feat(profile): add profile charts models, requests. Max length of description in posts, recipes, diets = 200

This commit is contained in:
mso7nueh
2024-09-13 14:22:57 +03:00
parent a826cba866
commit c800d35663
111 changed files with 5760 additions and 3215 deletions

View File

@@ -21,19 +21,12 @@ DiaryModel _$DiaryModelFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$DiaryModel {
int get id => throw _privateConstructorUsedError;
DateTime get date => throw _privateConstructorUsedError;
int get closed => throw _privateConstructorUsedError;
List<Meal> get meals => throw _privateConstructorUsedError;
State get state => throw _privateConstructorUsedError;
String? get comment => throw _privateConstructorUsedError;
DateTime? get wakeup => throw _privateConstructorUsedError;
DateTime? get retire => throw _privateConstructorUsedError;
/// Serializes this DiaryModel to a JSON map.
@@ -42,26 +35,36 @@ mixin _$DiaryModel {
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$DiaryModelCopyWith<DiaryModel> get copyWith => throw _privateConstructorUsedError;
$DiaryModelCopyWith<DiaryModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $DiaryModelCopyWith<$Res> {
factory $DiaryModelCopyWith(DiaryModel value, $Res Function(DiaryModel) then) = _$DiaryModelCopyWithImpl<$Res, DiaryModel>;
factory $DiaryModelCopyWith(
DiaryModel value, $Res Function(DiaryModel) then) =
_$DiaryModelCopyWithImpl<$Res, DiaryModel>;
@useResult
$Res call({int id, DateTime date, int closed, List<Meal> meals, State state, String? comment, DateTime? wakeup, DateTime? retire});
$Res call(
{int id,
DateTime date,
int closed,
List<Meal> meals,
State state,
String? comment,
DateTime? wakeup,
DateTime? retire});
$StateCopyWith<$Res> get state;
}
/// @nodoc
class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> implements $DiaryModelCopyWith<$Res> {
class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel>
implements $DiaryModelCopyWith<$Res> {
_$DiaryModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@@ -127,20 +130,34 @@ class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> implements $DiaryM
}
/// @nodoc
abstract class _$$DiaryModelImplCopyWith<$Res> implements $DiaryModelCopyWith<$Res> {
factory _$$DiaryModelImplCopyWith(_$DiaryModelImpl value, $Res Function(_$DiaryModelImpl) then) = __$$DiaryModelImplCopyWithImpl<$Res>;
abstract class _$$DiaryModelImplCopyWith<$Res>
implements $DiaryModelCopyWith<$Res> {
factory _$$DiaryModelImplCopyWith(
_$DiaryModelImpl value, $Res Function(_$DiaryModelImpl) then) =
__$$DiaryModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id, DateTime date, int closed, List<Meal> meals, State state, String? comment, DateTime? wakeup, DateTime? retire});
$Res call(
{int id,
DateTime date,
int closed,
List<Meal> meals,
State state,
String? comment,
DateTime? wakeup,
DateTime? retire});
@override
$StateCopyWith<$Res> get state;
}
/// @nodoc
class __$$DiaryModelImplCopyWithImpl<$Res> extends _$DiaryModelCopyWithImpl<$Res, _$DiaryModelImpl> implements _$$DiaryModelImplCopyWith<$Res> {
__$$DiaryModelImplCopyWithImpl(_$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then) : super(_value, _then);
class __$$DiaryModelImplCopyWithImpl<$Res>
extends _$DiaryModelCopyWithImpl<$Res, _$DiaryModelImpl>
implements _$$DiaryModelImplCopyWith<$Res> {
__$$DiaryModelImplCopyWithImpl(
_$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then)
: super(_value, _then);
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@@ -207,7 +224,8 @@ class _$DiaryModelImpl implements _DiaryModel {
this.retire})
: _meals = meals;
factory _$DiaryModelImpl.fromJson(Map<String, dynamic> json) => _$$DiaryModelImplFromJson(json);
factory _$DiaryModelImpl.fromJson(Map<String, dynamic> json) =>
_$$DiaryModelImplFromJson(json);
@override
final int id;
@@ -216,7 +234,6 @@ class _$DiaryModelImpl implements _DiaryModel {
@override
final int closed;
final List<Meal> _meals;
@override
List<Meal> get meals {
if (_meals is EqualUnmodifiableListView) return _meals;
@@ -255,14 +272,24 @@ class _$DiaryModelImpl implements _DiaryModel {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, date, closed, const DeepCollectionEquality().hash(_meals), state, comment, wakeup, retire);
int get hashCode => Object.hash(
runtimeType,
id,
date,
closed,
const DeepCollectionEquality().hash(_meals),
state,
comment,
wakeup,
retire);
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => __$$DiaryModelImplCopyWithImpl<_$DiaryModelImpl>(this, _$identity);
_$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith =>
__$$DiaryModelImplCopyWithImpl<_$DiaryModelImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -283,29 +310,23 @@ abstract class _DiaryModel implements DiaryModel {
final DateTime? wakeup,
final DateTime? retire}) = _$DiaryModelImpl;
factory _DiaryModel.fromJson(Map<String, dynamic> json) = _$DiaryModelImpl.fromJson;
factory _DiaryModel.fromJson(Map<String, dynamic> json) =
_$DiaryModelImpl.fromJson;
@override
int get id;
@override
DateTime get date;
@override
int get closed;
@override
List<Meal> get meals;
@override
State get state;
@override
String? get comment;
@override
DateTime? get wakeup;
@override
DateTime? get retire;
@@ -313,5 +334,6 @@ abstract class _DiaryModel implements DiaryModel {
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => throw _privateConstructorUsedError;
_$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -6,18 +6,26 @@ part of 'diary_model.dart';
// JsonSerializableGenerator
// **************************************************************************
_$DiaryModelImpl _$$DiaryModelImplFromJson(Map<String, dynamic> json) => _$DiaryModelImpl(
_$DiaryModelImpl _$$DiaryModelImplFromJson(Map<String, dynamic> json) =>
_$DiaryModelImpl(
id: (json['id'] as num).toInt(),
date: DateTime.parse(json['date'] as String),
closed: (json['closed'] as num).toInt(),
meals: (json['meals'] as List<dynamic>).map((e) => Meal.fromJson(e as Map<String, dynamic>)).toList(),
meals: (json['meals'] as List<dynamic>)
.map((e) => Meal.fromJson(e as Map<String, dynamic>))
.toList(),
state: State.fromJson(json['state'] as Map<String, dynamic>),
comment: json['comment'] as String?,
wakeup: json['wakeup'] == null ? null : DateTime.parse(json['wakeup'] as String),
retire: json['retire'] == null ? null : DateTime.parse(json['retire'] as String),
wakeup: json['wakeup'] == null
? null
: DateTime.parse(json['wakeup'] as String),
retire: json['retire'] == null
? null
: DateTime.parse(json['retire'] as String),
);
Map<String, dynamic> _$$DiaryModelImplToJson(_$DiaryModelImpl instance) => <String, dynamic>{
Map<String, dynamic> _$$DiaryModelImplToJson(_$DiaryModelImpl instance) =>
<String, dynamic>{
'id': instance.id,
'date': instance.date.toIso8601String(),
'closed': instance.closed,

View File

@@ -21,17 +21,11 @@ Meal _$MealFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$Meal {
int get id => throw _privateConstructorUsedError;
String get time => throw _privateConstructorUsedError;
int get type => throw _privateConstructorUsedError;
int get satiety => throw _privateConstructorUsedError;
int get mood => throw _privateConstructorUsedError;
List<Portion> get portions => throw _privateConstructorUsedError;
List<Photo> get photos => throw _privateConstructorUsedError;
/// Serializes this Meal to a JSON map.
@@ -45,19 +39,26 @@ mixin _$Meal {
/// @nodoc
abstract class $MealCopyWith<$Res> {
factory $MealCopyWith(Meal value, $Res Function(Meal) then) = _$MealCopyWithImpl<$Res, Meal>;
factory $MealCopyWith(Meal value, $Res Function(Meal) then) =
_$MealCopyWithImpl<$Res, Meal>;
@useResult
$Res call({int id, String time, int type, int satiety, int mood, List<Portion> portions, List<Photo> photos});
$Res call(
{int id,
String time,
int type,
int satiety,
int mood,
List<Portion> portions,
List<Photo> photos});
}
/// @nodoc
class _$MealCopyWithImpl<$Res, $Val extends Meal> implements $MealCopyWith<$Res> {
class _$MealCopyWithImpl<$Res, $Val extends Meal>
implements $MealCopyWith<$Res> {
_$MealCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@@ -109,16 +110,27 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal> implements $MealCopyWith<$Res>
/// @nodoc
abstract class _$$MealImplCopyWith<$Res> implements $MealCopyWith<$Res> {
factory _$$MealImplCopyWith(_$MealImpl value, $Res Function(_$MealImpl) then) = __$$MealImplCopyWithImpl<$Res>;
factory _$$MealImplCopyWith(
_$MealImpl value, $Res Function(_$MealImpl) then) =
__$$MealImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id, String time, int type, int satiety, int mood, List<Portion> portions, List<Photo> photos});
$Res call(
{int id,
String time,
int type,
int satiety,
int mood,
List<Portion> portions,
List<Photo> photos});
}
/// @nodoc
class __$$MealImplCopyWithImpl<$Res> extends _$MealCopyWithImpl<$Res, _$MealImpl> implements _$$MealImplCopyWith<$Res> {
__$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then) : super(_value, _then);
class __$$MealImplCopyWithImpl<$Res>
extends _$MealCopyWithImpl<$Res, _$MealImpl>
implements _$$MealImplCopyWith<$Res> {
__$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then)
: super(_value, _then);
/// Create a copy of Meal
/// with the given fields replaced by the non-null parameter values.
@@ -180,7 +192,8 @@ class _$MealImpl implements _Meal {
: _portions = portions,
_photos = photos;
factory _$MealImpl.fromJson(Map<String, dynamic> json) => _$$MealImplFromJson(json);
factory _$MealImpl.fromJson(Map<String, dynamic> json) =>
_$$MealImplFromJson(json);
@override
final int id;
@@ -193,7 +206,6 @@ class _$MealImpl implements _Meal {
@override
final int mood;
final List<Portion> _portions;
@override
List<Portion> get portions {
if (_portions is EqualUnmodifiableListView) return _portions;
@@ -202,7 +214,6 @@ class _$MealImpl implements _Meal {
}
final List<Photo> _photos;
@override
List<Photo> get photos {
if (_photos is EqualUnmodifiableListView) return _photos;
@@ -231,15 +242,23 @@ class _$MealImpl implements _Meal {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, id, time, type, satiety, mood, const DeepCollectionEquality().hash(_portions), const DeepCollectionEquality().hash(_photos));
int get hashCode => Object.hash(
runtimeType,
id,
time,
type,
satiety,
mood,
const DeepCollectionEquality().hash(_portions),
const DeepCollectionEquality().hash(_photos));
/// Create a copy of Meal
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$MealImplCopyWith<_$MealImpl> get copyWith => __$$MealImplCopyWithImpl<_$MealImpl>(this, _$identity);
_$$MealImplCopyWith<_$MealImpl> get copyWith =>
__$$MealImplCopyWithImpl<_$MealImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -263,22 +282,16 @@ abstract class _Meal implements Meal {
@override
int get id;
@override
String get time;
@override
int get type;
@override
int get satiety;
@override
int get mood;
@override
List<Portion> get portions;
@override
List<Photo> get photos;
@@ -286,5 +299,6 @@ abstract class _Meal implements Meal {
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$MealImplCopyWith<_$MealImpl> get copyWith => throw _privateConstructorUsedError;
_$$MealImplCopyWith<_$MealImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -12,11 +12,16 @@ _$MealImpl _$$MealImplFromJson(Map<String, dynamic> json) => _$MealImpl(
type: (json['type'] as num).toInt(),
satiety: (json['satiety'] as num).toInt(),
mood: (json['mood'] as num).toInt(),
portions: (json['portions'] as List<dynamic>).map((e) => Portion.fromJson(e as Map<String, dynamic>)).toList(),
photos: (json['photos'] as List<dynamic>).map((e) => Photo.fromJson(e as Map<String, dynamic>)).toList(),
portions: (json['portions'] as List<dynamic>)
.map((e) => Portion.fromJson(e as Map<String, dynamic>))
.toList(),
photos: (json['photos'] as List<dynamic>)
.map((e) => Photo.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$$MealImplToJson(_$MealImpl instance) => <String, dynamic>{
Map<String, dynamic> _$$MealImplToJson(_$MealImpl instance) =>
<String, dynamic>{
'id': instance.id,
'time': instance.time,
'type': instance.type,

View File

@@ -21,10 +21,8 @@ Photo _$PhotoFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$Photo {
int get id => throw _privateConstructorUsedError;
@JsonKey(name: 'original_name')
String get originalName => throw _privateConstructorUsedError;
String get path => throw _privateConstructorUsedError;
/// Serializes this Photo to a JSON map.
@@ -38,19 +36,22 @@ mixin _$Photo {
/// @nodoc
abstract class $PhotoCopyWith<$Res> {
factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) = _$PhotoCopyWithImpl<$Res, Photo>;
factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) =
_$PhotoCopyWithImpl<$Res, Photo>;
@useResult
$Res call({int id, @JsonKey(name: 'original_name') String originalName, String path});
$Res call(
{int id,
@JsonKey(name: 'original_name') String originalName,
String path});
}
/// @nodoc
class _$PhotoCopyWithImpl<$Res, $Val extends Photo> implements $PhotoCopyWith<$Res> {
class _$PhotoCopyWithImpl<$Res, $Val extends Photo>
implements $PhotoCopyWith<$Res> {
_$PhotoCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@@ -82,16 +83,24 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo> implements $PhotoCopyWith<$R
/// @nodoc
abstract class _$$PhotoImplCopyWith<$Res> implements $PhotoCopyWith<$Res> {
factory _$$PhotoImplCopyWith(_$PhotoImpl value, $Res Function(_$PhotoImpl) then) = __$$PhotoImplCopyWithImpl<$Res>;
factory _$$PhotoImplCopyWith(
_$PhotoImpl value, $Res Function(_$PhotoImpl) then) =
__$$PhotoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id, @JsonKey(name: 'original_name') String originalName, String path});
$Res call(
{int id,
@JsonKey(name: 'original_name') String originalName,
String path});
}
/// @nodoc
class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl> implements _$$PhotoImplCopyWith<$Res> {
__$$PhotoImplCopyWithImpl(_$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) : super(_value, _then);
class __$$PhotoImplCopyWithImpl<$Res>
extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl>
implements _$$PhotoImplCopyWith<$Res> {
__$$PhotoImplCopyWithImpl(
_$PhotoImpl _value, $Res Function(_$PhotoImpl) _then)
: super(_value, _then);
/// Create a copy of Photo
/// with the given fields replaced by the non-null parameter values.
@@ -122,9 +131,13 @@ class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoI
/// @nodoc
@JsonSerializable()
class _$PhotoImpl implements _Photo {
const _$PhotoImpl({required this.id, @JsonKey(name: 'original_name') required this.originalName, required this.path});
const _$PhotoImpl(
{required this.id,
@JsonKey(name: 'original_name') required this.originalName,
required this.path});
factory _$PhotoImpl.fromJson(Map<String, dynamic> json) => _$$PhotoImplFromJson(json);
factory _$PhotoImpl.fromJson(Map<String, dynamic> json) =>
_$$PhotoImplFromJson(json);
@override
final int id;
@@ -145,7 +158,8 @@ class _$PhotoImpl implements _Photo {
(other.runtimeType == runtimeType &&
other is _$PhotoImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.originalName, originalName) || other.originalName == originalName) &&
(identical(other.originalName, originalName) ||
other.originalName == originalName) &&
(identical(other.path, path) || other.path == path));
}
@@ -158,7 +172,8 @@ class _$PhotoImpl implements _Photo {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => __$$PhotoImplCopyWithImpl<_$PhotoImpl>(this, _$identity);
_$$PhotoImplCopyWith<_$PhotoImpl> get copyWith =>
__$$PhotoImplCopyWithImpl<_$PhotoImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -169,17 +184,18 @@ class _$PhotoImpl implements _Photo {
}
abstract class _Photo implements Photo {
const factory _Photo({required final int id, @JsonKey(name: 'original_name') required final String originalName, required final String path}) = _$PhotoImpl;
const factory _Photo(
{required final int id,
@JsonKey(name: 'original_name') required final String originalName,
required final String path}) = _$PhotoImpl;
factory _Photo.fromJson(Map<String, dynamic> json) = _$PhotoImpl.fromJson;
@override
int get id;
@override
@JsonKey(name: 'original_name')
String get originalName;
@override
String get path;
@@ -187,5 +203,6 @@ abstract class _Photo implements Photo {
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => throw _privateConstructorUsedError;
_$$PhotoImplCopyWith<_$PhotoImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -12,7 +12,8 @@ _$PhotoImpl _$$PhotoImplFromJson(Map<String, dynamic> json) => _$PhotoImpl(
path: json['path'] as String,
);
Map<String, dynamic> _$$PhotoImplToJson(_$PhotoImpl instance) => <String, dynamic>{
Map<String, dynamic> _$$PhotoImplToJson(_$PhotoImpl instance) =>
<String, dynamic>{
'id': instance.id,
'original_name': instance.originalName,
'path': instance.path,

View File

@@ -21,13 +21,9 @@ Portion _$PortionFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$Portion {
int get id => throw _privateConstructorUsedError;
String get product_name => throw _privateConstructorUsedError;
int get quantity => throw _privateConstructorUsedError;
String get portion => throw _privateConstructorUsedError;
bool get from_diet => throw _privateConstructorUsedError;
/// Serializes this Portion to a JSON map.
@@ -41,19 +37,24 @@ mixin _$Portion {
/// @nodoc
abstract class $PortionCopyWith<$Res> {
factory $PortionCopyWith(Portion value, $Res Function(Portion) then) = _$PortionCopyWithImpl<$Res, Portion>;
factory $PortionCopyWith(Portion value, $Res Function(Portion) then) =
_$PortionCopyWithImpl<$Res, Portion>;
@useResult
$Res call({int id, String product_name, int quantity, String portion, bool from_diet});
$Res call(
{int id,
String product_name,
int quantity,
String portion,
bool from_diet});
}
/// @nodoc
class _$PortionCopyWithImpl<$Res, $Val extends Portion> implements $PortionCopyWith<$Res> {
class _$PortionCopyWithImpl<$Res, $Val extends Portion>
implements $PortionCopyWith<$Res> {
_$PortionCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@@ -95,16 +96,26 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion> implements $PortionCopyW
/// @nodoc
abstract class _$$PortionImplCopyWith<$Res> implements $PortionCopyWith<$Res> {
factory _$$PortionImplCopyWith(_$PortionImpl value, $Res Function(_$PortionImpl) then) = __$$PortionImplCopyWithImpl<$Res>;
factory _$$PortionImplCopyWith(
_$PortionImpl value, $Res Function(_$PortionImpl) then) =
__$$PortionImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id, String product_name, int quantity, String portion, bool from_diet});
$Res call(
{int id,
String product_name,
int quantity,
String portion,
bool from_diet});
}
/// @nodoc
class __$$PortionImplCopyWithImpl<$Res> extends _$PortionCopyWithImpl<$Res, _$PortionImpl> implements _$$PortionImplCopyWith<$Res> {
__$$PortionImplCopyWithImpl(_$PortionImpl _value, $Res Function(_$PortionImpl) _then) : super(_value, _then);
class __$$PortionImplCopyWithImpl<$Res>
extends _$PortionCopyWithImpl<$Res, _$PortionImpl>
implements _$$PortionImplCopyWith<$Res> {
__$$PortionImplCopyWithImpl(
_$PortionImpl _value, $Res Function(_$PortionImpl) _then)
: super(_value, _then);
/// Create a copy of Portion
/// with the given fields replaced by the non-null parameter values.
@@ -145,9 +156,15 @@ class __$$PortionImplCopyWithImpl<$Res> extends _$PortionCopyWithImpl<$Res, _$Po
/// @nodoc
@JsonSerializable()
class _$PortionImpl implements _Portion {
const _$PortionImpl({required this.id, required this.product_name, required this.quantity, required this.portion, required this.from_diet});
const _$PortionImpl(
{required this.id,
required this.product_name,
required this.quantity,
required this.portion,
required this.from_diet});
factory _$PortionImpl.fromJson(Map<String, dynamic> json) => _$$PortionImplFromJson(json);
factory _$PortionImpl.fromJson(Map<String, dynamic> json) =>
_$$PortionImplFromJson(json);
@override
final int id;
@@ -171,22 +188,27 @@ class _$PortionImpl implements _Portion {
(other.runtimeType == runtimeType &&
other is _$PortionImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.product_name, product_name) || other.product_name == product_name) &&
(identical(other.quantity, quantity) || other.quantity == quantity) &&
(identical(other.product_name, product_name) ||
other.product_name == product_name) &&
(identical(other.quantity, quantity) ||
other.quantity == quantity) &&
(identical(other.portion, portion) || other.portion == portion) &&
(identical(other.from_diet, from_diet) || other.from_diet == from_diet));
(identical(other.from_diet, from_diet) ||
other.from_diet == from_diet));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, product_name, quantity, portion, from_diet);
int get hashCode =>
Object.hash(runtimeType, id, product_name, quantity, portion, from_diet);
/// Create a copy of Portion
/// 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);
_$$PortionImplCopyWith<_$PortionImpl> get copyWith =>
__$$PortionImplCopyWithImpl<_$PortionImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -208,16 +230,12 @@ abstract class _Portion implements Portion {
@override
int get id;
@override
String get product_name;
@override
int get quantity;
@override
String get portion;
@override
bool get from_diet;
@@ -225,5 +243,6 @@ abstract class _Portion implements Portion {
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PortionImplCopyWith<_$PortionImpl> get copyWith => throw _privateConstructorUsedError;
_$$PortionImplCopyWith<_$PortionImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -6,7 +6,8 @@ part of 'portion.dart';
// JsonSerializableGenerator
// **************************************************************************
_$PortionImpl _$$PortionImplFromJson(Map<String, dynamic> json) => _$PortionImpl(
_$PortionImpl _$$PortionImplFromJson(Map<String, dynamic> json) =>
_$PortionImpl(
id: (json['id'] as num).toInt(),
product_name: json['product_name'] as String,
quantity: (json['quantity'] as num).toInt(),
@@ -14,7 +15,8 @@ _$PortionImpl _$$PortionImplFromJson(Map<String, dynamic> json) => _$PortionImpl
from_diet: json['from_diet'] as bool,
);
Map<String, dynamic> _$$PortionImplToJson(_$PortionImpl instance) => <String, dynamic>{
Map<String, dynamic> _$$PortionImplToJson(_$PortionImpl instance) =>
<String, dynamic>{
'id': instance.id,
'product_name': instance.product_name,
'quantity': instance.quantity,

View File

@@ -21,7 +21,6 @@ Product _$ProductFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$Product {
int get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
/// Serializes this Product to a JSON map.
@@ -35,19 +34,19 @@ mixin _$Product {
/// @nodoc
abstract class $ProductCopyWith<$Res> {
factory $ProductCopyWith(Product value, $Res Function(Product) then) = _$ProductCopyWithImpl<$Res, Product>;
factory $ProductCopyWith(Product value, $Res Function(Product) then) =
_$ProductCopyWithImpl<$Res, Product>;
@useResult
$Res call({int id, String name});
}
/// @nodoc
class _$ProductCopyWithImpl<$Res, $Val extends Product> implements $ProductCopyWith<$Res> {
class _$ProductCopyWithImpl<$Res, $Val extends Product>
implements $ProductCopyWith<$Res> {
_$ProductCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@@ -74,16 +73,21 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product> implements $ProductCopyW
/// @nodoc
abstract class _$$ProductImplCopyWith<$Res> implements $ProductCopyWith<$Res> {
factory _$$ProductImplCopyWith(_$ProductImpl value, $Res Function(_$ProductImpl) then) = __$$ProductImplCopyWithImpl<$Res>;
factory _$$ProductImplCopyWith(
_$ProductImpl value, $Res Function(_$ProductImpl) then) =
__$$ProductImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id, String name});
}
/// @nodoc
class __$$ProductImplCopyWithImpl<$Res> extends _$ProductCopyWithImpl<$Res, _$ProductImpl> implements _$$ProductImplCopyWith<$Res> {
__$$ProductImplCopyWithImpl(_$ProductImpl _value, $Res Function(_$ProductImpl) _then) : super(_value, _then);
class __$$ProductImplCopyWithImpl<$Res>
extends _$ProductCopyWithImpl<$Res, _$ProductImpl>
implements _$$ProductImplCopyWith<$Res> {
__$$ProductImplCopyWithImpl(
_$ProductImpl _value, $Res Function(_$ProductImpl) _then)
: super(_value, _then);
/// Create a copy of Product
/// with the given fields replaced by the non-null parameter values.
@@ -111,7 +115,8 @@ class __$$ProductImplCopyWithImpl<$Res> extends _$ProductCopyWithImpl<$Res, _$Pr
class _$ProductImpl implements _Product {
const _$ProductImpl({required this.id, required this.name});
factory _$ProductImpl.fromJson(Map<String, dynamic> json) => _$$ProductImplFromJson(json);
factory _$ProductImpl.fromJson(Map<String, dynamic> json) =>
_$$ProductImplFromJson(json);
@override
final int id;
@@ -141,7 +146,8 @@ class _$ProductImpl implements _Product {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ProductImplCopyWith<_$ProductImpl> get copyWith => __$$ProductImplCopyWithImpl<_$ProductImpl>(this, _$identity);
_$$ProductImplCopyWith<_$ProductImpl> get copyWith =>
__$$ProductImplCopyWithImpl<_$ProductImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -152,13 +158,13 @@ class _$ProductImpl implements _Product {
}
abstract class _Product implements Product {
const factory _Product({required final int id, required final String name}) = _$ProductImpl;
const factory _Product({required final int id, required final String name}) =
_$ProductImpl;
factory _Product.fromJson(Map<String, dynamic> json) = _$ProductImpl.fromJson;
@override
int get id;
@override
String get name;
@@ -166,5 +172,6 @@ abstract class _Product implements Product {
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ProductImplCopyWith<_$ProductImpl> get copyWith => throw _privateConstructorUsedError;
_$$ProductImplCopyWith<_$ProductImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -6,12 +6,14 @@ part of 'product.dart';
// JsonSerializableGenerator
// **************************************************************************
_$ProductImpl _$$ProductImplFromJson(Map<String, dynamic> json) => _$ProductImpl(
_$ProductImpl _$$ProductImplFromJson(Map<String, dynamic> json) =>
_$ProductImpl(
id: (json['id'] as num).toInt(),
name: json['name'] as String,
);
Map<String, dynamic> _$$ProductImplToJson(_$ProductImpl instance) => <String, dynamic>{
Map<String, dynamic> _$$ProductImplToJson(_$ProductImpl instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
};

View File

@@ -21,7 +21,6 @@ State _$StateFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$State {
bool get has_chosen_diet => throw _privateConstructorUsedError;
bool get has_chosen_plan => throw _privateConstructorUsedError;
/// Serializes this State to a JSON map.
@@ -35,19 +34,19 @@ mixin _$State {
/// @nodoc
abstract class $StateCopyWith<$Res> {
factory $StateCopyWith(State value, $Res Function(State) then) = _$StateCopyWithImpl<$Res, State>;
factory $StateCopyWith(State value, $Res Function(State) then) =
_$StateCopyWithImpl<$Res, State>;
@useResult
$Res call({bool has_chosen_diet, bool has_chosen_plan});
}
/// @nodoc
class _$StateCopyWithImpl<$Res, $Val extends State> implements $StateCopyWith<$Res> {
class _$StateCopyWithImpl<$Res, $Val extends State>
implements $StateCopyWith<$Res> {
_$StateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@@ -74,16 +73,21 @@ class _$StateCopyWithImpl<$Res, $Val extends State> implements $StateCopyWith<$R
/// @nodoc
abstract class _$$StateImplCopyWith<$Res> implements $StateCopyWith<$Res> {
factory _$$StateImplCopyWith(_$StateImpl value, $Res Function(_$StateImpl) then) = __$$StateImplCopyWithImpl<$Res>;
factory _$$StateImplCopyWith(
_$StateImpl value, $Res Function(_$StateImpl) then) =
__$$StateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({bool has_chosen_diet, bool has_chosen_plan});
}
/// @nodoc
class __$$StateImplCopyWithImpl<$Res> extends _$StateCopyWithImpl<$Res, _$StateImpl> implements _$$StateImplCopyWith<$Res> {
__$$StateImplCopyWithImpl(_$StateImpl _value, $Res Function(_$StateImpl) _then) : super(_value, _then);
class __$$StateImplCopyWithImpl<$Res>
extends _$StateCopyWithImpl<$Res, _$StateImpl>
implements _$$StateImplCopyWith<$Res> {
__$$StateImplCopyWithImpl(
_$StateImpl _value, $Res Function(_$StateImpl) _then)
: super(_value, _then);
/// Create a copy of State
/// with the given fields replaced by the non-null parameter values.
@@ -109,9 +113,11 @@ class __$$StateImplCopyWithImpl<$Res> extends _$StateCopyWithImpl<$Res, _$StateI
/// @nodoc
@JsonSerializable()
class _$StateImpl implements _State {
const _$StateImpl({required this.has_chosen_diet, required this.has_chosen_plan});
const _$StateImpl(
{required this.has_chosen_diet, required this.has_chosen_plan});
factory _$StateImpl.fromJson(Map<String, dynamic> json) => _$$StateImplFromJson(json);
factory _$StateImpl.fromJson(Map<String, dynamic> json) =>
_$$StateImplFromJson(json);
@override
final bool has_chosen_diet;
@@ -128,20 +134,24 @@ class _$StateImpl implements _State {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$StateImpl &&
(identical(other.has_chosen_diet, has_chosen_diet) || other.has_chosen_diet == has_chosen_diet) &&
(identical(other.has_chosen_plan, has_chosen_plan) || other.has_chosen_plan == has_chosen_plan));
(identical(other.has_chosen_diet, has_chosen_diet) ||
other.has_chosen_diet == has_chosen_diet) &&
(identical(other.has_chosen_plan, has_chosen_plan) ||
other.has_chosen_plan == has_chosen_plan));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, has_chosen_diet, has_chosen_plan);
int get hashCode =>
Object.hash(runtimeType, has_chosen_diet, has_chosen_plan);
/// Create a copy of State
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$StateImplCopyWith<_$StateImpl> get copyWith => __$$StateImplCopyWithImpl<_$StateImpl>(this, _$identity);
_$$StateImplCopyWith<_$StateImpl> get copyWith =>
__$$StateImplCopyWithImpl<_$StateImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
@@ -152,13 +162,14 @@ class _$StateImpl implements _State {
}
abstract class _State implements State {
const factory _State({required final bool has_chosen_diet, required final bool has_chosen_plan}) = _$StateImpl;
const factory _State(
{required final bool has_chosen_diet,
required final bool has_chosen_plan}) = _$StateImpl;
factory _State.fromJson(Map<String, dynamic> json) = _$StateImpl.fromJson;
@override
bool get has_chosen_diet;
@override
bool get has_chosen_plan;
@@ -166,5 +177,6 @@ abstract class _State implements State {
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$StateImplCopyWith<_$StateImpl> get copyWith => throw _privateConstructorUsedError;
_$$StateImplCopyWith<_$StateImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -11,7 +11,8 @@ _$StateImpl _$$StateImplFromJson(Map<String, dynamic> json) => _$StateImpl(
has_chosen_plan: json['has_chosen_plan'] as bool,
);
Map<String, dynamic> _$$StateImplToJson(_$StateImpl instance) => <String, dynamic>{
Map<String, dynamic> _$$StateImplToJson(_$StateImpl instance) =>
<String, dynamic>{
'has_chosen_diet': instance.has_chosen_diet,
'has_chosen_plan': instance.has_chosen_plan,
};