feat(diary): Checkboxes for product when diet is chosen

This commit is contained in:
2024-08-16 16:26:22 +03:00
parent 684b2eec9d
commit 9497789eb5
11 changed files with 369 additions and 63 deletions

View File

@@ -24,6 +24,7 @@ mixin _$Portion {
String get product_name => throw _privateConstructorUsedError;
int get quantity => throw _privateConstructorUsedError;
String get portion => throw _privateConstructorUsedError;
bool get from_diet => throw _privateConstructorUsedError;
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
@@ -35,7 +36,12 @@ abstract class $PortionCopyWith<$Res> {
factory $PortionCopyWith(Portion value, $Res Function(Portion) then) =
_$PortionCopyWithImpl<$Res, Portion>;
@useResult
$Res call({int id, String product_name, int quantity, String portion});
$Res call(
{int id,
String product_name,
int quantity,
String portion,
bool from_diet});
}
/// @nodoc
@@ -55,6 +61,7 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion>
Object? product_name = null,
Object? quantity = null,
Object? portion = null,
Object? from_diet = null,
}) {
return _then(_value.copyWith(
id: null == id
@@ -73,6 +80,10 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion>
? _value.portion
: portion // ignore: cast_nullable_to_non_nullable
as String,
from_diet: null == from_diet
? _value.from_diet
: from_diet // ignore: cast_nullable_to_non_nullable
as bool,
) as $Val);
}
}
@@ -84,7 +95,12 @@ abstract class _$$PortionImplCopyWith<$Res> implements $PortionCopyWith<$Res> {
__$$PortionImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id, String product_name, int quantity, String portion});
$Res call(
{int id,
String product_name,
int quantity,
String portion,
bool from_diet});
}
/// @nodoc
@@ -102,6 +118,7 @@ class __$$PortionImplCopyWithImpl<$Res>
Object? product_name = null,
Object? quantity = null,
Object? portion = null,
Object? from_diet = null,
}) {
return _then(_$PortionImpl(
id: null == id
@@ -120,6 +137,10 @@ class __$$PortionImplCopyWithImpl<$Res>
? _value.portion
: portion // ignore: cast_nullable_to_non_nullable
as String,
from_diet: null == from_diet
? _value.from_diet
: from_diet // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
@@ -131,7 +152,8 @@ class _$PortionImpl implements _Portion {
{required this.id,
required this.product_name,
required this.quantity,
required this.portion});
required this.portion,
required this.from_diet});
factory _$PortionImpl.fromJson(Map<String, dynamic> json) =>
_$$PortionImplFromJson(json);
@@ -144,10 +166,12 @@ class _$PortionImpl implements _Portion {
final int quantity;
@override
final String portion;
@override
final bool from_diet;
@override
String toString() {
return 'Portion(id: $id, product_name: $product_name, quantity: $quantity, portion: $portion)';
return 'Portion(id: $id, product_name: $product_name, quantity: $quantity, portion: $portion, from_diet: $from_diet)';
}
@override
@@ -160,13 +184,15 @@ class _$PortionImpl implements _Portion {
other.product_name == product_name) &&
(identical(other.quantity, quantity) ||
other.quantity == quantity) &&
(identical(other.portion, portion) || other.portion == portion));
(identical(other.portion, portion) || other.portion == portion) &&
(identical(other.from_diet, from_diet) ||
other.from_diet == from_diet));
}
@JsonKey(ignore: true)
@override
int get hashCode =>
Object.hash(runtimeType, id, product_name, quantity, portion);
Object.hash(runtimeType, id, product_name, quantity, portion, from_diet);
@JsonKey(ignore: true)
@override
@@ -187,7 +213,8 @@ abstract class _Portion implements Portion {
{required final int id,
required final String product_name,
required final int quantity,
required final String portion}) = _$PortionImpl;
required final String portion,
required final bool from_diet}) = _$PortionImpl;
factory _Portion.fromJson(Map<String, dynamic> json) = _$PortionImpl.fromJson;
@@ -200,6 +227,8 @@ abstract class _Portion implements Portion {
@override
String get portion;
@override
bool get from_diet;
@override
@JsonKey(ignore: true)
_$$PortionImplCopyWith<_$PortionImpl> get copyWith =>
throw _privateConstructorUsedError;