From c800d356632bf9dfef80e0d83c51ea3d4983fd81 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 13 Sep 2024 14:22:57 +0300 Subject: [PATCH] feat(profile): add profile charts models, requests. Max length of description in posts, recipes, diets = 200 --- .../initialization_state.freezed.dart | 94 ++- lib/core/models/pagination_model.freezed.dart | 169 ++-- lib/core/models/pagination_model.g.dart | 13 +- .../selection_popup_model.freezed.dart | 52 +- .../new_messages_state.freezed.dart | 90 ++- .../notifications_state.freezed.dart | 157 ++-- .../profile_avatar_state.freezed.dart | 93 ++- .../models/calendar_model.freezed.dart | 89 ++- .../calendar/models/calendar_model.g.dart | 13 +- .../bloc/calendar_state.freezed.dart | 95 ++- .../presentation/pages/calendar_screen.dart | 5 +- .../calendar/services/calendar_service.g.dart | 8 +- .../models/chat_message_model.freezed.dart | 71 +- .../chat/models/chat_message_model.g.dart | 8 +- .../models/chat_messages_model.freezed.dart | 68 +- .../chat/models/chat_messages_model.g.dart | 12 +- .../chat/models/chat_meta_model.freezed.dart | 52 +- .../chat/models/chat_meta_model.g.dart | 6 +- .../chat/models/chat_room_model.freezed.dart | 76 +- .../chat/models/chat_room_model.g.dart | 12 +- .../chat_room_preview_model.freezed.dart | 332 ++++---- .../models/chat_room_preview_model.g.dart | 41 +- .../chat_room_settings_model.freezed.dart | 76 +- .../models/chat_room_settings_model.g.dart | 8 +- .../chat/models/chat_user_model.freezed.dart | 76 +- .../chat/models/chat_user_model.g.dart | 6 +- .../models/websocket_info_model.freezed.dart | 79 +- .../chat/models/websocket_info_model.g.dart | 8 +- .../chat_room_state.freezed.dart | 169 ++-- .../chat_select_state.freezed.dart | 100 ++- .../chat/services/chat_service.g.dart | 7 +- .../diary/models/diary_model.freezed.dart | 86 +- lib/features/diary/models/diary_model.g.dart | 18 +- lib/features/diary/models/meal.freezed.dart | 72 +- lib/features/diary/models/meal.g.dart | 11 +- lib/features/diary/models/photo.freezed.dart | 57 +- lib/features/diary/models/photo.g.dart | 3 +- .../diary/models/portion.freezed.dart | 71 +- lib/features/diary/models/portion.g.dart | 6 +- .../diary/models/product.freezed.dart | 35 +- lib/features/diary/models/product.g.dart | 6 +- lib/features/diary/models/state.freezed.dart | 48 +- lib/features/diary/models/state.g.dart | 3 +- .../bloc/diary_state.freezed.dart | 220 +++--- .../diary/services/diary_service.g.dart | 16 +- .../feed/models/comment_model.freezed.dart | 147 ++-- lib/features/feed/models/comment_model.g.dart | 20 +- .../diets_pagination_model.freezed.dart | 369 +++++---- .../feed/models/diets_pagination_model.g.dart | 36 +- .../models/feed_blog_post_model.freezed.dart | 129 +-- .../feed/models/feed_blog_post_model.g.dart | 8 +- ...feed_blog_post_settings_model.freezed.dart | 79 +- .../feed_blog_post_settings_model.g.dart | 12 +- .../feed/models/recipes_model.freezed.dart | 202 ++--- lib/features/feed/models/recipes_model.g.dart | 23 +- .../recipes_pagination_model.freezed.dart | 56 +- .../models/recipes_pagination_model.g.dart | 12 +- .../bloc/comments_cubit/comments_cubit.dart | 6 +- .../comments_state.freezed.dart | 83 +- .../bloc/diets_cubit/diets_state.freezed.dart | 88 ++- .../bloc/feed_cubit/feed_cubit.dart | 17 +- .../bloc/feed_cubit/feed_state.freezed.dart | 155 ++-- .../bloc/recipes_cubit/recipes_cubit.dart | 10 +- .../recipes_cubit/recipes_state.freezed.dart | 206 +++-- .../feed/presentation/pages/feed_screen.dart | 30 +- .../widgets/blog_post_widget.dart | 16 +- .../presentation/widgets/diets_widget.dart | 34 +- .../presentation/widgets/recipes_widget.dart | 34 +- .../widgets/tags_modal_widget.dart | 44 +- .../feed/repositories/feed_repository.dart | 50 +- lib/features/feed/services/feed_service.dart | 4 +- .../feed/services/feed_service.g.dart | 22 +- .../models/plan_pagination_model.freezed.dart | 328 ++++---- .../plans/models/plan_pagination_model.g.dart | 30 +- .../bloc/plans_cubit/plans_state.freezed.dart | 89 ++- .../plans/services/plans_service.g.dart | 4 +- .../profile/models/circumference_model.dart | 19 + .../models/circumference_model.freezed.dart | 319 ++++++++ .../profile/models/circumference_model.g.dart | 31 + .../profile/models/profile_model.freezed.dart | 247 +++--- .../profile/models/profile_model.g.dart | 34 +- lib/features/profile/models/weight_model.dart | 18 + .../profile/models/weight_model.freezed.dart | 289 +++++++ .../profile/models/weight_model.g.dart | 27 + .../bloc/profile_cubit/profile_cubit.dart | 4 + .../bloc/profile_cubit/profile_state.dart | 4 + .../profile_cubit/profile_state.freezed.dart | 288 +++++-- .../presentation/pages/profile_screen.dart | 53 +- .../widgets/circumference_chart_widget.dart | 748 +++++++++--------- .../widgets/imt_chart_widget.dart | 228 +++--- .../widgets/weight_chart_widget.dart | 474 +++++------ .../repositories/profile_repository.dart | 42 + .../profile/services/profile_service.dart | 24 + .../profile/services/profile_service.g.dart | 156 +++- .../recipes/models/ingredient.freezed.dart | 52 +- lib/features/recipes/models/ingredient.g.dart | 6 +- .../recipes/models/recipe_model.freezed.dart | 83 +- .../recipes/models/recipe_model.g.dart | 16 +- .../models/recipe_tag_model.freezed.dart | 135 ++-- .../recipes/models/recipe_tag_model.g.dart | 17 +- lib/features/recipes/models/step.freezed.dart | 37 +- lib/features/recipes/models/step.g.dart | 3 +- .../bloc/recipe_create_state.freezed.dart | 211 ++--- .../recipes/services/recipe_service.g.dart | 10 +- .../models/location_model.freezed.dart | 69 +- .../registration/models/location_model.g.dart | 9 +- .../user_registration_model.freezed.dart | 183 ++--- .../models/user_registration_model.g.dart | 11 +- .../registration_state.freezed.dart | 40 +- .../services/registration_service.g.dart | 7 +- pubspec.yaml | 1 + 111 files changed, 5760 insertions(+), 3215 deletions(-) create mode 100644 lib/features/profile/models/circumference_model.dart create mode 100644 lib/features/profile/models/circumference_model.freezed.dart create mode 100644 lib/features/profile/models/circumference_model.g.dart create mode 100644 lib/features/profile/models/weight_model.dart create mode 100644 lib/features/profile/models/weight_model.freezed.dart create mode 100644 lib/features/profile/models/weight_model.g.dart diff --git a/lib/core/initialization_cubit/initialization_state.freezed.dart b/lib/core/initialization_cubit/initialization_state.freezed.dart index d9ece2ef..b0535c68 100644 --- a/lib/core/initialization_cubit/initialization_state.freezed.dart +++ b/lib/core/initialization_cubit/initialization_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$InitializationState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,17 +70,18 @@ mixin _$InitializationState { /// @nodoc abstract class $InitializationStateCopyWith<$Res> { - factory $InitializationStateCopyWith(InitializationState value, $Res Function(InitializationState) then) = + factory $InitializationStateCopyWith( + InitializationState value, $Res Function(InitializationState) then) = _$InitializationStateCopyWithImpl<$Res, InitializationState>; } /// @nodoc -class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> implements $InitializationStateCopyWith<$Res> { +class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> + implements $InitializationStateCopyWith<$Res> { _$InitializationStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -91,14 +91,18 @@ class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> /// @nodoc abstract class _$$InitializationStateImplCopyWith<$Res> { - factory _$$InitializationStateImplCopyWith(_$InitializationStateImpl value, $Res Function(_$InitializationStateImpl) then) = + factory _$$InitializationStateImplCopyWith(_$InitializationStateImpl value, + $Res Function(_$InitializationStateImpl) then) = __$$InitializationStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitializationStateImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateImpl> +class __$$InitializationStateImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateImpl> implements _$$InitializationStateImplCopyWith<$Res> { - __$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value, $Res Function(_$InitializationStateImpl) _then) : super(_value, _then); + __$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value, + $Res Function(_$InitializationStateImpl) _then) + : super(_value, _then); /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @@ -116,7 +120,9 @@ class _$InitializationStateImpl implements _InitializationState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InitializationStateImpl); } @override @@ -203,14 +209,20 @@ abstract class _InitializationState implements InitializationState { /// @nodoc abstract class _$$InitializationStateLoadingImplCopyWith<$Res> { - factory _$$InitializationStateLoadingImplCopyWith(_$InitializationStateLoadingImpl value, $Res Function(_$InitializationStateLoadingImpl) then) = + factory _$$InitializationStateLoadingImplCopyWith( + _$InitializationStateLoadingImpl value, + $Res Function(_$InitializationStateLoadingImpl) then) = __$$InitializationStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitializationStateLoadingImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateLoadingImpl> +class __$$InitializationStateLoadingImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateLoadingImpl> implements _$$InitializationStateLoadingImplCopyWith<$Res> { - __$$InitializationStateLoadingImplCopyWithImpl(_$InitializationStateLoadingImpl _value, $Res Function(_$InitializationStateLoadingImpl) _then) + __$$InitializationStateLoadingImplCopyWithImpl( + _$InitializationStateLoadingImpl _value, + $Res Function(_$InitializationStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -229,7 +241,9 @@ class _$InitializationStateLoadingImpl implements InitializationStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InitializationStateLoadingImpl); } @override @@ -316,17 +330,22 @@ abstract class InitializationStateLoading implements InitializationState { /// @nodoc abstract class _$$InitializationStateSuccessImplCopyWith<$Res> { - factory _$$InitializationStateSuccessImplCopyWith(_$InitializationStateSuccessImpl value, $Res Function(_$InitializationStateSuccessImpl) then) = + factory _$$InitializationStateSuccessImplCopyWith( + _$InitializationStateSuccessImpl value, + $Res Function(_$InitializationStateSuccessImpl) then) = __$$InitializationStateSuccessImplCopyWithImpl<$Res>; - @useResult $Res call({PusherChannelsClient client}); } /// @nodoc -class __$$InitializationStateSuccessImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateSuccessImpl> +class __$$InitializationStateSuccessImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateSuccessImpl> implements _$$InitializationStateSuccessImplCopyWith<$Res> { - __$$InitializationStateSuccessImplCopyWithImpl(_$InitializationStateSuccessImpl _value, $Res Function(_$InitializationStateSuccessImpl) _then) + __$$InitializationStateSuccessImplCopyWithImpl( + _$InitializationStateSuccessImpl _value, + $Res Function(_$InitializationStateSuccessImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -361,7 +380,9 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$InitializationStateSuccessImpl && (identical(other.client, client) || other.client == client)); + (other.runtimeType == runtimeType && + other is _$InitializationStateSuccessImpl && + (identical(other.client, client) || other.client == client)); } @override @@ -372,8 +393,9 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => - __$$InitializationStateSuccessImplCopyWithImpl<_$InitializationStateSuccessImpl>(this, _$identity); + _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> + get copyWith => __$$InitializationStateSuccessImplCopyWithImpl< + _$InitializationStateSuccessImpl>(this, _$identity); @override @optionalTypeArgs @@ -451,29 +473,37 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { } abstract class InitializationStateSuccess implements InitializationState { - const factory InitializationStateSuccess({required final PusherChannelsClient client}) = _$InitializationStateSuccessImpl; + const factory InitializationStateSuccess( + {required final PusherChannelsClient client}) = + _$InitializationStateSuccessImpl; PusherChannelsClient get client; /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => throw _privateConstructorUsedError; + _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$InitializationStateErrorImplCopyWith<$Res> { - factory _$$InitializationStateErrorImplCopyWith(_$InitializationStateErrorImpl value, $Res Function(_$InitializationStateErrorImpl) then) = + factory _$$InitializationStateErrorImplCopyWith( + _$InitializationStateErrorImpl value, + $Res Function(_$InitializationStateErrorImpl) then) = __$$InitializationStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$InitializationStateErrorImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateErrorImpl> +class __$$InitializationStateErrorImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateErrorImpl> implements _$$InitializationStateErrorImplCopyWith<$Res> { - __$$InitializationStateErrorImplCopyWithImpl(_$InitializationStateErrorImpl _value, $Res Function(_$InitializationStateErrorImpl) _then) + __$$InitializationStateErrorImplCopyWithImpl( + _$InitializationStateErrorImpl _value, + $Res Function(_$InitializationStateErrorImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -510,7 +540,8 @@ class _$InitializationStateErrorImpl implements InitializationStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -521,8 +552,9 @@ class _$InitializationStateErrorImpl implements InitializationStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => - __$$InitializationStateErrorImplCopyWithImpl<_$InitializationStateErrorImpl>(this, _$identity); + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> + get copyWith => __$$InitializationStateErrorImplCopyWithImpl< + _$InitializationStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -600,12 +632,14 @@ class _$InitializationStateErrorImpl implements InitializationStateError { } abstract class InitializationStateError implements InitializationState { - const factory InitializationStateError({required final String errorMessage}) = _$InitializationStateErrorImpl; + const factory InitializationStateError({required final String errorMessage}) = + _$InitializationStateErrorImpl; String get errorMessage; /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/models/pagination_model.freezed.dart b/lib/core/models/pagination_model.freezed.dart index 692c6ef3..35f2c080 100644 --- a/lib/core/models/pagination_model.freezed.dart +++ b/lib/core/models/pagination_model.freezed.dart @@ -22,13 +22,10 @@ Links _$LinksFromJson(Map json) { mixin _$Links { @JsonKey(name: "first") String get first => throw _privateConstructorUsedError; - @JsonKey(name: "last") String get last => throw _privateConstructorUsedError; - @JsonKey(name: "prev") dynamic get prev => throw _privateConstructorUsedError; - @JsonKey(name: "next") dynamic get next => throw _privateConstructorUsedError; @@ -43,20 +40,23 @@ mixin _$Links { /// @nodoc abstract class $LinksCopyWith<$Res> { - factory $LinksCopyWith(Links value, $Res Function(Links) then) = _$LinksCopyWithImpl<$Res, Links>; - + factory $LinksCopyWith(Links value, $Res Function(Links) then) = + _$LinksCopyWithImpl<$Res, Links>; @useResult $Res call( - {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, + @JsonKey(name: "last") String last, + @JsonKey(name: "prev") dynamic prev, + @JsonKey(name: "next") dynamic next}); } /// @nodoc -class _$LinksCopyWithImpl<$Res, $Val extends Links> implements $LinksCopyWith<$Res> { +class _$LinksCopyWithImpl<$Res, $Val extends Links> + implements $LinksCopyWith<$Res> { _$LinksCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -93,17 +93,25 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links> implements $LinksCopyWith<$R /// @nodoc abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$Res> { - factory _$$LinksImplCopyWith(_$LinksImpl value, $Res Function(_$LinksImpl) then) = __$$LinksImplCopyWithImpl<$Res>; - + factory _$$LinksImplCopyWith( + _$LinksImpl value, $Res Function(_$LinksImpl) then) = + __$$LinksImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, + @JsonKey(name: "last") String last, + @JsonKey(name: "prev") dynamic prev, + @JsonKey(name: "next") dynamic next}); } /// @nodoc -class __$$LinksImplCopyWithImpl<$Res> extends _$LinksCopyWithImpl<$Res, _$LinksImpl> implements _$$LinksImplCopyWith<$Res> { - __$$LinksImplCopyWithImpl(_$LinksImpl _value, $Res Function(_$LinksImpl) _then) : super(_value, _then); +class __$$LinksImplCopyWithImpl<$Res> + extends _$LinksCopyWithImpl<$Res, _$LinksImpl> + implements _$$LinksImplCopyWith<$Res> { + __$$LinksImplCopyWithImpl( + _$LinksImpl _value, $Res Function(_$LinksImpl) _then) + : super(_value, _then); /// Create a copy of Links /// with the given fields replaced by the non-null parameter values. @@ -145,7 +153,8 @@ class _$LinksImpl implements _Links { @JsonKey(name: "prev") required this.prev, @JsonKey(name: "next") required this.next}); - factory _$LinksImpl.fromJson(Map json) => _$$LinksImplFromJson(json); + factory _$LinksImpl.fromJson(Map json) => + _$$LinksImplFromJson(json); @override @JsonKey(name: "first") @@ -178,14 +187,20 @@ class _$LinksImpl implements _Links { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, first, last, const DeepCollectionEquality().hash(prev), const DeepCollectionEquality().hash(next)); + int get hashCode => Object.hash( + runtimeType, + first, + last, + const DeepCollectionEquality().hash(prev), + const DeepCollectionEquality().hash(next)); /// Create a copy of Links /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => + __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); @override Map toJson() { @@ -207,15 +222,12 @@ abstract class _Links implements Links { @override @JsonKey(name: "first") String get first; - @override @JsonKey(name: "last") String get last; - @override @JsonKey(name: "prev") dynamic get prev; - @override @JsonKey(name: "next") dynamic get next; @@ -224,7 +236,8 @@ abstract class _Links implements Links { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => throw _privateConstructorUsedError; + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => + throw _privateConstructorUsedError; } Meta _$MetaFromJson(Map json) { @@ -235,25 +248,18 @@ Meta _$MetaFromJson(Map json) { mixin _$Meta { @JsonKey(name: "current_page") int get currentPage => throw _privateConstructorUsedError; - @JsonKey(name: "from") dynamic get from => throw _privateConstructorUsedError; - @JsonKey(name: "last_page") int get lastPage => throw _privateConstructorUsedError; - @JsonKey(name: "links") List get links => throw _privateConstructorUsedError; - @JsonKey(name: "path") String? get path => throw _privateConstructorUsedError; - @JsonKey(name: "per_page") int get perPage => throw _privateConstructorUsedError; - @JsonKey(name: "to") dynamic get to => throw _privateConstructorUsedError; - @JsonKey(name: "total") int get total => throw _privateConstructorUsedError; @@ -268,8 +274,8 @@ mixin _$Meta { /// @nodoc abstract class $MetaCopyWith<$Res> { - factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = _$MetaCopyWithImpl<$Res, Meta>; - + factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = + _$MetaCopyWithImpl<$Res, Meta>; @useResult $Res call( {@JsonKey(name: "current_page") int currentPage, @@ -283,12 +289,12 @@ abstract class $MetaCopyWith<$Res> { } /// @nodoc -class _$MetaCopyWithImpl<$Res, $Val extends Meta> implements $MetaCopyWith<$Res> { +class _$MetaCopyWithImpl<$Res, $Val extends Meta> + implements $MetaCopyWith<$Res> { _$MetaCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -345,8 +351,9 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> implements $MetaCopyWith<$Res> /// @nodoc abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { - factory _$$MetaImplCopyWith(_$MetaImpl value, $Res Function(_$MetaImpl) then) = __$$MetaImplCopyWithImpl<$Res>; - + factory _$$MetaImplCopyWith( + _$MetaImpl value, $Res Function(_$MetaImpl) then) = + __$$MetaImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -361,8 +368,11 @@ abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { } /// @nodoc -class __$$MetaImplCopyWithImpl<$Res> extends _$MetaCopyWithImpl<$Res, _$MetaImpl> implements _$$MetaImplCopyWith<$Res> { - __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) : super(_value, _then); +class __$$MetaImplCopyWithImpl<$Res> + extends _$MetaCopyWithImpl<$Res, _$MetaImpl> + implements _$$MetaImplCopyWith<$Res> { + __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) + : super(_value, _then); /// Create a copy of Meta /// with the given fields replaced by the non-null parameter values. @@ -429,7 +439,8 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "total") required this.total}) : _links = links; - factory _$MetaImpl.fromJson(Map json) => _$$MetaImplFromJson(json); + factory _$MetaImpl.fromJson(Map json) => + _$$MetaImplFromJson(json); @override @JsonKey(name: "current_page") @@ -441,7 +452,6 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "last_page") final int lastPage; final List _links; - @override @JsonKey(name: "links") List get links { @@ -473,9 +483,11 @@ class _$MetaImpl implements _Meta { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MetaImpl && - (identical(other.currentPage, currentPage) || other.currentPage == currentPage) && + (identical(other.currentPage, currentPage) || + other.currentPage == currentPage) && const DeepCollectionEquality().equals(other.from, from) && - (identical(other.lastPage, lastPage) || other.lastPage == lastPage) && + (identical(other.lastPage, lastPage) || + other.lastPage == lastPage) && const DeepCollectionEquality().equals(other._links, _links) && (identical(other.path, path) || other.path == path) && (identical(other.perPage, perPage) || other.perPage == perPage) && @@ -485,15 +497,24 @@ class _$MetaImpl implements _Meta { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, currentPage, const DeepCollectionEquality().hash(from), lastPage, const DeepCollectionEquality().hash(_links), - path, perPage, const DeepCollectionEquality().hash(to), total); + int get hashCode => Object.hash( + runtimeType, + currentPage, + const DeepCollectionEquality().hash(from), + lastPage, + const DeepCollectionEquality().hash(_links), + path, + perPage, + const DeepCollectionEquality().hash(to), + total); /// Create a copy of Meta /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => + __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); @override Map toJson() { @@ -519,31 +540,24 @@ abstract class _Meta implements Meta { @override @JsonKey(name: "current_page") int get currentPage; - @override @JsonKey(name: "from") dynamic get from; - @override @JsonKey(name: "last_page") int get lastPage; - @override @JsonKey(name: "links") List get links; - @override @JsonKey(name: "path") String? get path; - @override @JsonKey(name: "per_page") int get perPage; - @override @JsonKey(name: "to") dynamic get to; - @override @JsonKey(name: "total") int get total; @@ -552,7 +566,8 @@ abstract class _Meta implements Meta { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => throw _privateConstructorUsedError; + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => + throw _privateConstructorUsedError; } Link _$LinkFromJson(Map json) { @@ -563,10 +578,8 @@ Link _$LinkFromJson(Map json) { mixin _$Link { @JsonKey(name: "url") String? get url => throw _privateConstructorUsedError; - @JsonKey(name: "label") String? get label => throw _privateConstructorUsedError; - @JsonKey(name: "active") bool? get active => throw _privateConstructorUsedError; @@ -581,19 +594,22 @@ mixin _$Link { /// @nodoc abstract class $LinkCopyWith<$Res> { - factory $LinkCopyWith(Link value, $Res Function(Link) then) = _$LinkCopyWithImpl<$Res, Link>; - + factory $LinkCopyWith(Link value, $Res Function(Link) then) = + _$LinkCopyWithImpl<$Res, Link>; @useResult - $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String? label, @JsonKey(name: "active") bool? active}); + $Res call( + {@JsonKey(name: "url") String? url, + @JsonKey(name: "label") String? label, + @JsonKey(name: "active") bool? active}); } /// @nodoc -class _$LinkCopyWithImpl<$Res, $Val extends Link> implements $LinkCopyWith<$Res> { +class _$LinkCopyWithImpl<$Res, $Val extends Link> + implements $LinkCopyWith<$Res> { _$LinkCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -625,16 +641,23 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link> implements $LinkCopyWith<$Res> /// @nodoc abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> { - factory _$$LinkImplCopyWith(_$LinkImpl value, $Res Function(_$LinkImpl) then) = __$$LinkImplCopyWithImpl<$Res>; - + factory _$$LinkImplCopyWith( + _$LinkImpl value, $Res Function(_$LinkImpl) then) = + __$$LinkImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String? label, @JsonKey(name: "active") bool? active}); + $Res call( + {@JsonKey(name: "url") String? url, + @JsonKey(name: "label") String? label, + @JsonKey(name: "active") bool? active}); } /// @nodoc -class __$$LinkImplCopyWithImpl<$Res> extends _$LinkCopyWithImpl<$Res, _$LinkImpl> implements _$$LinkImplCopyWith<$Res> { - __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) : super(_value, _then); +class __$$LinkImplCopyWithImpl<$Res> + extends _$LinkCopyWithImpl<$Res, _$LinkImpl> + implements _$$LinkImplCopyWith<$Res> { + __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) + : super(_value, _then); /// Create a copy of Link /// with the given fields replaced by the non-null parameter values. @@ -665,9 +688,13 @@ class __$$LinkImplCopyWithImpl<$Res> extends _$LinkCopyWithImpl<$Res, _$LinkImpl /// @nodoc @JsonSerializable() class _$LinkImpl implements _Link { - const _$LinkImpl({@JsonKey(name: "url") this.url, @JsonKey(name: "label") this.label, @JsonKey(name: "active") this.active}); + const _$LinkImpl( + {@JsonKey(name: "url") this.url, + @JsonKey(name: "label") this.label, + @JsonKey(name: "active") this.active}); - factory _$LinkImpl.fromJson(Map json) => _$$LinkImplFromJson(json); + factory _$LinkImpl.fromJson(Map json) => + _$$LinkImplFromJson(json); @override @JsonKey(name: "url") @@ -703,7 +730,8 @@ class _$LinkImpl implements _Link { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => + __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); @override Map toJson() { @@ -714,19 +742,19 @@ class _$LinkImpl implements _Link { } abstract class _Link implements Link { - const factory _Link({@JsonKey(name: "url") final String? url, @JsonKey(name: "label") final String? label, @JsonKey(name: "active") final bool? active}) = - _$LinkImpl; + const factory _Link( + {@JsonKey(name: "url") final String? url, + @JsonKey(name: "label") final String? label, + @JsonKey(name: "active") final bool? active}) = _$LinkImpl; factory _Link.fromJson(Map json) = _$LinkImpl.fromJson; @override @JsonKey(name: "url") String? get url; - @override @JsonKey(name: "label") String? get label; - @override @JsonKey(name: "active") bool? get active; @@ -735,5 +763,6 @@ abstract class _Link implements Link { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => throw _privateConstructorUsedError; + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/core/models/pagination_model.g.dart b/lib/core/models/pagination_model.g.dart index d0baeab8..610d19b2 100644 --- a/lib/core/models/pagination_model.g.dart +++ b/lib/core/models/pagination_model.g.dart @@ -13,7 +13,8 @@ _$LinksImpl _$$LinksImplFromJson(Map json) => _$LinksImpl( next: json['next'], ); -Map _$$LinksImplToJson(_$LinksImpl instance) => { +Map _$$LinksImplToJson(_$LinksImpl instance) => + { 'first': instance.first, 'last': instance.last, 'prev': instance.prev, @@ -24,14 +25,17 @@ _$MetaImpl _$$MetaImplFromJson(Map json) => _$MetaImpl( currentPage: (json['current_page'] as num).toInt(), from: json['from'], lastPage: (json['last_page'] as num).toInt(), - links: (json['links'] as List).map((e) => Link.fromJson(e as Map)).toList(), + links: (json['links'] as List) + .map((e) => Link.fromJson(e as Map)) + .toList(), path: json['path'] as String?, perPage: (json['per_page'] as num).toInt(), to: json['to'], total: (json['total'] as num).toInt(), ); -Map _$$MetaImplToJson(_$MetaImpl instance) => { +Map _$$MetaImplToJson(_$MetaImpl instance) => + { 'current_page': instance.currentPage, 'from': instance.from, 'last_page': instance.lastPage, @@ -48,7 +52,8 @@ _$LinkImpl _$$LinkImplFromJson(Map json) => _$LinkImpl( active: json['active'] as bool?, ); -Map _$$LinkImplToJson(_$LinkImpl instance) => { +Map _$$LinkImplToJson(_$LinkImpl instance) => + { 'url': instance.url, 'label': instance.label, 'active': instance.active, diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart index 46367fd1..97ab368c 100644 --- a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart +++ b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart @@ -17,35 +17,33 @@ final _privateConstructorUsedError = UnsupportedError( /// @nodoc mixin _$SelectionPopupModel { int? get id => throw _privateConstructorUsedError; - String get title => throw _privateConstructorUsedError; - dynamic get value => throw _privateConstructorUsedError; - bool get isSelected => throw _privateConstructorUsedError; /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $SelectionPopupModelCopyWith get copyWith => throw _privateConstructorUsedError; + $SelectionPopupModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $SelectionPopupModelCopyWith<$Res> { - factory $SelectionPopupModelCopyWith(SelectionPopupModel value, $Res Function(SelectionPopupModel) then) = + factory $SelectionPopupModelCopyWith( + SelectionPopupModel value, $Res Function(SelectionPopupModel) then) = _$SelectionPopupModelCopyWithImpl<$Res, SelectionPopupModel>; - @useResult $Res call({int? id, String title, dynamic value, bool isSelected}); } /// @nodoc -class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> implements $SelectionPopupModelCopyWith<$Res> { +class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> + implements $SelectionPopupModelCopyWith<$Res> { _$SelectionPopupModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -81,19 +79,23 @@ class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> } /// @nodoc -abstract class _$$SelectionPopupModelImplCopyWith<$Res> implements $SelectionPopupModelCopyWith<$Res> { - factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value, $Res Function(_$SelectionPopupModelImpl) then) = +abstract class _$$SelectionPopupModelImplCopyWith<$Res> + implements $SelectionPopupModelCopyWith<$Res> { + factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value, + $Res Function(_$SelectionPopupModelImpl) then) = __$$SelectionPopupModelImplCopyWithImpl<$Res>; - @override @useResult $Res call({int? id, String title, dynamic value, bool isSelected}); } /// @nodoc -class __$$SelectionPopupModelImplCopyWithImpl<$Res> extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl> +class __$$SelectionPopupModelImplCopyWithImpl<$Res> + extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl> implements _$$SelectionPopupModelImplCopyWith<$Res> { - __$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value, $Res Function(_$SelectionPopupModelImpl) _then) : super(_value, _then); + __$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value, + $Res Function(_$SelectionPopupModelImpl) _then) + : super(_value, _then); /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @@ -129,7 +131,8 @@ class __$$SelectionPopupModelImplCopyWithImpl<$Res> extends _$SelectionPopupMode /// @nodoc class _$SelectionPopupModelImpl implements _SelectionPopupModel { - const _$SelectionPopupModelImpl({this.id, required this.title, this.value, this.isSelected = false}); + const _$SelectionPopupModelImpl( + {this.id, required this.title, this.value, this.isSelected = false}); @override final int? id; @@ -154,11 +157,13 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && const DeepCollectionEquality().equals(other.value, value) && - (identical(other.isSelected, isSelected) || other.isSelected == isSelected)); + (identical(other.isSelected, isSelected) || + other.isSelected == isSelected)); } @override - int get hashCode => Object.hash(runtimeType, id, title, const DeepCollectionEquality().hash(value), isSelected); + int get hashCode => Object.hash(runtimeType, id, title, + const DeepCollectionEquality().hash(value), isSelected); /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @@ -166,21 +171,23 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { @override @pragma('vm:prefer-inline') _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => - __$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>(this, _$identity); + __$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>( + this, _$identity); } abstract class _SelectionPopupModel implements SelectionPopupModel { - const factory _SelectionPopupModel({final int? id, required final String title, final dynamic value, final bool isSelected}) = _$SelectionPopupModelImpl; + const factory _SelectionPopupModel( + {final int? id, + required final String title, + final dynamic value, + final bool isSelected}) = _$SelectionPopupModelImpl; @override int? get id; - @override String get title; - @override dynamic get value; - @override bool get isSelected; @@ -188,5 +195,6 @@ abstract class _SelectionPopupModel implements SelectionPopupModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart index 433a7e15..7c5d7ffd 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$NewMessagesState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$NewMessagesState { /// @nodoc abstract class $NewMessagesStateCopyWith<$Res> { - factory $NewMessagesStateCopyWith(NewMessagesState value, $Res Function(NewMessagesState) then) = _$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>; + factory $NewMessagesStateCopyWith( + NewMessagesState value, $Res Function(NewMessagesState) then) = + _$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>; } /// @nodoc -class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> implements $NewMessagesStateCopyWith<$Res> { +class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> + implements $NewMessagesStateCopyWith<$Res> { _$NewMessagesStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,14 +91,18 @@ class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> implem /// @nodoc abstract class _$$NewMessagesStateImplCopyWith<$Res> { - factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value, $Res Function(_$NewMessagesStateImpl) then) = + factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value, + $Res Function(_$NewMessagesStateImpl) then) = __$$NewMessagesStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NewMessagesStateImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl> +class __$$NewMessagesStateImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl> implements _$$NewMessagesStateImplCopyWith<$Res> { - __$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value, $Res Function(_$NewMessagesStateImpl) _then) : super(_value, _then); + __$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value, + $Res Function(_$NewMessagesStateImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -115,7 +120,8 @@ class _$NewMessagesStateImpl implements _NewMessagesState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$NewMessagesStateImpl); } @override @@ -202,14 +208,19 @@ abstract class _NewMessagesState implements NewMessagesState { /// @nodoc abstract class _$$NewMessagesStateEmptyImplCopyWith<$Res> { - factory _$$NewMessagesStateEmptyImplCopyWith(_$NewMessagesStateEmptyImpl value, $Res Function(_$NewMessagesStateEmptyImpl) then) = + factory _$$NewMessagesStateEmptyImplCopyWith( + _$NewMessagesStateEmptyImpl value, + $Res Function(_$NewMessagesStateEmptyImpl) then) = __$$NewMessagesStateEmptyImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl> +class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl> implements _$$NewMessagesStateEmptyImplCopyWith<$Res> { - __$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value, $Res Function(_$NewMessagesStateEmptyImpl) _then) : super(_value, _then); + __$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value, + $Res Function(_$NewMessagesStateEmptyImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -227,7 +238,9 @@ class _$NewMessagesStateEmptyImpl implements NewMessagesStateEmpty { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateEmptyImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NewMessagesStateEmptyImpl); } @override @@ -314,17 +327,22 @@ abstract class NewMessagesStateEmpty implements NewMessagesState { /// @nodoc abstract class _$$NewMessagesStateLoadedImplCopyWith<$Res> { - factory _$$NewMessagesStateLoadedImplCopyWith(_$NewMessagesStateLoadedImpl value, $Res Function(_$NewMessagesStateLoadedImpl) then) = + factory _$$NewMessagesStateLoadedImplCopyWith( + _$NewMessagesStateLoadedImpl value, + $Res Function(_$NewMessagesStateLoadedImpl) then) = __$$NewMessagesStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({int messagesCount}); } /// @nodoc -class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl> +class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl> implements _$$NewMessagesStateLoadedImplCopyWith<$Res> { - __$$NewMessagesStateLoadedImplCopyWithImpl(_$NewMessagesStateLoadedImpl _value, $Res Function(_$NewMessagesStateLoadedImpl) _then) : super(_value, _then); + __$$NewMessagesStateLoadedImplCopyWithImpl( + _$NewMessagesStateLoadedImpl _value, + $Res Function(_$NewMessagesStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -360,7 +378,8 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateLoadedImpl && - (identical(other.messagesCount, messagesCount) || other.messagesCount == messagesCount)); + (identical(other.messagesCount, messagesCount) || + other.messagesCount == messagesCount)); } @override @@ -371,8 +390,9 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => - __$$NewMessagesStateLoadedImplCopyWithImpl<_$NewMessagesStateLoadedImpl>(this, _$identity); + _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> + get copyWith => __$$NewMessagesStateLoadedImplCopyWithImpl< + _$NewMessagesStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -450,29 +470,35 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { } abstract class NewMessagesStateLoaded implements NewMessagesState { - const factory NewMessagesStateLoaded({required final int messagesCount}) = _$NewMessagesStateLoadedImpl; + const factory NewMessagesStateLoaded({required final int messagesCount}) = + _$NewMessagesStateLoadedImpl; int get messagesCount; /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$NewMessagesStateErrorImplCopyWith<$Res> { - factory _$$NewMessagesStateErrorImplCopyWith(_$NewMessagesStateErrorImpl value, $Res Function(_$NewMessagesStateErrorImpl) then) = + factory _$$NewMessagesStateErrorImplCopyWith( + _$NewMessagesStateErrorImpl value, + $Res Function(_$NewMessagesStateErrorImpl) then) = __$$NewMessagesStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$NewMessagesStateErrorImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl> +class __$$NewMessagesStateErrorImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl> implements _$$NewMessagesStateErrorImplCopyWith<$Res> { - __$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value, $Res Function(_$NewMessagesStateErrorImpl) _then) : super(_value, _then); + __$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value, + $Res Function(_$NewMessagesStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -508,7 +534,8 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -519,8 +546,9 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => - __$$NewMessagesStateErrorImplCopyWithImpl<_$NewMessagesStateErrorImpl>(this, _$identity); + _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> + get copyWith => __$$NewMessagesStateErrorImplCopyWithImpl< + _$NewMessagesStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -598,12 +626,14 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { } abstract class NewMessagesStateError implements NewMessagesState { - const factory NewMessagesStateError({required final String errorMessage}) = _$NewMessagesStateErrorImpl; + const factory NewMessagesStateError({required final String errorMessage}) = + _$NewMessagesStateErrorImpl; String get errorMessage; /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart index 6fa44e3d..d634b318 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart @@ -20,16 +20,18 @@ mixin _$NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +39,8 @@ mixin _$NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,17 +74,18 @@ mixin _$NotificationsState { /// @nodoc abstract class $NotificationsStateCopyWith<$Res> { - factory $NotificationsStateCopyWith(NotificationsState value, $Res Function(NotificationsState) then) = + factory $NotificationsStateCopyWith( + NotificationsState value, $Res Function(NotificationsState) then) = _$NotificationsStateCopyWithImpl<$Res, NotificationsState>; } /// @nodoc -class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> implements $NotificationsStateCopyWith<$Res> { +class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> + implements $NotificationsStateCopyWith<$Res> { _$NotificationsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -91,14 +95,18 @@ class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> im /// @nodoc abstract class _$$NotificationsStateImplCopyWith<$Res> { - factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value, $Res Function(_$NotificationsStateImpl) then) = + factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value, + $Res Function(_$NotificationsStateImpl) then) = __$$NotificationsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NotificationsStateImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl> +class __$$NotificationsStateImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl> implements _$$NotificationsStateImplCopyWith<$Res> { - __$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value, $Res Function(_$NotificationsStateImpl) _then) : super(_value, _then); + __$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value, + $Res Function(_$NotificationsStateImpl) _then) + : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -116,7 +124,8 @@ class _$NotificationsStateImpl implements _NotificationsState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$NotificationsStateImpl); } @override @@ -127,7 +136,9 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -138,7 +149,8 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -149,7 +161,8 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -203,14 +216,21 @@ abstract class _NotificationsState implements NotificationsState { /// @nodoc abstract class _$$NotificationsStateEmptyImplCopyWith<$Res> { - factory _$$NotificationsStateEmptyImplCopyWith(_$NotificationsStateEmptyImpl value, $Res Function(_$NotificationsStateEmptyImpl) then) = + factory _$$NotificationsStateEmptyImplCopyWith( + _$NotificationsStateEmptyImpl value, + $Res Function(_$NotificationsStateEmptyImpl) then) = __$$NotificationsStateEmptyImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NotificationsStateEmptyImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateEmptyImpl> +class __$$NotificationsStateEmptyImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, + _$NotificationsStateEmptyImpl> implements _$$NotificationsStateEmptyImplCopyWith<$Res> { - __$$NotificationsStateEmptyImplCopyWithImpl(_$NotificationsStateEmptyImpl _value, $Res Function(_$NotificationsStateEmptyImpl) _then) : super(_value, _then); + __$$NotificationsStateEmptyImplCopyWithImpl( + _$NotificationsStateEmptyImpl _value, + $Res Function(_$NotificationsStateEmptyImpl) _then) + : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -228,7 +248,9 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateEmptyImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NotificationsStateEmptyImpl); } @override @@ -239,7 +261,9 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return empty(); @@ -250,7 +274,8 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return empty?.call(); @@ -261,7 +286,8 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -315,17 +341,22 @@ abstract class NotificationsStateEmpty implements NotificationsState { /// @nodoc abstract class _$$NotificationsStateLoadedImplCopyWith<$Res> { - factory _$$NotificationsStateLoadedImplCopyWith(_$NotificationsStateLoadedImpl value, $Res Function(_$NotificationsStateLoadedImpl) then) = + factory _$$NotificationsStateLoadedImplCopyWith( + _$NotificationsStateLoadedImpl value, + $Res Function(_$NotificationsStateLoadedImpl) then) = __$$NotificationsStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({List notifications, int notificationsCount}); } /// @nodoc -class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateLoadedImpl> +class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, + _$NotificationsStateLoadedImpl> implements _$$NotificationsStateLoadedImplCopyWith<$Res> { - __$$NotificationsStateLoadedImplCopyWithImpl(_$NotificationsStateLoadedImpl _value, $Res Function(_$NotificationsStateLoadedImpl) _then) + __$$NotificationsStateLoadedImplCopyWithImpl( + _$NotificationsStateLoadedImpl _value, + $Res Function(_$NotificationsStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of NotificationsState @@ -352,10 +383,12 @@ class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> extends _$Notifications /// @nodoc class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { - const _$NotificationsStateLoadedImpl({required final List notifications, required this.notificationsCount}) : _notifications = notifications; + const _$NotificationsStateLoadedImpl( + {required final List notifications, + required this.notificationsCount}) + : _notifications = notifications; final List _notifications; - @override List get notifications { if (_notifications is EqualUnmodifiableListView) return _notifications; @@ -376,27 +409,33 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateLoadedImpl && - const DeepCollectionEquality().equals(other._notifications, _notifications) && - (identical(other.notificationsCount, notificationsCount) || other.notificationsCount == notificationsCount)); + const DeepCollectionEquality() + .equals(other._notifications, _notifications) && + (identical(other.notificationsCount, notificationsCount) || + other.notificationsCount == notificationsCount)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_notifications), notificationsCount); + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_notifications), notificationsCount); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => - __$$NotificationsStateLoadedImplCopyWithImpl<_$NotificationsStateLoadedImpl>(this, _$identity); + _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> + get copyWith => __$$NotificationsStateLoadedImplCopyWithImpl< + _$NotificationsStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return loaded(notifications, notificationsCount); @@ -407,7 +446,8 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(notifications, notificationsCount); @@ -418,7 +458,8 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -467,31 +508,39 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { } abstract class NotificationsStateLoaded implements NotificationsState { - const factory NotificationsStateLoaded({required final List notifications, required final int notificationsCount}) = _$NotificationsStateLoadedImpl; + const factory NotificationsStateLoaded( + {required final List notifications, + required final int notificationsCount}) = _$NotificationsStateLoadedImpl; List get notifications; - int get notificationsCount; /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$NotificationsStateErrorImplCopyWith<$Res> { - factory _$$NotificationsStateErrorImplCopyWith(_$NotificationsStateErrorImpl value, $Res Function(_$NotificationsStateErrorImpl) then) = + factory _$$NotificationsStateErrorImplCopyWith( + _$NotificationsStateErrorImpl value, + $Res Function(_$NotificationsStateErrorImpl) then) = __$$NotificationsStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$NotificationsStateErrorImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateErrorImpl> +class __$$NotificationsStateErrorImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, + _$NotificationsStateErrorImpl> implements _$$NotificationsStateErrorImplCopyWith<$Res> { - __$$NotificationsStateErrorImplCopyWithImpl(_$NotificationsStateErrorImpl _value, $Res Function(_$NotificationsStateErrorImpl) _then) : super(_value, _then); + __$$NotificationsStateErrorImplCopyWithImpl( + _$NotificationsStateErrorImpl _value, + $Res Function(_$NotificationsStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -527,7 +576,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -538,15 +588,18 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => - __$$NotificationsStateErrorImplCopyWithImpl<_$NotificationsStateErrorImpl>(this, _$identity); + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> + get copyWith => __$$NotificationsStateErrorImplCopyWithImpl< + _$NotificationsStateErrorImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -557,7 +610,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -568,7 +622,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -617,12 +672,14 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { } abstract class NotificationsStateError implements NotificationsState { - const factory NotificationsStateError({required final String errorMessage}) = _$NotificationsStateErrorImpl; + const factory NotificationsStateError({required final String errorMessage}) = + _$NotificationsStateErrorImpl; String get errorMessage; /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart index b4ba4c19..b629d579 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$ProfileAvatarState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,17 +70,18 @@ mixin _$ProfileAvatarState { /// @nodoc abstract class $ProfileAvatarStateCopyWith<$Res> { - factory $ProfileAvatarStateCopyWith(ProfileAvatarState value, $Res Function(ProfileAvatarState) then) = + factory $ProfileAvatarStateCopyWith( + ProfileAvatarState value, $Res Function(ProfileAvatarState) then) = _$ProfileAvatarStateCopyWithImpl<$Res, ProfileAvatarState>; } /// @nodoc -class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> implements $ProfileAvatarStateCopyWith<$Res> { +class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> + implements $ProfileAvatarStateCopyWith<$Res> { _$ProfileAvatarStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -91,14 +91,18 @@ class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> im /// @nodoc abstract class _$$ProfileAvatarStateImplCopyWith<$Res> { - factory _$$ProfileAvatarStateImplCopyWith(_$ProfileAvatarStateImpl value, $Res Function(_$ProfileAvatarStateImpl) then) = + factory _$$ProfileAvatarStateImplCopyWith(_$ProfileAvatarStateImpl value, + $Res Function(_$ProfileAvatarStateImpl) then) = __$$ProfileAvatarStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileAvatarStateImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateImpl> +class __$$ProfileAvatarStateImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateImpl> implements _$$ProfileAvatarStateImplCopyWith<$Res> { - __$$ProfileAvatarStateImplCopyWithImpl(_$ProfileAvatarStateImpl _value, $Res Function(_$ProfileAvatarStateImpl) _then) : super(_value, _then); + __$$ProfileAvatarStateImplCopyWithImpl(_$ProfileAvatarStateImpl _value, + $Res Function(_$ProfileAvatarStateImpl) _then) + : super(_value, _then); /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @@ -116,7 +120,8 @@ class _$ProfileAvatarStateImpl implements _ProfileAvatarState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileAvatarStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ProfileAvatarStateImpl); } @override @@ -203,14 +208,20 @@ abstract class _ProfileAvatarState implements ProfileAvatarState { /// @nodoc abstract class _$$ProfileAvatarStateLoadingImplCopyWith<$Res> { - factory _$$ProfileAvatarStateLoadingImplCopyWith(_$ProfileAvatarStateLoadingImpl value, $Res Function(_$ProfileAvatarStateLoadingImpl) then) = + factory _$$ProfileAvatarStateLoadingImplCopyWith( + _$ProfileAvatarStateLoadingImpl value, + $Res Function(_$ProfileAvatarStateLoadingImpl) then) = __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateLoadingImpl> +class __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, + _$ProfileAvatarStateLoadingImpl> implements _$$ProfileAvatarStateLoadingImplCopyWith<$Res> { - __$$ProfileAvatarStateLoadingImplCopyWithImpl(_$ProfileAvatarStateLoadingImpl _value, $Res Function(_$ProfileAvatarStateLoadingImpl) _then) + __$$ProfileAvatarStateLoadingImplCopyWithImpl( + _$ProfileAvatarStateLoadingImpl _value, + $Res Function(_$ProfileAvatarStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of ProfileAvatarState @@ -229,7 +240,9 @@ class _$ProfileAvatarStateLoadingImpl implements ProfileAvatarStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileAvatarStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileAvatarStateLoadingImpl); } @override @@ -316,9 +329,10 @@ abstract class ProfileAvatarStateLoading implements ProfileAvatarState { /// @nodoc abstract class _$$ProfileAvatarStateLoadedImplCopyWith<$Res> { - factory _$$ProfileAvatarStateLoadedImplCopyWith(_$ProfileAvatarStateLoadedImpl value, $Res Function(_$ProfileAvatarStateLoadedImpl) then) = + factory _$$ProfileAvatarStateLoadedImplCopyWith( + _$ProfileAvatarStateLoadedImpl value, + $Res Function(_$ProfileAvatarStateLoadedImpl) then) = __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({ProfileModel profile}); @@ -326,9 +340,13 @@ abstract class _$$ProfileAvatarStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateLoadedImpl> +class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, + _$ProfileAvatarStateLoadedImpl> implements _$$ProfileAvatarStateLoadedImplCopyWith<$Res> { - __$$ProfileAvatarStateLoadedImplCopyWithImpl(_$ProfileAvatarStateLoadedImpl _value, $Res Function(_$ProfileAvatarStateLoadedImpl) _then) + __$$ProfileAvatarStateLoadedImplCopyWithImpl( + _$ProfileAvatarStateLoadedImpl _value, + $Res Function(_$ProfileAvatarStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of ProfileAvatarState @@ -373,7 +391,9 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ProfileAvatarStateLoadedImpl && (identical(other.profile, profile) || other.profile == profile)); + (other.runtimeType == runtimeType && + other is _$ProfileAvatarStateLoadedImpl && + (identical(other.profile, profile) || other.profile == profile)); } @override @@ -384,8 +404,9 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> get copyWith => - __$$ProfileAvatarStateLoadedImplCopyWithImpl<_$ProfileAvatarStateLoadedImpl>(this, _$identity); + _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> + get copyWith => __$$ProfileAvatarStateLoadedImplCopyWithImpl< + _$ProfileAvatarStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -463,29 +484,37 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded { } abstract class ProfileAvatarStateLoaded implements ProfileAvatarState { - const factory ProfileAvatarStateLoaded({required final ProfileModel profile}) = _$ProfileAvatarStateLoadedImpl; + const factory ProfileAvatarStateLoaded( + {required final ProfileModel profile}) = _$ProfileAvatarStateLoadedImpl; ProfileModel get profile; /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ProfileAvatarStateErrorImplCopyWith<$Res> { - factory _$$ProfileAvatarStateErrorImplCopyWith(_$ProfileAvatarStateErrorImpl value, $Res Function(_$ProfileAvatarStateErrorImpl) then) = + factory _$$ProfileAvatarStateErrorImplCopyWith( + _$ProfileAvatarStateErrorImpl value, + $Res Function(_$ProfileAvatarStateErrorImpl) then) = __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateErrorImpl> +class __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, + _$ProfileAvatarStateErrorImpl> implements _$$ProfileAvatarStateErrorImplCopyWith<$Res> { - __$$ProfileAvatarStateErrorImplCopyWithImpl(_$ProfileAvatarStateErrorImpl _value, $Res Function(_$ProfileAvatarStateErrorImpl) _then) : super(_value, _then); + __$$ProfileAvatarStateErrorImplCopyWithImpl( + _$ProfileAvatarStateErrorImpl _value, + $Res Function(_$ProfileAvatarStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @@ -521,7 +550,8 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileAvatarStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -532,8 +562,9 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> get copyWith => - __$$ProfileAvatarStateErrorImplCopyWithImpl<_$ProfileAvatarStateErrorImpl>(this, _$identity); + _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> + get copyWith => __$$ProfileAvatarStateErrorImplCopyWithImpl< + _$ProfileAvatarStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -611,12 +642,14 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError { } abstract class ProfileAvatarStateError implements ProfileAvatarState { - const factory ProfileAvatarStateError({required final String errorMessage}) = _$ProfileAvatarStateErrorImpl; + const factory ProfileAvatarStateError({required final String errorMessage}) = + _$ProfileAvatarStateErrorImpl; String get errorMessage; /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/models/calendar_model.freezed.dart b/lib/features/calendar/models/calendar_model.freezed.dart index f7a1d191..d10fc8f2 100644 --- a/lib/features/calendar/models/calendar_model.freezed.dart +++ b/lib/features/calendar/models/calendar_model.freezed.dart @@ -21,9 +21,8 @@ CalendarModel _$CalendarModelFromJson(Map json) { /// @nodoc mixin _$CalendarModel { String get date => throw _privateConstructorUsedError; - - bool get is_current_day_included_in_the_chosen_diet_progression => throw _privateConstructorUsedError; - + bool get is_current_day_included_in_the_chosen_diet_progression => + throw _privateConstructorUsedError; Object? get diary => throw _privateConstructorUsedError; /// Serializes this CalendarModel to a JSON map. @@ -32,24 +31,29 @@ mixin _$CalendarModel { /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $CalendarModelCopyWith get copyWith => throw _privateConstructorUsedError; + $CalendarModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $CalendarModelCopyWith<$Res> { - factory $CalendarModelCopyWith(CalendarModel value, $Res Function(CalendarModel) then) = _$CalendarModelCopyWithImpl<$Res, CalendarModel>; - + factory $CalendarModelCopyWith( + CalendarModel value, $Res Function(CalendarModel) then) = + _$CalendarModelCopyWithImpl<$Res, CalendarModel>; @useResult - $Res call({String date, bool is_current_day_included_in_the_chosen_diet_progression, Object? diary}); + $Res call( + {String date, + bool is_current_day_included_in_the_chosen_diet_progression, + Object? diary}); } /// @nodoc -class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> implements $CalendarModelCopyWith<$Res> { +class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> + implements $CalendarModelCopyWith<$Res> { _$CalendarModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -67,7 +71,8 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> implements $ ? _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 + 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, @@ -77,17 +82,26 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> implements $ } /// @nodoc -abstract class _$$CalendarModelImplCopyWith<$Res> implements $CalendarModelCopyWith<$Res> { - factory _$$CalendarModelImplCopyWith(_$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) = __$$CalendarModelImplCopyWithImpl<$Res>; - +abstract class _$$CalendarModelImplCopyWith<$Res> + implements $CalendarModelCopyWith<$Res> { + factory _$$CalendarModelImplCopyWith( + _$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) = + __$$CalendarModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({String date, bool is_current_day_included_in_the_chosen_diet_progression, Object? diary}); + $Res call( + {String date, + bool is_current_day_included_in_the_chosen_diet_progression, + Object? diary}); } /// @nodoc -class __$$CalendarModelImplCopyWithImpl<$Res> extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl> implements _$$CalendarModelImplCopyWith<$Res> { - __$$CalendarModelImplCopyWithImpl(_$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then) : super(_value, _then); +class __$$CalendarModelImplCopyWithImpl<$Res> + extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl> + implements _$$CalendarModelImplCopyWith<$Res> { + __$$CalendarModelImplCopyWithImpl( + _$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then) + : super(_value, _then); /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @@ -103,7 +117,8 @@ class __$$CalendarModelImplCopyWithImpl<$Res> extends _$CalendarModelCopyWithImp ? _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 + 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, @@ -115,9 +130,13 @@ class __$$CalendarModelImplCopyWithImpl<$Res> extends _$CalendarModelCopyWithImp /// @nodoc @JsonSerializable() class _$CalendarModelImpl implements _CalendarModel { - const _$CalendarModelImpl({required this.date, required this.is_current_day_included_in_the_chosen_diet_progression, this.diary}); + const _$CalendarModelImpl( + {required this.date, + required this.is_current_day_included_in_the_chosen_diet_progression, + this.diary}); - factory _$CalendarModelImpl.fromJson(Map json) => _$$CalendarModelImplFromJson(json); + factory _$CalendarModelImpl.fromJson(Map json) => + _$$CalendarModelImplFromJson(json); @override final String date; @@ -137,21 +156,30 @@ 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) && + (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(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, date, is_current_day_included_in_the_chosen_diet_progression, const DeepCollectionEquality().hash(diary)); + int get hashCode => Object.hash( + runtimeType, + date, + is_current_day_included_in_the_chosen_diet_progression, + const DeepCollectionEquality().hash(diary)); /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => __$$CalendarModelImplCopyWithImpl<_$CalendarModelImpl>(this, _$identity); + _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => + __$$CalendarModelImplCopyWithImpl<_$CalendarModelImpl>(this, _$identity); @override Map toJson() { @@ -162,17 +190,19 @@ class _$CalendarModelImpl implements _CalendarModel { } abstract class _CalendarModel implements CalendarModel { - const factory _CalendarModel({required final String date, required final bool is_current_day_included_in_the_chosen_diet_progression, final Object? diary}) = - _$CalendarModelImpl; + const factory _CalendarModel( + {required final String date, + required final bool + is_current_day_included_in_the_chosen_diet_progression, + final Object? diary}) = _$CalendarModelImpl; - factory _CalendarModel.fromJson(Map json) = _$CalendarModelImpl.fromJson; + factory _CalendarModel.fromJson(Map json) = + _$CalendarModelImpl.fromJson; @override String get date; - @override bool get is_current_day_included_in_the_chosen_diet_progression; - @override Object? get diary; @@ -180,5 +210,6 @@ abstract class _CalendarModel implements CalendarModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/models/calendar_model.g.dart b/lib/features/calendar/models/calendar_model.g.dart index 4134c22e..65fd0063 100644 --- a/lib/features/calendar/models/calendar_model.g.dart +++ b/lib/features/calendar/models/calendar_model.g.dart @@ -6,14 +6,19 @@ part of 'calendar_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CalendarModelImpl _$$CalendarModelImplFromJson(Map json) => _$CalendarModelImpl( +_$CalendarModelImpl _$$CalendarModelImplFromJson(Map 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, + 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 _$$CalendarModelImplToJson(_$CalendarModelImpl instance) => { +Map _$$CalendarModelImplToJson(_$CalendarModelImpl instance) => + { 'date': instance.date, - 'is_current_day_included_in_the_chosen_diet_progression': instance.is_current_day_included_in_the_chosen_diet_progression, + 'is_current_day_included_in_the_chosen_diet_progression': + instance.is_current_day_included_in_the_chosen_diet_progression, 'diary': instance.diary, }; diff --git a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart index 76a12423..0e7bdbcd 100644 --- a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart +++ b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$CalendarState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$CalendarState { /// @nodoc abstract class $CalendarStateCopyWith<$Res> { - factory $CalendarStateCopyWith(CalendarState value, $Res Function(CalendarState) then) = _$CalendarStateCopyWithImpl<$Res, CalendarState>; + factory $CalendarStateCopyWith( + CalendarState value, $Res Function(CalendarState) then) = + _$CalendarStateCopyWithImpl<$Res, CalendarState>; } /// @nodoc -class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> implements $CalendarStateCopyWith<$Res> { +class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> + implements $CalendarStateCopyWith<$Res> { _$CalendarStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +91,18 @@ class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> implements $ /// @nodoc abstract class _$$CalendarStateImplCopyWith<$Res> { - factory _$$CalendarStateImplCopyWith(_$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) = __$$CalendarStateImplCopyWithImpl<$Res>; + factory _$$CalendarStateImplCopyWith( + _$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) = + __$$CalendarStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CalendarStateImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl> implements _$$CalendarStateImplCopyWith<$Res> { - __$$CalendarStateImplCopyWithImpl(_$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then) : super(_value, _then); +class __$$CalendarStateImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl> + implements _$$CalendarStateImplCopyWith<$Res> { + __$$CalendarStateImplCopyWithImpl( + _$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +120,8 @@ class _$CalendarStateImpl implements _CalendarState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$CalendarStateImpl); } @override @@ -200,14 +208,18 @@ abstract class _CalendarState implements CalendarState { /// @nodoc abstract class _$$CalendarStateLoadingImplCopyWith<$Res> { - factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value, $Res Function(_$CalendarStateLoadingImpl) then) = + factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value, + $Res Function(_$CalendarStateLoadingImpl) then) = __$$CalendarStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CalendarStateLoadingImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl> +class __$$CalendarStateLoadingImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl> implements _$$CalendarStateLoadingImplCopyWith<$Res> { - __$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value, $Res Function(_$CalendarStateLoadingImpl) _then) : super(_value, _then); + __$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value, + $Res Function(_$CalendarStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +237,9 @@ class _$CalendarStateLoadingImpl implements CalendarStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$CalendarStateLoadingImpl); } @override @@ -312,17 +326,20 @@ abstract class CalendarStateLoading implements CalendarState { /// @nodoc abstract class _$$CalendarStateLoadedImplCopyWith<$Res> { - factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value, $Res Function(_$CalendarStateLoadedImpl) then) = + factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value, + $Res Function(_$CalendarStateLoadedImpl) then) = __$$CalendarStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({List calendarList}); } /// @nodoc -class __$$CalendarStateLoadedImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl> +class __$$CalendarStateLoadedImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl> implements _$$CalendarStateLoadedImplCopyWith<$Res> { - __$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value, $Res Function(_$CalendarStateLoadedImpl) _then) : super(_value, _then); + __$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value, + $Res Function(_$CalendarStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -343,10 +360,11 @@ class __$$CalendarStateLoadedImplCopyWithImpl<$Res> extends _$CalendarStateCopyW /// @nodoc class _$CalendarStateLoadedImpl implements CalendarStateLoaded { - const _$CalendarStateLoadedImpl({required final List calendarList}) : _calendarList = calendarList; + const _$CalendarStateLoadedImpl( + {required final List calendarList}) + : _calendarList = calendarList; final List _calendarList; - @override List get calendarList { if (_calendarList is EqualUnmodifiableListView) return _calendarList; @@ -362,11 +380,15 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$CalendarStateLoadedImpl && const DeepCollectionEquality().equals(other._calendarList, _calendarList)); + (other.runtimeType == runtimeType && + other is _$CalendarStateLoadedImpl && + const DeepCollectionEquality() + .equals(other._calendarList, _calendarList)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_calendarList)); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_calendarList)); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -374,7 +396,8 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { @override @pragma('vm:prefer-inline') _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => - __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>(this, _$identity); + __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -452,29 +475,35 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { } abstract class CalendarStateLoaded implements CalendarState { - const factory CalendarStateLoaded({required final List calendarList}) = _$CalendarStateLoadedImpl; + const factory CalendarStateLoaded( + {required final List calendarList}) = + _$CalendarStateLoadedImpl; List get calendarList; /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$CalendarStateErrorImplCopyWith<$Res> { - factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value, $Res Function(_$CalendarStateErrorImpl) then) = + factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value, + $Res Function(_$CalendarStateErrorImpl) then) = __$$CalendarStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$CalendarStateErrorImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl> +class __$$CalendarStateErrorImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl> implements _$$CalendarStateErrorImplCopyWith<$Res> { - __$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value, $Res Function(_$CalendarStateErrorImpl) _then) : super(_value, _then); + __$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value, + $Res Function(_$CalendarStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -510,7 +539,8 @@ class _$CalendarStateErrorImpl implements CalendarStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -522,7 +552,8 @@ class _$CalendarStateErrorImpl implements CalendarStateError { @override @pragma('vm:prefer-inline') _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => - __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>(this, _$identity); + __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -600,12 +631,14 @@ class _$CalendarStateErrorImpl implements CalendarStateError { } abstract class CalendarStateError implements CalendarState { - const factory CalendarStateError({required final String errorMessage}) = _$CalendarStateErrorImpl; + const factory CalendarStateError({required final String errorMessage}) = + _$CalendarStateErrorImpl; String get errorMessage; /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/presentation/pages/calendar_screen.dart b/lib/features/calendar/presentation/pages/calendar_screen.dart index 31342896..7bc7c3fa 100644 --- a/lib/features/calendar/presentation/pages/calendar_screen.dart +++ b/lib/features/calendar/presentation/pages/calendar_screen.dart @@ -1,15 +1,14 @@ import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_cubit.dart'; import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_state.dart'; - import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:go_router/go_router.dart'; import 'package:intl/intl.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_form_builder/flutter_form_builder.dart'; class CalendarScreen extends StatelessWidget { CalendarScreen({Key? key}) : super(key: key); diff --git a/lib/features/calendar/services/calendar_service.g.dart b/lib/features/calendar/services/calendar_service.g.dart index 223e1a2e..903145dc 100644 --- a/lib/features/calendar/services/calendar_service.g.dart +++ b/lib/features/calendar/services/calendar_service.g.dart @@ -46,7 +46,9 @@ class _CalendarService implements CalendarService { final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data!.map((dynamic i) => CalendarModel.fromJson(i as Map)).toList(); + _value = _result.data! + .map((dynamic i) => CalendarModel.fromJson(i as Map)) + .toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -55,7 +57,9 @@ class _CalendarService implements CalendarService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/chat/models/chat_message_model.freezed.dart b/lib/features/chat/models/chat_message_model.freezed.dart index 558753ef..8f921425 100644 --- a/lib/features/chat/models/chat_message_model.freezed.dart +++ b/lib/features/chat/models/chat_message_model.freezed.dart @@ -21,15 +21,11 @@ ChatMessageModel _$ChatMessageModelFromJson(Map json) { /// @nodoc mixin _$ChatMessageModel { int get id => throw _privateConstructorUsedError; - String get data => throw _privateConstructorUsedError; - @JsonKey(name: 'media_data') List? get mediaData => throw _privateConstructorUsedError; - @JsonKey(name: 'author_id') int get authorId => throw _privateConstructorUsedError; - @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; @@ -39,13 +35,15 @@ mixin _$ChatMessageModel { /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMessageModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatMessageModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMessageModelCopyWith<$Res> { - factory $ChatMessageModelCopyWith(ChatMessageModel value, $Res Function(ChatMessageModel) then) = _$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>; - + factory $ChatMessageModelCopyWith( + ChatMessageModel value, $Res Function(ChatMessageModel) then) = + _$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>; @useResult $Res call( {int id, @@ -56,12 +54,12 @@ abstract class $ChatMessageModelCopyWith<$Res> { } /// @nodoc -class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> implements $ChatMessageModelCopyWith<$Res> { +class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> + implements $ChatMessageModelCopyWith<$Res> { _$ChatMessageModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -102,10 +100,11 @@ class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> implem } /// @nodoc -abstract class _$$ChatMessageModelImplCopyWith<$Res> implements $ChatMessageModelCopyWith<$Res> { - factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value, $Res Function(_$ChatMessageModelImpl) then) = +abstract class _$$ChatMessageModelImplCopyWith<$Res> + implements $ChatMessageModelCopyWith<$Res> { + factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value, + $Res Function(_$ChatMessageModelImpl) then) = __$$ChatMessageModelImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -117,9 +116,12 @@ abstract class _$$ChatMessageModelImplCopyWith<$Res> implements $ChatMessageMode } /// @nodoc -class __$$ChatMessageModelImplCopyWithImpl<$Res> extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl> +class __$$ChatMessageModelImplCopyWithImpl<$Res> + extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl> implements _$$ChatMessageModelImplCopyWith<$Res> { - __$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value, $Res Function(_$ChatMessageModelImpl) _then) : super(_value, _then); + __$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value, + $Res Function(_$ChatMessageModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @@ -168,14 +170,14 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { @JsonKey(name: 'updated_at') required this.updatedAt}) : _mediaData = mediaData; - factory _$ChatMessageModelImpl.fromJson(Map json) => _$$ChatMessageModelImplFromJson(json); + factory _$ChatMessageModelImpl.fromJson(Map json) => + _$$ChatMessageModelImplFromJson(json); @override final int id; @override final String data; final List? _mediaData; - @override @JsonKey(name: 'media_data') List? get mediaData { @@ -205,21 +207,27 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { other is _$ChatMessageModelImpl && (identical(other.id, id) || other.id == id) && (identical(other.data, data) || other.data == data) && - const DeepCollectionEquality().equals(other._mediaData, _mediaData) && - (identical(other.authorId, authorId) || other.authorId == authorId) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + const DeepCollectionEquality() + .equals(other._mediaData, _mediaData) && + (identical(other.authorId, authorId) || + other.authorId == authorId) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); + int get hashCode => Object.hash(runtimeType, id, data, + const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>(this, _$identity); + _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => + __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>( + this, _$identity); @override Map toJson() { @@ -231,28 +239,26 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { abstract class _ChatMessageModel implements ChatMessageModel { const factory _ChatMessageModel( - {required final int id, - required final String data, - @JsonKey(name: 'media_data') required final List? mediaData, - @JsonKey(name: 'author_id') required final int authorId, - @JsonKey(name: 'updated_at') required final String updatedAt}) = _$ChatMessageModelImpl; + {required final int id, + required final String data, + @JsonKey(name: 'media_data') required final List? mediaData, + @JsonKey(name: 'author_id') required final int authorId, + @JsonKey(name: 'updated_at') required final String updatedAt}) = + _$ChatMessageModelImpl; - factory _ChatMessageModel.fromJson(Map json) = _$ChatMessageModelImpl.fromJson; + factory _ChatMessageModel.fromJson(Map json) = + _$ChatMessageModelImpl.fromJson; @override int get id; - @override String get data; - @override @JsonKey(name: 'media_data') List? get mediaData; - @override @JsonKey(name: 'author_id') int get authorId; - @override @JsonKey(name: 'updated_at') String get updatedAt; @@ -261,5 +267,6 @@ abstract class _ChatMessageModel implements ChatMessageModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_message_model.g.dart b/lib/features/chat/models/chat_message_model.g.dart index 70531099..3a8d1827 100644 --- a/lib/features/chat/models/chat_message_model.g.dart +++ b/lib/features/chat/models/chat_message_model.g.dart @@ -6,7 +6,9 @@ part of 'chat_message_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson(Map json) => _$ChatMessageModelImpl( +_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson( + Map json) => + _$ChatMessageModelImpl( id: (json['id'] as num).toInt(), data: json['data'] as String, mediaData: json['media_data'] as List?, @@ -14,7 +16,9 @@ _$ChatMessageModelImpl _$$ChatMessageModelImplFromJson(Map json updatedAt: json['updated_at'] as String, ); -Map _$$ChatMessageModelImplToJson(_$ChatMessageModelImpl instance) => { +Map _$$ChatMessageModelImplToJson( + _$ChatMessageModelImpl instance) => + { 'id': instance.id, 'data': instance.data, 'media_data': instance.mediaData, diff --git a/lib/features/chat/models/chat_messages_model.freezed.dart b/lib/features/chat/models/chat_messages_model.freezed.dart index d4dad1cb..852b33e4 100644 --- a/lib/features/chat/models/chat_messages_model.freezed.dart +++ b/lib/features/chat/models/chat_messages_model.freezed.dart @@ -22,7 +22,6 @@ ChatMessagesModel _$ChatMessagesModelFromJson(Map json) { mixin _$ChatMessagesModel { @JsonKey(name: 'data') List get messagesList => throw _privateConstructorUsedError; - ChatMetaModel get meta => throw _privateConstructorUsedError; /// Serializes this ChatMessagesModel to a JSON map. @@ -31,26 +30,30 @@ mixin _$ChatMessagesModel { /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMessagesModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatMessagesModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMessagesModelCopyWith<$Res> { - factory $ChatMessagesModelCopyWith(ChatMessagesModel value, $Res Function(ChatMessagesModel) then) = _$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>; - + factory $ChatMessagesModelCopyWith( + ChatMessagesModel value, $Res Function(ChatMessagesModel) then) = + _$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>; @useResult - $Res call({@JsonKey(name: 'data') List messagesList, ChatMetaModel meta}); + $Res call( + {@JsonKey(name: 'data') List messagesList, + ChatMetaModel meta}); $ChatMetaModelCopyWith<$Res> get meta; } /// @nodoc -class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> implements $ChatMessagesModelCopyWith<$Res> { +class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> + implements $ChatMessagesModelCopyWith<$Res> { _$ChatMessagesModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -86,22 +89,28 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> impl } /// @nodoc -abstract class _$$ChatMessagesModelImplCopyWith<$Res> implements $ChatMessagesModelCopyWith<$Res> { - factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value, $Res Function(_$ChatMessagesModelImpl) then) = +abstract class _$$ChatMessagesModelImplCopyWith<$Res> + implements $ChatMessagesModelCopyWith<$Res> { + factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value, + $Res Function(_$ChatMessagesModelImpl) then) = __$$ChatMessagesModelImplCopyWithImpl<$Res>; - @override @useResult - $Res call({@JsonKey(name: 'data') List messagesList, ChatMetaModel meta}); + $Res call( + {@JsonKey(name: 'data') List messagesList, + ChatMetaModel meta}); @override $ChatMetaModelCopyWith<$Res> get meta; } /// @nodoc -class __$$ChatMessagesModelImplCopyWithImpl<$Res> extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl> +class __$$ChatMessagesModelImplCopyWithImpl<$Res> + extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl> implements _$$ChatMessagesModelImplCopyWith<$Res> { - __$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value, $Res Function(_$ChatMessagesModelImpl) _then) : super(_value, _then); + __$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value, + $Res Function(_$ChatMessagesModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @@ -127,12 +136,16 @@ class __$$ChatMessagesModelImplCopyWithImpl<$Res> extends _$ChatMessagesModelCop /// @nodoc @JsonSerializable() class _$ChatMessagesModelImpl implements _ChatMessagesModel { - const _$ChatMessagesModelImpl({@JsonKey(name: 'data') required final List messagesList, required this.meta}) : _messagesList = messagesList; + const _$ChatMessagesModelImpl( + {@JsonKey(name: 'data') + required final List messagesList, + required this.meta}) + : _messagesList = messagesList; - factory _$ChatMessagesModelImpl.fromJson(Map json) => _$$ChatMessagesModelImplFromJson(json); + factory _$ChatMessagesModelImpl.fromJson(Map json) => + _$$ChatMessagesModelImplFromJson(json); final List _messagesList; - @override @JsonKey(name: 'data') List get messagesList { @@ -154,20 +167,24 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatMessagesModelImpl && - const DeepCollectionEquality().equals(other._messagesList, _messagesList) && + const DeepCollectionEquality() + .equals(other._messagesList, _messagesList) && (identical(other.meta, meta) || other.meta == meta)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>(this, _$identity); + _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => + __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>( + this, _$identity); @override Map toJson() { @@ -178,15 +195,17 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { } abstract class _ChatMessagesModel implements ChatMessagesModel { - const factory _ChatMessagesModel({@JsonKey(name: 'data') required final List messagesList, required final ChatMetaModel meta}) = - _$ChatMessagesModelImpl; + const factory _ChatMessagesModel( + {@JsonKey(name: 'data') + required final List messagesList, + required final ChatMetaModel meta}) = _$ChatMessagesModelImpl; - factory _ChatMessagesModel.fromJson(Map json) = _$ChatMessagesModelImpl.fromJson; + factory _ChatMessagesModel.fromJson(Map json) = + _$ChatMessagesModelImpl.fromJson; @override @JsonKey(name: 'data') List get messagesList; - @override ChatMetaModel get meta; @@ -194,5 +213,6 @@ abstract class _ChatMessagesModel implements ChatMessagesModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_messages_model.g.dart b/lib/features/chat/models/chat_messages_model.g.dart index 1a7fe48b..6216cd83 100644 --- a/lib/features/chat/models/chat_messages_model.g.dart +++ b/lib/features/chat/models/chat_messages_model.g.dart @@ -6,12 +6,18 @@ part of 'chat_messages_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson(Map json) => _$ChatMessagesModelImpl( - messagesList: (json['data'] as List).map((e) => ChatMessageModel.fromJson(e as Map)).toList(), +_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson( + Map json) => + _$ChatMessagesModelImpl( + messagesList: (json['data'] as List) + .map((e) => ChatMessageModel.fromJson(e as Map)) + .toList(), meta: ChatMetaModel.fromJson(json['meta'] as Map), ); -Map _$$ChatMessagesModelImplToJson(_$ChatMessagesModelImpl instance) => { +Map _$$ChatMessagesModelImplToJson( + _$ChatMessagesModelImpl instance) => + { 'data': instance.messagesList, 'meta': instance.meta, }; diff --git a/lib/features/chat/models/chat_meta_model.freezed.dart b/lib/features/chat/models/chat_meta_model.freezed.dart index b4354b59..e8e4e96b 100644 --- a/lib/features/chat/models/chat_meta_model.freezed.dart +++ b/lib/features/chat/models/chat_meta_model.freezed.dart @@ -29,24 +29,26 @@ mixin _$ChatMetaModel { /// Create a copy of ChatMetaModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMetaModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatMetaModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMetaModelCopyWith<$Res> { - factory $ChatMetaModelCopyWith(ChatMetaModel value, $Res Function(ChatMetaModel) then) = _$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>; - + factory $ChatMetaModelCopyWith( + ChatMetaModel value, $Res Function(ChatMetaModel) then) = + _$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>; @useResult $Res call({@JsonKey(name: "last_page") int lastPage}); } /// @nodoc -class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> implements $ChatMetaModelCopyWith<$Res> { +class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> + implements $ChatMetaModelCopyWith<$Res> { _$ChatMetaModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -67,17 +69,23 @@ class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> implements $ } /// @nodoc -abstract class _$$ChatMetaModelImplCopyWith<$Res> implements $ChatMetaModelCopyWith<$Res> { - factory _$$ChatMetaModelImplCopyWith(_$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) = __$$ChatMetaModelImplCopyWithImpl<$Res>; - +abstract class _$$ChatMetaModelImplCopyWith<$Res> + implements $ChatMetaModelCopyWith<$Res> { + factory _$$ChatMetaModelImplCopyWith( + _$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) = + __$$ChatMetaModelImplCopyWithImpl<$Res>; @override @useResult $Res call({@JsonKey(name: "last_page") int lastPage}); } /// @nodoc -class __$$ChatMetaModelImplCopyWithImpl<$Res> extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl> implements _$$ChatMetaModelImplCopyWith<$Res> { - __$$ChatMetaModelImplCopyWithImpl(_$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then) : super(_value, _then); +class __$$ChatMetaModelImplCopyWithImpl<$Res> + extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl> + implements _$$ChatMetaModelImplCopyWith<$Res> { + __$$ChatMetaModelImplCopyWithImpl( + _$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatMetaModel /// with the given fields replaced by the non-null parameter values. @@ -98,9 +106,11 @@ class __$$ChatMetaModelImplCopyWithImpl<$Res> extends _$ChatMetaModelCopyWithImp /// @nodoc @JsonSerializable() class _$ChatMetaModelImpl implements _ChatMetaModel { - const _$ChatMetaModelImpl({@JsonKey(name: "last_page") required this.lastPage}); + const _$ChatMetaModelImpl( + {@JsonKey(name: "last_page") required this.lastPage}); - factory _$ChatMetaModelImpl.fromJson(Map json) => _$$ChatMetaModelImplFromJson(json); + factory _$ChatMetaModelImpl.fromJson(Map json) => + _$$ChatMetaModelImplFromJson(json); @override @JsonKey(name: "last_page") @@ -114,7 +124,10 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatMetaModelImpl && (identical(other.lastPage, lastPage) || other.lastPage == lastPage)); + (other.runtimeType == runtimeType && + other is _$ChatMetaModelImpl && + (identical(other.lastPage, lastPage) || + other.lastPage == lastPage)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -126,7 +139,8 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); + _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => + __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); @override Map toJson() { @@ -137,9 +151,12 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { } abstract class _ChatMetaModel implements ChatMetaModel { - const factory _ChatMetaModel({@JsonKey(name: "last_page") required final int lastPage}) = _$ChatMetaModelImpl; + const factory _ChatMetaModel( + {@JsonKey(name: "last_page") required final int lastPage}) = + _$ChatMetaModelImpl; - factory _ChatMetaModel.fromJson(Map json) = _$ChatMetaModelImpl.fromJson; + factory _ChatMetaModel.fromJson(Map json) = + _$ChatMetaModelImpl.fromJson; @override @JsonKey(name: "last_page") @@ -149,5 +166,6 @@ abstract class _ChatMetaModel implements ChatMetaModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_meta_model.g.dart b/lib/features/chat/models/chat_meta_model.g.dart index bbd16d10..7126e2dd 100644 --- a/lib/features/chat/models/chat_meta_model.g.dart +++ b/lib/features/chat/models/chat_meta_model.g.dart @@ -6,10 +6,12 @@ part of 'chat_meta_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map json) => _$ChatMetaModelImpl( +_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map json) => + _$ChatMetaModelImpl( lastPage: (json['last_page'] as num).toInt(), ); -Map _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) => { +Map _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) => + { 'last_page': instance.lastPage, }; diff --git a/lib/features/chat/models/chat_room_model.freezed.dart b/lib/features/chat/models/chat_room_model.freezed.dart index cef12fbe..6afb3a94 100644 --- a/lib/features/chat/models/chat_room_model.freezed.dart +++ b/lib/features/chat/models/chat_room_model.freezed.dart @@ -21,10 +21,9 @@ ChatRoomModel _$ChatRoomModelFromJson(Map json) { /// @nodoc mixin _$ChatRoomModel { String get id => throw _privateConstructorUsedError; - @JsonKey(name: 'chat_room_setting') - ChatRoomSettingsModel get chatRoomSettings => throw _privateConstructorUsedError; - + ChatRoomSettingsModel get chatRoomSettings => + throw _privateConstructorUsedError; Map get users => throw _privateConstructorUsedError; /// Serializes this ChatRoomModel to a JSON map. @@ -33,26 +32,32 @@ mixin _$ChatRoomModel { /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomModelCopyWith<$Res> { - factory $ChatRoomModelCopyWith(ChatRoomModel value, $Res Function(ChatRoomModel) then) = _$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>; - + factory $ChatRoomModelCopyWith( + ChatRoomModel value, $Res Function(ChatRoomModel) then) = + _$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>; @useResult - $Res call({String id, @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings, Map users}); + $Res call( + {String id, + @JsonKey(name: 'chat_room_setting') + ChatRoomSettingsModel chatRoomSettings, + Map users}); $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings; } /// @nodoc -class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> implements $ChatRoomModelCopyWith<$Res> { +class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> + implements $ChatRoomModelCopyWith<$Res> { _$ChatRoomModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -86,27 +91,38 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> implements $ @override @pragma('vm:prefer-inline') $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings { - return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings, (value) { + return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings, + (value) { return _then(_value.copyWith(chatRoomSettings: value) as $Val); }); } } /// @nodoc -abstract class _$$ChatRoomModelImplCopyWith<$Res> implements $ChatRoomModelCopyWith<$Res> { - factory _$$ChatRoomModelImplCopyWith(_$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) = __$$ChatRoomModelImplCopyWithImpl<$Res>; - +abstract class _$$ChatRoomModelImplCopyWith<$Res> + implements $ChatRoomModelCopyWith<$Res> { + factory _$$ChatRoomModelImplCopyWith( + _$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) = + __$$ChatRoomModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({String id, @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings, Map users}); + $Res call( + {String id, + @JsonKey(name: 'chat_room_setting') + ChatRoomSettingsModel chatRoomSettings, + Map users}); @override $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings; } /// @nodoc -class __$$ChatRoomModelImplCopyWithImpl<$Res> extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl> implements _$$ChatRoomModelImplCopyWith<$Res> { - __$$ChatRoomModelImplCopyWithImpl(_$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then) : super(_value, _then); +class __$$ChatRoomModelImplCopyWithImpl<$Res> + extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl> + implements _$$ChatRoomModelImplCopyWith<$Res> { + __$$ChatRoomModelImplCopyWithImpl( + _$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @@ -138,10 +154,13 @@ class __$$ChatRoomModelImplCopyWithImpl<$Res> extends _$ChatRoomModelCopyWithImp @JsonSerializable() class _$ChatRoomModelImpl implements _ChatRoomModel { const _$ChatRoomModelImpl( - {required this.id, @JsonKey(name: 'chat_room_setting') required this.chatRoomSettings, required final Map users}) + {required this.id, + @JsonKey(name: 'chat_room_setting') required this.chatRoomSettings, + required final Map users}) : _users = users; - factory _$ChatRoomModelImpl.fromJson(Map json) => _$$ChatRoomModelImplFromJson(json); + factory _$ChatRoomModelImpl.fromJson(Map json) => + _$$ChatRoomModelImplFromJson(json); @override final String id; @@ -149,7 +168,6 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { @JsonKey(name: 'chat_room_setting') final ChatRoomSettingsModel chatRoomSettings; final Map _users; - @override Map get users { if (_users is EqualUnmodifiableMapView) return _users; @@ -168,20 +186,23 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { (other.runtimeType == runtimeType && other is _$ChatRoomModelImpl && (identical(other.id, id) || other.id == id) && - (identical(other.chatRoomSettings, chatRoomSettings) || other.chatRoomSettings == chatRoomSettings) && + (identical(other.chatRoomSettings, chatRoomSettings) || + other.chatRoomSettings == chatRoomSettings) && const DeepCollectionEquality().equals(other._users, _users)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, const DeepCollectionEquality().hash(_users)); + int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, + const DeepCollectionEquality().hash(_users)); /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); + _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => + __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); @override Map toJson() { @@ -194,18 +215,18 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { abstract class _ChatRoomModel implements ChatRoomModel { const factory _ChatRoomModel( {required final String id, - @JsonKey(name: 'chat_room_setting') required final ChatRoomSettingsModel chatRoomSettings, + @JsonKey(name: 'chat_room_setting') + required final ChatRoomSettingsModel chatRoomSettings, required final Map users}) = _$ChatRoomModelImpl; - factory _ChatRoomModel.fromJson(Map json) = _$ChatRoomModelImpl.fromJson; + factory _ChatRoomModel.fromJson(Map json) = + _$ChatRoomModelImpl.fromJson; @override String get id; - @override @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel get chatRoomSettings; - @override Map get users; @@ -213,5 +234,6 @@ abstract class _ChatRoomModel implements ChatRoomModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_model.g.dart b/lib/features/chat/models/chat_room_model.g.dart index 6230d4f4..68d3195c 100644 --- a/lib/features/chat/models/chat_room_model.g.dart +++ b/lib/features/chat/models/chat_room_model.g.dart @@ -6,15 +6,19 @@ part of 'chat_room_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map json) => _$ChatRoomModelImpl( +_$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map json) => + _$ChatRoomModelImpl( id: json['id'] as String, - chatRoomSettings: ChatRoomSettingsModel.fromJson(json['chat_room_setting'] as Map), + chatRoomSettings: ChatRoomSettingsModel.fromJson( + json['chat_room_setting'] as Map), users: (json['users'] as Map).map( - (k, e) => MapEntry(k, ChatUserModel.fromJson(e as Map)), + (k, e) => + MapEntry(k, ChatUserModel.fromJson(e as Map)), ), ); -Map _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) => { +Map _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) => + { 'id': instance.id, 'chat_room_setting': instance.chatRoomSettings, 'users': instance.users, diff --git a/lib/features/chat/models/chat_room_preview_model.freezed.dart b/lib/features/chat/models/chat_room_preview_model.freezed.dart index 468bfb92..4b006cf0 100644 --- a/lib/features/chat/models/chat_room_preview_model.freezed.dart +++ b/lib/features/chat/models/chat_room_preview_model.freezed.dart @@ -29,25 +29,27 @@ mixin _$ChatRoomPreviewModel { /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomPreviewModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomPreviewModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomPreviewModelCopyWith<$Res> { - factory $ChatRoomPreviewModelCopyWith(ChatRoomPreviewModel value, $Res Function(ChatRoomPreviewModel) then) = + factory $ChatRoomPreviewModelCopyWith(ChatRoomPreviewModel value, + $Res Function(ChatRoomPreviewModel) then) = _$ChatRoomPreviewModelCopyWithImpl<$Res, ChatRoomPreviewModel>; - @useResult $Res call({@JsonKey(name: "chatRooms") List chatRooms}); } /// @nodoc -class _$ChatRoomPreviewModelCopyWithImpl<$Res, $Val extends ChatRoomPreviewModel> implements $ChatRoomPreviewModelCopyWith<$Res> { +class _$ChatRoomPreviewModelCopyWithImpl<$Res, + $Val extends ChatRoomPreviewModel> + implements $ChatRoomPreviewModelCopyWith<$Res> { _$ChatRoomPreviewModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -68,19 +70,23 @@ class _$ChatRoomPreviewModelCopyWithImpl<$Res, $Val extends ChatRoomPreviewModel } /// @nodoc -abstract class _$$ChatRoomPreviewModelImplCopyWith<$Res> implements $ChatRoomPreviewModelCopyWith<$Res> { - factory _$$ChatRoomPreviewModelImplCopyWith(_$ChatRoomPreviewModelImpl value, $Res Function(_$ChatRoomPreviewModelImpl) then) = +abstract class _$$ChatRoomPreviewModelImplCopyWith<$Res> + implements $ChatRoomPreviewModelCopyWith<$Res> { + factory _$$ChatRoomPreviewModelImplCopyWith(_$ChatRoomPreviewModelImpl value, + $Res Function(_$ChatRoomPreviewModelImpl) then) = __$$ChatRoomPreviewModelImplCopyWithImpl<$Res>; - @override @useResult $Res call({@JsonKey(name: "chatRooms") List chatRooms}); } /// @nodoc -class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> extends _$ChatRoomPreviewModelCopyWithImpl<$Res, _$ChatRoomPreviewModelImpl> +class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> + extends _$ChatRoomPreviewModelCopyWithImpl<$Res, _$ChatRoomPreviewModelImpl> implements _$$ChatRoomPreviewModelImplCopyWith<$Res> { - __$$ChatRoomPreviewModelImplCopyWithImpl(_$ChatRoomPreviewModelImpl _value, $Res Function(_$ChatRoomPreviewModelImpl) _then) : super(_value, _then); + __$$ChatRoomPreviewModelImplCopyWithImpl(_$ChatRoomPreviewModelImpl _value, + $Res Function(_$ChatRoomPreviewModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @@ -101,12 +107,14 @@ class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> extends _$ChatRoomPreviewMo /// @nodoc @JsonSerializable() class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { - const _$ChatRoomPreviewModelImpl({@JsonKey(name: "chatRooms") required final List chatRooms}) : _chatRooms = chatRooms; + const _$ChatRoomPreviewModelImpl( + {@JsonKey(name: "chatRooms") required final List chatRooms}) + : _chatRooms = chatRooms; - factory _$ChatRoomPreviewModelImpl.fromJson(Map json) => _$$ChatRoomPreviewModelImplFromJson(json); + factory _$ChatRoomPreviewModelImpl.fromJson(Map json) => + _$$ChatRoomPreviewModelImplFromJson(json); final List _chatRooms; - @override @JsonKey(name: "chatRooms") List get chatRooms { @@ -123,20 +131,26 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatRoomPreviewModelImpl && const DeepCollectionEquality().equals(other._chatRooms, _chatRooms)); + (other.runtimeType == runtimeType && + other is _$ChatRoomPreviewModelImpl && + const DeepCollectionEquality() + .equals(other._chatRooms, _chatRooms)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => - __$$ChatRoomPreviewModelImplCopyWithImpl<_$ChatRoomPreviewModelImpl>(this, _$identity); + _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> + get copyWith => + __$$ChatRoomPreviewModelImplCopyWithImpl<_$ChatRoomPreviewModelImpl>( + this, _$identity); @override Map toJson() { @@ -147,9 +161,12 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { } abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel { - const factory _ChatRoomPreviewModel({@JsonKey(name: "chatRooms") required final List chatRooms}) = _$ChatRoomPreviewModelImpl; + const factory _ChatRoomPreviewModel( + {@JsonKey(name: "chatRooms") + required final List chatRooms}) = _$ChatRoomPreviewModelImpl; - factory _ChatRoomPreviewModel.fromJson(Map json) = _$ChatRoomPreviewModelImpl.fromJson; + factory _ChatRoomPreviewModel.fromJson(Map json) = + _$ChatRoomPreviewModelImpl.fromJson; @override @JsonKey(name: "chatRooms") @@ -159,7 +176,8 @@ abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> + get copyWith => throw _privateConstructorUsedError; } ChatRoom _$ChatRoomFromJson(Map json) { @@ -170,13 +188,10 @@ ChatRoom _$ChatRoomFromJson(Map json) { mixin _$ChatRoom { @JsonKey(name: "id") String get id => throw _privateConstructorUsedError; - @JsonKey(name: "room_name") String get roomName => throw _privateConstructorUsedError; - @JsonKey(name: "last_message") dynamic get lastMessage => throw _privateConstructorUsedError; - @JsonKey(name: "users") Users get users => throw _privateConstructorUsedError; @@ -186,13 +201,14 @@ mixin _$ChatRoom { /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomCopyWith<$Res> { - factory $ChatRoomCopyWith(ChatRoom value, $Res Function(ChatRoom) then) = _$ChatRoomCopyWithImpl<$Res, ChatRoom>; - + factory $ChatRoomCopyWith(ChatRoom value, $Res Function(ChatRoom) then) = + _$ChatRoomCopyWithImpl<$Res, ChatRoom>; @useResult $Res call( {@JsonKey(name: "id") String id, @@ -204,12 +220,12 @@ abstract class $ChatRoomCopyWith<$Res> { } /// @nodoc -class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> implements $ChatRoomCopyWith<$Res> { +class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> + implements $ChatRoomCopyWith<$Res> { _$ChatRoomCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -255,9 +271,11 @@ class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> implements $ChatRoomCo } /// @nodoc -abstract class _$$ChatRoomImplCopyWith<$Res> implements $ChatRoomCopyWith<$Res> { - factory _$$ChatRoomImplCopyWith(_$ChatRoomImpl value, $Res Function(_$ChatRoomImpl) then) = __$$ChatRoomImplCopyWithImpl<$Res>; - +abstract class _$$ChatRoomImplCopyWith<$Res> + implements $ChatRoomCopyWith<$Res> { + factory _$$ChatRoomImplCopyWith( + _$ChatRoomImpl value, $Res Function(_$ChatRoomImpl) then) = + __$$ChatRoomImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -271,8 +289,12 @@ abstract class _$$ChatRoomImplCopyWith<$Res> implements $ChatRoomCopyWith<$Res> } /// @nodoc -class __$$ChatRoomImplCopyWithImpl<$Res> extends _$ChatRoomCopyWithImpl<$Res, _$ChatRoomImpl> implements _$$ChatRoomImplCopyWith<$Res> { - __$$ChatRoomImplCopyWithImpl(_$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then) : super(_value, _then); +class __$$ChatRoomImplCopyWithImpl<$Res> + extends _$ChatRoomCopyWithImpl<$Res, _$ChatRoomImpl> + implements _$$ChatRoomImplCopyWith<$Res> { + __$$ChatRoomImplCopyWithImpl( + _$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @@ -314,7 +336,8 @@ class _$ChatRoomImpl implements _ChatRoom { @JsonKey(name: "last_message") required this.lastMessage, @JsonKey(name: "users") required this.users}); - factory _$ChatRoomImpl.fromJson(Map json) => _$$ChatRoomImplFromJson(json); + factory _$ChatRoomImpl.fromJson(Map json) => + _$$ChatRoomImplFromJson(json); @override @JsonKey(name: "id") @@ -340,21 +363,25 @@ class _$ChatRoomImpl implements _ChatRoom { (other.runtimeType == runtimeType && other is _$ChatRoomImpl && (identical(other.id, id) || other.id == id) && - (identical(other.roomName, roomName) || other.roomName == roomName) && - const DeepCollectionEquality().equals(other.lastMessage, lastMessage) && + (identical(other.roomName, roomName) || + other.roomName == roomName) && + const DeepCollectionEquality() + .equals(other.lastMessage, lastMessage) && (identical(other.users, users) || other.users == users)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, roomName, const DeepCollectionEquality().hash(lastMessage), users); + int get hashCode => Object.hash(runtimeType, id, roomName, + const DeepCollectionEquality().hash(lastMessage), users); /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => __$$ChatRoomImplCopyWithImpl<_$ChatRoomImpl>(this, _$identity); + _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => + __$$ChatRoomImplCopyWithImpl<_$ChatRoomImpl>(this, _$identity); @override Map toJson() { @@ -371,20 +398,18 @@ abstract class _ChatRoom implements ChatRoom { @JsonKey(name: "last_message") required final dynamic lastMessage, @JsonKey(name: "users") required final Users users}) = _$ChatRoomImpl; - factory _ChatRoom.fromJson(Map json) = _$ChatRoomImpl.fromJson; + factory _ChatRoom.fromJson(Map json) = + _$ChatRoomImpl.fromJson; @override @JsonKey(name: "id") String get id; - @override @JsonKey(name: "room_name") String get roomName; - @override @JsonKey(name: "last_message") dynamic get lastMessage; - @override @JsonKey(name: "users") Users get users; @@ -393,7 +418,8 @@ abstract class _ChatRoom implements ChatRoom { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => + throw _privateConstructorUsedError; } LastMessageClass _$LastMessageClassFromJson(Map json) { @@ -404,22 +430,16 @@ LastMessageClass _$LastMessageClassFromJson(Map json) { mixin _$LastMessageClass { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "data") String get data => throw _privateConstructorUsedError; - @JsonKey(name: "media_data") List get mediaData => throw _privateConstructorUsedError; - @JsonKey(name: "author_id") int get authorId => throw _privateConstructorUsedError; - @JsonKey(name: "is_author_message_auth_user") bool get isAuthorMessageAuthUser => throw _privateConstructorUsedError; - @JsonKey(name: "read_by_to_user") bool get readByToUser => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; @@ -429,31 +449,34 @@ mixin _$LastMessageClass { /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $LastMessageClassCopyWith get copyWith => throw _privateConstructorUsedError; + $LastMessageClassCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $LastMessageClassCopyWith<$Res> { - factory $LastMessageClassCopyWith(LastMessageClass value, $Res Function(LastMessageClass) then) = _$LastMessageClassCopyWithImpl<$Res, LastMessageClass>; - + factory $LastMessageClassCopyWith( + LastMessageClass value, $Res Function(LastMessageClass) then) = + _$LastMessageClassCopyWithImpl<$Res, LastMessageClass>; @useResult $Res call( {@JsonKey(name: "id") int id, @JsonKey(name: "data") String data, @JsonKey(name: "media_data") List mediaData, @JsonKey(name: "author_id") int authorId, - @JsonKey(name: "is_author_message_auth_user") bool isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") + bool isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") bool readByToUser, @JsonKey(name: "updated_at") DateTime updatedAt}); } /// @nodoc -class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> implements $LastMessageClassCopyWith<$Res> { +class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> + implements $LastMessageClassCopyWith<$Res> { _$LastMessageClassCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -504,10 +527,11 @@ class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> implem } /// @nodoc -abstract class _$$LastMessageClassImplCopyWith<$Res> implements $LastMessageClassCopyWith<$Res> { - factory _$$LastMessageClassImplCopyWith(_$LastMessageClassImpl value, $Res Function(_$LastMessageClassImpl) then) = +abstract class _$$LastMessageClassImplCopyWith<$Res> + implements $LastMessageClassCopyWith<$Res> { + factory _$$LastMessageClassImplCopyWith(_$LastMessageClassImpl value, + $Res Function(_$LastMessageClassImpl) then) = __$$LastMessageClassImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -515,15 +539,19 @@ abstract class _$$LastMessageClassImplCopyWith<$Res> implements $LastMessageClas @JsonKey(name: "data") String data, @JsonKey(name: "media_data") List mediaData, @JsonKey(name: "author_id") int authorId, - @JsonKey(name: "is_author_message_auth_user") bool isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") + bool isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") bool readByToUser, @JsonKey(name: "updated_at") DateTime updatedAt}); } /// @nodoc -class __$$LastMessageClassImplCopyWithImpl<$Res> extends _$LastMessageClassCopyWithImpl<$Res, _$LastMessageClassImpl> +class __$$LastMessageClassImplCopyWithImpl<$Res> + extends _$LastMessageClassCopyWithImpl<$Res, _$LastMessageClassImpl> implements _$$LastMessageClassImplCopyWith<$Res> { - __$$LastMessageClassImplCopyWithImpl(_$LastMessageClassImpl _value, $Res Function(_$LastMessageClassImpl) _then) : super(_value, _then); + __$$LastMessageClassImplCopyWithImpl(_$LastMessageClassImpl _value, + $Res Function(_$LastMessageClassImpl) _then) + : super(_value, _then); /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @@ -579,12 +607,14 @@ class _$LastMessageClassImpl implements _LastMessageClass { @JsonKey(name: "data") required this.data, @JsonKey(name: "media_data") required final List mediaData, @JsonKey(name: "author_id") required this.authorId, - @JsonKey(name: "is_author_message_auth_user") required this.isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") + required this.isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") required this.readByToUser, @JsonKey(name: "updated_at") required this.updatedAt}) : _mediaData = mediaData; - factory _$LastMessageClassImpl.fromJson(Map json) => _$$LastMessageClassImplFromJson(json); + factory _$LastMessageClassImpl.fromJson(Map json) => + _$$LastMessageClassImplFromJson(json); @override @JsonKey(name: "id") @@ -593,7 +623,6 @@ class _$LastMessageClassImpl implements _LastMessageClass { @JsonKey(name: "data") final String data; final List _mediaData; - @override @JsonKey(name: "media_data") List get mediaData { @@ -627,24 +656,39 @@ class _$LastMessageClassImpl implements _LastMessageClass { other is _$LastMessageClassImpl && (identical(other.id, id) || other.id == id) && (identical(other.data, data) || other.data == data) && - const DeepCollectionEquality().equals(other._mediaData, _mediaData) && - (identical(other.authorId, authorId) || other.authorId == authorId) && - (identical(other.isAuthorMessageAuthUser, isAuthorMessageAuthUser) || other.isAuthorMessageAuthUser == isAuthorMessageAuthUser) && - (identical(other.readByToUser, readByToUser) || other.readByToUser == readByToUser) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + const DeepCollectionEquality() + .equals(other._mediaData, _mediaData) && + (identical(other.authorId, authorId) || + other.authorId == authorId) && + (identical( + other.isAuthorMessageAuthUser, isAuthorMessageAuthUser) || + other.isAuthorMessageAuthUser == isAuthorMessageAuthUser) && + (identical(other.readByToUser, readByToUser) || + other.readByToUser == readByToUser) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, isAuthorMessageAuthUser, readByToUser, updatedAt); + int get hashCode => Object.hash( + runtimeType, + id, + data, + const DeepCollectionEquality().hash(_mediaData), + authorId, + isAuthorMessageAuthUser, + readByToUser, + updatedAt); /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => __$$LastMessageClassImplCopyWithImpl<_$LastMessageClassImpl>(this, _$identity); + _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => + __$$LastMessageClassImplCopyWithImpl<_$LastMessageClassImpl>( + this, _$identity); @override Map toJson() { @@ -656,40 +700,37 @@ class _$LastMessageClassImpl implements _LastMessageClass { abstract class _LastMessageClass implements LastMessageClass { const factory _LastMessageClass( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "data") required final String data, - @JsonKey(name: "media_data") required final List mediaData, - @JsonKey(name: "author_id") required final int authorId, - @JsonKey(name: "is_author_message_auth_user") required final bool isAuthorMessageAuthUser, - @JsonKey(name: "read_by_to_user") required final bool readByToUser, - @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$LastMessageClassImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "data") required final String data, + @JsonKey(name: "media_data") required final List mediaData, + @JsonKey(name: "author_id") required final int authorId, + @JsonKey(name: "is_author_message_auth_user") + required final bool isAuthorMessageAuthUser, + @JsonKey(name: "read_by_to_user") required final bool readByToUser, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = + _$LastMessageClassImpl; - factory _LastMessageClass.fromJson(Map json) = _$LastMessageClassImpl.fromJson; + factory _LastMessageClass.fromJson(Map json) = + _$LastMessageClassImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "data") String get data; - @override @JsonKey(name: "media_data") List get mediaData; - @override @JsonKey(name: "author_id") int get authorId; - @override @JsonKey(name: "is_author_message_auth_user") bool get isAuthorMessageAuthUser; - @override @JsonKey(name: "read_by_to_user") bool get readByToUser; - @override @JsonKey(name: "updated_at") DateTime get updatedAt; @@ -698,7 +739,8 @@ abstract class _LastMessageClass implements LastMessageClass { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => throw _privateConstructorUsedError; + _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => + throw _privateConstructorUsedError; } Users _$UsersFromJson(Map json) { @@ -709,7 +751,6 @@ Users _$UsersFromJson(Map json) { mixin _$Users { @JsonKey(name: "from_chat_user") ChatUser get fromChatUser => throw _privateConstructorUsedError; - @JsonKey(name: "to_chat_user") ChatUser get toChatUser => throw _privateConstructorUsedError; @@ -724,23 +765,24 @@ mixin _$Users { /// @nodoc abstract class $UsersCopyWith<$Res> { - factory $UsersCopyWith(Users value, $Res Function(Users) then) = _$UsersCopyWithImpl<$Res, Users>; - + factory $UsersCopyWith(Users value, $Res Function(Users) then) = + _$UsersCopyWithImpl<$Res, Users>; @useResult - $Res call({@JsonKey(name: "from_chat_user") ChatUser fromChatUser, @JsonKey(name: "to_chat_user") ChatUser toChatUser}); + $Res call( + {@JsonKey(name: "from_chat_user") ChatUser fromChatUser, + @JsonKey(name: "to_chat_user") ChatUser toChatUser}); $ChatUserCopyWith<$Res> get fromChatUser; - $ChatUserCopyWith<$Res> get toChatUser; } /// @nodoc -class _$UsersCopyWithImpl<$Res, $Val extends Users> implements $UsersCopyWith<$Res> { +class _$UsersCopyWithImpl<$Res, $Val extends Users> + implements $UsersCopyWith<$Res> { _$UsersCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -787,22 +829,28 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users> implements $UsersCopyWith<$R /// @nodoc abstract class _$$UsersImplCopyWith<$Res> implements $UsersCopyWith<$Res> { - factory _$$UsersImplCopyWith(_$UsersImpl value, $Res Function(_$UsersImpl) then) = __$$UsersImplCopyWithImpl<$Res>; - + factory _$$UsersImplCopyWith( + _$UsersImpl value, $Res Function(_$UsersImpl) then) = + __$$UsersImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "from_chat_user") ChatUser fromChatUser, @JsonKey(name: "to_chat_user") ChatUser toChatUser}); + $Res call( + {@JsonKey(name: "from_chat_user") ChatUser fromChatUser, + @JsonKey(name: "to_chat_user") ChatUser toChatUser}); @override $ChatUserCopyWith<$Res> get fromChatUser; - @override $ChatUserCopyWith<$Res> get toChatUser; } /// @nodoc -class __$$UsersImplCopyWithImpl<$Res> extends _$UsersCopyWithImpl<$Res, _$UsersImpl> implements _$$UsersImplCopyWith<$Res> { - __$$UsersImplCopyWithImpl(_$UsersImpl _value, $Res Function(_$UsersImpl) _then) : super(_value, _then); +class __$$UsersImplCopyWithImpl<$Res> + extends _$UsersCopyWithImpl<$Res, _$UsersImpl> + implements _$$UsersImplCopyWith<$Res> { + __$$UsersImplCopyWithImpl( + _$UsersImpl _value, $Res Function(_$UsersImpl) _then) + : super(_value, _then); /// Create a copy of Users /// with the given fields replaced by the non-null parameter values. @@ -828,9 +876,12 @@ class __$$UsersImplCopyWithImpl<$Res> extends _$UsersCopyWithImpl<$Res, _$UsersI /// @nodoc @JsonSerializable() class _$UsersImpl implements _Users { - const _$UsersImpl({@JsonKey(name: "from_chat_user") required this.fromChatUser, @JsonKey(name: "to_chat_user") required this.toChatUser}); + const _$UsersImpl( + {@JsonKey(name: "from_chat_user") required this.fromChatUser, + @JsonKey(name: "to_chat_user") required this.toChatUser}); - factory _$UsersImpl.fromJson(Map json) => _$$UsersImplFromJson(json); + factory _$UsersImpl.fromJson(Map json) => + _$$UsersImplFromJson(json); @override @JsonKey(name: "from_chat_user") @@ -849,8 +900,10 @@ class _$UsersImpl implements _Users { return identical(this, other) || (other.runtimeType == runtimeType && other is _$UsersImpl && - (identical(other.fromChatUser, fromChatUser) || other.fromChatUser == fromChatUser) && - (identical(other.toChatUser, toChatUser) || other.toChatUser == toChatUser)); + (identical(other.fromChatUser, fromChatUser) || + other.fromChatUser == fromChatUser) && + (identical(other.toChatUser, toChatUser) || + other.toChatUser == toChatUser)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -862,7 +915,8 @@ class _$UsersImpl implements _Users { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UsersImplCopyWith<_$UsersImpl> get copyWith => __$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity); + _$$UsersImplCopyWith<_$UsersImpl> get copyWith => + __$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity); @override Map toJson() { @@ -874,14 +928,15 @@ class _$UsersImpl implements _Users { abstract class _Users implements Users { const factory _Users( - {@JsonKey(name: "from_chat_user") required final ChatUser fromChatUser, @JsonKey(name: "to_chat_user") required final ChatUser toChatUser}) = _$UsersImpl; + {@JsonKey(name: "from_chat_user") required final ChatUser fromChatUser, + @JsonKey(name: "to_chat_user") + required final ChatUser toChatUser}) = _$UsersImpl; factory _Users.fromJson(Map json) = _$UsersImpl.fromJson; @override @JsonKey(name: "from_chat_user") ChatUser get fromChatUser; - @override @JsonKey(name: "to_chat_user") ChatUser get toChatUser; @@ -890,7 +945,8 @@ abstract class _Users implements Users { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$UsersImplCopyWith<_$UsersImpl> get copyWith => throw _privateConstructorUsedError; + _$$UsersImplCopyWith<_$UsersImpl> get copyWith => + throw _privateConstructorUsedError; } ChatUser _$ChatUserFromJson(Map json) { @@ -901,13 +957,10 @@ ChatUser _$ChatUserFromJson(Map json) { mixin _$ChatUser { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "profile_photo_path") String? get profilePhotoPath => throw _privateConstructorUsedError; - @JsonKey(name: "profile_photo_url") String get profilePhotoUrl => throw _privateConstructorUsedError; @@ -917,13 +970,14 @@ mixin _$ChatUser { /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatUserCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatUserCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatUserCopyWith<$Res> { - factory $ChatUserCopyWith(ChatUser value, $Res Function(ChatUser) then) = _$ChatUserCopyWithImpl<$Res, ChatUser>; - + factory $ChatUserCopyWith(ChatUser value, $Res Function(ChatUser) then) = + _$ChatUserCopyWithImpl<$Res, ChatUser>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -933,12 +987,12 @@ abstract class $ChatUserCopyWith<$Res> { } /// @nodoc -class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> implements $ChatUserCopyWith<$Res> { +class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> + implements $ChatUserCopyWith<$Res> { _$ChatUserCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -974,9 +1028,11 @@ class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> implements $ChatUserCo } /// @nodoc -abstract class _$$ChatUserImplCopyWith<$Res> implements $ChatUserCopyWith<$Res> { - factory _$$ChatUserImplCopyWith(_$ChatUserImpl value, $Res Function(_$ChatUserImpl) then) = __$$ChatUserImplCopyWithImpl<$Res>; - +abstract class _$$ChatUserImplCopyWith<$Res> + implements $ChatUserCopyWith<$Res> { + factory _$$ChatUserImplCopyWith( + _$ChatUserImpl value, $Res Function(_$ChatUserImpl) then) = + __$$ChatUserImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -987,8 +1043,12 @@ abstract class _$$ChatUserImplCopyWith<$Res> implements $ChatUserCopyWith<$Res> } /// @nodoc -class __$$ChatUserImplCopyWithImpl<$Res> extends _$ChatUserCopyWithImpl<$Res, _$ChatUserImpl> implements _$$ChatUserImplCopyWith<$Res> { - __$$ChatUserImplCopyWithImpl(_$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then) : super(_value, _then); +class __$$ChatUserImplCopyWithImpl<$Res> + extends _$ChatUserCopyWithImpl<$Res, _$ChatUserImpl> + implements _$$ChatUserImplCopyWith<$Res> { + __$$ChatUserImplCopyWithImpl( + _$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then) + : super(_value, _then); /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @@ -1030,7 +1090,8 @@ class _$ChatUserImpl implements _ChatUser { @JsonKey(name: "profile_photo_path") required this.profilePhotoPath, @JsonKey(name: "profile_photo_url") required this.profilePhotoUrl}); - factory _$ChatUserImpl.fromJson(Map json) => _$$ChatUserImplFromJson(json); + factory _$ChatUserImpl.fromJson(Map json) => + _$$ChatUserImplFromJson(json); @override @JsonKey(name: "id") @@ -1057,20 +1118,24 @@ class _$ChatUserImpl implements _ChatUser { other is _$ChatUserImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.profilePhotoPath, profilePhotoPath) || other.profilePhotoPath == profilePhotoPath) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoPath, profilePhotoPath) || + other.profilePhotoPath == profilePhotoPath) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || + other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); + int get hashCode => + Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => __$$ChatUserImplCopyWithImpl<_$ChatUserImpl>(this, _$identity); + _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => + __$$ChatUserImplCopyWithImpl<_$ChatUserImpl>(this, _$identity); @override Map toJson() { @@ -1084,23 +1149,23 @@ abstract class _ChatUser implements ChatUser { const factory _ChatUser( {@JsonKey(name: "id") required final int id, @JsonKey(name: "name") required final String name, - @JsonKey(name: "profile_photo_path") required final String? profilePhotoPath, - @JsonKey(name: "profile_photo_url") required final String profilePhotoUrl}) = _$ChatUserImpl; + @JsonKey(name: "profile_photo_path") + required final String? profilePhotoPath, + @JsonKey(name: "profile_photo_url") + required final String profilePhotoUrl}) = _$ChatUserImpl; - factory _ChatUser.fromJson(Map json) = _$ChatUserImpl.fromJson; + factory _ChatUser.fromJson(Map json) = + _$ChatUserImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "profile_photo_path") String? get profilePhotoPath; - @override @JsonKey(name: "profile_photo_url") String get profilePhotoUrl; @@ -1109,5 +1174,6 @@ abstract class _ChatUser implements ChatUser { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_preview_model.g.dart b/lib/features/chat/models/chat_room_preview_model.g.dart index ef589a94..5ae3f709 100644 --- a/lib/features/chat/models/chat_room_preview_model.g.dart +++ b/lib/features/chat/models/chat_room_preview_model.g.dart @@ -6,29 +6,39 @@ part of 'chat_room_preview_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson(Map json) => _$ChatRoomPreviewModelImpl( - chatRooms: (json['chatRooms'] as List).map((e) => ChatRoom.fromJson(e as Map)).toList(), +_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson( + Map json) => + _$ChatRoomPreviewModelImpl( + chatRooms: (json['chatRooms'] as List) + .map((e) => ChatRoom.fromJson(e as Map)) + .toList(), ); -Map _$$ChatRoomPreviewModelImplToJson(_$ChatRoomPreviewModelImpl instance) => { +Map _$$ChatRoomPreviewModelImplToJson( + _$ChatRoomPreviewModelImpl instance) => + { 'chatRooms': instance.chatRooms, }; -_$ChatRoomImpl _$$ChatRoomImplFromJson(Map json) => _$ChatRoomImpl( +_$ChatRoomImpl _$$ChatRoomImplFromJson(Map json) => + _$ChatRoomImpl( id: json['id'] as String, roomName: json['room_name'] as String, lastMessage: json['last_message'], users: Users.fromJson(json['users'] as Map), ); -Map _$$ChatRoomImplToJson(_$ChatRoomImpl instance) => { +Map _$$ChatRoomImplToJson(_$ChatRoomImpl instance) => + { 'id': instance.id, 'room_name': instance.roomName, 'last_message': instance.lastMessage, 'users': instance.users, }; -_$LastMessageClassImpl _$$LastMessageClassImplFromJson(Map json) => _$LastMessageClassImpl( +_$LastMessageClassImpl _$$LastMessageClassImplFromJson( + Map json) => + _$LastMessageClassImpl( id: (json['id'] as num).toInt(), data: json['data'] as String, mediaData: json['media_data'] as List, @@ -38,7 +48,9 @@ _$LastMessageClassImpl _$$LastMessageClassImplFromJson(Map json updatedAt: DateTime.parse(json['updated_at'] as String), ); -Map _$$LastMessageClassImplToJson(_$LastMessageClassImpl instance) => { +Map _$$LastMessageClassImplToJson( + _$LastMessageClassImpl instance) => + { 'id': instance.id, 'data': instance.data, 'media_data': instance.mediaData, @@ -49,23 +61,28 @@ Map _$$LastMessageClassImplToJson(_$LastMessageClassImpl instan }; _$UsersImpl _$$UsersImplFromJson(Map json) => _$UsersImpl( - fromChatUser: ChatUser.fromJson(json['from_chat_user'] as Map), - toChatUser: ChatUser.fromJson(json['to_chat_user'] as Map), + fromChatUser: + ChatUser.fromJson(json['from_chat_user'] as Map), + toChatUser: + ChatUser.fromJson(json['to_chat_user'] as Map), ); -Map _$$UsersImplToJson(_$UsersImpl instance) => { +Map _$$UsersImplToJson(_$UsersImpl instance) => + { 'from_chat_user': instance.fromChatUser, 'to_chat_user': instance.toChatUser, }; -_$ChatUserImpl _$$ChatUserImplFromJson(Map json) => _$ChatUserImpl( +_$ChatUserImpl _$$ChatUserImplFromJson(Map json) => + _$ChatUserImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, profilePhotoPath: json['profile_photo_path'] as String?, profilePhotoUrl: json['profile_photo_url'] as String, ); -Map _$$ChatUserImplToJson(_$ChatUserImpl instance) => { +Map _$$ChatUserImplToJson(_$ChatUserImpl instance) => + { 'id': instance.id, 'name': instance.name, 'profile_photo_path': instance.profilePhotoPath, diff --git a/lib/features/chat/models/chat_room_settings_model.freezed.dart b/lib/features/chat/models/chat_room_settings_model.freezed.dart index 76419b76..9d12eefa 100644 --- a/lib/features/chat/models/chat_room_settings_model.freezed.dart +++ b/lib/features/chat/models/chat_room_settings_model.freezed.dart @@ -14,22 +14,19 @@ T _$identity(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'); -ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson(Map json) { +ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson( + Map json) { return _ChatRoomSettingsModel.fromJson(json); } /// @nodoc mixin _$ChatRoomSettingsModel { int get id => throw _privateConstructorUsedError; - @JsonKey(name: 'room_name') String get roomName => throw _privateConstructorUsedError; - String get state => throw _privateConstructorUsedError; - @JsonKey(name: 'access_level') String get accessLevel => throw _privateConstructorUsedError; - @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; @@ -39,14 +36,15 @@ mixin _$ChatRoomSettingsModel { /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomSettingsModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomSettingsModelCopyWith<$Res> { - factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value, $Res Function(ChatRoomSettingsModel) then) = + factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value, + $Res Function(ChatRoomSettingsModel) then) = _$ChatRoomSettingsModelCopyWithImpl<$Res, ChatRoomSettingsModel>; - @useResult $Res call( {int id, @@ -57,12 +55,13 @@ abstract class $ChatRoomSettingsModelCopyWith<$Res> { } /// @nodoc -class _$ChatRoomSettingsModelCopyWithImpl<$Res, $Val extends ChatRoomSettingsModel> implements $ChatRoomSettingsModelCopyWith<$Res> { +class _$ChatRoomSettingsModelCopyWithImpl<$Res, + $Val extends ChatRoomSettingsModel> + implements $ChatRoomSettingsModelCopyWith<$Res> { _$ChatRoomSettingsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -103,10 +102,12 @@ class _$ChatRoomSettingsModelCopyWithImpl<$Res, $Val extends ChatRoomSettingsMod } /// @nodoc -abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> implements $ChatRoomSettingsModelCopyWith<$Res> { - factory _$$ChatRoomSettingsModelImplCopyWith(_$ChatRoomSettingsModelImpl value, $Res Function(_$ChatRoomSettingsModelImpl) then) = +abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> + implements $ChatRoomSettingsModelCopyWith<$Res> { + factory _$$ChatRoomSettingsModelImplCopyWith( + _$ChatRoomSettingsModelImpl value, + $Res Function(_$ChatRoomSettingsModelImpl) then) = __$$ChatRoomSettingsModelImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -118,9 +119,13 @@ abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> implements $ChatRoomSe } /// @nodoc -class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res> extends _$ChatRoomSettingsModelCopyWithImpl<$Res, _$ChatRoomSettingsModelImpl> +class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res> + extends _$ChatRoomSettingsModelCopyWithImpl<$Res, + _$ChatRoomSettingsModelImpl> implements _$$ChatRoomSettingsModelImplCopyWith<$Res> { - __$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value, $Res Function(_$ChatRoomSettingsModelImpl) _then) : super(_value, _then); + __$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value, + $Res Function(_$ChatRoomSettingsModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @@ -168,7 +173,8 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { @JsonKey(name: 'access_level') required this.accessLevel, @JsonKey(name: 'updated_at') required this.updatedAt}); - factory _$ChatRoomSettingsModelImpl.fromJson(Map json) => _$$ChatRoomSettingsModelImplFromJson(json); + factory _$ChatRoomSettingsModelImpl.fromJson(Map json) => + _$$ChatRoomSettingsModelImplFromJson(json); @override final int id; @@ -195,23 +201,28 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { (other.runtimeType == runtimeType && other is _$ChatRoomSettingsModelImpl && (identical(other.id, id) || other.id == id) && - (identical(other.roomName, roomName) || other.roomName == roomName) && + (identical(other.roomName, roomName) || + other.roomName == roomName) && (identical(other.state, state) || other.state == state) && - (identical(other.accessLevel, accessLevel) || other.accessLevel == accessLevel) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + (identical(other.accessLevel, accessLevel) || + other.accessLevel == accessLevel) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); + int get hashCode => + Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => - __$$ChatRoomSettingsModelImplCopyWithImpl<_$ChatRoomSettingsModelImpl>(this, _$identity); + _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> + get copyWith => __$$ChatRoomSettingsModelImplCopyWithImpl< + _$ChatRoomSettingsModelImpl>(this, _$identity); @override Map toJson() { @@ -223,28 +234,26 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel { const factory _ChatRoomSettingsModel( - {required final int id, - @JsonKey(name: 'room_name') required final String roomName, - required final String state, - @JsonKey(name: 'access_level') required final String accessLevel, - @JsonKey(name: 'updated_at') required final String updatedAt}) = _$ChatRoomSettingsModelImpl; + {required final int id, + @JsonKey(name: 'room_name') required final String roomName, + required final String state, + @JsonKey(name: 'access_level') required final String accessLevel, + @JsonKey(name: 'updated_at') required final String updatedAt}) = + _$ChatRoomSettingsModelImpl; - factory _ChatRoomSettingsModel.fromJson(Map json) = _$ChatRoomSettingsModelImpl.fromJson; + factory _ChatRoomSettingsModel.fromJson(Map json) = + _$ChatRoomSettingsModelImpl.fromJson; @override int get id; - @override @JsonKey(name: 'room_name') String get roomName; - @override String get state; - @override @JsonKey(name: 'access_level') String get accessLevel; - @override @JsonKey(name: 'updated_at') String get updatedAt; @@ -253,5 +262,6 @@ abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_settings_model.g.dart b/lib/features/chat/models/chat_room_settings_model.g.dart index 1a2ef327..7b824334 100644 --- a/lib/features/chat/models/chat_room_settings_model.g.dart +++ b/lib/features/chat/models/chat_room_settings_model.g.dart @@ -6,7 +6,9 @@ part of 'chat_room_settings_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson(Map json) => _$ChatRoomSettingsModelImpl( +_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson( + Map json) => + _$ChatRoomSettingsModelImpl( id: (json['id'] as num).toInt(), roomName: json['room_name'] as String, state: json['state'] as String, @@ -14,7 +16,9 @@ _$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson(Map _$$ChatRoomSettingsModelImplToJson(_$ChatRoomSettingsModelImpl instance) => { +Map _$$ChatRoomSettingsModelImplToJson( + _$ChatRoomSettingsModelImpl instance) => + { 'id': instance.id, 'room_name': instance.roomName, 'state': instance.state, diff --git a/lib/features/chat/models/chat_user_model.freezed.dart b/lib/features/chat/models/chat_user_model.freezed.dart index 166e3870..94718168 100644 --- a/lib/features/chat/models/chat_user_model.freezed.dart +++ b/lib/features/chat/models/chat_user_model.freezed.dart @@ -21,12 +21,9 @@ ChatUserModel _$ChatUserModelFromJson(Map json) { /// @nodoc mixin _$ChatUserModel { int get id => throw _privateConstructorUsedError; - String get name => throw _privateConstructorUsedError; - @JsonKey(name: 'profile_photo_path') String? get profilePhotoPath => throw _privateConstructorUsedError; - @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl => throw _privateConstructorUsedError; @@ -36,24 +33,30 @@ mixin _$ChatUserModel { /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatUserModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatUserModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatUserModelCopyWith<$Res> { - factory $ChatUserModelCopyWith(ChatUserModel value, $Res Function(ChatUserModel) then) = _$ChatUserModelCopyWithImpl<$Res, ChatUserModel>; - + factory $ChatUserModelCopyWith( + ChatUserModel value, $Res Function(ChatUserModel) then) = + _$ChatUserModelCopyWithImpl<$Res, ChatUserModel>; @useResult - $Res call({int id, String name, @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); + $Res call( + {int id, + String name, + @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, + @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); } /// @nodoc -class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> implements $ChatUserModelCopyWith<$Res> { +class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> + implements $ChatUserModelCopyWith<$Res> { _$ChatUserModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -89,17 +92,27 @@ class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> implements $ } /// @nodoc -abstract class _$$ChatUserModelImplCopyWith<$Res> implements $ChatUserModelCopyWith<$Res> { - factory _$$ChatUserModelImplCopyWith(_$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) = __$$ChatUserModelImplCopyWithImpl<$Res>; - +abstract class _$$ChatUserModelImplCopyWith<$Res> + implements $ChatUserModelCopyWith<$Res> { + factory _$$ChatUserModelImplCopyWith( + _$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) = + __$$ChatUserModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({int id, String name, @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); + $Res call( + {int id, + String name, + @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, + @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); } /// @nodoc -class __$$ChatUserModelImplCopyWithImpl<$Res> extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl> implements _$$ChatUserModelImplCopyWith<$Res> { - __$$ChatUserModelImplCopyWithImpl(_$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then) : super(_value, _then); +class __$$ChatUserModelImplCopyWithImpl<$Res> + extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl> + implements _$$ChatUserModelImplCopyWith<$Res> { + __$$ChatUserModelImplCopyWithImpl( + _$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @@ -141,7 +154,8 @@ class _$ChatUserModelImpl implements _ChatUserModel { @JsonKey(name: 'profile_photo_path') this.profilePhotoPath, @JsonKey(name: 'profile_photo_url') this.profilePhotoUrl}); - factory _$ChatUserModelImpl.fromJson(Map json) => _$$ChatUserModelImplFromJson(json); + factory _$ChatUserModelImpl.fromJson(Map json) => + _$$ChatUserModelImplFromJson(json); @override final int id; @@ -166,20 +180,24 @@ class _$ChatUserModelImpl implements _ChatUserModel { other is _$ChatUserModelImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.profilePhotoPath, profilePhotoPath) || other.profilePhotoPath == profilePhotoPath) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoPath, profilePhotoPath) || + other.profilePhotoPath == profilePhotoPath) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || + other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); + int get hashCode => + Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); + _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => + __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); @override Map toJson() { @@ -191,23 +209,22 @@ class _$ChatUserModelImpl implements _ChatUserModel { abstract class _ChatUserModel implements ChatUserModel { const factory _ChatUserModel( - {required final int id, - required final String name, - @JsonKey(name: 'profile_photo_path') final String? profilePhotoPath, - @JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) = _$ChatUserModelImpl; + {required final int id, + required final String name, + @JsonKey(name: 'profile_photo_path') final String? profilePhotoPath, + @JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) = + _$ChatUserModelImpl; - factory _ChatUserModel.fromJson(Map json) = _$ChatUserModelImpl.fromJson; + factory _ChatUserModel.fromJson(Map json) = + _$ChatUserModelImpl.fromJson; @override int get id; - @override String get name; - @override @JsonKey(name: 'profile_photo_path') String? get profilePhotoPath; - @override @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl; @@ -216,5 +233,6 @@ abstract class _ChatUserModel implements ChatUserModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_user_model.g.dart b/lib/features/chat/models/chat_user_model.g.dart index 06fa92a0..78e0f981 100644 --- a/lib/features/chat/models/chat_user_model.g.dart +++ b/lib/features/chat/models/chat_user_model.g.dart @@ -6,14 +6,16 @@ part of 'chat_user_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatUserModelImpl _$$ChatUserModelImplFromJson(Map json) => _$ChatUserModelImpl( +_$ChatUserModelImpl _$$ChatUserModelImplFromJson(Map json) => + _$ChatUserModelImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, profilePhotoPath: json['profile_photo_path'] as String?, profilePhotoUrl: json['profile_photo_url'] as String?, ); -Map _$$ChatUserModelImplToJson(_$ChatUserModelImpl instance) => { +Map _$$ChatUserModelImplToJson(_$ChatUserModelImpl instance) => + { 'id': instance.id, 'name': instance.name, 'profile_photo_path': instance.profilePhotoPath, diff --git a/lib/features/chat/models/websocket_info_model.freezed.dart b/lib/features/chat/models/websocket_info_model.freezed.dart index dd7a6bb0..9cddabee 100644 --- a/lib/features/chat/models/websocket_info_model.freezed.dart +++ b/lib/features/chat/models/websocket_info_model.freezed.dart @@ -21,13 +21,9 @@ WebsocketInfoModel _$WebsocketInfoModelFromJson(Map json) { /// @nodoc mixin _$WebsocketInfoModel { String get key => throw _privateConstructorUsedError; - String get host => throw _privateConstructorUsedError; - String get port => throw _privateConstructorUsedError; - String get cluster => throw _privateConstructorUsedError; - @JsonKey(name: 'user_id') int get userId => throw _privateConstructorUsedError; @@ -37,25 +33,31 @@ mixin _$WebsocketInfoModel { /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $WebsocketInfoModelCopyWith get copyWith => throw _privateConstructorUsedError; + $WebsocketInfoModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $WebsocketInfoModelCopyWith<$Res> { - factory $WebsocketInfoModelCopyWith(WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) = + factory $WebsocketInfoModelCopyWith( + WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) = _$WebsocketInfoModelCopyWithImpl<$Res, WebsocketInfoModel>; - @useResult - $Res call({String key, String host, String port, String cluster, @JsonKey(name: 'user_id') int userId}); + $Res call( + {String key, + String host, + String port, + String cluster, + @JsonKey(name: 'user_id') int userId}); } /// @nodoc -class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> implements $WebsocketInfoModelCopyWith<$Res> { +class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> + implements $WebsocketInfoModelCopyWith<$Res> { _$WebsocketInfoModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -96,19 +98,28 @@ class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> im } /// @nodoc -abstract class _$$WebsocketInfoModelImplCopyWith<$Res> implements $WebsocketInfoModelCopyWith<$Res> { - factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value, $Res Function(_$WebsocketInfoModelImpl) then) = +abstract class _$$WebsocketInfoModelImplCopyWith<$Res> + implements $WebsocketInfoModelCopyWith<$Res> { + factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value, + $Res Function(_$WebsocketInfoModelImpl) then) = __$$WebsocketInfoModelImplCopyWithImpl<$Res>; - @override @useResult - $Res call({String key, String host, String port, String cluster, @JsonKey(name: 'user_id') int userId}); + $Res call( + {String key, + String host, + String port, + String cluster, + @JsonKey(name: 'user_id') int userId}); } /// @nodoc -class __$$WebsocketInfoModelImplCopyWithImpl<$Res> extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl> +class __$$WebsocketInfoModelImplCopyWithImpl<$Res> + extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl> implements _$$WebsocketInfoModelImplCopyWith<$Res> { - __$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value, $Res Function(_$WebsocketInfoModelImpl) _then) : super(_value, _then); + __$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value, + $Res Function(_$WebsocketInfoModelImpl) _then) + : super(_value, _then); /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @@ -150,9 +161,14 @@ class __$$WebsocketInfoModelImplCopyWithImpl<$Res> extends _$WebsocketInfoModelC @JsonSerializable() class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { const _$WebsocketInfoModelImpl( - {required this.key, required this.host, required this.port, required this.cluster, @JsonKey(name: 'user_id') required this.userId}); + {required this.key, + required this.host, + required this.port, + required this.cluster, + @JsonKey(name: 'user_id') required this.userId}); - factory _$WebsocketInfoModelImpl.fromJson(Map json) => _$$WebsocketInfoModelImplFromJson(json); + factory _$WebsocketInfoModelImpl.fromJson(Map json) => + _$$WebsocketInfoModelImplFromJson(json); @override final String key; @@ -185,7 +201,8 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, key, host, port, cluster, userId); + int get hashCode => + Object.hash(runtimeType, key, host, port, cluster, userId); /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @@ -193,7 +210,8 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @override @pragma('vm:prefer-inline') _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => - __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>(this, _$identity); + __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>( + this, _$identity); @override Map toJson() { @@ -205,26 +223,24 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { abstract class _WebsocketInfoModel implements WebsocketInfoModel { const factory _WebsocketInfoModel( - {required final String key, - required final String host, - required final String port, - required final String cluster, - @JsonKey(name: 'user_id') required final int userId}) = _$WebsocketInfoModelImpl; + {required final String key, + required final String host, + required final String port, + required final String cluster, + @JsonKey(name: 'user_id') required final int userId}) = + _$WebsocketInfoModelImpl; - factory _WebsocketInfoModel.fromJson(Map json) = _$WebsocketInfoModelImpl.fromJson; + factory _WebsocketInfoModel.fromJson(Map json) = + _$WebsocketInfoModelImpl.fromJson; @override String get key; - @override String get host; - @override String get port; - @override String get cluster; - @override @JsonKey(name: 'user_id') int get userId; @@ -233,5 +249,6 @@ abstract class _WebsocketInfoModel implements WebsocketInfoModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/websocket_info_model.g.dart b/lib/features/chat/models/websocket_info_model.g.dart index 91c386f8..b2bb1248 100644 --- a/lib/features/chat/models/websocket_info_model.g.dart +++ b/lib/features/chat/models/websocket_info_model.g.dart @@ -6,7 +6,9 @@ part of 'websocket_info_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson(Map json) => _$WebsocketInfoModelImpl( +_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson( + Map json) => + _$WebsocketInfoModelImpl( key: json['key'] as String, host: json['host'] as String, port: json['port'] as String, @@ -14,7 +16,9 @@ _$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson(Map userId: (json['user_id'] as num).toInt(), ); -Map _$$WebsocketInfoModelImplToJson(_$WebsocketInfoModelImpl instance) => { +Map _$$WebsocketInfoModelImplToJson( + _$WebsocketInfoModelImpl instance) => + { 'key': instance.key, 'host': instance.host, 'port': instance.port, diff --git a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart index 9a27a0ba..4695b4ad 100644 --- a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart @@ -20,16 +20,19 @@ mixin _$ChatRoomState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +40,9 @@ mixin _$ChatRoomState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,16 +76,18 @@ mixin _$ChatRoomState { /// @nodoc abstract class $ChatRoomStateCopyWith<$Res> { - factory $ChatRoomStateCopyWith(ChatRoomState value, $Res Function(ChatRoomState) then) = _$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>; + factory $ChatRoomStateCopyWith( + ChatRoomState value, $Res Function(ChatRoomState) then) = + _$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>; } /// @nodoc -class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> implements $ChatRoomStateCopyWith<$Res> { +class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> + implements $ChatRoomStateCopyWith<$Res> { _$ChatRoomStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +97,18 @@ class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> implements $ /// @nodoc abstract class _$$ChatRoomStateImplCopyWith<$Res> { - factory _$$ChatRoomStateImplCopyWith(_$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) = __$$ChatRoomStateImplCopyWithImpl<$Res>; + factory _$$ChatRoomStateImplCopyWith( + _$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) = + __$$ChatRoomStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatRoomStateImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl> implements _$$ChatRoomStateImplCopyWith<$Res> { - __$$ChatRoomStateImplCopyWithImpl(_$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then) : super(_value, _then); +class __$$ChatRoomStateImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl> + implements _$$ChatRoomStateImplCopyWith<$Res> { + __$$ChatRoomStateImplCopyWithImpl( + _$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +126,8 @@ class _$ChatRoomStateImpl implements _ChatRoomState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ChatRoomStateImpl); } @override @@ -124,7 +138,9 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -135,7 +151,9 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -146,7 +164,9 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -200,14 +220,18 @@ abstract class _ChatRoomState implements ChatRoomState { /// @nodoc abstract class _$$ChatRoomStateLoadingImplCopyWith<$Res> { - factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value, $Res Function(_$ChatRoomStateLoadingImpl) then) = + factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value, + $Res Function(_$ChatRoomStateLoadingImpl) then) = __$$ChatRoomStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl> +class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl> implements _$$ChatRoomStateLoadingImplCopyWith<$Res> { - __$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value, $Res Function(_$ChatRoomStateLoadingImpl) _then) : super(_value, _then); + __$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value, + $Res Function(_$ChatRoomStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +249,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ChatRoomStateLoadingImpl); } @override @@ -236,7 +262,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -247,7 +275,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -258,7 +288,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -312,19 +344,26 @@ abstract class ChatRoomStateLoading implements ChatRoomState { /// @nodoc abstract class _$$ChatRoomStateLoadedImplCopyWith<$Res> { - factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value, $Res Function(_$ChatRoomStateLoadedImpl) then) = + factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value, + $Res Function(_$ChatRoomStateLoadedImpl) then) = __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>; - @useResult - $Res call({ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading}); + $Res call( + {ChatRoomModel chatRoom, + List chatMessages, + bool isTyping, + bool isLoading}); $ChatRoomModelCopyWith<$Res> get chatRoom; } /// @nodoc -class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl> +class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl> implements _$$ChatRoomStateLoadedImplCopyWith<$Res> { - __$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value, $Res Function(_$ChatRoomStateLoadedImpl) _then) : super(_value, _then); + __$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value, + $Res Function(_$ChatRoomStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -370,13 +409,16 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyW /// @nodoc class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { - const _$ChatRoomStateLoadedImpl({required this.chatRoom, required final List chatMessages, required this.isTyping, required this.isLoading}) + const _$ChatRoomStateLoadedImpl( + {required this.chatRoom, + required final List chatMessages, + required this.isTyping, + required this.isLoading}) : _chatMessages = chatMessages; @override final ChatRoomModel chatRoom; final List _chatMessages; - @override List get chatMessages { if (_chatMessages is EqualUnmodifiableListView) return _chatMessages; @@ -399,14 +441,19 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateLoadedImpl && - (identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom) && - const DeepCollectionEquality().equals(other._chatMessages, _chatMessages) && - (identical(other.isTyping, isTyping) || other.isTyping == isTyping) && - (identical(other.isLoading, isLoading) || other.isLoading == isLoading)); + (identical(other.chatRoom, chatRoom) || + other.chatRoom == chatRoom) && + const DeepCollectionEquality() + .equals(other._chatMessages, _chatMessages) && + (identical(other.isTyping, isTyping) || + other.isTyping == isTyping) && + (identical(other.isLoading, isLoading) || + other.isLoading == isLoading)); } @override - int get hashCode => Object.hash(runtimeType, chatRoom, const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); + int get hashCode => Object.hash(runtimeType, chatRoom, + const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -414,14 +461,17 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { @override @pragma('vm:prefer-inline') _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => - __$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>(this, _$identity); + __$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loaded(chatRoom, chatMessages, isTyping, isLoading); @@ -432,7 +482,9 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(chatRoom, chatMessages, isTyping, isLoading); @@ -443,7 +495,9 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -499,32 +553,33 @@ abstract class ChatRoomStateLoaded implements ChatRoomState { required final bool isLoading}) = _$ChatRoomStateLoadedImpl; ChatRoomModel get chatRoom; - List get chatMessages; - bool get isTyping; - bool get isLoading; /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ChatRoomStateErrorImplCopyWith<$Res> { - factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value, $Res Function(_$ChatRoomStateErrorImpl) then) = + factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value, + $Res Function(_$ChatRoomStateErrorImpl) then) = __$$ChatRoomStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ChatRoomStateErrorImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl> +class __$$ChatRoomStateErrorImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl> implements _$$ChatRoomStateErrorImplCopyWith<$Res> { - __$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value, $Res Function(_$ChatRoomStateErrorImpl) _then) : super(_value, _then); + __$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value, + $Res Function(_$ChatRoomStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -560,7 +615,8 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -572,14 +628,17 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { @override @pragma('vm:prefer-inline') _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => - __$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>(this, _$identity); + __$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -590,7 +649,9 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -601,7 +662,9 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -650,12 +713,14 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { } abstract class ChatRoomStateError implements ChatRoomState { - const factory ChatRoomStateError({required final String errorMessage}) = _$ChatRoomStateErrorImpl; + const factory ChatRoomStateError({required final String errorMessage}) = + _$ChatRoomStateErrorImpl; String get errorMessage; /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart index 1b216a02..99fa9054 100644 --- a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$ChatSelectState { required TResult Function(List chatRooms) loaded, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$ChatSelectState { /// @nodoc abstract class $ChatSelectStateCopyWith<$Res> { - factory $ChatSelectStateCopyWith(ChatSelectState value, $Res Function(ChatSelectState) then) = _$ChatSelectStateCopyWithImpl<$Res, ChatSelectState>; + factory $ChatSelectStateCopyWith( + ChatSelectState value, $Res Function(ChatSelectState) then) = + _$ChatSelectStateCopyWithImpl<$Res, ChatSelectState>; } /// @nodoc -class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> implements $ChatSelectStateCopyWith<$Res> { +class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> + implements $ChatSelectStateCopyWith<$Res> { _$ChatSelectStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,13 +91,18 @@ class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> implemen /// @nodoc abstract class _$$ChatSelectStateImplCopyWith<$Res> { - factory _$$ChatSelectStateImplCopyWith(_$ChatSelectStateImpl value, $Res Function(_$ChatSelectStateImpl) then) = __$$ChatSelectStateImplCopyWithImpl<$Res>; + factory _$$ChatSelectStateImplCopyWith(_$ChatSelectStateImpl value, + $Res Function(_$ChatSelectStateImpl) then) = + __$$ChatSelectStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatSelectStateImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateImpl> +class __$$ChatSelectStateImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateImpl> implements _$$ChatSelectStateImplCopyWith<$Res> { - __$$ChatSelectStateImplCopyWithImpl(_$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then) : super(_value, _then); + __$$ChatSelectStateImplCopyWithImpl( + _$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -114,7 +120,8 @@ class _$ChatSelectStateImpl implements _ChatSelectState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ChatSelectStateImpl); } @override @@ -201,14 +208,20 @@ abstract class _ChatSelectState implements ChatSelectState { /// @nodoc abstract class _$$ChatSelectStateLoadingImplCopyWith<$Res> { - factory _$$ChatSelectStateLoadingImplCopyWith(_$ChatSelectStateLoadingImpl value, $Res Function(_$ChatSelectStateLoadingImpl) then) = + factory _$$ChatSelectStateLoadingImplCopyWith( + _$ChatSelectStateLoadingImpl value, + $Res Function(_$ChatSelectStateLoadingImpl) then) = __$$ChatSelectStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadingImpl> +class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadingImpl> implements _$$ChatSelectStateLoadingImplCopyWith<$Res> { - __$$ChatSelectStateLoadingImplCopyWithImpl(_$ChatSelectStateLoadingImpl _value, $Res Function(_$ChatSelectStateLoadingImpl) _then) : super(_value, _then); + __$$ChatSelectStateLoadingImplCopyWithImpl( + _$ChatSelectStateLoadingImpl _value, + $Res Function(_$ChatSelectStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -226,7 +239,9 @@ class _$ChatSelectStateLoadingImpl implements ChatSelectStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ChatSelectStateLoadingImpl); } @override @@ -313,17 +328,20 @@ abstract class ChatSelectStateLoading implements ChatSelectState { /// @nodoc abstract class _$$ChatSelectStateErrorImplCopyWith<$Res> { - factory _$$ChatSelectStateErrorImplCopyWith(_$ChatSelectStateErrorImpl value, $Res Function(_$ChatSelectStateErrorImpl) then) = + factory _$$ChatSelectStateErrorImplCopyWith(_$ChatSelectStateErrorImpl value, + $Res Function(_$ChatSelectStateErrorImpl) then) = __$$ChatSelectStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ChatSelectStateErrorImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateErrorImpl> +class __$$ChatSelectStateErrorImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateErrorImpl> implements _$$ChatSelectStateErrorImplCopyWith<$Res> { - __$$ChatSelectStateErrorImplCopyWithImpl(_$ChatSelectStateErrorImpl _value, $Res Function(_$ChatSelectStateErrorImpl) _then) : super(_value, _then); + __$$ChatSelectStateErrorImplCopyWithImpl(_$ChatSelectStateErrorImpl _value, + $Res Function(_$ChatSelectStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -359,7 +377,8 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -370,8 +389,10 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => - __$$ChatSelectStateErrorImplCopyWithImpl<_$ChatSelectStateErrorImpl>(this, _$identity); + _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> + get copyWith => + __$$ChatSelectStateErrorImplCopyWithImpl<_$ChatSelectStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -449,29 +470,35 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { } abstract class ChatSelectStateError implements ChatSelectState { - const factory ChatSelectStateError({required final String errorMessage}) = _$ChatSelectStateErrorImpl; + const factory ChatSelectStateError({required final String errorMessage}) = + _$ChatSelectStateErrorImpl; String get errorMessage; /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ChatSelectStateLoadedImplCopyWith<$Res> { - factory _$$ChatSelectStateLoadedImplCopyWith(_$ChatSelectStateLoadedImpl value, $Res Function(_$ChatSelectStateLoadedImpl) then) = + factory _$$ChatSelectStateLoadedImplCopyWith( + _$ChatSelectStateLoadedImpl value, + $Res Function(_$ChatSelectStateLoadedImpl) then) = __$$ChatSelectStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({List chatRooms}); } /// @nodoc -class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadedImpl> +class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadedImpl> implements _$$ChatSelectStateLoadedImplCopyWith<$Res> { - __$$ChatSelectStateLoadedImplCopyWithImpl(_$ChatSelectStateLoadedImpl _value, $Res Function(_$ChatSelectStateLoadedImpl) _then) : super(_value, _then); + __$$ChatSelectStateLoadedImplCopyWithImpl(_$ChatSelectStateLoadedImpl _value, + $Res Function(_$ChatSelectStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -492,10 +519,10 @@ class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> extends _$ChatSelectStateC /// @nodoc class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { - const _$ChatSelectStateLoadedImpl({required final List chatRooms}) : _chatRooms = chatRooms; + const _$ChatSelectStateLoadedImpl({required final List chatRooms}) + : _chatRooms = chatRooms; final List _chatRooms; - @override List get chatRooms { if (_chatRooms is EqualUnmodifiableListView) return _chatRooms; @@ -511,19 +538,24 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatSelectStateLoadedImpl && const DeepCollectionEquality().equals(other._chatRooms, _chatRooms)); + (other.runtimeType == runtimeType && + other is _$ChatSelectStateLoadedImpl && + const DeepCollectionEquality() + .equals(other._chatRooms, _chatRooms)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> get copyWith => - __$$ChatSelectStateLoadedImplCopyWithImpl<_$ChatSelectStateLoadedImpl>(this, _$identity); + _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> + get copyWith => __$$ChatSelectStateLoadedImplCopyWithImpl< + _$ChatSelectStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -601,12 +633,14 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { } abstract class ChatSelectStateLoaded implements ChatSelectState { - const factory ChatSelectStateLoaded({required final List chatRooms}) = _$ChatSelectStateLoadedImpl; + const factory ChatSelectStateLoaded( + {required final List chatRooms}) = _$ChatSelectStateLoadedImpl; List get chatRooms; /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/services/chat_service.g.dart b/lib/features/chat/services/chat_service.g.dart index fa32d6fd..4e84a7b3 100644 --- a/lib/features/chat/services/chat_service.g.dart +++ b/lib/features/chat/services/chat_service.g.dart @@ -80,7 +80,8 @@ class _ChatService implements ChatService { final _result = await _dio.fetch>(_options); late Map _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry(k, ChatRoomModel.fromJson(v as Map))); + _value = _result.data!.map((k, dynamic v) => + MapEntry(k, ChatRoomModel.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -198,7 +199,9 @@ class _ChatService implements ChatService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/diary/models/diary_model.freezed.dart b/lib/features/diary/models/diary_model.freezed.dart index 1b3bca12..ceabd5db 100644 --- a/lib/features/diary/models/diary_model.freezed.dart +++ b/lib/features/diary/models/diary_model.freezed.dart @@ -21,19 +21,12 @@ DiaryModel _$DiaryModelFromJson(Map json) { /// @nodoc mixin _$DiaryModel { int get id => throw _privateConstructorUsedError; - DateTime get date => throw _privateConstructorUsedError; - int get closed => throw _privateConstructorUsedError; - List get meals => throw _privateConstructorUsedError; - State get state => throw _privateConstructorUsedError; - String? get comment => throw _privateConstructorUsedError; - DateTime? get wakeup => throw _privateConstructorUsedError; - DateTime? get retire => throw _privateConstructorUsedError; /// Serializes this DiaryModel to a JSON map. @@ -42,26 +35,36 @@ mixin _$DiaryModel { /// Create a copy of DiaryModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DiaryModelCopyWith get copyWith => throw _privateConstructorUsedError; + $DiaryModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $DiaryModelCopyWith<$Res> { - factory $DiaryModelCopyWith(DiaryModel value, $Res Function(DiaryModel) then) = _$DiaryModelCopyWithImpl<$Res, DiaryModel>; - + factory $DiaryModelCopyWith( + DiaryModel value, $Res Function(DiaryModel) then) = + _$DiaryModelCopyWithImpl<$Res, DiaryModel>; @useResult - $Res call({int id, DateTime date, int closed, List meals, State state, String? comment, DateTime? wakeup, DateTime? retire}); + $Res call( + {int id, + DateTime date, + int closed, + List meals, + State state, + String? comment, + DateTime? wakeup, + DateTime? retire}); $StateCopyWith<$Res> get state; } /// @nodoc -class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> implements $DiaryModelCopyWith<$Res> { +class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> + implements $DiaryModelCopyWith<$Res> { _$DiaryModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -127,20 +130,34 @@ class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> implements $DiaryM } /// @nodoc -abstract class _$$DiaryModelImplCopyWith<$Res> implements $DiaryModelCopyWith<$Res> { - factory _$$DiaryModelImplCopyWith(_$DiaryModelImpl value, $Res Function(_$DiaryModelImpl) then) = __$$DiaryModelImplCopyWithImpl<$Res>; - +abstract class _$$DiaryModelImplCopyWith<$Res> + implements $DiaryModelCopyWith<$Res> { + factory _$$DiaryModelImplCopyWith( + _$DiaryModelImpl value, $Res Function(_$DiaryModelImpl) then) = + __$$DiaryModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({int id, DateTime date, int closed, List meals, State state, String? comment, DateTime? wakeup, DateTime? retire}); + $Res call( + {int id, + DateTime date, + int closed, + List meals, + State state, + String? comment, + DateTime? wakeup, + DateTime? retire}); @override $StateCopyWith<$Res> get state; } /// @nodoc -class __$$DiaryModelImplCopyWithImpl<$Res> extends _$DiaryModelCopyWithImpl<$Res, _$DiaryModelImpl> implements _$$DiaryModelImplCopyWith<$Res> { - __$$DiaryModelImplCopyWithImpl(_$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then) : super(_value, _then); +class __$$DiaryModelImplCopyWithImpl<$Res> + extends _$DiaryModelCopyWithImpl<$Res, _$DiaryModelImpl> + implements _$$DiaryModelImplCopyWith<$Res> { + __$$DiaryModelImplCopyWithImpl( + _$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then) + : super(_value, _then); /// Create a copy of DiaryModel /// with the given fields replaced by the non-null parameter values. @@ -207,7 +224,8 @@ class _$DiaryModelImpl implements _DiaryModel { this.retire}) : _meals = meals; - factory _$DiaryModelImpl.fromJson(Map json) => _$$DiaryModelImplFromJson(json); + factory _$DiaryModelImpl.fromJson(Map json) => + _$$DiaryModelImplFromJson(json); @override final int id; @@ -216,7 +234,6 @@ class _$DiaryModelImpl implements _DiaryModel { @override final int closed; final List _meals; - @override List get meals { if (_meals is EqualUnmodifiableListView) return _meals; @@ -255,14 +272,24 @@ class _$DiaryModelImpl implements _DiaryModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, date, closed, const DeepCollectionEquality().hash(_meals), state, comment, wakeup, retire); + int get hashCode => Object.hash( + runtimeType, + id, + date, + closed, + const DeepCollectionEquality().hash(_meals), + state, + comment, + wakeup, + retire); /// Create a copy of DiaryModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => __$$DiaryModelImplCopyWithImpl<_$DiaryModelImpl>(this, _$identity); + _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => + __$$DiaryModelImplCopyWithImpl<_$DiaryModelImpl>(this, _$identity); @override Map toJson() { @@ -283,29 +310,23 @@ abstract class _DiaryModel implements DiaryModel { final DateTime? wakeup, final DateTime? retire}) = _$DiaryModelImpl; - factory _DiaryModel.fromJson(Map json) = _$DiaryModelImpl.fromJson; + factory _DiaryModel.fromJson(Map json) = + _$DiaryModelImpl.fromJson; @override int get id; - @override DateTime get date; - @override int get closed; - @override List get meals; - @override State get state; - @override String? get comment; - @override DateTime? get wakeup; - @override DateTime? get retire; @@ -313,5 +334,6 @@ abstract class _DiaryModel implements DiaryModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/diary_model.g.dart b/lib/features/diary/models/diary_model.g.dart index e549b464..29f98caa 100644 --- a/lib/features/diary/models/diary_model.g.dart +++ b/lib/features/diary/models/diary_model.g.dart @@ -6,18 +6,26 @@ part of 'diary_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$DiaryModelImpl _$$DiaryModelImplFromJson(Map json) => _$DiaryModelImpl( +_$DiaryModelImpl _$$DiaryModelImplFromJson(Map json) => + _$DiaryModelImpl( id: (json['id'] as num).toInt(), date: DateTime.parse(json['date'] as String), closed: (json['closed'] as num).toInt(), - meals: (json['meals'] as List).map((e) => Meal.fromJson(e as Map)).toList(), + meals: (json['meals'] as List) + .map((e) => Meal.fromJson(e as Map)) + .toList(), state: State.fromJson(json['state'] as Map), comment: json['comment'] as String?, - wakeup: json['wakeup'] == null ? null : DateTime.parse(json['wakeup'] as String), - retire: json['retire'] == null ? null : DateTime.parse(json['retire'] as String), + wakeup: json['wakeup'] == null + ? null + : DateTime.parse(json['wakeup'] as String), + retire: json['retire'] == null + ? null + : DateTime.parse(json['retire'] as String), ); -Map _$$DiaryModelImplToJson(_$DiaryModelImpl instance) => { +Map _$$DiaryModelImplToJson(_$DiaryModelImpl instance) => + { 'id': instance.id, 'date': instance.date.toIso8601String(), 'closed': instance.closed, diff --git a/lib/features/diary/models/meal.freezed.dart b/lib/features/diary/models/meal.freezed.dart index 16a7bd5a..2bd6c478 100644 --- a/lib/features/diary/models/meal.freezed.dart +++ b/lib/features/diary/models/meal.freezed.dart @@ -21,17 +21,11 @@ Meal _$MealFromJson(Map json) { /// @nodoc mixin _$Meal { int get id => throw _privateConstructorUsedError; - String get time => throw _privateConstructorUsedError; - int get type => throw _privateConstructorUsedError; - int get satiety => throw _privateConstructorUsedError; - int get mood => throw _privateConstructorUsedError; - List get portions => throw _privateConstructorUsedError; - List get photos => throw _privateConstructorUsedError; /// Serializes this Meal to a JSON map. @@ -45,19 +39,26 @@ mixin _$Meal { /// @nodoc abstract class $MealCopyWith<$Res> { - factory $MealCopyWith(Meal value, $Res Function(Meal) then) = _$MealCopyWithImpl<$Res, Meal>; - + factory $MealCopyWith(Meal value, $Res Function(Meal) then) = + _$MealCopyWithImpl<$Res, Meal>; @useResult - $Res call({int id, String time, int type, int satiety, int mood, List portions, List photos}); + $Res call( + {int id, + String time, + int type, + int satiety, + int mood, + List portions, + List photos}); } /// @nodoc -class _$MealCopyWithImpl<$Res, $Val extends Meal> implements $MealCopyWith<$Res> { +class _$MealCopyWithImpl<$Res, $Val extends Meal> + implements $MealCopyWith<$Res> { _$MealCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -109,16 +110,27 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal> implements $MealCopyWith<$Res> /// @nodoc abstract class _$$MealImplCopyWith<$Res> implements $MealCopyWith<$Res> { - factory _$$MealImplCopyWith(_$MealImpl value, $Res Function(_$MealImpl) then) = __$$MealImplCopyWithImpl<$Res>; - + factory _$$MealImplCopyWith( + _$MealImpl value, $Res Function(_$MealImpl) then) = + __$$MealImplCopyWithImpl<$Res>; @override @useResult - $Res call({int id, String time, int type, int satiety, int mood, List portions, List photos}); + $Res call( + {int id, + String time, + int type, + int satiety, + int mood, + List portions, + List photos}); } /// @nodoc -class __$$MealImplCopyWithImpl<$Res> extends _$MealCopyWithImpl<$Res, _$MealImpl> implements _$$MealImplCopyWith<$Res> { - __$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then) : super(_value, _then); +class __$$MealImplCopyWithImpl<$Res> + extends _$MealCopyWithImpl<$Res, _$MealImpl> + implements _$$MealImplCopyWith<$Res> { + __$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then) + : super(_value, _then); /// Create a copy of Meal /// with the given fields replaced by the non-null parameter values. @@ -180,7 +192,8 @@ class _$MealImpl implements _Meal { : _portions = portions, _photos = photos; - factory _$MealImpl.fromJson(Map json) => _$$MealImplFromJson(json); + factory _$MealImpl.fromJson(Map json) => + _$$MealImplFromJson(json); @override final int id; @@ -193,7 +206,6 @@ class _$MealImpl implements _Meal { @override final int mood; final List _portions; - @override List get portions { if (_portions is EqualUnmodifiableListView) return _portions; @@ -202,7 +214,6 @@ class _$MealImpl implements _Meal { } final List _photos; - @override List get photos { if (_photos is EqualUnmodifiableListView) return _photos; @@ -231,15 +242,23 @@ class _$MealImpl implements _Meal { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, time, type, satiety, mood, const DeepCollectionEquality().hash(_portions), const DeepCollectionEquality().hash(_photos)); + int get hashCode => Object.hash( + runtimeType, + id, + time, + type, + satiety, + mood, + const DeepCollectionEquality().hash(_portions), + const DeepCollectionEquality().hash(_photos)); /// Create a copy of Meal /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$MealImplCopyWith<_$MealImpl> get copyWith => __$$MealImplCopyWithImpl<_$MealImpl>(this, _$identity); + _$$MealImplCopyWith<_$MealImpl> get copyWith => + __$$MealImplCopyWithImpl<_$MealImpl>(this, _$identity); @override Map toJson() { @@ -263,22 +282,16 @@ abstract class _Meal implements Meal { @override int get id; - @override String get time; - @override int get type; - @override int get satiety; - @override int get mood; - @override List get portions; - @override List get photos; @@ -286,5 +299,6 @@ abstract class _Meal implements Meal { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$MealImplCopyWith<_$MealImpl> get copyWith => throw _privateConstructorUsedError; + _$$MealImplCopyWith<_$MealImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/meal.g.dart b/lib/features/diary/models/meal.g.dart index e1662cac..5536ed92 100644 --- a/lib/features/diary/models/meal.g.dart +++ b/lib/features/diary/models/meal.g.dart @@ -12,11 +12,16 @@ _$MealImpl _$$MealImplFromJson(Map json) => _$MealImpl( type: (json['type'] as num).toInt(), satiety: (json['satiety'] as num).toInt(), mood: (json['mood'] as num).toInt(), - portions: (json['portions'] as List).map((e) => Portion.fromJson(e as Map)).toList(), - photos: (json['photos'] as List).map((e) => Photo.fromJson(e as Map)).toList(), + portions: (json['portions'] as List) + .map((e) => Portion.fromJson(e as Map)) + .toList(), + photos: (json['photos'] as List) + .map((e) => Photo.fromJson(e as Map)) + .toList(), ); -Map _$$MealImplToJson(_$MealImpl instance) => { +Map _$$MealImplToJson(_$MealImpl instance) => + { 'id': instance.id, 'time': instance.time, 'type': instance.type, diff --git a/lib/features/diary/models/photo.freezed.dart b/lib/features/diary/models/photo.freezed.dart index ff812349..8f5e0152 100644 --- a/lib/features/diary/models/photo.freezed.dart +++ b/lib/features/diary/models/photo.freezed.dart @@ -21,10 +21,8 @@ Photo _$PhotoFromJson(Map json) { /// @nodoc mixin _$Photo { int get id => throw _privateConstructorUsedError; - @JsonKey(name: 'original_name') String get originalName => throw _privateConstructorUsedError; - String get path => throw _privateConstructorUsedError; /// Serializes this Photo to a JSON map. @@ -38,19 +36,22 @@ mixin _$Photo { /// @nodoc abstract class $PhotoCopyWith<$Res> { - factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) = _$PhotoCopyWithImpl<$Res, Photo>; - + factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) = + _$PhotoCopyWithImpl<$Res, Photo>; @useResult - $Res call({int id, @JsonKey(name: 'original_name') String originalName, String path}); + $Res call( + {int id, + @JsonKey(name: 'original_name') String originalName, + String path}); } /// @nodoc -class _$PhotoCopyWithImpl<$Res, $Val extends Photo> implements $PhotoCopyWith<$Res> { +class _$PhotoCopyWithImpl<$Res, $Val extends Photo> + implements $PhotoCopyWith<$Res> { _$PhotoCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -82,16 +83,24 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo> implements $PhotoCopyWith<$R /// @nodoc abstract class _$$PhotoImplCopyWith<$Res> implements $PhotoCopyWith<$Res> { - factory _$$PhotoImplCopyWith(_$PhotoImpl value, $Res Function(_$PhotoImpl) then) = __$$PhotoImplCopyWithImpl<$Res>; - + factory _$$PhotoImplCopyWith( + _$PhotoImpl value, $Res Function(_$PhotoImpl) then) = + __$$PhotoImplCopyWithImpl<$Res>; @override @useResult - $Res call({int id, @JsonKey(name: 'original_name') String originalName, String path}); + $Res call( + {int id, + @JsonKey(name: 'original_name') String originalName, + String path}); } /// @nodoc -class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl> implements _$$PhotoImplCopyWith<$Res> { - __$$PhotoImplCopyWithImpl(_$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) : super(_value, _then); +class __$$PhotoImplCopyWithImpl<$Res> + extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl> + implements _$$PhotoImplCopyWith<$Res> { + __$$PhotoImplCopyWithImpl( + _$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) + : super(_value, _then); /// Create a copy of Photo /// with the given fields replaced by the non-null parameter values. @@ -122,9 +131,13 @@ class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoI /// @nodoc @JsonSerializable() class _$PhotoImpl implements _Photo { - const _$PhotoImpl({required this.id, @JsonKey(name: 'original_name') required this.originalName, required this.path}); + const _$PhotoImpl( + {required this.id, + @JsonKey(name: 'original_name') required this.originalName, + required this.path}); - factory _$PhotoImpl.fromJson(Map json) => _$$PhotoImplFromJson(json); + factory _$PhotoImpl.fromJson(Map json) => + _$$PhotoImplFromJson(json); @override final int id; @@ -145,7 +158,8 @@ class _$PhotoImpl implements _Photo { (other.runtimeType == runtimeType && other is _$PhotoImpl && (identical(other.id, id) || other.id == id) && - (identical(other.originalName, originalName) || other.originalName == originalName) && + (identical(other.originalName, originalName) || + other.originalName == originalName) && (identical(other.path, path) || other.path == path)); } @@ -158,7 +172,8 @@ class _$PhotoImpl implements _Photo { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => __$$PhotoImplCopyWithImpl<_$PhotoImpl>(this, _$identity); + _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => + __$$PhotoImplCopyWithImpl<_$PhotoImpl>(this, _$identity); @override Map toJson() { @@ -169,17 +184,18 @@ class _$PhotoImpl implements _Photo { } abstract class _Photo implements Photo { - const factory _Photo({required final int id, @JsonKey(name: 'original_name') required final String originalName, required final String path}) = _$PhotoImpl; + const factory _Photo( + {required final int id, + @JsonKey(name: 'original_name') required final String originalName, + required final String path}) = _$PhotoImpl; factory _Photo.fromJson(Map json) = _$PhotoImpl.fromJson; @override int get id; - @override @JsonKey(name: 'original_name') String get originalName; - @override String get path; @@ -187,5 +203,6 @@ abstract class _Photo implements Photo { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => throw _privateConstructorUsedError; + _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/photo.g.dart b/lib/features/diary/models/photo.g.dart index 1efd15ed..cacf65ac 100644 --- a/lib/features/diary/models/photo.g.dart +++ b/lib/features/diary/models/photo.g.dart @@ -12,7 +12,8 @@ _$PhotoImpl _$$PhotoImplFromJson(Map json) => _$PhotoImpl( path: json['path'] as String, ); -Map _$$PhotoImplToJson(_$PhotoImpl instance) => { +Map _$$PhotoImplToJson(_$PhotoImpl instance) => + { 'id': instance.id, 'original_name': instance.originalName, 'path': instance.path, diff --git a/lib/features/diary/models/portion.freezed.dart b/lib/features/diary/models/portion.freezed.dart index 4aeb9936..4bef02d4 100644 --- a/lib/features/diary/models/portion.freezed.dart +++ b/lib/features/diary/models/portion.freezed.dart @@ -21,13 +21,9 @@ Portion _$PortionFromJson(Map json) { /// @nodoc mixin _$Portion { int get id => throw _privateConstructorUsedError; - String get product_name => throw _privateConstructorUsedError; - int get quantity => throw _privateConstructorUsedError; - String get portion => throw _privateConstructorUsedError; - bool get from_diet => throw _privateConstructorUsedError; /// Serializes this Portion to a JSON map. @@ -41,19 +37,24 @@ mixin _$Portion { /// @nodoc abstract class $PortionCopyWith<$Res> { - factory $PortionCopyWith(Portion value, $Res Function(Portion) then) = _$PortionCopyWithImpl<$Res, Portion>; - + factory $PortionCopyWith(Portion value, $Res Function(Portion) then) = + _$PortionCopyWithImpl<$Res, Portion>; @useResult - $Res call({int id, String product_name, int quantity, String portion, bool from_diet}); + $Res call( + {int id, + String product_name, + int quantity, + String portion, + bool from_diet}); } /// @nodoc -class _$PortionCopyWithImpl<$Res, $Val extends Portion> implements $PortionCopyWith<$Res> { +class _$PortionCopyWithImpl<$Res, $Val extends Portion> + implements $PortionCopyWith<$Res> { _$PortionCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -95,16 +96,26 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion> implements $PortionCopyW /// @nodoc abstract class _$$PortionImplCopyWith<$Res> implements $PortionCopyWith<$Res> { - factory _$$PortionImplCopyWith(_$PortionImpl value, $Res Function(_$PortionImpl) then) = __$$PortionImplCopyWithImpl<$Res>; - + factory _$$PortionImplCopyWith( + _$PortionImpl value, $Res Function(_$PortionImpl) then) = + __$$PortionImplCopyWithImpl<$Res>; @override @useResult - $Res call({int id, String product_name, int quantity, String portion, bool from_diet}); + $Res call( + {int id, + String product_name, + int quantity, + String portion, + bool from_diet}); } /// @nodoc -class __$$PortionImplCopyWithImpl<$Res> extends _$PortionCopyWithImpl<$Res, _$PortionImpl> implements _$$PortionImplCopyWith<$Res> { - __$$PortionImplCopyWithImpl(_$PortionImpl _value, $Res Function(_$PortionImpl) _then) : super(_value, _then); +class __$$PortionImplCopyWithImpl<$Res> + extends _$PortionCopyWithImpl<$Res, _$PortionImpl> + implements _$$PortionImplCopyWith<$Res> { + __$$PortionImplCopyWithImpl( + _$PortionImpl _value, $Res Function(_$PortionImpl) _then) + : super(_value, _then); /// Create a copy of Portion /// with the given fields replaced by the non-null parameter values. @@ -145,9 +156,15 @@ class __$$PortionImplCopyWithImpl<$Res> extends _$PortionCopyWithImpl<$Res, _$Po /// @nodoc @JsonSerializable() class _$PortionImpl implements _Portion { - const _$PortionImpl({required this.id, required this.product_name, required this.quantity, required this.portion, required this.from_diet}); + const _$PortionImpl( + {required this.id, + required this.product_name, + required this.quantity, + required this.portion, + required this.from_diet}); - factory _$PortionImpl.fromJson(Map json) => _$$PortionImplFromJson(json); + factory _$PortionImpl.fromJson(Map json) => + _$$PortionImplFromJson(json); @override final int id; @@ -171,22 +188,27 @@ class _$PortionImpl implements _Portion { (other.runtimeType == runtimeType && other is _$PortionImpl && (identical(other.id, id) || other.id == id) && - (identical(other.product_name, product_name) || other.product_name == product_name) && - (identical(other.quantity, quantity) || other.quantity == quantity) && + (identical(other.product_name, product_name) || + other.product_name == product_name) && + (identical(other.quantity, quantity) || + other.quantity == quantity) && (identical(other.portion, portion) || other.portion == portion) && - (identical(other.from_diet, from_diet) || other.from_diet == from_diet)); + (identical(other.from_diet, from_diet) || + other.from_diet == from_diet)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, product_name, quantity, portion, from_diet); + int get hashCode => + Object.hash(runtimeType, id, product_name, quantity, portion, from_diet); /// Create a copy of Portion /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PortionImplCopyWith<_$PortionImpl> get copyWith => __$$PortionImplCopyWithImpl<_$PortionImpl>(this, _$identity); + _$$PortionImplCopyWith<_$PortionImpl> get copyWith => + __$$PortionImplCopyWithImpl<_$PortionImpl>(this, _$identity); @override Map toJson() { @@ -208,16 +230,12 @@ abstract class _Portion implements Portion { @override int get id; - @override String get product_name; - @override int get quantity; - @override String get portion; - @override bool get from_diet; @@ -225,5 +243,6 @@ abstract class _Portion implements Portion { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PortionImplCopyWith<_$PortionImpl> get copyWith => throw _privateConstructorUsedError; + _$$PortionImplCopyWith<_$PortionImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/portion.g.dart b/lib/features/diary/models/portion.g.dart index 2a464133..f3503e5c 100644 --- a/lib/features/diary/models/portion.g.dart +++ b/lib/features/diary/models/portion.g.dart @@ -6,7 +6,8 @@ part of 'portion.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PortionImpl _$$PortionImplFromJson(Map json) => _$PortionImpl( +_$PortionImpl _$$PortionImplFromJson(Map json) => + _$PortionImpl( id: (json['id'] as num).toInt(), product_name: json['product_name'] as String, quantity: (json['quantity'] as num).toInt(), @@ -14,7 +15,8 @@ _$PortionImpl _$$PortionImplFromJson(Map json) => _$PortionImpl from_diet: json['from_diet'] as bool, ); -Map _$$PortionImplToJson(_$PortionImpl instance) => { +Map _$$PortionImplToJson(_$PortionImpl instance) => + { 'id': instance.id, 'product_name': instance.product_name, 'quantity': instance.quantity, diff --git a/lib/features/diary/models/product.freezed.dart b/lib/features/diary/models/product.freezed.dart index 4911e89e..610656fb 100644 --- a/lib/features/diary/models/product.freezed.dart +++ b/lib/features/diary/models/product.freezed.dart @@ -21,7 +21,6 @@ Product _$ProductFromJson(Map json) { /// @nodoc mixin _$Product { int get id => throw _privateConstructorUsedError; - String get name => throw _privateConstructorUsedError; /// Serializes this Product to a JSON map. @@ -35,19 +34,19 @@ mixin _$Product { /// @nodoc abstract class $ProductCopyWith<$Res> { - factory $ProductCopyWith(Product value, $Res Function(Product) then) = _$ProductCopyWithImpl<$Res, Product>; - + factory $ProductCopyWith(Product value, $Res Function(Product) then) = + _$ProductCopyWithImpl<$Res, Product>; @useResult $Res call({int id, String name}); } /// @nodoc -class _$ProductCopyWithImpl<$Res, $Val extends Product> implements $ProductCopyWith<$Res> { +class _$ProductCopyWithImpl<$Res, $Val extends Product> + implements $ProductCopyWith<$Res> { _$ProductCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -74,16 +73,21 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product> implements $ProductCopyW /// @nodoc abstract class _$$ProductImplCopyWith<$Res> implements $ProductCopyWith<$Res> { - factory _$$ProductImplCopyWith(_$ProductImpl value, $Res Function(_$ProductImpl) then) = __$$ProductImplCopyWithImpl<$Res>; - + factory _$$ProductImplCopyWith( + _$ProductImpl value, $Res Function(_$ProductImpl) then) = + __$$ProductImplCopyWithImpl<$Res>; @override @useResult $Res call({int id, String name}); } /// @nodoc -class __$$ProductImplCopyWithImpl<$Res> extends _$ProductCopyWithImpl<$Res, _$ProductImpl> implements _$$ProductImplCopyWith<$Res> { - __$$ProductImplCopyWithImpl(_$ProductImpl _value, $Res Function(_$ProductImpl) _then) : super(_value, _then); +class __$$ProductImplCopyWithImpl<$Res> + extends _$ProductCopyWithImpl<$Res, _$ProductImpl> + implements _$$ProductImplCopyWith<$Res> { + __$$ProductImplCopyWithImpl( + _$ProductImpl _value, $Res Function(_$ProductImpl) _then) + : super(_value, _then); /// Create a copy of Product /// with the given fields replaced by the non-null parameter values. @@ -111,7 +115,8 @@ class __$$ProductImplCopyWithImpl<$Res> extends _$ProductCopyWithImpl<$Res, _$Pr class _$ProductImpl implements _Product { const _$ProductImpl({required this.id, required this.name}); - factory _$ProductImpl.fromJson(Map json) => _$$ProductImplFromJson(json); + factory _$ProductImpl.fromJson(Map json) => + _$$ProductImplFromJson(json); @override final int id; @@ -141,7 +146,8 @@ class _$ProductImpl implements _Product { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProductImplCopyWith<_$ProductImpl> get copyWith => __$$ProductImplCopyWithImpl<_$ProductImpl>(this, _$identity); + _$$ProductImplCopyWith<_$ProductImpl> get copyWith => + __$$ProductImplCopyWithImpl<_$ProductImpl>(this, _$identity); @override Map toJson() { @@ -152,13 +158,13 @@ class _$ProductImpl implements _Product { } abstract class _Product implements Product { - const factory _Product({required final int id, required final String name}) = _$ProductImpl; + const factory _Product({required final int id, required final String name}) = + _$ProductImpl; factory _Product.fromJson(Map json) = _$ProductImpl.fromJson; @override int get id; - @override String get name; @@ -166,5 +172,6 @@ abstract class _Product implements Product { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProductImplCopyWith<_$ProductImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProductImplCopyWith<_$ProductImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/product.g.dart b/lib/features/diary/models/product.g.dart index d7e1ddd9..74331101 100644 --- a/lib/features/diary/models/product.g.dart +++ b/lib/features/diary/models/product.g.dart @@ -6,12 +6,14 @@ part of 'product.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ProductImpl _$$ProductImplFromJson(Map json) => _$ProductImpl( +_$ProductImpl _$$ProductImplFromJson(Map json) => + _$ProductImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, ); -Map _$$ProductImplToJson(_$ProductImpl instance) => { +Map _$$ProductImplToJson(_$ProductImpl instance) => + { 'id': instance.id, 'name': instance.name, }; diff --git a/lib/features/diary/models/state.freezed.dart b/lib/features/diary/models/state.freezed.dart index e20b37b4..6b9c50fb 100644 --- a/lib/features/diary/models/state.freezed.dart +++ b/lib/features/diary/models/state.freezed.dart @@ -21,7 +21,6 @@ State _$StateFromJson(Map json) { /// @nodoc mixin _$State { bool get has_chosen_diet => throw _privateConstructorUsedError; - bool get has_chosen_plan => throw _privateConstructorUsedError; /// Serializes this State to a JSON map. @@ -35,19 +34,19 @@ mixin _$State { /// @nodoc abstract class $StateCopyWith<$Res> { - factory $StateCopyWith(State value, $Res Function(State) then) = _$StateCopyWithImpl<$Res, State>; - + factory $StateCopyWith(State value, $Res Function(State) then) = + _$StateCopyWithImpl<$Res, State>; @useResult $Res call({bool has_chosen_diet, bool has_chosen_plan}); } /// @nodoc -class _$StateCopyWithImpl<$Res, $Val extends State> implements $StateCopyWith<$Res> { +class _$StateCopyWithImpl<$Res, $Val extends State> + implements $StateCopyWith<$Res> { _$StateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -74,16 +73,21 @@ class _$StateCopyWithImpl<$Res, $Val extends State> implements $StateCopyWith<$R /// @nodoc abstract class _$$StateImplCopyWith<$Res> implements $StateCopyWith<$Res> { - factory _$$StateImplCopyWith(_$StateImpl value, $Res Function(_$StateImpl) then) = __$$StateImplCopyWithImpl<$Res>; - + factory _$$StateImplCopyWith( + _$StateImpl value, $Res Function(_$StateImpl) then) = + __$$StateImplCopyWithImpl<$Res>; @override @useResult $Res call({bool has_chosen_diet, bool has_chosen_plan}); } /// @nodoc -class __$$StateImplCopyWithImpl<$Res> extends _$StateCopyWithImpl<$Res, _$StateImpl> implements _$$StateImplCopyWith<$Res> { - __$$StateImplCopyWithImpl(_$StateImpl _value, $Res Function(_$StateImpl) _then) : super(_value, _then); +class __$$StateImplCopyWithImpl<$Res> + extends _$StateCopyWithImpl<$Res, _$StateImpl> + implements _$$StateImplCopyWith<$Res> { + __$$StateImplCopyWithImpl( + _$StateImpl _value, $Res Function(_$StateImpl) _then) + : super(_value, _then); /// Create a copy of State /// with the given fields replaced by the non-null parameter values. @@ -109,9 +113,11 @@ class __$$StateImplCopyWithImpl<$Res> extends _$StateCopyWithImpl<$Res, _$StateI /// @nodoc @JsonSerializable() class _$StateImpl implements _State { - const _$StateImpl({required this.has_chosen_diet, required this.has_chosen_plan}); + const _$StateImpl( + {required this.has_chosen_diet, required this.has_chosen_plan}); - factory _$StateImpl.fromJson(Map json) => _$$StateImplFromJson(json); + factory _$StateImpl.fromJson(Map json) => + _$$StateImplFromJson(json); @override final bool has_chosen_diet; @@ -128,20 +134,24 @@ class _$StateImpl implements _State { return identical(this, other) || (other.runtimeType == runtimeType && other is _$StateImpl && - (identical(other.has_chosen_diet, has_chosen_diet) || other.has_chosen_diet == has_chosen_diet) && - (identical(other.has_chosen_plan, has_chosen_plan) || other.has_chosen_plan == has_chosen_plan)); + (identical(other.has_chosen_diet, has_chosen_diet) || + other.has_chosen_diet == has_chosen_diet) && + (identical(other.has_chosen_plan, has_chosen_plan) || + other.has_chosen_plan == has_chosen_plan)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, has_chosen_diet, has_chosen_plan); + int get hashCode => + Object.hash(runtimeType, has_chosen_diet, has_chosen_plan); /// Create a copy of State /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$StateImplCopyWith<_$StateImpl> get copyWith => __$$StateImplCopyWithImpl<_$StateImpl>(this, _$identity); + _$$StateImplCopyWith<_$StateImpl> get copyWith => + __$$StateImplCopyWithImpl<_$StateImpl>(this, _$identity); @override Map toJson() { @@ -152,13 +162,14 @@ class _$StateImpl implements _State { } abstract class _State implements State { - const factory _State({required final bool has_chosen_diet, required final bool has_chosen_plan}) = _$StateImpl; + const factory _State( + {required final bool has_chosen_diet, + required final bool has_chosen_plan}) = _$StateImpl; factory _State.fromJson(Map json) = _$StateImpl.fromJson; @override bool get has_chosen_diet; - @override bool get has_chosen_plan; @@ -166,5 +177,6 @@ abstract class _State implements State { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$StateImplCopyWith<_$StateImpl> get copyWith => throw _privateConstructorUsedError; + _$$StateImplCopyWith<_$StateImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/state.g.dart b/lib/features/diary/models/state.g.dart index 574604e3..1b0da8f4 100644 --- a/lib/features/diary/models/state.g.dart +++ b/lib/features/diary/models/state.g.dart @@ -11,7 +11,8 @@ _$StateImpl _$$StateImplFromJson(Map json) => _$StateImpl( has_chosen_plan: json['has_chosen_plan'] as bool, ); -Map _$$StateImplToJson(_$StateImpl instance) => { +Map _$$StateImplToJson(_$StateImpl instance) => + { 'has_chosen_diet': instance.has_chosen_diet, 'has_chosen_plan': instance.has_chosen_plan, }; diff --git a/lib/features/diary/presentation/bloc/diary_state.freezed.dart b/lib/features/diary/presentation/bloc/diary_state.freezed.dart index 881f2e9d..98d7019f 100644 --- a/lib/features/diary/presentation/bloc/diary_state.freezed.dart +++ b/lib/features/diary/presentation/bloc/diary_state.freezed.dart @@ -54,7 +54,6 @@ mixin _$DiaryState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -161,16 +160,18 @@ mixin _$DiaryState { /// @nodoc abstract class $DiaryStateCopyWith<$Res> { - factory $DiaryStateCopyWith(DiaryState value, $Res Function(DiaryState) then) = _$DiaryStateCopyWithImpl<$Res, DiaryState>; + factory $DiaryStateCopyWith( + DiaryState value, $Res Function(DiaryState) then) = + _$DiaryStateCopyWithImpl<$Res, DiaryState>; } /// @nodoc -class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState> implements $DiaryStateCopyWith<$Res> { +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; @@ -180,12 +181,18 @@ class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState> implements $DiaryS /// @nodoc abstract class _$$DiaryStateImplCopyWith<$Res> { - factory _$$DiaryStateImplCopyWith(_$DiaryStateImpl value, $Res Function(_$DiaryStateImpl) then) = __$$DiaryStateImplCopyWithImpl<$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); +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. @@ -203,7 +210,8 @@ class _$DiaryStateImpl implements _DiaryState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$DiaryStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$DiaryStateImpl); } @override @@ -380,17 +388,20 @@ abstract class _DiaryState implements DiaryState { /// @nodoc abstract class _$$DiaryStateLoadingImplCopyWith<$Res> { - factory _$$DiaryStateLoadingImplCopyWith(_$DiaryStateLoadingImpl value, $Res Function(_$DiaryStateLoadingImpl) then) = + factory _$$DiaryStateLoadingImplCopyWith(_$DiaryStateLoadingImpl value, + $Res Function(_$DiaryStateLoadingImpl) then) = __$$DiaryStateLoadingImplCopyWithImpl<$Res>; - @useResult $Res call({int? id}); } /// @nodoc -class __$$DiaryStateLoadingImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadingImpl> +class __$$DiaryStateLoadingImplCopyWithImpl<$Res> + extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadingImpl> implements _$$DiaryStateLoadingImplCopyWith<$Res> { - __$$DiaryStateLoadingImplCopyWithImpl(_$DiaryStateLoadingImpl _value, $Res Function(_$DiaryStateLoadingImpl) _then) : super(_value, _then); + __$$DiaryStateLoadingImplCopyWithImpl(_$DiaryStateLoadingImpl _value, + $Res Function(_$DiaryStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -423,7 +434,10 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$DiaryStateLoadingImpl && (identical(other.id, id) || other.id == id)); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DiaryStateLoadingImpl && + (identical(other.id, id) || other.id == id)); } @override @@ -434,7 +448,9 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => __$$DiaryStateLoadingImplCopyWithImpl<_$DiaryStateLoadingImpl>(this, _$identity); + _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => + __$$DiaryStateLoadingImplCopyWithImpl<_$DiaryStateLoadingImpl>( + this, _$identity); @override @optionalTypeArgs @@ -609,14 +625,15 @@ abstract class DiaryStateLoading implements DiaryState { /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => throw _privateConstructorUsedError; + _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$DiaryStateLoadedImplCopyWith<$Res> { - factory _$$DiaryStateLoadedImplCopyWith(_$DiaryStateLoadedImpl value, $Res Function(_$DiaryStateLoadedImpl) then) = + factory _$$DiaryStateLoadedImplCopyWith(_$DiaryStateLoadedImpl value, + $Res Function(_$DiaryStateLoadedImpl) then) = __$$DiaryStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call( {DiaryModel diary, @@ -650,16 +667,17 @@ abstract class _$$DiaryStateLoadedImplCopyWith<$Res> { List? chartDataCounted}); $DiaryModelCopyWith<$Res> get diary; - $MealCopyWith<$Res> get currentMeal; - $SelectionPopupModelCopyWith<$Res> get portionController; } /// @nodoc -class __$$DiaryStateLoadedImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadedImpl> +class __$$DiaryStateLoadedImplCopyWithImpl<$Res> + extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadedImpl> implements _$$DiaryStateLoadedImplCopyWith<$Res> { - __$$DiaryStateLoadedImplCopyWithImpl(_$DiaryStateLoadedImpl _value, $Res Function(_$DiaryStateLoadedImpl) _then) : super(_value, _then); + __$$DiaryStateLoadedImplCopyWithImpl(_$DiaryStateLoadedImpl _value, + $Res Function(_$DiaryStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -841,7 +859,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImp @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get portionController { - return $SelectionPopupModelCopyWith<$Res>(_value.portionController, (value) { + return $SelectionPopupModelCopyWith<$Res>(_value.portionController, + (value) { return _then(_value.copyWith(portionController: value)); }); } @@ -894,25 +913,24 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { @override final String? diaryDate; final List _recommendedChartValues; - @override List get recommendedChartValues { - if (_recommendedChartValues is EqualUnmodifiableListView) return _recommendedChartValues; + if (_recommendedChartValues is EqualUnmodifiableListView) + return _recommendedChartValues; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_recommendedChartValues); } final List _consumedChartValues; - @override List get consumedChartValues { - if (_consumedChartValues is EqualUnmodifiableListView) return _consumedChartValues; + if (_consumedChartValues is EqualUnmodifiableListView) + return _consumedChartValues; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_consumedChartValues); } final List _portions; - @override List get portions { if (_portions is EqualUnmodifiableListView) return _portions; @@ -921,7 +939,6 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } final List _mealList; - @override List get mealList { if (_mealList is EqualUnmodifiableListView) return _mealList; @@ -930,7 +947,6 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } final List _portionList; - @override List get portionList { if (_portionList is EqualUnmodifiableListView) return _portionList; @@ -939,16 +955,15 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } final List _autocompleteList; - @override List get autocompleteList { - if (_autocompleteList is EqualUnmodifiableListView) return _autocompleteList; + if (_autocompleteList is EqualUnmodifiableListView) + return _autocompleteList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_autocompleteList); } final Map _chartData; - @override Map get chartData { if (_chartData is EqualUnmodifiableMapView) return _chartData; @@ -995,12 +1010,12 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { @override final bool isAdded; final List? _chartDataCounted; - @override List? get chartDataCounted { final value = _chartDataCounted; if (value == null) return null; - if (_chartDataCounted is EqualUnmodifiableListView) return _chartDataCounted; + if (_chartDataCounted is EqualUnmodifiableListView) + return _chartDataCounted; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(value); } @@ -1016,34 +1031,60 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { (other.runtimeType == runtimeType && other is _$DiaryStateLoadedImpl && (identical(other.diary, diary) || other.diary == diary) && - (identical(other.diaryDate, diaryDate) || other.diaryDate == diaryDate) && - const DeepCollectionEquality().equals(other._recommendedChartValues, _recommendedChartValues) && - const DeepCollectionEquality().equals(other._consumedChartValues, _consumedChartValues) && + (identical(other.diaryDate, diaryDate) || + other.diaryDate == diaryDate) && + const DeepCollectionEquality().equals( + other._recommendedChartValues, _recommendedChartValues) && + const DeepCollectionEquality() + .equals(other._consumedChartValues, _consumedChartValues) && const DeepCollectionEquality().equals(other._portions, _portions) && const DeepCollectionEquality().equals(other._mealList, _mealList) && - const DeepCollectionEquality().equals(other._portionList, _portionList) && - const DeepCollectionEquality().equals(other._autocompleteList, _autocompleteList) && - const DeepCollectionEquality().equals(other._chartData, _chartData) && - (identical(other.currentMeal, currentMeal) || other.currentMeal == currentMeal) && - (identical(other.portionController, portionController) || other.portionController == portionController) && - (identical(other.wakeupController, wakeupController) || other.wakeupController == wakeupController) && - (identical(other.retireController, retireController) || other.retireController == retireController) && - (identical(other.mealTimeController, mealTimeController) || other.mealTimeController == mealTimeController) && - (identical(other.commentController, commentController) || other.commentController == commentController) && - (identical(other.product_nameController, product_nameController) || other.product_nameController == product_nameController) && - (identical(other.productQuantityController, productQuantityController) || other.productQuantityController == productQuantityController) && - (identical(other.caloriesController, caloriesController) || other.caloriesController == caloriesController) && - (identical(other.fatsController, fatsController) || other.fatsController == fatsController) && - (identical(other.proteinsController, proteinsController) || other.proteinsController == proteinsController) && - (identical(other.carbsController, carbsController) || other.carbsController == carbsController) && - (identical(other.selectedMood, selectedMood) || other.selectedMood == selectedMood) && - (identical(other.selectedSatiety, selectedSatiety) || other.selectedSatiety == selectedSatiety) && - (identical(other.wakeupExpanded, wakeupExpanded) || other.wakeupExpanded == wakeupExpanded) && - (identical(other.moderationExpanded, moderationExpanded) || other.moderationExpanded == moderationExpanded) && - (identical(other.moodExpanded, moodExpanded) || other.moodExpanded == moodExpanded) && - (identical(other.isLoading, isLoading) || other.isLoading == isLoading) && + const DeepCollectionEquality() + .equals(other._portionList, _portionList) && + const DeepCollectionEquality() + .equals(other._autocompleteList, _autocompleteList) && + const DeepCollectionEquality() + .equals(other._chartData, _chartData) && + (identical(other.currentMeal, currentMeal) || + other.currentMeal == currentMeal) && + (identical(other.portionController, portionController) || + other.portionController == portionController) && + (identical(other.wakeupController, wakeupController) || + other.wakeupController == wakeupController) && + (identical(other.retireController, retireController) || + other.retireController == retireController) && + (identical(other.mealTimeController, mealTimeController) || + other.mealTimeController == mealTimeController) && + (identical(other.commentController, commentController) || + other.commentController == commentController) && + (identical(other.product_nameController, product_nameController) || + other.product_nameController == product_nameController) && + (identical(other.productQuantityController, + productQuantityController) || + other.productQuantityController == productQuantityController) && + (identical(other.caloriesController, caloriesController) || + other.caloriesController == caloriesController) && + (identical(other.fatsController, fatsController) || + other.fatsController == fatsController) && + (identical(other.proteinsController, proteinsController) || + other.proteinsController == proteinsController) && + (identical(other.carbsController, carbsController) || + other.carbsController == carbsController) && + (identical(other.selectedMood, selectedMood) || + other.selectedMood == selectedMood) && + (identical(other.selectedSatiety, selectedSatiety) || + other.selectedSatiety == selectedSatiety) && + (identical(other.wakeupExpanded, wakeupExpanded) || + other.wakeupExpanded == wakeupExpanded) && + (identical(other.moderationExpanded, moderationExpanded) || + other.moderationExpanded == moderationExpanded) && + (identical(other.moodExpanded, moodExpanded) || + other.moodExpanded == moodExpanded) && + (identical(other.isLoading, isLoading) || + other.isLoading == isLoading) && (identical(other.isAdded, isAdded) || other.isAdded == isAdded) && - const DeepCollectionEquality().equals(other._chartDataCounted, _chartDataCounted)); + const DeepCollectionEquality() + .equals(other._chartDataCounted, _chartDataCounted)); } @override @@ -1085,7 +1126,9 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => __$$DiaryStateLoadedImplCopyWithImpl<_$DiaryStateLoadedImpl>(this, _$identity); + _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => + __$$DiaryStateLoadedImplCopyWithImpl<_$DiaryStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -1372,80 +1415,58 @@ abstract class DiaryStateLoaded implements DiaryState { final List? chartDataCounted}) = _$DiaryStateLoadedImpl; DiaryModel get diary; - String? get diaryDate; - List get recommendedChartValues; - List get consumedChartValues; - List get portions; - List get mealList; - List get portionList; - List get autocompleteList; - Map get chartData; - Meal get currentMeal; - SelectionPopupModel get portionController; - TimeOfDay get wakeupController; - TimeOfDay get retireController; - TimeOfDay? get mealTimeController; - TextEditingController get commentController; - TextEditingController get product_nameController; - TextEditingController get productQuantityController; - TextEditingController get caloriesController; - TextEditingController get fatsController; - TextEditingController get proteinsController; - TextEditingController get carbsController; - int get selectedMood; - int get selectedSatiety; - bool get wakeupExpanded; - bool get moderationExpanded; - bool get moodExpanded; - bool get isLoading; - bool get isAdded; - List? get chartDataCounted; /// 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; + _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$DiaryStateErrorImplCopyWith<$Res> { - factory _$$DiaryStateErrorImplCopyWith(_$DiaryStateErrorImpl value, $Res Function(_$DiaryStateErrorImpl) then) = __$$DiaryStateErrorImplCopyWithImpl<$Res>; - + factory _$$DiaryStateErrorImplCopyWith(_$DiaryStateErrorImpl value, + $Res Function(_$DiaryStateErrorImpl) then) = + __$$DiaryStateErrorImplCopyWithImpl<$Res>; @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$DiaryStateErrorImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateErrorImpl> implements _$$DiaryStateErrorImplCopyWith<$Res> { - __$$DiaryStateErrorImplCopyWithImpl(_$DiaryStateErrorImpl _value, $Res Function(_$DiaryStateErrorImpl) _then) : super(_value, _then); +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. @@ -1481,7 +1502,8 @@ class _$DiaryStateErrorImpl implements DiaryStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DiaryStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -1492,7 +1514,9 @@ class _$DiaryStateErrorImpl implements DiaryStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => __$$DiaryStateErrorImplCopyWithImpl<_$DiaryStateErrorImpl>(this, _$identity); + _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => + __$$DiaryStateErrorImplCopyWithImpl<_$DiaryStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -1660,12 +1684,14 @@ class _$DiaryStateErrorImpl implements DiaryStateError { } abstract class DiaryStateError implements DiaryState { - const factory DiaryStateError({required final String errorMessage}) = _$DiaryStateErrorImpl; + 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; + _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/services/diary_service.g.dart b/lib/features/diary/services/diary_service.g.dart index 31336bae..8c1039c0 100644 --- a/lib/features/diary/services/diary_service.g.dart +++ b/lib/features/diary/services/diary_service.g.dart @@ -79,7 +79,8 @@ class _DiaryService implements DiaryService { final _result = await _dio.fetch>(_options); late Map _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry(k, DiaryModel.fromJson(v as Map))); + _value = _result.data!.map((k, dynamic v) => + MapEntry(k, DiaryModel.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -139,7 +140,11 @@ class _DiaryService implements DiaryService { final _result = await _dio.fetch>(_options); late Map> _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry(k, (v as List).map((i) => Product.fromJson(i as Map)).toList())); + _value = _result.data!.map((k, dynamic v) => MapEntry( + k, + (v as List) + .map((i) => Product.fromJson(i as Map)) + .toList())); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -328,7 +333,8 @@ class _DiaryService implements DiaryService { final _result = await _dio.fetch>(_options); late Map _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry(k, Portion.fromJson(v as Map))); + _value = _result.data!.map((k, dynamic v) => + MapEntry(k, Portion.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -505,7 +511,9 @@ class _DiaryService implements DiaryService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/feed/models/comment_model.freezed.dart b/lib/features/feed/models/comment_model.freezed.dart index b32da824..4e520131 100644 --- a/lib/features/feed/models/comment_model.freezed.dart +++ b/lib/features/feed/models/comment_model.freezed.dart @@ -22,10 +22,8 @@ CommentModel _$CommentModelFromJson(Map json) { mixin _$CommentModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; - @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; - @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -35,28 +33,32 @@ mixin _$CommentModel { /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $CommentModelCopyWith get copyWith => throw _privateConstructorUsedError; + $CommentModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $CommentModelCopyWith<$Res> { - factory $CommentModelCopyWith(CommentModel value, $Res Function(CommentModel) then) = _$CommentModelCopyWithImpl<$Res, CommentModel>; - + factory $CommentModelCopyWith( + CommentModel value, $Res Function(CommentModel) then) = + _$CommentModelCopyWithImpl<$Res, CommentModel>; @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; - $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> implements $CommentModelCopyWith<$Res> { +class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> + implements $CommentModelCopyWith<$Res> { _$CommentModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -107,23 +109,31 @@ class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> implements $Co } /// @nodoc -abstract class _$$CommentModelImplCopyWith<$Res> implements $CommentModelCopyWith<$Res> { - factory _$$CommentModelImplCopyWith(_$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) = __$$CommentModelImplCopyWithImpl<$Res>; - +abstract class _$$CommentModelImplCopyWith<$Res> + implements $CommentModelCopyWith<$Res> { + factory _$$CommentModelImplCopyWith( + _$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) = + __$$CommentModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; - @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$CommentModelImplCopyWithImpl<$Res> extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl> implements _$$CommentModelImplCopyWith<$Res> { - __$$CommentModelImplCopyWithImpl(_$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) : super(_value, _then); +class __$$CommentModelImplCopyWithImpl<$Res> + extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl> + implements _$$CommentModelImplCopyWith<$Res> { + __$$CommentModelImplCopyWithImpl( + _$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) + : super(_value, _then); /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @@ -155,13 +165,15 @@ class __$$CommentModelImplCopyWithImpl<$Res> extends _$CommentModelCopyWithImpl< @JsonSerializable() class _$CommentModelImpl implements _CommentModel { const _$CommentModelImpl( - {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$CommentModelImpl.fromJson(Map json) => _$$CommentModelImplFromJson(json); + factory _$CommentModelImpl.fromJson(Map json) => + _$$CommentModelImplFromJson(json); final List _data; - @override @JsonKey(name: "data") List get data { @@ -194,14 +206,16 @@ class _$CommentModelImpl implements _CommentModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity); + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => + __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity); @override Map toJson() { @@ -217,16 +231,15 @@ abstract class _CommentModel implements CommentModel { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$CommentModelImpl; - factory _CommentModel.fromJson(Map json) = _$CommentModelImpl.fromJson; + factory _CommentModel.fromJson(Map json) = + _$CommentModelImpl.fromJson; @override @JsonKey(name: "data") List get data; - @override @JsonKey(name: "links") Links get links; - @override @JsonKey(name: "meta") Meta get meta; @@ -235,7 +248,8 @@ abstract class _CommentModel implements CommentModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => + throw _privateConstructorUsedError; } Comment _$CommentFromJson(Map json) { @@ -246,19 +260,14 @@ Comment _$CommentFromJson(Map json) { mixin _$Comment { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "author_name") String get authorName => throw _privateConstructorUsedError; - @JsonKey(name: "author_profile_icon") String get authorProfileIcon => throw _privateConstructorUsedError; - @JsonKey(name: "body") String get body => throw _privateConstructorUsedError; - @JsonKey(name: "children_comments") List get childrenComments => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; @@ -273,8 +282,8 @@ mixin _$Comment { /// @nodoc abstract class $CommentCopyWith<$Res> { - factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = _$CommentCopyWithImpl<$Res, Comment>; - + factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = + _$CommentCopyWithImpl<$Res, Comment>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -286,12 +295,12 @@ abstract class $CommentCopyWith<$Res> { } /// @nodoc -class _$CommentCopyWithImpl<$Res, $Val extends Comment> implements $CommentCopyWith<$Res> { +class _$CommentCopyWithImpl<$Res, $Val extends Comment> + implements $CommentCopyWith<$Res> { _$CommentCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -338,8 +347,9 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> implements $CommentCopyW /// @nodoc abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { - factory _$$CommentImplCopyWith(_$CommentImpl value, $Res Function(_$CommentImpl) then) = __$$CommentImplCopyWithImpl<$Res>; - + factory _$$CommentImplCopyWith( + _$CommentImpl value, $Res Function(_$CommentImpl) then) = + __$$CommentImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -352,8 +362,12 @@ abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { } /// @nodoc -class __$$CommentImplCopyWithImpl<$Res> extends _$CommentCopyWithImpl<$Res, _$CommentImpl> implements _$$CommentImplCopyWith<$Res> { - __$$CommentImplCopyWithImpl(_$CommentImpl _value, $Res Function(_$CommentImpl) _then) : super(_value, _then); +class __$$CommentImplCopyWithImpl<$Res> + extends _$CommentCopyWithImpl<$Res, _$CommentImpl> + implements _$$CommentImplCopyWith<$Res> { + __$$CommentImplCopyWithImpl( + _$CommentImpl _value, $Res Function(_$CommentImpl) _then) + : super(_value, _then); /// Create a copy of Comment /// with the given fields replaced by the non-null parameter values. @@ -404,11 +418,13 @@ class _$CommentImpl implements _Comment { @JsonKey(name: "author_name") required this.authorName, @JsonKey(name: "author_profile_icon") required this.authorProfileIcon, @JsonKey(name: "body") required this.body, - @JsonKey(name: "children_comments") required final List childrenComments, + @JsonKey(name: "children_comments") + required final List childrenComments, @JsonKey(name: "created_at") required this.createdAt}) : _childrenComments = childrenComments; - factory _$CommentImpl.fromJson(Map json) => _$$CommentImplFromJson(json); + factory _$CommentImpl.fromJson(Map json) => + _$$CommentImplFromJson(json); @override @JsonKey(name: "id") @@ -423,11 +439,11 @@ class _$CommentImpl implements _Comment { @JsonKey(name: "body") final String body; final List _childrenComments; - @override @JsonKey(name: "children_comments") List get childrenComments { - if (_childrenComments is EqualUnmodifiableListView) return _childrenComments; + if (_childrenComments is EqualUnmodifiableListView) + return _childrenComments; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_childrenComments); } @@ -447,23 +463,35 @@ class _$CommentImpl implements _Comment { (other.runtimeType == runtimeType && other is _$CommentImpl && (identical(other.id, id) || other.id == id) && - (identical(other.authorName, authorName) || other.authorName == authorName) && - (identical(other.authorProfileIcon, authorProfileIcon) || other.authorProfileIcon == authorProfileIcon) && + (identical(other.authorName, authorName) || + other.authorName == authorName) && + (identical(other.authorProfileIcon, authorProfileIcon) || + other.authorProfileIcon == authorProfileIcon) && (identical(other.body, body) || other.body == body) && - const DeepCollectionEquality().equals(other._childrenComments, _childrenComments) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt)); + const DeepCollectionEquality() + .equals(other._childrenComments, _childrenComments) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, authorName, authorProfileIcon, body, const DeepCollectionEquality().hash(_childrenComments), createdAt); + int get hashCode => Object.hash( + runtimeType, + id, + authorName, + authorProfileIcon, + body, + const DeepCollectionEquality().hash(_childrenComments), + createdAt); /// Create a copy of Comment /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => + __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); @override Map toJson() { @@ -475,35 +503,33 @@ class _$CommentImpl implements _Comment { abstract class _Comment implements Comment { const factory _Comment( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "author_name") required final String authorName, - @JsonKey(name: "author_profile_icon") required final String authorProfileIcon, - @JsonKey(name: "body") required final String body, - @JsonKey(name: "children_comments") required final List childrenComments, - @JsonKey(name: "created_at") required final DateTime createdAt}) = _$CommentImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "author_name") required final String authorName, + @JsonKey(name: "author_profile_icon") + required final String authorProfileIcon, + @JsonKey(name: "body") required final String body, + @JsonKey(name: "children_comments") + required final List childrenComments, + @JsonKey(name: "created_at") required final DateTime createdAt}) = + _$CommentImpl; factory _Comment.fromJson(Map json) = _$CommentImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "author_name") String get authorName; - @override @JsonKey(name: "author_profile_icon") String get authorProfileIcon; - @override @JsonKey(name: "body") String get body; - @override @JsonKey(name: "children_comments") List get childrenComments; - @override @JsonKey(name: "created_at") DateTime get createdAt; @@ -512,5 +538,6 @@ abstract class _Comment implements Comment { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/comment_model.g.dart b/lib/features/feed/models/comment_model.g.dart index 503322f9..1410cfcc 100644 --- a/lib/features/feed/models/comment_model.g.dart +++ b/lib/features/feed/models/comment_model.g.dart @@ -6,28 +6,36 @@ part of 'comment_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CommentModelImpl _$$CommentModelImplFromJson(Map json) => _$CommentModelImpl( - data: (json['data'] as List).map((e) => Comment.fromJson(e as Map)).toList(), +_$CommentModelImpl _$$CommentModelImplFromJson(Map json) => + _$CommentModelImpl( + data: (json['data'] as List) + .map((e) => Comment.fromJson(e as Map)) + .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$CommentModelImplToJson(_$CommentModelImpl instance) => { +Map _$$CommentModelImplToJson(_$CommentModelImpl instance) => + { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$CommentImpl _$$CommentImplFromJson(Map json) => _$CommentImpl( +_$CommentImpl _$$CommentImplFromJson(Map json) => + _$CommentImpl( id: (json['id'] as num).toInt(), authorName: json['author_name'] as String, authorProfileIcon: json['author_profile_icon'] as String, body: json['body'] as String, - childrenComments: (json['children_comments'] as List).map((e) => Comment.fromJson(e as Map)).toList(), + childrenComments: (json['children_comments'] as List) + .map((e) => Comment.fromJson(e as Map)) + .toList(), createdAt: DateTime.parse(json['created_at'] as String), ); -Map _$$CommentImplToJson(_$CommentImpl instance) => { +Map _$$CommentImplToJson(_$CommentImpl instance) => + { 'id': instance.id, 'author_name': instance.authorName, 'author_profile_icon': instance.authorProfileIcon, diff --git a/lib/features/feed/models/diets_pagination_model.freezed.dart b/lib/features/feed/models/diets_pagination_model.freezed.dart index 9e81d064..15b651f3 100644 --- a/lib/features/feed/models/diets_pagination_model.freezed.dart +++ b/lib/features/feed/models/diets_pagination_model.freezed.dart @@ -22,10 +22,8 @@ DietsPagination _$DietsPaginationFromJson(Map json) { mixin _$DietsPagination { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; - @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; - @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -35,28 +33,32 @@ mixin _$DietsPagination { /// Create a copy of DietsPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DietsPaginationCopyWith get copyWith => throw _privateConstructorUsedError; + $DietsPaginationCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $DietsPaginationCopyWith<$Res> { - factory $DietsPaginationCopyWith(DietsPagination value, $Res Function(DietsPagination) then) = _$DietsPaginationCopyWithImpl<$Res, DietsPagination>; - + factory $DietsPaginationCopyWith( + DietsPagination value, $Res Function(DietsPagination) then) = + _$DietsPaginationCopyWithImpl<$Res, DietsPagination>; @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; - $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> implements $DietsPaginationCopyWith<$Res> { +class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> + implements $DietsPaginationCopyWith<$Res> { _$DietsPaginationCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -107,24 +109,31 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> implemen } /// @nodoc -abstract class _$$DietsPaginationImplCopyWith<$Res> implements $DietsPaginationCopyWith<$Res> { - factory _$$DietsPaginationImplCopyWith(_$DietsPaginationImpl value, $Res Function(_$DietsPaginationImpl) then) = __$$DietsPaginationImplCopyWithImpl<$Res>; - +abstract class _$$DietsPaginationImplCopyWith<$Res> + implements $DietsPaginationCopyWith<$Res> { + factory _$$DietsPaginationImplCopyWith(_$DietsPaginationImpl value, + $Res Function(_$DietsPaginationImpl) then) = + __$$DietsPaginationImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; - @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$DietsPaginationImplCopyWithImpl<$Res> extends _$DietsPaginationCopyWithImpl<$Res, _$DietsPaginationImpl> +class __$$DietsPaginationImplCopyWithImpl<$Res> + extends _$DietsPaginationCopyWithImpl<$Res, _$DietsPaginationImpl> implements _$$DietsPaginationImplCopyWith<$Res> { - __$$DietsPaginationImplCopyWithImpl(_$DietsPaginationImpl _value, $Res Function(_$DietsPaginationImpl) _then) : super(_value, _then); + __$$DietsPaginationImplCopyWithImpl( + _$DietsPaginationImpl _value, $Res Function(_$DietsPaginationImpl) _then) + : super(_value, _then); /// Create a copy of DietsPagination /// with the given fields replaced by the non-null parameter values. @@ -156,13 +165,15 @@ class __$$DietsPaginationImplCopyWithImpl<$Res> extends _$DietsPaginationCopyWit @JsonSerializable() class _$DietsPaginationImpl implements _DietsPagination { const _$DietsPaginationImpl( - {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$DietsPaginationImpl.fromJson(Map json) => _$$DietsPaginationImplFromJson(json); + factory _$DietsPaginationImpl.fromJson(Map json) => + _$$DietsPaginationImplFromJson(json); final List _data; - @override @JsonKey(name: "data") List get data { @@ -195,14 +206,17 @@ class _$DietsPaginationImpl implements _DietsPagination { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of DietsPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => __$$DietsPaginationImplCopyWithImpl<_$DietsPaginationImpl>(this, _$identity); + _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => + __$$DietsPaginationImplCopyWithImpl<_$DietsPaginationImpl>( + this, _$identity); @override Map toJson() { @@ -218,16 +232,15 @@ abstract class _DietsPagination implements DietsPagination { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$DietsPaginationImpl; - factory _DietsPagination.fromJson(Map json) = _$DietsPaginationImpl.fromJson; + factory _DietsPagination.fromJson(Map json) = + _$DietsPaginationImpl.fromJson; @override @JsonKey(name: "data") List get data; - @override @JsonKey(name: "links") Links get links; - @override @JsonKey(name: "meta") Meta get meta; @@ -236,7 +249,8 @@ abstract class _DietsPagination implements DietsPagination { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => throw _privateConstructorUsedError; + _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => + throw _privateConstructorUsedError; } Diet _$DietFromJson(Map json) { @@ -247,37 +261,27 @@ Diet _$DietFromJson(Map json) { mixin _$Diet { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "image") String get image => throw _privateConstructorUsedError; - @JsonKey(name: "duration") int get duration => throw _privateConstructorUsedError; - @JsonKey(name: "state") String get state => throw _privateConstructorUsedError; - @JsonKey(name: "type") DietType get type => throw _privateConstructorUsedError; - @JsonKey(name: "details") String get details => throw _privateConstructorUsedError; - @JsonKey(name: "daily_schedule") - List>> get dailySchedule => throw _privateConstructorUsedError; - + List>> get dailySchedule => + throw _privateConstructorUsedError; @JsonKey(name: "author") Author get author => throw _privateConstructorUsedError; - @JsonKey(name: "total_likes") int get totalLikes => throw _privateConstructorUsedError; - @JsonKey(name: "total_views") int get totalViews => throw _privateConstructorUsedError; - @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; @@ -292,8 +296,8 @@ mixin _$Diet { /// @nodoc abstract class $DietCopyWith<$Res> { - factory $DietCopyWith(Diet value, $Res Function(Diet) then) = _$DietCopyWithImpl<$Res, Diet>; - + factory $DietCopyWith(Diet value, $Res Function(Diet) then) = + _$DietCopyWithImpl<$Res, Diet>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -303,24 +307,24 @@ abstract class $DietCopyWith<$Res> { @JsonKey(name: "state") String state, @JsonKey(name: "type") DietType type, @JsonKey(name: "details") String details, - @JsonKey(name: "daily_schedule") List>> dailySchedule, + @JsonKey(name: "daily_schedule") + List>> dailySchedule, @JsonKey(name: "author") Author author, @JsonKey(name: "total_likes") int totalLikes, @JsonKey(name: "total_views") int totalViews, @JsonKey(name: "total_comments") int totalComments}); $DietTypeCopyWith<$Res> get type; - $AuthorCopyWith<$Res> get author; } /// @nodoc -class _$DietCopyWithImpl<$Res, $Val extends Diet> implements $DietCopyWith<$Res> { +class _$DietCopyWithImpl<$Res, $Val extends Diet> + implements $DietCopyWith<$Res> { _$DietCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -417,8 +421,9 @@ class _$DietCopyWithImpl<$Res, $Val extends Diet> implements $DietCopyWith<$Res> /// @nodoc abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> { - factory _$$DietImplCopyWith(_$DietImpl value, $Res Function(_$DietImpl) then) = __$$DietImplCopyWithImpl<$Res>; - + factory _$$DietImplCopyWith( + _$DietImpl value, $Res Function(_$DietImpl) then) = + __$$DietImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -429,7 +434,8 @@ abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> { @JsonKey(name: "state") String state, @JsonKey(name: "type") DietType type, @JsonKey(name: "details") String details, - @JsonKey(name: "daily_schedule") List>> dailySchedule, + @JsonKey(name: "daily_schedule") + List>> dailySchedule, @JsonKey(name: "author") Author author, @JsonKey(name: "total_likes") int totalLikes, @JsonKey(name: "total_views") int totalViews, @@ -437,14 +443,16 @@ abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> { @override $DietTypeCopyWith<$Res> get type; - @override $AuthorCopyWith<$Res> get author; } /// @nodoc -class __$$DietImplCopyWithImpl<$Res> extends _$DietCopyWithImpl<$Res, _$DietImpl> implements _$$DietImplCopyWith<$Res> { - __$$DietImplCopyWithImpl(_$DietImpl _value, $Res Function(_$DietImpl) _then) : super(_value, _then); +class __$$DietImplCopyWithImpl<$Res> + extends _$DietCopyWithImpl<$Res, _$DietImpl> + implements _$$DietImplCopyWith<$Res> { + __$$DietImplCopyWithImpl(_$DietImpl _value, $Res Function(_$DietImpl) _then) + : super(_value, _then); /// Create a copy of Diet /// with the given fields replaced by the non-null parameter values. @@ -528,14 +536,16 @@ class _$DietImpl implements _Diet { @JsonKey(name: "state") required this.state, @JsonKey(name: "type") required this.type, @JsonKey(name: "details") required this.details, - @JsonKey(name: "daily_schedule") required final List>> dailySchedule, + @JsonKey(name: "daily_schedule") + required final List>> dailySchedule, @JsonKey(name: "author") required this.author, @JsonKey(name: "total_likes") required this.totalLikes, @JsonKey(name: "total_views") required this.totalViews, @JsonKey(name: "total_comments") required this.totalComments}) : _dailySchedule = dailySchedule; - factory _$DietImpl.fromJson(Map json) => _$$DietImplFromJson(json); + factory _$DietImpl.fromJson(Map json) => + _$$DietImplFromJson(json); @override @JsonKey(name: "id") @@ -559,7 +569,6 @@ class _$DietImpl implements _Diet { @JsonKey(name: "details") final String details; final List>> _dailySchedule; - @override @JsonKey(name: "daily_schedule") List>> get dailySchedule { @@ -594,28 +603,46 @@ class _$DietImpl implements _Diet { (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.image, image) || other.image == image) && - (identical(other.duration, duration) || other.duration == duration) && + (identical(other.duration, duration) || + other.duration == duration) && (identical(other.state, state) || other.state == state) && (identical(other.type, type) || other.type == type) && (identical(other.details, details) || other.details == details) && - const DeepCollectionEquality().equals(other._dailySchedule, _dailySchedule) && + const DeepCollectionEquality() + .equals(other._dailySchedule, _dailySchedule) && (identical(other.author, author) || other.author == author) && - (identical(other.totalLikes, totalLikes) || other.totalLikes == totalLikes) && - (identical(other.totalViews, totalViews) || other.totalViews == totalViews) && - (identical(other.totalComments, totalComments) || other.totalComments == totalComments)); + (identical(other.totalLikes, totalLikes) || + other.totalLikes == totalLikes) && + (identical(other.totalViews, totalViews) || + other.totalViews == totalViews) && + (identical(other.totalComments, totalComments) || + other.totalComments == totalComments)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, image, duration, state, type, details, const DeepCollectionEquality().hash(_dailySchedule), author, - totalLikes, totalViews, totalComments); + int get hashCode => Object.hash( + runtimeType, + id, + name, + image, + duration, + state, + type, + details, + const DeepCollectionEquality().hash(_dailySchedule), + author, + totalLikes, + totalViews, + totalComments); /// Create a copy of Diet /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietImplCopyWith<_$DietImpl> get copyWith => __$$DietImplCopyWithImpl<_$DietImpl>(this, _$identity); + _$$DietImplCopyWith<_$DietImpl> get copyWith => + __$$DietImplCopyWithImpl<_$DietImpl>(this, _$identity); @override Map toJson() { @@ -627,65 +654,56 @@ class _$DietImpl implements _Diet { abstract class _Diet implements Diet { const factory _Diet( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "image") required final String image, - @JsonKey(name: "duration") required final int duration, - @JsonKey(name: "state") required final String state, - @JsonKey(name: "type") required final DietType type, - @JsonKey(name: "details") required final String details, - @JsonKey(name: "daily_schedule") required final List>> dailySchedule, - @JsonKey(name: "author") required final Author author, - @JsonKey(name: "total_likes") required final int totalLikes, - @JsonKey(name: "total_views") required final int totalViews, - @JsonKey(name: "total_comments") required final int totalComments}) = _$DietImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "image") required final String image, + @JsonKey(name: "duration") required final int duration, + @JsonKey(name: "state") required final String state, + @JsonKey(name: "type") required final DietType type, + @JsonKey(name: "details") required final String details, + @JsonKey(name: "daily_schedule") + required final List>> dailySchedule, + @JsonKey(name: "author") required final Author author, + @JsonKey(name: "total_likes") required final int totalLikes, + @JsonKey(name: "total_views") required final int totalViews, + @JsonKey(name: "total_comments") required final int totalComments}) = + _$DietImpl; factory _Diet.fromJson(Map json) = _$DietImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "image") String get image; - @override @JsonKey(name: "duration") int get duration; - @override @JsonKey(name: "state") String get state; - @override @JsonKey(name: "type") DietType get type; - @override @JsonKey(name: "details") String get details; - @override @JsonKey(name: "daily_schedule") List>> get dailySchedule; - @override @JsonKey(name: "author") Author get author; - @override @JsonKey(name: "total_likes") int get totalLikes; - @override @JsonKey(name: "total_views") int get totalViews; - @override @JsonKey(name: "total_comments") int get totalComments; @@ -694,7 +712,8 @@ abstract class _Diet implements Diet { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietImplCopyWith<_$DietImpl> get copyWith => throw _privateConstructorUsedError; + _$$DietImplCopyWith<_$DietImpl> get copyWith => + throw _privateConstructorUsedError; } Author _$AuthorFromJson(Map json) { @@ -705,13 +724,10 @@ Author _$AuthorFromJson(Map json) { mixin _$Author { @JsonKey(name: "author_slug") String get authorSlug => throw _privateConstructorUsedError; - @JsonKey(name: "author_name") String get authorName => throw _privateConstructorUsedError; - @JsonKey(name: "author_profile_icon") String get authorProfileIcon => throw _privateConstructorUsedError; - @JsonKey(name: "author_is_me") bool get authorIsMe => throw _privateConstructorUsedError; @@ -726,8 +742,8 @@ mixin _$Author { /// @nodoc abstract class $AuthorCopyWith<$Res> { - factory $AuthorCopyWith(Author value, $Res Function(Author) then) = _$AuthorCopyWithImpl<$Res, Author>; - + factory $AuthorCopyWith(Author value, $Res Function(Author) then) = + _$AuthorCopyWithImpl<$Res, Author>; @useResult $Res call( {@JsonKey(name: "author_slug") String authorSlug, @@ -737,12 +753,12 @@ abstract class $AuthorCopyWith<$Res> { } /// @nodoc -class _$AuthorCopyWithImpl<$Res, $Val extends Author> implements $AuthorCopyWith<$Res> { +class _$AuthorCopyWithImpl<$Res, $Val extends Author> + implements $AuthorCopyWith<$Res> { _$AuthorCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -779,8 +795,9 @@ class _$AuthorCopyWithImpl<$Res, $Val extends Author> implements $AuthorCopyWith /// @nodoc abstract class _$$AuthorImplCopyWith<$Res> implements $AuthorCopyWith<$Res> { - factory _$$AuthorImplCopyWith(_$AuthorImpl value, $Res Function(_$AuthorImpl) then) = __$$AuthorImplCopyWithImpl<$Res>; - + factory _$$AuthorImplCopyWith( + _$AuthorImpl value, $Res Function(_$AuthorImpl) then) = + __$$AuthorImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -791,8 +808,12 @@ abstract class _$$AuthorImplCopyWith<$Res> implements $AuthorCopyWith<$Res> { } /// @nodoc -class __$$AuthorImplCopyWithImpl<$Res> extends _$AuthorCopyWithImpl<$Res, _$AuthorImpl> implements _$$AuthorImplCopyWith<$Res> { - __$$AuthorImplCopyWithImpl(_$AuthorImpl _value, $Res Function(_$AuthorImpl) _then) : super(_value, _then); +class __$$AuthorImplCopyWithImpl<$Res> + extends _$AuthorCopyWithImpl<$Res, _$AuthorImpl> + implements _$$AuthorImplCopyWith<$Res> { + __$$AuthorImplCopyWithImpl( + _$AuthorImpl _value, $Res Function(_$AuthorImpl) _then) + : super(_value, _then); /// Create a copy of Author /// with the given fields replaced by the non-null parameter values. @@ -834,7 +855,8 @@ class _$AuthorImpl implements _Author { @JsonKey(name: "author_profile_icon") required this.authorProfileIcon, @JsonKey(name: "author_is_me") required this.authorIsMe}); - factory _$AuthorImpl.fromJson(Map json) => _$$AuthorImplFromJson(json); + factory _$AuthorImpl.fromJson(Map json) => + _$$AuthorImplFromJson(json); @override @JsonKey(name: "author_slug") @@ -859,22 +881,28 @@ class _$AuthorImpl implements _Author { return identical(this, other) || (other.runtimeType == runtimeType && other is _$AuthorImpl && - (identical(other.authorSlug, authorSlug) || other.authorSlug == authorSlug) && - (identical(other.authorName, authorName) || other.authorName == authorName) && - (identical(other.authorProfileIcon, authorProfileIcon) || other.authorProfileIcon == authorProfileIcon) && - (identical(other.authorIsMe, authorIsMe) || other.authorIsMe == authorIsMe)); + (identical(other.authorSlug, authorSlug) || + other.authorSlug == authorSlug) && + (identical(other.authorName, authorName) || + other.authorName == authorName) && + (identical(other.authorProfileIcon, authorProfileIcon) || + other.authorProfileIcon == authorProfileIcon) && + (identical(other.authorIsMe, authorIsMe) || + other.authorIsMe == authorIsMe)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, authorSlug, authorName, authorProfileIcon, authorIsMe); + int get hashCode => Object.hash( + runtimeType, authorSlug, authorName, authorProfileIcon, authorIsMe); /// Create a copy of Author /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => __$$AuthorImplCopyWithImpl<_$AuthorImpl>(this, _$identity); + _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => + __$$AuthorImplCopyWithImpl<_$AuthorImpl>(this, _$identity); @override Map toJson() { @@ -886,25 +914,24 @@ class _$AuthorImpl implements _Author { abstract class _Author implements Author { const factory _Author( - {@JsonKey(name: "author_slug") required final String authorSlug, - @JsonKey(name: "author_name") required final String authorName, - @JsonKey(name: "author_profile_icon") required final String authorProfileIcon, - @JsonKey(name: "author_is_me") required final bool authorIsMe}) = _$AuthorImpl; + {@JsonKey(name: "author_slug") required final String authorSlug, + @JsonKey(name: "author_name") required final String authorName, + @JsonKey(name: "author_profile_icon") + required final String authorProfileIcon, + @JsonKey(name: "author_is_me") required final bool authorIsMe}) = + _$AuthorImpl; factory _Author.fromJson(Map json) = _$AuthorImpl.fromJson; @override @JsonKey(name: "author_slug") String get authorSlug; - @override @JsonKey(name: "author_name") String get authorName; - @override @JsonKey(name: "author_profile_icon") String get authorProfileIcon; - @override @JsonKey(name: "author_is_me") bool get authorIsMe; @@ -913,7 +940,8 @@ abstract class _Author implements Author { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => throw _privateConstructorUsedError; + _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => + throw _privateConstructorUsedError; } DailySchedule _$DailyScheduleFromJson(Map json) { @@ -924,13 +952,10 @@ DailySchedule _$DailyScheduleFromJson(Map json) { mixin _$DailySchedule { @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "uniq") String get uniq => throw _privateConstructorUsedError; - @JsonKey(name: "portion") Portion get portion => throw _privateConstructorUsedError; - @JsonKey(name: "quantity") int get quantity => throw _privateConstructorUsedError; @@ -940,13 +965,15 @@ mixin _$DailySchedule { /// Create a copy of DailySchedule /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DailyScheduleCopyWith get copyWith => throw _privateConstructorUsedError; + $DailyScheduleCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $DailyScheduleCopyWith<$Res> { - factory $DailyScheduleCopyWith(DailySchedule value, $Res Function(DailySchedule) then) = _$DailyScheduleCopyWithImpl<$Res, DailySchedule>; - + factory $DailyScheduleCopyWith( + DailySchedule value, $Res Function(DailySchedule) then) = + _$DailyScheduleCopyWithImpl<$Res, DailySchedule>; @useResult $Res call( {@JsonKey(name: "name") String name, @@ -956,12 +983,12 @@ abstract class $DailyScheduleCopyWith<$Res> { } /// @nodoc -class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> implements $DailyScheduleCopyWith<$Res> { +class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> + implements $DailyScheduleCopyWith<$Res> { _$DailyScheduleCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -997,9 +1024,11 @@ class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> implements $ } /// @nodoc -abstract class _$$DailyScheduleImplCopyWith<$Res> implements $DailyScheduleCopyWith<$Res> { - factory _$$DailyScheduleImplCopyWith(_$DailyScheduleImpl value, $Res Function(_$DailyScheduleImpl) then) = __$$DailyScheduleImplCopyWithImpl<$Res>; - +abstract class _$$DailyScheduleImplCopyWith<$Res> + implements $DailyScheduleCopyWith<$Res> { + factory _$$DailyScheduleImplCopyWith( + _$DailyScheduleImpl value, $Res Function(_$DailyScheduleImpl) then) = + __$$DailyScheduleImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -1010,8 +1039,12 @@ abstract class _$$DailyScheduleImplCopyWith<$Res> implements $DailyScheduleCopyW } /// @nodoc -class __$$DailyScheduleImplCopyWithImpl<$Res> extends _$DailyScheduleCopyWithImpl<$Res, _$DailyScheduleImpl> implements _$$DailyScheduleImplCopyWith<$Res> { - __$$DailyScheduleImplCopyWithImpl(_$DailyScheduleImpl _value, $Res Function(_$DailyScheduleImpl) _then) : super(_value, _then); +class __$$DailyScheduleImplCopyWithImpl<$Res> + extends _$DailyScheduleCopyWithImpl<$Res, _$DailyScheduleImpl> + implements _$$DailyScheduleImplCopyWith<$Res> { + __$$DailyScheduleImplCopyWithImpl( + _$DailyScheduleImpl _value, $Res Function(_$DailyScheduleImpl) _then) + : super(_value, _then); /// Create a copy of DailySchedule /// with the given fields replaced by the non-null parameter values. @@ -1053,7 +1086,8 @@ class _$DailyScheduleImpl implements _DailySchedule { @JsonKey(name: "portion") required this.portion, @JsonKey(name: "quantity") required this.quantity}); - factory _$DailyScheduleImpl.fromJson(Map json) => _$$DailyScheduleImplFromJson(json); + factory _$DailyScheduleImpl.fromJson(Map json) => + _$$DailyScheduleImplFromJson(json); @override @JsonKey(name: "name") @@ -1081,7 +1115,8 @@ class _$DailyScheduleImpl implements _DailySchedule { (identical(other.name, name) || other.name == name) && (identical(other.uniq, uniq) || other.uniq == uniq) && (identical(other.portion, portion) || other.portion == portion) && - (identical(other.quantity, quantity) || other.quantity == quantity)); + (identical(other.quantity, quantity) || + other.quantity == quantity)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -1093,7 +1128,8 @@ class _$DailyScheduleImpl implements _DailySchedule { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => __$$DailyScheduleImplCopyWithImpl<_$DailyScheduleImpl>(this, _$identity); + _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => + __$$DailyScheduleImplCopyWithImpl<_$DailyScheduleImpl>(this, _$identity); @override Map toJson() { @@ -1105,25 +1141,24 @@ class _$DailyScheduleImpl implements _DailySchedule { abstract class _DailySchedule implements DailySchedule { const factory _DailySchedule( - {@JsonKey(name: "name") required final String name, - @JsonKey(name: "uniq") required final String uniq, - @JsonKey(name: "portion") required final Portion portion, - @JsonKey(name: "quantity") required final int quantity}) = _$DailyScheduleImpl; + {@JsonKey(name: "name") required final String name, + @JsonKey(name: "uniq") required final String uniq, + @JsonKey(name: "portion") required final Portion portion, + @JsonKey(name: "quantity") required final int quantity}) = + _$DailyScheduleImpl; - factory _DailySchedule.fromJson(Map json) = _$DailyScheduleImpl.fromJson; + factory _DailySchedule.fromJson(Map json) = + _$DailyScheduleImpl.fromJson; @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "uniq") String get uniq; - @override @JsonKey(name: "portion") Portion get portion; - @override @JsonKey(name: "quantity") int get quantity; @@ -1132,7 +1167,8 @@ abstract class _DailySchedule implements DailySchedule { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => throw _privateConstructorUsedError; + _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => + throw _privateConstructorUsedError; } DietType _$DietTypeFromJson(Map json) { @@ -1143,13 +1179,10 @@ DietType _$DietTypeFromJson(Map json) { mixin _$DietType { @JsonKey(name: "alko") bool? get alko => throw _privateConstructorUsedError; - @JsonKey(name: "veg") bool? get veg => throw _privateConstructorUsedError; - @JsonKey(name: "corb") bool? get corb => throw _privateConstructorUsedError; - @JsonKey(name: "meat") bool? get meat => throw _privateConstructorUsedError; @@ -1159,24 +1192,29 @@ mixin _$DietType { /// Create a copy of DietType /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DietTypeCopyWith get copyWith => throw _privateConstructorUsedError; + $DietTypeCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $DietTypeCopyWith<$Res> { - factory $DietTypeCopyWith(DietType value, $Res Function(DietType) then) = _$DietTypeCopyWithImpl<$Res, DietType>; - + factory $DietTypeCopyWith(DietType value, $Res Function(DietType) then) = + _$DietTypeCopyWithImpl<$Res, DietType>; @useResult - $Res call({@JsonKey(name: "alko") bool? alko, @JsonKey(name: "veg") bool? veg, @JsonKey(name: "corb") bool? corb, @JsonKey(name: "meat") bool? meat}); + $Res call( + {@JsonKey(name: "alko") bool? alko, + @JsonKey(name: "veg") bool? veg, + @JsonKey(name: "corb") bool? corb, + @JsonKey(name: "meat") bool? meat}); } /// @nodoc -class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> implements $DietTypeCopyWith<$Res> { +class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> + implements $DietTypeCopyWith<$Res> { _$DietTypeCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -1212,17 +1250,27 @@ class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> implements $DietTypeCo } /// @nodoc -abstract class _$$DietTypeImplCopyWith<$Res> implements $DietTypeCopyWith<$Res> { - factory _$$DietTypeImplCopyWith(_$DietTypeImpl value, $Res Function(_$DietTypeImpl) then) = __$$DietTypeImplCopyWithImpl<$Res>; - +abstract class _$$DietTypeImplCopyWith<$Res> + implements $DietTypeCopyWith<$Res> { + factory _$$DietTypeImplCopyWith( + _$DietTypeImpl value, $Res Function(_$DietTypeImpl) then) = + __$$DietTypeImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "alko") bool? alko, @JsonKey(name: "veg") bool? veg, @JsonKey(name: "corb") bool? corb, @JsonKey(name: "meat") bool? meat}); + $Res call( + {@JsonKey(name: "alko") bool? alko, + @JsonKey(name: "veg") bool? veg, + @JsonKey(name: "corb") bool? corb, + @JsonKey(name: "meat") bool? meat}); } /// @nodoc -class __$$DietTypeImplCopyWithImpl<$Res> extends _$DietTypeCopyWithImpl<$Res, _$DietTypeImpl> implements _$$DietTypeImplCopyWith<$Res> { - __$$DietTypeImplCopyWithImpl(_$DietTypeImpl _value, $Res Function(_$DietTypeImpl) _then) : super(_value, _then); +class __$$DietTypeImplCopyWithImpl<$Res> + extends _$DietTypeCopyWithImpl<$Res, _$DietTypeImpl> + implements _$$DietTypeImplCopyWith<$Res> { + __$$DietTypeImplCopyWithImpl( + _$DietTypeImpl _value, $Res Function(_$DietTypeImpl) _then) + : super(_value, _then); /// Create a copy of DietType /// with the given fields replaced by the non-null parameter values. @@ -1258,9 +1306,14 @@ class __$$DietTypeImplCopyWithImpl<$Res> extends _$DietTypeCopyWithImpl<$Res, _$ /// @nodoc @JsonSerializable() class _$DietTypeImpl implements _DietType { - const _$DietTypeImpl({@JsonKey(name: "alko") this.alko, @JsonKey(name: "veg") this.veg, @JsonKey(name: "corb") this.corb, @JsonKey(name: "meat") this.meat}); + const _$DietTypeImpl( + {@JsonKey(name: "alko") this.alko, + @JsonKey(name: "veg") this.veg, + @JsonKey(name: "corb") this.corb, + @JsonKey(name: "meat") this.meat}); - factory _$DietTypeImpl.fromJson(Map json) => _$$DietTypeImplFromJson(json); + factory _$DietTypeImpl.fromJson(Map json) => + _$$DietTypeImplFromJson(json); @override @JsonKey(name: "alko") @@ -1300,7 +1353,8 @@ class _$DietTypeImpl implements _DietType { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => __$$DietTypeImplCopyWithImpl<_$DietTypeImpl>(this, _$identity); + _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => + __$$DietTypeImplCopyWithImpl<_$DietTypeImpl>(this, _$identity); @override Map toJson() { @@ -1317,20 +1371,18 @@ abstract class _DietType implements DietType { @JsonKey(name: "corb") final bool? corb, @JsonKey(name: "meat") final bool? meat}) = _$DietTypeImpl; - factory _DietType.fromJson(Map json) = _$DietTypeImpl.fromJson; + factory _DietType.fromJson(Map json) = + _$DietTypeImpl.fromJson; @override @JsonKey(name: "alko") bool? get alko; - @override @JsonKey(name: "veg") bool? get veg; - @override @JsonKey(name: "corb") bool? get corb; - @override @JsonKey(name: "meat") bool? get meat; @@ -1339,5 +1391,6 @@ abstract class _DietType implements DietType { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => throw _privateConstructorUsedError; + _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/diets_pagination_model.g.dart b/lib/features/feed/models/diets_pagination_model.g.dart index fd3e231c..7fcab8cd 100644 --- a/lib/features/feed/models/diets_pagination_model.g.dart +++ b/lib/features/feed/models/diets_pagination_model.g.dart @@ -6,13 +6,19 @@ part of 'diets_pagination_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$DietsPaginationImpl _$$DietsPaginationImplFromJson(Map json) => _$DietsPaginationImpl( - data: (json['data'] as List).map((e) => Diet.fromJson(e as Map)).toList(), +_$DietsPaginationImpl _$$DietsPaginationImplFromJson( + Map json) => + _$DietsPaginationImpl( + data: (json['data'] as List) + .map((e) => Diet.fromJson(e as Map)) + .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$DietsPaginationImplToJson(_$DietsPaginationImpl instance) => { +Map _$$DietsPaginationImplToJson( + _$DietsPaginationImpl instance) => + { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, @@ -27,7 +33,11 @@ _$DietImpl _$$DietImplFromJson(Map json) => _$DietImpl( type: DietType.fromJson(json['type'] as Map), details: json['details'] as String, dailySchedule: (json['daily_schedule'] as List) - .map((e) => (e as List).map((e) => (e as List).map((e) => DailySchedule.fromJson(e as Map)).toList()).toList()) + .map((e) => (e as List) + .map((e) => (e as List) + .map((e) => DailySchedule.fromJson(e as Map)) + .toList()) + .toList()) .toList(), author: Author.fromJson(json['author'] as Map), totalLikes: (json['total_likes'] as num).toInt(), @@ -35,7 +45,8 @@ _$DietImpl _$$DietImplFromJson(Map json) => _$DietImpl( totalComments: (json['total_comments'] as num).toInt(), ); -Map _$$DietImplToJson(_$DietImpl instance) => { +Map _$$DietImplToJson(_$DietImpl instance) => + { 'id': instance.id, 'name': instance.name, 'image': instance.image, @@ -57,21 +68,24 @@ _$AuthorImpl _$$AuthorImplFromJson(Map json) => _$AuthorImpl( authorIsMe: json['author_is_me'] as bool, ); -Map _$$AuthorImplToJson(_$AuthorImpl instance) => { +Map _$$AuthorImplToJson(_$AuthorImpl instance) => + { 'author_slug': instance.authorSlug, 'author_name': instance.authorName, 'author_profile_icon': instance.authorProfileIcon, 'author_is_me': instance.authorIsMe, }; -_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map json) => _$DailyScheduleImpl( +_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map json) => + _$DailyScheduleImpl( name: json['name'] as String, uniq: json['uniq'] as String, portion: $enumDecode(_$PortionEnumMap, json['portion']), quantity: (json['quantity'] as num).toInt(), ); -Map _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) => { +Map _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) => + { 'name': instance.name, 'uniq': instance.uniq, 'portion': _$PortionEnumMap[instance.portion]!, @@ -84,14 +98,16 @@ const _$PortionEnumMap = { Portion.PCS: 'pcs', }; -_$DietTypeImpl _$$DietTypeImplFromJson(Map json) => _$DietTypeImpl( +_$DietTypeImpl _$$DietTypeImplFromJson(Map json) => + _$DietTypeImpl( alko: json['alko'] as bool?, veg: json['veg'] as bool?, corb: json['corb'] as bool?, meat: json['meat'] as bool?, ); -Map _$$DietTypeImplToJson(_$DietTypeImpl instance) => { +Map _$$DietTypeImplToJson(_$DietTypeImpl instance) => + { 'alko': instance.alko, 'veg': instance.veg, 'corb': instance.corb, diff --git a/lib/features/feed/models/feed_blog_post_model.freezed.dart b/lib/features/feed/models/feed_blog_post_model.freezed.dart index ce6612b7..89087373 100644 --- a/lib/features/feed/models/feed_blog_post_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_model.freezed.dart @@ -21,35 +21,23 @@ FeedBlogPostModel _$FeedBlogPostModelFromJson(Map json) { /// @nodoc mixin _$FeedBlogPostModel { int get id => throw _privateConstructorUsedError; - String get state => throw _privateConstructorUsedError; - String get image => throw _privateConstructorUsedError; - String get description => throw _privateConstructorUsedError; - Author get author => throw _privateConstructorUsedError; - @JsonKey(name: "youtube_url") String get youtubeUrl => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; - String get title => throw _privateConstructorUsedError; - @JsonKey(name: "total_likes") int get totalLikes => throw _privateConstructorUsedError; - @JsonKey(name: "total_views") int get totalViews => throw _privateConstructorUsedError; - @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; - @JsonKey(name: "was_liked_by_me") bool get wasLikedByMe => throw _privateConstructorUsedError; @@ -59,13 +47,15 @@ mixin _$FeedBlogPostModel { /// Create a copy of FeedBlogPostModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $FeedBlogPostModelCopyWith get copyWith => throw _privateConstructorUsedError; + $FeedBlogPostModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $FeedBlogPostModelCopyWith<$Res> { - factory $FeedBlogPostModelCopyWith(FeedBlogPostModel value, $Res Function(FeedBlogPostModel) then) = _$FeedBlogPostModelCopyWithImpl<$Res, FeedBlogPostModel>; - + factory $FeedBlogPostModelCopyWith( + FeedBlogPostModel value, $Res Function(FeedBlogPostModel) then) = + _$FeedBlogPostModelCopyWithImpl<$Res, FeedBlogPostModel>; @useResult $Res call( {int id, @@ -86,12 +76,12 @@ abstract class $FeedBlogPostModelCopyWith<$Res> { } /// @nodoc -class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> implements $FeedBlogPostModelCopyWith<$Res> { +class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> + implements $FeedBlogPostModelCopyWith<$Res> { _$FeedBlogPostModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -182,10 +172,11 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> impl } /// @nodoc -abstract class _$$FeedBlogPostModelImplCopyWith<$Res> implements $FeedBlogPostModelCopyWith<$Res> { - factory _$$FeedBlogPostModelImplCopyWith(_$FeedBlogPostModelImpl value, $Res Function(_$FeedBlogPostModelImpl) then) = +abstract class _$$FeedBlogPostModelImplCopyWith<$Res> + implements $FeedBlogPostModelCopyWith<$Res> { + factory _$$FeedBlogPostModelImplCopyWith(_$FeedBlogPostModelImpl value, + $Res Function(_$FeedBlogPostModelImpl) then) = __$$FeedBlogPostModelImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -208,9 +199,12 @@ abstract class _$$FeedBlogPostModelImplCopyWith<$Res> implements $FeedBlogPostMo } /// @nodoc -class __$$FeedBlogPostModelImplCopyWithImpl<$Res> extends _$FeedBlogPostModelCopyWithImpl<$Res, _$FeedBlogPostModelImpl> +class __$$FeedBlogPostModelImplCopyWithImpl<$Res> + extends _$FeedBlogPostModelCopyWithImpl<$Res, _$FeedBlogPostModelImpl> implements _$$FeedBlogPostModelImplCopyWith<$Res> { - __$$FeedBlogPostModelImplCopyWithImpl(_$FeedBlogPostModelImpl _value, $Res Function(_$FeedBlogPostModelImpl) _then) : super(_value, _then); + __$$FeedBlogPostModelImplCopyWithImpl(_$FeedBlogPostModelImpl _value, + $Res Function(_$FeedBlogPostModelImpl) _then) + : super(_value, _then); /// Create a copy of FeedBlogPostModel /// with the given fields replaced by the non-null parameter values. @@ -306,7 +300,8 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { @JsonKey(name: "total_comments") required this.totalComments, @JsonKey(name: "was_liked_by_me") required this.wasLikedByMe}); - factory _$FeedBlogPostModelImpl.fromJson(Map json) => _$$FeedBlogPostModelImplFromJson(json); + factory _$FeedBlogPostModelImpl.fromJson(Map json) => + _$$FeedBlogPostModelImplFromJson(json); @override final int id; @@ -355,29 +350,52 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { (identical(other.id, id) || other.id == id) && (identical(other.state, state) || other.state == state) && (identical(other.image, image) || other.image == image) && - (identical(other.description, description) || other.description == description) && + (identical(other.description, description) || + other.description == description) && (identical(other.author, author) || other.author == author) && - (identical(other.youtubeUrl, youtubeUrl) || other.youtubeUrl == youtubeUrl) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && + (identical(other.youtubeUrl, youtubeUrl) || + other.youtubeUrl == youtubeUrl) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && (identical(other.title, title) || other.title == title) && - (identical(other.totalLikes, totalLikes) || other.totalLikes == totalLikes) && - (identical(other.totalViews, totalViews) || other.totalViews == totalViews) && - (identical(other.totalComments, totalComments) || other.totalComments == totalComments) && - (identical(other.wasLikedByMe, wasLikedByMe) || other.wasLikedByMe == wasLikedByMe)); + (identical(other.totalLikes, totalLikes) || + other.totalLikes == totalLikes) && + (identical(other.totalViews, totalViews) || + other.totalViews == totalViews) && + (identical(other.totalComments, totalComments) || + other.totalComments == totalComments) && + (identical(other.wasLikedByMe, wasLikedByMe) || + other.wasLikedByMe == wasLikedByMe)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, id, state, image, description, author, youtubeUrl, createdAt, updatedAt, title, totalLikes, totalViews, totalComments, wasLikedByMe); + runtimeType, + id, + state, + image, + description, + author, + youtubeUrl, + createdAt, + updatedAt, + title, + totalLikes, + totalViews, + totalComments, + wasLikedByMe); /// Create a copy of FeedBlogPostModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => __$$FeedBlogPostModelImplCopyWithImpl<_$FeedBlogPostModelImpl>(this, _$identity); + _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => + __$$FeedBlogPostModelImplCopyWithImpl<_$FeedBlogPostModelImpl>( + this, _$identity); @override Map toJson() { @@ -389,64 +407,54 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { abstract class _FeedBlogPostModel implements FeedBlogPostModel { const factory _FeedBlogPostModel( - {required final int id, - required final String state, - required final String image, - required final String description, - required final Author author, - @JsonKey(name: "youtube_url") required final String youtubeUrl, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") required final DateTime updatedAt, - required final String title, - @JsonKey(name: "total_likes") required final int totalLikes, - @JsonKey(name: "total_views") required final int totalViews, - @JsonKey(name: "total_comments") required final int totalComments, - @JsonKey(name: "was_liked_by_me") required final bool wasLikedByMe}) = _$FeedBlogPostModelImpl; + {required final int id, + required final String state, + required final String image, + required final String description, + required final Author author, + @JsonKey(name: "youtube_url") required final String youtubeUrl, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt, + required final String title, + @JsonKey(name: "total_likes") required final int totalLikes, + @JsonKey(name: "total_views") required final int totalViews, + @JsonKey(name: "total_comments") required final int totalComments, + @JsonKey(name: "was_liked_by_me") required final bool wasLikedByMe}) = + _$FeedBlogPostModelImpl; - factory _FeedBlogPostModel.fromJson(Map json) = _$FeedBlogPostModelImpl.fromJson; + factory _FeedBlogPostModel.fromJson(Map json) = + _$FeedBlogPostModelImpl.fromJson; @override int get id; - @override String get state; - @override String get image; - @override String get description; - @override Author get author; - @override @JsonKey(name: "youtube_url") String get youtubeUrl; - @override @JsonKey(name: "created_at") DateTime get createdAt; - @override @JsonKey(name: "updated_at") DateTime get updatedAt; - @override String get title; - @override @JsonKey(name: "total_likes") int get totalLikes; - @override @JsonKey(name: "total_views") int get totalViews; - @override @JsonKey(name: "total_comments") int get totalComments; - @override @JsonKey(name: "was_liked_by_me") bool get wasLikedByMe; @@ -455,5 +463,6 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/feed_blog_post_model.g.dart b/lib/features/feed/models/feed_blog_post_model.g.dart index 29ecd6f7..fadf4302 100644 --- a/lib/features/feed/models/feed_blog_post_model.g.dart +++ b/lib/features/feed/models/feed_blog_post_model.g.dart @@ -6,7 +6,9 @@ part of 'feed_blog_post_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(Map json) => _$FeedBlogPostModelImpl( +_$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson( + Map json) => + _$FeedBlogPostModelImpl( id: (json['id'] as num).toInt(), state: json['state'] as String, image: json['image'] as String, @@ -22,7 +24,9 @@ _$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(Map js wasLikedByMe: json['was_liked_by_me'] as bool, ); -Map _$$FeedBlogPostModelImplToJson(_$FeedBlogPostModelImpl instance) => { +Map _$$FeedBlogPostModelImplToJson( + _$FeedBlogPostModelImpl instance) => + { 'id': instance.id, 'state': instance.state, 'image': instance.image, diff --git a/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart b/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart index 1121d5e1..9bddceae 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart @@ -14,15 +14,16 @@ T _$identity(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'); -FeedBlogPostSettingsModel _$FeedBlogPostSettingsModelFromJson(Map json) { +FeedBlogPostSettingsModel _$FeedBlogPostSettingsModelFromJson( + Map json) { return _FeedBlogPostSettingsModel.fromJson(json); } /// @nodoc mixin _$FeedBlogPostSettingsModel { @JsonKey(name: 'data') - List get feedBlogPostList => throw _privateConstructorUsedError; - + List get feedBlogPostList => + throw _privateConstructorUsedError; Meta get meta => throw _privateConstructorUsedError; /// Serializes this FeedBlogPostSettingsModel to a JSON map. @@ -31,27 +32,31 @@ mixin _$FeedBlogPostSettingsModel { /// Create a copy of FeedBlogPostSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $FeedBlogPostSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; + $FeedBlogPostSettingsModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $FeedBlogPostSettingsModelCopyWith<$Res> { - factory $FeedBlogPostSettingsModelCopyWith(FeedBlogPostSettingsModel value, $Res Function(FeedBlogPostSettingsModel) then) = + factory $FeedBlogPostSettingsModelCopyWith(FeedBlogPostSettingsModel value, + $Res Function(FeedBlogPostSettingsModel) then) = _$FeedBlogPostSettingsModelCopyWithImpl<$Res, FeedBlogPostSettingsModel>; - @useResult - $Res call({@JsonKey(name: 'data') List feedBlogPostList, Meta meta}); + $Res call( + {@JsonKey(name: 'data') List feedBlogPostList, + Meta meta}); $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, $Val extends FeedBlogPostSettingsModel> implements $FeedBlogPostSettingsModelCopyWith<$Res> { +class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, + $Val extends FeedBlogPostSettingsModel> + implements $FeedBlogPostSettingsModelCopyWith<$Res> { _$FeedBlogPostSettingsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -87,22 +92,30 @@ class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, $Val extends FeedBlogPostSet } /// @nodoc -abstract class _$$FeedBlogPostSettingsModelImplCopyWith<$Res> implements $FeedBlogPostSettingsModelCopyWith<$Res> { - factory _$$FeedBlogPostSettingsModelImplCopyWith(_$FeedBlogPostSettingsModelImpl value, $Res Function(_$FeedBlogPostSettingsModelImpl) then) = +abstract class _$$FeedBlogPostSettingsModelImplCopyWith<$Res> + implements $FeedBlogPostSettingsModelCopyWith<$Res> { + factory _$$FeedBlogPostSettingsModelImplCopyWith( + _$FeedBlogPostSettingsModelImpl value, + $Res Function(_$FeedBlogPostSettingsModelImpl) then) = __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res>; - @override @useResult - $Res call({@JsonKey(name: 'data') List feedBlogPostList, Meta meta}); + $Res call( + {@JsonKey(name: 'data') List feedBlogPostList, + Meta meta}); @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> extends _$FeedBlogPostSettingsModelCopyWithImpl<$Res, _$FeedBlogPostSettingsModelImpl> +class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> + extends _$FeedBlogPostSettingsModelCopyWithImpl<$Res, + _$FeedBlogPostSettingsModelImpl> implements _$$FeedBlogPostSettingsModelImplCopyWith<$Res> { - __$$FeedBlogPostSettingsModelImplCopyWithImpl(_$FeedBlogPostSettingsModelImpl _value, $Res Function(_$FeedBlogPostSettingsModelImpl) _then) + __$$FeedBlogPostSettingsModelImplCopyWithImpl( + _$FeedBlogPostSettingsModelImpl _value, + $Res Function(_$FeedBlogPostSettingsModelImpl) _then) : super(_value, _then); /// Create a copy of FeedBlogPostSettingsModel @@ -129,17 +142,21 @@ class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> extends _$FeedBlogPost /// @nodoc @JsonSerializable() class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { - const _$FeedBlogPostSettingsModelImpl({@JsonKey(name: 'data') required final List feedBlogPostList, required this.meta}) + const _$FeedBlogPostSettingsModelImpl( + {@JsonKey(name: 'data') + required final List feedBlogPostList, + required this.meta}) : _feedBlogPostList = feedBlogPostList; - factory _$FeedBlogPostSettingsModelImpl.fromJson(Map json) => _$$FeedBlogPostSettingsModelImplFromJson(json); + factory _$FeedBlogPostSettingsModelImpl.fromJson(Map json) => + _$$FeedBlogPostSettingsModelImplFromJson(json); final List _feedBlogPostList; - @override @JsonKey(name: 'data') List get feedBlogPostList { - if (_feedBlogPostList is EqualUnmodifiableListView) return _feedBlogPostList; + if (_feedBlogPostList is EqualUnmodifiableListView) + return _feedBlogPostList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_feedBlogPostList); } @@ -157,21 +174,24 @@ class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedBlogPostSettingsModelImpl && - const DeepCollectionEquality().equals(other._feedBlogPostList, _feedBlogPostList) && + const DeepCollectionEquality() + .equals(other._feedBlogPostList, _feedBlogPostList) && (identical(other.meta, meta) || other.meta == meta)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList), meta); + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_feedBlogPostList), meta); /// Create a copy of FeedBlogPostSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> get copyWith => - __$$FeedBlogPostSettingsModelImplCopyWithImpl<_$FeedBlogPostSettingsModelImpl>(this, _$identity); + _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> + get copyWith => __$$FeedBlogPostSettingsModelImplCopyWithImpl< + _$FeedBlogPostSettingsModelImpl>(this, _$identity); @override Map toJson() { @@ -182,15 +202,17 @@ class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { } abstract class _FeedBlogPostSettingsModel implements FeedBlogPostSettingsModel { - const factory _FeedBlogPostSettingsModel({@JsonKey(name: 'data') required final List feedBlogPostList, required final Meta meta}) = - _$FeedBlogPostSettingsModelImpl; + const factory _FeedBlogPostSettingsModel( + {@JsonKey(name: 'data') + required final List feedBlogPostList, + required final Meta meta}) = _$FeedBlogPostSettingsModelImpl; - factory _FeedBlogPostSettingsModel.fromJson(Map json) = _$FeedBlogPostSettingsModelImpl.fromJson; + factory _FeedBlogPostSettingsModel.fromJson(Map json) = + _$FeedBlogPostSettingsModelImpl.fromJson; @override @JsonKey(name: 'data') List get feedBlogPostList; - @override Meta get meta; @@ -198,5 +220,6 @@ abstract class _FeedBlogPostSettingsModel implements FeedBlogPostSettingsModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/feed_blog_post_settings_model.g.dart b/lib/features/feed/models/feed_blog_post_settings_model.g.dart index 9566ca99..e300b594 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.g.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.g.dart @@ -6,12 +6,18 @@ part of 'feed_blog_post_settings_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$FeedBlogPostSettingsModelImpl _$$FeedBlogPostSettingsModelImplFromJson(Map json) => _$FeedBlogPostSettingsModelImpl( - feedBlogPostList: (json['data'] as List).map((e) => FeedBlogPostModel.fromJson(e as Map)).toList(), +_$FeedBlogPostSettingsModelImpl _$$FeedBlogPostSettingsModelImplFromJson( + Map json) => + _$FeedBlogPostSettingsModelImpl( + feedBlogPostList: (json['data'] as List) + .map((e) => FeedBlogPostModel.fromJson(e as Map)) + .toList(), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$FeedBlogPostSettingsModelImplToJson(_$FeedBlogPostSettingsModelImpl instance) => { +Map _$$FeedBlogPostSettingsModelImplToJson( + _$FeedBlogPostSettingsModelImpl instance) => + { 'data': instance.feedBlogPostList, 'meta': instance.meta, }; diff --git a/lib/features/feed/models/recipes_model.freezed.dart b/lib/features/feed/models/recipes_model.freezed.dart index 6b59786a..9dd4f54e 100644 --- a/lib/features/feed/models/recipes_model.freezed.dart +++ b/lib/features/feed/models/recipes_model.freezed.dart @@ -21,44 +21,28 @@ Recipes _$RecipesFromJson(Map json) { /// @nodoc mixin _$Recipes { int get id => throw _privateConstructorUsedError; - String get image => throw _privateConstructorUsedError; - String get state => throw _privateConstructorUsedError; - @JsonKey(name: 'cooking_time') int get cookingTime => throw _privateConstructorUsedError; - List get ingredients => throw _privateConstructorUsedError; - String get description => throw _privateConstructorUsedError; - List get steps => throw _privateConstructorUsedError; - @JsonKey(name: 'video_url') String get videoUrl => throw _privateConstructorUsedError; - @JsonKey(name: 'created_at') DateTime get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: 'updated_at') DateTime get updatedAt => throw _privateConstructorUsedError; - String get title => throw _privateConstructorUsedError; - String get type => throw _privateConstructorUsedError; - String get slug => throw _privateConstructorUsedError; - @JsonKey(name: 'total_comments') int get commentsCount => throw _privateConstructorUsedError; - @JsonKey(name: 'total_likes') int get likesCount => throw _privateConstructorUsedError; - @JsonKey(name: 'total_views') int get viewsCount => throw _privateConstructorUsedError; - Author get author => throw _privateConstructorUsedError; /// Serializes this Recipes to a JSON map. @@ -72,8 +56,8 @@ mixin _$Recipes { /// @nodoc abstract class $RecipesCopyWith<$Res> { - factory $RecipesCopyWith(Recipes value, $Res Function(Recipes) then) = _$RecipesCopyWithImpl<$Res, Recipes>; - + factory $RecipesCopyWith(Recipes value, $Res Function(Recipes) then) = + _$RecipesCopyWithImpl<$Res, Recipes>; @useResult $Res call( {int id, @@ -98,12 +82,12 @@ abstract class $RecipesCopyWith<$Res> { } /// @nodoc -class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> implements $RecipesCopyWith<$Res> { +class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> + implements $RecipesCopyWith<$Res> { _$RecipesCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -215,8 +199,9 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> implements $RecipesCopyW /// @nodoc abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> { - factory _$$RecipesImplCopyWith(_$RecipesImpl value, $Res Function(_$RecipesImpl) then) = __$$RecipesImplCopyWithImpl<$Res>; - + factory _$$RecipesImplCopyWith( + _$RecipesImpl value, $Res Function(_$RecipesImpl) then) = + __$$RecipesImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -243,8 +228,12 @@ abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> { } /// @nodoc -class __$$RecipesImplCopyWithImpl<$Res> extends _$RecipesCopyWithImpl<$Res, _$RecipesImpl> implements _$$RecipesImplCopyWith<$Res> { - __$$RecipesImplCopyWithImpl(_$RecipesImpl _value, $Res Function(_$RecipesImpl) _then) : super(_value, _then); +class __$$RecipesImplCopyWithImpl<$Res> + extends _$RecipesCopyWithImpl<$Res, _$RecipesImpl> + implements _$$RecipesImplCopyWith<$Res> { + __$$RecipesImplCopyWithImpl( + _$RecipesImpl _value, $Res Function(_$RecipesImpl) _then) + : super(_value, _then); /// Create a copy of Recipes /// with the given fields replaced by the non-null parameter values. @@ -366,7 +355,8 @@ class _$RecipesImpl implements _Recipes { : _ingredients = ingredients, _steps = steps; - factory _$RecipesImpl.fromJson(Map json) => _$$RecipesImplFromJson(json); + factory _$RecipesImpl.fromJson(Map json) => + _$$RecipesImplFromJson(json); @override final int id; @@ -378,7 +368,6 @@ class _$RecipesImpl implements _Recipes { @JsonKey(name: 'cooking_time') final int cookingTime; final List _ingredients; - @override List get ingredients { if (_ingredients is EqualUnmodifiableListView) return _ingredients; @@ -389,7 +378,6 @@ class _$RecipesImpl implements _Recipes { @override final String description; final List _steps; - @override List get steps { if (_steps is EqualUnmodifiableListView) return _steps; @@ -437,33 +425,60 @@ class _$RecipesImpl implements _Recipes { (identical(other.id, id) || other.id == id) && (identical(other.image, image) || other.image == image) && (identical(other.state, state) || other.state == state) && - (identical(other.cookingTime, cookingTime) || other.cookingTime == cookingTime) && - const DeepCollectionEquality().equals(other._ingredients, _ingredients) && - (identical(other.description, description) || other.description == description) && + (identical(other.cookingTime, cookingTime) || + other.cookingTime == cookingTime) && + const DeepCollectionEquality() + .equals(other._ingredients, _ingredients) && + (identical(other.description, description) || + other.description == description) && const DeepCollectionEquality().equals(other._steps, _steps) && - (identical(other.videoUrl, videoUrl) || other.videoUrl == videoUrl) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && + (identical(other.videoUrl, videoUrl) || + other.videoUrl == videoUrl) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && (identical(other.title, title) || other.title == title) && (identical(other.type, type) || other.type == type) && (identical(other.slug, slug) || other.slug == slug) && - (identical(other.commentsCount, commentsCount) || other.commentsCount == commentsCount) && - (identical(other.likesCount, likesCount) || other.likesCount == likesCount) && - (identical(other.viewsCount, viewsCount) || other.viewsCount == viewsCount) && + (identical(other.commentsCount, commentsCount) || + other.commentsCount == commentsCount) && + (identical(other.likesCount, likesCount) || + other.likesCount == likesCount) && + (identical(other.viewsCount, viewsCount) || + other.viewsCount == viewsCount) && (identical(other.author, author) || other.author == author)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, image, state, cookingTime, const DeepCollectionEquality().hash(_ingredients), description, - const DeepCollectionEquality().hash(_steps), videoUrl, createdAt, updatedAt, title, type, slug, commentsCount, likesCount, viewsCount, author); + int get hashCode => Object.hash( + runtimeType, + id, + image, + state, + cookingTime, + const DeepCollectionEquality().hash(_ingredients), + description, + const DeepCollectionEquality().hash(_steps), + videoUrl, + createdAt, + updatedAt, + title, + type, + slug, + commentsCount, + likesCount, + viewsCount, + author); /// Create a copy of Recipes /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => __$$RecipesImplCopyWithImpl<_$RecipesImpl>(this, _$identity); + _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => + __$$RecipesImplCopyWithImpl<_$RecipesImpl>(this, _$identity); @override Map toJson() { @@ -497,59 +512,43 @@ abstract class _Recipes implements Recipes { @override int get id; - @override String get image; - @override String get state; - @override @JsonKey(name: 'cooking_time') int get cookingTime; - @override List get ingredients; - @override String get description; - @override List get steps; - @override @JsonKey(name: 'video_url') String get videoUrl; - @override @JsonKey(name: 'created_at') DateTime get createdAt; - @override @JsonKey(name: 'updated_at') DateTime get updatedAt; - @override String get title; - @override String get type; - @override String get slug; - @override @JsonKey(name: 'total_comments') int get commentsCount; - @override @JsonKey(name: 'total_likes') int get likesCount; - @override @JsonKey(name: 'total_views') int get viewsCount; - @override Author get author; @@ -557,7 +556,8 @@ abstract class _Recipes implements Recipes { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => + throw _privateConstructorUsedError; } Ingredient _$IngredientFromJson(Map json) { @@ -567,9 +567,7 @@ Ingredient _$IngredientFromJson(Map json) { /// @nodoc mixin _$Ingredient { String get name => throw _privateConstructorUsedError; - String? get unit => throw _privateConstructorUsedError; - String get portion => throw _privateConstructorUsedError; /// Serializes this Ingredient to a JSON map. @@ -578,24 +576,26 @@ mixin _$Ingredient { /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $IngredientCopyWith get copyWith => throw _privateConstructorUsedError; + $IngredientCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $IngredientCopyWith<$Res> { - factory $IngredientCopyWith(Ingredient value, $Res Function(Ingredient) then) = _$IngredientCopyWithImpl<$Res, Ingredient>; - + factory $IngredientCopyWith( + Ingredient value, $Res Function(Ingredient) then) = + _$IngredientCopyWithImpl<$Res, Ingredient>; @useResult $Res call({String name, String? unit, String portion}); } /// @nodoc -class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $IngredientCopyWith<$Res> { +class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> + implements $IngredientCopyWith<$Res> { _$IngredientCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -626,17 +626,23 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $Ingred } /// @nodoc -abstract class _$$IngredientImplCopyWith<$Res> implements $IngredientCopyWith<$Res> { - factory _$$IngredientImplCopyWith(_$IngredientImpl value, $Res Function(_$IngredientImpl) then) = __$$IngredientImplCopyWithImpl<$Res>; - +abstract class _$$IngredientImplCopyWith<$Res> + implements $IngredientCopyWith<$Res> { + factory _$$IngredientImplCopyWith( + _$IngredientImpl value, $Res Function(_$IngredientImpl) then) = + __$$IngredientImplCopyWithImpl<$Res>; @override @useResult $Res call({String name, String? unit, String portion}); } /// @nodoc -class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> implements _$$IngredientImplCopyWith<$Res> { - __$$IngredientImplCopyWithImpl(_$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) : super(_value, _then); +class __$$IngredientImplCopyWithImpl<$Res> + extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> + implements _$$IngredientImplCopyWith<$Res> { + __$$IngredientImplCopyWithImpl( + _$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) + : super(_value, _then); /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @@ -667,9 +673,11 @@ class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$Res /// @nodoc @JsonSerializable() class _$IngredientImpl implements _Ingredient { - const _$IngredientImpl({required this.name, this.unit, required this.portion}); + const _$IngredientImpl( + {required this.name, this.unit, required this.portion}); - factory _$IngredientImpl.fromJson(Map json) => _$$IngredientImplFromJson(json); + factory _$IngredientImpl.fromJson(Map json) => + _$$IngredientImplFromJson(json); @override final String name; @@ -702,7 +710,8 @@ class _$IngredientImpl implements _Ingredient { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => + __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); @override Map toJson() { @@ -713,16 +722,18 @@ class _$IngredientImpl implements _Ingredient { } abstract class _Ingredient implements Ingredient { - const factory _Ingredient({required final String name, final String? unit, required final String portion}) = _$IngredientImpl; + const factory _Ingredient( + {required final String name, + final String? unit, + required final String portion}) = _$IngredientImpl; - factory _Ingredient.fromJson(Map json) = _$IngredientImpl.fromJson; + factory _Ingredient.fromJson(Map json) = + _$IngredientImpl.fromJson; @override String get name; - @override String? get unit; - @override String get portion; @@ -730,7 +741,8 @@ abstract class _Ingredient implements Ingredient { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError; + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => + throw _privateConstructorUsedError; } Step _$StepFromJson(Map json) { @@ -740,7 +752,6 @@ Step _$StepFromJson(Map json) { /// @nodoc mixin _$Step { String get image => throw _privateConstructorUsedError; - String get description => throw _privateConstructorUsedError; /// Serializes this Step to a JSON map. @@ -754,19 +765,19 @@ mixin _$Step { /// @nodoc abstract class $StepCopyWith<$Res> { - factory $StepCopyWith(Step value, $Res Function(Step) then) = _$StepCopyWithImpl<$Res, Step>; - + factory $StepCopyWith(Step value, $Res Function(Step) then) = + _$StepCopyWithImpl<$Res, Step>; @useResult $Res call({String image, String description}); } /// @nodoc -class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res> { +class _$StepCopyWithImpl<$Res, $Val extends Step> + implements $StepCopyWith<$Res> { _$StepCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -793,16 +804,20 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res> /// @nodoc abstract class _$$StepImplCopyWith<$Res> implements $StepCopyWith<$Res> { - factory _$$StepImplCopyWith(_$StepImpl value, $Res Function(_$StepImpl) then) = __$$StepImplCopyWithImpl<$Res>; - + factory _$$StepImplCopyWith( + _$StepImpl value, $Res Function(_$StepImpl) then) = + __$$StepImplCopyWithImpl<$Res>; @override @useResult $Res call({String image, String description}); } /// @nodoc -class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl> implements _$$StepImplCopyWith<$Res> { - __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) : super(_value, _then); +class __$$StepImplCopyWithImpl<$Res> + extends _$StepCopyWithImpl<$Res, _$StepImpl> + implements _$$StepImplCopyWith<$Res> { + __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) + : super(_value, _then); /// Create a copy of Step /// with the given fields replaced by the non-null parameter values. @@ -830,7 +845,8 @@ class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl class _$StepImpl implements _Step { const _$StepImpl({required this.image, required this.description}); - factory _$StepImpl.fromJson(Map json) => _$$StepImplFromJson(json); + factory _$StepImpl.fromJson(Map json) => + _$$StepImplFromJson(json); @override final String image; @@ -848,7 +864,8 @@ class _$StepImpl implements _Step { (other.runtimeType == runtimeType && other is _$StepImpl && (identical(other.image, image) || other.image == image) && - (identical(other.description, description) || other.description == description)); + (identical(other.description, description) || + other.description == description)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -860,7 +877,8 @@ class _$StepImpl implements _Step { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$StepImplCopyWith<_$StepImpl> get copyWith => __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); + _$$StepImplCopyWith<_$StepImpl> get copyWith => + __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); @override Map toJson() { @@ -871,13 +889,14 @@ class _$StepImpl implements _Step { } abstract class _Step implements Step { - const factory _Step({required final String image, required final String description}) = _$StepImpl; + const factory _Step( + {required final String image, + required final String description}) = _$StepImpl; factory _Step.fromJson(Map json) = _$StepImpl.fromJson; @override String get image; - @override String get description; @@ -885,5 +904,6 @@ abstract class _Step implements Step { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$StepImplCopyWith<_$StepImpl> get copyWith => throw _privateConstructorUsedError; + _$$StepImplCopyWith<_$StepImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/recipes_model.g.dart b/lib/features/feed/models/recipes_model.g.dart index 0f9e0a0d..7f8c0142 100644 --- a/lib/features/feed/models/recipes_model.g.dart +++ b/lib/features/feed/models/recipes_model.g.dart @@ -6,14 +6,19 @@ part of 'recipes_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipesImpl _$$RecipesImplFromJson(Map json) => _$RecipesImpl( +_$RecipesImpl _$$RecipesImplFromJson(Map json) => + _$RecipesImpl( id: (json['id'] as num).toInt(), image: json['image'] as String, state: json['state'] as String, cookingTime: (json['cooking_time'] as num).toInt(), - ingredients: (json['ingredients'] as List).map((e) => Ingredient.fromJson(e as Map)).toList(), + ingredients: (json['ingredients'] as List) + .map((e) => Ingredient.fromJson(e as Map)) + .toList(), description: json['description'] as String, - steps: (json['steps'] as List).map((e) => Step.fromJson(e as Map)).toList(), + steps: (json['steps'] as List) + .map((e) => Step.fromJson(e as Map)) + .toList(), videoUrl: json['video_url'] as String, createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), @@ -26,7 +31,8 @@ _$RecipesImpl _$$RecipesImplFromJson(Map json) => _$RecipesImpl author: Author.fromJson(json['author'] as Map), ); -Map _$$RecipesImplToJson(_$RecipesImpl instance) => { +Map _$$RecipesImplToJson(_$RecipesImpl instance) => + { 'id': instance.id, 'image': instance.image, 'state': instance.state, @@ -46,13 +52,15 @@ Map _$$RecipesImplToJson(_$RecipesImpl instance) => json) => _$IngredientImpl( +_$IngredientImpl _$$IngredientImplFromJson(Map json) => + _$IngredientImpl( name: json['name'] as String, unit: json['unit'] as String?, portion: json['portion'] as String, ); -Map _$$IngredientImplToJson(_$IngredientImpl instance) => { +Map _$$IngredientImplToJson(_$IngredientImpl instance) => + { 'name': instance.name, 'unit': instance.unit, 'portion': instance.portion, @@ -63,7 +71,8 @@ _$StepImpl _$$StepImplFromJson(Map json) => _$StepImpl( description: json['description'] as String, ); -Map _$$StepImplToJson(_$StepImpl instance) => { +Map _$$StepImplToJson(_$StepImpl instance) => + { 'image': instance.image, 'description': instance.description, }; diff --git a/lib/features/feed/models/recipes_pagination_model.freezed.dart b/lib/features/feed/models/recipes_pagination_model.freezed.dart index 8d95450d..ca8e9f92 100644 --- a/lib/features/feed/models/recipes_pagination_model.freezed.dart +++ b/lib/features/feed/models/recipes_pagination_model.freezed.dart @@ -29,24 +29,26 @@ mixin _$RecipesPagination { /// Create a copy of RecipesPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipesPaginationCopyWith get copyWith => throw _privateConstructorUsedError; + $RecipesPaginationCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipesPaginationCopyWith<$Res> { - factory $RecipesPaginationCopyWith(RecipesPagination value, $Res Function(RecipesPagination) then) = _$RecipesPaginationCopyWithImpl<$Res, RecipesPagination>; - + factory $RecipesPaginationCopyWith( + RecipesPagination value, $Res Function(RecipesPagination) then) = + _$RecipesPaginationCopyWithImpl<$Res, RecipesPagination>; @useResult $Res call({@JsonKey(name: 'data') List recipesList}); } /// @nodoc -class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> implements $RecipesPaginationCopyWith<$Res> { +class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> + implements $RecipesPaginationCopyWith<$Res> { _$RecipesPaginationCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -67,19 +69,23 @@ class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> impl } /// @nodoc -abstract class _$$RecipesPaginationImplCopyWith<$Res> implements $RecipesPaginationCopyWith<$Res> { - factory _$$RecipesPaginationImplCopyWith(_$RecipesPaginationImpl value, $Res Function(_$RecipesPaginationImpl) then) = +abstract class _$$RecipesPaginationImplCopyWith<$Res> + implements $RecipesPaginationCopyWith<$Res> { + factory _$$RecipesPaginationImplCopyWith(_$RecipesPaginationImpl value, + $Res Function(_$RecipesPaginationImpl) then) = __$$RecipesPaginationImplCopyWithImpl<$Res>; - @override @useResult $Res call({@JsonKey(name: 'data') List recipesList}); } /// @nodoc -class __$$RecipesPaginationImplCopyWithImpl<$Res> extends _$RecipesPaginationCopyWithImpl<$Res, _$RecipesPaginationImpl> +class __$$RecipesPaginationImplCopyWithImpl<$Res> + extends _$RecipesPaginationCopyWithImpl<$Res, _$RecipesPaginationImpl> implements _$$RecipesPaginationImplCopyWith<$Res> { - __$$RecipesPaginationImplCopyWithImpl(_$RecipesPaginationImpl _value, $Res Function(_$RecipesPaginationImpl) _then) : super(_value, _then); + __$$RecipesPaginationImplCopyWithImpl(_$RecipesPaginationImpl _value, + $Res Function(_$RecipesPaginationImpl) _then) + : super(_value, _then); /// Create a copy of RecipesPagination /// with the given fields replaced by the non-null parameter values. @@ -100,12 +106,14 @@ class __$$RecipesPaginationImplCopyWithImpl<$Res> extends _$RecipesPaginationCop /// @nodoc @JsonSerializable() class _$RecipesPaginationImpl implements _RecipesPagination { - const _$RecipesPaginationImpl({@JsonKey(name: 'data') required final List recipesList}) : _recipesList = recipesList; + const _$RecipesPaginationImpl( + {@JsonKey(name: 'data') required final List recipesList}) + : _recipesList = recipesList; - factory _$RecipesPaginationImpl.fromJson(Map json) => _$$RecipesPaginationImplFromJson(json); + factory _$RecipesPaginationImpl.fromJson(Map json) => + _$$RecipesPaginationImplFromJson(json); final List _recipesList; - @override @JsonKey(name: 'data') List get recipesList { @@ -122,19 +130,25 @@ class _$RecipesPaginationImpl implements _RecipesPagination { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$RecipesPaginationImpl && const DeepCollectionEquality().equals(other._recipesList, _recipesList)); + (other.runtimeType == runtimeType && + other is _$RecipesPaginationImpl && + const DeepCollectionEquality() + .equals(other._recipesList, _recipesList)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_recipesList)); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_recipesList)); /// Create a copy of RecipesPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => __$$RecipesPaginationImplCopyWithImpl<_$RecipesPaginationImpl>(this, _$identity); + _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => + __$$RecipesPaginationImplCopyWithImpl<_$RecipesPaginationImpl>( + this, _$identity); @override Map toJson() { @@ -145,9 +159,12 @@ class _$RecipesPaginationImpl implements _RecipesPagination { } abstract class _RecipesPagination implements RecipesPagination { - const factory _RecipesPagination({@JsonKey(name: 'data') required final List recipesList}) = _$RecipesPaginationImpl; + const factory _RecipesPagination( + {@JsonKey(name: 'data') required final List recipesList}) = + _$RecipesPaginationImpl; - factory _RecipesPagination.fromJson(Map json) = _$RecipesPaginationImpl.fromJson; + factory _RecipesPagination.fromJson(Map json) = + _$RecipesPaginationImpl.fromJson; @override @JsonKey(name: 'data') @@ -157,5 +174,6 @@ abstract class _RecipesPagination implements RecipesPagination { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/recipes_pagination_model.g.dart b/lib/features/feed/models/recipes_pagination_model.g.dart index e14428fb..109f39d5 100644 --- a/lib/features/feed/models/recipes_pagination_model.g.dart +++ b/lib/features/feed/models/recipes_pagination_model.g.dart @@ -6,10 +6,16 @@ part of 'recipes_pagination_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipesPaginationImpl _$$RecipesPaginationImplFromJson(Map json) => _$RecipesPaginationImpl( - recipesList: (json['data'] as List).map((e) => Recipes.fromJson(e as Map)).toList(), +_$RecipesPaginationImpl _$$RecipesPaginationImplFromJson( + Map json) => + _$RecipesPaginationImpl( + recipesList: (json['data'] as List) + .map((e) => Recipes.fromJson(e as Map)) + .toList(), ); -Map _$$RecipesPaginationImplToJson(_$RecipesPaginationImpl instance) => { +Map _$$RecipesPaginationImplToJson( + _$RecipesPaginationImpl instance) => + { 'data': instance.recipesList, }; diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart index 41a00d05..dbfdaeb0 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart @@ -19,13 +19,13 @@ class CommentsCubit extends Cubit { try { switch (commentSourceType) { case CommentSourceType.blogPost: - emit(CommentsState.loaded(comment: await feedRepository.getBlogPostComments(id))); + emit(CommentsState.loaded(comment: await feedRepository.getBlogPostComments(id: id))); break; case CommentSourceType.diet: - emit(CommentsState.loaded(comment: await feedRepository.getDietsComments(id))); + emit(CommentsState.loaded(comment: await feedRepository.getDietsComments(id: id))); break; case CommentSourceType.recipe: - emit(CommentsState.loaded(comment: await feedRepository.getRecipesComments(id))); + emit(CommentsState.loaded(comment: await feedRepository.getRecipesComments(id: id))); break; } } catch (e) { diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart index caa93548..c3b582ce 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$CommentsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$CommentsState { /// @nodoc abstract class $CommentsStateCopyWith<$Res> { - factory $CommentsStateCopyWith(CommentsState value, $Res Function(CommentsState) then) = _$CommentsStateCopyWithImpl<$Res, CommentsState>; + factory $CommentsStateCopyWith( + CommentsState value, $Res Function(CommentsState) then) = + _$CommentsStateCopyWithImpl<$Res, CommentsState>; } /// @nodoc -class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> implements $CommentsStateCopyWith<$Res> { +class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> + implements $CommentsStateCopyWith<$Res> { _$CommentsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +91,18 @@ class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> implements $ /// @nodoc abstract class _$$CommentsStateImplCopyWith<$Res> { - factory _$$CommentsStateImplCopyWith(_$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) = __$$CommentsStateImplCopyWithImpl<$Res>; + factory _$$CommentsStateImplCopyWith( + _$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) = + __$$CommentsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CommentsStateImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl> implements _$$CommentsStateImplCopyWith<$Res> { - __$$CommentsStateImplCopyWithImpl(_$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) : super(_value, _then); +class __$$CommentsStateImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl> + implements _$$CommentsStateImplCopyWith<$Res> { + __$$CommentsStateImplCopyWithImpl( + _$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +120,8 @@ class _$CommentsStateImpl implements _CommentsState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$CommentsStateImpl); } @override @@ -200,14 +208,18 @@ abstract class _CommentsState implements CommentsState { /// @nodoc abstract class _$$CommentsStateLoadingImplCopyWith<$Res> { - factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value, $Res Function(_$CommentsStateLoadingImpl) then) = + factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value, + $Res Function(_$CommentsStateLoadingImpl) then) = __$$CommentsStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CommentsStateLoadingImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl> +class __$$CommentsStateLoadingImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl> implements _$$CommentsStateLoadingImplCopyWith<$Res> { - __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, $Res Function(_$CommentsStateLoadingImpl) _then) : super(_value, _then); + __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, + $Res Function(_$CommentsStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +237,9 @@ class _$CommentsStateLoadingImpl implements CommentsStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$CommentsStateLoadingImpl); } @override @@ -312,9 +326,9 @@ abstract class CommentsStateLoading implements CommentsState { /// @nodoc abstract class _$$CommentsStateLoadedImplCopyWith<$Res> { - factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value, $Res Function(_$CommentsStateLoadedImpl) then) = + factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value, + $Res Function(_$CommentsStateLoadedImpl) then) = __$$CommentsStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({CommentModel comment, int? replyId}); @@ -322,9 +336,12 @@ abstract class _$$CommentsStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$CommentsStateLoadedImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl> +class __$$CommentsStateLoadedImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl> implements _$$CommentsStateLoadedImplCopyWith<$Res> { - __$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value, $Res Function(_$CommentsStateLoadedImpl) _then) : super(_value, _then); + __$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value, + $Res Function(_$CommentsStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -390,7 +407,8 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { @override @pragma('vm:prefer-inline') _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => - __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>(this, _$identity); + __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -468,31 +486,36 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { } abstract class CommentsStateLoaded implements CommentsState { - const factory CommentsStateLoaded({required final CommentModel comment, final int? replyId}) = _$CommentsStateLoadedImpl; + const factory CommentsStateLoaded( + {required final CommentModel comment, + final int? replyId}) = _$CommentsStateLoadedImpl; CommentModel get comment; - int? get replyId; /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$CommentsStateErrorImplCopyWith<$Res> { - factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value, $Res Function(_$CommentsStateErrorImpl) then) = + factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value, + $Res Function(_$CommentsStateErrorImpl) then) = __$$CommentsStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$CommentsStateErrorImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl> +class __$$CommentsStateErrorImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl> implements _$$CommentsStateErrorImplCopyWith<$Res> { - __$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value, $Res Function(_$CommentsStateErrorImpl) _then) : super(_value, _then); + __$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value, + $Res Function(_$CommentsStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -528,7 +551,8 @@ class _$CommentsStateErrorImpl implements CommentsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -540,7 +564,8 @@ class _$CommentsStateErrorImpl implements CommentsStateError { @override @pragma('vm:prefer-inline') _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => - __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>(this, _$identity); + __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -618,12 +643,14 @@ class _$CommentsStateErrorImpl implements CommentsStateError { } abstract class CommentsStateError implements CommentsState { - const factory CommentsStateError({required final String errorMessage}) = _$CommentsStateErrorImpl; + const factory CommentsStateError({required final String errorMessage}) = + _$CommentsStateErrorImpl; String get errorMessage; /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart b/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart index e1797ea0..dd30f73d 100644 --- a/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$DietsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$DietsState { /// @nodoc abstract class $DietsStateCopyWith<$Res> { - factory $DietsStateCopyWith(DietsState value, $Res Function(DietsState) then) = _$DietsStateCopyWithImpl<$Res, DietsState>; + factory $DietsStateCopyWith( + DietsState value, $Res Function(DietsState) then) = + _$DietsStateCopyWithImpl<$Res, DietsState>; } /// @nodoc -class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> implements $DietsStateCopyWith<$Res> { +class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> + implements $DietsStateCopyWith<$Res> { _$DietsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +91,18 @@ class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> implements $DietsS /// @nodoc abstract class _$$DietsStateImplCopyWith<$Res> { - factory _$$DietsStateImplCopyWith(_$DietsStateImpl value, $Res Function(_$DietsStateImpl) then) = __$$DietsStateImplCopyWithImpl<$Res>; + factory _$$DietsStateImplCopyWith( + _$DietsStateImpl value, $Res Function(_$DietsStateImpl) then) = + __$$DietsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$DietsStateImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateImpl> implements _$$DietsStateImplCopyWith<$Res> { - __$$DietsStateImplCopyWithImpl(_$DietsStateImpl _value, $Res Function(_$DietsStateImpl) _then) : super(_value, _then); +class __$$DietsStateImplCopyWithImpl<$Res> + extends _$DietsStateCopyWithImpl<$Res, _$DietsStateImpl> + implements _$$DietsStateImplCopyWith<$Res> { + __$$DietsStateImplCopyWithImpl( + _$DietsStateImpl _value, $Res Function(_$DietsStateImpl) _then) + : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +120,8 @@ class _$DietsStateImpl implements _DietsState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$DietsStateImpl); } @override @@ -200,14 +208,18 @@ abstract class _DietsState implements DietsState { /// @nodoc abstract class _$$DietsStateLoadingImplCopyWith<$Res> { - factory _$$DietsStateLoadingImplCopyWith(_$DietsStateLoadingImpl value, $Res Function(_$DietsStateLoadingImpl) then) = + factory _$$DietsStateLoadingImplCopyWith(_$DietsStateLoadingImpl value, + $Res Function(_$DietsStateLoadingImpl) then) = __$$DietsStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$DietsStateLoadingImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadingImpl> +class __$$DietsStateLoadingImplCopyWithImpl<$Res> + extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadingImpl> implements _$$DietsStateLoadingImplCopyWith<$Res> { - __$$DietsStateLoadingImplCopyWithImpl(_$DietsStateLoadingImpl _value, $Res Function(_$DietsStateLoadingImpl) _then) : super(_value, _then); + __$$DietsStateLoadingImplCopyWithImpl(_$DietsStateLoadingImpl _value, + $Res Function(_$DietsStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +237,8 @@ class _$DietsStateLoadingImpl implements DietsStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$DietsStateLoadingImpl); } @override @@ -312,9 +325,9 @@ abstract class DietsStateLoading implements DietsState { /// @nodoc abstract class _$$DietsStateLoadedImplCopyWith<$Res> { - factory _$$DietsStateLoadedImplCopyWith(_$DietsStateLoadedImpl value, $Res Function(_$DietsStateLoadedImpl) then) = + factory _$$DietsStateLoadedImplCopyWith(_$DietsStateLoadedImpl value, + $Res Function(_$DietsStateLoadedImpl) then) = __$$DietsStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({DietsPagination diets}); @@ -322,9 +335,12 @@ abstract class _$$DietsStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$DietsStateLoadedImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadedImpl> +class __$$DietsStateLoadedImplCopyWithImpl<$Res> + extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadedImpl> implements _$$DietsStateLoadedImplCopyWith<$Res> { - __$$DietsStateLoadedImplCopyWithImpl(_$DietsStateLoadedImpl _value, $Res Function(_$DietsStateLoadedImpl) _then) : super(_value, _then); + __$$DietsStateLoadedImplCopyWithImpl(_$DietsStateLoadedImpl _value, + $Res Function(_$DietsStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -368,7 +384,9 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$DietsStateLoadedImpl && (identical(other.diets, diets) || other.diets == diets)); + (other.runtimeType == runtimeType && + other is _$DietsStateLoadedImpl && + (identical(other.diets, diets) || other.diets == diets)); } @override @@ -379,7 +397,9 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => __$$DietsStateLoadedImplCopyWithImpl<_$DietsStateLoadedImpl>(this, _$identity); + _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => + __$$DietsStateLoadedImplCopyWithImpl<_$DietsStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -457,27 +477,34 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { } abstract class DietsStateLoaded implements DietsState { - const factory DietsStateLoaded({required final DietsPagination diets}) = _$DietsStateLoadedImpl; + const factory DietsStateLoaded({required final DietsPagination diets}) = + _$DietsStateLoadedImpl; DietsPagination get diets; /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$DietsStateErrorImplCopyWith<$Res> { - factory _$$DietsStateErrorImplCopyWith(_$DietsStateErrorImpl value, $Res Function(_$DietsStateErrorImpl) then) = __$$DietsStateErrorImplCopyWithImpl<$Res>; - + factory _$$DietsStateErrorImplCopyWith(_$DietsStateErrorImpl value, + $Res Function(_$DietsStateErrorImpl) then) = + __$$DietsStateErrorImplCopyWithImpl<$Res>; @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$DietsStateErrorImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateErrorImpl> implements _$$DietsStateErrorImplCopyWith<$Res> { - __$$DietsStateErrorImplCopyWithImpl(_$DietsStateErrorImpl _value, $Res Function(_$DietsStateErrorImpl) _then) : super(_value, _then); +class __$$DietsStateErrorImplCopyWithImpl<$Res> + extends _$DietsStateCopyWithImpl<$Res, _$DietsStateErrorImpl> + implements _$$DietsStateErrorImplCopyWith<$Res> { + __$$DietsStateErrorImplCopyWithImpl( + _$DietsStateErrorImpl _value, $Res Function(_$DietsStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -513,7 +540,8 @@ class _$DietsStateErrorImpl implements DietsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -524,7 +552,9 @@ class _$DietsStateErrorImpl implements DietsStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => __$$DietsStateErrorImplCopyWithImpl<_$DietsStateErrorImpl>(this, _$identity); + _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => + __$$DietsStateErrorImplCopyWithImpl<_$DietsStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -602,12 +632,14 @@ class _$DietsStateErrorImpl implements DietsStateError { } abstract class DietsStateError implements DietsState { - const factory DietsStateError({required final String errorMessage}) = _$DietsStateErrorImpl; + const factory DietsStateError({required final String errorMessage}) = + _$DietsStateErrorImpl; String get errorMessage; /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart b/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart index 11cbd4e2..83df5eb0 100644 --- a/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart +++ b/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart @@ -7,12 +7,16 @@ class FeedCubit extends Cubit { int currentPage = 1; late int lastPage; bool isLoading = false; + String? _query; FeedCubit({required this.feedRepository}) : super(const FeedState.loading()); - loadFeedBlogPostList() async { + loadFeedBlogPostList({ + String? query, + }) async { try { - final feedBlogPosts = await feedRepository.getFeedBlogPosts(); + _query = query; + final feedBlogPosts = await feedRepository.getFeedBlogPosts(query: query); lastPage = feedBlogPosts.meta.lastPage; emit( FeedState.loaded( @@ -34,7 +38,10 @@ class FeedCubit extends Cubit { try { if (currentPage < lastPage) { currentPage++; - final feedBlogPosts = await feedRepository.getFeedBlogPosts(page: currentPage); + final feedBlogPosts = await feedRepository.getFeedBlogPosts( + page: currentPage, + query: _query, + ); isLoading = false; emit( FeedState.loaded( @@ -52,7 +59,7 @@ class FeedCubit extends Cubit { } } - likePost(int id) async => await feedRepository.likeBlogPost(id); + likePost(int id) async => await feedRepository.likeBlogPost(id: id); - unlikedPost(int id) async => await feedRepository.unlikedBlogPost(id); + unlikedPost(int id) async => await feedRepository.unlikedBlogPost(id: id); } diff --git a/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart b/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart index 377ed8d7..70cb30d4 100644 --- a/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart @@ -20,16 +20,18 @@ mixin _$FeedState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List feedBlogPostList, bool isLoading) loaded, + required TResult Function( + List feedBlogPostList, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +39,8 @@ mixin _$FeedState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? loaded, + TResult Function(List feedBlogPostList, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,16 +74,17 @@ mixin _$FeedState { /// @nodoc abstract class $FeedStateCopyWith<$Res> { - factory $FeedStateCopyWith(FeedState value, $Res Function(FeedState) then) = _$FeedStateCopyWithImpl<$Res, FeedState>; + factory $FeedStateCopyWith(FeedState value, $Res Function(FeedState) then) = + _$FeedStateCopyWithImpl<$Res, FeedState>; } /// @nodoc -class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> implements $FeedStateCopyWith<$Res> { +class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> + implements $FeedStateCopyWith<$Res> { _$FeedStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +94,18 @@ class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> implements $FeedStat /// @nodoc abstract class _$$FeedStateImplCopyWith<$Res> { - factory _$$FeedStateImplCopyWith(_$FeedStateImpl value, $Res Function(_$FeedStateImpl) then) = __$$FeedStateImplCopyWithImpl<$Res>; + factory _$$FeedStateImplCopyWith( + _$FeedStateImpl value, $Res Function(_$FeedStateImpl) then) = + __$$FeedStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$FeedStateImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateImpl> implements _$$FeedStateImplCopyWith<$Res> { - __$$FeedStateImplCopyWithImpl(_$FeedStateImpl _value, $Res Function(_$FeedStateImpl) _then) : super(_value, _then); +class __$$FeedStateImplCopyWithImpl<$Res> + extends _$FeedStateCopyWithImpl<$Res, _$FeedStateImpl> + implements _$$FeedStateImplCopyWith<$Res> { + __$$FeedStateImplCopyWithImpl( + _$FeedStateImpl _value, $Res Function(_$FeedStateImpl) _then) + : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +123,8 @@ class _$FeedStateImpl implements _FeedState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$FeedStateImpl); } @override @@ -124,7 +135,9 @@ class _$FeedStateImpl implements _FeedState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List feedBlogPostList, bool isLoading) loaded, + required TResult Function( + List feedBlogPostList, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -135,7 +148,8 @@ class _$FeedStateImpl implements _FeedState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -146,7 +160,8 @@ class _$FeedStateImpl implements _FeedState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? loaded, + TResult Function(List feedBlogPostList, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -200,14 +215,18 @@ abstract class _FeedState implements FeedState { /// @nodoc abstract class _$$FeedStateLoadingImplCopyWith<$Res> { - factory _$$FeedStateLoadingImplCopyWith(_$FeedStateLoadingImpl value, $Res Function(_$FeedStateLoadingImpl) then) = + factory _$$FeedStateLoadingImplCopyWith(_$FeedStateLoadingImpl value, + $Res Function(_$FeedStateLoadingImpl) then) = __$$FeedStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$FeedStateLoadingImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadingImpl> +class __$$FeedStateLoadingImplCopyWithImpl<$Res> + extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadingImpl> implements _$$FeedStateLoadingImplCopyWith<$Res> { - __$$FeedStateLoadingImplCopyWithImpl(_$FeedStateLoadingImpl _value, $Res Function(_$FeedStateLoadingImpl) _then) : super(_value, _then); + __$$FeedStateLoadingImplCopyWithImpl(_$FeedStateLoadingImpl _value, + $Res Function(_$FeedStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +244,8 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$FeedStateLoadingImpl); } @override @@ -236,7 +256,9 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List feedBlogPostList, bool isLoading) loaded, + required TResult Function( + List feedBlogPostList, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -247,7 +269,8 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -258,7 +281,8 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? loaded, + TResult Function(List feedBlogPostList, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -312,15 +336,20 @@ abstract class FeedStateLoading implements FeedState { /// @nodoc abstract class _$$FeedStateLoadedImplCopyWith<$Res> { - factory _$$FeedStateLoadedImplCopyWith(_$FeedStateLoadedImpl value, $Res Function(_$FeedStateLoadedImpl) then) = __$$FeedStateLoadedImplCopyWithImpl<$Res>; - + factory _$$FeedStateLoadedImplCopyWith(_$FeedStateLoadedImpl value, + $Res Function(_$FeedStateLoadedImpl) then) = + __$$FeedStateLoadedImplCopyWithImpl<$Res>; @useResult $Res call({List feedBlogPostList, bool isLoading}); } /// @nodoc -class __$$FeedStateLoadedImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadedImpl> implements _$$FeedStateLoadedImplCopyWith<$Res> { - __$$FeedStateLoadedImplCopyWithImpl(_$FeedStateLoadedImpl _value, $Res Function(_$FeedStateLoadedImpl) _then) : super(_value, _then); +class __$$FeedStateLoadedImplCopyWithImpl<$Res> + extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadedImpl> + implements _$$FeedStateLoadedImplCopyWith<$Res> { + __$$FeedStateLoadedImplCopyWithImpl( + _$FeedStateLoadedImpl _value, $Res Function(_$FeedStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -346,13 +375,16 @@ class __$$FeedStateLoadedImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl< /// @nodoc class _$FeedStateLoadedImpl implements FeedStateLoaded { - const _$FeedStateLoadedImpl({required final List feedBlogPostList, required this.isLoading}) : _feedBlogPostList = feedBlogPostList; + const _$FeedStateLoadedImpl( + {required final List feedBlogPostList, + required this.isLoading}) + : _feedBlogPostList = feedBlogPostList; final List _feedBlogPostList; - @override List get feedBlogPostList { - if (_feedBlogPostList is EqualUnmodifiableListView) return _feedBlogPostList; + if (_feedBlogPostList is EqualUnmodifiableListView) + return _feedBlogPostList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_feedBlogPostList); } @@ -370,26 +402,33 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateLoadedImpl && - const DeepCollectionEquality().equals(other._feedBlogPostList, _feedBlogPostList) && - (identical(other.isLoading, isLoading) || other.isLoading == isLoading)); + const DeepCollectionEquality() + .equals(other._feedBlogPostList, _feedBlogPostList) && + (identical(other.isLoading, isLoading) || + other.isLoading == isLoading)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList), isLoading); + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_feedBlogPostList), isLoading); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => __$$FeedStateLoadedImplCopyWithImpl<_$FeedStateLoadedImpl>(this, _$identity); + _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => + __$$FeedStateLoadedImplCopyWithImpl<_$FeedStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List feedBlogPostList, bool isLoading) loaded, + required TResult Function( + List feedBlogPostList, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loaded(feedBlogPostList, isLoading); @@ -400,7 +439,8 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(feedBlogPostList, isLoading); @@ -411,7 +451,8 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? loaded, + TResult Function(List feedBlogPostList, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -460,29 +501,36 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { } abstract class FeedStateLoaded implements FeedState { - const factory FeedStateLoaded({required final List feedBlogPostList, required final bool isLoading}) = _$FeedStateLoadedImpl; + const factory FeedStateLoaded( + {required final List feedBlogPostList, + required final bool isLoading}) = _$FeedStateLoadedImpl; List get feedBlogPostList; - bool get isLoading; /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$FeedStateErrorImplCopyWith<$Res> { - factory _$$FeedStateErrorImplCopyWith(_$FeedStateErrorImpl value, $Res Function(_$FeedStateErrorImpl) then) = __$$FeedStateErrorImplCopyWithImpl<$Res>; - + factory _$$FeedStateErrorImplCopyWith(_$FeedStateErrorImpl value, + $Res Function(_$FeedStateErrorImpl) then) = + __$$FeedStateErrorImplCopyWithImpl<$Res>; @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$FeedStateErrorImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateErrorImpl> implements _$$FeedStateErrorImplCopyWith<$Res> { - __$$FeedStateErrorImplCopyWithImpl(_$FeedStateErrorImpl _value, $Res Function(_$FeedStateErrorImpl) _then) : super(_value, _then); +class __$$FeedStateErrorImplCopyWithImpl<$Res> + extends _$FeedStateCopyWithImpl<$Res, _$FeedStateErrorImpl> + implements _$$FeedStateErrorImplCopyWith<$Res> { + __$$FeedStateErrorImplCopyWithImpl( + _$FeedStateErrorImpl _value, $Res Function(_$FeedStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -518,7 +566,8 @@ class _$FeedStateErrorImpl implements FeedStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -529,14 +578,18 @@ class _$FeedStateErrorImpl implements FeedStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => __$$FeedStateErrorImplCopyWithImpl<_$FeedStateErrorImpl>(this, _$identity); + _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => + __$$FeedStateErrorImplCopyWithImpl<_$FeedStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List feedBlogPostList, bool isLoading) loaded, + required TResult Function( + List feedBlogPostList, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -547,7 +600,8 @@ class _$FeedStateErrorImpl implements FeedStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -558,7 +612,8 @@ class _$FeedStateErrorImpl implements FeedStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? loaded, + TResult Function(List feedBlogPostList, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -607,12 +662,14 @@ class _$FeedStateErrorImpl implements FeedStateError { } abstract class FeedStateError implements FeedState { - const factory FeedStateError({required final String errorMessage}) = _$FeedStateErrorImpl; + const factory FeedStateError({required final String errorMessage}) = + _$FeedStateErrorImpl; String get errorMessage; /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart index 93bcf399..621880fe 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart @@ -13,11 +13,6 @@ class RecipesCubit extends Cubit { bool isLoading = false; String? _query; - RecipesCubit({ - required this.feedRepository, - required this.recipeRepository, - }) : super(const RecipesState.loading()); - loadRecipesList({ String? query, }) async { @@ -40,6 +35,11 @@ class RecipesCubit extends Cubit { } } + RecipesCubit({ + required this.feedRepository, + required this.recipeRepository, + }) : super(const RecipesState.loading()); + loadNextPage() async { if (currentPage < lastPage && !isLoading) { isLoading = true; diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart index 3b29fac8..34100adb 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart @@ -20,16 +20,23 @@ mixin _$RecipesState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +44,9 @@ mixin _$RecipesState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,16 +80,18 @@ mixin _$RecipesState { /// @nodoc abstract class $RecipesStateCopyWith<$Res> { - factory $RecipesStateCopyWith(RecipesState value, $Res Function(RecipesState) then) = _$RecipesStateCopyWithImpl<$Res, RecipesState>; + factory $RecipesStateCopyWith( + RecipesState value, $Res Function(RecipesState) then) = + _$RecipesStateCopyWithImpl<$Res, RecipesState>; } /// @nodoc -class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> implements $RecipesStateCopyWith<$Res> { +class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> + implements $RecipesStateCopyWith<$Res> { _$RecipesStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +101,18 @@ class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> implements $Re /// @nodoc abstract class _$$RecipesStateImplCopyWith<$Res> { - factory _$$RecipesStateImplCopyWith(_$RecipesStateImpl value, $Res Function(_$RecipesStateImpl) then) = __$$RecipesStateImplCopyWithImpl<$Res>; + factory _$$RecipesStateImplCopyWith( + _$RecipesStateImpl value, $Res Function(_$RecipesStateImpl) then) = + __$$RecipesStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipesStateImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateImpl> implements _$$RecipesStateImplCopyWith<$Res> { - __$$RecipesStateImplCopyWithImpl(_$RecipesStateImpl _value, $Res Function(_$RecipesStateImpl) _then) : super(_value, _then); +class __$$RecipesStateImplCopyWithImpl<$Res> + extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateImpl> + implements _$$RecipesStateImplCopyWith<$Res> { + __$$RecipesStateImplCopyWithImpl( + _$RecipesStateImpl _value, $Res Function(_$RecipesStateImpl) _then) + : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +130,8 @@ class _$RecipesStateImpl implements _RecipesState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$RecipesStateImpl); } @override @@ -124,7 +142,13 @@ class _$RecipesStateImpl implements _RecipesState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -135,7 +159,9 @@ class _$RecipesStateImpl implements _RecipesState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -146,7 +172,9 @@ class _$RecipesStateImpl implements _RecipesState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -200,14 +228,18 @@ abstract class _RecipesState implements RecipesState { /// @nodoc abstract class _$$RecipesStateLoadingImplCopyWith<$Res> { - factory _$$RecipesStateLoadingImplCopyWith(_$RecipesStateLoadingImpl value, $Res Function(_$RecipesStateLoadingImpl) then) = + factory _$$RecipesStateLoadingImplCopyWith(_$RecipesStateLoadingImpl value, + $Res Function(_$RecipesStateLoadingImpl) then) = __$$RecipesStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipesStateLoadingImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadingImpl> +class __$$RecipesStateLoadingImplCopyWithImpl<$Res> + extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadingImpl> implements _$$RecipesStateLoadingImplCopyWith<$Res> { - __$$RecipesStateLoadingImplCopyWithImpl(_$RecipesStateLoadingImpl _value, $Res Function(_$RecipesStateLoadingImpl) _then) : super(_value, _then); + __$$RecipesStateLoadingImplCopyWithImpl(_$RecipesStateLoadingImpl _value, + $Res Function(_$RecipesStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +257,9 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$RecipesStateLoadingImpl); } @override @@ -236,7 +270,13 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -247,7 +287,9 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -258,7 +300,9 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -312,17 +356,25 @@ abstract class RecipesStateLoading implements RecipesState { /// @nodoc abstract class _$$RecipesStateLoadedImplCopyWith<$Res> { - factory _$$RecipesStateLoadedImplCopyWith(_$RecipesStateLoadedImpl value, $Res Function(_$RecipesStateLoadedImpl) then) = + factory _$$RecipesStateLoadedImplCopyWith(_$RecipesStateLoadedImpl value, + $Res Function(_$RecipesStateLoadedImpl) then) = __$$RecipesStateLoadedImplCopyWithImpl<$Res>; - @useResult - $Res call({List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading}); + $Res call( + {List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading}); } /// @nodoc -class __$$RecipesStateLoadedImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadedImpl> +class __$$RecipesStateLoadedImplCopyWithImpl<$Res> + extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadedImpl> implements _$$RecipesStateLoadedImplCopyWith<$Res> { - __$$RecipesStateLoadedImplCopyWithImpl(_$RecipesStateLoadedImpl _value, $Res Function(_$RecipesStateLoadedImpl) _then) : super(_value, _then); + __$$RecipesStateLoadedImplCopyWithImpl(_$RecipesStateLoadedImpl _value, + $Res Function(_$RecipesStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -374,7 +426,6 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { _selectedTags = selectedTags; final List _recipesList; - @override List get recipesList { if (_recipesList is EqualUnmodifiableListView) return _recipesList; @@ -383,7 +434,6 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { } final List _recipesTags; - @override List get recipesTags { if (_recipesTags is EqualUnmodifiableListView) return _recipesTags; @@ -392,7 +442,6 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { } final Set _selectedTags; - @override Set get selectedTags { if (_selectedTags is EqualUnmodifiableSetView) return _selectedTags; @@ -415,16 +464,26 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateLoadedImpl && - const DeepCollectionEquality().equals(other._recipesList, _recipesList) && - const DeepCollectionEquality().equals(other._recipesTags, _recipesTags) && - const DeepCollectionEquality().equals(other._selectedTags, _selectedTags) && - (identical(other.selectedTagsCounter, selectedTagsCounter) || other.selectedTagsCounter == selectedTagsCounter) && - (identical(other.isLoading, isLoading) || other.isLoading == isLoading)); + const DeepCollectionEquality() + .equals(other._recipesList, _recipesList) && + const DeepCollectionEquality() + .equals(other._recipesTags, _recipesTags) && + const DeepCollectionEquality() + .equals(other._selectedTags, _selectedTags) && + (identical(other.selectedTagsCounter, selectedTagsCounter) || + other.selectedTagsCounter == selectedTagsCounter) && + (identical(other.isLoading, isLoading) || + other.isLoading == isLoading)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_recipesList), const DeepCollectionEquality().hash(_recipesTags), - const DeepCollectionEquality().hash(_selectedTags), selectedTagsCounter, isLoading); + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(_recipesList), + const DeepCollectionEquality().hash(_recipesTags), + const DeepCollectionEquality().hash(_selectedTags), + selectedTagsCounter, + isLoading); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -432,17 +491,25 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { @override @pragma('vm:prefer-inline') _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => - __$$RecipesStateLoadedImplCopyWithImpl<_$RecipesStateLoadedImpl>(this, _$identity); + __$$RecipesStateLoadedImplCopyWithImpl<_$RecipesStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { - return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); + return loaded( + recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); } @override @@ -450,10 +517,13 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { - return loaded?.call(recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); + return loaded?.call( + recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); } @override @@ -461,12 +531,15 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { if (loaded != null) { - return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); + return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter, + isLoading); } return orElse(); } @@ -518,34 +591,34 @@ abstract class RecipesStateLoaded implements RecipesState { required final bool isLoading}) = _$RecipesStateLoadedImpl; List get recipesList; - List get recipesTags; - Set get selectedTags; - int get selectedTagsCounter; - bool get isLoading; /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$RecipesStateErrorImplCopyWith<$Res> { - factory _$$RecipesStateErrorImplCopyWith(_$RecipesStateErrorImpl value, $Res Function(_$RecipesStateErrorImpl) then) = + factory _$$RecipesStateErrorImplCopyWith(_$RecipesStateErrorImpl value, + $Res Function(_$RecipesStateErrorImpl) then) = __$$RecipesStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$RecipesStateErrorImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateErrorImpl> +class __$$RecipesStateErrorImplCopyWithImpl<$Res> + extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateErrorImpl> implements _$$RecipesStateErrorImplCopyWith<$Res> { - __$$RecipesStateErrorImplCopyWithImpl(_$RecipesStateErrorImpl _value, $Res Function(_$RecipesStateErrorImpl) _then) : super(_value, _then); + __$$RecipesStateErrorImplCopyWithImpl(_$RecipesStateErrorImpl _value, + $Res Function(_$RecipesStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -581,7 +654,8 @@ class _$RecipesStateErrorImpl implements RecipesStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -592,14 +666,22 @@ class _$RecipesStateErrorImpl implements RecipesStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => __$$RecipesStateErrorImplCopyWithImpl<_$RecipesStateErrorImpl>(this, _$identity); + _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => + __$$RecipesStateErrorImplCopyWithImpl<_$RecipesStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -610,7 +692,9 @@ class _$RecipesStateErrorImpl implements RecipesStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -621,7 +705,9 @@ class _$RecipesStateErrorImpl implements RecipesStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -670,12 +756,14 @@ class _$RecipesStateErrorImpl implements RecipesStateError { } abstract class RecipesStateError implements RecipesState { - const factory RecipesStateError({required final String errorMessage}) = _$RecipesStateErrorImpl; + const factory RecipesStateError({required final String errorMessage}) = + _$RecipesStateErrorImpl; String get errorMessage; /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/pages/feed_screen.dart b/lib/features/feed/presentation/pages/feed_screen.dart index 02691888..e74a9cf3 100644 --- a/lib/features/feed/presentation/pages/feed_screen.dart +++ b/lib/features/feed/presentation/pages/feed_screen.dart @@ -87,22 +87,11 @@ class _FeedScreenState extends State { await showModalBottomSheet( useRootNavigator: true, context: context, - builder: (context) { - return BlocBuilder( - builder: (BuildContext context, RecipesState state) { - if (state is RecipesStateLoaded) { - return TagsModalWidget( - tagsList: state.recipesTags, - selectedTags: state.selectedTags, - ); - } else { - return Container(); - } - }, - ); - }, + builder: (context) => TagsModalWidget( + recipesCubit: recipesCubit, + ), ); - context.read().loadRecipesList(); + recipesCubit.loadRecipesList(); }, ) : null, @@ -402,8 +391,11 @@ class _FeedScreenState extends State { Duration(milliseconds: 500), () { switch (_selectedChipIndex) { + case 0: + feedCubit.loadFeedBlogPostList(query: query); + break; case 1: - context.read().loadRecipesList(query: query); + recipesCubit.loadRecipesList(query: query); break; } }, @@ -414,8 +406,12 @@ class _FeedScreenState extends State { Duration(milliseconds: 500), () { switch (_selectedChipIndex) { + case 0: + feedCubit.loadFeedBlogPostList(); + break; case 1: - context.read().loadRecipesList(query: query); + recipesCubit.loadRecipesList(); + break; } }, ); diff --git a/lib/features/feed/presentation/widgets/blog_post_widget.dart b/lib/features/feed/presentation/widgets/blog_post_widget.dart index b3b6024c..781024cb 100644 --- a/lib/features/feed/presentation/widgets/blog_post_widget.dart +++ b/lib/features/feed/presentation/widgets/blog_post_widget.dart @@ -105,7 +105,9 @@ class _BlogPostWidgetState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 4), child: Html( - data: widget.feedBlogPostModel.description, + data: widget.feedBlogPostModel.description.length > 200 + ? widget.feedBlogPostModel.description.substring(0, 200) + : widget.feedBlogPostModel.description, style: { "*": Style( color: Colors.black87, @@ -113,6 +115,18 @@ class _BlogPostWidgetState extends State { }, ), ), + if (widget.feedBlogPostModel.description.length > 200) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Text( + 'Читать полностью...', + style: TextStyle( + height: 1, + color: appTheme.blueA400, + decoration: TextDecoration.underline, + ), + ), + ), if (widget.feedBlogPostModel.title.isNotEmpty || widget.feedBlogPostModel.description.isNotEmpty) SizedBox(height: 8), GestureDetector( onTap: () { diff --git a/lib/features/feed/presentation/widgets/diets_widget.dart b/lib/features/feed/presentation/widgets/diets_widget.dart index 038e1c73..ce8a9e15 100644 --- a/lib/features/feed/presentation/widgets/diets_widget.dart +++ b/lib/features/feed/presentation/widgets/diets_widget.dart @@ -1,6 +1,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; @@ -124,17 +125,30 @@ class _DietsWidgetState extends State { ), ), ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 4), - child: Html( - data: widget.diet.details, - style: { - "*": Style( - color: Colors.black87, - ), - }, + if (widget.diet.details.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Html( + data: widget.diet.details.length > 200 ? widget.diet.details.substring(0, 200) : widget.diet.details, + style: { + "*": Style( + color: Colors.black87, + ), + }, + ), + ), + if (widget.diet.details.length > 200) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Text( + 'Читать полностью...', + style: TextStyle( + height: 1, + color: appTheme.blueA400, + decoration: TextDecoration.underline, + ), + ), ), - ), SizedBox(height: 12), ], ), diff --git a/lib/features/feed/presentation/widgets/recipes_widget.dart b/lib/features/feed/presentation/widgets/recipes_widget.dart index 16291797..348ac841 100644 --- a/lib/features/feed/presentation/widgets/recipes_widget.dart +++ b/lib/features/feed/presentation/widgets/recipes_widget.dart @@ -1,6 +1,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/features/feed/models/recipes_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; @@ -124,17 +125,30 @@ class _RecipesWidgetState extends State { ), ), ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 4), - child: Html( - data: widget.recipes.description, - style: { - "*": Style( - color: Colors.black87, - ), - }, + if (widget.recipes.description.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Html( + data: widget.recipes.description.length > 200 ? widget.recipes.description.substring(0, 200) : widget.recipes.description, + style: { + "*": Style( + color: Colors.black87, + ), + }, + ), + ), + if (widget.recipes.description.length > 200) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Text( + 'Читать полностью...', + style: TextStyle( + height: 1, + color: appTheme.blueA400, + decoration: TextDecoration.underline, + ), + ), ), - ), SizedBox(height: 12), ], ), diff --git a/lib/features/feed/presentation/widgets/tags_modal_widget.dart b/lib/features/feed/presentation/widgets/tags_modal_widget.dart index 5d66b330..21618511 100644 --- a/lib/features/feed/presentation/widgets/tags_modal_widget.dart +++ b/lib/features/feed/presentation/widgets/tags_modal_widget.dart @@ -1,17 +1,16 @@ import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart'; +import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart'; import 'package:eatvio_app/features/recipes/models/recipe_tag_model.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class TagsModalWidget extends StatefulWidget { - final List tagsList; - final Set selectedTags; + final RecipesCubit recipesCubit; const TagsModalWidget({ super.key, - required this.tagsList, - required this.selectedTags, + required this.recipesCubit, }); @override @@ -21,20 +20,29 @@ class TagsModalWidget extends StatefulWidget { class _TagsModalWidgetState extends State { @override Widget build(BuildContext context) { - return Container( - padding: EdgeInsets.all(16), - width: MediaQuery.of(context).size.width, - child: Wrap( - spacing: 8, - runSpacing: -8, - children: [ - for (int i = 0; i < widget.tagsList.length; i++) - _tagChip( - tag: widget.tagsList[i], - isSelected: widget.selectedTags.contains(widget.tagsList[i].id), + return BlocBuilder( + bloc: widget.recipesCubit, + builder: (BuildContext context, RecipesState state) { + if (state is RecipesStateLoaded) { + return Container( + padding: EdgeInsets.all(16), + width: MediaQuery.of(context).size.width, + child: Wrap( + spacing: 8, + runSpacing: -8, + children: [ + for (int i = 0; i < state.recipesTags.length; i++) + _tagChip( + tag: state.recipesTags[i], + isSelected: state.selectedTags.contains(state.recipesTags[i].id), + ), + ], ), - ], - ), + ); + } else { + return Container(); + } + }, ); } @@ -58,7 +66,7 @@ class _TagsModalWidgetState extends State { ), selected: isSelected, backgroundColor: appTheme.gray100, - onSelected: (bool selected) => context.read().updateTags(tag), + onSelected: (bool selected) => widget.recipesCubit.updateTags(tag), label: Text( '${tag.name} ${tag.recipesCount}', ), diff --git a/lib/features/feed/repositories/feed_repository.dart b/lib/features/feed/repositories/feed_repository.dart index 7d6397d2..459923fc 100644 --- a/lib/features/feed/repositories/feed_repository.dart +++ b/lib/features/feed/repositories/feed_repository.dart @@ -7,17 +7,29 @@ import 'package:eatvio_app/features/feed/services/feed_service.dart'; class FeedRepository { final FeedService feedService; - FeedRepository({required this.feedService}); + FeedRepository({ + required this.feedService, + }); - Future getFeedBlogPosts({int page = 1}) async { + Future getFeedBlogPosts({ + String? query, + int page = 1, + }) async { try { - return (await feedService.getBlogPostList(page: page)); + return (await feedService.getBlogPostList( + page: page, + query: query, + )); } catch (e) { rethrow; } } - Future> getRecipes({String? query, List? tags, int page = 1}) async { + Future> getRecipes({ + String? query, + List? tags, + int page = 1, + }) async { try { return (await feedService.getRecipes( query: query, @@ -30,15 +42,23 @@ class FeedRepository { } } - Future getDiets({int page = 1}) async { + Future getDiets({ + int page = 1, + String? query, + }) async { try { - return (await feedService.getDiets(page: page)); + return (await feedService.getDiets( + page: page, + query: query, + )); } catch (e) { rethrow; } } - Future getBlogPostComments(String id) async { + Future getBlogPostComments({ + required String id, + }) async { try { return (await feedService.getBlogPostComments(id: id)); } catch (e) { @@ -62,7 +82,9 @@ class FeedRepository { } } - Future getDietsComments(String id) async { + Future getDietsComments({ + required String id, + }) async { try { return (await feedService.getDietsComments(id: id)); } catch (e) { @@ -86,7 +108,9 @@ class FeedRepository { } } - Future getRecipesComments(String id) async { + Future getRecipesComments({ + required String id, + }) async { try { return (await feedService.getRecipesComments(id: id)); } catch (e) { @@ -110,7 +134,9 @@ class FeedRepository { } } - Future likeBlogPost(int id) async { + Future likeBlogPost({ + required int id, + }) async { try { await feedService.likeBlogPost(id: id); } catch (e) { @@ -118,7 +144,9 @@ class FeedRepository { } } - Future unlikedBlogPost(int id) async { + Future unlikedBlogPost({ + required int id, + }) async { try { await feedService.unlikedBlogPost(id: id); } catch (e) { diff --git a/lib/features/feed/services/feed_service.dart b/lib/features/feed/services/feed_service.dart index db211b26..9d0cd1bd 100644 --- a/lib/features/feed/services/feed_service.dart +++ b/lib/features/feed/services/feed_service.dart @@ -11,9 +11,10 @@ part 'feed_service.g.dart'; abstract class FeedService { factory FeedService(Dio dio, {String baseUrl}) = _FeedService; - @GET('/api/blogPosts/index?page={page}') + @GET('/api/blogPosts/index') Future getBlogPostList({ @Path() required int page, + @Query('query_search') String? query, }); @GET('/api/recipes/index') @@ -26,6 +27,7 @@ abstract class FeedService { @GET('/api/diets/index') Future getDiets({ @Path() required int page, + @Query('query_search') String? query, }); @GET('/api/blogPosts/{id}/comments/show') diff --git a/lib/features/feed/services/feed_service.g.dart b/lib/features/feed/services/feed_service.g.dart index fe36ea64..d074b0a2 100644 --- a/lib/features/feed/services/feed_service.g.dart +++ b/lib/features/feed/services/feed_service.g.dart @@ -22,9 +22,13 @@ class _FeedService implements FeedService { final ParseErrorLogger? errorLogger; @override - Future getBlogPostList({required int page}) async { + Future getBlogPostList({ + required int page, + String? query, + }) async { final _extra = {}; - final queryParameters = {}; + final queryParameters = {r'query_search': query}; + queryParameters.removeWhere((k, v) => v == null); final _headers = {}; const Map? _data = null; final _options = _setStreamType(Options( @@ -34,7 +38,7 @@ class _FeedService implements FeedService { ) .compose( _dio.options, - '/api/blogPosts/index?page=${page}', + '/api/blogPosts/index', queryParameters: queryParameters, data: _data, ) @@ -96,9 +100,13 @@ class _FeedService implements FeedService { } @override - Future getDiets({required int page}) async { + Future getDiets({ + required int page, + String? query, + }) async { final _extra = {}; - final queryParameters = {}; + final queryParameters = {r'query_search': query}; + queryParameters.removeWhere((k, v) => v == null); final _headers = {}; const Map? _data = null; final _options = _setStreamType(Options( @@ -398,7 +406,9 @@ class _FeedService implements FeedService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/plans/models/plan_pagination_model.freezed.dart b/lib/features/plans/models/plan_pagination_model.freezed.dart index 59ad65ae..caa2ef10 100644 --- a/lib/features/plans/models/plan_pagination_model.freezed.dart +++ b/lib/features/plans/models/plan_pagination_model.freezed.dart @@ -22,10 +22,8 @@ PlanPaginationModel _$PlanPaginationModelFromJson(Map json) { mixin _$PlanPaginationModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; - @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; - @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -35,29 +33,32 @@ mixin _$PlanPaginationModel { /// Create a copy of PlanPaginationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PlanPaginationModelCopyWith get copyWith => throw _privateConstructorUsedError; + $PlanPaginationModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $PlanPaginationModelCopyWith<$Res> { - factory $PlanPaginationModelCopyWith(PlanPaginationModel value, $Res Function(PlanPaginationModel) then) = + factory $PlanPaginationModelCopyWith( + PlanPaginationModel value, $Res Function(PlanPaginationModel) then) = _$PlanPaginationModelCopyWithImpl<$Res, PlanPaginationModel>; - @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; - $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$PlanPaginationModelCopyWithImpl<$Res, $Val extends PlanPaginationModel> implements $PlanPaginationModelCopyWith<$Res> { +class _$PlanPaginationModelCopyWithImpl<$Res, $Val extends PlanPaginationModel> + implements $PlanPaginationModelCopyWith<$Res> { _$PlanPaginationModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -108,25 +109,31 @@ class _$PlanPaginationModelCopyWithImpl<$Res, $Val extends PlanPaginationModel> } /// @nodoc -abstract class _$$PlanPaginationModelImplCopyWith<$Res> implements $PlanPaginationModelCopyWith<$Res> { - factory _$$PlanPaginationModelImplCopyWith(_$PlanPaginationModelImpl value, $Res Function(_$PlanPaginationModelImpl) then) = +abstract class _$$PlanPaginationModelImplCopyWith<$Res> + implements $PlanPaginationModelCopyWith<$Res> { + factory _$$PlanPaginationModelImplCopyWith(_$PlanPaginationModelImpl value, + $Res Function(_$PlanPaginationModelImpl) then) = __$$PlanPaginationModelImplCopyWithImpl<$Res>; - @override @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; - @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$PlanPaginationModelImplCopyWithImpl<$Res> extends _$PlanPaginationModelCopyWithImpl<$Res, _$PlanPaginationModelImpl> +class __$$PlanPaginationModelImplCopyWithImpl<$Res> + extends _$PlanPaginationModelCopyWithImpl<$Res, _$PlanPaginationModelImpl> implements _$$PlanPaginationModelImplCopyWith<$Res> { - __$$PlanPaginationModelImplCopyWithImpl(_$PlanPaginationModelImpl _value, $Res Function(_$PlanPaginationModelImpl) _then) : super(_value, _then); + __$$PlanPaginationModelImplCopyWithImpl(_$PlanPaginationModelImpl _value, + $Res Function(_$PlanPaginationModelImpl) _then) + : super(_value, _then); /// Create a copy of PlanPaginationModel /// with the given fields replaced by the non-null parameter values. @@ -158,13 +165,15 @@ class __$$PlanPaginationModelImplCopyWithImpl<$Res> extends _$PlanPaginationMode @JsonSerializable() class _$PlanPaginationModelImpl implements _PlanPaginationModel { const _$PlanPaginationModelImpl( - {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$PlanPaginationModelImpl.fromJson(Map json) => _$$PlanPaginationModelImplFromJson(json); + factory _$PlanPaginationModelImpl.fromJson(Map json) => + _$$PlanPaginationModelImplFromJson(json); final List _data; - @override @JsonKey(name: "data") List get data { @@ -197,7 +206,8 @@ class _$PlanPaginationModelImpl implements _PlanPaginationModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of PlanPaginationModel /// with the given fields replaced by the non-null parameter values. @@ -205,7 +215,8 @@ class _$PlanPaginationModelImpl implements _PlanPaginationModel { @override @pragma('vm:prefer-inline') _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => - __$$PlanPaginationModelImplCopyWithImpl<_$PlanPaginationModelImpl>(this, _$identity); + __$$PlanPaginationModelImplCopyWithImpl<_$PlanPaginationModelImpl>( + this, _$identity); @override Map toJson() { @@ -217,20 +228,20 @@ class _$PlanPaginationModelImpl implements _PlanPaginationModel { abstract class _PlanPaginationModel implements PlanPaginationModel { const factory _PlanPaginationModel( - {@JsonKey(name: "data") required final List data, - @JsonKey(name: "links") required final Links links, - @JsonKey(name: "meta") required final Meta meta}) = _$PlanPaginationModelImpl; + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required final Links links, + @JsonKey(name: "meta") required final Meta meta}) = + _$PlanPaginationModelImpl; - factory _PlanPaginationModel.fromJson(Map json) = _$PlanPaginationModelImpl.fromJson; + factory _PlanPaginationModel.fromJson(Map json) = + _$PlanPaginationModelImpl.fromJson; @override @JsonKey(name: "data") List get data; - @override @JsonKey(name: "links") Links get links; - @override @JsonKey(name: "meta") Meta get meta; @@ -239,7 +250,8 @@ abstract class _PlanPaginationModel implements PlanPaginationModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => + throw _privateConstructorUsedError; } PlanModel _$PlanModelFromJson(Map json) { @@ -250,46 +262,32 @@ PlanModel _$PlanModelFromJson(Map json) { mixin _$PlanModel { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "image") String get image => throw _privateConstructorUsedError; - @JsonKey(name: "duration") int get duration => throw _privateConstructorUsedError; - @JsonKey(name: "state") String get state => throw _privateConstructorUsedError; - @JsonKey(name: "type") PlanType get type => throw _privateConstructorUsedError; - @JsonKey(name: "details") String get details => throw _privateConstructorUsedError; - @JsonKey(name: "packets_count") int get packetsCount => throw _privateConstructorUsedError; - @JsonKey(name: "packet1_options") dynamic get packet1Options => throw _privateConstructorUsedError; - @JsonKey(name: "packet2_options") dynamic get packet2Options => throw _privateConstructorUsedError; - @JsonKey(name: "packet3_options") dynamic get packet3Options => throw _privateConstructorUsedError; - @JsonKey(name: "author") Author get author => throw _privateConstructorUsedError; - @JsonKey(name: "total_likes") int get totalLikes => throw _privateConstructorUsedError; - @JsonKey(name: "total_views") int get totalViews => throw _privateConstructorUsedError; - @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; @@ -299,13 +297,14 @@ mixin _$PlanModel { /// Create a copy of PlanModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PlanModelCopyWith get copyWith => throw _privateConstructorUsedError; + $PlanModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $PlanModelCopyWith<$Res> { - factory $PlanModelCopyWith(PlanModel value, $Res Function(PlanModel) then) = _$PlanModelCopyWithImpl<$Res, PlanModel>; - + factory $PlanModelCopyWith(PlanModel value, $Res Function(PlanModel) then) = + _$PlanModelCopyWithImpl<$Res, PlanModel>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -325,17 +324,16 @@ abstract class $PlanModelCopyWith<$Res> { @JsonKey(name: "total_comments") int totalComments}); $PlanTypeCopyWith<$Res> get type; - $AuthorCopyWith<$Res> get author; } /// @nodoc -class _$PlanModelCopyWithImpl<$Res, $Val extends PlanModel> implements $PlanModelCopyWith<$Res> { +class _$PlanModelCopyWithImpl<$Res, $Val extends PlanModel> + implements $PlanModelCopyWith<$Res> { _$PlanModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -446,9 +444,11 @@ class _$PlanModelCopyWithImpl<$Res, $Val extends PlanModel> implements $PlanMode } /// @nodoc -abstract class _$$PlanModelImplCopyWith<$Res> implements $PlanModelCopyWith<$Res> { - factory _$$PlanModelImplCopyWith(_$PlanModelImpl value, $Res Function(_$PlanModelImpl) then) = __$$PlanModelImplCopyWithImpl<$Res>; - +abstract class _$$PlanModelImplCopyWith<$Res> + implements $PlanModelCopyWith<$Res> { + factory _$$PlanModelImplCopyWith( + _$PlanModelImpl value, $Res Function(_$PlanModelImpl) then) = + __$$PlanModelImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -470,14 +470,17 @@ abstract class _$$PlanModelImplCopyWith<$Res> implements $PlanModelCopyWith<$Res @override $PlanTypeCopyWith<$Res> get type; - @override $AuthorCopyWith<$Res> get author; } /// @nodoc -class __$$PlanModelImplCopyWithImpl<$Res> extends _$PlanModelCopyWithImpl<$Res, _$PlanModelImpl> implements _$$PlanModelImplCopyWith<$Res> { - __$$PlanModelImplCopyWithImpl(_$PlanModelImpl _value, $Res Function(_$PlanModelImpl) _then) : super(_value, _then); +class __$$PlanModelImplCopyWithImpl<$Res> + extends _$PlanModelCopyWithImpl<$Res, _$PlanModelImpl> + implements _$$PlanModelImplCopyWith<$Res> { + __$$PlanModelImplCopyWithImpl( + _$PlanModelImpl _value, $Res Function(_$PlanModelImpl) _then) + : super(_value, _then); /// Create a copy of PlanModel /// with the given fields replaced by the non-null parameter values. @@ -585,7 +588,8 @@ class _$PlanModelImpl implements _PlanModel { @JsonKey(name: "total_views") required this.totalViews, @JsonKey(name: "total_comments") required this.totalComments}); - factory _$PlanModelImpl.fromJson(Map json) => _$$PlanModelImplFromJson(json); + factory _$PlanModelImpl.fromJson(Map json) => + _$$PlanModelImplFromJson(json); @override @JsonKey(name: "id") @@ -646,18 +650,26 @@ class _$PlanModelImpl implements _PlanModel { (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.image, image) || other.image == image) && - (identical(other.duration, duration) || other.duration == duration) && + (identical(other.duration, duration) || + other.duration == duration) && (identical(other.state, state) || other.state == state) && (identical(other.type, type) || other.type == type) && (identical(other.details, details) || other.details == details) && - (identical(other.packetsCount, packetsCount) || other.packetsCount == packetsCount) && - const DeepCollectionEquality().equals(other.packet1Options, packet1Options) && - const DeepCollectionEquality().equals(other.packet2Options, packet2Options) && - const DeepCollectionEquality().equals(other.packet3Options, packet3Options) && + (identical(other.packetsCount, packetsCount) || + other.packetsCount == packetsCount) && + const DeepCollectionEquality() + .equals(other.packet1Options, packet1Options) && + const DeepCollectionEquality() + .equals(other.packet2Options, packet2Options) && + const DeepCollectionEquality() + .equals(other.packet3Options, packet3Options) && (identical(other.author, author) || other.author == author) && - (identical(other.totalLikes, totalLikes) || other.totalLikes == totalLikes) && - (identical(other.totalViews, totalViews) || other.totalViews == totalViews) && - (identical(other.totalComments, totalComments) || other.totalComments == totalComments)); + (identical(other.totalLikes, totalLikes) || + other.totalLikes == totalLikes) && + (identical(other.totalViews, totalViews) || + other.totalViews == totalViews) && + (identical(other.totalComments, totalComments) || + other.totalComments == totalComments)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -685,7 +697,8 @@ class _$PlanModelImpl implements _PlanModel { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => __$$PlanModelImplCopyWithImpl<_$PlanModelImpl>(this, _$identity); + _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => + __$$PlanModelImplCopyWithImpl<_$PlanModelImpl>(this, _$identity); @override Map toJson() { @@ -697,80 +710,68 @@ class _$PlanModelImpl implements _PlanModel { abstract class _PlanModel implements PlanModel { const factory _PlanModel( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "image") required final String image, - @JsonKey(name: "duration") required final int duration, - @JsonKey(name: "state") required final String state, - @JsonKey(name: "type") required final PlanType type, - @JsonKey(name: "details") required final String details, - @JsonKey(name: "packets_count") required final int packetsCount, - @JsonKey(name: "packet1_options") final dynamic packet1Options, - @JsonKey(name: "packet2_options") final dynamic packet2Options, - @JsonKey(name: "packet3_options") final dynamic packet3Options, - @JsonKey(name: "author") required final Author author, - @JsonKey(name: "total_likes") required final int totalLikes, - @JsonKey(name: "total_views") required final int totalViews, - @JsonKey(name: "total_comments") required final int totalComments}) = _$PlanModelImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "image") required final String image, + @JsonKey(name: "duration") required final int duration, + @JsonKey(name: "state") required final String state, + @JsonKey(name: "type") required final PlanType type, + @JsonKey(name: "details") required final String details, + @JsonKey(name: "packets_count") required final int packetsCount, + @JsonKey(name: "packet1_options") final dynamic packet1Options, + @JsonKey(name: "packet2_options") final dynamic packet2Options, + @JsonKey(name: "packet3_options") final dynamic packet3Options, + @JsonKey(name: "author") required final Author author, + @JsonKey(name: "total_likes") required final int totalLikes, + @JsonKey(name: "total_views") required final int totalViews, + @JsonKey(name: "total_comments") required final int totalComments}) = + _$PlanModelImpl; - factory _PlanModel.fromJson(Map json) = _$PlanModelImpl.fromJson; + factory _PlanModel.fromJson(Map json) = + _$PlanModelImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "image") String get image; - @override @JsonKey(name: "duration") int get duration; - @override @JsonKey(name: "state") String get state; - @override @JsonKey(name: "type") PlanType get type; - @override @JsonKey(name: "details") String get details; - @override @JsonKey(name: "packets_count") int get packetsCount; - @override @JsonKey(name: "packet1_options") dynamic get packet1Options; - @override @JsonKey(name: "packet2_options") dynamic get packet2Options; - @override @JsonKey(name: "packet3_options") dynamic get packet3Options; - @override @JsonKey(name: "author") Author get author; - @override @JsonKey(name: "total_likes") int get totalLikes; - @override @JsonKey(name: "total_views") int get totalViews; - @override @JsonKey(name: "total_comments") int get totalComments; @@ -779,7 +780,8 @@ abstract class _PlanModel implements PlanModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => + throw _privateConstructorUsedError; } PacketOptions _$PacketOptionsFromJson(Map json) { @@ -790,13 +792,10 @@ PacketOptions _$PacketOptionsFromJson(Map json) { mixin _$PacketOptions { @JsonKey(name: "items") List get items => throw _privateConstructorUsedError; - @JsonKey(name: "price") dynamic get price => throw _privateConstructorUsedError; - @JsonKey(name: "short") String get short => throw _privateConstructorUsedError; - @JsonKey(name: "description") String get description => throw _privateConstructorUsedError; @@ -806,13 +805,15 @@ mixin _$PacketOptions { /// Create a copy of PacketOptions /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PacketOptionsCopyWith get copyWith => throw _privateConstructorUsedError; + $PacketOptionsCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $PacketOptionsCopyWith<$Res> { - factory $PacketOptionsCopyWith(PacketOptions value, $Res Function(PacketOptions) then) = _$PacketOptionsCopyWithImpl<$Res, PacketOptions>; - + factory $PacketOptionsCopyWith( + PacketOptions value, $Res Function(PacketOptions) then) = + _$PacketOptionsCopyWithImpl<$Res, PacketOptions>; @useResult $Res call( {@JsonKey(name: "items") List items, @@ -822,12 +823,12 @@ abstract class $PacketOptionsCopyWith<$Res> { } /// @nodoc -class _$PacketOptionsCopyWithImpl<$Res, $Val extends PacketOptions> implements $PacketOptionsCopyWith<$Res> { +class _$PacketOptionsCopyWithImpl<$Res, $Val extends PacketOptions> + implements $PacketOptionsCopyWith<$Res> { _$PacketOptionsCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -863,9 +864,11 @@ class _$PacketOptionsCopyWithImpl<$Res, $Val extends PacketOptions> implements $ } /// @nodoc -abstract class _$$PacketOptionsImplCopyWith<$Res> implements $PacketOptionsCopyWith<$Res> { - factory _$$PacketOptionsImplCopyWith(_$PacketOptionsImpl value, $Res Function(_$PacketOptionsImpl) then) = __$$PacketOptionsImplCopyWithImpl<$Res>; - +abstract class _$$PacketOptionsImplCopyWith<$Res> + implements $PacketOptionsCopyWith<$Res> { + factory _$$PacketOptionsImplCopyWith( + _$PacketOptionsImpl value, $Res Function(_$PacketOptionsImpl) then) = + __$$PacketOptionsImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -876,8 +879,12 @@ abstract class _$$PacketOptionsImplCopyWith<$Res> implements $PacketOptionsCopyW } /// @nodoc -class __$$PacketOptionsImplCopyWithImpl<$Res> extends _$PacketOptionsCopyWithImpl<$Res, _$PacketOptionsImpl> implements _$$PacketOptionsImplCopyWith<$Res> { - __$$PacketOptionsImplCopyWithImpl(_$PacketOptionsImpl _value, $Res Function(_$PacketOptionsImpl) _then) : super(_value, _then); +class __$$PacketOptionsImplCopyWithImpl<$Res> + extends _$PacketOptionsCopyWithImpl<$Res, _$PacketOptionsImpl> + implements _$$PacketOptionsImplCopyWith<$Res> { + __$$PacketOptionsImplCopyWithImpl( + _$PacketOptionsImpl _value, $Res Function(_$PacketOptionsImpl) _then) + : super(_value, _then); /// Create a copy of PacketOptions /// with the given fields replaced by the non-null parameter values. @@ -920,10 +927,10 @@ class _$PacketOptionsImpl implements _PacketOptions { @JsonKey(name: "description") required this.description}) : _items = items; - factory _$PacketOptionsImpl.fromJson(Map json) => _$$PacketOptionsImplFromJson(json); + factory _$PacketOptionsImpl.fromJson(Map json) => + _$$PacketOptionsImplFromJson(json); final List _items; - @override @JsonKey(name: "items") List get items { @@ -955,19 +962,26 @@ class _$PacketOptionsImpl implements _PacketOptions { const DeepCollectionEquality().equals(other._items, _items) && const DeepCollectionEquality().equals(other.price, price) && (identical(other.short, short) || other.short == short) && - (identical(other.description, description) || other.description == description)); + (identical(other.description, description) || + other.description == description)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_items), const DeepCollectionEquality().hash(price), short, description); + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(_items), + const DeepCollectionEquality().hash(price), + short, + description); /// Create a copy of PacketOptions /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => __$$PacketOptionsImplCopyWithImpl<_$PacketOptionsImpl>(this, _$identity); + _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => + __$$PacketOptionsImplCopyWithImpl<_$PacketOptionsImpl>(this, _$identity); @override Map toJson() { @@ -979,25 +993,24 @@ class _$PacketOptionsImpl implements _PacketOptions { abstract class _PacketOptions implements PacketOptions { const factory _PacketOptions( - {@JsonKey(name: "items") required final List items, - @JsonKey(name: "price") required final dynamic price, - @JsonKey(name: "short") required final String short, - @JsonKey(name: "description") required final String description}) = _$PacketOptionsImpl; + {@JsonKey(name: "items") required final List items, + @JsonKey(name: "price") required final dynamic price, + @JsonKey(name: "short") required final String short, + @JsonKey(name: "description") required final String description}) = + _$PacketOptionsImpl; - factory _PacketOptions.fromJson(Map json) = _$PacketOptionsImpl.fromJson; + factory _PacketOptions.fromJson(Map json) = + _$PacketOptionsImpl.fromJson; @override @JsonKey(name: "items") List get items; - @override @JsonKey(name: "price") dynamic get price; - @override @JsonKey(name: "short") String get short; - @override @JsonKey(name: "description") String get description; @@ -1006,7 +1019,8 @@ abstract class _PacketOptions implements PacketOptions { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => throw _privateConstructorUsedError; + _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => + throw _privateConstructorUsedError; } PlanType _$PlanTypeFromJson(Map json) { @@ -1017,13 +1031,10 @@ PlanType _$PlanTypeFromJson(Map json) { mixin _$PlanType { @JsonKey(name: "fit") bool get fit => throw _privateConstructorUsedError; - @JsonKey(name: "slim") bool get slim => throw _privateConstructorUsedError; - @JsonKey(name: "behavior") bool get behavior => throw _privateConstructorUsedError; - @JsonKey(name: "wellness") bool get wellness => throw _privateConstructorUsedError; @@ -1033,25 +1044,29 @@ mixin _$PlanType { /// Create a copy of PlanType /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PlanTypeCopyWith get copyWith => throw _privateConstructorUsedError; + $PlanTypeCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $PlanTypeCopyWith<$Res> { - factory $PlanTypeCopyWith(PlanType value, $Res Function(PlanType) then) = _$PlanTypeCopyWithImpl<$Res, PlanType>; - + factory $PlanTypeCopyWith(PlanType value, $Res Function(PlanType) then) = + _$PlanTypeCopyWithImpl<$Res, PlanType>; @useResult $Res call( - {@JsonKey(name: "fit") bool fit, @JsonKey(name: "slim") bool slim, @JsonKey(name: "behavior") bool behavior, @JsonKey(name: "wellness") bool wellness}); + {@JsonKey(name: "fit") bool fit, + @JsonKey(name: "slim") bool slim, + @JsonKey(name: "behavior") bool behavior, + @JsonKey(name: "wellness") bool wellness}); } /// @nodoc -class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType> implements $PlanTypeCopyWith<$Res> { +class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType> + implements $PlanTypeCopyWith<$Res> { _$PlanTypeCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -1087,18 +1102,27 @@ class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType> implements $PlanTypeCo } /// @nodoc -abstract class _$$PlanTypeImplCopyWith<$Res> implements $PlanTypeCopyWith<$Res> { - factory _$$PlanTypeImplCopyWith(_$PlanTypeImpl value, $Res Function(_$PlanTypeImpl) then) = __$$PlanTypeImplCopyWithImpl<$Res>; - +abstract class _$$PlanTypeImplCopyWith<$Res> + implements $PlanTypeCopyWith<$Res> { + factory _$$PlanTypeImplCopyWith( + _$PlanTypeImpl value, $Res Function(_$PlanTypeImpl) then) = + __$$PlanTypeImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey(name: "fit") bool fit, @JsonKey(name: "slim") bool slim, @JsonKey(name: "behavior") bool behavior, @JsonKey(name: "wellness") bool wellness}); + {@JsonKey(name: "fit") bool fit, + @JsonKey(name: "slim") bool slim, + @JsonKey(name: "behavior") bool behavior, + @JsonKey(name: "wellness") bool wellness}); } /// @nodoc -class __$$PlanTypeImplCopyWithImpl<$Res> extends _$PlanTypeCopyWithImpl<$Res, _$PlanTypeImpl> implements _$$PlanTypeImplCopyWith<$Res> { - __$$PlanTypeImplCopyWithImpl(_$PlanTypeImpl _value, $Res Function(_$PlanTypeImpl) _then) : super(_value, _then); +class __$$PlanTypeImplCopyWithImpl<$Res> + extends _$PlanTypeCopyWithImpl<$Res, _$PlanTypeImpl> + implements _$$PlanTypeImplCopyWith<$Res> { + __$$PlanTypeImplCopyWithImpl( + _$PlanTypeImpl _value, $Res Function(_$PlanTypeImpl) _then) + : super(_value, _then); /// Create a copy of PlanType /// with the given fields replaced by the non-null parameter values. @@ -1140,7 +1164,8 @@ class _$PlanTypeImpl implements _PlanType { @JsonKey(name: "behavior") required this.behavior, @JsonKey(name: "wellness") required this.wellness}); - factory _$PlanTypeImpl.fromJson(Map json) => _$$PlanTypeImplFromJson(json); + factory _$PlanTypeImpl.fromJson(Map json) => + _$$PlanTypeImplFromJson(json); @override @JsonKey(name: "fit") @@ -1167,8 +1192,10 @@ class _$PlanTypeImpl implements _PlanType { other is _$PlanTypeImpl && (identical(other.fit, fit) || other.fit == fit) && (identical(other.slim, slim) || other.slim == slim) && - (identical(other.behavior, behavior) || other.behavior == behavior) && - (identical(other.wellness, wellness) || other.wellness == wellness)); + (identical(other.behavior, behavior) || + other.behavior == behavior) && + (identical(other.wellness, wellness) || + other.wellness == wellness)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -1180,7 +1207,8 @@ class _$PlanTypeImpl implements _PlanType { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => __$$PlanTypeImplCopyWithImpl<_$PlanTypeImpl>(this, _$identity); + _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => + __$$PlanTypeImplCopyWithImpl<_$PlanTypeImpl>(this, _$identity); @override Map toJson() { @@ -1192,25 +1220,24 @@ class _$PlanTypeImpl implements _PlanType { abstract class _PlanType implements PlanType { const factory _PlanType( - {@JsonKey(name: "fit") required final bool fit, - @JsonKey(name: "slim") required final bool slim, - @JsonKey(name: "behavior") required final bool behavior, - @JsonKey(name: "wellness") required final bool wellness}) = _$PlanTypeImpl; + {@JsonKey(name: "fit") required final bool fit, + @JsonKey(name: "slim") required final bool slim, + @JsonKey(name: "behavior") required final bool behavior, + @JsonKey(name: "wellness") required final bool wellness}) = + _$PlanTypeImpl; - factory _PlanType.fromJson(Map json) = _$PlanTypeImpl.fromJson; + factory _PlanType.fromJson(Map json) = + _$PlanTypeImpl.fromJson; @override @JsonKey(name: "fit") bool get fit; - @override @JsonKey(name: "slim") bool get slim; - @override @JsonKey(name: "behavior") bool get behavior; - @override @JsonKey(name: "wellness") bool get wellness; @@ -1219,5 +1246,6 @@ abstract class _PlanType implements PlanType { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => throw _privateConstructorUsedError; + _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/plans/models/plan_pagination_model.g.dart b/lib/features/plans/models/plan_pagination_model.g.dart index 595e52b4..8f203fa8 100644 --- a/lib/features/plans/models/plan_pagination_model.g.dart +++ b/lib/features/plans/models/plan_pagination_model.g.dart @@ -6,19 +6,26 @@ part of 'plan_pagination_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PlanPaginationModelImpl _$$PlanPaginationModelImplFromJson(Map json) => _$PlanPaginationModelImpl( - data: (json['data'] as List).map((e) => PlanModel.fromJson(e as Map)).toList(), +_$PlanPaginationModelImpl _$$PlanPaginationModelImplFromJson( + Map json) => + _$PlanPaginationModelImpl( + data: (json['data'] as List) + .map((e) => PlanModel.fromJson(e as Map)) + .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$PlanPaginationModelImplToJson(_$PlanPaginationModelImpl instance) => { +Map _$$PlanPaginationModelImplToJson( + _$PlanPaginationModelImpl instance) => + { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$PlanModelImpl _$$PlanModelImplFromJson(Map json) => _$PlanModelImpl( +_$PlanModelImpl _$$PlanModelImplFromJson(Map json) => + _$PlanModelImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, image: json['image'] as String, @@ -36,7 +43,8 @@ _$PlanModelImpl _$$PlanModelImplFromJson(Map json) => _$PlanMod totalComments: (json['total_comments'] as num).toInt(), ); -Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => { +Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => + { 'id': instance.id, 'name': instance.name, 'image': instance.image, @@ -54,28 +62,32 @@ Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => json) => _$PacketOptionsImpl( +_$PacketOptionsImpl _$$PacketOptionsImplFromJson(Map json) => + _$PacketOptionsImpl( items: (json['items'] as List).map((e) => e as String).toList(), price: json['price'], short: json['short'] as String, description: json['description'] as String, ); -Map _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) => { +Map _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) => + { 'items': instance.items, 'price': instance.price, 'short': instance.short, 'description': instance.description, }; -_$PlanTypeImpl _$$PlanTypeImplFromJson(Map json) => _$PlanTypeImpl( +_$PlanTypeImpl _$$PlanTypeImplFromJson(Map json) => + _$PlanTypeImpl( fit: json['fit'] as bool, slim: json['slim'] as bool, behavior: json['behavior'] as bool, wellness: json['wellness'] as bool, ); -Map _$$PlanTypeImplToJson(_$PlanTypeImpl instance) => { +Map _$$PlanTypeImplToJson(_$PlanTypeImpl instance) => + { 'fit': instance.fit, 'slim': instance.slim, 'behavior': instance.behavior, diff --git a/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart b/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart index e16e4e4d..1bbe3cac 100644 --- a/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart +++ b/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$PlansState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$PlansState { /// @nodoc abstract class $PlansStateCopyWith<$Res> { - factory $PlansStateCopyWith(PlansState value, $Res Function(PlansState) then) = _$PlansStateCopyWithImpl<$Res, PlansState>; + factory $PlansStateCopyWith( + PlansState value, $Res Function(PlansState) then) = + _$PlansStateCopyWithImpl<$Res, PlansState>; } /// @nodoc -class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState> implements $PlansStateCopyWith<$Res> { +class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState> + implements $PlansStateCopyWith<$Res> { _$PlansStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +91,18 @@ class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState> implements $PlansS /// @nodoc abstract class _$$PlansStateImplCopyWith<$Res> { - factory _$$PlansStateImplCopyWith(_$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) = __$$PlansStateImplCopyWithImpl<$Res>; + factory _$$PlansStateImplCopyWith( + _$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) = + __$$PlansStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$PlansStateImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl> implements _$$PlansStateImplCopyWith<$Res> { - __$$PlansStateImplCopyWithImpl(_$PlansStateImpl _value, $Res Function(_$PlansStateImpl) _then) : super(_value, _then); +class __$$PlansStateImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl> + implements _$$PlansStateImplCopyWith<$Res> { + __$$PlansStateImplCopyWithImpl( + _$PlansStateImpl _value, $Res Function(_$PlansStateImpl) _then) + : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +120,8 @@ class _$PlansStateImpl implements _PlansState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$PlansStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$PlansStateImpl); } @override @@ -200,14 +208,18 @@ abstract class _PlansState implements PlansState { /// @nodoc abstract class _$$PlansStateLoadingImplCopyWith<$Res> { - factory _$$PlansStateLoadingImplCopyWith(_$PlansStateLoadingImpl value, $Res Function(_$PlansStateLoadingImpl) then) = + factory _$$PlansStateLoadingImplCopyWith(_$PlansStateLoadingImpl value, + $Res Function(_$PlansStateLoadingImpl) then) = __$$PlansStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$PlansStateLoadingImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadingImpl> +class __$$PlansStateLoadingImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadingImpl> implements _$$PlansStateLoadingImplCopyWith<$Res> { - __$$PlansStateLoadingImplCopyWithImpl(_$PlansStateLoadingImpl _value, $Res Function(_$PlansStateLoadingImpl) _then) : super(_value, _then); + __$$PlansStateLoadingImplCopyWithImpl(_$PlansStateLoadingImpl _value, + $Res Function(_$PlansStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +237,8 @@ class _$PlansStateLoadingImpl implements PlansStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$PlansStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$PlansStateLoadingImpl); } @override @@ -312,9 +325,9 @@ abstract class PlansStateLoading implements PlansState { /// @nodoc abstract class _$$PlansStateLoadedImplCopyWith<$Res> { - factory _$$PlansStateLoadedImplCopyWith(_$PlansStateLoadedImpl value, $Res Function(_$PlansStateLoadedImpl) then) = + factory _$$PlansStateLoadedImplCopyWith(_$PlansStateLoadedImpl value, + $Res Function(_$PlansStateLoadedImpl) then) = __$$PlansStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({PlanPaginationModel plansModel}); @@ -322,9 +335,12 @@ abstract class _$$PlansStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$PlansStateLoadedImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadedImpl> +class __$$PlansStateLoadedImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadedImpl> implements _$$PlansStateLoadedImplCopyWith<$Res> { - __$$PlansStateLoadedImplCopyWithImpl(_$PlansStateLoadedImpl _value, $Res Function(_$PlansStateLoadedImpl) _then) : super(_value, _then); + __$$PlansStateLoadedImplCopyWithImpl(_$PlansStateLoadedImpl _value, + $Res Function(_$PlansStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -368,7 +384,10 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$PlansStateLoadedImpl && (identical(other.plansModel, plansModel) || other.plansModel == plansModel)); + (other.runtimeType == runtimeType && + other is _$PlansStateLoadedImpl && + (identical(other.plansModel, plansModel) || + other.plansModel == plansModel)); } @override @@ -379,7 +398,9 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => __$$PlansStateLoadedImplCopyWithImpl<_$PlansStateLoadedImpl>(this, _$identity); + _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => + __$$PlansStateLoadedImplCopyWithImpl<_$PlansStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -457,27 +478,34 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded { } abstract class PlansStateLoaded implements PlansState { - const factory PlansStateLoaded({required final PlanPaginationModel plansModel}) = _$PlansStateLoadedImpl; + const factory PlansStateLoaded( + {required final PlanPaginationModel plansModel}) = _$PlansStateLoadedImpl; PlanPaginationModel get plansModel; /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$PlansStateErrorImplCopyWith<$Res> { - factory _$$PlansStateErrorImplCopyWith(_$PlansStateErrorImpl value, $Res Function(_$PlansStateErrorImpl) then) = __$$PlansStateErrorImplCopyWithImpl<$Res>; - + factory _$$PlansStateErrorImplCopyWith(_$PlansStateErrorImpl value, + $Res Function(_$PlansStateErrorImpl) then) = + __$$PlansStateErrorImplCopyWithImpl<$Res>; @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$PlansStateErrorImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateErrorImpl> implements _$$PlansStateErrorImplCopyWith<$Res> { - __$$PlansStateErrorImplCopyWithImpl(_$PlansStateErrorImpl _value, $Res Function(_$PlansStateErrorImpl) _then) : super(_value, _then); +class __$$PlansStateErrorImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateErrorImpl> + implements _$$PlansStateErrorImplCopyWith<$Res> { + __$$PlansStateErrorImplCopyWithImpl( + _$PlansStateErrorImpl _value, $Res Function(_$PlansStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -513,7 +541,8 @@ class _$PlansStateErrorImpl implements PlansStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$PlansStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -524,7 +553,9 @@ class _$PlansStateErrorImpl implements PlansStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => __$$PlansStateErrorImplCopyWithImpl<_$PlansStateErrorImpl>(this, _$identity); + _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => + __$$PlansStateErrorImplCopyWithImpl<_$PlansStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -602,12 +633,14 @@ class _$PlansStateErrorImpl implements PlansStateError { } abstract class PlansStateError implements PlansState { - const factory PlansStateError({required final String errorMessage}) = _$PlansStateErrorImpl; + const factory PlansStateError({required final String errorMessage}) = + _$PlansStateErrorImpl; String get errorMessage; /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/plans/services/plans_service.g.dart b/lib/features/plans/services/plans_service.g.dart index 2f655a5d..bce687f0 100644 --- a/lib/features/plans/services/plans_service.g.dart +++ b/lib/features/plans/services/plans_service.g.dart @@ -55,7 +55,9 @@ class _PlansService implements PlansService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/profile/models/circumference_model.dart b/lib/features/profile/models/circumference_model.dart new file mode 100644 index 00000000..eeb4f6e0 --- /dev/null +++ b/lib/features/profile/models/circumference_model.dart @@ -0,0 +1,19 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'circumference_model.freezed.dart'; +part 'circumference_model.g.dart'; + +@freezed +class CircumferenceModel with _$CircumferenceModel { + const factory CircumferenceModel({ + @JsonKey(name: "id") required int id, + @JsonKey(name: "user_id") required int userId, + @JsonKey(name: "chest_circumference") required int chestCircumference, + @JsonKey(name: "waist_circumference") required int waistCircumference, + @JsonKey(name: "hip_circumference") required int hipCircumference, + @JsonKey(name: "created_at") required DateTime createdAt, + @JsonKey(name: "updated_at") required DateTime updatedAt, + }) = _CircumferenceModel; + + factory CircumferenceModel.fromJson(Map json) => _$CircumferenceModelFromJson(json); +} diff --git a/lib/features/profile/models/circumference_model.freezed.dart b/lib/features/profile/models/circumference_model.freezed.dart new file mode 100644 index 00000000..870620f3 --- /dev/null +++ b/lib/features/profile/models/circumference_model.freezed.dart @@ -0,0 +1,319 @@ +// 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 'circumference_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(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'); + +CircumferenceModel _$CircumferenceModelFromJson(Map json) { + return _CircumferenceModel.fromJson(json); +} + +/// @nodoc +mixin _$CircumferenceModel { + @JsonKey(name: "id") + int get id => throw _privateConstructorUsedError; + @JsonKey(name: "user_id") + int get userId => throw _privateConstructorUsedError; + @JsonKey(name: "chest_circumference") + int get chestCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "waist_circumference") + int get waistCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "hip_circumference") + int get hipCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") + DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") + DateTime get updatedAt => throw _privateConstructorUsedError; + + /// Serializes this CircumferenceModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of CircumferenceModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $CircumferenceModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $CircumferenceModelCopyWith<$Res> { + factory $CircumferenceModelCopyWith( + CircumferenceModel value, $Res Function(CircumferenceModel) then) = + _$CircumferenceModelCopyWithImpl<$Res, CircumferenceModel>; + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "chest_circumference") int chestCircumference, + @JsonKey(name: "waist_circumference") int waistCircumference, + @JsonKey(name: "hip_circumference") int hipCircumference, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt}); +} + +/// @nodoc +class _$CircumferenceModelCopyWithImpl<$Res, $Val extends CircumferenceModel> + implements $CircumferenceModelCopyWith<$Res> { + _$CircumferenceModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of CircumferenceModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? chestCircumference = null, + Object? waistCircumference = null, + Object? hipCircumference = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + chestCircumference: null == chestCircumference + ? _value.chestCircumference + : chestCircumference // ignore: cast_nullable_to_non_nullable + as int, + waistCircumference: null == waistCircumference + ? _value.waistCircumference + : waistCircumference // ignore: cast_nullable_to_non_nullable + as int, + hipCircumference: null == hipCircumference + ? _value.hipCircumference + : hipCircumference // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$CircumferenceModelImplCopyWith<$Res> + implements $CircumferenceModelCopyWith<$Res> { + factory _$$CircumferenceModelImplCopyWith(_$CircumferenceModelImpl value, + $Res Function(_$CircumferenceModelImpl) then) = + __$$CircumferenceModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "chest_circumference") int chestCircumference, + @JsonKey(name: "waist_circumference") int waistCircumference, + @JsonKey(name: "hip_circumference") int hipCircumference, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt}); +} + +/// @nodoc +class __$$CircumferenceModelImplCopyWithImpl<$Res> + extends _$CircumferenceModelCopyWithImpl<$Res, _$CircumferenceModelImpl> + implements _$$CircumferenceModelImplCopyWith<$Res> { + __$$CircumferenceModelImplCopyWithImpl(_$CircumferenceModelImpl _value, + $Res Function(_$CircumferenceModelImpl) _then) + : super(_value, _then); + + /// Create a copy of CircumferenceModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? chestCircumference = null, + Object? waistCircumference = null, + Object? hipCircumference = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then(_$CircumferenceModelImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + chestCircumference: null == chestCircumference + ? _value.chestCircumference + : chestCircumference // ignore: cast_nullable_to_non_nullable + as int, + waistCircumference: null == waistCircumference + ? _value.waistCircumference + : waistCircumference // ignore: cast_nullable_to_non_nullable + as int, + hipCircumference: null == hipCircumference + ? _value.hipCircumference + : hipCircumference // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$CircumferenceModelImpl implements _CircumferenceModel { + const _$CircumferenceModelImpl( + {@JsonKey(name: "id") required this.id, + @JsonKey(name: "user_id") required this.userId, + @JsonKey(name: "chest_circumference") required this.chestCircumference, + @JsonKey(name: "waist_circumference") required this.waistCircumference, + @JsonKey(name: "hip_circumference") required this.hipCircumference, + @JsonKey(name: "created_at") required this.createdAt, + @JsonKey(name: "updated_at") required this.updatedAt}); + + factory _$CircumferenceModelImpl.fromJson(Map json) => + _$$CircumferenceModelImplFromJson(json); + + @override + @JsonKey(name: "id") + final int id; + @override + @JsonKey(name: "user_id") + final int userId; + @override + @JsonKey(name: "chest_circumference") + final int chestCircumference; + @override + @JsonKey(name: "waist_circumference") + final int waistCircumference; + @override + @JsonKey(name: "hip_circumference") + final int hipCircumference; + @override + @JsonKey(name: "created_at") + final DateTime createdAt; + @override + @JsonKey(name: "updated_at") + final DateTime updatedAt; + + @override + String toString() { + return 'CircumferenceModel(id: $id, userId: $userId, chestCircumference: $chestCircumference, waistCircumference: $waistCircumference, hipCircumference: $hipCircumference, createdAt: $createdAt, updatedAt: $updatedAt)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$CircumferenceModelImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.userId, userId) || other.userId == userId) && + (identical(other.chestCircumference, chestCircumference) || + other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || + other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || + other.hipCircumference == hipCircumference) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, id, userId, chestCircumference, + waistCircumference, hipCircumference, createdAt, updatedAt); + + /// Create a copy of CircumferenceModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$CircumferenceModelImplCopyWith<_$CircumferenceModelImpl> get copyWith => + __$$CircumferenceModelImplCopyWithImpl<_$CircumferenceModelImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$CircumferenceModelImplToJson( + this, + ); + } +} + +abstract class _CircumferenceModel implements CircumferenceModel { + const factory _CircumferenceModel( + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "user_id") required final int userId, + @JsonKey(name: "chest_circumference") + required final int chestCircumference, + @JsonKey(name: "waist_circumference") + required final int waistCircumference, + @JsonKey(name: "hip_circumference") required final int hipCircumference, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") + required final DateTime updatedAt}) = _$CircumferenceModelImpl; + + factory _CircumferenceModel.fromJson(Map json) = + _$CircumferenceModelImpl.fromJson; + + @override + @JsonKey(name: "id") + int get id; + @override + @JsonKey(name: "user_id") + int get userId; + @override + @JsonKey(name: "chest_circumference") + int get chestCircumference; + @override + @JsonKey(name: "waist_circumference") + int get waistCircumference; + @override + @JsonKey(name: "hip_circumference") + int get hipCircumference; + @override + @JsonKey(name: "created_at") + DateTime get createdAt; + @override + @JsonKey(name: "updated_at") + DateTime get updatedAt; + + /// Create a copy of CircumferenceModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$CircumferenceModelImplCopyWith<_$CircumferenceModelImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/profile/models/circumference_model.g.dart b/lib/features/profile/models/circumference_model.g.dart new file mode 100644 index 00000000..07a10f71 --- /dev/null +++ b/lib/features/profile/models/circumference_model.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'circumference_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$CircumferenceModelImpl _$$CircumferenceModelImplFromJson( + Map json) => + _$CircumferenceModelImpl( + id: (json['id'] as num).toInt(), + userId: (json['user_id'] as num).toInt(), + chestCircumference: (json['chest_circumference'] as num).toInt(), + waistCircumference: (json['waist_circumference'] as num).toInt(), + hipCircumference: (json['hip_circumference'] as num).toInt(), + createdAt: DateTime.parse(json['created_at'] as String), + updatedAt: DateTime.parse(json['updated_at'] as String), + ); + +Map _$$CircumferenceModelImplToJson( + _$CircumferenceModelImpl instance) => + { + 'id': instance.id, + 'user_id': instance.userId, + 'chest_circumference': instance.chestCircumference, + 'waist_circumference': instance.waistCircumference, + 'hip_circumference': instance.hipCircumference, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + }; diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index 3732e837..94b860a3 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -22,28 +22,20 @@ ProfileModel _$ProfileModelFromJson(Map json) { mixin _$ProfileModel { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "email") String get email => throw _privateConstructorUsedError; - @JsonKey(name: "email_verified_at") DateTime? get emailVerifiedAt => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime? get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime? get updatedAt => throw _privateConstructorUsedError; - @JsonKey(name: "is_public_profile") bool get isPublicProfile => throw _privateConstructorUsedError; - @JsonKey(name: "slug") String get slug => throw _privateConstructorUsedError; - @JsonKey(name: "profile_photo_url") String get profilePhotoUrl => throw _privateConstructorUsedError; @@ -53,13 +45,15 @@ mixin _$ProfileModel { /// Create a copy of ProfileModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ProfileModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ProfileModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ProfileModelCopyWith<$Res> { - factory $ProfileModelCopyWith(ProfileModel value, $Res Function(ProfileModel) then) = _$ProfileModelCopyWithImpl<$Res, ProfileModel>; - + factory $ProfileModelCopyWith( + ProfileModel value, $Res Function(ProfileModel) then) = + _$ProfileModelCopyWithImpl<$Res, ProfileModel>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -74,12 +68,12 @@ abstract class $ProfileModelCopyWith<$Res> { } /// @nodoc -class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> implements $ProfileModelCopyWith<$Res> { +class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> + implements $ProfileModelCopyWith<$Res> { _$ProfileModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -140,9 +134,11 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> implements $Pr } /// @nodoc -abstract class _$$ProfileModelImplCopyWith<$Res> implements $ProfileModelCopyWith<$Res> { - factory _$$ProfileModelImplCopyWith(_$ProfileModelImpl value, $Res Function(_$ProfileModelImpl) then) = __$$ProfileModelImplCopyWithImpl<$Res>; - +abstract class _$$ProfileModelImplCopyWith<$Res> + implements $ProfileModelCopyWith<$Res> { + factory _$$ProfileModelImplCopyWith( + _$ProfileModelImpl value, $Res Function(_$ProfileModelImpl) then) = + __$$ProfileModelImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -158,8 +154,12 @@ abstract class _$$ProfileModelImplCopyWith<$Res> implements $ProfileModelCopyWit } /// @nodoc -class __$$ProfileModelImplCopyWithImpl<$Res> extends _$ProfileModelCopyWithImpl<$Res, _$ProfileModelImpl> implements _$$ProfileModelImplCopyWith<$Res> { - __$$ProfileModelImplCopyWithImpl(_$ProfileModelImpl _value, $Res Function(_$ProfileModelImpl) _then) : super(_value, _then); +class __$$ProfileModelImplCopyWithImpl<$Res> + extends _$ProfileModelCopyWithImpl<$Res, _$ProfileModelImpl> + implements _$$ProfileModelImplCopyWith<$Res> { + __$$ProfileModelImplCopyWithImpl( + _$ProfileModelImpl _value, $Res Function(_$ProfileModelImpl) _then) + : super(_value, _then); /// Create a copy of ProfileModel /// with the given fields replaced by the non-null parameter values. @@ -231,7 +231,8 @@ class _$ProfileModelImpl implements _ProfileModel { @JsonKey(name: "slug") required this.slug, @JsonKey(name: "profile_photo_url") required this.profilePhotoUrl}); - factory _$ProfileModelImpl.fromJson(Map json) => _$$ProfileModelImplFromJson(json); + factory _$ProfileModelImpl.fromJson(Map json) => + _$$ProfileModelImplFromJson(json); @override @JsonKey(name: "id") @@ -274,24 +275,31 @@ class _$ProfileModelImpl implements _ProfileModel { (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.email, email) || other.email == email) && - (identical(other.emailVerifiedAt, emailVerifiedAt) || other.emailVerifiedAt == emailVerifiedAt) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && - (identical(other.isPublicProfile, isPublicProfile) || other.isPublicProfile == isPublicProfile) && + (identical(other.emailVerifiedAt, emailVerifiedAt) || + other.emailVerifiedAt == emailVerifiedAt) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.isPublicProfile, isPublicProfile) || + other.isPublicProfile == isPublicProfile) && (identical(other.slug, slug) || other.slug == slug) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoUrl, profilePhotoUrl) || + other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, email, emailVerifiedAt, createdAt, updatedAt, isPublicProfile, slug, profilePhotoUrl); + int get hashCode => Object.hash(runtimeType, id, name, email, emailVerifiedAt, + createdAt, updatedAt, isPublicProfile, slug, profilePhotoUrl); /// Create a copy of ProfileModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => __$$ProfileModelImplCopyWithImpl<_$ProfileModelImpl>(this, _$identity); + _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => + __$$ProfileModelImplCopyWithImpl<_$ProfileModelImpl>(this, _$identity); @override Map toJson() { @@ -311,42 +319,36 @@ abstract class _ProfileModel implements ProfileModel { @JsonKey(name: "updated_at") final DateTime? updatedAt, @JsonKey(name: "is_public_profile") required final bool isPublicProfile, @JsonKey(name: "slug") required final String slug, - @JsonKey(name: "profile_photo_url") required final String profilePhotoUrl}) = _$ProfileModelImpl; + @JsonKey(name: "profile_photo_url") + required final String profilePhotoUrl}) = _$ProfileModelImpl; - factory _ProfileModel.fromJson(Map json) = _$ProfileModelImpl.fromJson; + factory _ProfileModel.fromJson(Map json) = + _$ProfileModelImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "email") String get email; - @override @JsonKey(name: "email_verified_at") DateTime? get emailVerifiedAt; - @override @JsonKey(name: "created_at") DateTime? get createdAt; - @override @JsonKey(name: "updated_at") DateTime? get updatedAt; - @override @JsonKey(name: "is_public_profile") bool get isPublicProfile; - @override @JsonKey(name: "slug") String get slug; - @override @JsonKey(name: "profile_photo_url") String get profilePhotoUrl; @@ -355,7 +357,8 @@ abstract class _ProfileModel implements ProfileModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => + throw _privateConstructorUsedError; } ProfileDetailsModel _$ProfileDetailsModelFromJson(Map json) { @@ -366,82 +369,56 @@ ProfileDetailsModel _$ProfileDetailsModelFromJson(Map json) { mixin _$ProfileDetailsModel { @JsonKey(name: "first_name") String get firstName => throw _privateConstructorUsedError; - @JsonKey(name: "last_name") String get lastName => throw _privateConstructorUsedError; - @JsonKey(name: "birthdate") String get birthdate => throw _privateConstructorUsedError; - @JsonKey(name: "gender") String get gender => throw _privateConstructorUsedError; - @JsonKey(name: "country") String get country => throw _privateConstructorUsedError; - @JsonKey(name: "city") String get city => throw _privateConstructorUsedError; - @JsonKey(name: "lang") String get lang => throw _privateConstructorUsedError; - @JsonKey(name: "weight") double get weight => throw _privateConstructorUsedError; - @JsonKey(name: "height") int get height => throw _privateConstructorUsedError; - @JsonKey(name: "chest_circumference") int get chestCircumference => throw _privateConstructorUsedError; - @JsonKey(name: "waist_circumference") int get waistCircumference => throw _privateConstructorUsedError; - @JsonKey(name: "hip_circumference") int get hipCircumference => throw _privateConstructorUsedError; - @JsonKey(name: "blood_pressure_up") int get bloodPressureUp => throw _privateConstructorUsedError; - @JsonKey(name: "blood_pressure_down") int get bloodPressureDown => throw _privateConstructorUsedError; - @JsonKey(name: "has_hypo") bool get hasHypo => throw _privateConstructorUsedError; - @JsonKey(name: "has_hyper") bool get hasHyper => throw _privateConstructorUsedError; - @JsonKey(name: "about_alergy") String get aboutAlergy => throw _privateConstructorUsedError; - @JsonKey(name: "about_taking_pils") String get aboutTakingPils => throw _privateConstructorUsedError; - @JsonKey(name: "about_sport_hobbies") String get aboutSportHobbies => throw _privateConstructorUsedError; - @JsonKey(name: "favorite_foods") String get favoriteFoods => throw _privateConstructorUsedError; - @JsonKey(name: "unfavorite_foods") String get unfavoriteFoods => throw _privateConstructorUsedError; - @JsonKey(name: "additional_info") String get additionalInfo => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime? get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime? get updatedAt => throw _privateConstructorUsedError; - @JsonKey(name: "is_mood_fillable") bool get isMoodFillable => throw _privateConstructorUsedError; - @JsonKey(name: "is_bedtime_fillable") bool get isBedtimeFillable => throw _privateConstructorUsedError; - @JsonKey(name: "activity_coefficient") double get activityCoefficient => throw _privateConstructorUsedError; @@ -451,14 +428,15 @@ mixin _$ProfileDetailsModel { /// Create a copy of ProfileDetailsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ProfileDetailsModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ProfileDetailsModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ProfileDetailsModelCopyWith<$Res> { - factory $ProfileDetailsModelCopyWith(ProfileDetailsModel value, $Res Function(ProfileDetailsModel) then) = + factory $ProfileDetailsModelCopyWith( + ProfileDetailsModel value, $Res Function(ProfileDetailsModel) then) = _$ProfileDetailsModelCopyWithImpl<$Res, ProfileDetailsModel>; - @useResult $Res call( {@JsonKey(name: "first_name") String firstName, @@ -491,12 +469,12 @@ abstract class $ProfileDetailsModelCopyWith<$Res> { } /// @nodoc -class _$ProfileDetailsModelCopyWithImpl<$Res, $Val extends ProfileDetailsModel> implements $ProfileDetailsModelCopyWith<$Res> { +class _$ProfileDetailsModelCopyWithImpl<$Res, $Val extends ProfileDetailsModel> + implements $ProfileDetailsModelCopyWith<$Res> { _$ProfileDetailsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -647,10 +625,11 @@ class _$ProfileDetailsModelCopyWithImpl<$Res, $Val extends ProfileDetailsModel> } /// @nodoc -abstract class _$$ProfileDetailsModelImplCopyWith<$Res> implements $ProfileDetailsModelCopyWith<$Res> { - factory _$$ProfileDetailsModelImplCopyWith(_$ProfileDetailsModelImpl value, $Res Function(_$ProfileDetailsModelImpl) then) = +abstract class _$$ProfileDetailsModelImplCopyWith<$Res> + implements $ProfileDetailsModelCopyWith<$Res> { + factory _$$ProfileDetailsModelImplCopyWith(_$ProfileDetailsModelImpl value, + $Res Function(_$ProfileDetailsModelImpl) then) = __$$ProfileDetailsModelImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -684,9 +663,12 @@ abstract class _$$ProfileDetailsModelImplCopyWith<$Res> implements $ProfileDetai } /// @nodoc -class __$$ProfileDetailsModelImplCopyWithImpl<$Res> extends _$ProfileDetailsModelCopyWithImpl<$Res, _$ProfileDetailsModelImpl> +class __$$ProfileDetailsModelImplCopyWithImpl<$Res> + extends _$ProfileDetailsModelCopyWithImpl<$Res, _$ProfileDetailsModelImpl> implements _$$ProfileDetailsModelImplCopyWith<$Res> { - __$$ProfileDetailsModelImplCopyWithImpl(_$ProfileDetailsModelImpl _value, $Res Function(_$ProfileDetailsModelImpl) _then) : super(_value, _then); + __$$ProfileDetailsModelImplCopyWithImpl(_$ProfileDetailsModelImpl _value, + $Res Function(_$ProfileDetailsModelImpl) _then) + : super(_value, _then); /// Create a copy of ProfileDetailsModel /// with the given fields replaced by the non-null parameter values. @@ -864,9 +846,11 @@ class _$ProfileDetailsModelImpl implements _ProfileDetailsModel { @JsonKey(name: "updated_at") this.updatedAt, @JsonKey(name: "is_mood_fillable") required this.isMoodFillable, @JsonKey(name: "is_bedtime_fillable") required this.isBedtimeFillable, - @JsonKey(name: "activity_coefficient") required this.activityCoefficient}); + @JsonKey(name: "activity_coefficient") + required this.activityCoefficient}); - factory _$ProfileDetailsModelImpl.fromJson(Map json) => _$$ProfileDetailsModelImplFromJson(json); + factory _$ProfileDetailsModelImpl.fromJson(Map json) => + _$$ProfileDetailsModelImplFromJson(json); @override @JsonKey(name: "first_name") @@ -960,33 +944,53 @@ class _$ProfileDetailsModelImpl implements _ProfileDetailsModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileDetailsModelImpl && - (identical(other.firstName, firstName) || other.firstName == firstName) && - (identical(other.lastName, lastName) || other.lastName == lastName) && - (identical(other.birthdate, birthdate) || other.birthdate == birthdate) && + (identical(other.firstName, firstName) || + other.firstName == firstName) && + (identical(other.lastName, lastName) || + other.lastName == lastName) && + (identical(other.birthdate, birthdate) || + other.birthdate == birthdate) && (identical(other.gender, gender) || other.gender == gender) && (identical(other.country, country) || other.country == country) && (identical(other.city, city) || other.city == city) && (identical(other.lang, lang) || other.lang == lang) && (identical(other.weight, weight) || other.weight == weight) && (identical(other.height, height) || other.height == height) && - (identical(other.chestCircumference, chestCircumference) || other.chestCircumference == chestCircumference) && - (identical(other.waistCircumference, waistCircumference) || other.waistCircumference == waistCircumference) && - (identical(other.hipCircumference, hipCircumference) || other.hipCircumference == hipCircumference) && - (identical(other.bloodPressureUp, bloodPressureUp) || other.bloodPressureUp == bloodPressureUp) && - (identical(other.bloodPressureDown, bloodPressureDown) || other.bloodPressureDown == bloodPressureDown) && + (identical(other.chestCircumference, chestCircumference) || + other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || + other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || + other.hipCircumference == hipCircumference) && + (identical(other.bloodPressureUp, bloodPressureUp) || + other.bloodPressureUp == bloodPressureUp) && + (identical(other.bloodPressureDown, bloodPressureDown) || + other.bloodPressureDown == bloodPressureDown) && (identical(other.hasHypo, hasHypo) || other.hasHypo == hasHypo) && - (identical(other.hasHyper, hasHyper) || other.hasHyper == hasHyper) && - (identical(other.aboutAlergy, aboutAlergy) || other.aboutAlergy == aboutAlergy) && - (identical(other.aboutTakingPils, aboutTakingPils) || other.aboutTakingPils == aboutTakingPils) && - (identical(other.aboutSportHobbies, aboutSportHobbies) || other.aboutSportHobbies == aboutSportHobbies) && - (identical(other.favoriteFoods, favoriteFoods) || other.favoriteFoods == favoriteFoods) && - (identical(other.unfavoriteFoods, unfavoriteFoods) || other.unfavoriteFoods == unfavoriteFoods) && - (identical(other.additionalInfo, additionalInfo) || other.additionalInfo == additionalInfo) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && - (identical(other.isMoodFillable, isMoodFillable) || other.isMoodFillable == isMoodFillable) && - (identical(other.isBedtimeFillable, isBedtimeFillable) || other.isBedtimeFillable == isBedtimeFillable) && - (identical(other.activityCoefficient, activityCoefficient) || other.activityCoefficient == activityCoefficient)); + (identical(other.hasHyper, hasHyper) || + other.hasHyper == hasHyper) && + (identical(other.aboutAlergy, aboutAlergy) || + other.aboutAlergy == aboutAlergy) && + (identical(other.aboutTakingPils, aboutTakingPils) || + other.aboutTakingPils == aboutTakingPils) && + (identical(other.aboutSportHobbies, aboutSportHobbies) || + other.aboutSportHobbies == aboutSportHobbies) && + (identical(other.favoriteFoods, favoriteFoods) || + other.favoriteFoods == favoriteFoods) && + (identical(other.unfavoriteFoods, unfavoriteFoods) || + other.unfavoriteFoods == unfavoriteFoods) && + (identical(other.additionalInfo, additionalInfo) || + other.additionalInfo == additionalInfo) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.isMoodFillable, isMoodFillable) || + other.isMoodFillable == isMoodFillable) && + (identical(other.isBedtimeFillable, isBedtimeFillable) || + other.isBedtimeFillable == isBedtimeFillable) && + (identical(other.activityCoefficient, activityCoefficient) || + other.activityCoefficient == activityCoefficient)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -1028,7 +1032,8 @@ class _$ProfileDetailsModelImpl implements _ProfileDetailsModel { @override @pragma('vm:prefer-inline') _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => - __$$ProfileDetailsModelImplCopyWithImpl<_$ProfileDetailsModelImpl>(this, _$identity); + __$$ProfileDetailsModelImplCopyWithImpl<_$ProfileDetailsModelImpl>( + this, _$identity); @override Map toJson() { @@ -1049,131 +1054,112 @@ abstract class _ProfileDetailsModel implements ProfileDetailsModel { @JsonKey(name: "lang") required final String lang, @JsonKey(name: "weight") required final double weight, @JsonKey(name: "height") required final int height, - @JsonKey(name: "chest_circumference") required final int chestCircumference, - @JsonKey(name: "waist_circumference") required final int waistCircumference, + @JsonKey(name: "chest_circumference") + required final int chestCircumference, + @JsonKey(name: "waist_circumference") + required final int waistCircumference, @JsonKey(name: "hip_circumference") required final int hipCircumference, @JsonKey(name: "blood_pressure_up") required final int bloodPressureUp, - @JsonKey(name: "blood_pressure_down") required final int bloodPressureDown, + @JsonKey(name: "blood_pressure_down") + required final int bloodPressureDown, @JsonKey(name: "has_hypo") required final bool hasHypo, @JsonKey(name: "has_hyper") required final bool hasHyper, @JsonKey(name: "about_alergy") required final String aboutAlergy, @JsonKey(name: "about_taking_pils") required final String aboutTakingPils, - @JsonKey(name: "about_sport_hobbies") required final String aboutSportHobbies, + @JsonKey(name: "about_sport_hobbies") + required final String aboutSportHobbies, @JsonKey(name: "favorite_foods") required final String favoriteFoods, @JsonKey(name: "unfavorite_foods") required final String unfavoriteFoods, @JsonKey(name: "additional_info") required final String additionalInfo, @JsonKey(name: "created_at") final DateTime? createdAt, @JsonKey(name: "updated_at") final DateTime? updatedAt, @JsonKey(name: "is_mood_fillable") required final bool isMoodFillable, - @JsonKey(name: "is_bedtime_fillable") required final bool isBedtimeFillable, - @JsonKey(name: "activity_coefficient") required final double activityCoefficient}) = _$ProfileDetailsModelImpl; + @JsonKey(name: "is_bedtime_fillable") + required final bool isBedtimeFillable, + @JsonKey(name: "activity_coefficient") + required final double activityCoefficient}) = _$ProfileDetailsModelImpl; - factory _ProfileDetailsModel.fromJson(Map json) = _$ProfileDetailsModelImpl.fromJson; + factory _ProfileDetailsModel.fromJson(Map json) = + _$ProfileDetailsModelImpl.fromJson; @override @JsonKey(name: "first_name") String get firstName; - @override @JsonKey(name: "last_name") String get lastName; - @override @JsonKey(name: "birthdate") String get birthdate; - @override @JsonKey(name: "gender") String get gender; - @override @JsonKey(name: "country") String get country; - @override @JsonKey(name: "city") String get city; - @override @JsonKey(name: "lang") String get lang; - @override @JsonKey(name: "weight") double get weight; - @override @JsonKey(name: "height") int get height; - @override @JsonKey(name: "chest_circumference") int get chestCircumference; - @override @JsonKey(name: "waist_circumference") int get waistCircumference; - @override @JsonKey(name: "hip_circumference") int get hipCircumference; - @override @JsonKey(name: "blood_pressure_up") int get bloodPressureUp; - @override @JsonKey(name: "blood_pressure_down") int get bloodPressureDown; - @override @JsonKey(name: "has_hypo") bool get hasHypo; - @override @JsonKey(name: "has_hyper") bool get hasHyper; - @override @JsonKey(name: "about_alergy") String get aboutAlergy; - @override @JsonKey(name: "about_taking_pils") String get aboutTakingPils; - @override @JsonKey(name: "about_sport_hobbies") String get aboutSportHobbies; - @override @JsonKey(name: "favorite_foods") String get favoriteFoods; - @override @JsonKey(name: "unfavorite_foods") String get unfavoriteFoods; - @override @JsonKey(name: "additional_info") String get additionalInfo; - @override @JsonKey(name: "created_at") DateTime? get createdAt; - @override @JsonKey(name: "updated_at") DateTime? get updatedAt; - @override @JsonKey(name: "is_mood_fillable") bool get isMoodFillable; - @override @JsonKey(name: "is_bedtime_fillable") bool get isBedtimeFillable; - @override @JsonKey(name: "activity_coefficient") double get activityCoefficient; @@ -1182,5 +1168,6 @@ abstract class _ProfileDetailsModel implements ProfileDetailsModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/profile/models/profile_model.g.dart b/lib/features/profile/models/profile_model.g.dart index 56e201fb..28e10ccf 100644 --- a/lib/features/profile/models/profile_model.g.dart +++ b/lib/features/profile/models/profile_model.g.dart @@ -6,19 +6,27 @@ part of 'profile_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ProfileModelImpl _$$ProfileModelImplFromJson(Map json) => _$ProfileModelImpl( +_$ProfileModelImpl _$$ProfileModelImplFromJson(Map json) => + _$ProfileModelImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, email: json['email'] as String, - emailVerifiedAt: json['email_verified_at'] == null ? null : DateTime.parse(json['email_verified_at'] as String), - createdAt: json['created_at'] == null ? null : DateTime.parse(json['created_at'] as String), - updatedAt: json['updated_at'] == null ? null : DateTime.parse(json['updated_at'] as String), + emailVerifiedAt: json['email_verified_at'] == null + ? null + : DateTime.parse(json['email_verified_at'] as String), + createdAt: json['created_at'] == null + ? null + : DateTime.parse(json['created_at'] as String), + updatedAt: json['updated_at'] == null + ? null + : DateTime.parse(json['updated_at'] as String), isPublicProfile: json['is_public_profile'] as bool, slug: json['slug'] as String, profilePhotoUrl: json['profile_photo_url'] as String, ); -Map _$$ProfileModelImplToJson(_$ProfileModelImpl instance) => { +Map _$$ProfileModelImplToJson(_$ProfileModelImpl instance) => + { 'id': instance.id, 'name': instance.name, 'email': instance.email, @@ -30,7 +38,9 @@ Map _$$ProfileModelImplToJson(_$ProfileModelImpl instance) => < 'profile_photo_url': instance.profilePhotoUrl, }; -_$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson(Map json) => _$ProfileDetailsModelImpl( +_$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson( + Map json) => + _$ProfileDetailsModelImpl( firstName: json['first_name'] as String, lastName: json['last_name'] as String, birthdate: json['birthdate'] as String, @@ -53,14 +63,20 @@ _$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson(Map _$$ProfileDetailsModelImplToJson(_$ProfileDetailsModelImpl instance) => { +Map _$$ProfileDetailsModelImplToJson( + _$ProfileDetailsModelImpl instance) => + { 'first_name': instance.firstName, 'last_name': instance.lastName, 'birthdate': instance.birthdate, diff --git a/lib/features/profile/models/weight_model.dart b/lib/features/profile/models/weight_model.dart new file mode 100644 index 00000000..1a24424e --- /dev/null +++ b/lib/features/profile/models/weight_model.dart @@ -0,0 +1,18 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'weight_model.freezed.dart'; +part 'weight_model.g.dart'; + +@freezed +class WeightModel with _$WeightModel { + const factory WeightModel({ + @JsonKey(name: "id") required int id, + @JsonKey(name: "user_id") required int userId, + @JsonKey(name: "weight") required int weight, + @JsonKey(name: "created_at") required DateTime createdAt, + @JsonKey(name: "updated_at") required DateTime updatedAt, + @JsonKey(name: "bmi") required double bmi, + }) = _WeightModel; + + factory WeightModel.fromJson(Map json) => _$WeightModelFromJson(json); +} diff --git a/lib/features/profile/models/weight_model.freezed.dart b/lib/features/profile/models/weight_model.freezed.dart new file mode 100644 index 00000000..3ca65637 --- /dev/null +++ b/lib/features/profile/models/weight_model.freezed.dart @@ -0,0 +1,289 @@ +// 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 'weight_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(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'); + +WeightModel _$WeightModelFromJson(Map json) { + return _WeightModel.fromJson(json); +} + +/// @nodoc +mixin _$WeightModel { + @JsonKey(name: "id") + int get id => throw _privateConstructorUsedError; + @JsonKey(name: "user_id") + int get userId => throw _privateConstructorUsedError; + @JsonKey(name: "weight") + int get weight => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") + DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") + DateTime get updatedAt => throw _privateConstructorUsedError; + @JsonKey(name: "bmi") + double get bmi => throw _privateConstructorUsedError; + + /// Serializes this WeightModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of WeightModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $WeightModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $WeightModelCopyWith<$Res> { + factory $WeightModelCopyWith( + WeightModel value, $Res Function(WeightModel) then) = + _$WeightModelCopyWithImpl<$Res, WeightModel>; + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "weight") int weight, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt, + @JsonKey(name: "bmi") double bmi}); +} + +/// @nodoc +class _$WeightModelCopyWithImpl<$Res, $Val extends WeightModel> + implements $WeightModelCopyWith<$Res> { + _$WeightModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of WeightModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? weight = null, + Object? createdAt = null, + Object? updatedAt = null, + Object? bmi = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + weight: null == weight + ? _value.weight + : weight // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + bmi: null == bmi + ? _value.bmi + : bmi // ignore: cast_nullable_to_non_nullable + as double, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$WeightModelImplCopyWith<$Res> + implements $WeightModelCopyWith<$Res> { + factory _$$WeightModelImplCopyWith( + _$WeightModelImpl value, $Res Function(_$WeightModelImpl) then) = + __$$WeightModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "weight") int weight, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt, + @JsonKey(name: "bmi") double bmi}); +} + +/// @nodoc +class __$$WeightModelImplCopyWithImpl<$Res> + extends _$WeightModelCopyWithImpl<$Res, _$WeightModelImpl> + implements _$$WeightModelImplCopyWith<$Res> { + __$$WeightModelImplCopyWithImpl( + _$WeightModelImpl _value, $Res Function(_$WeightModelImpl) _then) + : super(_value, _then); + + /// Create a copy of WeightModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? weight = null, + Object? createdAt = null, + Object? updatedAt = null, + Object? bmi = null, + }) { + return _then(_$WeightModelImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + weight: null == weight + ? _value.weight + : weight // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + bmi: null == bmi + ? _value.bmi + : bmi // ignore: cast_nullable_to_non_nullable + as double, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$WeightModelImpl implements _WeightModel { + const _$WeightModelImpl( + {@JsonKey(name: "id") required this.id, + @JsonKey(name: "user_id") required this.userId, + @JsonKey(name: "weight") required this.weight, + @JsonKey(name: "created_at") required this.createdAt, + @JsonKey(name: "updated_at") required this.updatedAt, + @JsonKey(name: "bmi") required this.bmi}); + + factory _$WeightModelImpl.fromJson(Map json) => + _$$WeightModelImplFromJson(json); + + @override + @JsonKey(name: "id") + final int id; + @override + @JsonKey(name: "user_id") + final int userId; + @override + @JsonKey(name: "weight") + final int weight; + @override + @JsonKey(name: "created_at") + final DateTime createdAt; + @override + @JsonKey(name: "updated_at") + final DateTime updatedAt; + @override + @JsonKey(name: "bmi") + final double bmi; + + @override + String toString() { + return 'WeightModel(id: $id, userId: $userId, weight: $weight, createdAt: $createdAt, updatedAt: $updatedAt, bmi: $bmi)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$WeightModelImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.userId, userId) || other.userId == userId) && + (identical(other.weight, weight) || other.weight == weight) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.bmi, bmi) || other.bmi == bmi)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, id, userId, weight, createdAt, updatedAt, bmi); + + /// Create a copy of WeightModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$WeightModelImplCopyWith<_$WeightModelImpl> get copyWith => + __$$WeightModelImplCopyWithImpl<_$WeightModelImpl>(this, _$identity); + + @override + Map toJson() { + return _$$WeightModelImplToJson( + this, + ); + } +} + +abstract class _WeightModel implements WeightModel { + const factory _WeightModel( + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "user_id") required final int userId, + @JsonKey(name: "weight") required final int weight, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt, + @JsonKey(name: "bmi") required final double bmi}) = _$WeightModelImpl; + + factory _WeightModel.fromJson(Map json) = + _$WeightModelImpl.fromJson; + + @override + @JsonKey(name: "id") + int get id; + @override + @JsonKey(name: "user_id") + int get userId; + @override + @JsonKey(name: "weight") + int get weight; + @override + @JsonKey(name: "created_at") + DateTime get createdAt; + @override + @JsonKey(name: "updated_at") + DateTime get updatedAt; + @override + @JsonKey(name: "bmi") + double get bmi; + + /// Create a copy of WeightModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$WeightModelImplCopyWith<_$WeightModelImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/profile/models/weight_model.g.dart b/lib/features/profile/models/weight_model.g.dart new file mode 100644 index 00000000..cd18ea8b --- /dev/null +++ b/lib/features/profile/models/weight_model.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'weight_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$WeightModelImpl _$$WeightModelImplFromJson(Map json) => + _$WeightModelImpl( + id: (json['id'] as num).toInt(), + userId: (json['user_id'] as num).toInt(), + weight: (json['weight'] as num).toInt(), + createdAt: DateTime.parse(json['created_at'] as String), + updatedAt: DateTime.parse(json['updated_at'] as String), + bmi: (json['bmi'] as num).toDouble(), + ); + +Map _$$WeightModelImplToJson(_$WeightModelImpl instance) => + { + 'id': instance.id, + 'user_id': instance.userId, + 'weight': instance.weight, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + 'bmi': instance.bmi, + }; diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index 6cdcff7a..11fb8f42 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -15,6 +15,8 @@ class ProfileCubit extends Cubit { profile: await profileRepository.getProfileBySlug(slug), profileDetails: await profileRepository.getMyProfileDetails(), blogPosts: await profileRepository.getBlogPostsByAuthorSlug(slug: slug), + weightPoints: await profileRepository.getWeight(period: '1', slug: slug), + circumferencePoints: await profileRepository.getCircumferences(period: '1', slug: slug), )); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); @@ -29,6 +31,8 @@ class ProfileCubit extends Cubit { profile: profile, profileDetails: await profileRepository.getMyProfileDetails(), blogPosts: await profileRepository.getBlogPostsByAuthorSlug(slug: profile.slug), + weightPoints: await profileRepository.getWeight(period: '1'), + circumferencePoints: await profileRepository.getCircumferences(period: '1'), )); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart index ff3c148f..696008ac 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart @@ -1,5 +1,7 @@ import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; +import 'package:eatvio_app/features/profile/models/circumference_model.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/profile/models/weight_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'profile_state.freezed.dart'; @@ -14,6 +16,8 @@ abstract class ProfileState with _$ProfileState { required ProfileModel profile, required ProfileDetailsModel profileDetails, required List blogPosts, + required List weightPoints, + required List circumferencePoints, }) = ProfileStateLoaded; const factory ProfileState.error({ diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart index e8e4c2ba..b110d522 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart @@ -20,16 +20,27 @@ mixin _$ProfileState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, + required TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult? Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +48,13 @@ mixin _$ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,16 +88,18 @@ mixin _$ProfileState { /// @nodoc abstract class $ProfileStateCopyWith<$Res> { - factory $ProfileStateCopyWith(ProfileState value, $Res Function(ProfileState) then) = _$ProfileStateCopyWithImpl<$Res, ProfileState>; + factory $ProfileStateCopyWith( + ProfileState value, $Res Function(ProfileState) then) = + _$ProfileStateCopyWithImpl<$Res, ProfileState>; } /// @nodoc -class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> implements $ProfileStateCopyWith<$Res> { +class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> + implements $ProfileStateCopyWith<$Res> { _$ProfileStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +109,18 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> implements $Pr /// @nodoc abstract class _$$ProfileStateImplCopyWith<$Res> { - factory _$$ProfileStateImplCopyWith(_$ProfileStateImpl value, $Res Function(_$ProfileStateImpl) then) = __$$ProfileStateImplCopyWithImpl<$Res>; + factory _$$ProfileStateImplCopyWith( + _$ProfileStateImpl value, $Res Function(_$ProfileStateImpl) then) = + __$$ProfileStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileStateImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateImpl> implements _$$ProfileStateImplCopyWith<$Res> { - __$$ProfileStateImplCopyWithImpl(_$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then) : super(_value, _then); +class __$$ProfileStateImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateImpl> + implements _$$ProfileStateImplCopyWith<$Res> { + __$$ProfileStateImplCopyWithImpl( + _$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then) + : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +138,8 @@ class _$ProfileStateImpl implements _ProfileState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ProfileStateImpl); } @override @@ -124,7 +150,13 @@ class _$ProfileStateImpl implements _ProfileState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, + required TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -135,7 +167,13 @@ class _$ProfileStateImpl implements _ProfileState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult? Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -146,7 +184,13 @@ class _$ProfileStateImpl implements _ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -200,14 +244,18 @@ abstract class _ProfileState implements ProfileState { /// @nodoc abstract class _$$ProfileStateLoadingImplCopyWith<$Res> { - factory _$$ProfileStateLoadingImplCopyWith(_$ProfileStateLoadingImpl value, $Res Function(_$ProfileStateLoadingImpl) then) = + factory _$$ProfileStateLoadingImplCopyWith(_$ProfileStateLoadingImpl value, + $Res Function(_$ProfileStateLoadingImpl) then) = __$$ProfileStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileStateLoadingImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadingImpl> +class __$$ProfileStateLoadingImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadingImpl> implements _$$ProfileStateLoadingImplCopyWith<$Res> { - __$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value, $Res Function(_$ProfileStateLoadingImpl) _then) : super(_value, _then); + __$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value, + $Res Function(_$ProfileStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +273,9 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileStateLoadingImpl); } @override @@ -236,7 +286,13 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, + required TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -247,7 +303,13 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult? Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -258,7 +320,13 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -312,21 +380,28 @@ abstract class ProfileStateLoading implements ProfileState { /// @nodoc abstract class _$$ProfileStateLoadedImplCopyWith<$Res> { - factory _$$ProfileStateLoadedImplCopyWith(_$ProfileStateLoadedImpl value, $Res Function(_$ProfileStateLoadedImpl) then) = + factory _$$ProfileStateLoadedImplCopyWith(_$ProfileStateLoadedImpl value, + $Res Function(_$ProfileStateLoadedImpl) then) = __$$ProfileStateLoadedImplCopyWithImpl<$Res>; - @useResult - $Res call({ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts}); + $Res call( + {ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints}); $ProfileModelCopyWith<$Res> get profile; - $ProfileDetailsModelCopyWith<$Res> get profileDetails; } /// @nodoc -class __$$ProfileStateLoadedImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadedImpl> +class __$$ProfileStateLoadedImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadedImpl> implements _$$ProfileStateLoadedImplCopyWith<$Res> { - __$$ProfileStateLoadedImplCopyWithImpl(_$ProfileStateLoadedImpl _value, $Res Function(_$ProfileStateLoadedImpl) _then) : super(_value, _then); + __$$ProfileStateLoadedImplCopyWithImpl(_$ProfileStateLoadedImpl _value, + $Res Function(_$ProfileStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -336,6 +411,8 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> extends _$ProfileStateCopyWit Object? profile = null, Object? profileDetails = null, Object? blogPosts = null, + Object? weightPoints = null, + Object? circumferencePoints = null, }) { return _then(_$ProfileStateLoadedImpl( profile: null == profile @@ -350,6 +427,14 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> extends _$ProfileStateCopyWit ? _value._blogPosts : blogPosts // ignore: cast_nullable_to_non_nullable as List, + weightPoints: null == weightPoints + ? _value._weightPoints + : weightPoints // ignore: cast_nullable_to_non_nullable + as List, + circumferencePoints: null == circumferencePoints + ? _value._circumferencePoints + : circumferencePoints // ignore: cast_nullable_to_non_nullable + as List, )); } @@ -377,15 +462,21 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> extends _$ProfileStateCopyWit /// @nodoc class _$ProfileStateLoadedImpl implements ProfileStateLoaded { - const _$ProfileStateLoadedImpl({required this.profile, required this.profileDetails, required final List blogPosts}) - : _blogPosts = blogPosts; + const _$ProfileStateLoadedImpl( + {required this.profile, + required this.profileDetails, + required final List blogPosts, + required final List weightPoints, + required final List circumferencePoints}) + : _blogPosts = blogPosts, + _weightPoints = weightPoints, + _circumferencePoints = circumferencePoints; @override final ProfileModel profile; @override final ProfileDetailsModel profileDetails; final List _blogPosts; - @override List get blogPosts { if (_blogPosts is EqualUnmodifiableListView) return _blogPosts; @@ -393,9 +484,26 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { return EqualUnmodifiableListView(_blogPosts); } + final List _weightPoints; + @override + List get weightPoints { + if (_weightPoints is EqualUnmodifiableListView) return _weightPoints; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_weightPoints); + } + + final List _circumferencePoints; + @override + List get circumferencePoints { + if (_circumferencePoints is EqualUnmodifiableListView) + return _circumferencePoints; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_circumferencePoints); + } + @override String toString() { - return 'ProfileState.loaded(profile: $profile, profileDetails: $profileDetails, blogPosts: $blogPosts)'; + return 'ProfileState.loaded(profile: $profile, profileDetails: $profileDetails, blogPosts: $blogPosts, weightPoints: $weightPoints, circumferencePoints: $circumferencePoints)'; } @override @@ -404,12 +512,24 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { (other.runtimeType == runtimeType && other is _$ProfileStateLoadedImpl && (identical(other.profile, profile) || other.profile == profile) && - (identical(other.profileDetails, profileDetails) || other.profileDetails == profileDetails) && - const DeepCollectionEquality().equals(other._blogPosts, _blogPosts)); + (identical(other.profileDetails, profileDetails) || + other.profileDetails == profileDetails) && + const DeepCollectionEquality() + .equals(other._blogPosts, _blogPosts) && + const DeepCollectionEquality() + .equals(other._weightPoints, _weightPoints) && + const DeepCollectionEquality() + .equals(other._circumferencePoints, _circumferencePoints)); } @override - int get hashCode => Object.hash(runtimeType, profile, profileDetails, const DeepCollectionEquality().hash(_blogPosts)); + int get hashCode => Object.hash( + runtimeType, + profile, + profileDetails, + const DeepCollectionEquality().hash(_blogPosts), + const DeepCollectionEquality().hash(_weightPoints), + const DeepCollectionEquality().hash(_circumferencePoints)); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -417,17 +537,25 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { @override @pragma('vm:prefer-inline') _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => - __$$ProfileStateLoadedImplCopyWithImpl<_$ProfileStateLoadedImpl>(this, _$identity); + __$$ProfileStateLoadedImplCopyWithImpl<_$ProfileStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, + required TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints) + loaded, required TResult Function(String errorMessage) error, }) { - return loaded(profile, profileDetails, blogPosts); + return loaded( + profile, profileDetails, blogPosts, weightPoints, circumferencePoints); } @override @@ -435,10 +563,17 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult? Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult? Function(String errorMessage)? error, }) { - return loaded?.call(profile, profileDetails, blogPosts); + return loaded?.call( + profile, profileDetails, blogPosts, weightPoints, circumferencePoints); } @override @@ -446,12 +581,19 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { if (loaded != null) { - return loaded(profile, profileDetails, blogPosts); + return loaded(profile, profileDetails, blogPosts, weightPoints, + circumferencePoints); } return orElse(); } @@ -496,35 +638,42 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { abstract class ProfileStateLoaded implements ProfileState { const factory ProfileStateLoaded( - {required final ProfileModel profile, - required final ProfileDetailsModel profileDetails, - required final List blogPosts}) = _$ProfileStateLoadedImpl; + {required final ProfileModel profile, + required final ProfileDetailsModel profileDetails, + required final List blogPosts, + required final List weightPoints, + required final List circumferencePoints}) = + _$ProfileStateLoadedImpl; ProfileModel get profile; - ProfileDetailsModel get profileDetails; - List get blogPosts; + List get weightPoints; + List get circumferencePoints; /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ProfileStateErrorImplCopyWith<$Res> { - factory _$$ProfileStateErrorImplCopyWith(_$ProfileStateErrorImpl value, $Res Function(_$ProfileStateErrorImpl) then) = + factory _$$ProfileStateErrorImplCopyWith(_$ProfileStateErrorImpl value, + $Res Function(_$ProfileStateErrorImpl) then) = __$$ProfileStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ProfileStateErrorImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateErrorImpl> +class __$$ProfileStateErrorImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateErrorImpl> implements _$$ProfileStateErrorImplCopyWith<$Res> { - __$$ProfileStateErrorImplCopyWithImpl(_$ProfileStateErrorImpl _value, $Res Function(_$ProfileStateErrorImpl) _then) : super(_value, _then); + __$$ProfileStateErrorImplCopyWithImpl(_$ProfileStateErrorImpl _value, + $Res Function(_$ProfileStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -560,7 +709,8 @@ class _$ProfileStateErrorImpl implements ProfileStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -571,14 +721,22 @@ class _$ProfileStateErrorImpl implements ProfileStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => __$$ProfileStateErrorImplCopyWithImpl<_$ProfileStateErrorImpl>(this, _$identity); + _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => + __$$ProfileStateErrorImplCopyWithImpl<_$ProfileStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, + required TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -589,7 +747,13 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult? Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -600,7 +764,13 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -649,12 +819,14 @@ class _$ProfileStateErrorImpl implements ProfileStateError { } abstract class ProfileStateError implements ProfileState { - const factory ProfileStateError({required final String errorMessage}) = _$ProfileStateErrorImpl; + const factory ProfileStateError({required final String errorMessage}) = + _$ProfileStateErrorImpl; String get errorMessage; /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index c31a7d2f..b388853a 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -1,8 +1,13 @@ import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/blog_post_widget.dart'; +import 'package:eatvio_app/features/profile/models/circumference_model.dart'; +import 'package:eatvio_app/features/profile/models/weight_model.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart'; +import 'package:eatvio_app/features/profile/presentation/widgets/circumference_chart_widget.dart'; +import 'package:eatvio_app/features/profile/presentation/widgets/imt_chart_widget.dart'; +import 'package:eatvio_app/features/profile/presentation/widgets/weight_chart_widget.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; @@ -21,8 +26,8 @@ class ProfileScreen extends StatefulWidget { } class _ProfileScreenState extends State { - // List chartData = []; - // List chartPoints = []; + List circumferencePoints = []; + List weightPoints = []; final List chipsLabelList = ['Вес', 'Замеры', 'ИМТ']; final List chipsIntervalLabelList = ['1М', '3М', '6М', '1Г', 'ВСЁ ВРЕМЯ']; int _selectedChipIndex = 0; @@ -40,8 +45,8 @@ class _ProfileScreenState extends State { child: BlocBuilder( builder: (BuildContext context, ProfileState state) { if (state is ProfileStateLoaded) { - // chartData = state.profile.circumferences; - // chartPoints = state.profile.chartPoints; + circumferencePoints = state.circumferencePoints; + weightPoints = state.weightPoints; return Scaffold( backgroundColor: Colors.grey.shade200, appBar: widget.author == null ? AppBar(toolbarHeight: 0) : AppBar(), @@ -209,25 +214,27 @@ class _ProfileScreenState extends State { ], ), ), - // Builder( - // builder: (context) { - // switch (_selectedChipIndex) { - // case 0: - // return WeightChartWidget( - // chartPoints: chartPoints, - // profileCubit: context.read(), - // ); - // case 1: - // return CircumferenceChartWidget( - // chartData: chartData, - // profileCubit: context.read(), - // ); - // case 2: - // return ImtChartWidget(chartPoints: chartPoints); - // } - // return SizedBox.shrink(); - // }, - // ), + Builder( + builder: (context) { + switch (_selectedChipIndex) { + case 0: + return WeightChartWidget( + weightPoints: weightPoints, + profileCubit: context.read(), + ); + case 1: + return CircumferenceChartWidget( + circumferencePoints: circumferencePoints, + profileCubit: context.read(), + ); + case 2: + return ImtChartWidget( + weightPoints: weightPoints, + ); + } + return SizedBox.shrink(); + }, + ), SizedBox(height: 8), Row( children: [ diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index a27450ce..21fef10c 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -1,374 +1,374 @@ -// -// import 'package:eatvio_app/features/profile/models/profile_model.dart'; -// import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; -// import 'package:flutter/cupertino.dart'; -// import 'package:flutter/material.dart'; -// import 'package:intl/intl.dart'; -// import 'package:syncfusion_flutter_charts/charts.dart'; -// -// class CircumferenceChartWidget extends StatefulWidget { -// final List chartData; -// final ProfileCubit profileCubit; -// -// const CircumferenceChartWidget({ -// super.key, -// required this.chartData, -// required this.profileCubit, -// }); -// -// @override -// State createState() => _CircumferenceChartWidgetState(); -// } -// -// class _CircumferenceChartWidgetState extends State { -// late FixedExtentScrollController chestController; -// late FixedExtentScrollController waistController; -// late FixedExtentScrollController hipController; -// late int chest; -// late int waist; -// late int hip; -// -// @override -// Widget build(BuildContext context) { -// return Column( -// children: [ -// if (widget.chartData.isNotEmpty) -// Padding( -// padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), -// child: Row( -// children: [ -// Text( -// '${widget.chartData.last.chestCircumference}', -// style: TextStyle( -// color: Colors.black, -// fontSize: 40, -// fontWeight: FontWeight.w500, -// ), -// ), -// if (widget.chartData.length == 1) -// Container( -// margin: EdgeInsets.symmetric(horizontal: 12), -// width: 8, -// height: 8, -// decoration: BoxDecoration( -// shape: BoxShape.circle, -// color: Colors.black12, -// ), -// ), -// if (widget.chartData.length > 1) -// widget.chartData.last.chestCircumference > widget.chartData[widget.chartData.length - 2].chestCircumference -// ? Icon( -// Icons.arrow_drop_up, -// size: 40, -// color: Colors.grey, -// ) -// : Icon( -// Icons.arrow_drop_down, -// size: 40, -// color: Colors.grey, -// ), -// Text( -// '${widget.chartData.last.waistCircumference}', -// style: TextStyle( -// color: Colors.black, -// fontSize: 40, -// fontWeight: FontWeight.w500, -// ), -// ), -// if (widget.chartData.length == 1) -// Container( -// margin: EdgeInsets.symmetric(horizontal: 12), -// width: 8, -// height: 8, -// decoration: BoxDecoration( -// shape: BoxShape.circle, -// color: Colors.black12, -// ), -// ), -// if (widget.chartData.length > 1) -// widget.chartData.last.waistCircumference > widget.chartData[widget.chartData.length - 2].waistCircumference -// ? Icon( -// Icons.arrow_drop_up, -// size: 40, -// color: Colors.grey, -// ) -// : Icon( -// Icons.arrow_drop_down, -// size: 40, -// color: Colors.grey, -// ), -// Text( -// '${widget.chartData.last.hipCircumference}', -// style: TextStyle( -// color: Colors.black, -// fontSize: 40, -// fontWeight: FontWeight.w500, -// ), -// ), -// if (widget.chartData.length == 1) -// Container( -// margin: EdgeInsets.symmetric(horizontal: 12), -// width: 8, -// height: 8, -// decoration: BoxDecoration( -// shape: BoxShape.circle, -// color: Colors.black12, -// ), -// ), -// if (widget.chartData.length > 1) -// widget.chartData.last.hipCircumference > widget.chartData[widget.chartData.length - 2].hipCircumference -// ? Icon( -// Icons.arrow_drop_up, -// size: 40, -// color: Colors.grey, -// ) -// : Icon( -// Icons.arrow_drop_down, -// size: 40, -// color: Colors.grey, -// ), -// ], -// ), -// ), -// Stack( -// alignment: Alignment.bottomRight, -// children: [ -// SfCartesianChart( -// margin: EdgeInsets.symmetric(horizontal: 8), -// enableAxisAnimation: true, -// plotAreaBorderWidth: 0, -// trackballBehavior: TrackballBehavior( -// enable: true, -// activationMode: ActivationMode.singleTap, -// tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, -// tooltipSettings: InteractiveTooltip(), -// lineType: TrackballLineType.vertical, -// ), -// primaryXAxis: DateTimeCategoryAxis( -// tickPosition: TickPosition.inside, -// majorTickLines: MajorTickLines( -// size: 0, -// ), -// edgeLabelPlacement: EdgeLabelPlacement.shift, -// dateFormat: DateFormat.MMMd('ru'), -// labelStyle: TextStyle( -// color: Colors.grey, -// ), -// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), -// axisLine: AxisLine( -// color: Colors.grey.withOpacity(0.3), -// width: 0.4, -// ), -// ), -// primaryYAxis: NumericAxis( -// isVisible: false, -// labelFormat: '{value} см', -// axisLine: AxisLine( -// width: 1, -// ), -// majorTickLines: MajorTickLines(size: 0), -// ), -// series: _getSplineSeries(), -// tooltipBehavior: TooltipBehavior(enable: true), -// ), -// FloatingActionButton.small( -// heroTag: 'addCircumference', -// onPressed: () { -// if (widget.chartData.isNotEmpty) { -// chest = widget.chartData.last.chestCircumference; -// waist = widget.chartData.last.waistCircumference; -// hip = widget.chartData.last.hipCircumference; -// chestController = FixedExtentScrollController(initialItem: chest - 20); -// waistController = FixedExtentScrollController(initialItem: waist - 20); -// hipController = FixedExtentScrollController(initialItem: hip - 20); -// } else { -// chestController = FixedExtentScrollController(); -// waistController = FixedExtentScrollController(); -// hipController = FixedExtentScrollController(); -// } -// showModalBottomSheet( -// useRootNavigator: true, -// context: context, -// builder: (context) { -// return Column( -// children: [ -// Expanded( -// child: Row( -// children: [ -// Expanded( -// child: CupertinoPicker( -// magnification: 1.22, -// squeeze: 1.2, -// useMagnifier: true, -// scrollController: chestController, -// itemExtent: 24, -// onSelectedItemChanged: (int value) { -// chest = value; -// }, -// children: [ -// for (int i = 20; i < 200; i++) Text('$i'), -// ], -// ), -// ), -// Expanded( -// child: CupertinoPicker( -// magnification: 1.22, -// squeeze: 1.2, -// useMagnifier: true, -// scrollController: waistController, -// itemExtent: 24, -// onSelectedItemChanged: (int value) { -// waist = value; -// }, -// children: [ -// for (int i = 20; i < 200; i++) Text('$i'), -// ], -// ), -// ), -// Expanded( -// child: CupertinoPicker( -// magnification: 1.22, -// squeeze: 1.2, -// useMagnifier: true, -// scrollController: hipController, -// itemExtent: 24, -// onSelectedItemChanged: (int value) { -// hip = value; -// }, -// children: [ -// for (int i = 20; i < 200; i++) Text('$i'), -// ], -// ), -// ), -// ], -// ), -// ), -// InkWell( -// onTap: () { -// widget.profileCubit.addCircumference( -// chestCircumference: chest, -// waistCircumference: waist, -// hipCircumference: hip, -// ); -// Navigator.of(context).pop(); -// }, -// borderRadius: BorderRadius.circular(16), -// child: Ink( -// width: MediaQuery.of(context).size.width - 32, -// padding: EdgeInsets.all(16), -// decoration: BoxDecoration( -// color: appTheme.blueA400, -// borderRadius: BorderRadius.circular(16), -// ), -// child: Center( -// child: Text( -// 'Сохранить', -// style: TextStyle( -// color: Colors.white, -// ), -// ), -// ), -// ), -// ), -// ], -// ); -// }, -// ); -// }, -// backgroundColor: Colors.red, -// shape: CircleBorder(), -// child: Icon( -// Icons.add, -// color: Colors.white, -// ), -// ), -// ], -// ), -// ], -// ); -// } -// -// List> _getSplineSeries() { -// final Color seriesColor1 = Colors.red; -// final Color seriesColor2 = appTheme.blueA400; -// final Color seriesColor3 = Colors.green; -// -// return >[ -// SplineAreaSeries( -// markerSettings: MarkerSettings( -// isVisible: true, -// color: seriesColor1, -// height: 8, -// width: 8, -// ), -// dataLabelSettings: DataLabelSettings( -// labelAlignment: ChartDataLabelAlignment.top, -// isVisible: true, -// ), -// dataSource: widget.chartData, -// borderColor: seriesColor1, -// gradient: LinearGradient( -// colors: [ -// seriesColor1.withOpacity(0.14), -// Colors.transparent, -// ], -// begin: Alignment.topCenter, -// end: Alignment(0, 0.6), -// ), -// name: 'Грудь', -// xValueMapper: (Circumference value, int index) => value.createdAt, -// yValueMapper: (Circumference value, int index) => value.chestCircumference, -// ), -// SplineAreaSeries( -// markerSettings: MarkerSettings( -// isVisible: true, -// color: seriesColor2, -// height: 8, -// width: 8, -// ), -// dataLabelSettings: DataLabelSettings( -// labelAlignment: ChartDataLabelAlignment.top, -// isVisible: true, -// ), -// dataSource: widget.chartData, -// borderColor: seriesColor2, -// gradient: LinearGradient( -// colors: [ -// seriesColor2.withOpacity(0.14), -// Colors.transparent, -// ], -// begin: Alignment.topCenter, -// end: Alignment(0, 0.6), -// ), -// name: 'Талия', -// xValueMapper: (Circumference value, int index) => value.createdAt, -// yValueMapper: (Circumference value, int index) => value.waistCircumference, -// ), -// SplineAreaSeries( -// markerSettings: MarkerSettings( -// isVisible: true, -// color: seriesColor3, -// height: 8, -// width: 8, -// ), -// dataLabelSettings: DataLabelSettings( -// labelAlignment: ChartDataLabelAlignment.top, -// isVisible: true, -// ), -// dataSource: widget.chartData, -// borderColor: seriesColor3, -// gradient: LinearGradient( -// colors: [ -// seriesColor3.withOpacity(0.14), -// Colors.transparent, -// ], -// begin: Alignment.topCenter, -// end: Alignment(0, 0.6), -// ), -// name: 'Бёдра', -// xValueMapper: (Circumference value, int index) => value.createdAt, -// yValueMapper: (Circumference value, int index) => value.hipCircumference, -// ), -// ]; -// } -// } +import 'package:eatvio_app/features/profile/models/circumference_model.dart'; +import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; + +class CircumferenceChartWidget extends StatefulWidget { + final List circumferencePoints; + final ProfileCubit profileCubit; + + const CircumferenceChartWidget({ + super.key, + required this.circumferencePoints, + required this.profileCubit, + }); + + @override + State createState() => _CircumferenceChartWidgetState(); +} + +class _CircumferenceChartWidgetState extends State { + late FixedExtentScrollController chestController; + late FixedExtentScrollController waistController; + late FixedExtentScrollController hipController; + late int chest; + late int waist; + late int hip; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + if (widget.circumferencePoints.isNotEmpty) + Padding( + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Text( + '${widget.circumferencePoints.last.chestCircumference}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), + ), + if (widget.circumferencePoints.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, + ), + ), + if (widget.circumferencePoints.length > 1) + widget.circumferencePoints.last.chestCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].chestCircumference + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey, + ), + Text( + '${widget.circumferencePoints.last.waistCircumference}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), + ), + if (widget.circumferencePoints.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, + ), + ), + if (widget.circumferencePoints.length > 1) + widget.circumferencePoints.last.waistCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].waistCircumference + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey, + ), + Text( + '${widget.circumferencePoints.last.hipCircumference}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), + ), + if (widget.circumferencePoints.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, + ), + ), + if (widget.circumferencePoints.length > 1) + widget.circumferencePoints.last.hipCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].hipCircumference + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey, + ), + ], + ), + ), + Stack( + alignment: Alignment.bottomRight, + children: [ + SfCartesianChart( + margin: EdgeInsets.symmetric(horizontal: 8), + enableAxisAnimation: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, + ), + primaryXAxis: DateTimeCategoryAxis( + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, + dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + axisLine: AxisLine( + color: Colors.grey.withOpacity(0.3), + width: 0.4, + ), + ), + primaryYAxis: NumericAxis( + isVisible: false, + labelFormat: '{value} см', + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), + ), + FloatingActionButton.small( + heroTag: 'addCircumference', + onPressed: () { + if (widget.circumferencePoints.isNotEmpty) { + chest = widget.circumferencePoints.last.chestCircumference; + waist = widget.circumferencePoints.last.waistCircumference; + hip = widget.circumferencePoints.last.hipCircumference; + chestController = FixedExtentScrollController(initialItem: chest - 20); + waistController = FixedExtentScrollController(initialItem: waist - 20); + hipController = FixedExtentScrollController(initialItem: hip - 20); + } else { + chestController = FixedExtentScrollController(); + waistController = FixedExtentScrollController(); + hipController = FixedExtentScrollController(); + } + showModalBottomSheet( + useRootNavigator: true, + context: context, + builder: (context) { + return Column( + children: [ + Expanded( + child: Row( + children: [ + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: chestController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + chest = value; + }, + children: [ + for (int i = 20; i < 200; i++) Text('$i'), + ], + ), + ), + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: waistController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + waist = value; + }, + children: [ + for (int i = 20; i < 200; i++) Text('$i'), + ], + ), + ), + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: hipController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + hip = value; + }, + children: [ + for (int i = 20; i < 200; i++) Text('$i'), + ], + ), + ), + ], + ), + ), + InkWell( + onTap: () { + widget.profileCubit.addCircumference( + chestCircumference: chest, + waistCircumference: waist, + hipCircumference: hip, + ); + Navigator.of(context).pop(); + }, + borderRadius: BorderRadius.circular(16), + child: Ink( + width: MediaQuery.of(context).size.width - 32, + padding: EdgeInsets.all(16), + decoration: BoxDecoration( + color: appTheme.blueA400, + borderRadius: BorderRadius.circular(16), + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + ), + ), + ), + ), + ), + ], + ); + }, + ); + }, + backgroundColor: Colors.red, + shape: CircleBorder(), + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ], + ), + ], + ); + } + + List> _getSplineSeries() { + final Color seriesColor1 = Colors.red; + final Color seriesColor2 = appTheme.blueA400; + final Color seriesColor3 = Colors.green; + + return >[ + SplineAreaSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor1, + height: 8, + width: 8, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: widget.circumferencePoints, + borderColor: seriesColor1, + gradient: LinearGradient( + colors: [ + seriesColor1.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), + name: 'Грудь', + xValueMapper: (CircumferenceModel value, int index) => value.createdAt, + yValueMapper: (CircumferenceModel value, int index) => value.chestCircumference, + ), + SplineAreaSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor2, + height: 8, + width: 8, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: widget.circumferencePoints, + borderColor: seriesColor2, + gradient: LinearGradient( + colors: [ + seriesColor2.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), + name: 'Талия', + xValueMapper: (CircumferenceModel value, int index) => value.createdAt, + yValueMapper: (CircumferenceModel value, int index) => value.waistCircumference, + ), + SplineAreaSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor3, + height: 8, + width: 8, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: widget.circumferencePoints, + borderColor: seriesColor3, + gradient: LinearGradient( + colors: [ + seriesColor3.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), + name: 'Бёдра', + xValueMapper: (CircumferenceModel value, int index) => value.createdAt, + yValueMapper: (CircumferenceModel value, int index) => value.hipCircumference, + ), + ]; + } +} diff --git a/lib/features/profile/presentation/widgets/imt_chart_widget.dart b/lib/features/profile/presentation/widgets/imt_chart_widget.dart index 258bd004..abd8e05b 100644 --- a/lib/features/profile/presentation/widgets/imt_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/imt_chart_widget.dart @@ -1,114 +1,114 @@ -// import 'package:eatvio_app/features/profile/models/profile_model.dart'; -// import 'package:eatvio_app/theme/theme_helper.dart'; -// import 'package:flutter/material.dart'; -// import 'package:syncfusion_flutter_charts/charts.dart'; -// import 'package:intl/intl.dart'; -// -// class ImtChartWidget extends StatelessWidget { -// final List chartPoints; -// -// const ImtChartWidget({ -// super.key, -// required this.chartPoints, -// }); -// -// @override -// Widget build(BuildContext context) { -// return Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), -// child: Row( -// children: [ -// Text( -// '${chartPoints.last.bmi.toStringAsFixed(2)}', -// style: TextStyle( -// color: Colors.black, -// fontSize: 40, -// fontWeight: FontWeight.w500, -// ), -// ), -// chartPoints.last.bmi > chartPoints[chartPoints.length - 2].bmi -// ? Icon( -// Icons.arrow_drop_up, -// size: 40, -// color: Colors.grey, -// ) -// : Icon( -// Icons.arrow_drop_down, -// size: 40, -// color: Colors.grey, -// ), -// ], -// ), -// ), -// SfCartesianChart( -// margin: EdgeInsets.symmetric(horizontal: 8), -// enableAxisAnimation: true, -// plotAreaBorderWidth: 0, -// trackballBehavior: TrackballBehavior( -// enable: true, -// activationMode: ActivationMode.singleTap, -// tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, -// tooltipSettings: InteractiveTooltip(), -// lineType: TrackballLineType.vertical, -// ), -// primaryXAxis: DateTimeCategoryAxis( -// initialVisibleMinimum: chartPoints.first.createdAt, -// initialVisibleMaximum: chartPoints.last.createdAt, -// tickPosition: TickPosition.inside, -// majorTickLines: MajorTickLines( -// size: 0, -// ), -// edgeLabelPlacement: EdgeLabelPlacement.shift, -// dateFormat: DateFormat.MMMd('ru'), -// labelStyle: TextStyle( -// color: Colors.grey, -// ), -// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), -// axisLine: AxisLine( -// color: Colors.grey.withOpacity(0.3), -// width: 0.4, -// ), -// ), -// primaryYAxis: NumericAxis( -// isVisible: false, -// ), -// series: _getSplineSeries(), -// tooltipBehavior: TooltipBehavior(enable: true), -// ), -// ], -// ); -// } -// -// List> _getSplineSeries() { -// return >[ -// SplineAreaSeries( -// markerSettings: MarkerSettings( -// isVisible: true, -// color: appTheme.blueA400, -// height: 8, -// width: 8, -// ), -// dataLabelSettings: DataLabelSettings( -// labelAlignment: ChartDataLabelAlignment.top, -// isVisible: true, -// ), -// dataSource: chartPoints, -// borderColor: appTheme.blueA400, -// gradient: LinearGradient( -// colors: [ -// appTheme.blueA400.withOpacity(0.14), -// Colors.transparent, -// ], -// begin: Alignment.topCenter, -// end: Alignment(0, 0.6), -// ), -// name: 'ИМТ', -// xValueMapper: (ChartPointModel value, int index) => value.createdAt, -// yValueMapper: (ChartPointModel value, int index) => double.parse(value.bmi.toStringAsFixed(2)), -// ), -// ]; -// } -// } +import 'package:eatvio_app/features/profile/models/weight_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:flutter/material.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; +import 'package:intl/intl.dart'; + +class ImtChartWidget extends StatelessWidget { + final List weightPoints; + + const ImtChartWidget({ + super.key, + required this.weightPoints, + }); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Text( + '${weightPoints.last.bmi.toStringAsFixed(2)}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), + ), + weightPoints.last.bmi > weightPoints[weightPoints.length - 2].bmi + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey, + ), + ], + ), + ), + SfCartesianChart( + margin: EdgeInsets.symmetric(horizontal: 8), + enableAxisAnimation: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, + ), + primaryXAxis: DateTimeCategoryAxis( + initialVisibleMinimum: weightPoints.first.createdAt, + initialVisibleMaximum: weightPoints.last.createdAt, + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, + dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + axisLine: AxisLine( + color: Colors.grey.withOpacity(0.3), + width: 0.4, + ), + ), + primaryYAxis: NumericAxis( + isVisible: false, + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), + ), + ], + ); + } + + List> _getSplineSeries() { + return >[ + SplineAreaSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: appTheme.blueA400, + height: 8, + width: 8, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: weightPoints, + borderColor: appTheme.blueA400, + gradient: LinearGradient( + colors: [ + appTheme.blueA400.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), + name: 'ИМТ', + xValueMapper: (WeightModel value, int index) => value.createdAt, + yValueMapper: (WeightModel value, int index) => double.parse(value.bmi.toStringAsFixed(2)), + ), + ]; + } +} diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index ab457ebe..f5f2a579 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -1,237 +1,237 @@ -// -// import 'package:eatvio_app/features/profile/models/profile_model.dart'; -// import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; -// import 'package:flutter/cupertino.dart'; -// import 'package:flutter/material.dart'; -// import 'package:intl/intl.dart'; -// import 'package:syncfusion_flutter_charts/charts.dart'; -// -// class WeightChartWidget extends StatefulWidget { -// final List chartPoints; -// final ProfileCubit profileCubit; -// -// const WeightChartWidget({ -// super.key, -// required this.chartPoints, -// required this.profileCubit, -// }); -// -// @override -// State createState() => _WeightChartWidgetState(); -// } -// -// class _WeightChartWidgetState extends State { -// late FixedExtentScrollController weightKiloController; -// late FixedExtentScrollController weightGramsController; -// late int weightKilo; -// late int weightGrams; -// -// @override -// Widget build(BuildContext context) { -// return Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// if (widget.chartPoints.isNotEmpty) -// Padding( -// padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), -// child: Row( -// children: [ -// Text( -// '${widget.chartPoints.last.weight.toStringAsFixed(1)} кг', -// style: TextStyle( -// color: Colors.black, -// fontSize: 40, -// fontWeight: FontWeight.w500, -// ), -// ), -// if (widget.chartPoints.length == 1) -// Container( -// margin: EdgeInsets.symmetric(horizontal: 12), -// width: 8, -// height: 8, -// decoration: BoxDecoration( -// shape: BoxShape.circle, -// color: Colors.black12, -// ), -// ), -// if (widget.chartPoints.length > 1) widget.chartPoints.last.weight > widget.chartPoints[widget.chartPoints.length - 2].weight -// ? Icon( -// Icons.arrow_drop_up, -// size: 40, -// color: Colors.grey.withOpacity(0.4), -// ) -// : Icon( -// Icons.arrow_drop_down, -// size: 40, -// color: Colors.grey.withOpacity(0.4), -// ), -// ], -// ), -// ), -// Stack( -// alignment: Alignment.bottomRight, -// children: [ -// SfCartesianChart( -// margin: EdgeInsets.symmetric(horizontal: 8), -// enableAxisAnimation: true, -// plotAreaBorderWidth: 0, -// trackballBehavior: TrackballBehavior( -// enable: true, -// activationMode: ActivationMode.singleTap, -// tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, -// tooltipSettings: InteractiveTooltip(), -// lineType: TrackballLineType.vertical, -// ), -// primaryXAxis: DateTimeCategoryAxis( -// tickPosition: TickPosition.inside, -// majorTickLines: MajorTickLines( -// size: 0, -// ), -// edgeLabelPlacement: EdgeLabelPlacement.shift, -// dateFormat: DateFormat.MMMd('ru'), -// labelStyle: TextStyle( -// color: Colors.grey, -// ), -// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), -// axisLine: AxisLine( -// color: Colors.grey.withOpacity(0.3), -// width: 0.4, -// ), -// ), -// primaryYAxis: NumericAxis( -// isVisible: false, -// labelFormat: '{value} кг', -// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), -// axisLine: AxisLine( -// width: 1, -// ), -// majorTickLines: MajorTickLines(size: 0), -// ), -// series: _getSplineSeries(), -// tooltipBehavior: TooltipBehavior(enable: true), -// ), -// FloatingActionButton.small( -// heroTag: 'addWeight', -// onPressed: () { -// if (widget.chartPoints.isNotEmpty) { -// weightKilo = int.parse(widget.chartPoints.last.weight.toString().split('.')[0]); -// weightGrams = int.parse(widget.chartPoints.last.weight.toString().split('.')[1][0]); -// weightKiloController = FixedExtentScrollController(initialItem: weightKilo - 20); -// weightGramsController = FixedExtentScrollController(initialItem: weightGrams); -// } else { -// weightKiloController = FixedExtentScrollController(); -// weightGramsController = FixedExtentScrollController(); -// } -// showModalBottomSheet( -// useRootNavigator: true, -// context: context, -// builder: (context) { -// return Column( -// children: [ -// Expanded( -// child: Row( -// children: [ -// Expanded( -// child: CupertinoPicker( -// magnification: 1.22, -// squeeze: 1.2, -// useMagnifier: true, -// scrollController: weightKiloController, -// itemExtent: 24, -// onSelectedItemChanged: (int value) { -// weightKilo = value + 20; -// }, -// children: [ -// for (int i = 20; i < 300; i++) Text('$i'), -// ], -// ), -// ), -// Expanded( -// child: CupertinoPicker( -// magnification: 1.22, -// squeeze: 1.2, -// useMagnifier: true, -// scrollController: weightGramsController, -// itemExtent: 24, -// onSelectedItemChanged: (int value) { -// weightGrams = value; -// }, -// children: [ -// for (int i = 0; i < 10; i++) Text('$i'), -// ], -// ), -// ), -// ], -// ), -// ), -// InkWell( -// onTap: () { -// widget.profileCubit.addWeight(weight: double.parse('$weightKilo.$weightGrams')); -// Navigator.of(context).pop(); -// }, -// borderRadius: BorderRadius.circular(16), -// child: Ink( -// width: MediaQuery.of(context).size.width - 32, -// padding: EdgeInsets.all(16), -// decoration: BoxDecoration( -// color: appTheme.blueA400, -// borderRadius: BorderRadius.circular(16), -// ), -// child: Center( -// child: Text( -// 'Сохранить', -// style: TextStyle( -// color: Colors.white, -// ), -// ), -// ), -// ), -// ), -// ], -// ); -// }, -// ); -// }, -// backgroundColor: Colors.red, -// shape: CircleBorder(), -// child: Icon( -// Icons.add, -// color: Colors.white, -// ), -// ), -// ], -// ), -// ], -// ); -// } -// -// List> _getSplineSeries() { -// return >[ -// SplineAreaSeries( -// markerSettings: MarkerSettings( -// isVisible: true, -// color: appTheme.blueA400, -// height: 8, -// width: 8, -// ), -// dataLabelSettings: DataLabelSettings( -// labelAlignment: ChartDataLabelAlignment.top, -// isVisible: true, -// ), -// dataSource: widget.chartPoints, -// borderColor: appTheme.blueA400, -// gradient: LinearGradient( -// colors: [ -// appTheme.blueA400.withOpacity(0.14), -// Colors.transparent, -// ], -// begin: Alignment.topCenter, -// end: Alignment(0, 0.6), -// ), -// name: 'Вес', -// xValueMapper: (ChartPointModel value, int index) => value.createdAt, -// yValueMapper: (ChartPointModel value, int index) => value.weight, -// ), -// ]; -// } -// } +import 'package:eatvio_app/features/profile/models/weight_model.dart'; +import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; + +class WeightChartWidget extends StatefulWidget { + final List weightPoints; + final ProfileCubit profileCubit; + + const WeightChartWidget({ + super.key, + required this.weightPoints, + required this.profileCubit, + }); + + @override + State createState() => _WeightChartWidgetState(); +} + +class _WeightChartWidgetState extends State { + late FixedExtentScrollController weightKiloController; + late FixedExtentScrollController weightGramsController; + late int weightKilo; + late int weightGrams; + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (widget.weightPoints.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Text( + '${widget.weightPoints.last.weight.toStringAsFixed(1)} кг', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), + ), + if (widget.weightPoints.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, + ), + ), + if (widget.weightPoints.length > 1) widget.weightPoints.last.weight > widget.weightPoints[widget.weightPoints.length - 2].weight + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey.withOpacity(0.4), + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey.withOpacity(0.4), + ), + ], + ), + ), + Stack( + alignment: Alignment.bottomRight, + children: [ + SfCartesianChart( + margin: EdgeInsets.symmetric(horizontal: 8), + enableAxisAnimation: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, + ), + primaryXAxis: DateTimeCategoryAxis( + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, + dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + axisLine: AxisLine( + color: Colors.grey.withOpacity(0.3), + width: 0.4, + ), + ), + primaryYAxis: NumericAxis( + isVisible: false, + labelFormat: '{value} кг', + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), + ), + FloatingActionButton.small( + heroTag: 'addWeight', + onPressed: () { + if (widget.weightPoints.isNotEmpty) { + weightKilo = int.parse(widget.weightPoints.last.weight.toString().split('.')[0]); + weightGrams = int.parse(widget.weightPoints.last.weight.toString().split('.')[1][0]); + weightKiloController = FixedExtentScrollController(initialItem: weightKilo - 20); + weightGramsController = FixedExtentScrollController(initialItem: weightGrams); + } else { + weightKiloController = FixedExtentScrollController(); + weightGramsController = FixedExtentScrollController(); + } + showModalBottomSheet( + useRootNavigator: true, + context: context, + builder: (context) { + return Column( + children: [ + Expanded( + child: Row( + children: [ + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: weightKiloController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + weightKilo = value + 20; + }, + children: [ + for (int i = 20; i < 300; i++) Text('$i'), + ], + ), + ), + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: weightGramsController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + weightGrams = value; + }, + children: [ + for (int i = 0; i < 10; i++) Text('$i'), + ], + ), + ), + ], + ), + ), + InkWell( + onTap: () { + widget.profileCubit.addWeight(weight: double.parse('$weightKilo.$weightGrams')); + Navigator.of(context).pop(); + }, + borderRadius: BorderRadius.circular(16), + child: Ink( + width: MediaQuery.of(context).size.width - 32, + padding: EdgeInsets.all(16), + decoration: BoxDecoration( + color: appTheme.blueA400, + borderRadius: BorderRadius.circular(16), + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + ), + ), + ), + ), + ), + ], + ); + }, + ); + }, + backgroundColor: Colors.red, + shape: CircleBorder(), + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ], + ), + ], + ); + } + + List> _getSplineSeries() { + return >[ + SplineAreaSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: appTheme.blueA400, + height: 8, + width: 8, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: widget.weightPoints, + borderColor: appTheme.blueA400, + gradient: LinearGradient( + colors: [ + appTheme.blueA400.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), + name: 'Вес', + xValueMapper: (WeightModel value, int index) => value.createdAt, + yValueMapper: (WeightModel value, int index) => value.weight, + ), + ]; + } +} diff --git a/lib/features/profile/repositories/profile_repository.dart b/lib/features/profile/repositories/profile_repository.dart index de8c37cf..2e927ca0 100644 --- a/lib/features/profile/repositories/profile_repository.dart +++ b/lib/features/profile/repositories/profile_repository.dart @@ -1,5 +1,7 @@ import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; +import 'package:eatvio_app/features/profile/models/circumference_model.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/profile/models/weight_model.dart'; import 'package:eatvio_app/features/profile/services/profile_service.dart'; class ProfileRepository { @@ -69,4 +71,44 @@ class ProfileRepository { rethrow; } } + + Future> getWeight({ + required String period, + String? slug, + }) async { + try { + if (slug != null) { + return (await profileService.getWeightBySlug( + period: period, + slug: slug, + )); + } else { + return (await profileService.getWeight( + period: period, + )); + } + } catch (e) { + rethrow; + } + } + + Future> getCircumferences({ + required String period, + String? slug, + }) async { + try { + if (slug != null) { + return (await profileService.getCircumferencesBySlug( + period: period, + slug: slug, + )); + } else { + return (await profileService.getCircumferences( + period: period, + )); + } + } catch (e) { + rethrow; + } + } } diff --git a/lib/features/profile/services/profile_service.dart b/lib/features/profile/services/profile_service.dart index 078eb61d..f5490213 100644 --- a/lib/features/profile/services/profile_service.dart +++ b/lib/features/profile/services/profile_service.dart @@ -1,6 +1,8 @@ import 'package:dio/dio.dart'; import 'package:eatvio_app/features/feed/models/feed_blog_post_settings_model.dart'; +import 'package:eatvio_app/features/profile/models/circumference_model.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/profile/models/weight_model.dart'; import 'package:retrofit/retrofit.dart'; part 'profile_service.g.dart'; @@ -36,4 +38,26 @@ abstract class ProfileService { Future getBlogPostByAuthorSlug({ @Path() required String slug, }); + + @GET('/api/profile/measure/weight/{period}') + Future> getWeight({ + @Path() required String period, + }); + + @GET('/api/profile/measure/weight/{period}/{slug}') + Future> getWeightBySlug({ + @Path() required String period, + @Path() required String slug, + }); + + @GET('/api/profile/measure/circumferences/{period}') + Future> getCircumferences({ + @Path() required String period, + }); + + @GET('/api/profile/measure/circumferences/{period}/{user}') + Future> getCircumferencesBySlug({ + @Path() required String period, + @Path() required String slug, + }); } diff --git a/lib/features/profile/services/profile_service.g.dart b/lib/features/profile/services/profile_service.g.dart index 47070f20..36b64eb3 100644 --- a/lib/features/profile/services/profile_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -191,7 +191,8 @@ class _ProfileService implements ProfileService { } @override - Future getBlogPostByAuthorSlug({required String slug}) async { + Future getBlogPostByAuthorSlug( + {required String slug}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -223,8 +224,159 @@ class _ProfileService implements ProfileService { return _value; } + @override + Future> getWeight({required String period}) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/measure/weight/${period}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late List _value; + try { + _value = _result.data! + .map((dynamic i) => WeightModel.fromJson(i as Map)) + .toList(); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + + @override + Future> getWeightBySlug({ + required String period, + required String slug, + }) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/measure/weight/${period}/${slug}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late List _value; + try { + _value = _result.data! + .map((dynamic i) => WeightModel.fromJson(i as Map)) + .toList(); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + + @override + Future> getCircumferences( + {required String period}) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/measure/circumferences/${period}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late List _value; + try { + _value = _result.data! + .map((dynamic i) => + CircumferenceModel.fromJson(i as Map)) + .toList(); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + + @override + Future> getCircumferencesBySlug({ + required String period, + required String slug, + }) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/measure/circumferences/${period}/{user}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late List _value; + try { + _value = _result.data! + .map((dynamic i) => + CircumferenceModel.fromJson(i as Map)) + .toList(); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/recipes/models/ingredient.freezed.dart b/lib/features/recipes/models/ingredient.freezed.dart index 24468f59..2bf96fb3 100644 --- a/lib/features/recipes/models/ingredient.freezed.dart +++ b/lib/features/recipes/models/ingredient.freezed.dart @@ -21,9 +21,7 @@ Ingredient _$IngredientFromJson(Map json) { /// @nodoc mixin _$Ingredient { String get name => throw _privateConstructorUsedError; - String get unit => throw _privateConstructorUsedError; - String get portion => throw _privateConstructorUsedError; /// Serializes this Ingredient to a JSON map. @@ -32,24 +30,26 @@ mixin _$Ingredient { /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $IngredientCopyWith get copyWith => throw _privateConstructorUsedError; + $IngredientCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $IngredientCopyWith<$Res> { - factory $IngredientCopyWith(Ingredient value, $Res Function(Ingredient) then) = _$IngredientCopyWithImpl<$Res, Ingredient>; - + factory $IngredientCopyWith( + Ingredient value, $Res Function(Ingredient) then) = + _$IngredientCopyWithImpl<$Res, Ingredient>; @useResult $Res call({String name, String unit, String portion}); } /// @nodoc -class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $IngredientCopyWith<$Res> { +class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> + implements $IngredientCopyWith<$Res> { _$IngredientCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -80,17 +80,23 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $Ingred } /// @nodoc -abstract class _$$IngredientImplCopyWith<$Res> implements $IngredientCopyWith<$Res> { - factory _$$IngredientImplCopyWith(_$IngredientImpl value, $Res Function(_$IngredientImpl) then) = __$$IngredientImplCopyWithImpl<$Res>; - +abstract class _$$IngredientImplCopyWith<$Res> + implements $IngredientCopyWith<$Res> { + factory _$$IngredientImplCopyWith( + _$IngredientImpl value, $Res Function(_$IngredientImpl) then) = + __$$IngredientImplCopyWithImpl<$Res>; @override @useResult $Res call({String name, String unit, String portion}); } /// @nodoc -class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> implements _$$IngredientImplCopyWith<$Res> { - __$$IngredientImplCopyWithImpl(_$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) : super(_value, _then); +class __$$IngredientImplCopyWithImpl<$Res> + extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> + implements _$$IngredientImplCopyWith<$Res> { + __$$IngredientImplCopyWithImpl( + _$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) + : super(_value, _then); /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @@ -121,9 +127,11 @@ class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$Res /// @nodoc @JsonSerializable() class _$IngredientImpl implements _Ingredient { - const _$IngredientImpl({required this.name, required this.unit, required this.portion}); + const _$IngredientImpl( + {required this.name, required this.unit, required this.portion}); - factory _$IngredientImpl.fromJson(Map json) => _$$IngredientImplFromJson(json); + factory _$IngredientImpl.fromJson(Map json) => + _$$IngredientImplFromJson(json); @override final String name; @@ -156,7 +164,8 @@ class _$IngredientImpl implements _Ingredient { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => + __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); @override Map toJson() { @@ -167,16 +176,18 @@ class _$IngredientImpl implements _Ingredient { } abstract class _Ingredient implements Ingredient { - const factory _Ingredient({required final String name, required final String unit, required final String portion}) = _$IngredientImpl; + const factory _Ingredient( + {required final String name, + required final String unit, + required final String portion}) = _$IngredientImpl; - factory _Ingredient.fromJson(Map json) = _$IngredientImpl.fromJson; + factory _Ingredient.fromJson(Map json) = + _$IngredientImpl.fromJson; @override String get name; - @override String get unit; - @override String get portion; @@ -184,5 +195,6 @@ abstract class _Ingredient implements Ingredient { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError; + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/ingredient.g.dart b/lib/features/recipes/models/ingredient.g.dart index 3d2f63b5..b3f1844d 100644 --- a/lib/features/recipes/models/ingredient.g.dart +++ b/lib/features/recipes/models/ingredient.g.dart @@ -6,13 +6,15 @@ part of 'ingredient.dart'; // JsonSerializableGenerator // ************************************************************************** -_$IngredientImpl _$$IngredientImplFromJson(Map json) => _$IngredientImpl( +_$IngredientImpl _$$IngredientImplFromJson(Map json) => + _$IngredientImpl( name: json['name'] as String, unit: json['unit'] as String, portion: json['portion'] as String, ); -Map _$$IngredientImplToJson(_$IngredientImpl instance) => { +Map _$$IngredientImplToJson(_$IngredientImpl instance) => + { 'name': instance.name, 'unit': instance.unit, 'portion': instance.portion, diff --git a/lib/features/recipes/models/recipe_model.freezed.dart b/lib/features/recipes/models/recipe_model.freezed.dart index de1cbd2e..691ac1f3 100644 --- a/lib/features/recipes/models/recipe_model.freezed.dart +++ b/lib/features/recipes/models/recipe_model.freezed.dart @@ -21,21 +21,13 @@ RecipeModel _$RecipeModelFromJson(Map json) { /// @nodoc mixin _$RecipeModel { List? get ingredients => throw _privateConstructorUsedError; - List? get steps => throw _privateConstructorUsedError; - String? get type => throw _privateConstructorUsedError; - String? get state => throw _privateConstructorUsedError; - String? get title => throw _privateConstructorUsedError; - String? get description => throw _privateConstructorUsedError; - String? get video_url => throw _privateConstructorUsedError; - String? get image => throw _privateConstructorUsedError; - int? get cooking_time => throw _privateConstructorUsedError; /// Serializes this RecipeModel to a JSON map. @@ -44,13 +36,15 @@ mixin _$RecipeModel { /// Create a copy of RecipeModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeModelCopyWith get copyWith => throw _privateConstructorUsedError; + $RecipeModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeModelCopyWith<$Res> { - factory $RecipeModelCopyWith(RecipeModel value, $Res Function(RecipeModel) then) = _$RecipeModelCopyWithImpl<$Res, RecipeModel>; - + factory $RecipeModelCopyWith( + RecipeModel value, $Res Function(RecipeModel) then) = + _$RecipeModelCopyWithImpl<$Res, RecipeModel>; @useResult $Res call( {List? ingredients, @@ -65,12 +59,12 @@ abstract class $RecipeModelCopyWith<$Res> { } /// @nodoc -class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> implements $RecipeModelCopyWith<$Res> { +class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> + implements $RecipeModelCopyWith<$Res> { _$RecipeModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -131,9 +125,11 @@ class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> implements $Reci } /// @nodoc -abstract class _$$RecipeModelImplCopyWith<$Res> implements $RecipeModelCopyWith<$Res> { - factory _$$RecipeModelImplCopyWith(_$RecipeModelImpl value, $Res Function(_$RecipeModelImpl) then) = __$$RecipeModelImplCopyWithImpl<$Res>; - +abstract class _$$RecipeModelImplCopyWith<$Res> + implements $RecipeModelCopyWith<$Res> { + factory _$$RecipeModelImplCopyWith( + _$RecipeModelImpl value, $Res Function(_$RecipeModelImpl) then) = + __$$RecipeModelImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -149,8 +145,12 @@ abstract class _$$RecipeModelImplCopyWith<$Res> implements $RecipeModelCopyWith< } /// @nodoc -class __$$RecipeModelImplCopyWithImpl<$Res> extends _$RecipeModelCopyWithImpl<$Res, _$RecipeModelImpl> implements _$$RecipeModelImplCopyWith<$Res> { - __$$RecipeModelImplCopyWithImpl(_$RecipeModelImpl _value, $Res Function(_$RecipeModelImpl) _then) : super(_value, _then); +class __$$RecipeModelImplCopyWithImpl<$Res> + extends _$RecipeModelCopyWithImpl<$Res, _$RecipeModelImpl> + implements _$$RecipeModelImplCopyWith<$Res> { + __$$RecipeModelImplCopyWithImpl( + _$RecipeModelImpl _value, $Res Function(_$RecipeModelImpl) _then) + : super(_value, _then); /// Create a copy of RecipeModel /// with the given fields replaced by the non-null parameter values. @@ -224,10 +224,10 @@ class _$RecipeModelImpl implements _RecipeModel { : _ingredients = ingredients, _steps = steps; - factory _$RecipeModelImpl.fromJson(Map json) => _$$RecipeModelImplFromJson(json); + factory _$RecipeModelImpl.fromJson(Map json) => + _$$RecipeModelImplFromJson(json); final List? _ingredients; - @override List? get ingredients { final value = _ingredients; @@ -238,7 +238,6 @@ class _$RecipeModelImpl implements _RecipeModel { } final List? _steps; - @override List? get steps { final value = _steps; @@ -273,28 +272,42 @@ class _$RecipeModelImpl implements _RecipeModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeModelImpl && - const DeepCollectionEquality().equals(other._ingredients, _ingredients) && + const DeepCollectionEquality() + .equals(other._ingredients, _ingredients) && const DeepCollectionEquality().equals(other._steps, _steps) && (identical(other.type, type) || other.type == type) && (identical(other.state, state) || other.state == state) && (identical(other.title, title) || other.title == title) && - (identical(other.description, description) || other.description == description) && - (identical(other.video_url, video_url) || other.video_url == video_url) && + (identical(other.description, description) || + other.description == description) && + (identical(other.video_url, video_url) || + other.video_url == video_url) && (identical(other.image, image) || other.image == image) && - (identical(other.cooking_time, cooking_time) || other.cooking_time == cooking_time)); + (identical(other.cooking_time, cooking_time) || + other.cooking_time == cooking_time)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_ingredients), const DeepCollectionEquality().hash(_steps), type, state, - title, description, video_url, image, cooking_time); + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(_ingredients), + const DeepCollectionEquality().hash(_steps), + type, + state, + title, + description, + video_url, + image, + cooking_time); /// Create a copy of RecipeModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => __$$RecipeModelImplCopyWithImpl<_$RecipeModelImpl>(this, _$identity); + _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => + __$$RecipeModelImplCopyWithImpl<_$RecipeModelImpl>(this, _$identity); @override Map toJson() { @@ -316,32 +329,25 @@ abstract class _RecipeModel implements RecipeModel { final String? image, final int? cooking_time}) = _$RecipeModelImpl; - factory _RecipeModel.fromJson(Map json) = _$RecipeModelImpl.fromJson; + factory _RecipeModel.fromJson(Map json) = + _$RecipeModelImpl.fromJson; @override List? get ingredients; - @override List? get steps; - @override String? get type; - @override String? get state; - @override String? get title; - @override String? get description; - @override String? get video_url; - @override String? get image; - @override int? get cooking_time; @@ -349,5 +355,6 @@ abstract class _RecipeModel implements RecipeModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/recipe_model.g.dart b/lib/features/recipes/models/recipe_model.g.dart index ac7c7c2d..d5ab9c96 100644 --- a/lib/features/recipes/models/recipe_model.g.dart +++ b/lib/features/recipes/models/recipe_model.g.dart @@ -6,9 +6,16 @@ part of 'recipe_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipeModelImpl _$$RecipeModelImplFromJson(Map json) => _$RecipeModelImpl( - ingredients: (json['ingredients'] as List?)?.map((e) => e == null ? null : Ingredient.fromJson(e as Map)).toList(), - steps: (json['steps'] as List?)?.map((e) => e == null ? null : Step.fromJson(e as Map)).toList(), +_$RecipeModelImpl _$$RecipeModelImplFromJson(Map json) => + _$RecipeModelImpl( + ingredients: (json['ingredients'] as List?) + ?.map((e) => + e == null ? null : Ingredient.fromJson(e as Map)) + .toList(), + steps: (json['steps'] as List?) + ?.map((e) => + e == null ? null : Step.fromJson(e as Map)) + .toList(), type: json['type'] as String?, state: json['state'] as String?, title: json['title'] as String?, @@ -18,7 +25,8 @@ _$RecipeModelImpl _$$RecipeModelImplFromJson(Map json) => _$Rec cooking_time: (json['cooking_time'] as num?)?.toInt(), ); -Map _$$RecipeModelImplToJson(_$RecipeModelImpl instance) => { +Map _$$RecipeModelImplToJson(_$RecipeModelImpl instance) => + { 'ingredients': instance.ingredients, 'steps': instance.steps, 'type': instance.type, diff --git a/lib/features/recipes/models/recipe_tag_model.freezed.dart b/lib/features/recipes/models/recipe_tag_model.freezed.dart index cfeff53c..d9993da3 100644 --- a/lib/features/recipes/models/recipe_tag_model.freezed.dart +++ b/lib/features/recipes/models/recipe_tag_model.freezed.dart @@ -22,10 +22,8 @@ RecipeTagModel _$RecipeTagModelFromJson(Map json) { mixin _$RecipeTagModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; - @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; - @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -35,28 +33,32 @@ mixin _$RecipeTagModel { /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeTagModelCopyWith get copyWith => throw _privateConstructorUsedError; + $RecipeTagModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeTagModelCopyWith<$Res> { - factory $RecipeTagModelCopyWith(RecipeTagModel value, $Res Function(RecipeTagModel) then) = _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>; - + factory $RecipeTagModelCopyWith( + RecipeTagModel value, $Res Function(RecipeTagModel) then) = + _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>; @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; - $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> implements $RecipeTagModelCopyWith<$Res> { +class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> + implements $RecipeTagModelCopyWith<$Res> { _$RecipeTagModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -107,23 +109,31 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> implements } /// @nodoc -abstract class _$$RecipeTagModelImplCopyWith<$Res> implements $RecipeTagModelCopyWith<$Res> { - factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value, $Res Function(_$RecipeTagModelImpl) then) = __$$RecipeTagModelImplCopyWithImpl<$Res>; - +abstract class _$$RecipeTagModelImplCopyWith<$Res> + implements $RecipeTagModelCopyWith<$Res> { + factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value, + $Res Function(_$RecipeTagModelImpl) then) = + __$$RecipeTagModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; - @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$RecipeTagModelImplCopyWithImpl<$Res> extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl> implements _$$RecipeTagModelImplCopyWith<$Res> { - __$$RecipeTagModelImplCopyWithImpl(_$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) : super(_value, _then); +class __$$RecipeTagModelImplCopyWithImpl<$Res> + extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl> + implements _$$RecipeTagModelImplCopyWith<$Res> { + __$$RecipeTagModelImplCopyWithImpl( + _$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) + : super(_value, _then); /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @@ -155,13 +165,15 @@ class __$$RecipeTagModelImplCopyWithImpl<$Res> extends _$RecipeTagModelCopyWithI @JsonSerializable() class _$RecipeTagModelImpl implements _RecipeTagModel { const _$RecipeTagModelImpl( - {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$RecipeTagModelImpl.fromJson(Map json) => _$$RecipeTagModelImplFromJson(json); + factory _$RecipeTagModelImpl.fromJson(Map json) => + _$$RecipeTagModelImplFromJson(json); final List _data; - @override @JsonKey(name: "data") List get data { @@ -194,14 +206,17 @@ class _$RecipeTagModelImpl implements _RecipeTagModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => __$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>(this, _$identity); + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => + __$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>( + this, _$identity); @override Map toJson() { @@ -217,16 +232,15 @@ abstract class _RecipeTagModel implements RecipeTagModel { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$RecipeTagModelImpl; - factory _RecipeTagModel.fromJson(Map json) = _$RecipeTagModelImpl.fromJson; + factory _RecipeTagModel.fromJson(Map json) = + _$RecipeTagModelImpl.fromJson; @override @JsonKey(name: "data") List get data; - @override @JsonKey(name: "links") Links get links; - @override @JsonKey(name: "meta") Meta get meta; @@ -235,7 +249,8 @@ abstract class _RecipeTagModel implements RecipeTagModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => + throw _privateConstructorUsedError; } RecipeTag _$RecipeTagFromJson(Map json) { @@ -246,16 +261,12 @@ RecipeTag _$RecipeTagFromJson(Map json) { mixin _$RecipeTag { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "recipes_count") int get recipesCount => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; @@ -265,13 +276,14 @@ mixin _$RecipeTag { /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeTagCopyWith get copyWith => throw _privateConstructorUsedError; + $RecipeTagCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeTagCopyWith<$Res> { - factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) = _$RecipeTagCopyWithImpl<$Res, RecipeTag>; - + factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) = + _$RecipeTagCopyWithImpl<$Res, RecipeTag>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -282,12 +294,12 @@ abstract class $RecipeTagCopyWith<$Res> { } /// @nodoc -class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> implements $RecipeTagCopyWith<$Res> { +class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> + implements $RecipeTagCopyWith<$Res> { _$RecipeTagCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -328,9 +340,11 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> implements $RecipeTa } /// @nodoc -abstract class _$$RecipeTagImplCopyWith<$Res> implements $RecipeTagCopyWith<$Res> { - factory _$$RecipeTagImplCopyWith(_$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) = __$$RecipeTagImplCopyWithImpl<$Res>; - +abstract class _$$RecipeTagImplCopyWith<$Res> + implements $RecipeTagCopyWith<$Res> { + factory _$$RecipeTagImplCopyWith( + _$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) = + __$$RecipeTagImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -342,8 +356,12 @@ abstract class _$$RecipeTagImplCopyWith<$Res> implements $RecipeTagCopyWith<$Res } /// @nodoc -class __$$RecipeTagImplCopyWithImpl<$Res> extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl> implements _$$RecipeTagImplCopyWith<$Res> { - __$$RecipeTagImplCopyWithImpl(_$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) : super(_value, _then); +class __$$RecipeTagImplCopyWithImpl<$Res> + extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl> + implements _$$RecipeTagImplCopyWith<$Res> { + __$$RecipeTagImplCopyWithImpl( + _$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) + : super(_value, _then); /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @@ -391,7 +409,8 @@ class _$RecipeTagImpl implements _RecipeTag { @JsonKey(name: "created_at") required this.createdAt, @JsonKey(name: "updated_at") required this.updatedAt}); - factory _$RecipeTagImpl.fromJson(Map json) => _$$RecipeTagImplFromJson(json); + factory _$RecipeTagImpl.fromJson(Map json) => + _$$RecipeTagImplFromJson(json); @override @JsonKey(name: "id") @@ -421,21 +440,26 @@ class _$RecipeTagImpl implements _RecipeTag { other is _$RecipeTagImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.recipesCount, recipesCount) || other.recipesCount == recipesCount) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + (identical(other.recipesCount, recipesCount) || + other.recipesCount == recipesCount) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); + int get hashCode => + Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => __$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity); + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => + __$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity); @override Map toJson() { @@ -447,30 +471,28 @@ class _$RecipeTagImpl implements _RecipeTag { abstract class _RecipeTag implements RecipeTag { const factory _RecipeTag( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "recipes_count") required final int recipesCount, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$RecipeTagImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "recipes_count") required final int recipesCount, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = + _$RecipeTagImpl; - factory _RecipeTag.fromJson(Map json) = _$RecipeTagImpl.fromJson; + factory _RecipeTag.fromJson(Map json) = + _$RecipeTagImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "recipes_count") int get recipesCount; - @override @JsonKey(name: "created_at") DateTime get createdAt; - @override @JsonKey(name: "updated_at") DateTime get updatedAt; @@ -479,5 +501,6 @@ abstract class _RecipeTag implements RecipeTag { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/recipe_tag_model.g.dart b/lib/features/recipes/models/recipe_tag_model.g.dart index 9a6ea20f..cd387547 100644 --- a/lib/features/recipes/models/recipe_tag_model.g.dart +++ b/lib/features/recipes/models/recipe_tag_model.g.dart @@ -6,19 +6,25 @@ part of 'recipe_tag_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map json) => _$RecipeTagModelImpl( - data: (json['data'] as List).map((e) => RecipeTag.fromJson(e as Map)).toList(), +_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map json) => + _$RecipeTagModelImpl( + data: (json['data'] as List) + .map((e) => RecipeTag.fromJson(e as Map)) + .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$RecipeTagModelImplToJson(_$RecipeTagModelImpl instance) => { +Map _$$RecipeTagModelImplToJson( + _$RecipeTagModelImpl instance) => + { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => _$RecipeTagImpl( +_$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => + _$RecipeTagImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, recipesCount: (json['recipes_count'] as num).toInt(), @@ -26,7 +32,8 @@ _$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => _$RecipeT updatedAt: DateTime.parse(json['updated_at'] as String), ); -Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => { +Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => + { 'id': instance.id, 'name': instance.name, 'recipes_count': instance.recipesCount, diff --git a/lib/features/recipes/models/step.freezed.dart b/lib/features/recipes/models/step.freezed.dart index a0877daa..040dd5aa 100644 --- a/lib/features/recipes/models/step.freezed.dart +++ b/lib/features/recipes/models/step.freezed.dart @@ -21,7 +21,6 @@ Step _$StepFromJson(Map json) { /// @nodoc mixin _$Step { String? get image => throw _privateConstructorUsedError; - String? get description => throw _privateConstructorUsedError; /// Serializes this Step to a JSON map. @@ -35,19 +34,19 @@ mixin _$Step { /// @nodoc abstract class $StepCopyWith<$Res> { - factory $StepCopyWith(Step value, $Res Function(Step) then) = _$StepCopyWithImpl<$Res, Step>; - + factory $StepCopyWith(Step value, $Res Function(Step) then) = + _$StepCopyWithImpl<$Res, Step>; @useResult $Res call({String? image, String? description}); } /// @nodoc -class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res> { +class _$StepCopyWithImpl<$Res, $Val extends Step> + implements $StepCopyWith<$Res> { _$StepCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -74,16 +73,20 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res> /// @nodoc abstract class _$$StepImplCopyWith<$Res> implements $StepCopyWith<$Res> { - factory _$$StepImplCopyWith(_$StepImpl value, $Res Function(_$StepImpl) then) = __$$StepImplCopyWithImpl<$Res>; - + factory _$$StepImplCopyWith( + _$StepImpl value, $Res Function(_$StepImpl) then) = + __$$StepImplCopyWithImpl<$Res>; @override @useResult $Res call({String? image, String? description}); } /// @nodoc -class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl> implements _$$StepImplCopyWith<$Res> { - __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) : super(_value, _then); +class __$$StepImplCopyWithImpl<$Res> + extends _$StepCopyWithImpl<$Res, _$StepImpl> + implements _$$StepImplCopyWith<$Res> { + __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) + : super(_value, _then); /// Create a copy of Step /// with the given fields replaced by the non-null parameter values. @@ -111,7 +114,8 @@ class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl class _$StepImpl implements _Step { const _$StepImpl({this.image, this.description}); - factory _$StepImpl.fromJson(Map json) => _$$StepImplFromJson(json); + factory _$StepImpl.fromJson(Map json) => + _$$StepImplFromJson(json); @override final String? image; @@ -129,7 +133,8 @@ class _$StepImpl implements _Step { (other.runtimeType == runtimeType && other is _$StepImpl && (identical(other.image, image) || other.image == image) && - (identical(other.description, description) || other.description == description)); + (identical(other.description, description) || + other.description == description)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -141,7 +146,8 @@ class _$StepImpl implements _Step { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$StepImplCopyWith<_$StepImpl> get copyWith => __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); + _$$StepImplCopyWith<_$StepImpl> get copyWith => + __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); @override Map toJson() { @@ -152,13 +158,13 @@ class _$StepImpl implements _Step { } abstract class _Step implements Step { - const factory _Step({final String? image, final String? description}) = _$StepImpl; + const factory _Step({final String? image, final String? description}) = + _$StepImpl; factory _Step.fromJson(Map json) = _$StepImpl.fromJson; @override String? get image; - @override String? get description; @@ -166,5 +172,6 @@ abstract class _Step implements Step { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$StepImplCopyWith<_$StepImpl> get copyWith => throw _privateConstructorUsedError; + _$$StepImplCopyWith<_$StepImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/step.g.dart b/lib/features/recipes/models/step.g.dart index 1ead263e..31d97f9f 100644 --- a/lib/features/recipes/models/step.g.dart +++ b/lib/features/recipes/models/step.g.dart @@ -11,7 +11,8 @@ _$StepImpl _$$StepImplFromJson(Map json) => _$StepImpl( description: json['description'] as String?, ); -Map _$$StepImplToJson(_$StepImpl instance) => { +Map _$$StepImplToJson(_$StepImpl instance) => + { 'image': instance.image, 'description': instance.description, }; diff --git a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart index a0f3d59f..e15a1a52 100644 --- a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart +++ b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart @@ -45,7 +45,6 @@ mixin _$RecipeCreateState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -134,16 +133,18 @@ mixin _$RecipeCreateState { /// @nodoc abstract class $RecipeCreateStateCopyWith<$Res> { - factory $RecipeCreateStateCopyWith(RecipeCreateState value, $Res Function(RecipeCreateState) then) = _$RecipeCreateStateCopyWithImpl<$Res, RecipeCreateState>; + factory $RecipeCreateStateCopyWith( + RecipeCreateState value, $Res Function(RecipeCreateState) then) = + _$RecipeCreateStateCopyWithImpl<$Res, RecipeCreateState>; } /// @nodoc -class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> implements $RecipeCreateStateCopyWith<$Res> { +class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> + implements $RecipeCreateStateCopyWith<$Res> { _$RecipeCreateStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -153,14 +154,18 @@ class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> impl /// @nodoc abstract class _$$RecipeCreateStateImplCopyWith<$Res> { - factory _$$RecipeCreateStateImplCopyWith(_$RecipeCreateStateImpl value, $Res Function(_$RecipeCreateStateImpl) then) = + factory _$$RecipeCreateStateImplCopyWith(_$RecipeCreateStateImpl value, + $Res Function(_$RecipeCreateStateImpl) then) = __$$RecipeCreateStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipeCreateStateImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateImpl> +class __$$RecipeCreateStateImplCopyWithImpl<$Res> + extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateImpl> implements _$$RecipeCreateStateImplCopyWith<$Res> { - __$$RecipeCreateStateImplCopyWithImpl(_$RecipeCreateStateImpl _value, $Res Function(_$RecipeCreateStateImpl) _then) : super(_value, _then); + __$$RecipeCreateStateImplCopyWithImpl(_$RecipeCreateStateImpl _value, + $Res Function(_$RecipeCreateStateImpl) _then) + : super(_value, _then); /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @@ -178,7 +183,8 @@ class _$RecipeCreateStateImpl implements _RecipeCreateState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeCreateStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$RecipeCreateStateImpl); } @override @@ -328,14 +334,20 @@ abstract class _RecipeCreateState implements RecipeCreateState { /// @nodoc abstract class _$$RecipeCreateStateLoadingImplCopyWith<$Res> { - factory _$$RecipeCreateStateLoadingImplCopyWith(_$RecipeCreateStateLoadingImpl value, $Res Function(_$RecipeCreateStateLoadingImpl) then) = + factory _$$RecipeCreateStateLoadingImplCopyWith( + _$RecipeCreateStateLoadingImpl value, + $Res Function(_$RecipeCreateStateLoadingImpl) then) = __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadingImpl> +class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res> + extends _$RecipeCreateStateCopyWithImpl<$Res, + _$RecipeCreateStateLoadingImpl> implements _$$RecipeCreateStateLoadingImplCopyWith<$Res> { - __$$RecipeCreateStateLoadingImplCopyWithImpl(_$RecipeCreateStateLoadingImpl _value, $Res Function(_$RecipeCreateStateLoadingImpl) _then) + __$$RecipeCreateStateLoadingImplCopyWithImpl( + _$RecipeCreateStateLoadingImpl _value, + $Res Function(_$RecipeCreateStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of RecipeCreateState @@ -354,7 +366,9 @@ class _$RecipeCreateStateLoadingImpl implements RecipeCreateStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeCreateStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$RecipeCreateStateLoadingImpl); } @override @@ -504,9 +518,10 @@ abstract class RecipeCreateStateLoading implements RecipeCreateState { /// @nodoc abstract class _$$RecipeCreateStateLoadedImplCopyWith<$Res> { - factory _$$RecipeCreateStateLoadedImplCopyWith(_$RecipeCreateStateLoadedImpl value, $Res Function(_$RecipeCreateStateLoadedImpl) then) = + factory _$$RecipeCreateStateLoadedImplCopyWith( + _$RecipeCreateStateLoadedImpl value, + $Res Function(_$RecipeCreateStateLoadedImpl) then) = __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call( {RecipeModel? recipe, @@ -531,18 +546,19 @@ abstract class _$$RecipeCreateStateLoadedImplCopyWith<$Res> { SelectionPopupModel selectedStatus}); $RecipeModelCopyWith<$Res>? get recipe; - $SelectionPopupModelCopyWith<$Res> get selectedType; - $SelectionPopupModelCopyWith<$Res> get selectedCookingTime; - $SelectionPopupModelCopyWith<$Res> get selectedStatus; } /// @nodoc -class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadedImpl> +class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> + extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadedImpl> implements _$$RecipeCreateStateLoadedImplCopyWith<$Res> { - __$$RecipeCreateStateLoadedImplCopyWithImpl(_$RecipeCreateStateLoadedImpl _value, $Res Function(_$RecipeCreateStateLoadedImpl) _then) : super(_value, _then); + __$$RecipeCreateStateLoadedImplCopyWithImpl( + _$RecipeCreateStateLoadedImpl _value, + $Res Function(_$RecipeCreateStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @@ -683,7 +699,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> extends _$RecipeCreateSt @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get selectedCookingTime { - return $SelectionPopupModelCopyWith<$Res>(_value.selectedCookingTime, (value) { + return $SelectionPopupModelCopyWith<$Res>(_value.selectedCookingTime, + (value) { return _then(_value.copyWith(selectedCookingTime: value)); }); } @@ -746,7 +763,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final TextEditingController youtubeLinkController; final List _stepControllers; - @override List get stepControllers { if (_stepControllers is EqualUnmodifiableListView) return _stepControllers; @@ -757,7 +773,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final XFile? recipeImage; final List _stepImages; - @override List get stepImages { if (_stepImages is EqualUnmodifiableListView) return _stepImages; @@ -766,7 +781,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _ingredients; - @override List get ingredients { if (_ingredients is EqualUnmodifiableListView) return _ingredients; @@ -775,10 +789,10 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _autocompleteList; - @override List get autocompleteList { - if (_autocompleteList is EqualUnmodifiableListView) return _autocompleteList; + if (_autocompleteList is EqualUnmodifiableListView) + return _autocompleteList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_autocompleteList); } @@ -788,7 +802,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final bool ingredientAsItems; final List _types; - @override List get types { if (_types is EqualUnmodifiableListView) return _types; @@ -797,7 +810,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _cookingTimes; - @override List get cookingTimes { if (_cookingTimes is EqualUnmodifiableListView) return _cookingTimes; @@ -806,7 +818,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _statuses; - @override List get statuses { if (_statuses is EqualUnmodifiableListView) return _statuses; @@ -833,24 +844,41 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { other is _$RecipeCreateStateLoadedImpl && (identical(other.recipe, recipe) || other.recipe == recipe) && (identical(other.picker, picker) || other.picker == picker) && - (identical(other.titleController, titleController) || other.titleController == titleController) && - (identical(other.productNameController, productNameController) || other.productNameController == productNameController) && - (identical(other.ingredientController, ingredientController) || other.ingredientController == ingredientController) && - (identical(other.stepDescriptionController, stepDescriptionController) || other.stepDescriptionController == stepDescriptionController) && - (identical(other.youtubeLinkController, youtubeLinkController) || other.youtubeLinkController == youtubeLinkController) && - const DeepCollectionEquality().equals(other._stepControllers, _stepControllers) && - (identical(other.recipeImage, recipeImage) || other.recipeImage == recipeImage) && - const DeepCollectionEquality().equals(other._stepImages, _stepImages) && - const DeepCollectionEquality().equals(other._ingredients, _ingredients) && - const DeepCollectionEquality().equals(other._autocompleteList, _autocompleteList) && - (identical(other.numberOfSteps, numberOfSteps) || other.numberOfSteps == numberOfSteps) && - (identical(other.ingredientAsItems, ingredientAsItems) || other.ingredientAsItems == ingredientAsItems) && + (identical(other.titleController, titleController) || + other.titleController == titleController) && + (identical(other.productNameController, productNameController) || + other.productNameController == productNameController) && + (identical(other.ingredientController, ingredientController) || + other.ingredientController == ingredientController) && + (identical(other.stepDescriptionController, + stepDescriptionController) || + other.stepDescriptionController == stepDescriptionController) && + (identical(other.youtubeLinkController, youtubeLinkController) || + other.youtubeLinkController == youtubeLinkController) && + const DeepCollectionEquality() + .equals(other._stepControllers, _stepControllers) && + (identical(other.recipeImage, recipeImage) || + other.recipeImage == recipeImage) && + const DeepCollectionEquality() + .equals(other._stepImages, _stepImages) && + const DeepCollectionEquality() + .equals(other._ingredients, _ingredients) && + const DeepCollectionEquality() + .equals(other._autocompleteList, _autocompleteList) && + (identical(other.numberOfSteps, numberOfSteps) || + other.numberOfSteps == numberOfSteps) && + (identical(other.ingredientAsItems, ingredientAsItems) || + other.ingredientAsItems == ingredientAsItems) && const DeepCollectionEquality().equals(other._types, _types) && - const DeepCollectionEquality().equals(other._cookingTimes, _cookingTimes) && + const DeepCollectionEquality() + .equals(other._cookingTimes, _cookingTimes) && const DeepCollectionEquality().equals(other._statuses, _statuses) && - (identical(other.selectedType, selectedType) || other.selectedType == selectedType) && - (identical(other.selectedCookingTime, selectedCookingTime) || other.selectedCookingTime == selectedCookingTime) && - (identical(other.selectedStatus, selectedStatus) || other.selectedStatus == selectedStatus)); + (identical(other.selectedType, selectedType) || + other.selectedType == selectedType) && + (identical(other.selectedCookingTime, selectedCookingTime) || + other.selectedCookingTime == selectedCookingTime) && + (identical(other.selectedStatus, selectedStatus) || + other.selectedStatus == selectedStatus)); } @override @@ -883,8 +911,9 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> get copyWith => - __$$RecipeCreateStateLoadedImplCopyWithImpl<_$RecipeCreateStateLoadedImpl>(this, _$identity); + _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> + get copyWith => __$$RecipeCreateStateLoadedImplCopyWithImpl< + _$RecipeCreateStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -1086,86 +1115,74 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { abstract class RecipeCreateStateLoaded implements RecipeCreateState { const factory RecipeCreateStateLoaded( - {final RecipeModel? recipe, - required final ImagePicker picker, - required final TextEditingController titleController, - required final TextEditingController productNameController, - required final TextEditingController ingredientController, - required final TextEditingController stepDescriptionController, - required final TextEditingController youtubeLinkController, - required final List stepControllers, - final XFile? recipeImage, - required final List stepImages, - required final List ingredients, - required final List autocompleteList, - required final int numberOfSteps, - required final bool ingredientAsItems, - required final List types, - required final List cookingTimes, - required final List statuses, - required final SelectionPopupModel selectedType, - required final SelectionPopupModel selectedCookingTime, - required final SelectionPopupModel selectedStatus}) = _$RecipeCreateStateLoadedImpl; + {final RecipeModel? recipe, + required final ImagePicker picker, + required final TextEditingController titleController, + required final TextEditingController productNameController, + required final TextEditingController ingredientController, + required final TextEditingController stepDescriptionController, + required final TextEditingController youtubeLinkController, + required final List stepControllers, + final XFile? recipeImage, + required final List stepImages, + required final List ingredients, + required final List autocompleteList, + required final int numberOfSteps, + required final bool ingredientAsItems, + required final List types, + required final List cookingTimes, + required final List statuses, + required final SelectionPopupModel selectedType, + required final SelectionPopupModel selectedCookingTime, + required final SelectionPopupModel selectedStatus}) = + _$RecipeCreateStateLoadedImpl; RecipeModel? get recipe; - ImagePicker get picker; - TextEditingController get titleController; - TextEditingController get productNameController; - TextEditingController get ingredientController; - TextEditingController get stepDescriptionController; - TextEditingController get youtubeLinkController; - List get stepControllers; - XFile? get recipeImage; - List get stepImages; - List get ingredients; - List get autocompleteList; - int get numberOfSteps; - bool get ingredientAsItems; - List get types; - List get cookingTimes; - List get statuses; - SelectionPopupModel get selectedType; - SelectionPopupModel get selectedCookingTime; - SelectionPopupModel get selectedStatus; /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$RecipeCreateStateErrorImplCopyWith<$Res> { - factory _$$RecipeCreateStateErrorImplCopyWith(_$RecipeCreateStateErrorImpl value, $Res Function(_$RecipeCreateStateErrorImpl) then) = + factory _$$RecipeCreateStateErrorImplCopyWith( + _$RecipeCreateStateErrorImpl value, + $Res Function(_$RecipeCreateStateErrorImpl) then) = __$$RecipeCreateStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$RecipeCreateStateErrorImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateErrorImpl> +class __$$RecipeCreateStateErrorImplCopyWithImpl<$Res> + extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateErrorImpl> implements _$$RecipeCreateStateErrorImplCopyWith<$Res> { - __$$RecipeCreateStateErrorImplCopyWithImpl(_$RecipeCreateStateErrorImpl _value, $Res Function(_$RecipeCreateStateErrorImpl) _then) : super(_value, _then); + __$$RecipeCreateStateErrorImplCopyWithImpl( + _$RecipeCreateStateErrorImpl _value, + $Res Function(_$RecipeCreateStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @@ -1201,7 +1218,8 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeCreateStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -1212,8 +1230,9 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> get copyWith => - __$$RecipeCreateStateErrorImplCopyWithImpl<_$RecipeCreateStateErrorImpl>(this, _$identity); + _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> + get copyWith => __$$RecipeCreateStateErrorImplCopyWithImpl< + _$RecipeCreateStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -1354,12 +1373,14 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { } abstract class RecipeCreateStateError implements RecipeCreateState { - const factory RecipeCreateStateError({required final String errorMessage}) = _$RecipeCreateStateErrorImpl; + const factory RecipeCreateStateError({required final String errorMessage}) = + _$RecipeCreateStateErrorImpl; String get errorMessage; /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/services/recipe_service.g.dart b/lib/features/recipes/services/recipe_service.g.dart index 65636a26..c32c9e8a 100644 --- a/lib/features/recipes/services/recipe_service.g.dart +++ b/lib/features/recipes/services/recipe_service.g.dart @@ -79,7 +79,11 @@ class _RecipeService implements RecipeService { final _result = await _dio.fetch>(_options); late Map> _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry(k, (v as List).map((i) => Product.fromJson(i as Map)).toList())); + _value = _result.data!.map((k, dynamic v) => MapEntry( + k, + (v as List) + .map((i) => Product.fromJson(i as Map)) + .toList())); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -250,7 +254,9 @@ class _RecipeService implements RecipeService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/registration/models/location_model.freezed.dart b/lib/features/registration/models/location_model.freezed.dart index 052bc27b..95f81d60 100644 --- a/lib/features/registration/models/location_model.freezed.dart +++ b/lib/features/registration/models/location_model.freezed.dart @@ -21,7 +21,6 @@ LocationModel _$LocationModelFromJson(Map json) { /// @nodoc mixin _$LocationModel { List get locations => throw _privateConstructorUsedError; - @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; @@ -31,24 +30,28 @@ mixin _$LocationModel { /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $LocationModelCopyWith get copyWith => throw _privateConstructorUsedError; + $LocationModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $LocationModelCopyWith<$Res> { - factory $LocationModelCopyWith(LocationModel value, $Res Function(LocationModel) then) = _$LocationModelCopyWithImpl<$Res, LocationModel>; - + factory $LocationModelCopyWith( + LocationModel value, $Res Function(LocationModel) then) = + _$LocationModelCopyWithImpl<$Res, LocationModel>; @useResult - $Res call({List locations, @JsonKey(name: 'response_body') String responseBody}); + $Res call( + {List locations, + @JsonKey(name: 'response_body') String responseBody}); } /// @nodoc -class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> implements $LocationModelCopyWith<$Res> { +class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> + implements $LocationModelCopyWith<$Res> { _$LocationModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -74,17 +77,25 @@ class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> implements $ } /// @nodoc -abstract class _$$LocationModelImplCopyWith<$Res> implements $LocationModelCopyWith<$Res> { - factory _$$LocationModelImplCopyWith(_$LocationModelImpl value, $Res Function(_$LocationModelImpl) then) = __$$LocationModelImplCopyWithImpl<$Res>; - +abstract class _$$LocationModelImplCopyWith<$Res> + implements $LocationModelCopyWith<$Res> { + factory _$$LocationModelImplCopyWith( + _$LocationModelImpl value, $Res Function(_$LocationModelImpl) then) = + __$$LocationModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({List locations, @JsonKey(name: 'response_body') String responseBody}); + $Res call( + {List locations, + @JsonKey(name: 'response_body') String responseBody}); } /// @nodoc -class __$$LocationModelImplCopyWithImpl<$Res> extends _$LocationModelCopyWithImpl<$Res, _$LocationModelImpl> implements _$$LocationModelImplCopyWith<$Res> { - __$$LocationModelImplCopyWithImpl(_$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) : super(_value, _then); +class __$$LocationModelImplCopyWithImpl<$Res> + extends _$LocationModelCopyWithImpl<$Res, _$LocationModelImpl> + implements _$$LocationModelImplCopyWith<$Res> { + __$$LocationModelImplCopyWithImpl( + _$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) + : super(_value, _then); /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @@ -110,12 +121,15 @@ class __$$LocationModelImplCopyWithImpl<$Res> extends _$LocationModelCopyWithImp /// @nodoc @JsonSerializable() class _$LocationModelImpl implements _LocationModel { - const _$LocationModelImpl({required final List locations, @JsonKey(name: 'response_body') required this.responseBody}) : _locations = locations; + const _$LocationModelImpl( + {required final List locations, + @JsonKey(name: 'response_body') required this.responseBody}) + : _locations = locations; - factory _$LocationModelImpl.fromJson(Map json) => _$$LocationModelImplFromJson(json); + factory _$LocationModelImpl.fromJson(Map json) => + _$$LocationModelImplFromJson(json); final List _locations; - @override List get locations { if (_locations is EqualUnmodifiableListView) return _locations; @@ -137,20 +151,24 @@ class _$LocationModelImpl implements _LocationModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$LocationModelImpl && - const DeepCollectionEquality().equals(other._locations, _locations) && - (identical(other.responseBody, responseBody) || other.responseBody == responseBody)); + const DeepCollectionEquality() + .equals(other._locations, _locations) && + (identical(other.responseBody, responseBody) || + other.responseBody == responseBody)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_locations), responseBody); + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_locations), responseBody); /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); + _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => + __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); @override Map toJson() { @@ -161,14 +179,16 @@ class _$LocationModelImpl implements _LocationModel { } abstract class _LocationModel implements LocationModel { - const factory _LocationModel({required final List locations, @JsonKey(name: 'response_body') required final String responseBody}) = + const factory _LocationModel( + {required final List locations, + @JsonKey(name: 'response_body') required final String responseBody}) = _$LocationModelImpl; - factory _LocationModel.fromJson(Map json) = _$LocationModelImpl.fromJson; + factory _LocationModel.fromJson(Map json) = + _$LocationModelImpl.fromJson; @override List get locations; - @override @JsonKey(name: 'response_body') String get responseBody; @@ -177,5 +197,6 @@ abstract class _LocationModel implements LocationModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/registration/models/location_model.g.dart b/lib/features/registration/models/location_model.g.dart index da69ba9b..449630a4 100644 --- a/lib/features/registration/models/location_model.g.dart +++ b/lib/features/registration/models/location_model.g.dart @@ -6,12 +6,15 @@ part of 'location_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$LocationModelImpl _$$LocationModelImplFromJson(Map json) => _$LocationModelImpl( - locations: (json['locations'] as List).map((e) => e as String).toList(), +_$LocationModelImpl _$$LocationModelImplFromJson(Map json) => + _$LocationModelImpl( + locations: + (json['locations'] as List).map((e) => e as String).toList(), responseBody: json['response_body'] as String, ); -Map _$$LocationModelImplToJson(_$LocationModelImpl instance) => { +Map _$$LocationModelImplToJson(_$LocationModelImpl instance) => + { 'locations': instance.locations, 'response_body': instance.responseBody, }; diff --git a/lib/features/registration/models/user_registration_model.freezed.dart b/lib/features/registration/models/user_registration_model.freezed.dart index ed0044cc..fd835a26 100644 --- a/lib/features/registration/models/user_registration_model.freezed.dart +++ b/lib/features/registration/models/user_registration_model.freezed.dart @@ -3,7 +3,7 @@ // 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 '../../../features/registration/models/user_registration_model.dart'; +part of 'user_registration_model.dart'; // ************************************************************************** // FreezedGenerator @@ -14,7 +14,8 @@ T _$identity(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'); -UserRegistrationSheet _$UserRegistrationSheetFromJson(Map json) { +UserRegistrationSheet _$UserRegistrationSheetFromJson( + Map json) { return _UserRegistrationSheet.fromJson(json); } @@ -22,74 +23,48 @@ UserRegistrationSheet _$UserRegistrationSheetFromJson(Map json) mixin _$UserRegistrationSheet { @JsonKey(name: 'first_name') String get firstName => throw _privateConstructorUsedError; - @JsonKey(name: 'last_name') String get lastName => throw _privateConstructorUsedError; - String get email => throw _privateConstructorUsedError; - String get password => throw _privateConstructorUsedError; - @JsonKey(name: 'password_confirmation') String get passwordConfirmation => throw _privateConstructorUsedError; - @JsonKey(name: 'terms') String get termsAccepted => throw _privateConstructorUsedError; - String get birthdate => throw _privateConstructorUsedError; - String get gender => throw _privateConstructorUsedError; - String get location => throw _privateConstructorUsedError; - @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; - String get lang => throw _privateConstructorUsedError; - int get weight => throw _privateConstructorUsedError; - int get height => throw _privateConstructorUsedError; - @JsonKey(name: 'chest_circumference') int get chestCircumference => throw _privateConstructorUsedError; - @JsonKey(name: 'waist_circumference') int get waistCircumference => throw _privateConstructorUsedError; - @JsonKey(name: 'hip_circumference') int get hipCircumference => throw _privateConstructorUsedError; - @JsonKey(name: 'blood_pressure_up') int get bloodPressureUp => throw _privateConstructorUsedError; - @JsonKey(name: 'blood_pressure_down') int get bloodPressureDown => throw _privateConstructorUsedError; - @JsonKey(name: 'has_hypo') int get hasHypo => throw _privateConstructorUsedError; - @JsonKey(name: 'has_hyper') int get hasHyper => throw _privateConstructorUsedError; - @JsonKey(name: 'about_alergy') String get aboutAllergy => throw _privateConstructorUsedError; - @JsonKey(name: 'about_taking_pils') String get aboutTakingPils => throw _privateConstructorUsedError; - @JsonKey(name: 'about_sport_hobbies') String get aboutSportHobbies => throw _privateConstructorUsedError; - @JsonKey(name: 'favorite_foods') String get favoriteFoods => throw _privateConstructorUsedError; - @JsonKey(name: 'unfavorite_foods') String get unfavoriteFoods => throw _privateConstructorUsedError; - @JsonKey(name: 'additional_info') String get additionalInfo => throw _privateConstructorUsedError; - @JsonKey(name: 'activity_coefficient') double get activityCoefficient => throw _privateConstructorUsedError; @@ -99,14 +74,15 @@ mixin _$UserRegistrationSheet { /// Create a copy of UserRegistrationSheet /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $UserRegistrationSheetCopyWith get copyWith => throw _privateConstructorUsedError; + $UserRegistrationSheetCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $UserRegistrationSheetCopyWith<$Res> { - factory $UserRegistrationSheetCopyWith(UserRegistrationSheet value, $Res Function(UserRegistrationSheet) then) = + factory $UserRegistrationSheetCopyWith(UserRegistrationSheet value, + $Res Function(UserRegistrationSheet) then) = _$UserRegistrationSheetCopyWithImpl<$Res, UserRegistrationSheet>; - @useResult $Res call( {@JsonKey(name: 'first_name') String firstName, @@ -139,12 +115,13 @@ abstract class $UserRegistrationSheetCopyWith<$Res> { } /// @nodoc -class _$UserRegistrationSheetCopyWithImpl<$Res, $Val extends UserRegistrationSheet> implements $UserRegistrationSheetCopyWith<$Res> { +class _$UserRegistrationSheetCopyWithImpl<$Res, + $Val extends UserRegistrationSheet> + implements $UserRegistrationSheetCopyWith<$Res> { _$UserRegistrationSheetCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -295,10 +272,12 @@ class _$UserRegistrationSheetCopyWithImpl<$Res, $Val extends UserRegistrationShe } /// @nodoc -abstract class _$$UserRegistrationSheetImplCopyWith<$Res> implements $UserRegistrationSheetCopyWith<$Res> { - factory _$$UserRegistrationSheetImplCopyWith(_$UserRegistrationSheetImpl value, $Res Function(_$UserRegistrationSheetImpl) then) = +abstract class _$$UserRegistrationSheetImplCopyWith<$Res> + implements $UserRegistrationSheetCopyWith<$Res> { + factory _$$UserRegistrationSheetImplCopyWith( + _$UserRegistrationSheetImpl value, + $Res Function(_$UserRegistrationSheetImpl) then) = __$$UserRegistrationSheetImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -332,9 +311,13 @@ abstract class _$$UserRegistrationSheetImplCopyWith<$Res> implements $UserRegist } /// @nodoc -class __$$UserRegistrationSheetImplCopyWithImpl<$Res> extends _$UserRegistrationSheetCopyWithImpl<$Res, _$UserRegistrationSheetImpl> +class __$$UserRegistrationSheetImplCopyWithImpl<$Res> + extends _$UserRegistrationSheetCopyWithImpl<$Res, + _$UserRegistrationSheetImpl> implements _$$UserRegistrationSheetImplCopyWith<$Res> { - __$$UserRegistrationSheetImplCopyWithImpl(_$UserRegistrationSheetImpl _value, $Res Function(_$UserRegistrationSheetImpl) _then) : super(_value, _then); + __$$UserRegistrationSheetImplCopyWithImpl(_$UserRegistrationSheetImpl _value, + $Res Function(_$UserRegistrationSheetImpl) _then) + : super(_value, _then); /// Create a copy of UserRegistrationSheet /// with the given fields replaced by the non-null parameter values. @@ -490,7 +473,8 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(name: 'last_name') required this.lastName, required this.email, required this.password, - @JsonKey(name: 'password_confirmation') required this.passwordConfirmation, + @JsonKey(name: 'password_confirmation') + required this.passwordConfirmation, @JsonKey(name: 'terms') this.termsAccepted = 'accepted', required this.birthdate, required this.gender, @@ -514,7 +498,8 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(name: 'additional_info') required this.additionalInfo, @JsonKey(name: 'activity_coefficient') this.activityCoefficient = 1.2}); - factory _$UserRegistrationSheetImpl.fromJson(Map json) => _$$UserRegistrationSheetImplFromJson(json); + factory _$UserRegistrationSheetImpl.fromJson(Map json) => + _$$UserRegistrationSheetImplFromJson(json); @override @JsonKey(name: 'first_name') @@ -600,33 +585,54 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { return identical(this, other) || (other.runtimeType == runtimeType && other is _$UserRegistrationSheetImpl && - (identical(other.firstName, firstName) || other.firstName == firstName) && - (identical(other.lastName, lastName) || other.lastName == lastName) && + (identical(other.firstName, firstName) || + other.firstName == firstName) && + (identical(other.lastName, lastName) || + other.lastName == lastName) && (identical(other.email, email) || other.email == email) && - (identical(other.password, password) || other.password == password) && - (identical(other.passwordConfirmation, passwordConfirmation) || other.passwordConfirmation == passwordConfirmation) && - (identical(other.termsAccepted, termsAccepted) || other.termsAccepted == termsAccepted) && - (identical(other.birthdate, birthdate) || other.birthdate == birthdate) && + (identical(other.password, password) || + other.password == password) && + (identical(other.passwordConfirmation, passwordConfirmation) || + other.passwordConfirmation == passwordConfirmation) && + (identical(other.termsAccepted, termsAccepted) || + other.termsAccepted == termsAccepted) && + (identical(other.birthdate, birthdate) || + other.birthdate == birthdate) && (identical(other.gender, gender) || other.gender == gender) && - (identical(other.location, location) || other.location == location) && - (identical(other.responseBody, responseBody) || other.responseBody == responseBody) && + (identical(other.location, location) || + other.location == location) && + (identical(other.responseBody, responseBody) || + other.responseBody == responseBody) && (identical(other.lang, lang) || other.lang == lang) && (identical(other.weight, weight) || other.weight == weight) && (identical(other.height, height) || other.height == height) && - (identical(other.chestCircumference, chestCircumference) || other.chestCircumference == chestCircumference) && - (identical(other.waistCircumference, waistCircumference) || other.waistCircumference == waistCircumference) && - (identical(other.hipCircumference, hipCircumference) || other.hipCircumference == hipCircumference) && - (identical(other.bloodPressureUp, bloodPressureUp) || other.bloodPressureUp == bloodPressureUp) && - (identical(other.bloodPressureDown, bloodPressureDown) || other.bloodPressureDown == bloodPressureDown) && + (identical(other.chestCircumference, chestCircumference) || + other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || + other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || + other.hipCircumference == hipCircumference) && + (identical(other.bloodPressureUp, bloodPressureUp) || + other.bloodPressureUp == bloodPressureUp) && + (identical(other.bloodPressureDown, bloodPressureDown) || + other.bloodPressureDown == bloodPressureDown) && (identical(other.hasHypo, hasHypo) || other.hasHypo == hasHypo) && - (identical(other.hasHyper, hasHyper) || other.hasHyper == hasHyper) && - (identical(other.aboutAllergy, aboutAllergy) || other.aboutAllergy == aboutAllergy) && - (identical(other.aboutTakingPils, aboutTakingPils) || other.aboutTakingPils == aboutTakingPils) && - (identical(other.aboutSportHobbies, aboutSportHobbies) || other.aboutSportHobbies == aboutSportHobbies) && - (identical(other.favoriteFoods, favoriteFoods) || other.favoriteFoods == favoriteFoods) && - (identical(other.unfavoriteFoods, unfavoriteFoods) || other.unfavoriteFoods == unfavoriteFoods) && - (identical(other.additionalInfo, additionalInfo) || other.additionalInfo == additionalInfo) && - (identical(other.activityCoefficient, activityCoefficient) || other.activityCoefficient == activityCoefficient)); + (identical(other.hasHyper, hasHyper) || + other.hasHyper == hasHyper) && + (identical(other.aboutAllergy, aboutAllergy) || + other.aboutAllergy == aboutAllergy) && + (identical(other.aboutTakingPils, aboutTakingPils) || + other.aboutTakingPils == aboutTakingPils) && + (identical(other.aboutSportHobbies, aboutSportHobbies) || + other.aboutSportHobbies == aboutSportHobbies) && + (identical(other.favoriteFoods, favoriteFoods) || + other.favoriteFoods == favoriteFoods) && + (identical(other.unfavoriteFoods, unfavoriteFoods) || + other.unfavoriteFoods == unfavoriteFoods) && + (identical(other.additionalInfo, additionalInfo) || + other.additionalInfo == additionalInfo) && + (identical(other.activityCoefficient, activityCoefficient) || + other.activityCoefficient == activityCoefficient)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -667,8 +673,9 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => - __$$UserRegistrationSheetImplCopyWithImpl<_$UserRegistrationSheetImpl>(this, _$identity); + _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> + get copyWith => __$$UserRegistrationSheetImplCopyWithImpl< + _$UserRegistrationSheetImpl>(this, _$identity); @override Map toJson() { @@ -684,7 +691,8 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { @JsonKey(name: 'last_name') required final String lastName, required final String email, required final String password, - @JsonKey(name: 'password_confirmation') required final String passwordConfirmation, + @JsonKey(name: 'password_confirmation') + required final String passwordConfirmation, @JsonKey(name: 'terms') final String termsAccepted, required final String birthdate, required final String gender, @@ -693,119 +701,99 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { required final String lang, required final int weight, required final int height, - @JsonKey(name: 'chest_circumference') required final int chestCircumference, - @JsonKey(name: 'waist_circumference') required final int waistCircumference, + @JsonKey(name: 'chest_circumference') + required final int chestCircumference, + @JsonKey(name: 'waist_circumference') + required final int waistCircumference, @JsonKey(name: 'hip_circumference') required final int hipCircumference, @JsonKey(name: 'blood_pressure_up') required final int bloodPressureUp, - @JsonKey(name: 'blood_pressure_down') required final int bloodPressureDown, + @JsonKey(name: 'blood_pressure_down') + required final int bloodPressureDown, @JsonKey(name: 'has_hypo') required final int hasHypo, @JsonKey(name: 'has_hyper') required final int hasHyper, @JsonKey(name: 'about_alergy') required final String aboutAllergy, @JsonKey(name: 'about_taking_pils') required final String aboutTakingPils, - @JsonKey(name: 'about_sport_hobbies') required final String aboutSportHobbies, + @JsonKey(name: 'about_sport_hobbies') + required final String aboutSportHobbies, @JsonKey(name: 'favorite_foods') required final String favoriteFoods, @JsonKey(name: 'unfavorite_foods') required final String unfavoriteFoods, @JsonKey(name: 'additional_info') required final String additionalInfo, - @JsonKey(name: 'activity_coefficient') final double activityCoefficient}) = _$UserRegistrationSheetImpl; + @JsonKey(name: 'activity_coefficient') + final double activityCoefficient}) = _$UserRegistrationSheetImpl; - factory _UserRegistrationSheet.fromJson(Map json) = _$UserRegistrationSheetImpl.fromJson; + factory _UserRegistrationSheet.fromJson(Map json) = + _$UserRegistrationSheetImpl.fromJson; @override @JsonKey(name: 'first_name') String get firstName; - @override @JsonKey(name: 'last_name') String get lastName; - @override String get email; - @override String get password; - @override @JsonKey(name: 'password_confirmation') String get passwordConfirmation; - @override @JsonKey(name: 'terms') String get termsAccepted; - @override String get birthdate; - @override String get gender; - @override String get location; - @override @JsonKey(name: 'response_body') String get responseBody; - @override String get lang; - @override int get weight; - @override int get height; - @override @JsonKey(name: 'chest_circumference') int get chestCircumference; - @override @JsonKey(name: 'waist_circumference') int get waistCircumference; - @override @JsonKey(name: 'hip_circumference') int get hipCircumference; - @override @JsonKey(name: 'blood_pressure_up') int get bloodPressureUp; - @override @JsonKey(name: 'blood_pressure_down') int get bloodPressureDown; - @override @JsonKey(name: 'has_hypo') int get hasHypo; - @override @JsonKey(name: 'has_hyper') int get hasHyper; - @override @JsonKey(name: 'about_alergy') String get aboutAllergy; - @override @JsonKey(name: 'about_taking_pils') String get aboutTakingPils; - @override @JsonKey(name: 'about_sport_hobbies') String get aboutSportHobbies; - @override @JsonKey(name: 'favorite_foods') String get favoriteFoods; - @override @JsonKey(name: 'unfavorite_foods') String get unfavoriteFoods; - @override @JsonKey(name: 'additional_info') String get additionalInfo; - @override @JsonKey(name: 'activity_coefficient') double get activityCoefficient; @@ -814,5 +802,6 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => throw _privateConstructorUsedError; + _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/models/user_registration_model.g.dart b/lib/features/registration/models/user_registration_model.g.dart index 7690dbb1..9500e915 100644 --- a/lib/features/registration/models/user_registration_model.g.dart +++ b/lib/features/registration/models/user_registration_model.g.dart @@ -6,7 +6,9 @@ part of 'user_registration_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson(Map json) => _$UserRegistrationSheetImpl( +_$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson( + Map json) => + _$UserRegistrationSheetImpl( firstName: json['first_name'] as String, lastName: json['last_name'] as String, email: json['email'] as String, @@ -33,10 +35,13 @@ _$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson(Map _$$UserRegistrationSheetImplToJson(_$UserRegistrationSheetImpl instance) => { +Map _$$UserRegistrationSheetImplToJson( + _$UserRegistrationSheetImpl instance) => + { 'first_name': instance.firstName, 'last_name': instance.lastName, 'email': instance.email, diff --git a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart index eb722a2b..ae0a9706 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart @@ -21,13 +21,15 @@ mixin _$RegistrationState { /// Create a copy of RegistrationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RegistrationStateCopyWith get copyWith => throw _privateConstructorUsedError; + $RegistrationStateCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RegistrationStateCopyWith<$Res> { - factory $RegistrationStateCopyWith(RegistrationState value, $Res Function(RegistrationState) then) = _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; - + factory $RegistrationStateCopyWith( + RegistrationState value, $Res Function(RegistrationState) then) = + _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; @useResult $Res call({UserRegistrationSheet sheet}); @@ -35,12 +37,12 @@ abstract class $RegistrationStateCopyWith<$Res> { } /// @nodoc -class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> implements $RegistrationStateCopyWith<$Res> { +class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> + implements $RegistrationStateCopyWith<$Res> { _$RegistrationStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -71,10 +73,11 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> impl } /// @nodoc -abstract class _$$RegistrationStateImplCopyWith<$Res> implements $RegistrationStateCopyWith<$Res> { - factory _$$RegistrationStateImplCopyWith(_$RegistrationStateImpl value, $Res Function(_$RegistrationStateImpl) then) = +abstract class _$$RegistrationStateImplCopyWith<$Res> + implements $RegistrationStateCopyWith<$Res> { + factory _$$RegistrationStateImplCopyWith(_$RegistrationStateImpl value, + $Res Function(_$RegistrationStateImpl) then) = __$$RegistrationStateImplCopyWithImpl<$Res>; - @override @useResult $Res call({UserRegistrationSheet sheet}); @@ -84,9 +87,12 @@ abstract class _$$RegistrationStateImplCopyWith<$Res> implements $RegistrationSt } /// @nodoc -class __$$RegistrationStateImplCopyWithImpl<$Res> extends _$RegistrationStateCopyWithImpl<$Res, _$RegistrationStateImpl> +class __$$RegistrationStateImplCopyWithImpl<$Res> + extends _$RegistrationStateCopyWithImpl<$Res, _$RegistrationStateImpl> implements _$$RegistrationStateImplCopyWith<$Res> { - __$$RegistrationStateImplCopyWithImpl(_$RegistrationStateImpl _value, $Res Function(_$RegistrationStateImpl) _then) : super(_value, _then); + __$$RegistrationStateImplCopyWithImpl(_$RegistrationStateImpl _value, + $Res Function(_$RegistrationStateImpl) _then) + : super(_value, _then); /// Create a copy of RegistrationState /// with the given fields replaced by the non-null parameter values. @@ -120,7 +126,9 @@ class _$RegistrationStateImpl implements _RegistrationState { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$RegistrationStateImpl && (identical(other.sheet, sheet) || other.sheet == sheet)); + (other.runtimeType == runtimeType && + other is _$RegistrationStateImpl && + (identical(other.sheet, sheet) || other.sheet == sheet)); } @override @@ -131,11 +139,14 @@ class _$RegistrationStateImpl implements _RegistrationState { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => __$$RegistrationStateImplCopyWithImpl<_$RegistrationStateImpl>(this, _$identity); + _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => + __$$RegistrationStateImplCopyWithImpl<_$RegistrationStateImpl>( + this, _$identity); } abstract class _RegistrationState implements RegistrationState { - const factory _RegistrationState({required final UserRegistrationSheet sheet}) = _$RegistrationStateImpl; + const factory _RegistrationState( + {required final UserRegistrationSheet sheet}) = _$RegistrationStateImpl; @override UserRegistrationSheet get sheet; @@ -144,5 +155,6 @@ abstract class _RegistrationState implements RegistrationState { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => throw _privateConstructorUsedError; + _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/registration/services/registration_service.g.dart b/lib/features/registration/services/registration_service.g.dart index 50d9fd82..4aaccede 100644 --- a/lib/features/registration/services/registration_service.g.dart +++ b/lib/features/registration/services/registration_service.g.dart @@ -22,7 +22,8 @@ class _RegistrationService implements RegistrationService { final ParseErrorLogger? errorLogger; @override - Future> register({required Map sheet}) async { + Future> register( + {required Map sheet}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -128,7 +129,9 @@ class _RegistrationService implements RegistrationService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/pubspec.yaml b/pubspec.yaml index 0dbf3d7a..c3a96e3b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -64,5 +64,6 @@ flutter: - assets/images/ - assets/audio/ - assets/icons/ + flutter_intl: enabled: true