forked from eatvio/eatvio_app
fix: remove ignored files
This commit is contained in:
@@ -1,242 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'badge_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
BadgeModel _$BadgeModelFromJson(Map<String, dynamic> json) {
|
||||
return _BadgeModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$BadgeModel {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get title => throw _privateConstructorUsedError;
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
String get image => throw _privateConstructorUsedError;
|
||||
String get type => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this BadgeModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of BadgeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$BadgeModelCopyWith<BadgeModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $BadgeModelCopyWith<$Res> {
|
||||
factory $BadgeModelCopyWith(
|
||||
BadgeModel value, $Res Function(BadgeModel) then) =
|
||||
_$BadgeModelCopyWithImpl<$Res, BadgeModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id, String title, String description, String image, String type});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$BadgeModelCopyWithImpl<$Res, $Val extends BadgeModel>
|
||||
implements $BadgeModelCopyWith<$Res> {
|
||||
_$BadgeModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of BadgeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? title = null,
|
||||
Object? description = null,
|
||||
Object? image = null,
|
||||
Object? type = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
title: null == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
description: null == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
image: null == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
type: null == type
|
||||
? _value.type
|
||||
: type // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$BadgeModelImplCopyWith<$Res>
|
||||
implements $BadgeModelCopyWith<$Res> {
|
||||
factory _$$BadgeModelImplCopyWith(
|
||||
_$BadgeModelImpl value, $Res Function(_$BadgeModelImpl) then) =
|
||||
__$$BadgeModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id, String title, String description, String image, String type});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$BadgeModelImplCopyWithImpl<$Res>
|
||||
extends _$BadgeModelCopyWithImpl<$Res, _$BadgeModelImpl>
|
||||
implements _$$BadgeModelImplCopyWith<$Res> {
|
||||
__$$BadgeModelImplCopyWithImpl(
|
||||
_$BadgeModelImpl _value, $Res Function(_$BadgeModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of BadgeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? title = null,
|
||||
Object? description = null,
|
||||
Object? image = null,
|
||||
Object? type = null,
|
||||
}) {
|
||||
return _then(_$BadgeModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
title: null == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
description: null == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
image: null == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
type: null == type
|
||||
? _value.type
|
||||
: type // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$BadgeModelImpl implements _BadgeModel {
|
||||
const _$BadgeModelImpl(
|
||||
{required this.id,
|
||||
required this.title,
|
||||
required this.description,
|
||||
required this.image,
|
||||
required this.type});
|
||||
|
||||
factory _$BadgeModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$BadgeModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
final String title;
|
||||
@override
|
||||
final String description;
|
||||
@override
|
||||
final String image;
|
||||
@override
|
||||
final String type;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BadgeModel(id: $id, title: $title, description: $description, image: $image, type: $type)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$BadgeModelImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.title, title) || other.title == title) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
(identical(other.image, image) || other.image == image) &&
|
||||
(identical(other.type, type) || other.type == type));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, id, title, description, image, type);
|
||||
|
||||
/// Create a copy of BadgeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$BadgeModelImplCopyWith<_$BadgeModelImpl> get copyWith =>
|
||||
__$$BadgeModelImplCopyWithImpl<_$BadgeModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$BadgeModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _BadgeModel implements BadgeModel {
|
||||
const factory _BadgeModel(
|
||||
{required final int id,
|
||||
required final String title,
|
||||
required final String description,
|
||||
required final String image,
|
||||
required final String type}) = _$BadgeModelImpl;
|
||||
|
||||
factory _BadgeModel.fromJson(Map<String, dynamic> json) =
|
||||
_$BadgeModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
String get title;
|
||||
@override
|
||||
String get description;
|
||||
@override
|
||||
String get image;
|
||||
@override
|
||||
String get type;
|
||||
|
||||
/// Create a copy of BadgeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$BadgeModelImplCopyWith<_$BadgeModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'badge_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$BadgeModelImpl _$$BadgeModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$BadgeModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
title: json['title'] as String,
|
||||
description: json['description'] as String,
|
||||
image: json['image'] as String,
|
||||
type: json['type'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$BadgeModelImplToJson(_$BadgeModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'title': instance.title,
|
||||
'description': instance.description,
|
||||
'image': instance.image,
|
||||
'type': instance.type,
|
||||
};
|
||||
@@ -1,441 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'chosen_diets_pagination_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ChosenDietsPaginationModel _$ChosenDietsPaginationModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _ChosenDietsPaginationModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChosenDietsPaginationModel {
|
||||
@JsonKey(name: 'data')
|
||||
List<ChosenDietModel> get diets => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ChosenDietsPaginationModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ChosenDietsPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ChosenDietsPaginationModelCopyWith<ChosenDietsPaginationModel>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ChosenDietsPaginationModelCopyWith<$Res> {
|
||||
factory $ChosenDietsPaginationModelCopyWith(ChosenDietsPaginationModel value,
|
||||
$Res Function(ChosenDietsPaginationModel) then) =
|
||||
_$ChosenDietsPaginationModelCopyWithImpl<$Res,
|
||||
ChosenDietsPaginationModel>;
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'data') List<ChosenDietModel> diets});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ChosenDietsPaginationModelCopyWithImpl<$Res,
|
||||
$Val extends ChosenDietsPaginationModel>
|
||||
implements $ChosenDietsPaginationModelCopyWith<$Res> {
|
||||
_$ChosenDietsPaginationModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ChosenDietsPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? diets = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
diets: null == diets
|
||||
? _value.diets
|
||||
: diets // ignore: cast_nullable_to_non_nullable
|
||||
as List<ChosenDietModel>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChosenDietsPaginationModelImplCopyWith<$Res>
|
||||
implements $ChosenDietsPaginationModelCopyWith<$Res> {
|
||||
factory _$$ChosenDietsPaginationModelImplCopyWith(
|
||||
_$ChosenDietsPaginationModelImpl value,
|
||||
$Res Function(_$ChosenDietsPaginationModelImpl) then) =
|
||||
__$$ChosenDietsPaginationModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'data') List<ChosenDietModel> diets});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChosenDietsPaginationModelImplCopyWithImpl<$Res>
|
||||
extends _$ChosenDietsPaginationModelCopyWithImpl<$Res,
|
||||
_$ChosenDietsPaginationModelImpl>
|
||||
implements _$$ChosenDietsPaginationModelImplCopyWith<$Res> {
|
||||
__$$ChosenDietsPaginationModelImplCopyWithImpl(
|
||||
_$ChosenDietsPaginationModelImpl _value,
|
||||
$Res Function(_$ChosenDietsPaginationModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChosenDietsPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? diets = null,
|
||||
}) {
|
||||
return _then(_$ChosenDietsPaginationModelImpl(
|
||||
diets: null == diets
|
||||
? _value._diets
|
||||
: diets // ignore: cast_nullable_to_non_nullable
|
||||
as List<ChosenDietModel>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ChosenDietsPaginationModelImpl implements _ChosenDietsPaginationModel {
|
||||
_$ChosenDietsPaginationModelImpl(
|
||||
{@JsonKey(name: 'data') required final List<ChosenDietModel> diets})
|
||||
: _diets = diets;
|
||||
|
||||
factory _$ChosenDietsPaginationModelImpl.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$$ChosenDietsPaginationModelImplFromJson(json);
|
||||
|
||||
final List<ChosenDietModel> _diets;
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<ChosenDietModel> get diets {
|
||||
if (_diets is EqualUnmodifiableListView) return _diets;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_diets);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChosenDietsPaginationModel(diets: $diets)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChosenDietsPaginationModelImpl &&
|
||||
const DeepCollectionEquality().equals(other._diets, _diets));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, const DeepCollectionEquality().hash(_diets));
|
||||
|
||||
/// Create a copy of ChosenDietsPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChosenDietsPaginationModelImplCopyWith<_$ChosenDietsPaginationModelImpl>
|
||||
get copyWith => __$$ChosenDietsPaginationModelImplCopyWithImpl<
|
||||
_$ChosenDietsPaginationModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ChosenDietsPaginationModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ChosenDietsPaginationModel
|
||||
implements ChosenDietsPaginationModel {
|
||||
factory _ChosenDietsPaginationModel(
|
||||
{@JsonKey(name: 'data') required final List<ChosenDietModel> diets}) =
|
||||
_$ChosenDietsPaginationModelImpl;
|
||||
|
||||
factory _ChosenDietsPaginationModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ChosenDietsPaginationModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<ChosenDietModel> get diets;
|
||||
|
||||
/// Create a copy of ChosenDietsPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChosenDietsPaginationModelImplCopyWith<_$ChosenDietsPaginationModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
ChosenDietModel _$ChosenDietModelFromJson(Map<String, dynamic> json) {
|
||||
return _ChosenDietModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChosenDietModel {
|
||||
@JsonKey(name: 'id')
|
||||
int get chosenDietID => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'chosen_plan_id')
|
||||
int get chosenPlanId => throw _privateConstructorUsedError;
|
||||
@JsonKey()
|
||||
String get state => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'start_date', fromJson: parseDate)
|
||||
DateTime get startDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'diet', fromJson: _parseDietId)
|
||||
int? get dietId => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ChosenDietModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ChosenDietModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ChosenDietModelCopyWith<ChosenDietModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ChosenDietModelCopyWith<$Res> {
|
||||
factory $ChosenDietModelCopyWith(
|
||||
ChosenDietModel value, $Res Function(ChosenDietModel) then) =
|
||||
_$ChosenDietModelCopyWithImpl<$Res, ChosenDietModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'id') int chosenDietID,
|
||||
@JsonKey(name: 'chosen_plan_id') int chosenPlanId,
|
||||
@JsonKey() String state,
|
||||
@JsonKey(name: 'start_date', fromJson: parseDate) DateTime startDate,
|
||||
@JsonKey(name: 'diet', fromJson: _parseDietId) int? dietId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ChosenDietModelCopyWithImpl<$Res, $Val extends ChosenDietModel>
|
||||
implements $ChosenDietModelCopyWith<$Res> {
|
||||
_$ChosenDietModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ChosenDietModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? chosenDietID = null,
|
||||
Object? chosenPlanId = null,
|
||||
Object? state = null,
|
||||
Object? startDate = null,
|
||||
Object? dietId = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
chosenDietID: null == chosenDietID
|
||||
? _value.chosenDietID
|
||||
: chosenDietID // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
chosenPlanId: null == chosenPlanId
|
||||
? _value.chosenPlanId
|
||||
: chosenPlanId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
state: null == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
startDate: null == startDate
|
||||
? _value.startDate
|
||||
: startDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
dietId: freezed == dietId
|
||||
? _value.dietId
|
||||
: dietId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChosenDietModelImplCopyWith<$Res>
|
||||
implements $ChosenDietModelCopyWith<$Res> {
|
||||
factory _$$ChosenDietModelImplCopyWith(_$ChosenDietModelImpl value,
|
||||
$Res Function(_$ChosenDietModelImpl) then) =
|
||||
__$$ChosenDietModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'id') int chosenDietID,
|
||||
@JsonKey(name: 'chosen_plan_id') int chosenPlanId,
|
||||
@JsonKey() String state,
|
||||
@JsonKey(name: 'start_date', fromJson: parseDate) DateTime startDate,
|
||||
@JsonKey(name: 'diet', fromJson: _parseDietId) int? dietId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChosenDietModelImplCopyWithImpl<$Res>
|
||||
extends _$ChosenDietModelCopyWithImpl<$Res, _$ChosenDietModelImpl>
|
||||
implements _$$ChosenDietModelImplCopyWith<$Res> {
|
||||
__$$ChosenDietModelImplCopyWithImpl(
|
||||
_$ChosenDietModelImpl _value, $Res Function(_$ChosenDietModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChosenDietModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? chosenDietID = null,
|
||||
Object? chosenPlanId = null,
|
||||
Object? state = null,
|
||||
Object? startDate = null,
|
||||
Object? dietId = freezed,
|
||||
}) {
|
||||
return _then(_$ChosenDietModelImpl(
|
||||
chosenDietID: null == chosenDietID
|
||||
? _value.chosenDietID
|
||||
: chosenDietID // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
chosenPlanId: null == chosenPlanId
|
||||
? _value.chosenPlanId
|
||||
: chosenPlanId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
state: null == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
startDate: null == startDate
|
||||
? _value.startDate
|
||||
: startDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
dietId: freezed == dietId
|
||||
? _value.dietId
|
||||
: dietId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ChosenDietModelImpl implements _ChosenDietModel {
|
||||
_$ChosenDietModelImpl(
|
||||
{@JsonKey(name: 'id') required this.chosenDietID,
|
||||
@JsonKey(name: 'chosen_plan_id') required this.chosenPlanId,
|
||||
@JsonKey() required this.state,
|
||||
@JsonKey(name: 'start_date', fromJson: parseDate) required this.startDate,
|
||||
@JsonKey(name: 'diet', fromJson: _parseDietId) required this.dietId});
|
||||
|
||||
factory _$ChosenDietModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ChosenDietModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'id')
|
||||
final int chosenDietID;
|
||||
@override
|
||||
@JsonKey(name: 'chosen_plan_id')
|
||||
final int chosenPlanId;
|
||||
@override
|
||||
@JsonKey()
|
||||
final String state;
|
||||
@override
|
||||
@JsonKey(name: 'start_date', fromJson: parseDate)
|
||||
final DateTime startDate;
|
||||
@override
|
||||
@JsonKey(name: 'diet', fromJson: _parseDietId)
|
||||
final int? dietId;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChosenDietModel(chosenDietID: $chosenDietID, chosenPlanId: $chosenPlanId, state: $state, startDate: $startDate, dietId: $dietId)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChosenDietModelImpl &&
|
||||
(identical(other.chosenDietID, chosenDietID) ||
|
||||
other.chosenDietID == chosenDietID) &&
|
||||
(identical(other.chosenPlanId, chosenPlanId) ||
|
||||
other.chosenPlanId == chosenPlanId) &&
|
||||
(identical(other.state, state) || other.state == state) &&
|
||||
(identical(other.startDate, startDate) ||
|
||||
other.startDate == startDate) &&
|
||||
(identical(other.dietId, dietId) || other.dietId == dietId));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, chosenDietID, chosenPlanId, state, startDate, dietId);
|
||||
|
||||
/// Create a copy of ChosenDietModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChosenDietModelImplCopyWith<_$ChosenDietModelImpl> get copyWith =>
|
||||
__$$ChosenDietModelImplCopyWithImpl<_$ChosenDietModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ChosenDietModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ChosenDietModel implements ChosenDietModel {
|
||||
factory _ChosenDietModel(
|
||||
{@JsonKey(name: 'id') required final int chosenDietID,
|
||||
@JsonKey(name: 'chosen_plan_id') required final int chosenPlanId,
|
||||
@JsonKey() required final String state,
|
||||
@JsonKey(name: 'start_date', fromJson: parseDate)
|
||||
required final DateTime startDate,
|
||||
@JsonKey(name: 'diet', fromJson: _parseDietId)
|
||||
required final int? dietId}) = _$ChosenDietModelImpl;
|
||||
|
||||
factory _ChosenDietModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ChosenDietModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'id')
|
||||
int get chosenDietID;
|
||||
@override
|
||||
@JsonKey(name: 'chosen_plan_id')
|
||||
int get chosenPlanId;
|
||||
@override
|
||||
@JsonKey()
|
||||
String get state;
|
||||
@override
|
||||
@JsonKey(name: 'start_date', fromJson: parseDate)
|
||||
DateTime get startDate;
|
||||
@override
|
||||
@JsonKey(name: 'diet', fromJson: _parseDietId)
|
||||
int? get dietId;
|
||||
|
||||
/// Create a copy of ChosenDietModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChosenDietModelImplCopyWith<_$ChosenDietModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'chosen_diets_pagination_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ChosenDietsPaginationModelImpl _$$ChosenDietsPaginationModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ChosenDietsPaginationModelImpl(
|
||||
diets: (json['data'] as List<dynamic>)
|
||||
.map((e) => ChosenDietModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChosenDietsPaginationModelImplToJson(
|
||||
_$ChosenDietsPaginationModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.diets,
|
||||
};
|
||||
|
||||
_$ChosenDietModelImpl _$$ChosenDietModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ChosenDietModelImpl(
|
||||
chosenDietID: (json['id'] as num).toInt(),
|
||||
chosenPlanId: (json['chosen_plan_id'] as num).toInt(),
|
||||
state: json['state'] as String,
|
||||
startDate: parseDate(json['start_date'] as String),
|
||||
dietId: _parseDietId(json['diet']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChosenDietModelImplToJson(
|
||||
_$ChosenDietModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.chosenDietID,
|
||||
'chosen_plan_id': instance.chosenPlanId,
|
||||
'state': instance.state,
|
||||
'start_date': instance.startDate.toIso8601String(),
|
||||
'diet': instance.dietId,
|
||||
};
|
||||
@@ -1,319 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'circumference_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
CircumferenceModel _$CircumferenceModelFromJson(Map<String, dynamic> json) {
|
||||
return _CircumferenceModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CircumferenceModel {
|
||||
@JsonKey(name: "id")
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "user_id")
|
||||
int get userId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "chest_circumference")
|
||||
int get chestCircumference => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "waist_circumference")
|
||||
int get waistCircumference => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "hip_circumference")
|
||||
int get hipCircumference => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "updated_at")
|
||||
DateTime get updatedAt => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CircumferenceModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CircumferenceModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CircumferenceModelCopyWith<CircumferenceModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CircumferenceModelCopyWith<$Res> {
|
||||
factory $CircumferenceModelCopyWith(
|
||||
CircumferenceModel value, $Res Function(CircumferenceModel) then) =
|
||||
_$CircumferenceModelCopyWithImpl<$Res, CircumferenceModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "id") int id,
|
||||
@JsonKey(name: "user_id") int userId,
|
||||
@JsonKey(name: "chest_circumference") int chestCircumference,
|
||||
@JsonKey(name: "waist_circumference") int waistCircumference,
|
||||
@JsonKey(name: "hip_circumference") int hipCircumference,
|
||||
@JsonKey(name: "created_at") DateTime createdAt,
|
||||
@JsonKey(name: "updated_at") DateTime updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CircumferenceModelCopyWithImpl<$Res, $Val extends CircumferenceModel>
|
||||
implements $CircumferenceModelCopyWith<$Res> {
|
||||
_$CircumferenceModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CircumferenceModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? userId = null,
|
||||
Object? chestCircumference = null,
|
||||
Object? waistCircumference = null,
|
||||
Object? hipCircumference = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
userId: null == userId
|
||||
? _value.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
chestCircumference: null == chestCircumference
|
||||
? _value.chestCircumference
|
||||
: chestCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
waistCircumference: null == waistCircumference
|
||||
? _value.waistCircumference
|
||||
: waistCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
hipCircumference: null == hipCircumference
|
||||
? _value.hipCircumference
|
||||
: hipCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CircumferenceModelImplCopyWith<$Res>
|
||||
implements $CircumferenceModelCopyWith<$Res> {
|
||||
factory _$$CircumferenceModelImplCopyWith(_$CircumferenceModelImpl value,
|
||||
$Res Function(_$CircumferenceModelImpl) then) =
|
||||
__$$CircumferenceModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "id") int id,
|
||||
@JsonKey(name: "user_id") int userId,
|
||||
@JsonKey(name: "chest_circumference") int chestCircumference,
|
||||
@JsonKey(name: "waist_circumference") int waistCircumference,
|
||||
@JsonKey(name: "hip_circumference") int hipCircumference,
|
||||
@JsonKey(name: "created_at") DateTime createdAt,
|
||||
@JsonKey(name: "updated_at") DateTime updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CircumferenceModelImplCopyWithImpl<$Res>
|
||||
extends _$CircumferenceModelCopyWithImpl<$Res, _$CircumferenceModelImpl>
|
||||
implements _$$CircumferenceModelImplCopyWith<$Res> {
|
||||
__$$CircumferenceModelImplCopyWithImpl(_$CircumferenceModelImpl _value,
|
||||
$Res Function(_$CircumferenceModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CircumferenceModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? userId = null,
|
||||
Object? chestCircumference = null,
|
||||
Object? waistCircumference = null,
|
||||
Object? hipCircumference = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
}) {
|
||||
return _then(_$CircumferenceModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
userId: null == userId
|
||||
? _value.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
chestCircumference: null == chestCircumference
|
||||
? _value.chestCircumference
|
||||
: chestCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
waistCircumference: null == waistCircumference
|
||||
? _value.waistCircumference
|
||||
: waistCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
hipCircumference: null == hipCircumference
|
||||
? _value.hipCircumference
|
||||
: hipCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$CircumferenceModelImpl implements _CircumferenceModel {
|
||||
const _$CircumferenceModelImpl(
|
||||
{@JsonKey(name: "id") required this.id,
|
||||
@JsonKey(name: "user_id") required this.userId,
|
||||
@JsonKey(name: "chest_circumference") required this.chestCircumference,
|
||||
@JsonKey(name: "waist_circumference") required this.waistCircumference,
|
||||
@JsonKey(name: "hip_circumference") required this.hipCircumference,
|
||||
@JsonKey(name: "created_at") required this.createdAt,
|
||||
@JsonKey(name: "updated_at") required this.updatedAt});
|
||||
|
||||
factory _$CircumferenceModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CircumferenceModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
final int id;
|
||||
@override
|
||||
@JsonKey(name: "user_id")
|
||||
final int userId;
|
||||
@override
|
||||
@JsonKey(name: "chest_circumference")
|
||||
final int chestCircumference;
|
||||
@override
|
||||
@JsonKey(name: "waist_circumference")
|
||||
final int waistCircumference;
|
||||
@override
|
||||
@JsonKey(name: "hip_circumference")
|
||||
final int hipCircumference;
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
final DateTime createdAt;
|
||||
@override
|
||||
@JsonKey(name: "updated_at")
|
||||
final DateTime updatedAt;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CircumferenceModel(id: $id, userId: $userId, chestCircumference: $chestCircumference, waistCircumference: $waistCircumference, hipCircumference: $hipCircumference, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CircumferenceModelImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.userId, userId) || other.userId == userId) &&
|
||||
(identical(other.chestCircumference, chestCircumference) ||
|
||||
other.chestCircumference == chestCircumference) &&
|
||||
(identical(other.waistCircumference, waistCircumference) ||
|
||||
other.waistCircumference == waistCircumference) &&
|
||||
(identical(other.hipCircumference, hipCircumference) ||
|
||||
other.hipCircumference == hipCircumference) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, userId, chestCircumference,
|
||||
waistCircumference, hipCircumference, createdAt, updatedAt);
|
||||
|
||||
/// Create a copy of CircumferenceModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CircumferenceModelImplCopyWith<_$CircumferenceModelImpl> get copyWith =>
|
||||
__$$CircumferenceModelImplCopyWithImpl<_$CircumferenceModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$CircumferenceModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _CircumferenceModel implements CircumferenceModel {
|
||||
const factory _CircumferenceModel(
|
||||
{@JsonKey(name: "id") required final int id,
|
||||
@JsonKey(name: "user_id") required final int userId,
|
||||
@JsonKey(name: "chest_circumference")
|
||||
required final int chestCircumference,
|
||||
@JsonKey(name: "waist_circumference")
|
||||
required final int waistCircumference,
|
||||
@JsonKey(name: "hip_circumference") required final int hipCircumference,
|
||||
@JsonKey(name: "created_at") required final DateTime createdAt,
|
||||
@JsonKey(name: "updated_at")
|
||||
required final DateTime updatedAt}) = _$CircumferenceModelImpl;
|
||||
|
||||
factory _CircumferenceModel.fromJson(Map<String, dynamic> json) =
|
||||
_$CircumferenceModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
int get id;
|
||||
@override
|
||||
@JsonKey(name: "user_id")
|
||||
int get userId;
|
||||
@override
|
||||
@JsonKey(name: "chest_circumference")
|
||||
int get chestCircumference;
|
||||
@override
|
||||
@JsonKey(name: "waist_circumference")
|
||||
int get waistCircumference;
|
||||
@override
|
||||
@JsonKey(name: "hip_circumference")
|
||||
int get hipCircumference;
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt;
|
||||
@override
|
||||
@JsonKey(name: "updated_at")
|
||||
DateTime get updatedAt;
|
||||
|
||||
/// Create a copy of CircumferenceModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CircumferenceModelImplCopyWith<_$CircumferenceModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'circumference_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$CircumferenceModelImpl _$$CircumferenceModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CircumferenceModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
userId: (json['user_id'] as num).toInt(),
|
||||
chestCircumference: (json['chest_circumference'] as num).toInt(),
|
||||
waistCircumference: (json['waist_circumference'] as num).toInt(),
|
||||
hipCircumference: (json['hip_circumference'] as num).toInt(),
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
updatedAt: DateTime.parse(json['updated_at'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CircumferenceModelImplToJson(
|
||||
_$CircumferenceModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'user_id': instance.userId,
|
||||
'chest_circumference': instance.chestCircumference,
|
||||
'waist_circumference': instance.waistCircumference,
|
||||
'hip_circumference': instance.hipCircumference,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
'updated_at': instance.updatedAt.toIso8601String(),
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,205 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'profile_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ProfileModelImpl _$$ProfileModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ProfileModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
email: json['email'] as String,
|
||||
ratingPlace: (json['rating_place'] as num?)?.toInt(),
|
||||
emailVerifiedAt: json['email_verified_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['email_verified_at'] as String),
|
||||
createdAt: json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String),
|
||||
updatedAt: json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String),
|
||||
isPublicProfile: parseBool(json['is_public_profile']),
|
||||
isEntitySubscribedByMe: json['is_entity_subscribed_by_me'] as bool,
|
||||
slug: json['slug'] as String,
|
||||
profilePhotoUrl: json['profile_photo_url'] as String,
|
||||
roles: (json['roles'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
badges: (json['badges'] as List<dynamic>)
|
||||
.map((e) => BadgeModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
subscriptions: (json['subscriptions'] as List<dynamic>)
|
||||
.map((e) => ProfilePreviewModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
subscribers: (json['subscribers'] as List<dynamic>)
|
||||
.map((e) => ProfilePreviewModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
educationResource: json['education_resource'] == null
|
||||
? null
|
||||
: EducationModel.fromJson(
|
||||
json['education_resource'] as Map<String, dynamic>),
|
||||
diplomasAndCertificates: (json['cert_photos'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
DiplomasAndCertificatesModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ProfileModelImplToJson(_$ProfileModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'email': instance.email,
|
||||
'rating_place': instance.ratingPlace,
|
||||
'email_verified_at': instance.emailVerifiedAt?.toIso8601String(),
|
||||
'created_at': instance.createdAt?.toIso8601String(),
|
||||
'updated_at': instance.updatedAt?.toIso8601String(),
|
||||
'is_public_profile': instance.isPublicProfile,
|
||||
'is_entity_subscribed_by_me': instance.isEntitySubscribedByMe,
|
||||
'slug': instance.slug,
|
||||
'profile_photo_url': instance.profilePhotoUrl,
|
||||
'roles': instance.roles,
|
||||
'badges': instance.badges,
|
||||
'subscriptions': instance.subscriptions,
|
||||
'subscribers': instance.subscribers,
|
||||
'education_resource': instance.educationResource,
|
||||
'cert_photos': instance.diplomasAndCertificates,
|
||||
};
|
||||
|
||||
_$DiplomasAndCertificatesModelImpl _$$DiplomasAndCertificatesModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$DiplomasAndCertificatesModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
path: json['path'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DiplomasAndCertificatesModelImplToJson(
|
||||
_$DiplomasAndCertificatesModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'path': instance.path,
|
||||
};
|
||||
|
||||
_$EducationModelImpl _$$EducationModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$EducationModelImpl(
|
||||
hasMedicalEducation: (json['has_medical_education'] as num?)?.toInt(),
|
||||
completedCourses: (json['completed_cources'] as List<dynamic>?)
|
||||
?.map((e) => (e as Map<String, dynamic>).map(
|
||||
(k, e) => MapEntry(k,
|
||||
CompletedCoursesModel.fromJson(e as Map<String, dynamic>)),
|
||||
))
|
||||
.toList(),
|
||||
vkLink: json['vk_link'] as String?,
|
||||
instaLink: json['insta_link'] as String?,
|
||||
fbLink: json['fb_link'] as String?,
|
||||
tgLink: json['tg_link'] as String?,
|
||||
personalSiteLink: json['personal_site_link'] as String?,
|
||||
requestState: json['request_state'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$EducationModelImplToJson(
|
||||
_$EducationModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'has_medical_education': instance.hasMedicalEducation,
|
||||
'completed_cources': instance.completedCourses,
|
||||
'vk_link': instance.vkLink,
|
||||
'insta_link': instance.instaLink,
|
||||
'fb_link': instance.fbLink,
|
||||
'tg_link': instance.tgLink,
|
||||
'personal_site_link': instance.personalSiteLink,
|
||||
'request_state': instance.requestState,
|
||||
};
|
||||
|
||||
_$CompletedCoursesModelImpl _$$CompletedCoursesModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CompletedCoursesModelImpl(
|
||||
date: json['date'] as String,
|
||||
title: json['title'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CompletedCoursesModelImplToJson(
|
||||
_$CompletedCoursesModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'date': instance.date,
|
||||
'title': instance.title,
|
||||
};
|
||||
|
||||
_$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ProfileDetailsModelImpl(
|
||||
firstName: json['first_name'] as String,
|
||||
lastName: json['last_name'] as String,
|
||||
birthdate: json['birthdate'] as String,
|
||||
gender: json['gender'] as String,
|
||||
country: json['country'] as String,
|
||||
city: json['city'] as String,
|
||||
lang: json['lang'] as String,
|
||||
weight: (json['weight'] as num).toDouble(),
|
||||
height: (json['height'] as num).toInt(),
|
||||
chestCircumference: (json['chest_circumference'] as num).toInt(),
|
||||
waistCircumference: (json['waist_circumference'] as num).toInt(),
|
||||
hipCircumference: (json['hip_circumference'] as num).toInt(),
|
||||
bloodPressureUp: (json['blood_pressure_up'] as num).toInt(),
|
||||
bloodPressureDown: (json['blood_pressure_down'] as num).toInt(),
|
||||
hasHypo: json['has_hypo'] as bool,
|
||||
hasHyper: json['has_hyper'] as bool,
|
||||
aboutAlergy: json['about_alergy'] as String,
|
||||
aboutTakingPils: json['about_taking_pils'] as String,
|
||||
aboutSportHobbies: json['about_sport_hobbies'] as String,
|
||||
favoriteFoods: json['favorite_foods'] as String,
|
||||
unfavoriteFoods: json['unfavorite_foods'] as String,
|
||||
additionalInfo: json['additional_info'] as String,
|
||||
createdAt: json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String),
|
||||
updatedAt: json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String),
|
||||
isMoodFillable: json['is_mood_fillable'] as bool,
|
||||
isBedtimeFillable: json['is_bedtime_fillable'] as bool,
|
||||
activityCoefficient: (json['activity_coefficient'] as num).toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ProfileDetailsModelImplToJson(
|
||||
_$ProfileDetailsModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'birthdate': instance.birthdate,
|
||||
'gender': instance.gender,
|
||||
'country': instance.country,
|
||||
'city': instance.city,
|
||||
'lang': instance.lang,
|
||||
'weight': instance.weight,
|
||||
'height': instance.height,
|
||||
'chest_circumference': instance.chestCircumference,
|
||||
'waist_circumference': instance.waistCircumference,
|
||||
'hip_circumference': instance.hipCircumference,
|
||||
'blood_pressure_up': instance.bloodPressureUp,
|
||||
'blood_pressure_down': instance.bloodPressureDown,
|
||||
'has_hypo': instance.hasHypo,
|
||||
'has_hyper': instance.hasHyper,
|
||||
'about_alergy': instance.aboutAlergy,
|
||||
'about_taking_pils': instance.aboutTakingPils,
|
||||
'about_sport_hobbies': instance.aboutSportHobbies,
|
||||
'favorite_foods': instance.favoriteFoods,
|
||||
'unfavorite_foods': instance.unfavoriteFoods,
|
||||
'additional_info': instance.additionalInfo,
|
||||
'created_at': instance.createdAt?.toIso8601String(),
|
||||
'updated_at': instance.updatedAt?.toIso8601String(),
|
||||
'is_mood_fillable': instance.isMoodFillable,
|
||||
'is_bedtime_fillable': instance.isBedtimeFillable,
|
||||
'activity_coefficient': instance.activityCoefficient,
|
||||
};
|
||||
|
||||
_$ProfilePreviewModelImpl _$$ProfilePreviewModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ProfilePreviewModelImpl(
|
||||
profilePhotoUrl: json['profile_photo_url'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ProfilePreviewModelImplToJson(
|
||||
_$ProfilePreviewModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'profile_photo_url': instance.profilePhotoUrl,
|
||||
};
|
||||
@@ -1,648 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'sub_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
SubPaginationModel _$SubPaginationModelFromJson(Map<String, dynamic> json) {
|
||||
return _SubPaginationModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SubPaginationModel {
|
||||
List<SubModel> get data => throw _privateConstructorUsedError;
|
||||
Links get links => throw _privateConstructorUsedError;
|
||||
Meta get meta => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this SubPaginationModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of SubPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$SubPaginationModelCopyWith<SubPaginationModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $SubPaginationModelCopyWith<$Res> {
|
||||
factory $SubPaginationModelCopyWith(
|
||||
SubPaginationModel value, $Res Function(SubPaginationModel) then) =
|
||||
_$SubPaginationModelCopyWithImpl<$Res, SubPaginationModel>;
|
||||
@useResult
|
||||
$Res call({List<SubModel> data, Links links, Meta meta});
|
||||
|
||||
$LinksCopyWith<$Res> get links;
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$SubPaginationModelCopyWithImpl<$Res, $Val extends SubPaginationModel>
|
||||
implements $SubPaginationModelCopyWith<$Res> {
|
||||
_$SubPaginationModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of SubPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? data = null,
|
||||
Object? links = null,
|
||||
Object? meta = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
data: null == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as List<SubModel>,
|
||||
links: null == links
|
||||
? _value.links
|
||||
: links // ignore: cast_nullable_to_non_nullable
|
||||
as Links,
|
||||
meta: null == meta
|
||||
? _value.meta
|
||||
: meta // ignore: cast_nullable_to_non_nullable
|
||||
as Meta,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of SubPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$LinksCopyWith<$Res> get links {
|
||||
return $LinksCopyWith<$Res>(_value.links, (value) {
|
||||
return _then(_value.copyWith(links: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of SubPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$MetaCopyWith<$Res> get meta {
|
||||
return $MetaCopyWith<$Res>(_value.meta, (value) {
|
||||
return _then(_value.copyWith(meta: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SubPaginationModelImplCopyWith<$Res>
|
||||
implements $SubPaginationModelCopyWith<$Res> {
|
||||
factory _$$SubPaginationModelImplCopyWith(_$SubPaginationModelImpl value,
|
||||
$Res Function(_$SubPaginationModelImpl) then) =
|
||||
__$$SubPaginationModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({List<SubModel> data, Links links, Meta meta});
|
||||
|
||||
@override
|
||||
$LinksCopyWith<$Res> get links;
|
||||
@override
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SubPaginationModelImplCopyWithImpl<$Res>
|
||||
extends _$SubPaginationModelCopyWithImpl<$Res, _$SubPaginationModelImpl>
|
||||
implements _$$SubPaginationModelImplCopyWith<$Res> {
|
||||
__$$SubPaginationModelImplCopyWithImpl(_$SubPaginationModelImpl _value,
|
||||
$Res Function(_$SubPaginationModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SubPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? data = null,
|
||||
Object? links = null,
|
||||
Object? meta = null,
|
||||
}) {
|
||||
return _then(_$SubPaginationModelImpl(
|
||||
data: null == data
|
||||
? _value._data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as List<SubModel>,
|
||||
links: null == links
|
||||
? _value.links
|
||||
: links // ignore: cast_nullable_to_non_nullable
|
||||
as Links,
|
||||
meta: null == meta
|
||||
? _value.meta
|
||||
: meta // ignore: cast_nullable_to_non_nullable
|
||||
as Meta,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$SubPaginationModelImpl implements _SubPaginationModel {
|
||||
const _$SubPaginationModelImpl(
|
||||
{required final List<SubModel> data,
|
||||
required this.links,
|
||||
required this.meta})
|
||||
: _data = data;
|
||||
|
||||
factory _$SubPaginationModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$SubPaginationModelImplFromJson(json);
|
||||
|
||||
final List<SubModel> _data;
|
||||
@override
|
||||
List<SubModel> get data {
|
||||
if (_data is EqualUnmodifiableListView) return _data;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_data);
|
||||
}
|
||||
|
||||
@override
|
||||
final Links links;
|
||||
@override
|
||||
final Meta meta;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubPaginationModel(data: $data, links: $links, meta: $meta)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$SubPaginationModelImpl &&
|
||||
const DeepCollectionEquality().equals(other._data, _data) &&
|
||||
(identical(other.links, links) || other.links == links) &&
|
||||
(identical(other.meta, meta) || other.meta == meta));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_data), links, meta);
|
||||
|
||||
/// Create a copy of SubPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$SubPaginationModelImplCopyWith<_$SubPaginationModelImpl> get copyWith =>
|
||||
__$$SubPaginationModelImplCopyWithImpl<_$SubPaginationModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$SubPaginationModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _SubPaginationModel implements SubPaginationModel {
|
||||
const factory _SubPaginationModel(
|
||||
{required final List<SubModel> data,
|
||||
required final Links links,
|
||||
required final Meta meta}) = _$SubPaginationModelImpl;
|
||||
|
||||
factory _SubPaginationModel.fromJson(Map<String, dynamic> json) =
|
||||
_$SubPaginationModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
List<SubModel> get data;
|
||||
@override
|
||||
Links get links;
|
||||
@override
|
||||
Meta get meta;
|
||||
|
||||
/// Create a copy of SubPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$SubPaginationModelImplCopyWith<_$SubPaginationModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
SubModel _$SubModelFromJson(Map<String, dynamic> json) {
|
||||
return _SubModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SubModel {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get slug => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String get city => throw _privateConstructorUsedError;
|
||||
DateTime get birthdate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_entity_subscribed_by_me')
|
||||
bool get isEntitySubscribedByMe => throw _privateConstructorUsedError;
|
||||
String get email => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
String get profilePhotoUrl => throw _privateConstructorUsedError;
|
||||
String get role => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_public_profile')
|
||||
bool get isPublicProfile => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'updated_at')
|
||||
DateTime get updatedAt => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this SubModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of SubModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$SubModelCopyWith<SubModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $SubModelCopyWith<$Res> {
|
||||
factory $SubModelCopyWith(SubModel value, $Res Function(SubModel) then) =
|
||||
_$SubModelCopyWithImpl<$Res, SubModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String slug,
|
||||
String name,
|
||||
String city,
|
||||
DateTime birthdate,
|
||||
@JsonKey(name: 'is_entity_subscribed_by_me') bool isEntitySubscribedByMe,
|
||||
String email,
|
||||
@JsonKey(name: 'profile_photo_url') String profilePhotoUrl,
|
||||
String role,
|
||||
@JsonKey(name: 'is_public_profile') bool isPublicProfile,
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$SubModelCopyWithImpl<$Res, $Val extends SubModel>
|
||||
implements $SubModelCopyWith<$Res> {
|
||||
_$SubModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of SubModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? slug = null,
|
||||
Object? name = null,
|
||||
Object? city = null,
|
||||
Object? birthdate = null,
|
||||
Object? isEntitySubscribedByMe = null,
|
||||
Object? email = null,
|
||||
Object? profilePhotoUrl = null,
|
||||
Object? role = null,
|
||||
Object? isPublicProfile = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
slug: null == slug
|
||||
? _value.slug
|
||||
: slug // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
city: null == city
|
||||
? _value.city
|
||||
: city // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
birthdate: null == birthdate
|
||||
? _value.birthdate
|
||||
: birthdate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
isEntitySubscribedByMe: null == isEntitySubscribedByMe
|
||||
? _value.isEntitySubscribedByMe
|
||||
: isEntitySubscribedByMe // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
email: null == email
|
||||
? _value.email
|
||||
: email // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
profilePhotoUrl: null == profilePhotoUrl
|
||||
? _value.profilePhotoUrl
|
||||
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
role: null == role
|
||||
? _value.role
|
||||
: role // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
isPublicProfile: null == isPublicProfile
|
||||
? _value.isPublicProfile
|
||||
: isPublicProfile // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SubModelImplCopyWith<$Res>
|
||||
implements $SubModelCopyWith<$Res> {
|
||||
factory _$$SubModelImplCopyWith(
|
||||
_$SubModelImpl value, $Res Function(_$SubModelImpl) then) =
|
||||
__$$SubModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String slug,
|
||||
String name,
|
||||
String city,
|
||||
DateTime birthdate,
|
||||
@JsonKey(name: 'is_entity_subscribed_by_me') bool isEntitySubscribedByMe,
|
||||
String email,
|
||||
@JsonKey(name: 'profile_photo_url') String profilePhotoUrl,
|
||||
String role,
|
||||
@JsonKey(name: 'is_public_profile') bool isPublicProfile,
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SubModelImplCopyWithImpl<$Res>
|
||||
extends _$SubModelCopyWithImpl<$Res, _$SubModelImpl>
|
||||
implements _$$SubModelImplCopyWith<$Res> {
|
||||
__$$SubModelImplCopyWithImpl(
|
||||
_$SubModelImpl _value, $Res Function(_$SubModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SubModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? slug = null,
|
||||
Object? name = null,
|
||||
Object? city = null,
|
||||
Object? birthdate = null,
|
||||
Object? isEntitySubscribedByMe = null,
|
||||
Object? email = null,
|
||||
Object? profilePhotoUrl = null,
|
||||
Object? role = null,
|
||||
Object? isPublicProfile = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
}) {
|
||||
return _then(_$SubModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
slug: null == slug
|
||||
? _value.slug
|
||||
: slug // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
city: null == city
|
||||
? _value.city
|
||||
: city // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
birthdate: null == birthdate
|
||||
? _value.birthdate
|
||||
: birthdate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
isEntitySubscribedByMe: null == isEntitySubscribedByMe
|
||||
? _value.isEntitySubscribedByMe
|
||||
: isEntitySubscribedByMe // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
email: null == email
|
||||
? _value.email
|
||||
: email // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
profilePhotoUrl: null == profilePhotoUrl
|
||||
? _value.profilePhotoUrl
|
||||
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
role: null == role
|
||||
? _value.role
|
||||
: role // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
isPublicProfile: null == isPublicProfile
|
||||
? _value.isPublicProfile
|
||||
: isPublicProfile // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$SubModelImpl implements _SubModel {
|
||||
const _$SubModelImpl(
|
||||
{required this.id,
|
||||
required this.slug,
|
||||
required this.name,
|
||||
required this.city,
|
||||
required this.birthdate,
|
||||
@JsonKey(name: 'is_entity_subscribed_by_me')
|
||||
required this.isEntitySubscribedByMe,
|
||||
required this.email,
|
||||
@JsonKey(name: 'profile_photo_url') required this.profilePhotoUrl,
|
||||
required this.role,
|
||||
@JsonKey(name: 'is_public_profile') required this.isPublicProfile,
|
||||
@JsonKey(name: 'created_at') required this.createdAt,
|
||||
@JsonKey(name: 'updated_at') required this.updatedAt});
|
||||
|
||||
factory _$SubModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$SubModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
final String slug;
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
final String city;
|
||||
@override
|
||||
final DateTime birthdate;
|
||||
@override
|
||||
@JsonKey(name: 'is_entity_subscribed_by_me')
|
||||
final bool isEntitySubscribedByMe;
|
||||
@override
|
||||
final String email;
|
||||
@override
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
final String profilePhotoUrl;
|
||||
@override
|
||||
final String role;
|
||||
@override
|
||||
@JsonKey(name: 'is_public_profile')
|
||||
final bool isPublicProfile;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
final DateTime createdAt;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
final DateTime updatedAt;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubModel(id: $id, slug: $slug, name: $name, city: $city, birthdate: $birthdate, isEntitySubscribedByMe: $isEntitySubscribedByMe, email: $email, profilePhotoUrl: $profilePhotoUrl, role: $role, isPublicProfile: $isPublicProfile, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$SubModelImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.slug, slug) || other.slug == slug) &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.city, city) || other.city == city) &&
|
||||
(identical(other.birthdate, birthdate) ||
|
||||
other.birthdate == birthdate) &&
|
||||
(identical(other.isEntitySubscribedByMe, isEntitySubscribedByMe) ||
|
||||
other.isEntitySubscribedByMe == isEntitySubscribedByMe) &&
|
||||
(identical(other.email, email) || other.email == email) &&
|
||||
(identical(other.profilePhotoUrl, profilePhotoUrl) ||
|
||||
other.profilePhotoUrl == profilePhotoUrl) &&
|
||||
(identical(other.role, role) || other.role == role) &&
|
||||
(identical(other.isPublicProfile, isPublicProfile) ||
|
||||
other.isPublicProfile == isPublicProfile) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
slug,
|
||||
name,
|
||||
city,
|
||||
birthdate,
|
||||
isEntitySubscribedByMe,
|
||||
email,
|
||||
profilePhotoUrl,
|
||||
role,
|
||||
isPublicProfile,
|
||||
createdAt,
|
||||
updatedAt);
|
||||
|
||||
/// Create a copy of SubModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$SubModelImplCopyWith<_$SubModelImpl> get copyWith =>
|
||||
__$$SubModelImplCopyWithImpl<_$SubModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$SubModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _SubModel implements SubModel {
|
||||
const factory _SubModel(
|
||||
{required final int id,
|
||||
required final String slug,
|
||||
required final String name,
|
||||
required final String city,
|
||||
required final DateTime birthdate,
|
||||
@JsonKey(name: 'is_entity_subscribed_by_me')
|
||||
required final bool isEntitySubscribedByMe,
|
||||
required final String email,
|
||||
@JsonKey(name: 'profile_photo_url') required final String profilePhotoUrl,
|
||||
required final String role,
|
||||
@JsonKey(name: 'is_public_profile') required final bool isPublicProfile,
|
||||
@JsonKey(name: 'created_at') required final DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at')
|
||||
required final DateTime updatedAt}) = _$SubModelImpl;
|
||||
|
||||
factory _SubModel.fromJson(Map<String, dynamic> json) =
|
||||
_$SubModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
String get slug;
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
String get city;
|
||||
@override
|
||||
DateTime get birthdate;
|
||||
@override
|
||||
@JsonKey(name: 'is_entity_subscribed_by_me')
|
||||
bool get isEntitySubscribedByMe;
|
||||
@override
|
||||
String get email;
|
||||
@override
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
String get profilePhotoUrl;
|
||||
@override
|
||||
String get role;
|
||||
@override
|
||||
@JsonKey(name: 'is_public_profile')
|
||||
bool get isPublicProfile;
|
||||
@override
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime get createdAt;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
DateTime get updatedAt;
|
||||
|
||||
/// Create a copy of SubModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$SubModelImplCopyWith<_$SubModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'sub_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$SubPaginationModelImpl _$$SubPaginationModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$SubPaginationModelImpl(
|
||||
data: (json['data'] as List<dynamic>)
|
||||
.map((e) => SubModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
links: Links.fromJson(json['links'] as Map<String, dynamic>),
|
||||
meta: Meta.fromJson(json['meta'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$SubPaginationModelImplToJson(
|
||||
_$SubPaginationModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.data,
|
||||
'links': instance.links,
|
||||
'meta': instance.meta,
|
||||
};
|
||||
|
||||
_$SubModelImpl _$$SubModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$SubModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
slug: json['slug'] as String,
|
||||
name: json['name'] as String,
|
||||
city: json['city'] as String,
|
||||
birthdate: DateTime.parse(json['birthdate'] as String),
|
||||
isEntitySubscribedByMe: json['is_entity_subscribed_by_me'] as bool,
|
||||
email: json['email'] as String,
|
||||
profilePhotoUrl: json['profile_photo_url'] as String,
|
||||
role: json['role'] as String,
|
||||
isPublicProfile: json['is_public_profile'] as bool,
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
updatedAt: DateTime.parse(json['updated_at'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$SubModelImplToJson(_$SubModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'slug': instance.slug,
|
||||
'name': instance.name,
|
||||
'city': instance.city,
|
||||
'birthdate': instance.birthdate.toIso8601String(),
|
||||
'is_entity_subscribed_by_me': instance.isEntitySubscribedByMe,
|
||||
'email': instance.email,
|
||||
'profile_photo_url': instance.profilePhotoUrl,
|
||||
'role': instance.role,
|
||||
'is_public_profile': instance.isPublicProfile,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
'updated_at': instance.updatedAt.toIso8601String(),
|
||||
};
|
||||
@@ -1,289 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'weight_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
WeightModel _$WeightModelFromJson(Map<String, dynamic> json) {
|
||||
return _WeightModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$WeightModel {
|
||||
@JsonKey(name: "id")
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "user_id")
|
||||
int get userId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "weight")
|
||||
int get weight => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "updated_at")
|
||||
DateTime get updatedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "bmi")
|
||||
double get bmi => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this WeightModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of WeightModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$WeightModelCopyWith<WeightModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $WeightModelCopyWith<$Res> {
|
||||
factory $WeightModelCopyWith(
|
||||
WeightModel value, $Res Function(WeightModel) then) =
|
||||
_$WeightModelCopyWithImpl<$Res, WeightModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "id") int id,
|
||||
@JsonKey(name: "user_id") int userId,
|
||||
@JsonKey(name: "weight") int weight,
|
||||
@JsonKey(name: "created_at") DateTime createdAt,
|
||||
@JsonKey(name: "updated_at") DateTime updatedAt,
|
||||
@JsonKey(name: "bmi") double bmi});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$WeightModelCopyWithImpl<$Res, $Val extends WeightModel>
|
||||
implements $WeightModelCopyWith<$Res> {
|
||||
_$WeightModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of WeightModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? userId = null,
|
||||
Object? weight = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
Object? bmi = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
userId: null == userId
|
||||
? _value.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
weight: null == weight
|
||||
? _value.weight
|
||||
: weight // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
bmi: null == bmi
|
||||
? _value.bmi
|
||||
: bmi // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$WeightModelImplCopyWith<$Res>
|
||||
implements $WeightModelCopyWith<$Res> {
|
||||
factory _$$WeightModelImplCopyWith(
|
||||
_$WeightModelImpl value, $Res Function(_$WeightModelImpl) then) =
|
||||
__$$WeightModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "id") int id,
|
||||
@JsonKey(name: "user_id") int userId,
|
||||
@JsonKey(name: "weight") int weight,
|
||||
@JsonKey(name: "created_at") DateTime createdAt,
|
||||
@JsonKey(name: "updated_at") DateTime updatedAt,
|
||||
@JsonKey(name: "bmi") double bmi});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$WeightModelImplCopyWithImpl<$Res>
|
||||
extends _$WeightModelCopyWithImpl<$Res, _$WeightModelImpl>
|
||||
implements _$$WeightModelImplCopyWith<$Res> {
|
||||
__$$WeightModelImplCopyWithImpl(
|
||||
_$WeightModelImpl _value, $Res Function(_$WeightModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of WeightModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? userId = null,
|
||||
Object? weight = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
Object? bmi = null,
|
||||
}) {
|
||||
return _then(_$WeightModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
userId: null == userId
|
||||
? _value.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
weight: null == weight
|
||||
? _value.weight
|
||||
: weight // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
bmi: null == bmi
|
||||
? _value.bmi
|
||||
: bmi // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$WeightModelImpl implements _WeightModel {
|
||||
const _$WeightModelImpl(
|
||||
{@JsonKey(name: "id") required this.id,
|
||||
@JsonKey(name: "user_id") required this.userId,
|
||||
@JsonKey(name: "weight") required this.weight,
|
||||
@JsonKey(name: "created_at") required this.createdAt,
|
||||
@JsonKey(name: "updated_at") required this.updatedAt,
|
||||
@JsonKey(name: "bmi") required this.bmi});
|
||||
|
||||
factory _$WeightModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$WeightModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
final int id;
|
||||
@override
|
||||
@JsonKey(name: "user_id")
|
||||
final int userId;
|
||||
@override
|
||||
@JsonKey(name: "weight")
|
||||
final int weight;
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
final DateTime createdAt;
|
||||
@override
|
||||
@JsonKey(name: "updated_at")
|
||||
final DateTime updatedAt;
|
||||
@override
|
||||
@JsonKey(name: "bmi")
|
||||
final double bmi;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'WeightModel(id: $id, userId: $userId, weight: $weight, createdAt: $createdAt, updatedAt: $updatedAt, bmi: $bmi)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$WeightModelImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.userId, userId) || other.userId == userId) &&
|
||||
(identical(other.weight, weight) || other.weight == weight) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt) &&
|
||||
(identical(other.bmi, bmi) || other.bmi == bmi));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, id, userId, weight, createdAt, updatedAt, bmi);
|
||||
|
||||
/// Create a copy of WeightModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$WeightModelImplCopyWith<_$WeightModelImpl> get copyWith =>
|
||||
__$$WeightModelImplCopyWithImpl<_$WeightModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$WeightModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _WeightModel implements WeightModel {
|
||||
const factory _WeightModel(
|
||||
{@JsonKey(name: "id") required final int id,
|
||||
@JsonKey(name: "user_id") required final int userId,
|
||||
@JsonKey(name: "weight") required final int weight,
|
||||
@JsonKey(name: "created_at") required final DateTime createdAt,
|
||||
@JsonKey(name: "updated_at") required final DateTime updatedAt,
|
||||
@JsonKey(name: "bmi") required final double bmi}) = _$WeightModelImpl;
|
||||
|
||||
factory _WeightModel.fromJson(Map<String, dynamic> json) =
|
||||
_$WeightModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
int get id;
|
||||
@override
|
||||
@JsonKey(name: "user_id")
|
||||
int get userId;
|
||||
@override
|
||||
@JsonKey(name: "weight")
|
||||
int get weight;
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt;
|
||||
@override
|
||||
@JsonKey(name: "updated_at")
|
||||
DateTime get updatedAt;
|
||||
@override
|
||||
@JsonKey(name: "bmi")
|
||||
double get bmi;
|
||||
|
||||
/// Create a copy of WeightModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$WeightModelImplCopyWith<_$WeightModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'weight_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$WeightModelImpl _$$WeightModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$WeightModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
userId: (json['user_id'] as num).toInt(),
|
||||
weight: (json['weight'] as num).toInt(),
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
updatedAt: DateTime.parse(json['updated_at'] as String),
|
||||
bmi: (json['bmi'] as num).toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$WeightModelImplToJson(_$WeightModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'user_id': instance.userId,
|
||||
'weight': instance.weight,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
'updated_at': instance.updatedAt.toIso8601String(),
|
||||
'bmi': instance.bmi,
|
||||
};
|
||||
@@ -1,641 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'plans_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$PlansState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<PlanModel> plansList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<PlanModel> plansList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<PlanModel> plansList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_PlansState value) $default, {
|
||||
required TResult Function(PlansStateLoading value) loading,
|
||||
required TResult Function(PlansStateLoaded value) loaded,
|
||||
required TResult Function(PlansStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_PlansState value)? $default, {
|
||||
TResult? Function(PlansStateLoading value)? loading,
|
||||
TResult? Function(PlansStateLoaded value)? loaded,
|
||||
TResult? Function(PlansStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_PlansState value)? $default, {
|
||||
TResult Function(PlansStateLoading value)? loading,
|
||||
TResult Function(PlansStateLoaded value)? loaded,
|
||||
TResult Function(PlansStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $PlansStateCopyWith<$Res> {
|
||||
factory $PlansStateCopyWith(
|
||||
PlansState value, $Res Function(PlansState) then) =
|
||||
_$PlansStateCopyWithImpl<$Res, PlansState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState>
|
||||
implements $PlansStateCopyWith<$Res> {
|
||||
_$PlansStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of PlansState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$PlansStateImplCopyWith<$Res> {
|
||||
factory _$$PlansStateImplCopyWith(
|
||||
_$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) =
|
||||
__$$PlansStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$PlansStateImplCopyWithImpl<$Res>
|
||||
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl>
|
||||
implements _$$PlansStateImplCopyWith<$Res> {
|
||||
__$$PlansStateImplCopyWithImpl(
|
||||
_$PlansStateImpl _value, $Res Function(_$PlansStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of PlansState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$PlansStateImpl implements _PlansState {
|
||||
const _$PlansStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PlansState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$PlansStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<PlanModel> plansList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<PlanModel> plansList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<PlanModel> plansList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_PlansState value) $default, {
|
||||
required TResult Function(PlansStateLoading value) loading,
|
||||
required TResult Function(PlansStateLoaded value) loaded,
|
||||
required TResult Function(PlansStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_PlansState value)? $default, {
|
||||
TResult? Function(PlansStateLoading value)? loading,
|
||||
TResult? Function(PlansStateLoaded value)? loaded,
|
||||
TResult? Function(PlansStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_PlansState value)? $default, {
|
||||
TResult Function(PlansStateLoading value)? loading,
|
||||
TResult Function(PlansStateLoaded value)? loaded,
|
||||
TResult Function(PlansStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _PlansState implements PlansState {
|
||||
const factory _PlansState() = _$PlansStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$PlansStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$PlansStateLoadingImplCopyWith(_$PlansStateLoadingImpl value,
|
||||
$Res Function(_$PlansStateLoadingImpl) then) =
|
||||
__$$PlansStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$PlansStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadingImpl>
|
||||
implements _$$PlansStateLoadingImplCopyWith<$Res> {
|
||||
__$$PlansStateLoadingImplCopyWithImpl(_$PlansStateLoadingImpl _value,
|
||||
$Res Function(_$PlansStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of PlansState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$PlansStateLoadingImpl implements PlansStateLoading {
|
||||
const _$PlansStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PlansState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$PlansStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<PlanModel> plansList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<PlanModel> plansList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<PlanModel> plansList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_PlansState value) $default, {
|
||||
required TResult Function(PlansStateLoading value) loading,
|
||||
required TResult Function(PlansStateLoaded value) loaded,
|
||||
required TResult Function(PlansStateError value) error,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_PlansState value)? $default, {
|
||||
TResult? Function(PlansStateLoading value)? loading,
|
||||
TResult? Function(PlansStateLoaded value)? loaded,
|
||||
TResult? Function(PlansStateError value)? error,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_PlansState value)? $default, {
|
||||
TResult Function(PlansStateLoading value)? loading,
|
||||
TResult Function(PlansStateLoaded value)? loaded,
|
||||
TResult Function(PlansStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class PlansStateLoading implements PlansState {
|
||||
const factory PlansStateLoading() = _$PlansStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$PlansStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$PlansStateLoadedImplCopyWith(_$PlansStateLoadedImpl value,
|
||||
$Res Function(_$PlansStateLoadedImpl) then) =
|
||||
__$$PlansStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({List<PlanModel> plansList});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$PlansStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadedImpl>
|
||||
implements _$$PlansStateLoadedImplCopyWith<$Res> {
|
||||
__$$PlansStateLoadedImplCopyWithImpl(_$PlansStateLoadedImpl _value,
|
||||
$Res Function(_$PlansStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of PlansState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? plansList = null,
|
||||
}) {
|
||||
return _then(_$PlansStateLoadedImpl(
|
||||
plansList: null == plansList
|
||||
? _value._plansList
|
||||
: plansList // ignore: cast_nullable_to_non_nullable
|
||||
as List<PlanModel>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$PlansStateLoadedImpl implements PlansStateLoaded {
|
||||
const _$PlansStateLoadedImpl({required final List<PlanModel> plansList})
|
||||
: _plansList = plansList;
|
||||
|
||||
final List<PlanModel> _plansList;
|
||||
@override
|
||||
List<PlanModel> get plansList {
|
||||
if (_plansList is EqualUnmodifiableListView) return _plansList;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_plansList);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PlansState.loaded(plansList: $plansList)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$PlansStateLoadedImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._plansList, _plansList));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, const DeepCollectionEquality().hash(_plansList));
|
||||
|
||||
/// Create a copy of PlansState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith =>
|
||||
__$$PlansStateLoadedImplCopyWithImpl<_$PlansStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<PlanModel> plansList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loaded(plansList);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<PlanModel> plansList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loaded?.call(plansList);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<PlanModel> plansList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(plansList);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_PlansState value) $default, {
|
||||
required TResult Function(PlansStateLoading value) loading,
|
||||
required TResult Function(PlansStateLoaded value) loaded,
|
||||
required TResult Function(PlansStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_PlansState value)? $default, {
|
||||
TResult? Function(PlansStateLoading value)? loading,
|
||||
TResult? Function(PlansStateLoaded value)? loaded,
|
||||
TResult? Function(PlansStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_PlansState value)? $default, {
|
||||
TResult Function(PlansStateLoading value)? loading,
|
||||
TResult Function(PlansStateLoaded value)? loaded,
|
||||
TResult Function(PlansStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class PlansStateLoaded implements PlansState {
|
||||
const factory PlansStateLoaded({required final List<PlanModel> plansList}) =
|
||||
_$PlansStateLoadedImpl;
|
||||
|
||||
List<PlanModel> get plansList;
|
||||
|
||||
/// Create a copy of PlansState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$PlansStateErrorImplCopyWith<$Res> {
|
||||
factory _$$PlansStateErrorImplCopyWith(_$PlansStateErrorImpl value,
|
||||
$Res Function(_$PlansStateErrorImpl) then) =
|
||||
__$$PlansStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$PlansStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateErrorImpl>
|
||||
implements _$$PlansStateErrorImplCopyWith<$Res> {
|
||||
__$$PlansStateErrorImplCopyWithImpl(
|
||||
_$PlansStateErrorImpl _value, $Res Function(_$PlansStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of PlansState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$PlansStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$PlansStateErrorImpl implements PlansStateError {
|
||||
const _$PlansStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PlansState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$PlansStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of PlansState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith =>
|
||||
__$$PlansStateErrorImplCopyWithImpl<_$PlansStateErrorImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<PlanModel> plansList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<PlanModel> plansList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<PlanModel> plansList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_PlansState value) $default, {
|
||||
required TResult Function(PlansStateLoading value) loading,
|
||||
required TResult Function(PlansStateLoaded value) loaded,
|
||||
required TResult Function(PlansStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_PlansState value)? $default, {
|
||||
TResult? Function(PlansStateLoading value)? loading,
|
||||
TResult? Function(PlansStateLoaded value)? loaded,
|
||||
TResult? Function(PlansStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_PlansState value)? $default, {
|
||||
TResult Function(PlansStateLoading value)? loading,
|
||||
TResult Function(PlansStateLoaded value)? loaded,
|
||||
TResult Function(PlansStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class PlansStateError implements PlansState {
|
||||
const factory PlansStateError({required final String errorMessage}) =
|
||||
_$PlansStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of PlansState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,836 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'profile_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ProfileState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ProfileState value) $default, {
|
||||
required TResult Function(ProfileStateLoading value) loading,
|
||||
required TResult Function(ProfileStateLoaded value) loaded,
|
||||
required TResult Function(ProfileStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ProfileState value)? $default, {
|
||||
TResult? Function(ProfileStateLoading value)? loading,
|
||||
TResult? Function(ProfileStateLoaded value)? loaded,
|
||||
TResult? Function(ProfileStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ProfileState value)? $default, {
|
||||
TResult Function(ProfileStateLoading value)? loading,
|
||||
TResult Function(ProfileStateLoaded value)? loaded,
|
||||
TResult Function(ProfileStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ProfileStateCopyWith<$Res> {
|
||||
factory $ProfileStateCopyWith(
|
||||
ProfileState value, $Res Function(ProfileState) then) =
|
||||
_$ProfileStateCopyWithImpl<$Res, ProfileState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState>
|
||||
implements $ProfileStateCopyWith<$Res> {
|
||||
_$ProfileStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ProfileState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProfileStateImplCopyWith<$Res> {
|
||||
factory _$$ProfileStateImplCopyWith(
|
||||
_$ProfileStateImpl value, $Res Function(_$ProfileStateImpl) then) =
|
||||
__$$ProfileStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProfileStateImplCopyWithImpl<$Res>
|
||||
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateImpl>
|
||||
implements _$$ProfileStateImplCopyWith<$Res> {
|
||||
__$$ProfileStateImplCopyWithImpl(
|
||||
_$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ProfileState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ProfileStateImpl implements _ProfileState {
|
||||
const _$ProfileStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProfileState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$ProfileStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ProfileState value) $default, {
|
||||
required TResult Function(ProfileStateLoading value) loading,
|
||||
required TResult Function(ProfileStateLoaded value) loaded,
|
||||
required TResult Function(ProfileStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ProfileState value)? $default, {
|
||||
TResult? Function(ProfileStateLoading value)? loading,
|
||||
TResult? Function(ProfileStateLoaded value)? loaded,
|
||||
TResult? Function(ProfileStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ProfileState value)? $default, {
|
||||
TResult Function(ProfileStateLoading value)? loading,
|
||||
TResult Function(ProfileStateLoaded value)? loaded,
|
||||
TResult Function(ProfileStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ProfileState implements ProfileState {
|
||||
const factory _ProfileState() = _$ProfileStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProfileStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$ProfileStateLoadingImplCopyWith(_$ProfileStateLoadingImpl value,
|
||||
$Res Function(_$ProfileStateLoadingImpl) then) =
|
||||
__$$ProfileStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProfileStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadingImpl>
|
||||
implements _$$ProfileStateLoadingImplCopyWith<$Res> {
|
||||
__$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value,
|
||||
$Res Function(_$ProfileStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ProfileState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ProfileStateLoadingImpl implements ProfileStateLoading {
|
||||
const _$ProfileStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProfileState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ProfileStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ProfileState value) $default, {
|
||||
required TResult Function(ProfileStateLoading value) loading,
|
||||
required TResult Function(ProfileStateLoaded value) loaded,
|
||||
required TResult Function(ProfileStateError value) error,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ProfileState value)? $default, {
|
||||
TResult? Function(ProfileStateLoading value)? loading,
|
||||
TResult? Function(ProfileStateLoaded value)? loaded,
|
||||
TResult? Function(ProfileStateError value)? error,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ProfileState value)? $default, {
|
||||
TResult Function(ProfileStateLoading value)? loading,
|
||||
TResult Function(ProfileStateLoaded value)? loaded,
|
||||
TResult Function(ProfileStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ProfileStateLoading implements ProfileState {
|
||||
const factory ProfileStateLoading() = _$ProfileStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProfileStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$ProfileStateLoadedImplCopyWith(_$ProfileStateLoadedImpl value,
|
||||
$Res Function(_$ProfileStateLoadedImpl) then) =
|
||||
__$$ProfileStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints});
|
||||
|
||||
$ProfileModelCopyWith<$Res> get profile;
|
||||
$ProfileDetailsModelCopyWith<$Res> get profileDetails;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProfileStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadedImpl>
|
||||
implements _$$ProfileStateLoadedImplCopyWith<$Res> {
|
||||
__$$ProfileStateLoadedImplCopyWithImpl(_$ProfileStateLoadedImpl _value,
|
||||
$Res Function(_$ProfileStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ProfileState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? profile = null,
|
||||
Object? profileDetails = null,
|
||||
Object? blogPosts = null,
|
||||
Object? weightPoints = freezed,
|
||||
Object? circumferencePoints = freezed,
|
||||
}) {
|
||||
return _then(_$ProfileStateLoadedImpl(
|
||||
profile: null == profile
|
||||
? _value.profile
|
||||
: profile // ignore: cast_nullable_to_non_nullable
|
||||
as ProfileModel,
|
||||
profileDetails: null == profileDetails
|
||||
? _value.profileDetails
|
||||
: profileDetails // ignore: cast_nullable_to_non_nullable
|
||||
as ProfileDetailsModel,
|
||||
blogPosts: null == blogPosts
|
||||
? _value._blogPosts
|
||||
: blogPosts // ignore: cast_nullable_to_non_nullable
|
||||
as List<FeedBlogPostModel>,
|
||||
weightPoints: freezed == weightPoints
|
||||
? _value._weightPoints
|
||||
: weightPoints // ignore: cast_nullable_to_non_nullable
|
||||
as List<WeightModel>?,
|
||||
circumferencePoints: freezed == circumferencePoints
|
||||
? _value._circumferencePoints
|
||||
: circumferencePoints // ignore: cast_nullable_to_non_nullable
|
||||
as List<CircumferenceModel>?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of ProfileState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ProfileModelCopyWith<$Res> get profile {
|
||||
return $ProfileModelCopyWith<$Res>(_value.profile, (value) {
|
||||
return _then(_value.copyWith(profile: value));
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of ProfileState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ProfileDetailsModelCopyWith<$Res> get profileDetails {
|
||||
return $ProfileDetailsModelCopyWith<$Res>(_value.profileDetails, (value) {
|
||||
return _then(_value.copyWith(profileDetails: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
|
||||
const _$ProfileStateLoadedImpl(
|
||||
{required this.profile,
|
||||
required this.profileDetails,
|
||||
required final List<FeedBlogPostModel> blogPosts,
|
||||
final List<WeightModel>? weightPoints,
|
||||
final List<CircumferenceModel>? circumferencePoints})
|
||||
: _blogPosts = blogPosts,
|
||||
_weightPoints = weightPoints,
|
||||
_circumferencePoints = circumferencePoints;
|
||||
|
||||
@override
|
||||
final ProfileModel profile;
|
||||
@override
|
||||
final ProfileDetailsModel profileDetails;
|
||||
final List<FeedBlogPostModel> _blogPosts;
|
||||
@override
|
||||
List<FeedBlogPostModel> get blogPosts {
|
||||
if (_blogPosts is EqualUnmodifiableListView) return _blogPosts;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_blogPosts);
|
||||
}
|
||||
|
||||
final List<WeightModel>? _weightPoints;
|
||||
@override
|
||||
List<WeightModel>? get weightPoints {
|
||||
final value = _weightPoints;
|
||||
if (value == null) return null;
|
||||
if (_weightPoints is EqualUnmodifiableListView) return _weightPoints;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
final List<CircumferenceModel>? _circumferencePoints;
|
||||
@override
|
||||
List<CircumferenceModel>? get circumferencePoints {
|
||||
final value = _circumferencePoints;
|
||||
if (value == null) return null;
|
||||
if (_circumferencePoints is EqualUnmodifiableListView)
|
||||
return _circumferencePoints;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProfileState.loaded(profile: $profile, profileDetails: $profileDetails, blogPosts: $blogPosts, weightPoints: $weightPoints, circumferencePoints: $circumferencePoints)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ProfileStateLoadedImpl &&
|
||||
(identical(other.profile, profile) || other.profile == profile) &&
|
||||
(identical(other.profileDetails, profileDetails) ||
|
||||
other.profileDetails == profileDetails) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._blogPosts, _blogPosts) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._weightPoints, _weightPoints) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._circumferencePoints, _circumferencePoints));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
profile,
|
||||
profileDetails,
|
||||
const DeepCollectionEquality().hash(_blogPosts),
|
||||
const DeepCollectionEquality().hash(_weightPoints),
|
||||
const DeepCollectionEquality().hash(_circumferencePoints));
|
||||
|
||||
/// Create a copy of ProfileState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith =>
|
||||
__$$ProfileStateLoadedImplCopyWithImpl<_$ProfileStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loaded(
|
||||
profile, profileDetails, blogPosts, weightPoints, circumferencePoints);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loaded?.call(
|
||||
profile, profileDetails, blogPosts, weightPoints, circumferencePoints);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(profile, profileDetails, blogPosts, weightPoints,
|
||||
circumferencePoints);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ProfileState value) $default, {
|
||||
required TResult Function(ProfileStateLoading value) loading,
|
||||
required TResult Function(ProfileStateLoaded value) loaded,
|
||||
required TResult Function(ProfileStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ProfileState value)? $default, {
|
||||
TResult? Function(ProfileStateLoading value)? loading,
|
||||
TResult? Function(ProfileStateLoaded value)? loaded,
|
||||
TResult? Function(ProfileStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ProfileState value)? $default, {
|
||||
TResult Function(ProfileStateLoading value)? loading,
|
||||
TResult Function(ProfileStateLoaded value)? loaded,
|
||||
TResult Function(ProfileStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ProfileStateLoaded implements ProfileState {
|
||||
const factory ProfileStateLoaded(
|
||||
{required final ProfileModel profile,
|
||||
required final ProfileDetailsModel profileDetails,
|
||||
required final List<FeedBlogPostModel> blogPosts,
|
||||
final List<WeightModel>? weightPoints,
|
||||
final List<CircumferenceModel>? circumferencePoints}) =
|
||||
_$ProfileStateLoadedImpl;
|
||||
|
||||
ProfileModel get profile;
|
||||
ProfileDetailsModel get profileDetails;
|
||||
List<FeedBlogPostModel> get blogPosts;
|
||||
List<WeightModel>? get weightPoints;
|
||||
List<CircumferenceModel>? get circumferencePoints;
|
||||
|
||||
/// Create a copy of ProfileState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProfileStateErrorImplCopyWith<$Res> {
|
||||
factory _$$ProfileStateErrorImplCopyWith(_$ProfileStateErrorImpl value,
|
||||
$Res Function(_$ProfileStateErrorImpl) then) =
|
||||
__$$ProfileStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProfileStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateErrorImpl>
|
||||
implements _$$ProfileStateErrorImplCopyWith<$Res> {
|
||||
__$$ProfileStateErrorImplCopyWithImpl(_$ProfileStateErrorImpl _value,
|
||||
$Res Function(_$ProfileStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ProfileState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$ProfileStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ProfileStateErrorImpl implements ProfileStateError {
|
||||
const _$ProfileStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProfileState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ProfileStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of ProfileState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith =>
|
||||
__$$ProfileStateErrorImplCopyWithImpl<_$ProfileStateErrorImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(
|
||||
ProfileModel profile,
|
||||
ProfileDetailsModel profileDetails,
|
||||
List<FeedBlogPostModel> blogPosts,
|
||||
List<WeightModel>? weightPoints,
|
||||
List<CircumferenceModel>? circumferencePoints)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ProfileState value) $default, {
|
||||
required TResult Function(ProfileStateLoading value) loading,
|
||||
required TResult Function(ProfileStateLoaded value) loaded,
|
||||
required TResult Function(ProfileStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ProfileState value)? $default, {
|
||||
TResult? Function(ProfileStateLoading value)? loading,
|
||||
TResult? Function(ProfileStateLoaded value)? loaded,
|
||||
TResult? Function(ProfileStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ProfileState value)? $default, {
|
||||
TResult Function(ProfileStateLoading value)? loading,
|
||||
TResult Function(ProfileStateLoaded value)? loaded,
|
||||
TResult Function(ProfileStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ProfileStateError implements ProfileState {
|
||||
const factory ProfileStateError({required final String errorMessage}) =
|
||||
_$ProfileStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of ProfileState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,638 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'sub_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SubState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<SubModel> subList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<SubModel> subList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<SubModel> subList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_SubState value) $default, {
|
||||
required TResult Function(SubStateLoading value) loading,
|
||||
required TResult Function(SubStateLoaded value) loaded,
|
||||
required TResult Function(SubStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_SubState value)? $default, {
|
||||
TResult? Function(SubStateLoading value)? loading,
|
||||
TResult? Function(SubStateLoaded value)? loaded,
|
||||
TResult? Function(SubStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SubState value)? $default, {
|
||||
TResult Function(SubStateLoading value)? loading,
|
||||
TResult Function(SubStateLoaded value)? loaded,
|
||||
TResult Function(SubStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $SubStateCopyWith<$Res> {
|
||||
factory $SubStateCopyWith(SubState value, $Res Function(SubState) then) =
|
||||
_$SubStateCopyWithImpl<$Res, SubState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$SubStateCopyWithImpl<$Res, $Val extends SubState>
|
||||
implements $SubStateCopyWith<$Res> {
|
||||
_$SubStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of SubState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SubStateImplCopyWith<$Res> {
|
||||
factory _$$SubStateImplCopyWith(
|
||||
_$SubStateImpl value, $Res Function(_$SubStateImpl) then) =
|
||||
__$$SubStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SubStateImplCopyWithImpl<$Res>
|
||||
extends _$SubStateCopyWithImpl<$Res, _$SubStateImpl>
|
||||
implements _$$SubStateImplCopyWith<$Res> {
|
||||
__$$SubStateImplCopyWithImpl(
|
||||
_$SubStateImpl _value, $Res Function(_$SubStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SubState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$SubStateImpl implements _SubState {
|
||||
const _$SubStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$SubStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<SubModel> subList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<SubModel> subList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<SubModel> subList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_SubState value) $default, {
|
||||
required TResult Function(SubStateLoading value) loading,
|
||||
required TResult Function(SubStateLoaded value) loaded,
|
||||
required TResult Function(SubStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_SubState value)? $default, {
|
||||
TResult? Function(SubStateLoading value)? loading,
|
||||
TResult? Function(SubStateLoaded value)? loaded,
|
||||
TResult? Function(SubStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SubState value)? $default, {
|
||||
TResult Function(SubStateLoading value)? loading,
|
||||
TResult Function(SubStateLoaded value)? loaded,
|
||||
TResult Function(SubStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _SubState implements SubState {
|
||||
const factory _SubState() = _$SubStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SubStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$SubStateLoadingImplCopyWith(_$SubStateLoadingImpl value,
|
||||
$Res Function(_$SubStateLoadingImpl) then) =
|
||||
__$$SubStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SubStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$SubStateCopyWithImpl<$Res, _$SubStateLoadingImpl>
|
||||
implements _$$SubStateLoadingImplCopyWith<$Res> {
|
||||
__$$SubStateLoadingImplCopyWithImpl(
|
||||
_$SubStateLoadingImpl _value, $Res Function(_$SubStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SubState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$SubStateLoadingImpl implements SubStateLoading {
|
||||
const _$SubStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$SubStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<SubModel> subList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<SubModel> subList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<SubModel> subList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_SubState value) $default, {
|
||||
required TResult Function(SubStateLoading value) loading,
|
||||
required TResult Function(SubStateLoaded value) loaded,
|
||||
required TResult Function(SubStateError value) error,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_SubState value)? $default, {
|
||||
TResult? Function(SubStateLoading value)? loading,
|
||||
TResult? Function(SubStateLoaded value)? loaded,
|
||||
TResult? Function(SubStateError value)? error,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SubState value)? $default, {
|
||||
TResult Function(SubStateLoading value)? loading,
|
||||
TResult Function(SubStateLoaded value)? loaded,
|
||||
TResult Function(SubStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class SubStateLoading implements SubState {
|
||||
const factory SubStateLoading() = _$SubStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SubStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$SubStateLoadedImplCopyWith(_$SubStateLoadedImpl value,
|
||||
$Res Function(_$SubStateLoadedImpl) then) =
|
||||
__$$SubStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({List<SubModel> subList});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SubStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$SubStateCopyWithImpl<$Res, _$SubStateLoadedImpl>
|
||||
implements _$$SubStateLoadedImplCopyWith<$Res> {
|
||||
__$$SubStateLoadedImplCopyWithImpl(
|
||||
_$SubStateLoadedImpl _value, $Res Function(_$SubStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SubState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? subList = null,
|
||||
}) {
|
||||
return _then(_$SubStateLoadedImpl(
|
||||
subList: null == subList
|
||||
? _value._subList
|
||||
: subList // ignore: cast_nullable_to_non_nullable
|
||||
as List<SubModel>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$SubStateLoadedImpl implements SubStateLoaded {
|
||||
const _$SubStateLoadedImpl({required final List<SubModel> subList})
|
||||
: _subList = subList;
|
||||
|
||||
final List<SubModel> _subList;
|
||||
@override
|
||||
List<SubModel> get subList {
|
||||
if (_subList is EqualUnmodifiableListView) return _subList;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_subList);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubState.loaded(subList: $subList)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$SubStateLoadedImpl &&
|
||||
const DeepCollectionEquality().equals(other._subList, _subList));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, const DeepCollectionEquality().hash(_subList));
|
||||
|
||||
/// Create a copy of SubState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$SubStateLoadedImplCopyWith<_$SubStateLoadedImpl> get copyWith =>
|
||||
__$$SubStateLoadedImplCopyWithImpl<_$SubStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<SubModel> subList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loaded(subList);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<SubModel> subList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loaded?.call(subList);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<SubModel> subList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(subList);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_SubState value) $default, {
|
||||
required TResult Function(SubStateLoading value) loading,
|
||||
required TResult Function(SubStateLoaded value) loaded,
|
||||
required TResult Function(SubStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_SubState value)? $default, {
|
||||
TResult? Function(SubStateLoading value)? loading,
|
||||
TResult? Function(SubStateLoaded value)? loaded,
|
||||
TResult? Function(SubStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SubState value)? $default, {
|
||||
TResult Function(SubStateLoading value)? loading,
|
||||
TResult Function(SubStateLoaded value)? loaded,
|
||||
TResult Function(SubStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class SubStateLoaded implements SubState {
|
||||
const factory SubStateLoaded({required final List<SubModel> subList}) =
|
||||
_$SubStateLoadedImpl;
|
||||
|
||||
List<SubModel> get subList;
|
||||
|
||||
/// Create a copy of SubState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$SubStateLoadedImplCopyWith<_$SubStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SubStateErrorImplCopyWith<$Res> {
|
||||
factory _$$SubStateErrorImplCopyWith(
|
||||
_$SubStateErrorImpl value, $Res Function(_$SubStateErrorImpl) then) =
|
||||
__$$SubStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SubStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$SubStateCopyWithImpl<$Res, _$SubStateErrorImpl>
|
||||
implements _$$SubStateErrorImplCopyWith<$Res> {
|
||||
__$$SubStateErrorImplCopyWithImpl(
|
||||
_$SubStateErrorImpl _value, $Res Function(_$SubStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SubState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$SubStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$SubStateErrorImpl implements SubStateError {
|
||||
const _$SubStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$SubStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of SubState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$SubStateErrorImplCopyWith<_$SubStateErrorImpl> get copyWith =>
|
||||
__$$SubStateErrorImplCopyWithImpl<_$SubStateErrorImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<SubModel> subList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<SubModel> subList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<SubModel> subList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_SubState value) $default, {
|
||||
required TResult Function(SubStateLoading value) loading,
|
||||
required TResult Function(SubStateLoaded value) loaded,
|
||||
required TResult Function(SubStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_SubState value)? $default, {
|
||||
TResult? Function(SubStateLoading value)? loading,
|
||||
TResult? Function(SubStateLoaded value)? loaded,
|
||||
TResult? Function(SubStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SubState value)? $default, {
|
||||
TResult Function(SubStateLoading value)? loading,
|
||||
TResult Function(SubStateLoaded value)? loaded,
|
||||
TResult Function(SubStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class SubStateError implements SubState {
|
||||
const factory SubStateError({required final String errorMessage}) =
|
||||
_$SubStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of SubState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$SubStateErrorImplCopyWith<_$SubStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,559 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'profile_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _ProfileService implements ProfileService {
|
||||
_ProfileService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<ProfileModel> getProfileBySlug({required String slug}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<ProfileModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/show/${slug}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late ProfileModel _value;
|
||||
try {
|
||||
_value = ProfileModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ProfileModel> getMyProfile() async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<ProfileModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/index',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late ProfileModel _value;
|
||||
try {
|
||||
_value = ProfileModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ProfileDetailsModel> getMyProfileDetails() async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<ProfileDetailsModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/detailz',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late ProfileDetailsModel _value;
|
||||
try {
|
||||
_value = ProfileDetailsModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ProfileDetailsModel> getProfileDetailsBySlug({
|
||||
required String slug,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<ProfileDetailsModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/detailz/${slug}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late ProfileDetailsModel _value;
|
||||
try {
|
||||
_value = ProfileDetailsModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> addCircumference({
|
||||
required int chestCircumference,
|
||||
required int waistCircumference,
|
||||
required int hipCircumference,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = FormData();
|
||||
_data.fields.add(
|
||||
MapEntry('chest_circumference', chestCircumference.toString()),
|
||||
);
|
||||
_data.fields.add(
|
||||
MapEntry('waist_circumference', waistCircumference.toString()),
|
||||
);
|
||||
_data.fields.add(
|
||||
MapEntry('hip_circumference', hipCircumference.toString()),
|
||||
);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/addCircumference',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> addWeight({required double weight}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = FormData();
|
||||
_data.fields.add(MapEntry('weight', weight.toString()));
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/addWeight',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<FeedBlogPostModel>> getBlogPostByAuthorSlug({
|
||||
required String slug,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<List<FeedBlogPostModel>>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/blogPosts/search_by_author/${slug}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||
late List<FeedBlogPostModel> _value;
|
||||
try {
|
||||
_value = _result.data!
|
||||
.map(
|
||||
(dynamic i) =>
|
||||
FeedBlogPostModel.fromJson(i as Map<String, dynamic>),
|
||||
)
|
||||
.toList();
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<WeightModel>> getWeight({required String period}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<List<WeightModel>>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/measure/weight/${period}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||
late List<WeightModel> _value;
|
||||
try {
|
||||
_value = _result.data!
|
||||
.map(
|
||||
(dynamic i) => WeightModel.fromJson(i as Map<String, dynamic>),
|
||||
)
|
||||
.toList();
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<WeightModel>> getWeightBySlug({
|
||||
required String period,
|
||||
required String slug,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<List<WeightModel>>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/measure/weight/${period}/${slug}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||
late List<WeightModel> _value;
|
||||
try {
|
||||
_value = _result.data!
|
||||
.map(
|
||||
(dynamic i) => WeightModel.fromJson(i as Map<String, dynamic>),
|
||||
)
|
||||
.toList();
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<CircumferenceModel>> getCircumferences({
|
||||
required String period,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<List<CircumferenceModel>>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/measure/circumferences/${period}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||
late List<CircumferenceModel> _value;
|
||||
try {
|
||||
_value = _result.data!
|
||||
.map(
|
||||
(dynamic i) =>
|
||||
CircumferenceModel.fromJson(i as Map<String, dynamic>),
|
||||
)
|
||||
.toList();
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<CircumferenceModel>> getCircumferencesBySlug({
|
||||
required String period,
|
||||
required String slug,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<List<CircumferenceModel>>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/measure/circumferences/${period}/{user}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||
late List<CircumferenceModel> _value;
|
||||
try {
|
||||
_value = _result.data!
|
||||
.map(
|
||||
(dynamic i) =>
|
||||
CircumferenceModel.fromJson(i as Map<String, dynamic>),
|
||||
)
|
||||
.toList();
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SubPaginationModel> getSubscribers({
|
||||
required String slug,
|
||||
String? query,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{
|
||||
r'filters[name][$startsWith]': query,
|
||||
};
|
||||
queryParameters.removeWhere((k, v) => v == null);
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<SubPaginationModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/${slug}/subscribers',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late SubPaginationModel _value;
|
||||
try {
|
||||
_value = SubPaginationModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SubPaginationModel> getSubscriptions({
|
||||
required String slug,
|
||||
String? query,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{
|
||||
r'filters[name][$startsWith]': query,
|
||||
};
|
||||
queryParameters.removeWhere((k, v) => v == null);
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<SubPaginationModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/${slug}/subscriptions',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late SubPaginationModel _value;
|
||||
try {
|
||||
_value = SubPaginationModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> subscribe({required String slug}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/subscribe/${slug}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> unsubscribe({required String slug}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/unsubscribe/${slug}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> uploadPhoto({required File photo}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = FormData();
|
||||
_data.files.add(
|
||||
MapEntry(
|
||||
'photo',
|
||||
MultipartFile.fromFileSync(
|
||||
photo.path,
|
||||
filename: photo.path.split(Platform.pathSeparator).last,
|
||||
),
|
||||
),
|
||||
);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/photo/upload',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deletePhoto() async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'DELETE', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/photo/delete',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ChosenDietsPaginationModel> getChosenDiets() async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<ChosenDietsPaginationModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/chosen_diets',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late ChosenDietsPaginationModel _value;
|
||||
try {
|
||||
_value = ChosenDietsPaginationModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user