forked from eatvio/eatvio_app
diet creation page
This commit is contained in:
@@ -288,6 +288,8 @@ mixin _$Diet {
|
||||
bool get wasLikedByMe => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "is_favorite")
|
||||
bool get isFavorite => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "daily_nutrition")
|
||||
List<DailyNutrition> get dailyNutrition => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Diet to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -318,7 +320,8 @@ abstract class $DietCopyWith<$Res> {
|
||||
@JsonKey(name: "total_views") int totalViews,
|
||||
@JsonKey(name: "total_comments") int totalComments,
|
||||
@JsonKey(name: "was_liked_by_me") bool wasLikedByMe,
|
||||
@JsonKey(name: "is_favorite") bool isFavorite});
|
||||
@JsonKey(name: "is_favorite") bool isFavorite,
|
||||
@JsonKey(name: "daily_nutrition") List<DailyNutrition> dailyNutrition});
|
||||
|
||||
$DietTypeCopyWith<$Res> get type;
|
||||
$AuthorCopyWith<$Res> get author;
|
||||
@@ -353,6 +356,7 @@ class _$DietCopyWithImpl<$Res, $Val extends Diet>
|
||||
Object? totalComments = null,
|
||||
Object? wasLikedByMe = null,
|
||||
Object? isFavorite = null,
|
||||
Object? dailyNutrition = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
@@ -411,6 +415,10 @@ class _$DietCopyWithImpl<$Res, $Val extends Diet>
|
||||
? _value.isFavorite
|
||||
: isFavorite // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
dailyNutrition: null == dailyNutrition
|
||||
? _value.dailyNutrition
|
||||
: dailyNutrition // ignore: cast_nullable_to_non_nullable
|
||||
as List<DailyNutrition>,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
@@ -457,7 +465,8 @@ abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> {
|
||||
@JsonKey(name: "total_views") int totalViews,
|
||||
@JsonKey(name: "total_comments") int totalComments,
|
||||
@JsonKey(name: "was_liked_by_me") bool wasLikedByMe,
|
||||
@JsonKey(name: "is_favorite") bool isFavorite});
|
||||
@JsonKey(name: "is_favorite") bool isFavorite,
|
||||
@JsonKey(name: "daily_nutrition") List<DailyNutrition> dailyNutrition});
|
||||
|
||||
@override
|
||||
$DietTypeCopyWith<$Res> get type;
|
||||
@@ -491,6 +500,7 @@ class __$$DietImplCopyWithImpl<$Res>
|
||||
Object? totalComments = null,
|
||||
Object? wasLikedByMe = null,
|
||||
Object? isFavorite = null,
|
||||
Object? dailyNutrition = null,
|
||||
}) {
|
||||
return _then(_$DietImpl(
|
||||
id: null == id
|
||||
@@ -549,6 +559,10 @@ class __$$DietImplCopyWithImpl<$Res>
|
||||
? _value.isFavorite
|
||||
: isFavorite // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
dailyNutrition: null == dailyNutrition
|
||||
? _value._dailyNutrition
|
||||
: dailyNutrition // ignore: cast_nullable_to_non_nullable
|
||||
as List<DailyNutrition>,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -571,8 +585,11 @@ class _$DietImpl implements _Diet {
|
||||
@JsonKey(name: "total_views") required this.totalViews,
|
||||
@JsonKey(name: "total_comments") required this.totalComments,
|
||||
@JsonKey(name: "was_liked_by_me") required this.wasLikedByMe,
|
||||
@JsonKey(name: "is_favorite") required this.isFavorite})
|
||||
: _dailySchedule = dailySchedule;
|
||||
@JsonKey(name: "is_favorite") required this.isFavorite,
|
||||
@JsonKey(name: "daily_nutrition")
|
||||
required final List<DailyNutrition> dailyNutrition})
|
||||
: _dailySchedule = dailySchedule,
|
||||
_dailyNutrition = dailyNutrition;
|
||||
|
||||
factory _$DietImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$DietImplFromJson(json);
|
||||
@@ -625,10 +642,18 @@ class _$DietImpl implements _Diet {
|
||||
@override
|
||||
@JsonKey(name: "is_favorite")
|
||||
final bool isFavorite;
|
||||
final List<DailyNutrition> _dailyNutrition;
|
||||
@override
|
||||
@JsonKey(name: "daily_nutrition")
|
||||
List<DailyNutrition> get dailyNutrition {
|
||||
if (_dailyNutrition is EqualUnmodifiableListView) return _dailyNutrition;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_dailyNutrition);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Diet(id: $id, name: $name, image: $image, duration: $duration, state: $state, type: $type, details: $details, dailySchedule: $dailySchedule, author: $author, totalLikes: $totalLikes, totalViews: $totalViews, totalComments: $totalComments, wasLikedByMe: $wasLikedByMe, isFavorite: $isFavorite)';
|
||||
return 'Diet(id: $id, name: $name, image: $image, duration: $duration, state: $state, type: $type, details: $details, dailySchedule: $dailySchedule, author: $author, totalLikes: $totalLikes, totalViews: $totalViews, totalComments: $totalComments, wasLikedByMe: $wasLikedByMe, isFavorite: $isFavorite, dailyNutrition: $dailyNutrition)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -656,7 +681,9 @@ class _$DietImpl implements _Diet {
|
||||
(identical(other.wasLikedByMe, wasLikedByMe) ||
|
||||
other.wasLikedByMe == wasLikedByMe) &&
|
||||
(identical(other.isFavorite, isFavorite) ||
|
||||
other.isFavorite == isFavorite));
|
||||
other.isFavorite == isFavorite) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._dailyNutrition, _dailyNutrition));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -676,7 +703,8 @@ class _$DietImpl implements _Diet {
|
||||
totalViews,
|
||||
totalComments,
|
||||
wasLikedByMe,
|
||||
isFavorite);
|
||||
isFavorite,
|
||||
const DeepCollectionEquality().hash(_dailyNutrition));
|
||||
|
||||
/// Create a copy of Diet
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -696,22 +724,23 @@ class _$DietImpl implements _Diet {
|
||||
|
||||
abstract class _Diet implements Diet {
|
||||
const factory _Diet(
|
||||
{@JsonKey(name: "id") required final int id,
|
||||
@JsonKey(name: "name") required final String name,
|
||||
@JsonKey(name: "image") required final String image,
|
||||
@JsonKey(name: "duration") required final int duration,
|
||||
@JsonKey(name: "state") required final String state,
|
||||
@JsonKey(name: "type") required final DietType type,
|
||||
@JsonKey(name: "details") required final String details,
|
||||
@JsonKey(name: "daily_schedule")
|
||||
required final List<List<List<DailySchedule>>> dailySchedule,
|
||||
@JsonKey(name: "author") required final Author author,
|
||||
@JsonKey(name: "total_likes") required final int totalLikes,
|
||||
@JsonKey(name: "total_views") required final int totalViews,
|
||||
@JsonKey(name: "total_comments") required final int totalComments,
|
||||
@JsonKey(name: "was_liked_by_me") required final bool wasLikedByMe,
|
||||
@JsonKey(name: "is_favorite") required final bool isFavorite}) =
|
||||
_$DietImpl;
|
||||
{@JsonKey(name: "id") required final int id,
|
||||
@JsonKey(name: "name") required final String name,
|
||||
@JsonKey(name: "image") required final String image,
|
||||
@JsonKey(name: "duration") required final int duration,
|
||||
@JsonKey(name: "state") required final String state,
|
||||
@JsonKey(name: "type") required final DietType type,
|
||||
@JsonKey(name: "details") required final String details,
|
||||
@JsonKey(name: "daily_schedule")
|
||||
required final List<List<List<DailySchedule>>> dailySchedule,
|
||||
@JsonKey(name: "author") required final Author author,
|
||||
@JsonKey(name: "total_likes") required final int totalLikes,
|
||||
@JsonKey(name: "total_views") required final int totalViews,
|
||||
@JsonKey(name: "total_comments") required final int totalComments,
|
||||
@JsonKey(name: "was_liked_by_me") required final bool wasLikedByMe,
|
||||
@JsonKey(name: "is_favorite") required final bool isFavorite,
|
||||
@JsonKey(name: "daily_nutrition")
|
||||
required final List<DailyNutrition> dailyNutrition}) = _$DietImpl;
|
||||
|
||||
factory _Diet.fromJson(Map<String, dynamic> json) = _$DietImpl.fromJson;
|
||||
|
||||
@@ -757,6 +786,9 @@ abstract class _Diet implements Diet {
|
||||
@override
|
||||
@JsonKey(name: "is_favorite")
|
||||
bool get isFavorite;
|
||||
@override
|
||||
@JsonKey(name: "daily_nutrition")
|
||||
List<DailyNutrition> get dailyNutrition;
|
||||
|
||||
/// Create a copy of Diet
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -1444,3 +1476,233 @@ abstract class _DietType implements DietType {
|
||||
_$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
DailyNutrition _$DailyNutritionFromJson(Map<String, dynamic> json) {
|
||||
return _DailyNutrition.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DailyNutrition {
|
||||
@JsonKey(name: 'energy')
|
||||
double get energy => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'proteins')
|
||||
double get proteins => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'fats')
|
||||
double get fats => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'carbohydrates')
|
||||
double get carbohydrates => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this DailyNutrition to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of DailyNutrition
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$DailyNutritionCopyWith<DailyNutrition> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $DailyNutritionCopyWith<$Res> {
|
||||
factory $DailyNutritionCopyWith(
|
||||
DailyNutrition value, $Res Function(DailyNutrition) then) =
|
||||
_$DailyNutritionCopyWithImpl<$Res, DailyNutrition>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'energy') double energy,
|
||||
@JsonKey(name: 'proteins') double proteins,
|
||||
@JsonKey(name: 'fats') double fats,
|
||||
@JsonKey(name: 'carbohydrates') double carbohydrates});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$DailyNutritionCopyWithImpl<$Res, $Val extends DailyNutrition>
|
||||
implements $DailyNutritionCopyWith<$Res> {
|
||||
_$DailyNutritionCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of DailyNutrition
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? energy = null,
|
||||
Object? proteins = null,
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DailyNutritionImplCopyWith<$Res>
|
||||
implements $DailyNutritionCopyWith<$Res> {
|
||||
factory _$$DailyNutritionImplCopyWith(_$DailyNutritionImpl value,
|
||||
$Res Function(_$DailyNutritionImpl) then) =
|
||||
__$$DailyNutritionImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'energy') double energy,
|
||||
@JsonKey(name: 'proteins') double proteins,
|
||||
@JsonKey(name: 'fats') double fats,
|
||||
@JsonKey(name: 'carbohydrates') double carbohydrates});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DailyNutritionImplCopyWithImpl<$Res>
|
||||
extends _$DailyNutritionCopyWithImpl<$Res, _$DailyNutritionImpl>
|
||||
implements _$$DailyNutritionImplCopyWith<$Res> {
|
||||
__$$DailyNutritionImplCopyWithImpl(
|
||||
_$DailyNutritionImpl _value, $Res Function(_$DailyNutritionImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of DailyNutrition
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? energy = null,
|
||||
Object? proteins = null,
|
||||
Object? fats = null,
|
||||
Object? carbohydrates = null,
|
||||
}) {
|
||||
return _then(_$DailyNutritionImpl(
|
||||
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 _$DailyNutritionImpl implements _DailyNutrition {
|
||||
const _$DailyNutritionImpl(
|
||||
{@JsonKey(name: 'energy') required this.energy,
|
||||
@JsonKey(name: 'proteins') required this.proteins,
|
||||
@JsonKey(name: 'fats') required this.fats,
|
||||
@JsonKey(name: 'carbohydrates') required this.carbohydrates});
|
||||
|
||||
factory _$DailyNutritionImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$DailyNutritionImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'energy')
|
||||
final double energy;
|
||||
@override
|
||||
@JsonKey(name: 'proteins')
|
||||
final double proteins;
|
||||
@override
|
||||
@JsonKey(name: 'fats')
|
||||
final double fats;
|
||||
@override
|
||||
@JsonKey(name: 'carbohydrates')
|
||||
final double carbohydrates;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DailyNutrition(energy: $energy, proteins: $proteins, fats: $fats, carbohydrates: $carbohydrates)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$DailyNutritionImpl &&
|
||||
(identical(other.energy, energy) || other.energy == energy) &&
|
||||
(identical(other.proteins, proteins) ||
|
||||
other.proteins == proteins) &&
|
||||
(identical(other.fats, fats) || other.fats == fats) &&
|
||||
(identical(other.carbohydrates, carbohydrates) ||
|
||||
other.carbohydrates == carbohydrates));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, energy, proteins, fats, carbohydrates);
|
||||
|
||||
/// Create a copy of DailyNutrition
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DailyNutritionImplCopyWith<_$DailyNutritionImpl> get copyWith =>
|
||||
__$$DailyNutritionImplCopyWithImpl<_$DailyNutritionImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$DailyNutritionImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _DailyNutrition implements DailyNutrition {
|
||||
const factory _DailyNutrition(
|
||||
{@JsonKey(name: 'energy') required final double energy,
|
||||
@JsonKey(name: 'proteins') required final double proteins,
|
||||
@JsonKey(name: 'fats') required final double fats,
|
||||
@JsonKey(name: 'carbohydrates')
|
||||
required final double carbohydrates}) = _$DailyNutritionImpl;
|
||||
|
||||
factory _DailyNutrition.fromJson(Map<String, dynamic> json) =
|
||||
_$DailyNutritionImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'energy')
|
||||
double get energy;
|
||||
@override
|
||||
@JsonKey(name: 'proteins')
|
||||
double get proteins;
|
||||
@override
|
||||
@JsonKey(name: 'fats')
|
||||
double get fats;
|
||||
@override
|
||||
@JsonKey(name: 'carbohydrates')
|
||||
double get carbohydrates;
|
||||
|
||||
/// Create a copy of DailyNutrition
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$DailyNutritionImplCopyWith<_$DailyNutritionImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user