forked from eatvio/eatvio_app
feat(diary): diet
This commit is contained in:
@@ -545,7 +545,7 @@ mixin _$MealModel {
|
||||
@JsonKey(name: "mood")
|
||||
int get mood => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "portions")
|
||||
List<Portion> get portions => throw _privateConstructorUsedError;
|
||||
List<PortionModel> get portions => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "photos")
|
||||
List<DiaryPhotoModel> get photos => throw _privateConstructorUsedError;
|
||||
|
||||
@@ -570,7 +570,7 @@ abstract class $MealModelCopyWith<$Res> {
|
||||
@JsonKey(name: "type_no") int typeNumber,
|
||||
@JsonKey(name: "satiety") int satiety,
|
||||
@JsonKey(name: "mood") int mood,
|
||||
@JsonKey(name: "portions") List<Portion> portions,
|
||||
@JsonKey(name: "portions") List<PortionModel> portions,
|
||||
@JsonKey(name: "photos") List<DiaryPhotoModel> photos});
|
||||
}
|
||||
|
||||
@@ -621,7 +621,7 @@ class _$MealModelCopyWithImpl<$Res, $Val extends MealModel>
|
||||
portions: null == portions
|
||||
? _value.portions
|
||||
: portions // ignore: cast_nullable_to_non_nullable
|
||||
as List<Portion>,
|
||||
as List<PortionModel>,
|
||||
photos: null == photos
|
||||
? _value.photos
|
||||
: photos // ignore: cast_nullable_to_non_nullable
|
||||
@@ -644,7 +644,7 @@ abstract class _$$MealModelImplCopyWith<$Res>
|
||||
@JsonKey(name: "type_no") int typeNumber,
|
||||
@JsonKey(name: "satiety") int satiety,
|
||||
@JsonKey(name: "mood") int mood,
|
||||
@JsonKey(name: "portions") List<Portion> portions,
|
||||
@JsonKey(name: "portions") List<PortionModel> portions,
|
||||
@JsonKey(name: "photos") List<DiaryPhotoModel> photos});
|
||||
}
|
||||
|
||||
@@ -693,7 +693,7 @@ class __$$MealModelImplCopyWithImpl<$Res>
|
||||
portions: null == portions
|
||||
? _value._portions
|
||||
: portions // ignore: cast_nullable_to_non_nullable
|
||||
as List<Portion>,
|
||||
as List<PortionModel>,
|
||||
photos: null == photos
|
||||
? _value._photos
|
||||
: photos // ignore: cast_nullable_to_non_nullable
|
||||
@@ -711,7 +711,7 @@ class _$MealModelImpl implements _MealModel {
|
||||
@JsonKey(name: "type_no") required this.typeNumber,
|
||||
@JsonKey(name: "satiety") required this.satiety,
|
||||
@JsonKey(name: "mood") required this.mood,
|
||||
@JsonKey(name: "portions") required final List<Portion> portions,
|
||||
@JsonKey(name: "portions") required final List<PortionModel> portions,
|
||||
@JsonKey(name: "photos") required final List<DiaryPhotoModel> photos})
|
||||
: _portions = portions,
|
||||
_photos = photos;
|
||||
@@ -734,10 +734,10 @@ class _$MealModelImpl implements _MealModel {
|
||||
@override
|
||||
@JsonKey(name: "mood")
|
||||
final int mood;
|
||||
final List<Portion> _portions;
|
||||
final List<PortionModel> _portions;
|
||||
@override
|
||||
@JsonKey(name: "portions")
|
||||
List<Portion> get portions {
|
||||
List<PortionModel> get portions {
|
||||
if (_portions is EqualUnmodifiableListView) return _portions;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_portions);
|
||||
@@ -807,7 +807,7 @@ abstract class _MealModel implements MealModel {
|
||||
@JsonKey(name: "type_no") required final int typeNumber,
|
||||
@JsonKey(name: "satiety") required final int satiety,
|
||||
@JsonKey(name: "mood") required final int mood,
|
||||
@JsonKey(name: "portions") required final List<Portion> portions,
|
||||
@JsonKey(name: "portions") required final List<PortionModel> portions,
|
||||
@JsonKey(name: "photos")
|
||||
required final List<DiaryPhotoModel> photos}) = _$MealModelImpl;
|
||||
|
||||
@@ -831,7 +831,7 @@ abstract class _MealModel implements MealModel {
|
||||
int get mood;
|
||||
@override
|
||||
@JsonKey(name: "portions")
|
||||
List<Portion> get portions;
|
||||
List<PortionModel> get portions;
|
||||
@override
|
||||
@JsonKey(name: "photos")
|
||||
List<DiaryPhotoModel> get photos;
|
||||
@@ -1071,14 +1071,16 @@ abstract class _DiaryPhotoModel implements DiaryPhotoModel {
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
Portion _$PortionFromJson(Map<String, dynamic> json) {
|
||||
return _Portion.fromJson(json);
|
||||
PortionModel _$PortionModelFromJson(Map<String, dynamic> json) {
|
||||
return _PortionModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Portion {
|
||||
mixin _$PortionModel {
|
||||
@JsonKey(name: "id")
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "product_nutritional_value_id")
|
||||
int? get productNutritionalValueId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "product_name")
|
||||
String get productName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "quantity")
|
||||
@@ -1087,55 +1089,68 @@ mixin _$Portion {
|
||||
String get portion => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "from_diet")
|
||||
bool get fromDiet => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "state")
|
||||
PortionState get portionState => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Portion to a JSON map.
|
||||
/// Serializes this PortionModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of Portion
|
||||
/// Create a copy of PortionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$PortionCopyWith<Portion> get copyWith => throw _privateConstructorUsedError;
|
||||
$PortionModelCopyWith<PortionModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $PortionCopyWith<$Res> {
|
||||
factory $PortionCopyWith(Portion value, $Res Function(Portion) then) =
|
||||
_$PortionCopyWithImpl<$Res, Portion>;
|
||||
abstract class $PortionModelCopyWith<$Res> {
|
||||
factory $PortionModelCopyWith(
|
||||
PortionModel value, $Res Function(PortionModel) then) =
|
||||
_$PortionModelCopyWithImpl<$Res, PortionModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "id") int id,
|
||||
@JsonKey(name: "product_nutritional_value_id")
|
||||
int? productNutritionalValueId,
|
||||
@JsonKey(name: "product_name") String productName,
|
||||
@JsonKey(name: "quantity") int quantity,
|
||||
@JsonKey(name: "portion") String portion,
|
||||
@JsonKey(name: "from_diet") bool fromDiet});
|
||||
@JsonKey(name: "from_diet") bool fromDiet,
|
||||
@JsonKey(name: "state") PortionState portionState});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$PortionCopyWithImpl<$Res, $Val extends Portion>
|
||||
implements $PortionCopyWith<$Res> {
|
||||
_$PortionCopyWithImpl(this._value, this._then);
|
||||
class _$PortionModelCopyWithImpl<$Res, $Val extends PortionModel>
|
||||
implements $PortionModelCopyWith<$Res> {
|
||||
_$PortionModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Portion
|
||||
/// Create a copy of PortionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? productNutritionalValueId = freezed,
|
||||
Object? productName = null,
|
||||
Object? quantity = null,
|
||||
Object? portion = null,
|
||||
Object? fromDiet = null,
|
||||
Object? portionState = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
productNutritionalValueId: freezed == productNutritionalValueId
|
||||
? _value.productNutritionalValueId
|
||||
: productNutritionalValueId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
productName: null == productName
|
||||
? _value.productName
|
||||
: productName // ignore: cast_nullable_to_non_nullable
|
||||
@@ -1152,49 +1167,63 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion>
|
||||
? _value.fromDiet
|
||||
: fromDiet // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
portionState: null == portionState
|
||||
? _value.portionState
|
||||
: portionState // ignore: cast_nullable_to_non_nullable
|
||||
as PortionState,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$PortionImplCopyWith<$Res> implements $PortionCopyWith<$Res> {
|
||||
factory _$$PortionImplCopyWith(
|
||||
_$PortionImpl value, $Res Function(_$PortionImpl) then) =
|
||||
__$$PortionImplCopyWithImpl<$Res>;
|
||||
abstract class _$$PortionModelImplCopyWith<$Res>
|
||||
implements $PortionModelCopyWith<$Res> {
|
||||
factory _$$PortionModelImplCopyWith(
|
||||
_$PortionModelImpl value, $Res Function(_$PortionModelImpl) then) =
|
||||
__$$PortionModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "id") int id,
|
||||
@JsonKey(name: "product_nutritional_value_id")
|
||||
int? productNutritionalValueId,
|
||||
@JsonKey(name: "product_name") String productName,
|
||||
@JsonKey(name: "quantity") int quantity,
|
||||
@JsonKey(name: "portion") String portion,
|
||||
@JsonKey(name: "from_diet") bool fromDiet});
|
||||
@JsonKey(name: "from_diet") bool fromDiet,
|
||||
@JsonKey(name: "state") PortionState portionState});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$PortionImplCopyWithImpl<$Res>
|
||||
extends _$PortionCopyWithImpl<$Res, _$PortionImpl>
|
||||
implements _$$PortionImplCopyWith<$Res> {
|
||||
__$$PortionImplCopyWithImpl(
|
||||
_$PortionImpl _value, $Res Function(_$PortionImpl) _then)
|
||||
class __$$PortionModelImplCopyWithImpl<$Res>
|
||||
extends _$PortionModelCopyWithImpl<$Res, _$PortionModelImpl>
|
||||
implements _$$PortionModelImplCopyWith<$Res> {
|
||||
__$$PortionModelImplCopyWithImpl(
|
||||
_$PortionModelImpl _value, $Res Function(_$PortionModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Portion
|
||||
/// Create a copy of PortionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? productNutritionalValueId = freezed,
|
||||
Object? productName = null,
|
||||
Object? quantity = null,
|
||||
Object? portion = null,
|
||||
Object? fromDiet = null,
|
||||
Object? portionState = null,
|
||||
}) {
|
||||
return _then(_$PortionImpl(
|
||||
return _then(_$PortionModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
productNutritionalValueId: freezed == productNutritionalValueId
|
||||
? _value.productNutritionalValueId
|
||||
: productNutritionalValueId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
productName: null == productName
|
||||
? _value.productName
|
||||
: productName // ignore: cast_nullable_to_non_nullable
|
||||
@@ -1211,27 +1240,37 @@ class __$$PortionImplCopyWithImpl<$Res>
|
||||
? _value.fromDiet
|
||||
: fromDiet // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
portionState: null == portionState
|
||||
? _value.portionState
|
||||
: portionState // ignore: cast_nullable_to_non_nullable
|
||||
as PortionState,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$PortionImpl implements _Portion {
|
||||
const _$PortionImpl(
|
||||
class _$PortionModelImpl implements _PortionModel {
|
||||
const _$PortionModelImpl(
|
||||
{@JsonKey(name: "id") required this.id,
|
||||
@JsonKey(name: "product_nutritional_value_id")
|
||||
this.productNutritionalValueId,
|
||||
@JsonKey(name: "product_name") required this.productName,
|
||||
@JsonKey(name: "quantity") required this.quantity,
|
||||
@JsonKey(name: "portion") required this.portion,
|
||||
@JsonKey(name: "from_diet") required this.fromDiet});
|
||||
@JsonKey(name: "from_diet") required this.fromDiet,
|
||||
@JsonKey(name: "state") required this.portionState});
|
||||
|
||||
factory _$PortionImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$PortionImplFromJson(json);
|
||||
factory _$PortionModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$PortionModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
final int id;
|
||||
@override
|
||||
@JsonKey(name: "product_nutritional_value_id")
|
||||
final int? productNutritionalValueId;
|
||||
@override
|
||||
@JsonKey(name: "product_name")
|
||||
final String productName;
|
||||
@override
|
||||
@@ -1243,63 +1282,78 @@ class _$PortionImpl implements _Portion {
|
||||
@override
|
||||
@JsonKey(name: "from_diet")
|
||||
final bool fromDiet;
|
||||
@override
|
||||
@JsonKey(name: "state")
|
||||
final PortionState portionState;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Portion(id: $id, productName: $productName, quantity: $quantity, portion: $portion, fromDiet: $fromDiet)';
|
||||
return 'PortionModel(id: $id, productNutritionalValueId: $productNutritionalValueId, productName: $productName, quantity: $quantity, portion: $portion, fromDiet: $fromDiet, portionState: $portionState)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$PortionImpl &&
|
||||
other is _$PortionModelImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.productNutritionalValueId,
|
||||
productNutritionalValueId) ||
|
||||
other.productNutritionalValueId == productNutritionalValueId) &&
|
||||
(identical(other.productName, productName) ||
|
||||
other.productName == productName) &&
|
||||
(identical(other.quantity, quantity) ||
|
||||
other.quantity == quantity) &&
|
||||
(identical(other.portion, portion) || other.portion == portion) &&
|
||||
(identical(other.fromDiet, fromDiet) ||
|
||||
other.fromDiet == fromDiet));
|
||||
other.fromDiet == fromDiet) &&
|
||||
(identical(other.portionState, portionState) ||
|
||||
other.portionState == portionState));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, id, productName, quantity, portion, fromDiet);
|
||||
int get hashCode => Object.hash(runtimeType, id, productNutritionalValueId,
|
||||
productName, quantity, portion, fromDiet, portionState);
|
||||
|
||||
/// Create a copy of Portion
|
||||
/// Create a copy of PortionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$PortionImplCopyWith<_$PortionImpl> get copyWith =>
|
||||
__$$PortionImplCopyWithImpl<_$PortionImpl>(this, _$identity);
|
||||
_$$PortionModelImplCopyWith<_$PortionModelImpl> get copyWith =>
|
||||
__$$PortionModelImplCopyWithImpl<_$PortionModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$PortionImplToJson(
|
||||
return _$$PortionModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _Portion implements Portion {
|
||||
const factory _Portion(
|
||||
abstract class _PortionModel implements PortionModel {
|
||||
const factory _PortionModel(
|
||||
{@JsonKey(name: "id") required final int id,
|
||||
@JsonKey(name: "product_nutritional_value_id")
|
||||
final int? productNutritionalValueId,
|
||||
@JsonKey(name: "product_name") required final String productName,
|
||||
@JsonKey(name: "quantity") required final int quantity,
|
||||
@JsonKey(name: "portion") required final String portion,
|
||||
@JsonKey(name: "from_diet") required final bool fromDiet}) =
|
||||
_$PortionImpl;
|
||||
@JsonKey(name: "from_diet") required final bool fromDiet,
|
||||
@JsonKey(name: "state") required final PortionState portionState}) =
|
||||
_$PortionModelImpl;
|
||||
|
||||
factory _Portion.fromJson(Map<String, dynamic> json) = _$PortionImpl.fromJson;
|
||||
factory _PortionModel.fromJson(Map<String, dynamic> json) =
|
||||
_$PortionModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
int get id;
|
||||
@override
|
||||
@JsonKey(name: "product_nutritional_value_id")
|
||||
int? get productNutritionalValueId;
|
||||
@override
|
||||
@JsonKey(name: "product_name")
|
||||
String get productName;
|
||||
@override
|
||||
@@ -1311,12 +1365,15 @@ abstract class _Portion implements Portion {
|
||||
@override
|
||||
@JsonKey(name: "from_diet")
|
||||
bool get fromDiet;
|
||||
@override
|
||||
@JsonKey(name: "state")
|
||||
PortionState get portionState;
|
||||
|
||||
/// Create a copy of Portion
|
||||
/// Create a copy of PortionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$PortionImplCopyWith<_$PortionImpl> get copyWith =>
|
||||
_$$PortionModelImplCopyWith<_$PortionModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user