forked from eatvio/eatvio_app
feat(order info): added order info screen
This commit is contained in:
@@ -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
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
);
|
||||
} catch (e) {
|
||||
emit(DiaryState.error(errorMessage: e.toString()));
|
||||
throw e;
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
int? productNutritionalValueId,
|
||||
required PortionState portionState,
|
||||
}) async {
|
||||
if (portionState == PortionState.filled_diet || portionState == PortionState.eaten_from_diet) {
|
||||
if (portionState == PortionState.filledDiet || portionState == PortionState.eatenFromDiet) {
|
||||
await diaryRepository.addPortionToMeal(
|
||||
diaryId: diaryId,
|
||||
mealId: mealId,
|
||||
|
||||
@@ -12,8 +12,7 @@ part of 'diary_state.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');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DiaryState {
|
||||
@@ -22,55 +21,48 @@ mixin _$DiaryState {
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String errorMessage) error,
|
||||
required TResult Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)
|
||||
loaded,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)
|
||||
loaded,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
TResult? Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)?
|
||||
loaded,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String errorMessage)? error,
|
||||
TResult Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)?
|
||||
loaded,
|
||||
TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
required TResult orElse(),
|
||||
}) => throw _privateConstructorUsedError;
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value) $default, {
|
||||
required TResult Function(DiaryStateLoading value) loading,
|
||||
required TResult Function(DiaryStateError value) error,
|
||||
required TResult Function(DiaryStateLoaded value) loaded,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_DiaryState value)? $default, {
|
||||
TResult? Function(DiaryStateLoading value)? loading,
|
||||
TResult? Function(DiaryStateError value)? error,
|
||||
TResult? Function(DiaryStateLoaded value)? loaded,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value)? $default, {
|
||||
@@ -78,15 +70,15 @@ mixin _$DiaryState {
|
||||
TResult Function(DiaryStateError value)? error,
|
||||
TResult Function(DiaryStateLoaded value)? loaded,
|
||||
required TResult orElse(),
|
||||
}) => throw _privateConstructorUsedError;
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $DiaryStateCopyWith<$Res> {
|
||||
factory $DiaryStateCopyWith(
|
||||
DiaryState value,
|
||||
$Res Function(DiaryState) then,
|
||||
) = _$DiaryStateCopyWithImpl<$Res, DiaryState>;
|
||||
DiaryState value, $Res Function(DiaryState) then) =
|
||||
_$DiaryStateCopyWithImpl<$Res, DiaryState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -106,9 +98,8 @@ class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState>
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateImplCopyWith<$Res> {
|
||||
factory _$$DiaryStateImplCopyWith(
|
||||
_$DiaryStateImpl value,
|
||||
$Res Function(_$DiaryStateImpl) then,
|
||||
) = __$$DiaryStateImplCopyWithImpl<$Res>;
|
||||
_$DiaryStateImpl value, $Res Function(_$DiaryStateImpl) then) =
|
||||
__$$DiaryStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -116,9 +107,8 @@ class __$$DiaryStateImplCopyWithImpl<$Res>
|
||||
extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateImpl>
|
||||
implements _$$DiaryStateImplCopyWith<$Res> {
|
||||
__$$DiaryStateImplCopyWithImpl(
|
||||
_$DiaryStateImpl _value,
|
||||
$Res Function(_$DiaryStateImpl) _then,
|
||||
) : super(_value, _then);
|
||||
_$DiaryStateImpl _value, $Res Function(_$DiaryStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -149,13 +139,9 @@ class _$DiaryStateImpl implements _DiaryState {
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String errorMessage) error,
|
||||
required TResult Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)
|
||||
loaded,
|
||||
required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)
|
||||
loaded,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
@@ -166,13 +152,9 @@ class _$DiaryStateImpl implements _DiaryState {
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
TResult? Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)?
|
||||
loaded,
|
||||
TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
@@ -183,13 +165,9 @@ class _$DiaryStateImpl implements _DiaryState {
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String errorMessage)? error,
|
||||
TResult Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)?
|
||||
loaded,
|
||||
TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
@@ -242,20 +220,18 @@ abstract class _DiaryState implements DiaryState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$DiaryStateLoadingImplCopyWith(
|
||||
_$DiaryStateLoadingImpl value,
|
||||
$Res Function(_$DiaryStateLoadingImpl) then,
|
||||
) = __$$DiaryStateLoadingImplCopyWithImpl<$Res>;
|
||||
factory _$$DiaryStateLoadingImplCopyWith(_$DiaryStateLoadingImpl value,
|
||||
$Res Function(_$DiaryStateLoadingImpl) then) =
|
||||
__$$DiaryStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DiaryStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadingImpl>
|
||||
implements _$$DiaryStateLoadingImplCopyWith<$Res> {
|
||||
__$$DiaryStateLoadingImplCopyWithImpl(
|
||||
_$DiaryStateLoadingImpl _value,
|
||||
$Res Function(_$DiaryStateLoadingImpl) _then,
|
||||
) : super(_value, _then);
|
||||
__$$DiaryStateLoadingImplCopyWithImpl(_$DiaryStateLoadingImpl _value,
|
||||
$Res Function(_$DiaryStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -286,13 +262,9 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading {
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String errorMessage) error,
|
||||
required TResult Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)
|
||||
loaded,
|
||||
required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)
|
||||
loaded,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
@@ -303,13 +275,9 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading {
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
TResult? Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)?
|
||||
loaded,
|
||||
TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
@@ -320,13 +288,9 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading {
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String errorMessage)? error,
|
||||
TResult Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)?
|
||||
loaded,
|
||||
TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
@@ -379,10 +343,9 @@ abstract class DiaryStateLoading implements DiaryState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateErrorImplCopyWith<$Res> {
|
||||
factory _$$DiaryStateErrorImplCopyWith(
|
||||
_$DiaryStateErrorImpl value,
|
||||
$Res Function(_$DiaryStateErrorImpl) then,
|
||||
) = __$$DiaryStateErrorImplCopyWithImpl<$Res>;
|
||||
factory _$$DiaryStateErrorImplCopyWith(_$DiaryStateErrorImpl value,
|
||||
$Res Function(_$DiaryStateErrorImpl) then) =
|
||||
__$$DiaryStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
@@ -392,24 +355,22 @@ class __$$DiaryStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateErrorImpl>
|
||||
implements _$$DiaryStateErrorImplCopyWith<$Res> {
|
||||
__$$DiaryStateErrorImplCopyWithImpl(
|
||||
_$DiaryStateErrorImpl _value,
|
||||
$Res Function(_$DiaryStateErrorImpl) _then,
|
||||
) : super(_value, _then);
|
||||
_$DiaryStateErrorImpl _value, $Res Function(_$DiaryStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({Object? errorMessage = null}) {
|
||||
return _then(
|
||||
_$DiaryStateErrorImpl(
|
||||
errorMessage:
|
||||
null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
),
|
||||
);
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$DiaryStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,9 +406,7 @@ class _$DiaryStateErrorImpl implements DiaryStateError {
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith =>
|
||||
__$$DiaryStateErrorImplCopyWithImpl<_$DiaryStateErrorImpl>(
|
||||
this,
|
||||
_$identity,
|
||||
);
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
@@ -455,13 +414,9 @@ class _$DiaryStateErrorImpl implements DiaryStateError {
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String errorMessage) error,
|
||||
required TResult Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)
|
||||
loaded,
|
||||
required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)
|
||||
loaded,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
@@ -472,13 +427,9 @@ class _$DiaryStateErrorImpl implements DiaryStateError {
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
TResult? Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)?
|
||||
loaded,
|
||||
TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
@@ -489,13 +440,9 @@ class _$DiaryStateErrorImpl implements DiaryStateError {
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String errorMessage)? error,
|
||||
TResult Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)?
|
||||
loaded,
|
||||
TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
@@ -557,17 +504,15 @@ abstract class DiaryStateError implements DiaryState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$DiaryStateLoadedImplCopyWith(
|
||||
_$DiaryStateLoadedImpl value,
|
||||
$Res Function(_$DiaryStateLoadedImpl) then,
|
||||
) = __$$DiaryStateLoadedImplCopyWithImpl<$Res>;
|
||||
factory _$$DiaryStateLoadedImplCopyWith(_$DiaryStateLoadedImpl value,
|
||||
$Res Function(_$DiaryStateLoadedImpl) then) =
|
||||
__$$DiaryStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
});
|
||||
$Res call(
|
||||
{DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal});
|
||||
|
||||
$DiaryDayModelCopyWith<$Res> get diary;
|
||||
$NutritionDataModelCopyWith<$Res> get nutrition;
|
||||
@@ -577,10 +522,9 @@ abstract class _$$DiaryStateLoadedImplCopyWith<$Res> {
|
||||
class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadedImpl>
|
||||
implements _$$DiaryStateLoadedImplCopyWith<$Res> {
|
||||
__$$DiaryStateLoadedImplCopyWithImpl(
|
||||
_$DiaryStateLoadedImpl _value,
|
||||
$Res Function(_$DiaryStateLoadedImpl) _then,
|
||||
) : super(_value, _then);
|
||||
__$$DiaryStateLoadedImplCopyWithImpl(_$DiaryStateLoadedImpl _value,
|
||||
$Res Function(_$DiaryStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -592,30 +536,24 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
|
||||
Object? selectedDay = null,
|
||||
Object? selectedMeal = null,
|
||||
}) {
|
||||
return _then(
|
||||
_$DiaryStateLoadedImpl(
|
||||
diary:
|
||||
null == diary
|
||||
? _value.diary
|
||||
: diary // ignore: cast_nullable_to_non_nullable
|
||||
as DiaryDayModel,
|
||||
nutrition:
|
||||
null == nutrition
|
||||
? _value.nutrition
|
||||
: nutrition // ignore: cast_nullable_to_non_nullable
|
||||
as NutritionDataModel,
|
||||
selectedDay:
|
||||
null == selectedDay
|
||||
? _value.selectedDay
|
||||
: selectedDay // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
selectedMeal:
|
||||
null == selectedMeal
|
||||
? _value.selectedMeal
|
||||
: selectedMeal // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
),
|
||||
);
|
||||
return _then(_$DiaryStateLoadedImpl(
|
||||
diary: null == diary
|
||||
? _value.diary
|
||||
: diary // ignore: cast_nullable_to_non_nullable
|
||||
as DiaryDayModel,
|
||||
nutrition: null == nutrition
|
||||
? _value.nutrition
|
||||
: nutrition // ignore: cast_nullable_to_non_nullable
|
||||
as NutritionDataModel,
|
||||
selectedDay: null == selectedDay
|
||||
? _value.selectedDay
|
||||
: selectedDay // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
selectedMeal: null == selectedMeal
|
||||
? _value.selectedMeal
|
||||
: selectedMeal // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
@@ -642,12 +580,11 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
|
||||
class _$DiaryStateLoadedImpl implements DiaryStateLoaded {
|
||||
const _$DiaryStateLoadedImpl({
|
||||
required this.diary,
|
||||
required this.nutrition,
|
||||
required this.selectedDay,
|
||||
required this.selectedMeal,
|
||||
});
|
||||
const _$DiaryStateLoadedImpl(
|
||||
{required this.diary,
|
||||
required this.nutrition,
|
||||
required this.selectedDay,
|
||||
required this.selectedMeal});
|
||||
|
||||
@override
|
||||
final DiaryDayModel diary;
|
||||
@@ -688,9 +625,7 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded {
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith =>
|
||||
__$$DiaryStateLoadedImplCopyWithImpl<_$DiaryStateLoadedImpl>(
|
||||
this,
|
||||
_$identity,
|
||||
);
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
@@ -698,13 +633,9 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded {
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String errorMessage) error,
|
||||
required TResult Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)
|
||||
loaded,
|
||||
required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)
|
||||
loaded,
|
||||
}) {
|
||||
return loaded(diary, nutrition, selectedDay, selectedMeal);
|
||||
}
|
||||
@@ -715,13 +646,9 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded {
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
TResult? Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)?
|
||||
loaded,
|
||||
TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
}) {
|
||||
return loaded?.call(diary, nutrition, selectedDay, selectedMeal);
|
||||
}
|
||||
@@ -732,13 +659,9 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded {
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String errorMessage)? error,
|
||||
TResult Function(
|
||||
DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal,
|
||||
)?
|
||||
loaded,
|
||||
TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
@@ -786,12 +709,11 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded {
|
||||
}
|
||||
|
||||
abstract class DiaryStateLoaded implements DiaryState {
|
||||
const factory DiaryStateLoaded({
|
||||
required final DiaryDayModel diary,
|
||||
required final NutritionDataModel nutrition,
|
||||
required final DateTime selectedDay,
|
||||
required final int selectedMeal,
|
||||
}) = _$DiaryStateLoadedImpl;
|
||||
const factory DiaryStateLoaded(
|
||||
{required final DiaryDayModel diary,
|
||||
required final NutritionDataModel nutrition,
|
||||
required final DateTime selectedDay,
|
||||
required final int selectedMeal}) = _$DiaryStateLoadedImpl;
|
||||
|
||||
DiaryDayModel get diary;
|
||||
NutritionDataModel get nutrition;
|
||||
|
||||
@@ -46,14 +46,14 @@ class _DiaryScreenState extends State<DiaryScreen> {
|
||||
physics: const BouncingScrollPhysics(),
|
||||
child: Column(
|
||||
children: [
|
||||
CalendarWidget(),
|
||||
const CalendarWidget(),
|
||||
if (state is DiaryStateLoading) const Loader(),
|
||||
if (state is DiaryStateLoaded) WakeupAndRetireWidget(),
|
||||
if (state is DiaryStateLoaded) const WakeupAndRetireWidget(),
|
||||
const SizedBox(height: 12),
|
||||
if (state is DiaryStateLoaded) MealWidget(),
|
||||
if (state is DiaryStateLoaded) CaloriesChartWidget(),
|
||||
if (state is DiaryStateLoaded) const MealWidget(),
|
||||
if (state is DiaryStateLoaded) const CaloriesChartWidget(),
|
||||
const SizedBox(height: 12),
|
||||
if (state is DiaryStateLoaded) CommentForConsultantWidget(),
|
||||
if (state is DiaryStateLoaded) const CommentForConsultantWidget(),
|
||||
if (state is DiaryStateLoaded && state.diary.closed == 0)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 12),
|
||||
|
||||
@@ -25,7 +25,7 @@ class _AddProductButtonWidgetState extends State<AddProductButtonWidget> {
|
||||
return showModalBottomSheet(
|
||||
useRootNavigator: true,
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
|
||||
),
|
||||
isScrollControlled: true,
|
||||
@@ -45,16 +45,16 @@ class _AddProductButtonWidgetState extends State<AddProductButtonWidget> {
|
||||
onTap: () => addProductInMeal(state),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
child: Ink(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
width: MediaQuery.of(context).size.width - 32,
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'Добавить',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
|
||||
@@ -66,7 +66,7 @@ class _AddProductModalState extends State<AddProductModal> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
'Добавление блюда',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
@@ -87,7 +87,7 @@ class _AddProductModalState extends State<AddProductModal> {
|
||||
onChanged: (query) {
|
||||
EasyDebounce.debounce(
|
||||
'glossary-search',
|
||||
Duration(milliseconds: 250),
|
||||
const Duration(milliseconds: 250),
|
||||
() async {
|
||||
selectedGlossary = null;
|
||||
if (query.isEmpty) {
|
||||
@@ -124,7 +124,7 @@ class _AddProductModalState extends State<AddProductModal> {
|
||||
),
|
||||
glossariesList.isEmpty ? const SizedBox(height: 16) : const SizedBox.shrink(),
|
||||
Container(
|
||||
constraints: BoxConstraints(
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: 256,
|
||||
),
|
||||
child: ListView.separated(
|
||||
@@ -146,7 +146,7 @@ class _AddProductModalState extends State<AddProductModal> {
|
||||
),
|
||||
title: Text(
|
||||
glossariesList[i].name,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
height: 1,
|
||||
),
|
||||
),
|
||||
@@ -163,12 +163,12 @@ class _AddProductModalState extends State<AddProductModal> {
|
||||
Icons.add_rounded,
|
||||
color: Colors.grey.shade400,
|
||||
),
|
||||
contentPadding: EdgeInsets.only(left: 12),
|
||||
contentPadding: const EdgeInsets.only(left: 12),
|
||||
);
|
||||
},
|
||||
itemCount: glossariesList.length,
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return CustomDivider();
|
||||
return const CustomDivider();
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -190,9 +190,9 @@ class _AddProductModalState extends State<AddProductModal> {
|
||||
height: 52,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: Color(0xFFF6F6F6),
|
||||
color: const Color(0xFFF6F6F6),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.delete_outline_rounded,
|
||||
color: Colors.red,
|
||||
),
|
||||
@@ -259,7 +259,7 @@ class _AddProductModalState extends State<AddProductModal> {
|
||||
child: Center(
|
||||
child: Text(
|
||||
widget.portion == null ? 'Добавить' : 'Сохранить',
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white,
|
||||
|
||||
@@ -40,7 +40,7 @@ class _CalendarWidgetState extends State<CalendarWidget> {
|
||||
locale: 'ru_RU',
|
||||
startingDayOfWeek: StartingDayOfWeek.monday,
|
||||
calendarFormat: _calendarFormat,
|
||||
headerStyle: HeaderStyle(
|
||||
headerStyle: const HeaderStyle(
|
||||
titleCentered: true,
|
||||
formatButtonVisible: false,
|
||||
leftChevronVisible: false,
|
||||
@@ -69,11 +69,11 @@ class _CalendarWidgetState extends State<CalendarWidget> {
|
||||
}
|
||||
},
|
||||
calendarStyle: CalendarStyle(
|
||||
weekendDecoration: BoxDecoration(
|
||||
weekendDecoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
defaultDecoration: BoxDecoration(
|
||||
defaultDecoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
@@ -81,7 +81,7 @@ class _CalendarWidgetState extends State<CalendarWidget> {
|
||||
color: appTheme.blueA400,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
todayTextStyle: TextStyle(
|
||||
todayTextStyle: const TextStyle(
|
||||
color: Colors.black,
|
||||
),
|
||||
todayDecoration: BoxDecoration(
|
||||
|
||||
@@ -6,6 +6,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncfusion_flutter_gauges/gauges.dart';
|
||||
|
||||
class CaloriesChartWidget extends StatelessWidget {
|
||||
const CaloriesChartWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<DiaryCubit, DiaryState>(
|
||||
@@ -26,7 +28,7 @@ class CaloriesChartWidget extends StatelessWidget {
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
builder: (context) => const AlertDialog(
|
||||
content: Text(
|
||||
'График отображает сколько калорий вам нужно ежедневно для похуденияи поддержания веса, согласно формуле Харриса-Бенедикта.\nИзменить коэффициент физической нагрузки можно в настройках.',
|
||||
style: TextStyle(
|
||||
@@ -60,7 +62,7 @@ class CaloriesChartWidget extends StatelessWidget {
|
||||
radiusFactor: 0.7,
|
||||
showAxisLine: false,
|
||||
pointers: <GaugePointer>[
|
||||
RangePointer(
|
||||
const RangePointer(
|
||||
value: 100,
|
||||
width: 0.16,
|
||||
animationDuration: 2000,
|
||||
@@ -79,7 +81,7 @@ class CaloriesChartWidget extends StatelessWidget {
|
||||
enableAnimation: true,
|
||||
cornerStyle: CornerStyle.bothCurve,
|
||||
),
|
||||
RangePointer(
|
||||
const RangePointer(
|
||||
value: 100,
|
||||
width: 0.16,
|
||||
animationDuration: 2000,
|
||||
@@ -100,7 +102,7 @@ class CaloriesChartWidget extends StatelessWidget {
|
||||
cornerStyle: CornerStyle.bothCurve,
|
||||
pointerOffset: -0.18,
|
||||
),
|
||||
RangePointer(
|
||||
const RangePointer(
|
||||
value: 100,
|
||||
width: 0.16,
|
||||
animationDuration: 2000,
|
||||
@@ -121,7 +123,7 @@ class CaloriesChartWidget extends StatelessWidget {
|
||||
cornerStyle: CornerStyle.bothCurve,
|
||||
pointerOffset: -0.36,
|
||||
),
|
||||
RangePointer(
|
||||
const RangePointer(
|
||||
value: 100,
|
||||
width: 0.16,
|
||||
animationDuration: 2000,
|
||||
@@ -147,7 +149,7 @@ class CaloriesChartWidget extends StatelessWidget {
|
||||
GaugeAnnotation(
|
||||
widget: Transform.rotate(
|
||||
angle: 30.1,
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'Углеводы',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -161,7 +163,7 @@ class CaloriesChartWidget extends StatelessWidget {
|
||||
GaugeAnnotation(
|
||||
widget: Transform.rotate(
|
||||
angle: 30,
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'Жиры',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -175,7 +177,7 @@ class CaloriesChartWidget extends StatelessWidget {
|
||||
GaugeAnnotation(
|
||||
widget: Transform.rotate(
|
||||
angle: 30,
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'Белки',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -189,7 +191,7 @@ class CaloriesChartWidget extends StatelessWidget {
|
||||
GaugeAnnotation(
|
||||
widget: Transform.rotate(
|
||||
angle: 30,
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'Калории',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -246,7 +248,7 @@ class CaloriesChartWidget extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF323F4B),
|
||||
@@ -254,7 +256,7 @@ class CaloriesChartWidget extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF323F4B),
|
||||
|
||||
@@ -22,7 +22,7 @@ class _CommentForConsultantWidgetState extends State<CommentForConsultantWidget>
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
'Дополнительная информация для консультанта',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600, color: Color(0xFF323F4B), height: 1),
|
||||
@@ -30,7 +30,7 @@ class _CommentForConsultantWidgetState extends State<CommentForConsultantWidget>
|
||||
const SizedBox(height: 12),
|
||||
CustomTextFormField(
|
||||
onChanged: (value) {
|
||||
EasyDebounce.debounce('client-typing', Duration(seconds: 3), () => context.read<DiaryCubit>().fillComment(value));
|
||||
EasyDebounce.debounce('client-typing', const Duration(seconds: 3), () => context.read<DiaryCubit>().fillComment(value));
|
||||
},
|
||||
hintText: 'Укажите дополнительную информацию',
|
||||
minLines: 4,
|
||||
|
||||
@@ -26,13 +26,13 @@ class _FinishDayButtonWidgetState extends State<FinishDayButtonWidget> {
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
child: Ink(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
width: MediaQuery.of(context).size.width - 16,
|
||||
decoration: BoxDecoration(color: appTheme.blueA400, borderRadius: BorderRadius.circular(20)),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
alignment: Alignment.center,
|
||||
child: Text('Закончить день', style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600)),
|
||||
child: const Text('Закончить день', style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -52,7 +52,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
'Добавление нового продукта',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
@@ -62,7 +62,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
const Text(
|
||||
'Оу... а у нас нет в базе калорийности такого продукта. Если вы знаете, давайте её запишем?',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
@@ -83,13 +83,13 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
child: Ink(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFF6F6F6),
|
||||
color: const Color(0xFFF6F6F6),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'В другой раз',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF6D6F71),
|
||||
@@ -116,9 +116,9 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'Записать',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -139,11 +139,11 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
|
||||
_success() {
|
||||
return Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
'Продукт успешно отправлен\nна модерацию',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
@@ -170,9 +170,9 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'Закрыть',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -195,7 +195,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
'Добавление нового продукта',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
@@ -205,7 +205,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
const Text(
|
||||
'Если у вас данные по нему\nпросим заполнить значения на 100гр.',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
@@ -227,7 +227,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
child: CustomTextFormField(
|
||||
hintText: 'Калории',
|
||||
controller: energyController,
|
||||
keyboardType: TextInputType.numberWithOptions(decimal: true),
|
||||
keyboardType: const TextInputType.numberWithOptions(decimal: true),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
@@ -235,7 +235,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
child: CustomTextFormField(
|
||||
hintText: 'Белки',
|
||||
controller: proteinsController,
|
||||
keyboardType: TextInputType.numberWithOptions(decimal: true),
|
||||
keyboardType: const TextInputType.numberWithOptions(decimal: true),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -248,7 +248,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
child: CustomTextFormField(
|
||||
hintText: 'Жиры',
|
||||
controller: fatsController,
|
||||
keyboardType: TextInputType.numberWithOptions(decimal: true),
|
||||
keyboardType: const TextInputType.numberWithOptions(decimal: true),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
@@ -256,7 +256,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
child: CustomTextFormField(
|
||||
hintText: 'Углеводы',
|
||||
controller: carbohydratesController,
|
||||
keyboardType: TextInputType.numberWithOptions(decimal: true),
|
||||
keyboardType: const TextInputType.numberWithOptions(decimal: true),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -278,15 +278,15 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
|
||||
},
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
child: Ink(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'Сохранить',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
|
||||
@@ -32,13 +32,13 @@ class _MealButtonWidgetState extends State<MealButtonWidget> {
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: state.selectedMeal == widget.mealNumber ? appTheme.blueA400 : Color(0xFFF1F2F6),
|
||||
color: state.selectedMeal == widget.mealNumber ? appTheme.blueA400 : const Color(0xFFF1F2F6),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${widget.mealNumber}',
|
||||
style: TextStyle(
|
||||
color: state.selectedMeal == widget.mealNumber ? Colors.white : Color(0xFF6D6F71),
|
||||
color: state.selectedMeal == widget.mealNumber ? Colors.white : const Color(0xFF6D6F71),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
|
||||
@@ -20,8 +20,8 @@ class _MealWidgetState extends State<MealWidget> {
|
||||
return Material(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: Colors.white,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -33,7 +33,7 @@ class _MealWidgetState extends State<MealWidget> {
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@@ -44,17 +44,17 @@ class _MealWidgetState extends State<MealWidget> {
|
||||
MealButtonWidget(mealNumber: 5),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(height: 12),
|
||||
TimeOfMealPickerWidget(),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(height: 12),
|
||||
ProductsListWidget(),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(height: 12),
|
||||
AddProductButtonWidget(),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(height: 12),
|
||||
PhotoGalleryWidget(),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(height: 12),
|
||||
SatietyRatingWidget(),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(height: 12),
|
||||
MoodRatingWidget(),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -7,6 +7,8 @@ import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class MoodRatingWidget extends StatefulWidget {
|
||||
const MoodRatingWidget({super.key});
|
||||
|
||||
@override
|
||||
State<MoodRatingWidget> createState() => _MoodRatingWidgetState();
|
||||
}
|
||||
@@ -29,7 +31,7 @@ class _MoodRatingWidgetState extends State<MoodRatingWidget> {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
'Ваше настроение после приёма пищи',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
@@ -54,22 +56,22 @@ class _MoodRatingWidgetState extends State<MoodRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 1 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 1 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFC82222),
|
||||
color: const Color(0xFFC82222),
|
||||
border: currentSelectedRating == 1
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFAA3333),
|
||||
color: const Color(0xFFAA3333),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
borderRadius: currentSelectedRating == 1
|
||||
? BorderRadius.horizontal(
|
||||
? const BorderRadius.horizontal(
|
||||
left: Radius.circular(8),
|
||||
right: Radius.circular(2),
|
||||
)
|
||||
: BorderRadius.horizontal(
|
||||
: const BorderRadius.horizontal(
|
||||
left: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
@@ -78,13 +80,13 @@ class _MoodRatingWidgetState extends State<MoodRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 2 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 2 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFFF3E3E),
|
||||
color: const Color(0xFFFF3E3E),
|
||||
border: currentSelectedRating == 2
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFF550000),
|
||||
color: const Color(0xFF550000),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
@@ -95,13 +97,13 @@ class _MoodRatingWidgetState extends State<MoodRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 3 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 3 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFF8C926),
|
||||
color: const Color(0xFFF8C926),
|
||||
border: currentSelectedRating == 3
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFF8C5D00),
|
||||
color: const Color(0xFF8C5D00),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
@@ -112,13 +114,13 @@ class _MoodRatingWidgetState extends State<MoodRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 4 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 4 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFFFF3BF),
|
||||
color: const Color(0xFFFFF3BF),
|
||||
border: currentSelectedRating == 4
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFB5911B),
|
||||
color: const Color(0xFFB5911B),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
@@ -129,13 +131,13 @@ class _MoodRatingWidgetState extends State<MoodRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 5 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 5 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF62E833),
|
||||
color: const Color(0xFF62E833),
|
||||
border: currentSelectedRating == 5
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFF276918),
|
||||
color: const Color(0xFF276918),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
@@ -146,22 +148,22 @@ class _MoodRatingWidgetState extends State<MoodRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 6 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 6 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF4DCE20),
|
||||
color: const Color(0xFF4DCE20),
|
||||
border: currentSelectedRating == 6
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFF184D12),
|
||||
color: const Color(0xFF184D12),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
borderRadius: currentSelectedRating == 6
|
||||
? BorderRadius.horizontal(
|
||||
? const BorderRadius.horizontal(
|
||||
left: Radius.circular(2),
|
||||
right: Radius.circular(8),
|
||||
)
|
||||
: BorderRadius.horizontal(
|
||||
: const BorderRadius.horizontal(
|
||||
right: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
@@ -174,7 +176,7 @@ class _MoodRatingWidgetState extends State<MoodRatingWidget> {
|
||||
});
|
||||
EasyDebounce.debounce(
|
||||
'change-satiety',
|
||||
Duration(milliseconds: 250),
|
||||
const Duration(milliseconds: 250),
|
||||
() {
|
||||
context.read<DiaryCubit>().fillMood(diaryId: state.diary.id, mood: currentSelectedRating.toInt() - 1);
|
||||
},
|
||||
|
||||
@@ -39,14 +39,15 @@ class _PhotoGalleryWidgetState extends State<PhotoGalleryWidget> {
|
||||
Navigator.of(context).pop();
|
||||
final picker = ImagePicker();
|
||||
XFile? image = await picker.pickImage(source: ImageSource.camera);
|
||||
if (image != null)
|
||||
if (image != null) {
|
||||
diaryCubit.uploadPhotos(
|
||||
files: [File(image.path)],
|
||||
diaryId: diaryDay.id,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: const Row(
|
||||
children: const [
|
||||
children: [
|
||||
Icon(Icons.photo_camera),
|
||||
SizedBox(width: 8),
|
||||
Text('Фото'),
|
||||
@@ -58,14 +59,15 @@ class _PhotoGalleryWidgetState extends State<PhotoGalleryWidget> {
|
||||
Navigator.of(context).pop();
|
||||
final picker = ImagePicker();
|
||||
List<XFile>? images = await picker.pickMultiImage();
|
||||
if (images.isNotEmpty)
|
||||
if (images.isNotEmpty) {
|
||||
diaryCubit.uploadPhotos(
|
||||
files: images.map((f) => File(f.path)).toList(),
|
||||
diaryId: diaryDay.id,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: const Row(
|
||||
children: const [
|
||||
children: [
|
||||
Icon(Icons.photo),
|
||||
SizedBox(width: 8),
|
||||
Text('Галерея'),
|
||||
@@ -107,7 +109,7 @@ class _PhotoGalleryWidgetState extends State<PhotoGalleryWidget> {
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: baseUrl + '/storage/' + state.diary.meals[mealIndex].photos[currentSelectedPhotoIndex].path,
|
||||
imageUrl: '$baseUrl/storage/${state.diary.meals[mealIndex].photos[currentSelectedPhotoIndex].path}',
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -128,7 +130,7 @@ class _PhotoGalleryWidgetState extends State<PhotoGalleryWidget> {
|
||||
}
|
||||
});
|
||||
},
|
||||
icon: Icon(
|
||||
icon: const Icon(
|
||||
Icons.close_rounded,
|
||||
color: Colors.grey,
|
||||
),
|
||||
@@ -156,7 +158,7 @@ class _PhotoGalleryWidgetState extends State<PhotoGalleryWidget> {
|
||||
width: 52,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
color: Color(0xFFF1F2F6),
|
||||
color: const Color(0xFFF1F2F6),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.add_rounded,
|
||||
@@ -178,7 +180,7 @@ class _PhotoGalleryWidgetState extends State<PhotoGalleryWidget> {
|
||||
height: 52,
|
||||
width: 52,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: baseUrl + '/storage/' + state.diary.meals[mealIndex].photos[i].path,
|
||||
imageUrl: '$baseUrl/storage/${state.diary.meals[mealIndex].photos[i].path}',
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -29,15 +29,16 @@ class _ProductWidgetState extends State<ProductWidget> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
diaryCubit = context.read<DiaryCubit>();
|
||||
portionName = widget.portion == 'gr' ? 'гр' : 'шт';
|
||||
isEaten = widget.portion.portionState == PortionState.eaten_from_diet ? true : false;
|
||||
portionName = widget.portion.portion == 'gr' ? 'гр' : 'шт';
|
||||
|
||||
isEaten = widget.portion.portionState == PortionState.eatenFromDiet ? true : false;
|
||||
}
|
||||
|
||||
updateProductInMeal(DiaryStateLoaded state, PortionModel portion) {
|
||||
return showModalBottomSheet(
|
||||
useRootNavigator: true,
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
|
||||
),
|
||||
isScrollControlled: true,
|
||||
@@ -54,14 +55,14 @@ class _ProductWidgetState extends State<ProductWidget> {
|
||||
return BlocBuilder<DiaryCubit, DiaryState>(
|
||||
builder: (context, state) {
|
||||
if (state is DiaryStateLoaded) {
|
||||
if (widget.portion.portionState == PortionState.eaten_deleted) {
|
||||
if (widget.portion.portionState == PortionState.eatenDeleted) {
|
||||
return DottedBorder(
|
||||
dashPattern: [6, 6],
|
||||
dashPattern: const [6, 6],
|
||||
padding: EdgeInsets.zero,
|
||||
borderPadding: EdgeInsets.zero,
|
||||
borderType: BorderType.RRect,
|
||||
radius: Radius.circular(20),
|
||||
color: Color(0xFF6D6F71),
|
||||
radius: const Radius.circular(20),
|
||||
color: const Color(0xFF6D6F71),
|
||||
child: ListTile(
|
||||
onTap: () => diaryCubit.restore(
|
||||
diaryId: state.diary.id,
|
||||
@@ -72,19 +73,20 @@ class _ProductWidgetState extends State<ProductWidget> {
|
||||
'assets/icons/revert_product.svg',
|
||||
),
|
||||
horizontalTitleGap: 0,
|
||||
contentPadding: widget.portion.fromDiet ? EdgeInsets.only(right: 24, left: 4) : null,
|
||||
contentPadding: widget.portion.fromDiet ? const EdgeInsets.only(right: 24, left: 4) : null,
|
||||
title: Text(widget.portion.productName),
|
||||
subtitle: Text('${widget.portion.quantity} ${widget.portion.portion == 'gr' ? 'гр' : 'шт'}'),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
tileColor: Color(0xFFF6FAFF03).withValues(alpha: 0.01),
|
||||
// ignore: use_full_hex_values_for_flutter_colors
|
||||
tileColor: const Color(0xfff6faff03).withValues(alpha: 0.01),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return ListTile(
|
||||
onTap: () => updateProductInMeal(state, widget.portion),
|
||||
trailing: Icon(Icons.more_vert_rounded),
|
||||
trailing: const Icon(Icons.more_vert_rounded),
|
||||
leading: widget.portion.fromDiet
|
||||
? Transform.scale(
|
||||
scale: 1.2,
|
||||
@@ -112,20 +114,20 @@ class _ProductWidgetState extends State<ProductWidget> {
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
side: BorderSide(
|
||||
side: const BorderSide(
|
||||
color: Color(0xFF809CB9),
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
horizontalTitleGap: 0,
|
||||
contentPadding: widget.portion.fromDiet ? EdgeInsets.only(right: 24, left: 4) : null,
|
||||
contentPadding: widget.portion.fromDiet ? const EdgeInsets.only(right: 24, left: 4) : null,
|
||||
title: Text(widget.portion.productName),
|
||||
subtitle: Text('${widget.portion.quantity} ${widget.portion.portion == 'gr' ? 'гр' : 'шт'}'),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
tileColor: Color(0xFFF6FAFF),
|
||||
tileColor: const Color(0xFFF6FAFF),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class SatietyRatingWidget extends StatefulWidget {
|
||||
const SatietyRatingWidget({super.key});
|
||||
|
||||
@override
|
||||
State<SatietyRatingWidget> createState() => _SatietyRatingWidgetState();
|
||||
}
|
||||
@@ -29,7 +31,7 @@ class _SatietyRatingWidgetState extends State<SatietyRatingWidget> {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
'Ваша сытость после приёма пищи',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
@@ -54,22 +56,22 @@ class _SatietyRatingWidgetState extends State<SatietyRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 1 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 1 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFC82222),
|
||||
color: const Color(0xFFC82222),
|
||||
border: currentSelectedRating == 1
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFAA3333),
|
||||
color: const Color(0xFFAA3333),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
borderRadius: currentSelectedRating == 1
|
||||
? BorderRadius.horizontal(
|
||||
? const BorderRadius.horizontal(
|
||||
left: Radius.circular(8),
|
||||
right: Radius.circular(2),
|
||||
)
|
||||
: BorderRadius.horizontal(
|
||||
: const BorderRadius.horizontal(
|
||||
left: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
@@ -78,13 +80,13 @@ class _SatietyRatingWidgetState extends State<SatietyRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 2 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 2 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFFF3E3E),
|
||||
color: const Color(0xFFFF3E3E),
|
||||
border: currentSelectedRating == 2
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFF550000),
|
||||
color: const Color(0xFF550000),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
@@ -95,13 +97,13 @@ class _SatietyRatingWidgetState extends State<SatietyRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 3 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 3 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFF8C926),
|
||||
color: const Color(0xFFF8C926),
|
||||
border: currentSelectedRating == 3
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFF8C5D00),
|
||||
color: const Color(0xFF8C5D00),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
@@ -112,13 +114,13 @@ class _SatietyRatingWidgetState extends State<SatietyRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 4 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 4 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFFFF3BF),
|
||||
color: const Color(0xFFFFF3BF),
|
||||
border: currentSelectedRating == 4
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFB5911B),
|
||||
color: const Color(0xFFB5911B),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
@@ -129,13 +131,13 @@ class _SatietyRatingWidgetState extends State<SatietyRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 5 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 5 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF62E833),
|
||||
color: const Color(0xFF62E833),
|
||||
border: currentSelectedRating == 5
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFF276918),
|
||||
color: const Color(0xFF276918),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
@@ -146,22 +148,22 @@ class _SatietyRatingWidgetState extends State<SatietyRatingWidget> {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width / 6,
|
||||
height: 24,
|
||||
margin: currentSelectedRating == 6 ? EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
margin: currentSelectedRating == 6 ? const EdgeInsets.symmetric(horizontal: 2) : null,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF4DCE20),
|
||||
color: const Color(0xFF4DCE20),
|
||||
border: currentSelectedRating == 6
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFF184D12),
|
||||
color: const Color(0xFF184D12),
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
)
|
||||
: null,
|
||||
borderRadius: currentSelectedRating == 6
|
||||
? BorderRadius.horizontal(
|
||||
? const BorderRadius.horizontal(
|
||||
left: Radius.circular(2),
|
||||
right: Radius.circular(8),
|
||||
)
|
||||
: BorderRadius.horizontal(
|
||||
: const BorderRadius.horizontal(
|
||||
right: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
@@ -174,7 +176,7 @@ class _SatietyRatingWidgetState extends State<SatietyRatingWidget> {
|
||||
});
|
||||
EasyDebounce.debounce(
|
||||
'change-satiety',
|
||||
Duration(milliseconds: 250),
|
||||
const Duration(milliseconds: 250),
|
||||
() {
|
||||
context.read<DiaryCubit>().fillSatiety(diaryId: state.diary.id, satiety: currentSelectedRating.toInt() - 1);
|
||||
},
|
||||
|
||||
@@ -57,7 +57,7 @@ class _TimeOfMealPickerWidgetState extends State<TimeOfMealPickerWidget> {
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: appTheme.blueA400,
|
||||
),
|
||||
child: Center(
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'Сохранить',
|
||||
style: TextStyle(
|
||||
@@ -82,13 +82,13 @@ class _TimeOfMealPickerWidgetState extends State<TimeOfMealPickerWidget> {
|
||||
if (state is DiaryStateLoaded) {
|
||||
return Column(
|
||||
children: [
|
||||
CustomDivider(),
|
||||
const CustomDivider(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
'Время приема пищи',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF323F4B),
|
||||
@@ -103,14 +103,14 @@ class _TimeOfMealPickerWidgetState extends State<TimeOfMealPickerWidget> {
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xFFF1F2F6),
|
||||
color: const Color(0xFFF1F2F6),
|
||||
),
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text(
|
||||
state.diary.meals[state.selectedMeal - 1].time.substring(0, state.diary.meals[state.selectedMeal - 1].time.length - 3),
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF6D6F71),
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w500,
|
||||
@@ -122,7 +122,7 @@ class _TimeOfMealPickerWidgetState extends State<TimeOfMealPickerWidget> {
|
||||
],
|
||||
),
|
||||
),
|
||||
CustomDivider(),
|
||||
const CustomDivider(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ class _WakeupAndRetireWidgetState extends State<WakeupAndRetireWidget> {
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: appTheme.blueA400,
|
||||
),
|
||||
child: Center(
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'Сохранить',
|
||||
style: TextStyle(
|
||||
@@ -116,7 +116,7 @@ class _WakeupAndRetireWidgetState extends State<WakeupAndRetireWidget> {
|
||||
children: [
|
||||
SvgPicture.asset('assets/icons/wakeup.svg'),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
const Text(
|
||||
'Подъём',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
@@ -134,17 +134,17 @@ class _WakeupAndRetireWidgetState extends State<WakeupAndRetireWidget> {
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xFFF1F2F6),
|
||||
color: const Color(0xFFF1F2F6),
|
||||
),
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text(
|
||||
state.diary.wakeup.toString().substring(
|
||||
0,
|
||||
state.diary.wakeup.toString().length - 3,
|
||||
),
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF6D6F71),
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w500,
|
||||
@@ -175,7 +175,7 @@ class _WakeupAndRetireWidgetState extends State<WakeupAndRetireWidget> {
|
||||
children: [
|
||||
SvgPicture.asset('assets/icons/retire.svg'),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
const Text(
|
||||
'Уход ко сну',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
@@ -193,17 +193,17 @@ class _WakeupAndRetireWidgetState extends State<WakeupAndRetireWidget> {
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Color(0xFFF1F2F6),
|
||||
color: const Color(0xFFF1F2F6),
|
||||
),
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text(
|
||||
state.diary.retire.toString().substring(
|
||||
0,
|
||||
state.diary.retire.toString().length - 3,
|
||||
),
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF6D6F71),
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w500,
|
||||
@@ -221,7 +221,7 @@ class _WakeupAndRetireWidgetState extends State<WakeupAndRetireWidget> {
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -38,13 +38,11 @@ class _DiaryService implements DiaryService {
|
||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||
late List<DiaryDayModel> _value;
|
||||
try {
|
||||
_value =
|
||||
_result.data!
|
||||
.map(
|
||||
(dynamic i) =>
|
||||
DiaryDayModel.fromJson(i as Map<String, dynamic>),
|
||||
)
|
||||
.toList();
|
||||
_value = _result.data!
|
||||
.map(
|
||||
(dynamic i) => DiaryDayModel.fromJson(i as Map<String, dynamic>),
|
||||
)
|
||||
.toList();
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
@@ -127,11 +125,11 @@ class _DiaryService implements DiaryService {
|
||||
);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/photo/upload',
|
||||
|
||||
Reference in New Issue
Block a user