feat(order info): added order info screen

This commit is contained in:
Username1548
2025-04-04 20:21:31 +07:00
parent 9715f4cac9
commit 748484cf8f
387 changed files with 16171 additions and 18199 deletions

View File

@@ -6,13 +6,13 @@ part 'diary_day_model.g.dart';
enum PortionState {
active,
filled_diet,
eaten_from_diet,
filledDiet,
eatenFromDiet,
eaten,
eaten_deleted,
eaten_edited,
eatenDeleted,
eatenEdited,
commented,
reviewed_by_user,
revieweByUser,
}
@freezed

File diff suppressed because it is too large Load Diff

View File

@@ -7,14 +7,16 @@ part of 'diary_day_model.dart';
// **************************************************************************
_$DiaryDayWrapperModelImpl _$$DiaryDayWrapperModelImplFromJson(
Map<String, dynamic> json,
) => _$DiaryDayWrapperModelImpl(
diary: DiaryDayModel.fromJson(json['diary'] as Map<String, dynamic>),
);
Map<String, dynamic> json) =>
_$DiaryDayWrapperModelImpl(
diary: DiaryDayModel.fromJson(json['diary'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$DiaryDayWrapperModelImplToJson(
_$DiaryDayWrapperModelImpl instance,
) => <String, dynamic>{'diary': instance.diary};
_$DiaryDayWrapperModelImpl instance) =>
<String, dynamic>{
'diary': instance.diary,
};
_$DiaryDayModelImpl _$$DiaryDayModelImplFromJson(Map<String, dynamic> json) =>
_$DiaryDayModelImpl(
@@ -24,13 +26,11 @@ _$DiaryDayModelImpl _$$DiaryDayModelImplFromJson(Map<String, dynamic> json) =>
retire: json['retire'] as String?,
closed: (json['closed'] as num).toInt(),
comment: json['comment'] as String,
typeOfDiary: TypeOfDiaryModel.fromJson(
json['state'] as Map<String, dynamic>,
),
meals:
(json['meals'] as List<dynamic>)
.map((e) => MealModel.fromJson(e as Map<String, dynamic>))
.toList(),
typeOfDiary:
TypeOfDiaryModel.fromJson(json['state'] as Map<String, dynamic>),
meals: (json['meals'] as List<dynamic>)
.map((e) => MealModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$$DiaryDayModelImplToJson(_$DiaryDayModelImpl instance) =>
@@ -52,14 +52,12 @@ _$MealModelImpl _$$MealModelImplFromJson(Map<String, dynamic> json) =>
typeNumber: (json['type_no'] as num).toInt(),
satiety: (json['satiety'] as num).toInt(),
mood: (json['mood'] as num).toInt(),
portions:
(json['portions'] as List<dynamic>)
.map((e) => PortionModel.fromJson(e as Map<String, dynamic>))
.toList(),
photos:
(json['photos'] as List<dynamic>)
.map((e) => DiaryPhotoModel.fromJson(e as Map<String, dynamic>))
.toList(),
portions: (json['portions'] as List<dynamic>)
.map((e) => PortionModel.fromJson(e as Map<String, dynamic>))
.toList(),
photos: (json['photos'] as List<dynamic>)
.map((e) => DiaryPhotoModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$$MealModelImplToJson(_$MealModelImpl instance) =>
@@ -74,22 +72,22 @@ Map<String, dynamic> _$$MealModelImplToJson(_$MealModelImpl instance) =>
};
_$DiaryPhotoModelImpl _$$DiaryPhotoModelImplFromJson(
Map<String, dynamic> json,
) => _$DiaryPhotoModelImpl(
id: (json['id'] as num).toInt(),
originalName: json['original_name'] as String,
path: json['path'] as String,
size: (json['size'] as num).toInt(),
);
Map<String, dynamic> json) =>
_$DiaryPhotoModelImpl(
id: (json['id'] as num).toInt(),
originalName: json['original_name'] as String,
path: json['path'] as String,
size: (json['size'] as num).toInt(),
);
Map<String, dynamic> _$$DiaryPhotoModelImplToJson(
_$DiaryPhotoModelImpl instance,
) => <String, dynamic>{
'id': instance.id,
'original_name': instance.originalName,
'path': instance.path,
'size': instance.size,
};
_$DiaryPhotoModelImpl instance) =>
<String, dynamic>{
'id': instance.id,
'original_name': instance.originalName,
'path': instance.path,
'size': instance.size,
};
_$PortionModelImpl _$$PortionModelImplFromJson(Map<String, dynamic> json) =>
_$PortionModelImpl(
@@ -116,28 +114,28 @@ Map<String, dynamic> _$$PortionModelImplToJson(_$PortionModelImpl instance) =>
const _$PortionStateEnumMap = {
PortionState.active: 'active',
PortionState.filled_diet: 'filled_diet',
PortionState.eaten_from_diet: 'eaten_from_diet',
PortionState.filledDiet: 'filledDiet',
PortionState.eatenFromDiet: 'eatenFromDiet',
PortionState.eaten: 'eaten',
PortionState.eaten_deleted: 'eaten_deleted',
PortionState.eaten_edited: 'eaten_edited',
PortionState.eatenDeleted: 'eatenDeleted',
PortionState.eatenEdited: 'eatenEdited',
PortionState.commented: 'commented',
PortionState.reviewed_by_user: 'reviewed_by_user',
PortionState.revieweByUser: 'revieweByUser',
};
_$TypeOfDiaryModelImpl _$$TypeOfDiaryModelImplFromJson(
Map<String, dynamic> json,
) => _$TypeOfDiaryModelImpl(
hasChosenDiet: json['has_chosen_diet'] as bool,
hasChosenPlan: json['has_chosen_plan'] as bool,
);
Map<String, dynamic> json) =>
_$TypeOfDiaryModelImpl(
hasChosenDiet: json['has_chosen_diet'] as bool,
hasChosenPlan: json['has_chosen_plan'] as bool,
);
Map<String, dynamic> _$$TypeOfDiaryModelImplToJson(
_$TypeOfDiaryModelImpl instance,
) => <String, dynamic>{
'has_chosen_diet': instance.hasChosenDiet,
'has_chosen_plan': instance.hasChosenPlan,
};
_$TypeOfDiaryModelImpl instance) =>
<String, dynamic>{
'has_chosen_diet': instance.hasChosenDiet,
'has_chosen_plan': instance.hasChosenPlan,
};
_$ProductInMealImpl _$$ProductInMealImplFromJson(Map<String, dynamic> json) =>
_$ProductInMealImpl(

View File

@@ -12,8 +12,7 @@ part of 'diary_index_model.dart';
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',
);
'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');
DiaryIndexModel _$DiaryIndexModelFromJson(Map<String, dynamic> json) {
return _DiaryIndexModel.fromJson(json);
@@ -36,9 +35,8 @@ mixin _$DiaryIndexModel {
/// @nodoc
abstract class $DiaryIndexModelCopyWith<$Res> {
factory $DiaryIndexModelCopyWith(
DiaryIndexModel value,
$Res Function(DiaryIndexModel) then,
) = _$DiaryIndexModelCopyWithImpl<$Res, DiaryIndexModel>;
DiaryIndexModel value, $Res Function(DiaryIndexModel) then) =
_$DiaryIndexModelCopyWithImpl<$Res, DiaryIndexModel>;
@useResult
$Res call({int id});
}
@@ -57,27 +55,24 @@ class _$DiaryIndexModelCopyWithImpl<$Res, $Val extends DiaryIndexModel>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? id = null}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
)
as $Val,
);
$Res call({
Object? id = null,
}) {
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
/// @nodoc
abstract class _$$DiaryIndexModelImplCopyWith<$Res>
implements $DiaryIndexModelCopyWith<$Res> {
factory _$$DiaryIndexModelImplCopyWith(
_$DiaryIndexModelImpl value,
$Res Function(_$DiaryIndexModelImpl) then,
) = __$$DiaryIndexModelImplCopyWithImpl<$Res>;
factory _$$DiaryIndexModelImplCopyWith(_$DiaryIndexModelImpl value,
$Res Function(_$DiaryIndexModelImpl) then) =
__$$DiaryIndexModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id});
@@ -88,24 +83,22 @@ class __$$DiaryIndexModelImplCopyWithImpl<$Res>
extends _$DiaryIndexModelCopyWithImpl<$Res, _$DiaryIndexModelImpl>
implements _$$DiaryIndexModelImplCopyWith<$Res> {
__$$DiaryIndexModelImplCopyWithImpl(
_$DiaryIndexModelImpl _value,
$Res Function(_$DiaryIndexModelImpl) _then,
) : super(_value, _then);
_$DiaryIndexModelImpl _value, $Res Function(_$DiaryIndexModelImpl) _then)
: super(_value, _then);
/// Create a copy of DiaryIndexModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? id = null}) {
return _then(
_$DiaryIndexModelImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
),
);
$Res call({
Object? id = null,
}) {
return _then(_$DiaryIndexModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
@@ -144,13 +137,13 @@ class _$DiaryIndexModelImpl implements _DiaryIndexModel {
@pragma('vm:prefer-inline')
_$$DiaryIndexModelImplCopyWith<_$DiaryIndexModelImpl> get copyWith =>
__$$DiaryIndexModelImplCopyWithImpl<_$DiaryIndexModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$DiaryIndexModelImplToJson(this);
return _$$DiaryIndexModelImplToJson(
this,
);
}
}

View File

@@ -7,9 +7,13 @@ part of 'diary_index_model.dart';
// **************************************************************************
_$DiaryIndexModelImpl _$$DiaryIndexModelImplFromJson(
Map<String, dynamic> json,
) => _$DiaryIndexModelImpl(id: (json['id'] as num).toInt());
Map<String, dynamic> json) =>
_$DiaryIndexModelImpl(
id: (json['id'] as num).toInt(),
);
Map<String, dynamic> _$$DiaryIndexModelImplToJson(
_$DiaryIndexModelImpl instance,
) => <String, dynamic>{'id': instance.id};
_$DiaryIndexModelImpl instance) =>
<String, dynamic>{
'id': instance.id,
};

