forked from eatvio/eatvio_app
fix: remove ignored files
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,151 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'diary_day_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$DiaryDayWrapperModelImpl _$$DiaryDayWrapperModelImplFromJson(
|
||||
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,
|
||||
};
|
||||
|
||||
_$DiaryDayModelImpl _$$DiaryDayModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$DiaryDayModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
date: json['date'] as String,
|
||||
wakeup: json['wakeup'] as String?,
|
||||
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(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DiaryDayModelImplToJson(_$DiaryDayModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'date': instance.date,
|
||||
'wakeup': instance.wakeup,
|
||||
'retire': instance.retire,
|
||||
'closed': instance.closed,
|
||||
'comment': instance.comment,
|
||||
'state': instance.typeOfDiary,
|
||||
'meals': instance.meals,
|
||||
};
|
||||
|
||||
_$MealModelImpl _$$MealModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$MealModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
time: json['time'] as String,
|
||||
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(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MealModelImplToJson(_$MealModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'time': instance.time,
|
||||
'type_no': instance.typeNumber,
|
||||
'satiety': instance.satiety,
|
||||
'mood': instance.mood,
|
||||
'portions': instance.portions,
|
||||
'photos': instance.photos,
|
||||
};
|
||||
|
||||
_$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> _$$DiaryPhotoModelImplToJson(
|
||||
_$DiaryPhotoModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'original_name': instance.originalName,
|
||||
'path': instance.path,
|
||||
'size': instance.size,
|
||||
};
|
||||
|
||||
_$PortionModelImpl _$$PortionModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$PortionModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
productNutritionalValueId:
|
||||
(json['product_nutritional_value_id'] as num?)?.toInt(),
|
||||
productName: json['product_name'] as String,
|
||||
quantity: (json['quantity'] as num).toInt(),
|
||||
portion: json['portion'] as String,
|
||||
fromDiet: json['from_diet'] as bool,
|
||||
portionState: $enumDecode(_$PortionStateEnumMap, json['state']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$PortionModelImplToJson(_$PortionModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'product_nutritional_value_id': instance.productNutritionalValueId,
|
||||
'product_name': instance.productName,
|
||||
'quantity': instance.quantity,
|
||||
'portion': instance.portion,
|
||||
'from_diet': instance.fromDiet,
|
||||
'state': _$PortionStateEnumMap[instance.portionState]!,
|
||||
};
|
||||
|
||||
const _$PortionStateEnumMap = {
|
||||
PortionState.filledDiet: 'filled_diet',
|
||||
PortionState.eatenFromDiet: 'eaten_from_diet',
|
||||
PortionState.eaten: 'eaten',
|
||||
PortionState.eatenDeleted: 'eaten_deleted',
|
||||
PortionState.eatenEdited: 'eaten_edited',
|
||||
PortionState.commented: 'commented',
|
||||
PortionState.reviewedByUser: 'reviewed_by_user',
|
||||
};
|
||||
|
||||
_$TypeOfDiaryModelImpl _$$TypeOfDiaryModelImplFromJson(
|
||||
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,
|
||||
};
|
||||
|
||||
_$ProductInMealImpl _$$ProductInMealImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ProductInMealImpl(
|
||||
productName: json['product_name'] as String,
|
||||
portion: json['portion'] as String,
|
||||
quantity: (json['quantity'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ProductInMealImplToJson(_$ProductInMealImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'product_name': instance.productName,
|
||||
'portion': instance.portion,
|
||||
'quantity': instance.quantity,
|
||||
};
|
||||
@@ -1,166 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'diary_index_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
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');
|
||||
|
||||
DiaryIndexModel _$DiaryIndexModelFromJson(Map<String, dynamic> json) {
|
||||
return _DiaryIndexModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DiaryIndexModel {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this DiaryIndexModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of DiaryIndexModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$DiaryIndexModelCopyWith<DiaryIndexModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $DiaryIndexModelCopyWith<$Res> {
|
||||
factory $DiaryIndexModelCopyWith(
|
||||
DiaryIndexModel value, $Res Function(DiaryIndexModel) then) =
|
||||
_$DiaryIndexModelCopyWithImpl<$Res, DiaryIndexModel>;
|
||||
@useResult
|
||||
$Res call({int id});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$DiaryIndexModelCopyWithImpl<$Res, $Val extends DiaryIndexModel>
|
||||
implements $DiaryIndexModelCopyWith<$Res> {
|
||||
_$DiaryIndexModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _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(_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>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int id});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DiaryIndexModelImplCopyWithImpl<$Res>
|
||||
extends _$DiaryIndexModelCopyWithImpl<$Res, _$DiaryIndexModelImpl>
|
||||
implements _$$DiaryIndexModelImplCopyWith<$Res> {
|
||||
__$$DiaryIndexModelImplCopyWithImpl(
|
||||
_$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,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$DiaryIndexModelImpl implements _DiaryIndexModel {
|
||||
const _$DiaryIndexModelImpl({required this.id});
|
||||
|
||||
factory _$DiaryIndexModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$DiaryIndexModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DiaryIndexModel(id: $id)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$DiaryIndexModelImpl &&
|
||||
(identical(other.id, id) || other.id == id));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id);
|
||||
|
||||
/// Create a copy of DiaryIndexModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DiaryIndexModelImplCopyWith<_$DiaryIndexModelImpl> get copyWith =>
|
||||
__$$DiaryIndexModelImplCopyWithImpl<_$DiaryIndexModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$DiaryIndexModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _DiaryIndexModel implements DiaryIndexModel {
|
||||
const factory _DiaryIndexModel({required final int id}) =
|
||||
_$DiaryIndexModelImpl;
|
||||
|
||||
factory _DiaryIndexModel.fromJson(Map<String, dynamic> json) =
|
||||
_$DiaryIndexModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
|
||||
/// Create a copy of DiaryIndexModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$DiaryIndexModelImplCopyWith<_$DiaryIndexModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'diary_index_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$DiaryIndexModelImpl _$$DiaryIndexModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$DiaryIndexModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DiaryIndexModelImplToJson(
|
||||
_$DiaryIndexModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
};
|
||||
@@ -1,213 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'finish_diary_day_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
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');
|
||||
|
||||
FinishDiaryDayModel _$FinishDiaryDayModelFromJson(Map<String, dynamic> json) {
|
||||
return _FinishDiaryDayModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$FinishDiaryDayModel {
|
||||
String get wakeUp => throw _privateConstructorUsedError;
|
||||
String get retire => throw _privateConstructorUsedError;
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get comment => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this FinishDiaryDayModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$FinishDiaryDayModelCopyWith<FinishDiaryDayModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $FinishDiaryDayModelCopyWith<$Res> {
|
||||
factory $FinishDiaryDayModelCopyWith(
|
||||
FinishDiaryDayModel value, $Res Function(FinishDiaryDayModel) then) =
|
||||
_$FinishDiaryDayModelCopyWithImpl<$Res, FinishDiaryDayModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String wakeUp,
|
||||
String retire,
|
||||
@JsonKey(includeIfNull: false) String? comment});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$FinishDiaryDayModelCopyWithImpl<$Res, $Val extends FinishDiaryDayModel>
|
||||
implements $FinishDiaryDayModelCopyWith<$Res> {
|
||||
_$FinishDiaryDayModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? wakeUp = null,
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FinishDiaryDayModelImplCopyWith<$Res>
|
||||
implements $FinishDiaryDayModelCopyWith<$Res> {
|
||||
factory _$$FinishDiaryDayModelImplCopyWith(_$FinishDiaryDayModelImpl value,
|
||||
$Res Function(_$FinishDiaryDayModelImpl) then) =
|
||||
__$$FinishDiaryDayModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$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);
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? wakeUp = null,
|
||||
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?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$FinishDiaryDayModelImpl implements _FinishDiaryDayModel {
|
||||
const _$FinishDiaryDayModelImpl(
|
||||
{required this.wakeUp,
|
||||
required this.retire,
|
||||
@JsonKey(includeIfNull: false) this.comment});
|
||||
|
||||
factory _$FinishDiaryDayModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$FinishDiaryDayModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String wakeUp;
|
||||
@override
|
||||
final String retire;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? comment;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'FinishDiaryDayModel(wakeUp: $wakeUp, retire: $retire, comment: $comment)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FinishDiaryDayModelImpl &&
|
||||
(identical(other.wakeUp, wakeUp) || other.wakeUp == wakeUp) &&
|
||||
(identical(other.retire, retire) || other.retire == retire) &&
|
||||
(identical(other.comment, comment) || other.comment == comment));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, wakeUp, retire, comment);
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FinishDiaryDayModelImplCopyWith<_$FinishDiaryDayModelImpl> get copyWith =>
|
||||
__$$FinishDiaryDayModelImplCopyWithImpl<_$FinishDiaryDayModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
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;
|
||||
|
||||
factory _FinishDiaryDayModel.fromJson(Map<String, dynamic> json) =
|
||||
_$FinishDiaryDayModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get wakeUp;
|
||||
@override
|
||||
String get retire;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get comment;
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$FinishDiaryDayModelImplCopyWith<_$FinishDiaryDayModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'finish_diary_day_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$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> _$$FinishDiaryDayModelImplToJson(
|
||||
_$FinishDiaryDayModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'wakeUp': instance.wakeUp,
|
||||
'retire': instance.retire,
|
||||
if (instance.comment case final value?) 'comment': value,
|
||||
};
|
||||
@@ -1,437 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'nutrition_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
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');
|
||||
|
||||
NutritionDataModel _$NutritionDataModelFromJson(Map<String, dynamic> json) {
|
||||
return _NutritionDataModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$NutritionDataModel {
|
||||
NutritionModel get dailyNutritionIntake => throw _privateConstructorUsedError;
|
||||
NutritionModel get dailyNutritionRecommendation =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this NutritionDataModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$NutritionDataModelCopyWith<NutritionDataModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $NutritionDataModelCopyWith<$Res> {
|
||||
factory $NutritionDataModelCopyWith(
|
||||
NutritionDataModel value, $Res Function(NutritionDataModel) then) =
|
||||
_$NutritionDataModelCopyWithImpl<$Res, NutritionDataModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{NutritionModel dailyNutritionIntake,
|
||||
NutritionModel dailyNutritionRecommendation});
|
||||
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionIntake;
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionRecommendation;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$NutritionDataModelCopyWithImpl<$Res, $Val extends NutritionDataModel>
|
||||
implements $NutritionDataModelCopyWith<$Res> {
|
||||
_$NutritionDataModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
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);
|
||||
}
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionIntake {
|
||||
return $NutritionModelCopyWith<$Res>(_value.dailyNutritionIntake, (value) {
|
||||
return _then(_value.copyWith(dailyNutritionIntake: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionRecommendation {
|
||||
return $NutritionModelCopyWith<$Res>(_value.dailyNutritionRecommendation,
|
||||
(value) {
|
||||
return _then(
|
||||
_value.copyWith(dailyNutritionRecommendation: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NutritionDataModelImplCopyWith<$Res>
|
||||
implements $NutritionDataModelCopyWith<$Res> {
|
||||
factory _$$NutritionDataModelImplCopyWith(_$NutritionDataModelImpl value,
|
||||
$Res Function(_$NutritionDataModelImpl) then) =
|
||||
__$$NutritionDataModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{NutritionModel dailyNutritionIntake,
|
||||
NutritionModel dailyNutritionRecommendation});
|
||||
|
||||
@override
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionIntake;
|
||||
@override
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionRecommendation;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NutritionDataModelImplCopyWithImpl<$Res>
|
||||
extends _$NutritionDataModelCopyWithImpl<$Res, _$NutritionDataModelImpl>
|
||||
implements _$$NutritionDataModelImplCopyWith<$Res> {
|
||||
__$$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.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
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,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$NutritionDataModelImpl implements _NutritionDataModel {
|
||||
const _$NutritionDataModelImpl(
|
||||
{required this.dailyNutritionIntake,
|
||||
required this.dailyNutritionRecommendation});
|
||||
|
||||
factory _$NutritionDataModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$NutritionDataModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final NutritionModel dailyNutritionIntake;
|
||||
@override
|
||||
final NutritionModel dailyNutritionRecommendation;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NutritionDataModel(dailyNutritionIntake: $dailyNutritionIntake, dailyNutritionRecommendation: $dailyNutritionRecommendation)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$NutritionDataModelImpl &&
|
||||
(identical(other.dailyNutritionIntake, dailyNutritionIntake) ||
|
||||
other.dailyNutritionIntake == dailyNutritionIntake) &&
|
||||
(identical(other.dailyNutritionRecommendation,
|
||||
dailyNutritionRecommendation) ||
|
||||
other.dailyNutritionRecommendation ==
|
||||
dailyNutritionRecommendation));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, dailyNutritionIntake, dailyNutritionRecommendation);
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$NutritionDataModelImplCopyWith<_$NutritionDataModelImpl> get copyWith =>
|
||||
__$$NutritionDataModelImplCopyWithImpl<_$NutritionDataModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$NutritionDataModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _NutritionDataModel implements NutritionDataModel {
|
||||
const factory _NutritionDataModel(
|
||||
{required final NutritionModel dailyNutritionIntake,
|
||||
required final NutritionModel dailyNutritionRecommendation}) =
|
||||
_$NutritionDataModelImpl;
|
||||
|
||||
factory _NutritionDataModel.fromJson(Map<String, dynamic> json) =
|
||||
_$NutritionDataModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
NutritionModel get dailyNutritionIntake;
|
||||
@override
|
||||
NutritionModel get dailyNutritionRecommendation;
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$NutritionDataModelImplCopyWith<_$NutritionDataModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
NutritionModel _$NutritionModelFromJson(Map<String, dynamic> json) {
|
||||
return _NutritionModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$NutritionModel {
|
||||
double get energy => throw _privateConstructorUsedError;
|
||||
double get proteins => throw _privateConstructorUsedError;
|
||||
double get fats => throw _privateConstructorUsedError;
|
||||
double get carbohydrates => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this NutritionModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of NutritionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$NutritionModelCopyWith<NutritionModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $NutritionModelCopyWith<$Res> {
|
||||
factory $NutritionModelCopyWith(
|
||||
NutritionModel value, $Res Function(NutritionModel) then) =
|
||||
_$NutritionModelCopyWithImpl<$Res, NutritionModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{double energy, double proteins, double fats, double carbohydrates});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$NutritionModelCopyWithImpl<$Res, $Val extends NutritionModel>
|
||||
implements $NutritionModelCopyWith<$Res> {
|
||||
_$NutritionModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of NutritionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? energy = null,
|
||||
Object? proteins = null,
|
||||
Object? fats = null,
|
||||
Object? carbohydrates = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
energy: null == energy
|
||||
? _value.energy
|
||||
: energy // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
proteins: null == proteins
|
||||
? _value.proteins
|
||||
: proteins // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
fats: null == fats
|
||||
? _value.fats
|
||||
: fats // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
carbohydrates: null == carbohydrates
|
||||
? _value.carbohydrates
|
||||
: carbohydrates // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NutritionModelImplCopyWith<$Res>
|
||||
implements $NutritionModelCopyWith<$Res> {
|
||||
factory _$$NutritionModelImplCopyWith(_$NutritionModelImpl value,
|
||||
$Res Function(_$NutritionModelImpl) then) =
|
||||
__$$NutritionModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{double energy, double proteins, double fats, double carbohydrates});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NutritionModelImplCopyWithImpl<$Res>
|
||||
extends _$NutritionModelCopyWithImpl<$Res, _$NutritionModelImpl>
|
||||
implements _$$NutritionModelImplCopyWith<$Res> {
|
||||
__$$NutritionModelImplCopyWithImpl(
|
||||
_$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.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? energy = null,
|
||||
Object? proteins = null,
|
||||
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,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$NutritionModelImpl implements _NutritionModel {
|
||||
const _$NutritionModelImpl(
|
||||
{required this.energy,
|
||||
required this.proteins,
|
||||
required this.fats,
|
||||
required this.carbohydrates});
|
||||
|
||||
factory _$NutritionModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$NutritionModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final double energy;
|
||||
@override
|
||||
final double proteins;
|
||||
@override
|
||||
final double fats;
|
||||
@override
|
||||
final double carbohydrates;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NutritionModel(energy: $energy, proteins: $proteins, fats: $fats, carbohydrates: $carbohydrates)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$NutritionModelImpl &&
|
||||
(identical(other.energy, energy) || other.energy == energy) &&
|
||||
(identical(other.proteins, proteins) ||
|
||||
other.proteins == proteins) &&
|
||||
(identical(other.fats, fats) || other.fats == fats) &&
|
||||
(identical(other.carbohydrates, carbohydrates) ||
|
||||
other.carbohydrates == carbohydrates));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, energy, proteins, fats, carbohydrates);
|
||||
|
||||
/// Create a copy of NutritionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$NutritionModelImplCopyWith<_$NutritionModelImpl> get copyWith =>
|
||||
__$$NutritionModelImplCopyWithImpl<_$NutritionModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
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;
|
||||
|
||||
factory _NutritionModel.fromJson(Map<String, dynamic> json) =
|
||||
_$NutritionModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
double get energy;
|
||||
@override
|
||||
double get proteins;
|
||||
@override
|
||||
double get fats;
|
||||
@override
|
||||
double get carbohydrates;
|
||||
|
||||
/// Create a copy of NutritionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$NutritionModelImplCopyWith<_$NutritionModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'nutrition_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$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> _$$NutritionDataModelImplToJson(
|
||||
_$NutritionDataModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'dailyNutritionIntake': instance.dailyNutritionIntake,
|
||||
'dailyNutritionRecommendation': instance.dailyNutritionRecommendation,
|
||||
};
|
||||
|
||||
_$NutritionModelImpl _$$NutritionModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$NutritionModelImpl(
|
||||
energy: (json['energy'] as num).toDouble(),
|
||||
proteins: (json['proteins'] as num).toDouble(),
|
||||
fats: (json['fats'] as num).toDouble(),
|
||||
carbohydrates: (json['carbohydrates'] as num).toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$NutritionModelImplToJson(
|
||||
_$NutritionModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'energy': instance.energy,
|
||||
'proteins': instance.proteins,
|
||||
'fats': instance.fats,
|
||||
'carbohydrates': instance.carbohydrates,
|
||||
};
|
||||
@@ -1,270 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'product_moderation_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
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');
|
||||
|
||||
ProductModerationModel _$ProductModerationModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _ProductModerationModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ProductModerationModel {
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'energy_on_100gr')
|
||||
double get energy => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'proteins_on_100gr')
|
||||
double get proteins => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'fats_on_100gr')
|
||||
double get fats => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'carbohydrates_on_100gr')
|
||||
double get carbohydrates => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ProductModerationModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ProductModerationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ProductModerationModelCopyWith<ProductModerationModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ProductModerationModelCopyWith<$Res> {
|
||||
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});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ProductModerationModelCopyWithImpl<$Res,
|
||||
$Val extends ProductModerationModel>
|
||||
implements $ProductModerationModelCopyWith<$Res> {
|
||||
_$ProductModerationModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ProductModerationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? name = null,
|
||||
Object? energy = null,
|
||||
Object? proteins = null,
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProductModerationModelImplCopyWith<$Res>
|
||||
implements $ProductModerationModelCopyWith<$Res> {
|
||||
factory _$$ProductModerationModelImplCopyWith(
|
||||
_$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});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProductModerationModelImplCopyWithImpl<$Res>
|
||||
extends _$ProductModerationModelCopyWithImpl<$Res,
|
||||
_$ProductModerationModelImpl>
|
||||
implements _$$ProductModerationModelImplCopyWith<$Res> {
|
||||
__$$ProductModerationModelImplCopyWithImpl(
|
||||
_$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.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? name = null,
|
||||
Object? energy = null,
|
||||
Object? proteins = null,
|
||||
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,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @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});
|
||||
|
||||
factory _$ProductModerationModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ProductModerationModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
@JsonKey(name: 'energy_on_100gr')
|
||||
final double energy;
|
||||
@override
|
||||
@JsonKey(name: 'proteins_on_100gr')
|
||||
final double proteins;
|
||||
@override
|
||||
@JsonKey(name: 'fats_on_100gr')
|
||||
final double fats;
|
||||
@override
|
||||
@JsonKey(name: 'carbohydrates_on_100gr')
|
||||
final double carbohydrates;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProductModerationModel(name: $name, energy: $energy, proteins: $proteins, fats: $fats, carbohydrates: $carbohydrates)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ProductModerationModelImpl &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.energy, energy) || other.energy == energy) &&
|
||||
(identical(other.proteins, proteins) ||
|
||||
other.proteins == proteins) &&
|
||||
(identical(other.fats, fats) || other.fats == fats) &&
|
||||
(identical(other.carbohydrates, carbohydrates) ||
|
||||
other.carbohydrates == carbohydrates));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, name, energy, proteins, fats, carbohydrates);
|
||||
|
||||
/// Create a copy of ProductModerationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ProductModerationModelImplCopyWith<_$ProductModerationModelImpl>
|
||||
get copyWith => __$$ProductModerationModelImplCopyWithImpl<
|
||||
_$ProductModerationModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
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;
|
||||
|
||||
factory _ProductModerationModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ProductModerationModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
@JsonKey(name: 'energy_on_100gr')
|
||||
double get energy;
|
||||
@override
|
||||
@JsonKey(name: 'proteins_on_100gr')
|
||||
double get proteins;
|
||||
@override
|
||||
@JsonKey(name: 'fats_on_100gr')
|
||||
double get fats;
|
||||
@override
|
||||
@JsonKey(name: 'carbohydrates_on_100gr')
|
||||
double get carbohydrates;
|
||||
|
||||
/// Create a copy of ProductModerationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ProductModerationModelImplCopyWith<_$ProductModerationModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'product_moderation_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$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> _$$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,
|
||||
};
|
||||
@@ -1,728 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'diary_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
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');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DiaryState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
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;
|
||||
@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;
|
||||
@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,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
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;
|
||||
@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;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value)? $default, {
|
||||
TResult Function(DiaryStateLoading value)? loading,
|
||||
TResult Function(DiaryStateError value)? error,
|
||||
TResult Function(DiaryStateLoaded value)? loaded,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $DiaryStateCopyWith<$Res> {
|
||||
factory $DiaryStateCopyWith(
|
||||
DiaryState value, $Res Function(DiaryState) then) =
|
||||
_$DiaryStateCopyWithImpl<$Res, DiaryState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState>
|
||||
implements $DiaryStateCopyWith<$Res> {
|
||||
_$DiaryStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateImplCopyWith<$Res> {
|
||||
factory _$$DiaryStateImplCopyWith(
|
||||
_$DiaryStateImpl value, $Res Function(_$DiaryStateImpl) then) =
|
||||
__$$DiaryStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DiaryStateImplCopyWithImpl<$Res>
|
||||
extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateImpl>
|
||||
implements _$$DiaryStateImplCopyWith<$Res> {
|
||||
__$$DiaryStateImplCopyWithImpl(
|
||||
_$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.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DiaryStateImpl implements _DiaryState {
|
||||
const _$DiaryStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DiaryState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$DiaryStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
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,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value)? $default, {
|
||||
TResult Function(DiaryStateLoading value)? loading,
|
||||
TResult Function(DiaryStateError value)? error,
|
||||
TResult Function(DiaryStateLoaded value)? loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _DiaryState implements DiaryState {
|
||||
const factory _DiaryState() = _$DiaryStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateLoadingImplCopyWith<$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);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DiaryStateLoadingImpl implements DiaryStateLoading {
|
||||
const _$DiaryStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DiaryState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$DiaryStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
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,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value)? $default, {
|
||||
TResult Function(DiaryStateLoading value)? loading,
|
||||
TResult Function(DiaryStateError value)? error,
|
||||
TResult Function(DiaryStateLoaded value)? loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DiaryStateLoading implements DiaryState {
|
||||
const factory DiaryStateLoading() = _$DiaryStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateErrorImplCopyWith<$Res> {
|
||||
factory _$$DiaryStateErrorImplCopyWith(_$DiaryStateErrorImpl value,
|
||||
$Res Function(_$DiaryStateErrorImpl) then) =
|
||||
__$$DiaryStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DiaryStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateErrorImpl>
|
||||
implements _$$DiaryStateErrorImplCopyWith<$Res> {
|
||||
__$$DiaryStateErrorImplCopyWithImpl(
|
||||
_$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,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DiaryStateErrorImpl implements DiaryStateError {
|
||||
const _$DiaryStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DiaryState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$DiaryStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith =>
|
||||
__$$DiaryStateErrorImplCopyWithImpl<_$DiaryStateErrorImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
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,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value)? $default, {
|
||||
TResult Function(DiaryStateLoading value)? loading,
|
||||
TResult Function(DiaryStateError value)? error,
|
||||
TResult Function(DiaryStateLoaded value)? loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DiaryStateError implements DiaryState {
|
||||
const factory DiaryStateError({required final String errorMessage}) =
|
||||
_$DiaryStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$DiaryStateLoadedImplCopyWith(_$DiaryStateLoadedImpl value,
|
||||
$Res Function(_$DiaryStateLoadedImpl) then) =
|
||||
__$$DiaryStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal});
|
||||
|
||||
$DiaryDayModelCopyWith<$Res> get diary;
|
||||
$NutritionDataModelCopyWith<$Res> get nutrition;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadedImpl>
|
||||
implements _$$DiaryStateLoadedImplCopyWith<$Res> {
|
||||
__$$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.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? diary = null,
|
||||
Object? nutrition = null,
|
||||
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,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DiaryDayModelCopyWith<$Res> get diary {
|
||||
return $DiaryDayModelCopyWith<$Res>(_value.diary, (value) {
|
||||
return _then(_value.copyWith(diary: value));
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$NutritionDataModelCopyWith<$Res> get nutrition {
|
||||
return $NutritionDataModelCopyWith<$Res>(_value.nutrition, (value) {
|
||||
return _then(_value.copyWith(nutrition: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DiaryStateLoadedImpl implements DiaryStateLoaded {
|
||||
const _$DiaryStateLoadedImpl(
|
||||
{required this.diary,
|
||||
required this.nutrition,
|
||||
required this.selectedDay,
|
||||
required this.selectedMeal});
|
||||
|
||||
@override
|
||||
final DiaryDayModel diary;
|
||||
@override
|
||||
final NutritionDataModel nutrition;
|
||||
@override
|
||||
final DateTime selectedDay;
|
||||
@override
|
||||
final int selectedMeal;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DiaryState.loaded(diary: $diary, nutrition: $nutrition, selectedDay: $selectedDay, selectedMeal: $selectedMeal)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$DiaryStateLoadedImpl &&
|
||||
(identical(other.diary, diary) || other.diary == diary) &&
|
||||
(identical(other.nutrition, nutrition) ||
|
||||
other.nutrition == nutrition) &&
|
||||
(identical(other.selectedDay, selectedDay) ||
|
||||
other.selectedDay == selectedDay) &&
|
||||
(identical(other.selectedMeal, selectedMeal) ||
|
||||
other.selectedMeal == selectedMeal));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, diary, nutrition, selectedDay, selectedMeal);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith =>
|
||||
__$$DiaryStateLoadedImplCopyWithImpl<_$DiaryStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
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,
|
||||
}) {
|
||||
return loaded(diary, nutrition, selectedDay, selectedMeal);
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return loaded?.call(diary, nutrition, selectedDay, selectedMeal);
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(diary, nutrition, selectedDay, selectedMeal);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@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,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value)? $default, {
|
||||
TResult Function(DiaryStateLoading value)? loading,
|
||||
TResult Function(DiaryStateError value)? error,
|
||||
TResult Function(DiaryStateLoaded value)? loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
DiaryDayModel get diary;
|
||||
NutritionDataModel get nutrition;
|
||||
DateTime get selectedDay;
|
||||
int get selectedMeal;
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,507 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'diary_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _DiaryService implements DiaryService {
|
||||
_DiaryService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<List<DiaryDayModel>> getDiaryIndexByDate({
|
||||
required String date,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<List<DiaryDayModel>>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/index/${date}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
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();
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<DiaryDayWrapperModel> getDiaryDay({required int diary}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<DiaryDayWrapperModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/show',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late DiaryDayWrapperModel _value;
|
||||
try {
|
||||
_value = DiaryDayWrapperModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<NutritionDataModel> getNutrition({required int diary}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<NutritionDataModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/dailyNutritionData',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late NutritionDataModel _value;
|
||||
try {
|
||||
_value = NutritionDataModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> uploadPhotoOfMeal({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required File photo,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = FormData();
|
||||
_data.files.add(
|
||||
MapEntry(
|
||||
'photo',
|
||||
MultipartFile.fromFileSync(
|
||||
photo.path,
|
||||
filename: photo.path.split(Platform.pathSeparator).last,
|
||||
),
|
||||
),
|
||||
);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/photo/upload',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deletePhotoOfMeal({
|
||||
required int diaryId,
|
||||
required int typeNo,
|
||||
required int userAttachment,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'DELETE', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diaryId}/meals/${typeNo}/photo/${userAttachment}/delete',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> addProductToMeal({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required String productName,
|
||||
required String portion,
|
||||
required int quantity,
|
||||
int? productNutritionalValueId,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
queryParameters.removeWhere((k, v) => v == null);
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = FormData();
|
||||
_data.fields.add(MapEntry('product_name', productName));
|
||||
_data.fields.add(MapEntry('portion', portion));
|
||||
_data.fields.add(MapEntry('quantity', quantity.toString()));
|
||||
if (productNutritionalValueId != null) {
|
||||
_data.fields.add(
|
||||
MapEntry(
|
||||
'product_nutritional_value_id',
|
||||
productNutritionalValueId.toString(),
|
||||
),
|
||||
);
|
||||
}
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/portion/create',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateProductInMeal({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int portionModel,
|
||||
required Map<String, dynamic> productInMeal,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(productInMeal);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'PUT', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/update',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> markEaten({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int portionModel,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/${portionModel}/mark_eaten',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> unmarkEaten({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int portionModel,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/${portionModel}/unmark_eaten',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> restore({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int portionModel,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/restore',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteProductFromMeal({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int portionModel,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'DELETE', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/delete',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> finishDiaryDay({
|
||||
required int diary,
|
||||
required FinishDiaryDayModel finishDiaryDayModel,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = finishDiaryDayModel;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/finishDay',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> fillSatiety({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int satiety,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = {'satiety': satiety};
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/satiety/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> fillMood({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int mood,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = {'mood': mood};
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/mood/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> fillTime({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required String time,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = {'time': time};
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/time/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> fillWakeup({required int diary, required String wakeUp}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = {'wakeUp': wakeUp};
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/wakeUp/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> fillRetire({required int diary, required String retire}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = {'retire': retire};
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/retire/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<GlossaryModerationModel> sendProductToModeration({
|
||||
required Map<String, dynamic> data,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(data);
|
||||
final _options = _setStreamType<GlossaryModerationModel>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/product_nutritional_values/sendToModeration',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late GlossaryModerationModel _value;
|
||||
try {
|
||||
_value = GlossaryModerationModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user