forked from eatvio/eatvio_app
feat(calendar): Diet days marked in calendar, diet preview page added
This commit is contained in:
@@ -5,14 +5,18 @@ class CalendarEntryModel {
|
||||
String? date;
|
||||
String? status;
|
||||
String id;
|
||||
bool is_current_day_included_in_the_chosen_diet_progression;
|
||||
|
||||
CalendarEntryModel({
|
||||
this.date,
|
||||
this.status,
|
||||
required this.id,
|
||||
required this.is_current_day_included_in_the_chosen_diet_progression,
|
||||
}) {
|
||||
date = date;
|
||||
status = status;
|
||||
id = id;
|
||||
is_current_day_included_in_the_chosen_diet_progression =
|
||||
is_current_day_included_in_the_chosen_diet_progression;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ part 'calendar_model.g.dart';
|
||||
class CalendarModel with _$CalendarModel {
|
||||
const factory CalendarModel({
|
||||
required String date,
|
||||
required bool is_current_day_included_in_the_chosen_diet_progression,
|
||||
Object? diary,
|
||||
}) = _CalendarModel;
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ CalendarModel _$CalendarModelFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$CalendarModel {
|
||||
String get date => throw _privateConstructorUsedError;
|
||||
bool get is_current_day_included_in_the_chosen_diet_progression =>
|
||||
throw _privateConstructorUsedError;
|
||||
Object? get diary => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -35,7 +37,10 @@ abstract class $CalendarModelCopyWith<$Res> {
|
||||
CalendarModel value, $Res Function(CalendarModel) then) =
|
||||
_$CalendarModelCopyWithImpl<$Res, CalendarModel>;
|
||||
@useResult
|
||||
$Res call({String date, Object? diary});
|
||||
$Res call(
|
||||
{String date,
|
||||
bool is_current_day_included_in_the_chosen_diet_progression,
|
||||
Object? diary});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -52,6 +57,7 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel>
|
||||
@override
|
||||
$Res call({
|
||||
Object? date = null,
|
||||
Object? is_current_day_included_in_the_chosen_diet_progression = null,
|
||||
Object? diary = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
@@ -59,6 +65,11 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel>
|
||||
? _value.date
|
||||
: date // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
is_current_day_included_in_the_chosen_diet_progression: null ==
|
||||
is_current_day_included_in_the_chosen_diet_progression
|
||||
? _value.is_current_day_included_in_the_chosen_diet_progression
|
||||
: is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
diary: freezed == diary ? _value.diary : diary,
|
||||
) as $Val);
|
||||
}
|
||||
@@ -72,7 +83,10 @@ abstract class _$$CalendarModelImplCopyWith<$Res>
|
||||
__$$CalendarModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String date, Object? diary});
|
||||
$Res call(
|
||||
{String date,
|
||||
bool is_current_day_included_in_the_chosen_diet_progression,
|
||||
Object? diary});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -87,6 +101,7 @@ class __$$CalendarModelImplCopyWithImpl<$Res>
|
||||
@override
|
||||
$Res call({
|
||||
Object? date = null,
|
||||
Object? is_current_day_included_in_the_chosen_diet_progression = null,
|
||||
Object? diary = freezed,
|
||||
}) {
|
||||
return _then(_$CalendarModelImpl(
|
||||
@@ -94,6 +109,11 @@ class __$$CalendarModelImplCopyWithImpl<$Res>
|
||||
? _value.date
|
||||
: date // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
is_current_day_included_in_the_chosen_diet_progression: null ==
|
||||
is_current_day_included_in_the_chosen_diet_progression
|
||||
? _value.is_current_day_included_in_the_chosen_diet_progression
|
||||
: is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
diary: freezed == diary ? _value.diary : diary,
|
||||
));
|
||||
}
|
||||
@@ -102,7 +122,10 @@ class __$$CalendarModelImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$CalendarModelImpl implements _CalendarModel {
|
||||
const _$CalendarModelImpl({required this.date, this.diary});
|
||||
const _$CalendarModelImpl(
|
||||
{required this.date,
|
||||
required this.is_current_day_included_in_the_chosen_diet_progression,
|
||||
this.diary});
|
||||
|
||||
factory _$CalendarModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CalendarModelImplFromJson(json);
|
||||
@@ -110,11 +133,13 @@ class _$CalendarModelImpl implements _CalendarModel {
|
||||
@override
|
||||
final String date;
|
||||
@override
|
||||
final bool is_current_day_included_in_the_chosen_diet_progression;
|
||||
@override
|
||||
final Object? diary;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CalendarModel(date: $date, diary: $diary)';
|
||||
return 'CalendarModel(date: $date, is_current_day_included_in_the_chosen_diet_progression: $is_current_day_included_in_the_chosen_diet_progression, diary: $diary)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -123,13 +148,22 @@ class _$CalendarModelImpl implements _CalendarModel {
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CalendarModelImpl &&
|
||||
(identical(other.date, date) || other.date == date) &&
|
||||
(identical(
|
||||
other
|
||||
.is_current_day_included_in_the_chosen_diet_progression,
|
||||
is_current_day_included_in_the_chosen_diet_progression) ||
|
||||
other.is_current_day_included_in_the_chosen_diet_progression ==
|
||||
is_current_day_included_in_the_chosen_diet_progression) &&
|
||||
const DeepCollectionEquality().equals(other.diary, diary));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, date, const DeepCollectionEquality().hash(diary));
|
||||
runtimeType,
|
||||
date,
|
||||
is_current_day_included_in_the_chosen_diet_progression,
|
||||
const DeepCollectionEquality().hash(diary));
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@@ -147,7 +181,10 @@ class _$CalendarModelImpl implements _CalendarModel {
|
||||
|
||||
abstract class _CalendarModel implements CalendarModel {
|
||||
const factory _CalendarModel(
|
||||
{required final String date, final Object? diary}) = _$CalendarModelImpl;
|
||||
{required final String date,
|
||||
required final bool
|
||||
is_current_day_included_in_the_chosen_diet_progression,
|
||||
final Object? diary}) = _$CalendarModelImpl;
|
||||
|
||||
factory _CalendarModel.fromJson(Map<String, dynamic> json) =
|
||||
_$CalendarModelImpl.fromJson;
|
||||
@@ -155,6 +192,8 @@ abstract class _CalendarModel implements CalendarModel {
|
||||
@override
|
||||
String get date;
|
||||
@override
|
||||
bool get is_current_day_included_in_the_chosen_diet_progression;
|
||||
@override
|
||||
Object? get diary;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
|
||||
@@ -9,11 +9,16 @@ part of 'calendar_model.dart';
|
||||
_$CalendarModelImpl _$$CalendarModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$CalendarModelImpl(
|
||||
date: json['date'] as String,
|
||||
is_current_day_included_in_the_chosen_diet_progression:
|
||||
json['is_current_day_included_in_the_chosen_diet_progression']
|
||||
as bool,
|
||||
diary: json['diary'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CalendarModelImplToJson(_$CalendarModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'date': instance.date,
|
||||
'is_current_day_included_in_the_chosen_diet_progression':
|
||||
instance.is_current_day_included_in_the_chosen_diet_progression,
|
||||
'diary': instance.diary,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user