View File

@@ -12,8 +12,7 @@ part of 'finish_diary_day_model.dart';
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',
);
'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');
FinishDiaryDayModel _$FinishDiaryDayModelFromJson(Map<String, dynamic> json) {
return _FinishDiaryDayModel.fromJson(json);
@@ -39,15 +38,13 @@ mixin _$FinishDiaryDayModel {
/// @nodoc
abstract class $FinishDiaryDayModelCopyWith<$Res> {
factory $FinishDiaryDayModelCopyWith(
FinishDiaryDayModel value,
$Res Function(FinishDiaryDayModel) then,
) = _$FinishDiaryDayModelCopyWithImpl<$Res, FinishDiaryDayModel>;
FinishDiaryDayModel value, $Res Function(FinishDiaryDayModel) then) =
_$FinishDiaryDayModelCopyWithImpl<$Res, FinishDiaryDayModel>;
@useResult
$Res call({
String wakeUp,
String retire,
@JsonKey(includeIfNull: false) String? comment,
});
$Res call(
{String wakeUp,
String retire,
@JsonKey(includeIfNull: false) String? comment});
}
/// @nodoc
@@ -69,53 +66,44 @@ class _$FinishDiaryDayModelCopyWithImpl<$Res, $Val extends FinishDiaryDayModel>
Object? retire = null,
Object? comment = freezed,
}) {
return _then(
_value.copyWith(
wakeUp:
null == wakeUp
? _value.wakeUp
: wakeUp // ignore: cast_nullable_to_non_nullable
as String,
retire:
null == retire
? _value.retire
: retire // ignore: cast_nullable_to_non_nullable
as String,
comment:
freezed == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String?,
)
as $Val,
);
return _then(_value.copyWith(
wakeUp: null == wakeUp
? _value.wakeUp
: wakeUp // ignore: cast_nullable_to_non_nullable
as String,
retire: null == retire
? _value.retire
: retire // ignore: cast_nullable_to_non_nullable
as String,
comment: freezed == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
}
/// @nodoc
abstract class _$$FinishDiaryDayModelImplCopyWith<$Res>
implements $FinishDiaryDayModelCopyWith<$Res> {
factory _$$FinishDiaryDayModelImplCopyWith(
_$FinishDiaryDayModelImpl value,
$Res Function(_$FinishDiaryDayModelImpl) then,
) = __$$FinishDiaryDayModelImplCopyWithImpl<$Res>;
factory _$$FinishDiaryDayModelImplCopyWith(_$FinishDiaryDayModelImpl value,
$Res Function(_$FinishDiaryDayModelImpl) then) =
__$$FinishDiaryDayModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
String wakeUp,
String retire,
@JsonKey(includeIfNull: false) String? comment,
});
$Res call(
{String wakeUp,
String retire,
@JsonKey(includeIfNull: false) String? comment});
}
/// @nodoc
class __$$FinishDiaryDayModelImplCopyWithImpl<$Res>
extends _$FinishDiaryDayModelCopyWithImpl<$Res, _$FinishDiaryDayModelImpl>
implements _$$FinishDiaryDayModelImplCopyWith<$Res> {
__$$FinishDiaryDayModelImplCopyWithImpl(
_$FinishDiaryDayModelImpl _value,
$Res Function(_$FinishDiaryDayModelImpl) _then,
) : super(_value, _then);
__$$FinishDiaryDayModelImplCopyWithImpl(_$FinishDiaryDayModelImpl _value,
$Res Function(_$FinishDiaryDayModelImpl) _then)
: super(_value, _then);
/// Create a copy of FinishDiaryDayModel
/// with the given fields replaced by the non-null parameter values.
@@ -126,36 +114,30 @@ class __$$FinishDiaryDayModelImplCopyWithImpl<$Res>
Object? retire = null,
Object? comment = freezed,
}) {
return _then(
_$FinishDiaryDayModelImpl(
wakeUp:
null == wakeUp
? _value.wakeUp
: wakeUp // ignore: cast_nullable_to_non_nullable
as String,
retire:
null == retire
? _value.retire
: retire // ignore: cast_nullable_to_non_nullable
as String,
comment:
freezed == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String?,
),
);
return _then(_$FinishDiaryDayModelImpl(
wakeUp: null == wakeUp
? _value.wakeUp
: wakeUp // ignore: cast_nullable_to_non_nullable
as String,
retire: null == retire
? _value.retire
: retire // ignore: cast_nullable_to_non_nullable
as String,
comment: freezed == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$FinishDiaryDayModelImpl implements _FinishDiaryDayModel {
const _$FinishDiaryDayModelImpl({
required this.wakeUp,
required this.retire,
@JsonKey(includeIfNull: false) this.comment,
});
const _$FinishDiaryDayModelImpl(
{required this.wakeUp,
required this.retire,
@JsonKey(includeIfNull: false) this.comment});
factory _$FinishDiaryDayModelImpl.fromJson(Map<String, dynamic> json) =>
_$$FinishDiaryDayModelImplFromJson(json);
@@ -194,22 +176,22 @@ class _$FinishDiaryDayModelImpl implements _FinishDiaryDayModel {
@pragma('vm:prefer-inline')
_$$FinishDiaryDayModelImplCopyWith<_$FinishDiaryDayModelImpl> get copyWith =>
__$$FinishDiaryDayModelImplCopyWithImpl<_$FinishDiaryDayModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$FinishDiaryDayModelImplToJson(this);
return _$$FinishDiaryDayModelImplToJson(
this,
);
}
}
abstract class _FinishDiaryDayModel implements FinishDiaryDayModel {
const factory _FinishDiaryDayModel({
required final String wakeUp,
required final String retire,
@JsonKey(includeIfNull: false) final String? comment,
}) = _$FinishDiaryDayModelImpl;
const factory _FinishDiaryDayModel(
{required final String wakeUp,
required final String retire,
@JsonKey(includeIfNull: false) final String? comment}) =
_$FinishDiaryDayModelImpl;
factory _FinishDiaryDayModel.fromJson(Map<String, dynamic> json) =
_$FinishDiaryDayModelImpl.fromJson;

View File

@@ -7,17 +7,17 @@ part of 'finish_diary_day_model.dart';
// **************************************************************************
_$FinishDiaryDayModelImpl _$$FinishDiaryDayModelImplFromJson(
Map<String, dynamic> json,
) => _$FinishDiaryDayModelImpl(
wakeUp: json['wakeUp'] as String,
retire: json['retire'] as String,
comment: json['comment'] as String?,
);
Map<String, dynamic> json) =>
_$FinishDiaryDayModelImpl(
wakeUp: json['wakeUp'] as String,
retire: json['retire'] as String,
comment: json['comment'] as String?,
);
Map<String, dynamic> _$$FinishDiaryDayModelImplToJson(
_$FinishDiaryDayModelImpl instance,
) => <String, dynamic>{
'wakeUp': instance.wakeUp,
'retire': instance.retire,
if (instance.comment case final value?) 'comment': value,
};
_$FinishDiaryDayModelImpl instance) =>
<String, dynamic>{
'wakeUp': instance.wakeUp,
'retire': instance.retire,
if (instance.comment case final value?) 'comment': value,
};

View File

@@ -12,8 +12,7 @@ part of 'nutrition_model.dart';
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',
);
'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');
NutritionDataModel _$NutritionDataModelFromJson(Map<String, dynamic> json) {
return _NutritionDataModel.fromJson(json);
@@ -38,14 +37,12 @@ mixin _$NutritionDataModel {
/// @nodoc
abstract class $NutritionDataModelCopyWith<$Res> {
factory $NutritionDataModelCopyWith(
NutritionDataModel value,
$Res Function(NutritionDataModel) then,
) = _$NutritionDataModelCopyWithImpl<$Res, NutritionDataModel>;
NutritionDataModel value, $Res Function(NutritionDataModel) then) =
_$NutritionDataModelCopyWithImpl<$Res, NutritionDataModel>;
@useResult
$Res call({
NutritionModel dailyNutritionIntake,
NutritionModel dailyNutritionRecommendation,
});
$Res call(
{NutritionModel dailyNutritionIntake,
NutritionModel dailyNutritionRecommendation});
$NutritionModelCopyWith<$Res> get dailyNutritionIntake;
$NutritionModelCopyWith<$Res> get dailyNutritionRecommendation;
@@ -69,21 +66,16 @@ class _$NutritionDataModelCopyWithImpl<$Res, $Val extends NutritionDataModel>
Object? dailyNutritionIntake = null,
Object? dailyNutritionRecommendation = null,
}) {
return _then(
_value.copyWith(
dailyNutritionIntake:
null == dailyNutritionIntake
? _value.dailyNutritionIntake
: dailyNutritionIntake // ignore: cast_nullable_to_non_nullable
as NutritionModel,
dailyNutritionRecommendation:
null == dailyNutritionRecommendation
? _value.dailyNutritionRecommendation
: dailyNutritionRecommendation // ignore: cast_nullable_to_non_nullable
as NutritionModel,
)
as $Val,
);
return _then(_value.copyWith(
dailyNutritionIntake: null == dailyNutritionIntake
? _value.dailyNutritionIntake
: dailyNutritionIntake // ignore: cast_nullable_to_non_nullable
as NutritionModel,
dailyNutritionRecommendation: null == dailyNutritionRecommendation
? _value.dailyNutritionRecommendation
: dailyNutritionRecommendation // ignore: cast_nullable_to_non_nullable
as NutritionModel,
) as $Val);
}
/// Create a copy of NutritionDataModel
@@ -101,12 +93,10 @@ class _$NutritionDataModelCopyWithImpl<$Res, $Val extends NutritionDataModel>
@override
@pragma('vm:prefer-inline')
$NutritionModelCopyWith<$Res> get dailyNutritionRecommendation {
return $NutritionModelCopyWith<$Res>(_value.dailyNutritionRecommendation, (
value,
) {
return $NutritionModelCopyWith<$Res>(_value.dailyNutritionRecommendation,
(value) {
return _then(
_value.copyWith(dailyNutritionRecommendation: value) as $Val,
);
_value.copyWith(dailyNutritionRecommendation: value) as $Val);
});
}
}
@@ -114,16 +104,14 @@ class _$NutritionDataModelCopyWithImpl<$Res, $Val extends NutritionDataModel>
/// @nodoc
abstract class _$$NutritionDataModelImplCopyWith<$Res>
implements $NutritionDataModelCopyWith<$Res> {
factory _$$NutritionDataModelImplCopyWith(
_$NutritionDataModelImpl value,
$Res Function(_$NutritionDataModelImpl) then,
) = __$$NutritionDataModelImplCopyWithImpl<$Res>;
factory _$$NutritionDataModelImplCopyWith(_$NutritionDataModelImpl value,
$Res Function(_$NutritionDataModelImpl) then) =
__$$NutritionDataModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
NutritionModel dailyNutritionIntake,
NutritionModel dailyNutritionRecommendation,
});
$Res call(
{NutritionModel dailyNutritionIntake,
NutritionModel dailyNutritionRecommendation});
@override
$NutritionModelCopyWith<$Res> get dailyNutritionIntake;
@@ -135,10 +123,9 @@ abstract class _$$NutritionDataModelImplCopyWith<$Res>
class __$$NutritionDataModelImplCopyWithImpl<$Res>
extends _$NutritionDataModelCopyWithImpl<$Res, _$NutritionDataModelImpl>
implements _$$NutritionDataModelImplCopyWith<$Res> {
__$$NutritionDataModelImplCopyWithImpl(
_$NutritionDataModelImpl _value,
$Res Function(_$NutritionDataModelImpl) _then,
) : super(_value, _then);
__$$NutritionDataModelImplCopyWithImpl(_$NutritionDataModelImpl _value,
$Res Function(_$NutritionDataModelImpl) _then)
: super(_value, _then);
/// Create a copy of NutritionDataModel
/// with the given fields replaced by the non-null parameter values.
@@ -148,30 +135,25 @@ class __$$NutritionDataModelImplCopyWithImpl<$Res>
Object? dailyNutritionIntake = null,
Object? dailyNutritionRecommendation = null,
}) {
return _then(
_$NutritionDataModelImpl(
dailyNutritionIntake:
null == dailyNutritionIntake
? _value.dailyNutritionIntake
: dailyNutritionIntake // ignore: cast_nullable_to_non_nullable
as NutritionModel,
dailyNutritionRecommendation:
null == dailyNutritionRecommendation
? _value.dailyNutritionRecommendation
: dailyNutritionRecommendation // ignore: cast_nullable_to_non_nullable
as NutritionModel,
),
);
return _then(_$NutritionDataModelImpl(
dailyNutritionIntake: null == dailyNutritionIntake
? _value.dailyNutritionIntake
: dailyNutritionIntake // ignore: cast_nullable_to_non_nullable
as NutritionModel,
dailyNutritionRecommendation: null == dailyNutritionRecommendation
? _value.dailyNutritionRecommendation
: dailyNutritionRecommendation // ignore: cast_nullable_to_non_nullable
as NutritionModel,
));
}
}
/// @nodoc
@JsonSerializable()
class _$NutritionDataModelImpl implements _NutritionDataModel {
const _$NutritionDataModelImpl({
required this.dailyNutritionIntake,
required this.dailyNutritionRecommendation,
});
const _$NutritionDataModelImpl(
{required this.dailyNutritionIntake,
required this.dailyNutritionRecommendation});
factory _$NutritionDataModelImpl.fromJson(Map<String, dynamic> json) =>
_$$NutritionDataModelImplFromJson(json);
@@ -193,10 +175,8 @@ class _$NutritionDataModelImpl implements _NutritionDataModel {
other is _$NutritionDataModelImpl &&
(identical(other.dailyNutritionIntake, dailyNutritionIntake) ||
other.dailyNutritionIntake == dailyNutritionIntake) &&
(identical(
other.dailyNutritionRecommendation,
dailyNutritionRecommendation,
) ||
(identical(other.dailyNutritionRecommendation,
dailyNutritionRecommendation) ||
other.dailyNutritionRecommendation ==
dailyNutritionRecommendation));
}
@@ -204,10 +184,7 @@ class _$NutritionDataModelImpl implements _NutritionDataModel {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
dailyNutritionIntake,
dailyNutritionRecommendation,
);
runtimeType, dailyNutritionIntake, dailyNutritionRecommendation);
/// Create a copy of NutritionDataModel
/// with the given fields replaced by the non-null parameter values.
@@ -216,21 +193,21 @@ class _$NutritionDataModelImpl implements _NutritionDataModel {
@pragma('vm:prefer-inline')
_$$NutritionDataModelImplCopyWith<_$NutritionDataModelImpl> get copyWith =>
__$$NutritionDataModelImplCopyWithImpl<_$NutritionDataModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$NutritionDataModelImplToJson(this);
return _$$NutritionDataModelImplToJson(
this,
);
}
}
abstract class _NutritionDataModel implements NutritionDataModel {
const factory _NutritionDataModel({
required final NutritionModel dailyNutritionIntake,
required final NutritionModel dailyNutritionRecommendation,
}) = _$NutritionDataModelImpl;
const factory _NutritionDataModel(
{required final NutritionModel dailyNutritionIntake,
required final NutritionModel dailyNutritionRecommendation}) =
_$NutritionDataModelImpl;
factory _NutritionDataModel.fromJson(Map<String, dynamic> json) =
_$NutritionDataModelImpl.fromJson;
@@ -272,16 +249,11 @@ mixin _$NutritionModel {
/// @nodoc
abstract class $NutritionModelCopyWith<$Res> {
factory $NutritionModelCopyWith(
NutritionModel value,
$Res Function(NutritionModel) then,
) = _$NutritionModelCopyWithImpl<$Res, NutritionModel>;
NutritionModel value, $Res Function(NutritionModel) then) =
_$NutritionModelCopyWithImpl<$Res, NutritionModel>;
@useResult
$Res call({
double energy,
double proteins,
double fats,
double carbohydrates,
});
$Res call(
{double energy, double proteins, double fats, double carbohydrates});
}
/// @nodoc
@@ -304,49 +276,37 @@ class _$NutritionModelCopyWithImpl<$Res, $Val extends NutritionModel>
Object? fats = null,
Object? carbohydrates = null,
}) {
return _then(
_value.copyWith(
energy:
null == energy
? _value.energy
: energy // ignore: cast_nullable_to_non_nullable
as double,
proteins:
null == proteins
? _value.proteins
: proteins // ignore: cast_nullable_to_non_nullable
as double,
fats:
null == fats
? _value.fats
: fats // ignore: cast_nullable_to_non_nullable
as double,
carbohydrates:
null == carbohydrates
? _value.carbohydrates
: carbohydrates // ignore: cast_nullable_to_non_nullable
as double,
)
as $Val,
);
return _then(_value.copyWith(
energy: null == energy
? _value.energy
: energy // ignore: cast_nullable_to_non_nullable
as double,
proteins: null == proteins
? _value.proteins
: proteins // ignore: cast_nullable_to_non_nullable
as double,
fats: null == fats
? _value.fats
: fats // ignore: cast_nullable_to_non_nullable
as double,
carbohydrates: null == carbohydrates
? _value.carbohydrates
: carbohydrates // ignore: cast_nullable_to_non_nullable
as double,
) as $Val);
}
}
/// @nodoc
abstract class _$$NutritionModelImplCopyWith<$Res>
implements $NutritionModelCopyWith<$Res> {
factory _$$NutritionModelImplCopyWith(
_$NutritionModelImpl value,
$Res Function(_$NutritionModelImpl) then,
) = __$$NutritionModelImplCopyWithImpl<$Res>;
factory _$$NutritionModelImplCopyWith(_$NutritionModelImpl value,
$Res Function(_$NutritionModelImpl) then) =
__$$NutritionModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
double energy,
double proteins,
double fats,
double carbohydrates,
});
$Res call(
{double energy, double proteins, double fats, double carbohydrates});
}
/// @nodoc
@@ -354,9 +314,8 @@ class __$$NutritionModelImplCopyWithImpl<$Res>
extends _$NutritionModelCopyWithImpl<$Res, _$NutritionModelImpl>
implements _$$NutritionModelImplCopyWith<$Res> {
__$$NutritionModelImplCopyWithImpl(
_$NutritionModelImpl _value,
$Res Function(_$NutritionModelImpl) _then,
) : super(_value, _then);
_$NutritionModelImpl _value, $Res Function(_$NutritionModelImpl) _then)
: super(_value, _then);
/// Create a copy of NutritionModel
/// with the given fields replaced by the non-null parameter values.
@@ -368,42 +327,35 @@ class __$$NutritionModelImplCopyWithImpl<$Res>
Object? fats = null,
Object? carbohydrates = null,
}) {
return _then(
_$NutritionModelImpl(
energy:
null == energy
? _value.energy
: energy // ignore: cast_nullable_to_non_nullable
as double,
proteins:
null == proteins
? _value.proteins
: proteins // ignore: cast_nullable_to_non_nullable
as double,
fats:
null == fats
? _value.fats
: fats // ignore: cast_nullable_to_non_nullable
as double,
carbohydrates:
null == carbohydrates
? _value.carbohydrates
: carbohydrates // ignore: cast_nullable_to_non_nullable
as double,
),
);
return _then(_$NutritionModelImpl(
energy: null == energy
? _value.energy
: energy // ignore: cast_nullable_to_non_nullable
as double,
proteins: null == proteins
? _value.proteins
: proteins // ignore: cast_nullable_to_non_nullable
as double,
fats: null == fats
? _value.fats
: fats // ignore: cast_nullable_to_non_nullable
as double,
carbohydrates: null == carbohydrates
? _value.carbohydrates
: carbohydrates // ignore: cast_nullable_to_non_nullable
as double,
));
}
}
/// @nodoc
@JsonSerializable()
class _$NutritionModelImpl implements _NutritionModel {
const _$NutritionModelImpl({
required this.energy,
required this.proteins,
required this.fats,
required this.carbohydrates,
});
const _$NutritionModelImpl(
{required this.energy,
required this.proteins,
required this.fats,
required this.carbohydrates});
factory _$NutritionModelImpl.fromJson(Map<String, dynamic> json) =>
_$$NutritionModelImplFromJson(json);
@@ -447,23 +399,22 @@ class _$NutritionModelImpl implements _NutritionModel {
@pragma('vm:prefer-inline')
_$$NutritionModelImplCopyWith<_$NutritionModelImpl> get copyWith =>
__$$NutritionModelImplCopyWithImpl<_$NutritionModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$NutritionModelImplToJson(this);
return _$$NutritionModelImplToJson(
this,
);
}
}
abstract class _NutritionModel implements NutritionModel {
const factory _NutritionModel({
required final double energy,
required final double proteins,
required final double fats,
required final double carbohydrates,
}) = _$NutritionModelImpl;
const factory _NutritionModel(
{required final double energy,
required final double proteins,
required final double fats,
required final double carbohydrates}) = _$NutritionModelImpl;
factory _NutritionModel.fromJson(Map<String, dynamic> json) =
_$NutritionModelImpl.fromJson;

View File

@@ -7,22 +7,20 @@ part of 'nutrition_model.dart';
// **************************************************************************
_$NutritionDataModelImpl _$$NutritionDataModelImplFromJson(
Map<String, dynamic> json,
) => _$NutritionDataModelImpl(
dailyNutritionIntake: NutritionModel.fromJson(
json['dailyNutritionIntake'] as Map<String, dynamic>,
),
dailyNutritionRecommendation: NutritionModel.fromJson(
json['dailyNutritionRecommendation'] as Map<String, dynamic>,
),
);
Map<String, dynamic> json) =>
_$NutritionDataModelImpl(
dailyNutritionIntake: NutritionModel.fromJson(
json['dailyNutritionIntake'] as Map<String, dynamic>),
dailyNutritionRecommendation: NutritionModel.fromJson(
json['dailyNutritionRecommendation'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$NutritionDataModelImplToJson(
_$NutritionDataModelImpl instance,
) => <String, dynamic>{
'dailyNutritionIntake': instance.dailyNutritionIntake,
'dailyNutritionRecommendation': instance.dailyNutritionRecommendation,
};
_$NutritionDataModelImpl instance) =>
<String, dynamic>{
'dailyNutritionIntake': instance.dailyNutritionIntake,
'dailyNutritionRecommendation': instance.dailyNutritionRecommendation,
};
_$NutritionModelImpl _$$NutritionModelImplFromJson(Map<String, dynamic> json) =>
_$NutritionModelImpl(
@@ -33,10 +31,10 @@ _$NutritionModelImpl _$$NutritionModelImplFromJson(Map<String, dynamic> json) =>
);
Map<String, dynamic> _$$NutritionModelImplToJson(
_$NutritionModelImpl instance,
) => <String, dynamic>{
'energy': instance.energy,
'proteins': instance.proteins,
'fats': instance.fats,
'carbohydrates': instance.carbohydrates,
};
_$NutritionModelImpl instance) =>
<String, dynamic>{
'energy': instance.energy,
'proteins': instance.proteins,
'fats': instance.fats,
'carbohydrates': instance.carbohydrates,
};

View File

@@ -12,12 +12,10 @@ part of 'product_moderation_model.dart';
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',
);
'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');
ProductModerationModel _$ProductModerationModelFromJson(
Map<String, dynamic> json,
) {
Map<String, dynamic> json) {
return _ProductModerationModel.fromJson(json);
}
@@ -45,25 +43,21 @@ mixin _$ProductModerationModel {
/// @nodoc
abstract class $ProductModerationModelCopyWith<$Res> {
factory $ProductModerationModelCopyWith(
ProductModerationModel value,
$Res Function(ProductModerationModel) then,
) = _$ProductModerationModelCopyWithImpl<$Res, ProductModerationModel>;
factory $ProductModerationModelCopyWith(ProductModerationModel value,
$Res Function(ProductModerationModel) then) =
_$ProductModerationModelCopyWithImpl<$Res, ProductModerationModel>;
@useResult
$Res call({
String name,
@JsonKey(name: 'energy_on_100gr') double energy,
@JsonKey(name: 'proteins_on_100gr') double proteins,
@JsonKey(name: 'fats_on_100gr') double fats,
@JsonKey(name: 'carbohydrates_on_100gr') double carbohydrates,
});
$Res call(
{String name,
@JsonKey(name: 'energy_on_100gr') double energy,
@JsonKey(name: 'proteins_on_100gr') double proteins,
@JsonKey(name: 'fats_on_100gr') double fats,
@JsonKey(name: 'carbohydrates_on_100gr') double carbohydrates});
}
/// @nodoc
class _$ProductModerationModelCopyWithImpl<
$Res,
$Val extends ProductModerationModel
>
class _$ProductModerationModelCopyWithImpl<$Res,
$Val extends ProductModerationModel>
implements $ProductModerationModelCopyWith<$Res> {
_$ProductModerationModelCopyWithImpl(this._value, this._then);
@@ -83,36 +77,28 @@ class _$ProductModerationModelCopyWithImpl<
Object? fats = null,
Object? carbohydrates = null,
}) {
return _then(
_value.copyWith(
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
energy:
null == energy
? _value.energy
: energy // ignore: cast_nullable_to_non_nullable
as double,
proteins:
null == proteins
? _value.proteins
: proteins // ignore: cast_nullable_to_non_nullable
as double,
fats:
null == fats
? _value.fats
: fats // ignore: cast_nullable_to_non_nullable
as double,
carbohydrates:
null == carbohydrates
? _value.carbohydrates
: carbohydrates // ignore: cast_nullable_to_non_nullable
as double,
)
as $Val,
);
return _then(_value.copyWith(
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
energy: null == energy
? _value.energy
: energy // ignore: cast_nullable_to_non_nullable
as double,
proteins: null == proteins
? _value.proteins
: proteins // ignore: cast_nullable_to_non_nullable
as double,
fats: null == fats
? _value.fats
: fats // ignore: cast_nullable_to_non_nullable
as double,
carbohydrates: null == carbohydrates
? _value.carbohydrates
: carbohydrates // ignore: cast_nullable_to_non_nullable
as double,
) as $Val);
}
}
@@ -120,29 +106,28 @@ class _$ProductModerationModelCopyWithImpl<
abstract class _$$ProductModerationModelImplCopyWith<$Res>
implements $ProductModerationModelCopyWith<$Res> {
factory _$$ProductModerationModelImplCopyWith(
_$ProductModerationModelImpl value,
$Res Function(_$ProductModerationModelImpl) then,
) = __$$ProductModerationModelImplCopyWithImpl<$Res>;
_$ProductModerationModelImpl value,
$Res Function(_$ProductModerationModelImpl) then) =
__$$ProductModerationModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
String name,
@JsonKey(name: 'energy_on_100gr') double energy,
@JsonKey(name: 'proteins_on_100gr') double proteins,
@JsonKey(name: 'fats_on_100gr') double fats,
@JsonKey(name: 'carbohydrates_on_100gr') double carbohydrates,
});
$Res call(
{String name,
@JsonKey(name: 'energy_on_100gr') double energy,
@JsonKey(name: 'proteins_on_100gr') double proteins,
@JsonKey(name: 'fats_on_100gr') double fats,
@JsonKey(name: 'carbohydrates_on_100gr') double carbohydrates});
}
/// @nodoc
class __$$ProductModerationModelImplCopyWithImpl<$Res>
extends
_$ProductModerationModelCopyWithImpl<$Res, _$ProductModerationModelImpl>
extends _$ProductModerationModelCopyWithImpl<$Res,
_$ProductModerationModelImpl>
implements _$$ProductModerationModelImplCopyWith<$Res> {
__$$ProductModerationModelImplCopyWithImpl(
_$ProductModerationModelImpl _value,
$Res Function(_$ProductModerationModelImpl) _then,
) : super(_value, _then);
_$ProductModerationModelImpl _value,
$Res Function(_$ProductModerationModelImpl) _then)
: super(_value, _then);
/// Create a copy of ProductModerationModel
/// with the given fields replaced by the non-null parameter values.
@@ -155,48 +140,40 @@ class __$$ProductModerationModelImplCopyWithImpl<$Res>
Object? fats = null,
Object? carbohydrates = null,
}) {
return _then(
_$ProductModerationModelImpl(
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
energy:
null == energy
? _value.energy
: energy // ignore: cast_nullable_to_non_nullable
as double,
proteins:
null == proteins
? _value.proteins
: proteins // ignore: cast_nullable_to_non_nullable
as double,
fats:
null == fats
? _value.fats
: fats // ignore: cast_nullable_to_non_nullable
as double,
carbohydrates:
null == carbohydrates
? _value.carbohydrates
: carbohydrates // ignore: cast_nullable_to_non_nullable
as double,
),
);
return _then(_$ProductModerationModelImpl(
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
energy: null == energy
? _value.energy
: energy // ignore: cast_nullable_to_non_nullable
as double,
proteins: null == proteins
? _value.proteins
: proteins // ignore: cast_nullable_to_non_nullable
as double,
fats: null == fats
? _value.fats
: fats // ignore: cast_nullable_to_non_nullable
as double,
carbohydrates: null == carbohydrates
? _value.carbohydrates
: carbohydrates // ignore: cast_nullable_to_non_nullable
as double,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ProductModerationModelImpl implements _ProductModerationModel {
const _$ProductModerationModelImpl({
required this.name,
@JsonKey(name: 'energy_on_100gr') required this.energy,
@JsonKey(name: 'proteins_on_100gr') required this.proteins,
@JsonKey(name: 'fats_on_100gr') required this.fats,
@JsonKey(name: 'carbohydrates_on_100gr') required this.carbohydrates,
});
const _$ProductModerationModelImpl(
{required this.name,
@JsonKey(name: 'energy_on_100gr') required this.energy,
@JsonKey(name: 'proteins_on_100gr') required this.proteins,
@JsonKey(name: 'fats_on_100gr') required this.fats,
@JsonKey(name: 'carbohydrates_on_100gr') required this.carbohydrates});
factory _$ProductModerationModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ProductModerationModelImplFromJson(json);
@@ -246,27 +223,25 @@ class _$ProductModerationModelImpl implements _ProductModerationModel {
@override
@pragma('vm:prefer-inline')
_$$ProductModerationModelImplCopyWith<_$ProductModerationModelImpl>
get copyWith =>
__$$ProductModerationModelImplCopyWithImpl<_$ProductModerationModelImpl>(
this,
_$identity,
);
get copyWith => __$$ProductModerationModelImplCopyWithImpl<
_$ProductModerationModelImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ProductModerationModelImplToJson(this);
return _$$ProductModerationModelImplToJson(
this,
);
}
}
abstract class _ProductModerationModel implements ProductModerationModel {
const factory _ProductModerationModel({
required final String name,
@JsonKey(name: 'energy_on_100gr') required final double energy,
@JsonKey(name: 'proteins_on_100gr') required final double proteins,
@JsonKey(name: 'fats_on_100gr') required final double fats,
@JsonKey(name: 'carbohydrates_on_100gr')
required final double carbohydrates,
}) = _$ProductModerationModelImpl;
const factory _ProductModerationModel(
{required final String name,
@JsonKey(name: 'energy_on_100gr') required final double energy,
@JsonKey(name: 'proteins_on_100gr') required final double proteins,
@JsonKey(name: 'fats_on_100gr') required final double fats,
@JsonKey(name: 'carbohydrates_on_100gr')
required final double carbohydrates}) = _$ProductModerationModelImpl;
factory _ProductModerationModel.fromJson(Map<String, dynamic> json) =
_$ProductModerationModelImpl.fromJson;
@@ -291,5 +266,5 @@ abstract class _ProductModerationModel implements ProductModerationModel {
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ProductModerationModelImplCopyWith<_$ProductModerationModelImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -7,21 +7,21 @@ part of 'product_moderation_model.dart';
// **************************************************************************
_$ProductModerationModelImpl _$$ProductModerationModelImplFromJson(
Map<String, dynamic> json,
) => _$ProductModerationModelImpl(
name: json['name'] as String,
energy: (json['energy_on_100gr'] as num).toDouble(),
proteins: (json['proteins_on_100gr'] as num).toDouble(),
fats: (json['fats_on_100gr'] as num).toDouble(),
carbohydrates: (json['carbohydrates_on_100gr'] as num).toDouble(),
);
Map<String, dynamic> json) =>
_$ProductModerationModelImpl(
name: json['name'] as String,
energy: (json['energy_on_100gr'] as num).toDouble(),
proteins: (json['proteins_on_100gr'] as num).toDouble(),
fats: (json['fats_on_100gr'] as num).toDouble(),
carbohydrates: (json['carbohydrates_on_100gr'] as num).toDouble(),
);
Map<String, dynamic> _$$ProductModerationModelImplToJson(
_$ProductModerationModelImpl instance,
) => <String, dynamic>{
'name': instance.name,
'energy_on_100gr': instance.energy,
'proteins_on_100gr': instance.proteins,
'fats_on_100gr': instance.fats,
'carbohydrates_on_100gr': instance.carbohydrates,
};
_$ProductModerationModelImpl instance) =>
<String, dynamic>{
'name': instance.name,
'energy_on_100gr': instance.energy,
'proteins_on_100gr': instance.proteins,
'fats_on_100gr': instance.fats,
'carbohydrates_on_100gr': instance.carbohydrates,
};