From 69472f422edf780106a25899d2a078bb3e338195 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 11 Sep 2024 16:39:15 +0300 Subject: [PATCH] refactor: remove unused elements --- lib/app_router.dart | 9 - lib/core/errors/exceptions.dart | 25 - lib/core/errors/failures.dart | 8 - .../initialization_state.freezed.dart | 94 ++-- ...base_models.dart => pagination_model.dart} | 4 +- ...zed.dart => pagination_model.freezed.dart} | 171 +++---- ..._models.g.dart => pagination_model.g.dart} | 15 +- lib/core/utils/logger.dart | 15 - lib/core/utils/progress_dialog_utils.dart | 33 -- .../selection_popup_model.freezed.dart | 52 +- .../new_messages_state.freezed.dart | 90 ++-- .../notifications_state.freezed.dart | 157 ++---- .../profile_avatar_cubit.dart | 2 +- .../profile_avatar_state.freezed.dart | 93 ++-- .../calendar/models/calendar_entry_model.dart | 3 +- .../calendar/models/calendar_model.dart | 1 + .../models/calendar_model.freezed.dart | 89 ++-- .../calendar/models/calendar_model.g.dart | 13 +- .../bloc/calendar_state.freezed.dart | 95 ++-- .../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/presentation/pages/chat_screen.dart | 8 +- .../pages/chat_select_screen.dart | 1 - .../presentation/pages/photo_view_screen.dart | 1 - .../widgets/chat_bubble_widget.dart | 1 - .../chat/repositories/chat_repository.dart | 5 +- .../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.dart | 1 - 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 +- .../diary/presentation/bloc/diary_bloc.dart | 2 + .../diary/presentation/bloc/diary_event.dart | 1 + .../bloc/diary_state.freezed.dart | 220 ++++---- .../pages/diary_recommendations_scree.dart | 1 - .../presentation/pages/diary_screen.dart | 4 +- .../diary/services/diary_service.g.dart | 16 +- .../presentation/pages/about_diet_screen.dart | 2 +- lib/features/feed/models/comment_model.dart | 2 +- .../feed/models/comment_model.freezed.dart | 147 +++--- lib/features/feed/models/comment_model.g.dart | 20 +- .../feed/models/diets_pagination_model.dart | 2 +- .../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 +- .../models/feed_blog_post_settings_model.dart | 2 +- ...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 +- .../comments_state.freezed.dart | 83 +-- .../bloc/diets_cubit/diets_state.freezed.dart | 88 +--- .../bloc/feed_cubit/feed_state.freezed.dart | 155 ++---- .../recipes_cubit/recipes_state.freezed.dart | 206 +++----- .../presentation/widgets/diets_widget.dart | 1 - .../presentation/widgets/recipes_widget.dart | 1 - .../feed/repositories/feed_repository.dart | 6 +- .../feed/services/feed_service.g.dart | 4 +- .../menu/presentation/pages/menu_screen.dart | 1 - .../plans/models/plan_pagination_model.dart | 3 +- .../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/profile_model.dart | 1 - .../profile/models/profile_model.freezed.dart | 247 ++++----- .../profile/models/profile_model.g.dart | 34 +- .../profile_cubit/profile_state.freezed.dart | 179 ++----- .../widgets/circumference_chart_widget.dart | 2 +- .../widgets/weight_chart_widget.dart | 2 +- .../profile/services/profile_service.g.dart | 7 +- lib/features/recipes/models/ingredient.dart | 1 - .../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 +- .../recipes/models/recipe_tag_model.dart | 3 +- .../models/recipe_tag_model.freezed.dart | 135 ++--- .../recipes/models/recipe_tag_model.g.dart | 17 +- lib/features/recipes/models/step.dart | 1 - lib/features/recipes/models/step.freezed.dart | 37 +- lib/features/recipes/models/step.g.dart | 3 +- .../bloc/recipe_create_state.freezed.dart | 211 ++++---- .../pages/recipe_edit_screen.dart | 2 + .../recipes/services/recipe_service.g.dart | 10 +- .../registration/models/location_model.dart | 1 + .../models/location_model.freezed.dart | 69 +-- .../registration/models/location_model.g.dart | 9 +- .../models}/user_registration_model.dart | 1 + .../user_registration_model.freezed.dart | 183 +++---- .../models}/user_registration_model.g.dart | 11 +- .../registration_cubit.dart | 2 +- .../registration_state.dart | 2 +- .../registration_state.freezed.dart | 40 +- .../pages/additional_information_screen.dart | 2 +- .../presentation/pages/allergies_screen.dart | 2 +- .../pages/blood_pressure_screen.dart | 2 +- .../pages/body_circumferences_screen.dart | 2 +- .../pages/city_of_living_screen.dart | 2 +- .../pages/credentials_screen.dart | 2 +- .../pages/date_of_birth_screen.dart | 2 +- .../pages/favorite_foods_screen.dart | 2 +- .../pages/favorite_sports_screen.dart | 2 +- .../presentation/pages/gender_screen.dart | 2 +- .../presentation/pages/height_screen.dart | 2 +- .../pages/language_select_screen.dart | 2 +- .../pages/medicine_intake_screen.dart | 2 +- .../presentation/pages/name_screen.dart | 2 +- .../presentation/pages/weight_screen.dart | 2 +- .../repositories/registration_repository.dart | 2 +- .../services/registration_service.g.dart | 7 +- lib/localization/app_localization.dart | 1 + lib/old/auth/auth_screen/auth_screen.dart | 2 + lib/old/auth/auth_screen/bloc/auth_bloc.dart | 1 + .../bloc/diet_create_bloc.dart | 5 +- .../diet_edit_screen/bloc/diet_edit_bloc.dart | 5 +- .../diet_edit_screen/diet_edit_screen.dart | 1 - .../bloc/diet_select_bloc.dart | 5 +- .../diet_select_screen.dart | 1 - .../diet_show_screen/bloc/diet_show_bloc.dart | 5 +- .../diet_show_screen/diet_show_screen.dart | 1 - .../bloc/glossary_screen_bloc.dart | 5 +- .../glossary_screen/glossary_screen.dart | 1 - .../bloc/plan_create_bloc.dart | 5 +- .../plan_edit_screen/bloc/plan_edit_bloc.dart | 5 +- .../plan_edit_screen/plan_edit_screen.dart | 1 - .../bloc/plan_select_bloc.dart | 5 +- .../plan_select_screen.dart | 1 - .../plan_show_screen/bloc/plan_show_bloc.dart | 5 +- .../plan_show_screen/plan_show_screen.dart | 1 - .../bloc/my_profile_bloc.dart | 2 + .../my_profile_screen/my_profile_screen.dart | 1 - .../bloc/recipe_edit_bloc.dart | 1 + .../recipe_edit_screen.dart | 1 - .../bloc/recipe_select_bloc.dart | 1 + .../recipe_select_screen.dart | 1 - .../bloc/recipe_show_bloc.dart | 197 ------- .../bloc/recipe_show_event.dart | 34 -- .../bloc/recipe_show_state.dart | 91 ---- .../models/recipe_show_model.dart | 19 - .../recipe_show_screen.dart | 480 ------------------ .../widgets/comment_widget.dart | 101 ---- .../bloc/subscribers_bloc.dart | 2 + .../subscribers_screen.dart | 5 - .../app_bar/appbar_title_circleimage.dart | 32 -- lib/widgets/app_bar/exit_button.dart | 34 -- lib/widgets/chart_axis.dart | 145 ------ lib/widgets/chart_bars.dart | 79 --- lib/widgets/custom_autocomplete.dart | 80 --- lib/widgets/custom_expandable_list.dart | 1 + lib/widgets/custom_icon_button.dart | 65 --- lib/widgets/custom_navigation_menu_item.dart | 41 -- lib/widgets/nutrition_chart.dart | 89 ---- 182 files changed, 2443 insertions(+), 5482 deletions(-) delete mode 100644 lib/core/errors/exceptions.dart delete mode 100644 lib/core/errors/failures.dart rename lib/core/models/{base_models.dart => pagination_model.dart} (94%) rename lib/core/models/{base_models.freezed.dart => pagination_model.freezed.dart} (82%) rename lib/core/models/{base_models.g.dart => pagination_model.g.dart} (81%) delete mode 100644 lib/core/utils/logger.dart delete mode 100644 lib/core/utils/progress_dialog_utils.dart rename lib/{data/models/userRegistrationModel => features/registration/models}/user_registration_model.dart (99%) rename lib/{data/models/userRegistrationModel => features/registration/models}/user_registration_model.freezed.dart (88%) rename lib/{data/models/userRegistrationModel => features/registration/models}/user_registration_model.g.dart (90%) delete mode 100644 lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart delete mode 100644 lib/old/recipe/recipe_show_screen/bloc/recipe_show_event.dart delete mode 100644 lib/old/recipe/recipe_show_screen/bloc/recipe_show_state.dart delete mode 100644 lib/old/recipe/recipe_show_screen/models/recipe_show_model.dart delete mode 100644 lib/old/recipe/recipe_show_screen/recipe_show_screen.dart delete mode 100644 lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart delete mode 100644 lib/widgets/app_bar/appbar_title_circleimage.dart delete mode 100644 lib/widgets/app_bar/exit_button.dart delete mode 100644 lib/widgets/chart_axis.dart delete mode 100644 lib/widgets/chart_bars.dart delete mode 100644 lib/widgets/custom_autocomplete.dart delete mode 100644 lib/widgets/custom_icon_button.dart delete mode 100644 lib/widgets/custom_navigation_menu_item.dart delete mode 100644 lib/widgets/nutrition_chart.dart diff --git a/lib/app_router.dart b/lib/app_router.dart index 2851b3c6..e0f60978 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -25,7 +25,6 @@ import 'package:eatvio_app/features/registration/presentation/pages/registration import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'package:eatvio_app/old/diets/diet_create_screen/diet_create_screen.dart'; import 'package:eatvio_app/old/diets/diet_select_screen/diet_select_screen.dart'; -import 'package:eatvio_app/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart'; import 'package:eatvio_app/old/glossary/glossary_screen/glossary_screen.dart'; import 'package:eatvio_app/old/plans/plan_select_screen/plan_select_screen.dart'; import 'package:eatvio_app/old/profile/my_profile_screen/my_settings_screen.dart'; @@ -155,14 +154,6 @@ class AppRouter { name: 'blogPostScreen', builder: (context, state) => BlogPostScreen(blogPost: state.extra as FeedBlogPostModel), ), - GoRoute( - path: '/blog-post-edit-screen', - name: 'blogPostEditScreen', - builder: (context, state) => BlogPostEditScreen.builder( - context, - state.extra, - ), - ), GoRoute( path: '/chat-screen', name: 'chatScreen', diff --git a/lib/core/errors/exceptions.dart b/lib/core/errors/exceptions.dart deleted file mode 100644 index 7cbb3f19..00000000 --- a/lib/core/errors/exceptions.dart +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:eatvio_app/main.dart'; -import 'package:flutter/material.dart'; - -class ServerException implements Exception {} - -class CacheException implements Exception {} - -class NetworkException implements Exception {} - -///can be used for throwing [NoInternetException] -class NoInternetException implements Exception { - late String _message; - - NoInternetException([String message = 'NoInternetException Occurred']) { - if (globalMessengerKey.currentState != null) { - globalMessengerKey.currentState!.showSnackBar(SnackBar(content: Text(message))); - } - this._message = message; - } - - @override - String toString() { - return _message; - } -} diff --git a/lib/core/errors/failures.dart b/lib/core/errors/failures.dart deleted file mode 100644 index a96b786a..00000000 --- a/lib/core/errors/failures.dart +++ /dev/null @@ -1,8 +0,0 @@ -abstract class Failure {} - -// General failures -class ServerFailure extends Failure {} - -class CacheFailure extends Failure {} - -class NetworkFailure extends Failure {} diff --git a/lib/core/initialization_cubit/initialization_state.freezed.dart b/lib/core/initialization_cubit/initialization_state.freezed.dart index b0535c68..d9ece2ef 100644 --- a/lib/core/initialization_cubit/initialization_state.freezed.dart +++ b/lib/core/initialization_cubit/initialization_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$InitializationState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,17 @@ 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,18 +91,14 @@ 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. @@ -120,9 +116,7 @@ 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 @@ -209,20 +203,14 @@ 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 @@ -241,9 +229,7 @@ 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 @@ -330,22 +316,17 @@ 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 @@ -380,9 +361,7 @@ 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 @@ -393,9 +372,8 @@ 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 @@ -473,37 +451,29 @@ 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 @@ -540,8 +510,7 @@ 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 @@ -552,9 +521,8 @@ 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 @@ -632,14 +600,12 @@ 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/base_models.dart b/lib/core/models/pagination_model.dart similarity index 94% rename from lib/core/models/base_models.dart rename to lib/core/models/pagination_model.dart index 1f6e04d5..d54863b6 100644 --- a/lib/core/models/base_models.dart +++ b/lib/core/models/pagination_model.dart @@ -1,7 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; -part 'base_models.freezed.dart'; -part 'base_models.g.dart'; +part 'pagination_model.freezed.dart'; +part 'pagination_model.g.dart'; @freezed class Links with _$Links { diff --git a/lib/core/models/base_models.freezed.dart b/lib/core/models/pagination_model.freezed.dart similarity index 82% rename from lib/core/models/base_models.freezed.dart rename to lib/core/models/pagination_model.freezed.dart index 8abf29f4..692c6ef3 100644 --- a/lib/core/models/base_models.freezed.dart +++ b/lib/core/models/pagination_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 'base_models.dart'; +part of 'pagination_model.dart'; // ************************************************************************** // FreezedGenerator @@ -22,10 +22,13 @@ 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; @@ -40,23 +43,20 @@ 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,25 +93,17 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links> /// @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. @@ -153,8 +145,7 @@ 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") @@ -187,20 +178,14 @@ 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() { @@ -222,12 +207,15 @@ 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; @@ -236,8 +224,7 @@ 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) { @@ -248,18 +235,25 @@ 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; @@ -274,8 +268,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, @@ -289,12 +283,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; @@ -351,9 +345,8 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> /// @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( @@ -368,11 +361,8 @@ 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. @@ -439,8 +429,7 @@ 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") @@ -452,6 +441,7 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "last_page") final int lastPage; final List _links; + @override @JsonKey(name: "links") List get links { @@ -483,11 +473,9 @@ 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) && @@ -497,24 +485,15 @@ 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() { @@ -540,24 +519,31 @@ 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; @@ -566,8 +552,7 @@ 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) { @@ -578,8 +563,10 @@ 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; @@ -594,22 +581,19 @@ 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; @@ -641,23 +625,16 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link> /// @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. @@ -688,13 +665,9 @@ class __$$LinkImplCopyWithImpl<$Res> /// @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") @@ -730,8 +703,7 @@ 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() { @@ -742,19 +714,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; @@ -763,6 +735,5 @@ 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/base_models.g.dart b/lib/core/models/pagination_model.g.dart similarity index 81% rename from lib/core/models/base_models.g.dart rename to lib/core/models/pagination_model.g.dart index ada8e71f..d0baeab8 100644 --- a/lib/core/models/base_models.g.dart +++ b/lib/core/models/pagination_model.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'base_models.dart'; +part of 'pagination_model.dart'; // ************************************************************************** // JsonSerializableGenerator @@ -13,8 +13,7 @@ _$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, @@ -25,17 +24,14 @@ _$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, @@ -52,8 +48,7 @@ _$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/core/utils/logger.dart b/lib/core/utils/logger.dart deleted file mode 100644 index dab50c2a..00000000 --- a/lib/core/utils/logger.dart +++ /dev/null @@ -1,15 +0,0 @@ -class Logger { - static LogMode _logMode = LogMode.debug; - - static void init(LogMode mode) { - Logger._logMode = mode; - } - - static void log(dynamic data, {StackTrace? stackTrace}) { - if (_logMode == LogMode.debug) { - print("Error: $data$stackTrace"); - } - } -} - -enum LogMode { debug, live } diff --git a/lib/core/utils/progress_dialog_utils.dart b/lib/core/utils/progress_dialog_utils.dart deleted file mode 100644 index ced3347c..00000000 --- a/lib/core/utils/progress_dialog_utils.dart +++ /dev/null @@ -1,33 +0,0 @@ -import 'package:eatvio_app/app_router.dart'; -import 'package:flutter/material.dart'; - -class ProgressDialogUtils { - static bool isProgressVisible = false; - - ///common method for showing progress dialog - static void showProgressDialog({BuildContext? context, isCancellable = false}) async { - if (!isProgressVisible && AppRouter.navigatorKey.currentState?.overlay?.context != null) { - showDialog( - barrierDismissible: isCancellable, - context: AppRouter.navigatorKey.currentState!.overlay!.context, - builder: (BuildContext context) { - return Center( - child: CircularProgressIndicator.adaptive( - strokeWidth: 4, - valueColor: AlwaysStoppedAnimation( - Colors.white, - ), - ), - ); - }, - ); - isProgressVisible = true; - } - } - - ///common method for hiding progress dialog - static void hideProgressDialog() { - if (isProgressVisible) Navigator.pop(AppRouter.navigatorKey.currentState!.overlay!.context); - isProgressVisible = false; - } -} diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart index 97ab368c..46367fd1 100644 --- a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart +++ b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart @@ -17,33 +17,35 @@ 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; @@ -79,23 +81,19 @@ 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. @@ -131,8 +129,7 @@ class __$$SelectionPopupModelImplCopyWithImpl<$Res> /// @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; @@ -157,13 +154,11 @@ 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. @@ -171,23 +166,21 @@ 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; @@ -195,6 +188,5 @@ 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 7c5d7ffd..433a7e15 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,6 +24,7 @@ mixin _$NewMessagesState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ 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; @@ -91,18 +90,14 @@ class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> /// @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. @@ -120,8 +115,7 @@ 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 @@ -208,19 +202,14 @@ 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. @@ -238,9 +227,7 @@ 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 @@ -327,22 +314,17 @@ 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. @@ -378,8 +360,7 @@ 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 @@ -390,9 +371,8 @@ 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 @@ -470,35 +450,29 @@ 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. @@ -534,8 +508,7 @@ 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 @@ -546,9 +519,8 @@ 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 @@ -626,14 +598,12 @@ 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 d634b318..6fa44e3d 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,18 +20,16 @@ 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; @@ -39,8 +37,7 @@ 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(), }) => @@ -74,18 +71,17 @@ 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; @@ -95,18 +91,14 @@ class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> /// @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. @@ -124,8 +116,7 @@ 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 @@ -136,9 +127,7 @@ 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(); @@ -149,8 +138,7 @@ 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(); @@ -161,8 +149,7 @@ 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(), }) { @@ -216,21 +203,14 @@ 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. @@ -248,9 +228,7 @@ 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 @@ -261,9 +239,7 @@ 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(); @@ -274,8 +250,7 @@ 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(); @@ -286,8 +261,7 @@ 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(), }) { @@ -341,22 +315,17 @@ 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 @@ -383,12 +352,10 @@ class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> /// @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; @@ -409,33 +376,27 @@ 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); @@ -446,8 +407,7 @@ 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); @@ -458,8 +418,7 @@ 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(), }) { @@ -508,39 +467,31 @@ 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. @@ -576,8 +527,7 @@ 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 @@ -588,18 +538,15 @@ 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); @@ -610,8 +557,7 @@ 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); @@ -622,8 +568,7 @@ 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(), }) { @@ -672,14 +617,12 @@ 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_cubit.dart b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart index e2bfd48b..c6d83825 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart @@ -19,4 +19,4 @@ class ProfileAvatarCubit extends Cubit { print(e); } } -} \ No newline at end of file +} 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 b629d579..b4ba4c19 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,6 +24,7 @@ mixin _$ProfileAvatarState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,17 @@ 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,18 +91,14 @@ class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> /// @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. @@ -120,8 +116,7 @@ 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 @@ -208,20 +203,14 @@ 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 @@ -240,9 +229,7 @@ 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 @@ -329,10 +316,9 @@ 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}); @@ -340,13 +326,9 @@ 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 @@ -391,9 +373,7 @@ 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 @@ -404,9 +384,8 @@ 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 @@ -484,37 +463,29 @@ 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. @@ -550,8 +521,7 @@ 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 @@ -562,9 +532,8 @@ 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 @@ -642,14 +611,12 @@ 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_entry_model.dart b/lib/features/calendar/models/calendar_entry_model.dart index 0973f979..32a6d1bd 100644 --- a/lib/features/calendar/models/calendar_entry_model.dart +++ b/lib/features/calendar/models/calendar_entry_model.dart @@ -16,7 +16,6 @@ class CalendarEntryModel { date = date; status = status; id = id; - is_current_day_included_in_the_chosen_diet_progression = - is_current_day_included_in_the_chosen_diet_progression; + is_current_day_included_in_the_chosen_diet_progression = is_current_day_included_in_the_chosen_diet_progression; } } diff --git a/lib/features/calendar/models/calendar_model.dart b/lib/features/calendar/models/calendar_model.dart index 4d74a87a..29e822e2 100644 --- a/lib/features/calendar/models/calendar_model.dart +++ b/lib/features/calendar/models/calendar_model.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'calendar_model.freezed.dart'; + part 'calendar_model.g.dart'; @freezed diff --git a/lib/features/calendar/models/calendar_model.freezed.dart b/lib/features/calendar/models/calendar_model.freezed.dart index d10fc8f2..f7a1d191 100644 --- a/lib/features/calendar/models/calendar_model.freezed.dart +++ b/lib/features/calendar/models/calendar_model.freezed.dart @@ -21,8 +21,9 @@ 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. @@ -31,29 +32,24 @@ 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; @@ -71,8 +67,7 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> ? _value.date : date // ignore: cast_nullable_to_non_nullable as String, - is_current_day_included_in_the_chosen_diet_progression: null == - is_current_day_included_in_the_chosen_diet_progression + 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, @@ -82,26 +77,17 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> } /// @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. @@ -117,8 +103,7 @@ class __$$CalendarModelImplCopyWithImpl<$Res> ? _value.date : date // ignore: cast_nullable_to_non_nullable as String, - is_current_day_included_in_the_chosen_diet_progression: null == - is_current_day_included_in_the_chosen_diet_progression + 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, @@ -130,13 +115,9 @@ class __$$CalendarModelImplCopyWithImpl<$Res> /// @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; @@ -156,30 +137,21 @@ 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() { @@ -190,19 +162,17 @@ 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; @@ -210,6 +180,5 @@ 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 65fd0063..4134c22e 100644 --- a/lib/features/calendar/models/calendar_model.g.dart +++ b/lib/features/calendar/models/calendar_model.g.dart @@ -6,19 +6,14 @@ 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 0e7bdbcd..76a12423 100644 --- a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart +++ b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$CalendarState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ 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; @@ -91,18 +90,12 @@ class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> /// @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. @@ -120,8 +113,7 @@ 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 @@ -208,18 +200,14 @@ 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. @@ -237,9 +225,7 @@ 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 @@ -326,20 +312,17 @@ 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. @@ -360,11 +343,10 @@ class __$$CalendarStateLoadedImplCopyWithImpl<$Res> /// @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; @@ -380,15 +362,11 @@ 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. @@ -396,8 +374,7 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { @override @pragma('vm:prefer-inline') _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => - __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>( - this, _$identity); + __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -475,35 +452,29 @@ 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. @@ -539,8 +510,7 @@ 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 @@ -552,8 +522,7 @@ class _$CalendarStateErrorImpl implements CalendarStateError { @override @pragma('vm:prefer-inline') _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => - __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>( - this, _$identity); + __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -631,14 +600,12 @@ 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/services/calendar_service.g.dart b/lib/features/calendar/services/calendar_service.g.dart index 903145dc..223e1a2e 100644 --- a/lib/features/calendar/services/calendar_service.g.dart +++ b/lib/features/calendar/services/calendar_service.g.dart @@ -46,9 +46,7 @@ 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; @@ -57,9 +55,7 @@ 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 8f921425..558753ef 100644 --- a/lib/features/chat/models/chat_message_model.freezed.dart +++ b/lib/features/chat/models/chat_message_model.freezed.dart @@ -21,11 +21,15 @@ 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; @@ -35,15 +39,13 @@ 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, @@ -54,12 +56,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; @@ -100,11 +102,10 @@ class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> } /// @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( @@ -116,12 +117,9 @@ abstract class _$$ChatMessageModelImplCopyWith<$Res> } /// @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. @@ -170,14 +168,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 { @@ -207,27 +205,21 @@ 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() { @@ -239,26 +231,28 @@ 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; @@ -267,6 +261,5 @@ 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 3a8d1827..70531099 100644 --- a/lib/features/chat/models/chat_message_model.g.dart +++ b/lib/features/chat/models/chat_message_model.g.dart @@ -6,9 +6,7 @@ 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?, @@ -16,9 +14,7 @@ _$ChatMessageModelImpl _$$ChatMessageModelImplFromJson( 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 852b33e4..d4dad1cb 100644 --- a/lib/features/chat/models/chat_messages_model.freezed.dart +++ b/lib/features/chat/models/chat_messages_model.freezed.dart @@ -22,6 +22,7 @@ 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. @@ -30,30 +31,26 @@ 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; @@ -89,28 +86,22 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> } /// @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. @@ -136,16 +127,12 @@ class __$$ChatMessagesModelImplCopyWithImpl<$Res> /// @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 { @@ -167,24 +154,20 @@ 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() { @@ -195,17 +178,15 @@ 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; @@ -213,6 +194,5 @@ 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 6216cd83..1a7fe48b 100644 --- a/lib/features/chat/models/chat_messages_model.g.dart +++ b/lib/features/chat/models/chat_messages_model.g.dart @@ -6,18 +6,12 @@ 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 e8e4e96b..b4354b59 100644 --- a/lib/features/chat/models/chat_meta_model.freezed.dart +++ b/lib/features/chat/models/chat_meta_model.freezed.dart @@ -29,26 +29,24 @@ 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; @@ -69,23 +67,17 @@ class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> } /// @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. @@ -106,11 +98,9 @@ class __$$ChatMetaModelImplCopyWithImpl<$Res> /// @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") @@ -124,10 +114,7 @@ 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) @@ -139,8 +126,7 @@ 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() { @@ -151,12 +137,9 @@ 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") @@ -166,6 +149,5 @@ 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 7126e2dd..bbd16d10 100644 --- a/lib/features/chat/models/chat_meta_model.g.dart +++ b/lib/features/chat/models/chat_meta_model.g.dart @@ -6,12 +6,10 @@ 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 6afb3a94..cef12fbe 100644 --- a/lib/features/chat/models/chat_room_model.freezed.dart +++ b/lib/features/chat/models/chat_room_model.freezed.dart @@ -21,9 +21,10 @@ 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. @@ -32,32 +33,26 @@ 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; @@ -91,38 +86,27 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> @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. @@ -154,13 +138,10 @@ class __$$ChatRoomModelImplCopyWithImpl<$Res> @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; @@ -168,6 +149,7 @@ 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; @@ -186,23 +168,20 @@ 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() { @@ -215,18 +194,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; @@ -234,6 +213,5 @@ 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 68d3195c..6230d4f4 100644 --- a/lib/features/chat/models/chat_room_model.g.dart +++ b/lib/features/chat/models/chat_room_model.g.dart @@ -6,19 +6,15 @@ 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 4b006cf0..468bfb92 100644 --- a/lib/features/chat/models/chat_room_preview_model.freezed.dart +++ b/lib/features/chat/models/chat_room_preview_model.freezed.dart @@ -29,27 +29,25 @@ 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; @@ -70,23 +68,19 @@ class _$ChatRoomPreviewModelCopyWithImpl<$Res, } /// @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. @@ -107,14 +101,12 @@ class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> /// @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 { @@ -131,26 +123,20 @@ 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() { @@ -161,12 +147,9 @@ 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") @@ -176,8 +159,7 @@ 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) { @@ -188,10 +170,13 @@ 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; @@ -201,14 +186,13 @@ 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, @@ -220,12 +204,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; @@ -271,11 +255,9 @@ class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> } /// @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( @@ -289,12 +271,8 @@ abstract class _$$ChatRoomImplCopyWith<$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. @@ -336,8 +314,7 @@ 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") @@ -363,25 +340,21 @@ 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() { @@ -398,18 +371,20 @@ 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; @@ -418,8 +393,7 @@ 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) { @@ -430,16 +404,22 @@ 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; @@ -449,34 +429,31 @@ 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; @@ -527,11 +504,10 @@ class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> } /// @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( @@ -539,19 +515,15 @@ abstract class _$$LastMessageClassImplCopyWith<$Res> @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. @@ -607,14 +579,12 @@ 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") @@ -623,6 +593,7 @@ class _$LastMessageClassImpl implements _LastMessageClass { @JsonKey(name: "data") final String data; final List _mediaData; + @override @JsonKey(name: "media_data") List get mediaData { @@ -656,39 +627,24 @@ 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() { @@ -700,37 +656,40 @@ 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; @@ -739,8 +698,7 @@ 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) { @@ -751,6 +709,7 @@ 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; @@ -765,24 +724,23 @@ 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; @@ -829,28 +787,22 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users> /// @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. @@ -876,12 +828,9 @@ class __$$UsersImplCopyWithImpl<$Res> /// @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") @@ -900,10 +849,8 @@ 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) @@ -915,8 +862,7 @@ 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() { @@ -928,15 +874,14 @@ 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; @@ -945,8 +890,7 @@ 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) { @@ -957,10 +901,13 @@ 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; @@ -970,14 +917,13 @@ 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, @@ -987,12 +933,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; @@ -1028,11 +974,9 @@ class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> } /// @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( @@ -1043,12 +987,8 @@ abstract class _$$ChatUserImplCopyWith<$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. @@ -1090,8 +1030,7 @@ 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") @@ -1118,24 +1057,20 @@ 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() { @@ -1149,23 +1084,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; @@ -1174,6 +1109,5 @@ 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 5ae3f709..ef589a94 100644 --- a/lib/features/chat/models/chat_room_preview_model.g.dart +++ b/lib/features/chat/models/chat_room_preview_model.g.dart @@ -6,39 +6,29 @@ 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, @@ -48,9 +38,7 @@ _$LastMessageClassImpl _$$LastMessageClassImplFromJson( 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, @@ -61,28 +49,23 @@ Map _$$LastMessageClassImplToJson( }; _$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 9d12eefa..76419b76 100644 --- a/lib/features/chat/models/chat_room_settings_model.freezed.dart +++ b/lib/features/chat/models/chat_room_settings_model.freezed.dart @@ -14,19 +14,22 @@ 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; @@ -36,15 +39,14 @@ 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, @@ -55,13 +57,12 @@ 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; @@ -102,12 +103,10 @@ class _$ChatRoomSettingsModelCopyWithImpl<$Res, } /// @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( @@ -119,13 +118,9 @@ abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> } /// @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. @@ -173,8 +168,7 @@ 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; @@ -201,28 +195,23 @@ 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() { @@ -234,26 +223,28 @@ 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; @@ -262,6 +253,5 @@ 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 7b824334..1a2ef327 100644 --- a/lib/features/chat/models/chat_room_settings_model.g.dart +++ b/lib/features/chat/models/chat_room_settings_model.g.dart @@ -6,9 +6,7 @@ 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, @@ -16,9 +14,7 @@ _$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson( updatedAt: json['updated_at'] as String, ); -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 94718168..166e3870 100644 --- a/lib/features/chat/models/chat_user_model.freezed.dart +++ b/lib/features/chat/models/chat_user_model.freezed.dart @@ -21,9 +21,12 @@ 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; @@ -33,30 +36,24 @@ 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; @@ -92,27 +89,17 @@ class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> } /// @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. @@ -154,8 +141,7 @@ 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; @@ -180,24 +166,20 @@ 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() { @@ -209,22 +191,23 @@ 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; @@ -233,6 +216,5 @@ 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 78e0f981..06fa92a0 100644 --- a/lib/features/chat/models/chat_user_model.g.dart +++ b/lib/features/chat/models/chat_user_model.g.dart @@ -6,16 +6,14 @@ 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 9cddabee..dd7a6bb0 100644 --- a/lib/features/chat/models/websocket_info_model.freezed.dart +++ b/lib/features/chat/models/websocket_info_model.freezed.dart @@ -21,9 +21,13 @@ 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; @@ -33,31 +37,25 @@ 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; @@ -98,28 +96,19 @@ class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> } /// @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. @@ -161,14 +150,9 @@ class __$$WebsocketInfoModelImplCopyWithImpl<$Res> @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; @@ -201,8 +185,7 @@ 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. @@ -210,8 +193,7 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @override @pragma('vm:prefer-inline') _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => - __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>( - this, _$identity); + __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>(this, _$identity); @override Map toJson() { @@ -223,24 +205,26 @@ 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; @@ -249,6 +233,5 @@ 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 b2bb1248..91c386f8 100644 --- a/lib/features/chat/models/websocket_info_model.g.dart +++ b/lib/features/chat/models/websocket_info_model.g.dart @@ -6,9 +6,7 @@ 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, @@ -16,9 +14,7 @@ _$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson( 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 4695b4ad..9a27a0ba 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,19 +20,16 @@ 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; @@ -40,9 +37,7 @@ 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(), }) => @@ -76,18 +71,16 @@ 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; @@ -97,18 +90,12 @@ class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> /// @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. @@ -126,8 +113,7 @@ 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 @@ -138,9 +124,7 @@ 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(); @@ -151,9 +135,7 @@ 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(); @@ -164,9 +146,7 @@ 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(), }) { @@ -220,18 +200,14 @@ 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. @@ -249,9 +225,7 @@ 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 @@ -262,9 +236,7 @@ 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(); @@ -275,9 +247,7 @@ 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(); @@ -288,9 +258,7 @@ 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(), }) { @@ -344,26 +312,19 @@ 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. @@ -409,16 +370,13 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> /// @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; @@ -441,19 +399,14 @@ 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. @@ -461,17 +414,14 @@ 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); @@ -482,9 +432,7 @@ 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); @@ -495,9 +443,7 @@ 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(), }) { @@ -553,33 +499,32 @@ 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. @@ -615,8 +560,7 @@ 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 @@ -628,17 +572,14 @@ 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); @@ -649,9 +590,7 @@ 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); @@ -662,9 +601,7 @@ 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(), }) { @@ -713,14 +650,12 @@ 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 99fa9054..1b216a02 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,6 +24,7 @@ mixin _$ChatSelectState { required TResult Function(List chatRooms) loaded, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ 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; @@ -91,18 +90,13 @@ class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> /// @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. @@ -120,8 +114,7 @@ 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 @@ -208,20 +201,14 @@ 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. @@ -239,9 +226,7 @@ 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 @@ -328,20 +313,17 @@ 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. @@ -377,8 +359,7 @@ 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 @@ -389,10 +370,8 @@ 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 @@ -470,35 +449,29 @@ 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. @@ -519,10 +492,10 @@ class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> /// @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; @@ -538,24 +511,19 @@ 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 @@ -633,14 +601,12 @@ 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/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index 53220865..58c1b70c 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -1,15 +1,15 @@ import 'dart:io'; -import 'package:eatvio_app/theme/custom_text_style.dart'; -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:intl/intl.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_bubble_widget.dart'; import 'package:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:intl/intl.dart'; class ChatScreen extends StatefulWidget { final String chatId; diff --git a/lib/features/chat/presentation/pages/chat_select_screen.dart b/lib/features/chat/presentation/pages/chat_select_screen.dart index 6c14e46d..b683eb39 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen.dart @@ -1,5 +1,4 @@ import 'package:easy_debounce/easy_debounce.dart'; - import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_entry_widget.dart'; diff --git a/lib/features/chat/presentation/pages/photo_view_screen.dart b/lib/features/chat/presentation/pages/photo_view_screen.dart index fab2f064..4bc71ee9 100644 --- a/lib/features/chat/presentation/pages/photo_view_screen.dart +++ b/lib/features/chat/presentation/pages/photo_view_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:dismissible_page/dismissible_page.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; - import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:photo_view/photo_view.dart'; diff --git a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart index 5c12f9b4..79e3269a 100644 --- a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:dismissible_page/dismissible_page.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/utils/date_time_utils.dart'; - import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; diff --git a/lib/features/chat/repositories/chat_repository.dart b/lib/features/chat/repositories/chat_repository.dart index 0f0be7de..f83fa563 100644 --- a/lib/features/chat/repositories/chat_repository.dart +++ b/lib/features/chat/repositories/chat_repository.dart @@ -1,11 +1,12 @@ import 'dart:io'; + import 'package:dio/dio.dart'; -import 'package:eatvio_app/features/chat/models/chat_room_preview_model.dart'; -import 'package:http_parser/http_parser.dart'; import 'package:eatvio_app/features/chat/models/chat_messages_model.dart'; import 'package:eatvio_app/features/chat/models/chat_room_model.dart'; +import 'package:eatvio_app/features/chat/models/chat_room_preview_model.dart'; import 'package:eatvio_app/features/chat/models/websocket_info_model.dart'; import 'package:eatvio_app/features/chat/services/chat_service.dart'; +import 'package:http_parser/http_parser.dart'; class ChatRepository { final ChatService chatService; diff --git a/lib/features/chat/services/chat_service.g.dart b/lib/features/chat/services/chat_service.g.dart index 4e84a7b3..fa32d6fd 100644 --- a/lib/features/chat/services/chat_service.g.dart +++ b/lib/features/chat/services/chat_service.g.dart @@ -80,8 +80,7 @@ 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; @@ -199,9 +198,7 @@ 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 ceabd5db..1b3bca12 100644 --- a/lib/features/diary/models/diary_model.freezed.dart +++ b/lib/features/diary/models/diary_model.freezed.dart @@ -21,12 +21,19 @@ 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. @@ -35,36 +42,26 @@ 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; @@ -130,34 +127,20 @@ class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> } /// @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. @@ -224,8 +207,7 @@ 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; @@ -234,6 +216,7 @@ class _$DiaryModelImpl implements _DiaryModel { @override final int closed; final List _meals; + @override List get meals { if (_meals is EqualUnmodifiableListView) return _meals; @@ -272,24 +255,14 @@ 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() { @@ -310,23 +283,29 @@ 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; @@ -334,6 +313,5 @@ 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 29f98caa..e549b464 100644 --- a/lib/features/diary/models/diary_model.g.dart +++ b/lib/features/diary/models/diary_model.g.dart @@ -6,26 +6,18 @@ 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 2bd6c478..16a7bd5a 100644 --- a/lib/features/diary/models/meal.freezed.dart +++ b/lib/features/diary/models/meal.freezed.dart @@ -21,11 +21,17 @@ 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. @@ -39,26 +45,19 @@ 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; @@ -110,27 +109,16 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal> /// @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. @@ -192,8 +180,7 @@ 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; @@ -206,6 +193,7 @@ class _$MealImpl implements _Meal { @override final int mood; final List _portions; + @override List get portions { if (_portions is EqualUnmodifiableListView) return _portions; @@ -214,6 +202,7 @@ class _$MealImpl implements _Meal { } final List _photos; + @override List get photos { if (_photos is EqualUnmodifiableListView) return _photos; @@ -242,23 +231,15 @@ 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() { @@ -282,16 +263,22 @@ 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; @@ -299,6 +286,5 @@ 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 5536ed92..e1662cac 100644 --- a/lib/features/diary/models/meal.g.dart +++ b/lib/features/diary/models/meal.g.dart @@ -12,16 +12,11 @@ _$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.dart b/lib/features/diary/models/photo.dart index d3e4f695..e3a485d8 100644 --- a/lib/features/diary/models/photo.dart +++ b/lib/features/diary/models/photo.dart @@ -1,7 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'photo.freezed.dart'; - part 'photo.g.dart'; @freezed diff --git a/lib/features/diary/models/photo.freezed.dart b/lib/features/diary/models/photo.freezed.dart index 8f5e0152..ff812349 100644 --- a/lib/features/diary/models/photo.freezed.dart +++ b/lib/features/diary/models/photo.freezed.dart @@ -21,8 +21,10 @@ 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. @@ -36,22 +38,19 @@ 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; @@ -83,24 +82,16 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo> /// @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. @@ -131,13 +122,9 @@ class __$$PhotoImplCopyWithImpl<$Res> /// @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; @@ -158,8 +145,7 @@ 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)); } @@ -172,8 +158,7 @@ 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() { @@ -184,18 +169,17 @@ 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; @@ -203,6 +187,5 @@ 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 cacf65ac..1efd15ed 100644 --- a/lib/features/diary/models/photo.g.dart +++ b/lib/features/diary/models/photo.g.dart @@ -12,8 +12,7 @@ _$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 4bef02d4..4aeb9936 100644 --- a/lib/features/diary/models/portion.freezed.dart +++ b/lib/features/diary/models/portion.freezed.dart @@ -21,9 +21,13 @@ 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. @@ -37,24 +41,19 @@ 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; @@ -96,26 +95,16 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion> /// @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. @@ -156,15 +145,9 @@ class __$$PortionImplCopyWithImpl<$Res> /// @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; @@ -188,27 +171,22 @@ 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() { @@ -230,12 +208,16 @@ 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; @@ -243,6 +225,5 @@ 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 f3503e5c..2a464133 100644 --- a/lib/features/diary/models/portion.g.dart +++ b/lib/features/diary/models/portion.g.dart @@ -6,8 +6,7 @@ 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(), @@ -15,8 +14,7 @@ _$PortionImpl _$$PortionImplFromJson(Map json) => 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 610656fb..4911e89e 100644 --- a/lib/features/diary/models/product.freezed.dart +++ b/lib/features/diary/models/product.freezed.dart @@ -21,6 +21,7 @@ Product _$ProductFromJson(Map json) { /// @nodoc mixin _$Product { int get id => throw _privateConstructorUsedError; + String get name => throw _privateConstructorUsedError; /// Serializes this Product to a JSON map. @@ -34,19 +35,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; @@ -73,21 +74,16 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product> /// @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. @@ -115,8 +111,7 @@ class __$$ProductImplCopyWithImpl<$Res> 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; @@ -146,8 +141,7 @@ 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() { @@ -158,13 +152,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; @@ -172,6 +166,5 @@ 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 74331101..d7e1ddd9 100644 --- a/lib/features/diary/models/product.g.dart +++ b/lib/features/diary/models/product.g.dart @@ -6,14 +6,12 @@ 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 6b9c50fb..e20b37b4 100644 --- a/lib/features/diary/models/state.freezed.dart +++ b/lib/features/diary/models/state.freezed.dart @@ -21,6 +21,7 @@ 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. @@ -34,19 +35,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; @@ -73,21 +74,16 @@ class _$StateCopyWithImpl<$Res, $Val extends State> /// @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. @@ -113,11 +109,9 @@ class __$$StateImplCopyWithImpl<$Res> /// @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; @@ -134,24 +128,20 @@ 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() { @@ -162,14 +152,13 @@ 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; @@ -177,6 +166,5 @@ 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 1b0da8f4..574604e3 100644 --- a/lib/features/diary/models/state.g.dart +++ b/lib/features/diary/models/state.g.dart @@ -11,8 +11,7 @@ _$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_bloc.dart b/lib/features/diary/presentation/bloc/diary_bloc.dart index 74742144..cee99a34 100644 --- a/lib/features/diary/presentation/bloc/diary_bloc.dart +++ b/lib/features/diary/presentation/bloc/diary_bloc.dart @@ -1,4 +1,5 @@ import 'dart:async'; + import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/features/diary/models/diary_model.dart'; import 'package:eatvio_app/features/diary/models/meal.dart'; @@ -10,6 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:image_picker/image_picker.dart'; import 'package:intl/intl.dart'; + part 'diary_event.dart'; /// A bloc that manages the state of a Diary according to the event that is dispatched to it. diff --git a/lib/features/diary/presentation/bloc/diary_event.dart b/lib/features/diary/presentation/bloc/diary_event.dart index cfc1bedf..33c168d7 100644 --- a/lib/features/diary/presentation/bloc/diary_event.dart +++ b/lib/features/diary/presentation/bloc/diary_event.dart @@ -182,6 +182,7 @@ class RefreshEvent extends DiaryEvent { class ConfirmPortion extends DiaryEvent { ConfirmPortion(this.id); + int id; @override diff --git a/lib/features/diary/presentation/bloc/diary_state.freezed.dart b/lib/features/diary/presentation/bloc/diary_state.freezed.dart index 98d7019f..881f2e9d 100644 --- a/lib/features/diary/presentation/bloc/diary_state.freezed.dart +++ b/lib/features/diary/presentation/bloc/diary_state.freezed.dart @@ -54,6 +54,7 @@ mixin _$DiaryState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -160,18 +161,16 @@ 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; @@ -181,18 +180,12 @@ class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState> /// @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. @@ -210,8 +203,7 @@ 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 @@ -388,20 +380,17 @@ 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. @@ -434,10 +423,7 @@ 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 @@ -448,9 +434,7 @@ 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 @@ -625,15 +609,14 @@ 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, @@ -667,17 +650,16 @@ 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. @@ -859,8 +841,7 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> @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)); }); } @@ -913,24 +894,25 @@ 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; @@ -939,6 +921,7 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } final List _mealList; + @override List get mealList { if (_mealList is EqualUnmodifiableListView) return _mealList; @@ -947,6 +930,7 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } final List _portionList; + @override List get portionList { if (_portionList is EqualUnmodifiableListView) return _portionList; @@ -955,15 +939,16 @@ 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; @@ -1010,12 +995,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); } @@ -1031,60 +1016,34 @@ 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 @@ -1126,9 +1085,7 @@ 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 @@ -1415,58 +1372,80 @@ 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. @@ -1502,8 +1481,7 @@ 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 @@ -1514,9 +1492,7 @@ 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 @@ -1684,14 +1660,12 @@ 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/presentation/pages/diary_recommendations_scree.dart b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart index 5211eeed..e76b33ab 100644 --- a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart +++ b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart @@ -3,7 +3,6 @@ import 'package:eatvio_app/features/diary/models/portion.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 8e537a20..e2287ddd 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -11,15 +11,13 @@ import 'package:eatvio_app/features/diary/models/product.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; import 'package:eatvio_app/localization/app_localization.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:eatvio_app/widgets/custom_edit_text_form_field.dart'; import 'package:eatvio_app/widgets/custom_edit_drop_down.dart'; +import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; import 'package:eatvio_app/widgets/custom_scale_element.dart'; - import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/features/diary/services/diary_service.g.dart b/lib/features/diary/services/diary_service.g.dart index 8c1039c0..31336bae 100644 --- a/lib/features/diary/services/diary_service.g.dart +++ b/lib/features/diary/services/diary_service.g.dart @@ -79,8 +79,7 @@ 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; @@ -140,11 +139,7 @@ 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; @@ -333,8 +328,7 @@ 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; @@ -511,9 +505,7 @@ 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/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart index d2ee8bd2..1847689d 100644 --- a/lib/features/diets/presentation/pages/about_diet_screen.dart +++ b/lib/features/diets/presentation/pages/about_diet_screen.dart @@ -1,7 +1,7 @@ import 'dart:io'; + 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/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart'; diff --git a/lib/features/feed/models/comment_model.dart b/lib/features/feed/models/comment_model.dart index edcc722a..1fbcb145 100644 --- a/lib/features/feed/models/comment_model.dart +++ b/lib/features/feed/models/comment_model.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:eatvio_app/core/models/pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'comment_model.freezed.dart'; diff --git a/lib/features/feed/models/comment_model.freezed.dart b/lib/features/feed/models/comment_model.freezed.dart index 4e520131..b32da824 100644 --- a/lib/features/feed/models/comment_model.freezed.dart +++ b/lib/features/feed/models/comment_model.freezed.dart @@ -22,8 +22,10 @@ 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; @@ -33,32 +35,28 @@ 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; @@ -109,31 +107,23 @@ class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> } /// @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. @@ -165,15 +155,13 @@ class __$$CommentModelImplCopyWithImpl<$Res> @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 { @@ -206,16 +194,14 @@ 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() { @@ -231,15 +217,16 @@ 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; @@ -248,8 +235,7 @@ 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) { @@ -260,14 +246,19 @@ 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; @@ -282,8 +273,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, @@ -295,12 +286,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; @@ -347,9 +338,8 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> /// @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( @@ -362,12 +352,8 @@ 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. @@ -418,13 +404,11 @@ 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") @@ -439,11 +423,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); } @@ -463,35 +447,23 @@ 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() { @@ -503,33 +475,35 @@ 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; @@ -538,6 +512,5 @@ 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 1410cfcc..503322f9 100644 --- a/lib/features/feed/models/comment_model.g.dart +++ b/lib/features/feed/models/comment_model.g.dart @@ -6,36 +6,28 @@ 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.dart b/lib/features/feed/models/diets_pagination_model.dart index f56c606c..a83be43f 100644 --- a/lib/features/feed/models/diets_pagination_model.dart +++ b/lib/features/feed/models/diets_pagination_model.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:eatvio_app/core/models/pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'diets_pagination_model.freezed.dart'; diff --git a/lib/features/feed/models/diets_pagination_model.freezed.dart b/lib/features/feed/models/diets_pagination_model.freezed.dart index 15b651f3..9e81d064 100644 --- a/lib/features/feed/models/diets_pagination_model.freezed.dart +++ b/lib/features/feed/models/diets_pagination_model.freezed.dart @@ -22,8 +22,10 @@ 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; @@ -33,32 +35,28 @@ 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; @@ -109,31 +107,24 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> } /// @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. @@ -165,15 +156,13 @@ class __$$DietsPaginationImplCopyWithImpl<$Res> @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 { @@ -206,17 +195,14 @@ 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() { @@ -232,15 +218,16 @@ 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; @@ -249,8 +236,7 @@ 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) { @@ -261,27 +247,37 @@ 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; @@ -296,8 +292,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, @@ -307,24 +303,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; @@ -421,9 +417,8 @@ class _$DietCopyWithImpl<$Res, $Val extends Diet> /// @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( @@ -434,8 +429,7 @@ 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, @@ -443,16 +437,14 @@ 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. @@ -536,16 +528,14 @@ 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") @@ -569,6 +559,7 @@ class _$DietImpl implements _Diet { @JsonKey(name: "details") final String details; final List>> _dailySchedule; + @override @JsonKey(name: "daily_schedule") List>> get dailySchedule { @@ -603,46 +594,28 @@ 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() { @@ -654,56 +627,65 @@ 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; @@ -712,8 +694,7 @@ 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) { @@ -724,10 +705,13 @@ 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; @@ -742,8 +726,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, @@ -753,12 +737,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; @@ -795,9 +779,8 @@ class _$AuthorCopyWithImpl<$Res, $Val extends Author> /// @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( @@ -808,12 +791,8 @@ 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. @@ -855,8 +834,7 @@ 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") @@ -881,28 +859,22 @@ 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() { @@ -914,24 +886,25 @@ 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; @@ -940,8 +913,7 @@ 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) { @@ -952,10 +924,13 @@ 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; @@ -965,15 +940,13 @@ 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, @@ -983,12 +956,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; @@ -1024,11 +997,9 @@ class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> } /// @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( @@ -1039,12 +1010,8 @@ abstract class _$$DailyScheduleImplCopyWith<$Res> } /// @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. @@ -1086,8 +1053,7 @@ 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") @@ -1115,8 +1081,7 @@ 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) @@ -1128,8 +1093,7 @@ 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() { @@ -1141,24 +1105,25 @@ 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; @@ -1167,8 +1132,7 @@ 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) { @@ -1179,10 +1143,13 @@ 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; @@ -1192,29 +1159,24 @@ 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; @@ -1250,27 +1212,17 @@ class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> } /// @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. @@ -1306,14 +1258,9 @@ class __$$DietTypeImplCopyWithImpl<$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") @@ -1353,8 +1300,7 @@ 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() { @@ -1371,18 +1317,20 @@ 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; @@ -1391,6 +1339,5 @@ 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 7fcab8cd..fd3e231c 100644 --- a/lib/features/feed/models/diets_pagination_model.g.dart +++ b/lib/features/feed/models/diets_pagination_model.g.dart @@ -6,19 +6,13 @@ 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, @@ -33,11 +27,7 @@ _$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(), @@ -45,8 +35,7 @@ _$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, @@ -68,24 +57,21 @@ _$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]!, @@ -98,16 +84,14 @@ 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 89087373..ce6612b7 100644 --- a/lib/features/feed/models/feed_blog_post_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_model.freezed.dart @@ -21,23 +21,35 @@ 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; @@ -47,15 +59,13 @@ 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, @@ -76,12 +86,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; @@ -172,11 +182,10 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> } /// @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( @@ -199,12 +208,9 @@ abstract class _$$FeedBlogPostModelImplCopyWith<$Res> } /// @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. @@ -300,8 +306,7 @@ 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; @@ -350,52 +355,29 @@ 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() { @@ -407,54 +389,64 @@ 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; @@ -463,6 +455,5 @@ 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 fadf4302..29ecd6f7 100644 --- a/lib/features/feed/models/feed_blog_post_model.g.dart +++ b/lib/features/feed/models/feed_blog_post_model.g.dart @@ -6,9 +6,7 @@ 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, @@ -24,9 +22,7 @@ _$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson( 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.dart b/lib/features/feed/models/feed_blog_post_settings_model.dart index 2dcd22a1..2998cddd 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:eatvio_app/core/models/pagination_model.dart'; import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; 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 9bddceae..1121d5e1 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,16 +14,15 @@ 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. @@ -32,31 +31,27 @@ 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; @@ -92,30 +87,22 @@ class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, } /// @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 @@ -142,21 +129,17 @@ class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> /// @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); } @@ -174,24 +157,21 @@ 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() { @@ -202,17 +182,15 @@ 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; @@ -220,6 +198,5 @@ 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 e300b594..9566ca99 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,18 +6,12 @@ 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 9dd4f54e..6b59786a 100644 --- a/lib/features/feed/models/recipes_model.freezed.dart +++ b/lib/features/feed/models/recipes_model.freezed.dart @@ -21,28 +21,44 @@ 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. @@ -56,8 +72,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, @@ -82,12 +98,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; @@ -199,9 +215,8 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> /// @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( @@ -228,12 +243,8 @@ 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. @@ -355,8 +366,7 @@ 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; @@ -368,6 +378,7 @@ class _$RecipesImpl implements _Recipes { @JsonKey(name: 'cooking_time') final int cookingTime; final List _ingredients; + @override List get ingredients { if (_ingredients is EqualUnmodifiableListView) return _ingredients; @@ -378,6 +389,7 @@ class _$RecipesImpl implements _Recipes { @override final String description; final List _steps; + @override List get steps { if (_steps is EqualUnmodifiableListView) return _steps; @@ -425,60 +437,33 @@ 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() { @@ -512,43 +497,59 @@ 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; @@ -556,8 +557,7 @@ 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,7 +567,9 @@ 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. @@ -576,26 +578,24 @@ 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,23 +626,17 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> } /// @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. @@ -673,11 +667,9 @@ class __$$IngredientImplCopyWithImpl<$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; @@ -710,8 +702,7 @@ 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() { @@ -722,18 +713,16 @@ 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; @@ -741,8 +730,7 @@ 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) { @@ -752,6 +740,7 @@ Step _$StepFromJson(Map json) { /// @nodoc mixin _$Step { String get image => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; /// Serializes this Step to a JSON map. @@ -765,19 +754,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; @@ -804,20 +793,16 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> /// @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. @@ -845,8 +830,7 @@ class __$$StepImplCopyWithImpl<$Res> 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; @@ -864,8 +848,7 @@ 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) @@ -877,8 +860,7 @@ 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() { @@ -889,14 +871,13 @@ 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; @@ -904,6 +885,5 @@ 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 7f8c0142..0f9e0a0d 100644 --- a/lib/features/feed/models/recipes_model.g.dart +++ b/lib/features/feed/models/recipes_model.g.dart @@ -6,19 +6,14 @@ 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), @@ -31,8 +26,7 @@ _$RecipesImpl _$$RecipesImplFromJson(Map json) => author: Author.fromJson(json['author'] as Map), ); -Map _$$RecipesImplToJson(_$RecipesImpl instance) => - { +Map _$$RecipesImplToJson(_$RecipesImpl instance) => { 'id': instance.id, 'image': instance.image, 'state': instance.state, @@ -52,15 +46,13 @@ Map _$$RecipesImplToJson(_$RecipesImpl instance) => 'author': instance.author, }; -_$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, @@ -71,8 +63,7 @@ _$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 ca8e9f92..8d95450d 100644 --- a/lib/features/feed/models/recipes_pagination_model.freezed.dart +++ b/lib/features/feed/models/recipes_pagination_model.freezed.dart @@ -29,26 +29,24 @@ 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; @@ -69,23 +67,19 @@ class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> } /// @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. @@ -106,14 +100,12 @@ class __$$RecipesPaginationImplCopyWithImpl<$Res> /// @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 { @@ -130,25 +122,19 @@ 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() { @@ -159,12 +145,9 @@ 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') @@ -174,6 +157,5 @@ 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 109f39d5..e14428fb 100644 --- a/lib/features/feed/models/recipes_pagination_model.g.dart +++ b/lib/features/feed/models/recipes_pagination_model.g.dart @@ -6,16 +6,10 @@ 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_state.freezed.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart index c3b582ce..caa93548 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,6 +24,7 @@ mixin _$CommentsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ 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; @@ -91,18 +90,12 @@ class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> /// @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. @@ -120,8 +113,7 @@ 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 @@ -208,18 +200,14 @@ 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. @@ -237,9 +225,7 @@ 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 @@ -326,9 +312,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}); @@ -336,12 +322,9 @@ 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. @@ -407,8 +390,7 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { @override @pragma('vm:prefer-inline') _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => - __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>( - this, _$identity); + __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -486,36 +468,31 @@ 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. @@ -551,8 +528,7 @@ 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 @@ -564,8 +540,7 @@ class _$CommentsStateErrorImpl implements CommentsStateError { @override @pragma('vm:prefer-inline') _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => - __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>( - this, _$identity); + __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -643,14 +618,12 @@ 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 dd30f73d..e1797ea0 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,6 +24,7 @@ mixin _$DietsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ 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; @@ -91,18 +90,12 @@ class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> /// @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. @@ -120,8 +113,7 @@ 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 @@ -208,18 +200,14 @@ 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. @@ -237,8 +225,7 @@ 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 @@ -325,9 +312,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}); @@ -335,12 +322,9 @@ 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. @@ -384,9 +368,7 @@ 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 @@ -397,9 +379,7 @@ 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 @@ -477,34 +457,27 @@ 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. @@ -540,8 +513,7 @@ 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 @@ -552,9 +524,7 @@ 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 @@ -632,14 +602,12 @@ 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_state.freezed.dart b/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart index 70cb30d4..377ed8d7 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,18 +20,16 @@ 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; @@ -39,8 +37,7 @@ 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(), }) => @@ -74,17 +71,16 @@ 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; @@ -94,18 +90,12 @@ class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> /// @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. @@ -123,8 +113,7 @@ 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 @@ -135,9 +124,7 @@ 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(); @@ -148,8 +135,7 @@ 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(); @@ -160,8 +146,7 @@ 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(), }) { @@ -215,18 +200,14 @@ 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. @@ -244,8 +225,7 @@ 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 @@ -256,9 +236,7 @@ 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(); @@ -269,8 +247,7 @@ 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(); @@ -281,8 +258,7 @@ 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(), }) { @@ -336,20 +312,15 @@ 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. @@ -375,16 +346,13 @@ class __$$FeedStateLoadedImplCopyWithImpl<$Res> /// @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); } @@ -402,33 +370,26 @@ 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); @@ -439,8 +400,7 @@ 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); @@ -451,8 +411,7 @@ 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(), }) { @@ -501,36 +460,29 @@ 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. @@ -566,8 +518,7 @@ 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 @@ -578,18 +529,14 @@ 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); @@ -600,8 +547,7 @@ 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); @@ -612,8 +558,7 @@ 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(), }) { @@ -662,14 +607,12 @@ 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_state.freezed.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart index 34100adb..3b29fac8 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,23 +20,16 @@ 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; @@ -44,9 +37,7 @@ 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(), }) => @@ -80,18 +71,16 @@ 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; @@ -101,18 +90,12 @@ class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> /// @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. @@ -130,8 +113,7 @@ 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 @@ -142,13 +124,7 @@ 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(); @@ -159,9 +135,7 @@ 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(); @@ -172,9 +146,7 @@ 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(), }) { @@ -228,18 +200,14 @@ 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. @@ -257,9 +225,7 @@ 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 @@ -270,13 +236,7 @@ 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(); @@ -287,9 +247,7 @@ 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(); @@ -300,9 +258,7 @@ 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(), }) { @@ -356,25 +312,17 @@ 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. @@ -426,6 +374,7 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { _selectedTags = selectedTags; final List _recipesList; + @override List get recipesList { if (_recipesList is EqualUnmodifiableListView) return _recipesList; @@ -434,6 +383,7 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { } final List _recipesTags; + @override List get recipesTags { if (_recipesTags is EqualUnmodifiableListView) return _recipesTags; @@ -442,6 +392,7 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { } final Set _selectedTags; + @override Set get selectedTags { if (_selectedTags is EqualUnmodifiableSetView) return _selectedTags; @@ -464,26 +415,16 @@ 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. @@ -491,25 +432,17 @@ 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 @@ -517,13 +450,10 @@ 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 @@ -531,15 +461,12 @@ 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(); } @@ -591,34 +518,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. @@ -654,8 +581,7 @@ 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 @@ -666,22 +592,14 @@ 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); @@ -692,9 +610,7 @@ 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); @@ -705,9 +621,7 @@ 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(), }) { @@ -756,14 +670,12 @@ 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/widgets/diets_widget.dart b/lib/features/feed/presentation/widgets/diets_widget.dart index 82069967..038e1c73 100644 --- a/lib/features/feed/presentation/widgets/diets_widget.dart +++ b/lib/features/feed/presentation/widgets/diets_widget.dart @@ -1,6 +1,5 @@ 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:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; diff --git a/lib/features/feed/presentation/widgets/recipes_widget.dart b/lib/features/feed/presentation/widgets/recipes_widget.dart index a982a6f2..16291797 100644 --- a/lib/features/feed/presentation/widgets/recipes_widget.dart +++ b/lib/features/feed/presentation/widgets/recipes_widget.dart @@ -1,6 +1,5 @@ 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:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; diff --git a/lib/features/feed/repositories/feed_repository.dart b/lib/features/feed/repositories/feed_repository.dart index e90f2680..7d6397d2 100644 --- a/lib/features/feed/repositories/feed_repository.dart +++ b/lib/features/feed/repositories/feed_repository.dart @@ -17,11 +17,7 @@ class FeedRepository { } } - 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, diff --git a/lib/features/feed/services/feed_service.g.dart b/lib/features/feed/services/feed_service.g.dart index 3f513034..fe36ea64 100644 --- a/lib/features/feed/services/feed_service.g.dart +++ b/lib/features/feed/services/feed_service.g.dart @@ -398,9 +398,7 @@ 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/menu/presentation/pages/menu_screen.dart b/lib/features/menu/presentation/pages/menu_screen.dart index 80e06835..9d55b7b9 100644 --- a/lib/features/menu/presentation/pages/menu_screen.dart +++ b/lib/features/menu/presentation/pages/menu_screen.dart @@ -1,6 +1,5 @@ import 'package:dio/dio.dart'; import 'package:eatvio_app/core/const.dart'; - import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/locator_service.dart'; diff --git a/lib/features/plans/models/plan_pagination_model.dart b/lib/features/plans/models/plan_pagination_model.dart index 767d959a..e9fef491 100644 --- a/lib/features/plans/models/plan_pagination_model.dart +++ b/lib/features/plans/models/plan_pagination_model.dart @@ -1,9 +1,8 @@ -import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:eatvio_app/core/models/pagination_model.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'plan_pagination_model.freezed.dart'; - part 'plan_pagination_model.g.dart'; @freezed diff --git a/lib/features/plans/models/plan_pagination_model.freezed.dart b/lib/features/plans/models/plan_pagination_model.freezed.dart index caa2ef10..59ad65ae 100644 --- a/lib/features/plans/models/plan_pagination_model.freezed.dart +++ b/lib/features/plans/models/plan_pagination_model.freezed.dart @@ -22,8 +22,10 @@ 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; @@ -33,32 +35,29 @@ 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; @@ -109,31 +108,25 @@ 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. @@ -165,15 +158,13 @@ class __$$PlanPaginationModelImplCopyWithImpl<$Res> @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 { @@ -206,8 +197,7 @@ 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. @@ -215,8 +205,7 @@ class _$PlanPaginationModelImpl implements _PlanPaginationModel { @override @pragma('vm:prefer-inline') _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => - __$$PlanPaginationModelImplCopyWithImpl<_$PlanPaginationModelImpl>( - this, _$identity); + __$$PlanPaginationModelImplCopyWithImpl<_$PlanPaginationModelImpl>(this, _$identity); @override Map toJson() { @@ -228,20 +217,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; @@ -250,8 +239,7 @@ 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) { @@ -262,32 +250,46 @@ 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; @@ -297,14 +299,13 @@ 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, @@ -324,16 +325,17 @@ 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; @@ -444,11 +446,9 @@ class _$PlanModelCopyWithImpl<$Res, $Val extends PlanModel> } /// @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,17 +470,14 @@ abstract class _$$PlanModelImplCopyWith<$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. @@ -588,8 +585,7 @@ 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") @@ -650,26 +646,18 @@ 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) @@ -697,8 +685,7 @@ 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() { @@ -710,68 +697,80 @@ 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; @@ -780,8 +779,7 @@ 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) { @@ -792,10 +790,13 @@ 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; @@ -805,15 +806,13 @@ 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, @@ -823,12 +822,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; @@ -864,11 +863,9 @@ class _$PacketOptionsCopyWithImpl<$Res, $Val extends PacketOptions> } /// @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( @@ -879,12 +876,8 @@ abstract class _$$PacketOptionsImplCopyWith<$Res> } /// @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. @@ -927,10 +920,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 { @@ -962,26 +955,19 @@ 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() { @@ -993,24 +979,25 @@ 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; @@ -1019,8 +1006,7 @@ 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) { @@ -1031,10 +1017,13 @@ 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; @@ -1044,29 +1033,25 @@ 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; @@ -1102,27 +1087,18 @@ class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType> } /// @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. @@ -1164,8 +1140,7 @@ 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") @@ -1192,10 +1167,8 @@ 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) @@ -1207,8 +1180,7 @@ 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() { @@ -1220,24 +1192,25 @@ 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; @@ -1246,6 +1219,5 @@ 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 8f203fa8..595e52b4 100644 --- a/lib/features/plans/models/plan_pagination_model.g.dart +++ b/lib/features/plans/models/plan_pagination_model.g.dart @@ -6,26 +6,19 @@ 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, @@ -43,8 +36,7 @@ _$PlanModelImpl _$$PlanModelImplFromJson(Map json) => totalComments: (json['total_comments'] as num).toInt(), ); -Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => - { +Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => { 'id': instance.id, 'name': instance.name, 'image': instance.image, @@ -62,32 +54,28 @@ Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => 'total_comments': instance.totalComments, }; -_$PacketOptionsImpl _$$PacketOptionsImplFromJson(Map 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 1bbe3cac..e16e4e4d 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,6 +24,7 @@ mixin _$PlansState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ 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; @@ -91,18 +90,12 @@ class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState> /// @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. @@ -120,8 +113,7 @@ 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 @@ -208,18 +200,14 @@ 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. @@ -237,8 +225,7 @@ 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 @@ -325,9 +312,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}); @@ -335,12 +322,9 @@ 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. @@ -384,10 +368,7 @@ 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 @@ -398,9 +379,7 @@ 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 @@ -478,34 +457,27 @@ 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. @@ -541,8 +513,7 @@ 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 @@ -553,9 +524,7 @@ 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 @@ -633,14 +602,12 @@ 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 bce687f0..2f655a5d 100644 --- a/lib/features/plans/services/plans_service.g.dart +++ b/lib/features/plans/services/plans_service.g.dart @@ -55,9 +55,7 @@ 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/profile_model.dart b/lib/features/profile/models/profile_model.dart index d209e6d7..2ef4d073 100644 --- a/lib/features/profile/models/profile_model.dart +++ b/lib/features/profile/models/profile_model.dart @@ -1,7 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'profile_model.freezed.dart'; - part 'profile_model.g.dart'; @freezed diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index 94b860a3..3732e837 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -22,20 +22,28 @@ 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; @@ -45,15 +53,13 @@ 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, @@ -68,12 +74,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; @@ -134,11 +140,9 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> } /// @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( @@ -154,12 +158,8 @@ abstract class _$$ProfileModelImplCopyWith<$Res> } /// @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,8 +231,7 @@ 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") @@ -275,31 +274,24 @@ 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() { @@ -319,36 +311,42 @@ 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; @@ -357,8 +355,7 @@ 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) { @@ -369,56 +366,82 @@ 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; @@ -428,15 +451,14 @@ 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, @@ -469,12 +491,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; @@ -625,11 +647,10 @@ 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( @@ -663,12 +684,9 @@ abstract class _$$ProfileDetailsModelImplCopyWith<$Res> } /// @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. @@ -846,11 +864,9 @@ 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") @@ -944,53 +960,33 @@ 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) @@ -1032,8 +1028,7 @@ class _$ProfileDetailsModelImpl implements _ProfileDetailsModel { @override @pragma('vm:prefer-inline') _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => - __$$ProfileDetailsModelImplCopyWithImpl<_$ProfileDetailsModelImpl>( - this, _$identity); + __$$ProfileDetailsModelImplCopyWithImpl<_$ProfileDetailsModelImpl>(this, _$identity); @override Map toJson() { @@ -1054,112 +1049,131 @@ 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; @@ -1168,6 +1182,5 @@ 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 28e10ccf..56e201fb 100644 --- a/lib/features/profile/models/profile_model.g.dart +++ b/lib/features/profile/models/profile_model.g.dart @@ -6,27 +6,19 @@ 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, @@ -38,9 +30,7 @@ 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, @@ -63,20 +53,14 @@ _$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson( favoriteFoods: json['favorite_foods'] as String, unfavoriteFoods: json['unfavorite_foods'] as String, additionalInfo: json['additional_info'] 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), + 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), isMoodFillable: json['is_mood_fillable'] as bool, isBedtimeFillable: json['is_bedtime_fillable'] as bool, activityCoefficient: (json['activity_coefficient'] as num).toDouble(), ); -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/presentation/bloc/profile_cubit/profile_state.freezed.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart index 9e574749..e8e4c2ba 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,21 +20,16 @@ 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) 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)? loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -42,9 +37,7 @@ 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)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -78,18 +71,16 @@ 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; @@ -99,18 +90,12 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> /// @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. @@ -128,8 +113,7 @@ 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 @@ -140,11 +124,7 @@ 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) loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -155,9 +135,7 @@ 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)? loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -168,9 +146,7 @@ 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)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -224,18 +200,14 @@ 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. @@ -253,9 +225,7 @@ 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 @@ -266,11 +236,7 @@ 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) loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -281,9 +247,7 @@ 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)? loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -294,9 +258,7 @@ 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)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -350,26 +312,21 @@ 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}); $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. @@ -420,10 +377,7 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$ProfileStateLoadedImpl implements ProfileStateLoaded { - const _$ProfileStateLoadedImpl( - {required this.profile, - required this.profileDetails, - required final List blogPosts}) + const _$ProfileStateLoadedImpl({required this.profile, required this.profileDetails, required final List blogPosts}) : _blogPosts = blogPosts; @override @@ -431,6 +385,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { @override final ProfileDetailsModel profileDetails; final List _blogPosts; + @override List get blogPosts { if (_blogPosts is EqualUnmodifiableListView) return _blogPosts; @@ -449,15 +404,12 @@ 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)); } @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)); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -465,19 +417,14 @@ 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) loaded, required TResult Function(String errorMessage) error, }) { return loaded(profile, profileDetails, blogPosts); @@ -488,9 +435,7 @@ 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)? loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(profile, profileDetails, blogPosts); @@ -501,9 +446,7 @@ 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)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -553,38 +496,35 @@ 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}) = _$ProfileStateLoadedImpl; ProfileModel get profile; + ProfileDetailsModel get profileDetails; + List get blogPosts; /// 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. @@ -620,8 +560,7 @@ 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 @@ -632,20 +571,14 @@ 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) loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -656,9 +589,7 @@ 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)? loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -669,9 +600,7 @@ 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)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -720,14 +649,12 @@ 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/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index 560266d4..a27450ce 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -1,4 +1,4 @@ -// +// // 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'; diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index fea255cc..ab457ebe 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -1,4 +1,4 @@ -// +// // 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'; diff --git a/lib/features/profile/services/profile_service.g.dart b/lib/features/profile/services/profile_service.g.dart index a7f855ff..47070f20 100644 --- a/lib/features/profile/services/profile_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -191,8 +191,7 @@ class _ProfileService implements ProfileService { } @override - Future getBlogPostByAuthorSlug( - {required String slug}) async { + Future getBlogPostByAuthorSlug({required String slug}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -225,9 +224,7 @@ class _ProfileService implements ProfileService { } 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.dart b/lib/features/recipes/models/ingredient.dart index d7a130e4..5524e744 100644 --- a/lib/features/recipes/models/ingredient.dart +++ b/lib/features/recipes/models/ingredient.dart @@ -1,7 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'ingredient.freezed.dart'; - part 'ingredient.g.dart'; @freezed diff --git a/lib/features/recipes/models/ingredient.freezed.dart b/lib/features/recipes/models/ingredient.freezed.dart index 2bf96fb3..24468f59 100644 --- a/lib/features/recipes/models/ingredient.freezed.dart +++ b/lib/features/recipes/models/ingredient.freezed.dart @@ -21,7 +21,9 @@ 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. @@ -30,26 +32,24 @@ 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,23 +80,17 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> } /// @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. @@ -127,11 +121,9 @@ class __$$IngredientImplCopyWithImpl<$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; @@ -164,8 +156,7 @@ 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() { @@ -176,18 +167,16 @@ 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; @@ -195,6 +184,5 @@ 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 b3f1844d..3d2f63b5 100644 --- a/lib/features/recipes/models/ingredient.g.dart +++ b/lib/features/recipes/models/ingredient.g.dart @@ -6,15 +6,13 @@ 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 691ac1f3..de1cbd2e 100644 --- a/lib/features/recipes/models/recipe_model.freezed.dart +++ b/lib/features/recipes/models/recipe_model.freezed.dart @@ -21,13 +21,21 @@ 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. @@ -36,15 +44,13 @@ 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, @@ -59,12 +65,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; @@ -125,11 +131,9 @@ class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> } /// @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( @@ -145,12 +149,8 @@ abstract class _$$RecipeModelImplCopyWith<$Res> } /// @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,6 +238,7 @@ class _$RecipeModelImpl implements _RecipeModel { } final List? _steps; + @override List? get steps { final value = _steps; @@ -272,42 +273,28 @@ 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() { @@ -329,25 +316,32 @@ 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; @@ -355,6 +349,5 @@ 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 d5ab9c96..ac7c7c2d 100644 --- a/lib/features/recipes/models/recipe_model.g.dart +++ b/lib/features/recipes/models/recipe_model.g.dart @@ -6,16 +6,9 @@ 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?, @@ -25,8 +18,7 @@ _$RecipeModelImpl _$$RecipeModelImplFromJson(Map json) => 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.dart b/lib/features/recipes/models/recipe_tag_model.dart index 004f4f29..11850791 100644 --- a/lib/features/recipes/models/recipe_tag_model.dart +++ b/lib/features/recipes/models/recipe_tag_model.dart @@ -1,7 +1,8 @@ -import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:eatvio_app/core/models/pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'recipe_tag_model.freezed.dart'; + part 'recipe_tag_model.g.dart'; @freezed diff --git a/lib/features/recipes/models/recipe_tag_model.freezed.dart b/lib/features/recipes/models/recipe_tag_model.freezed.dart index d9993da3..cfeff53c 100644 --- a/lib/features/recipes/models/recipe_tag_model.freezed.dart +++ b/lib/features/recipes/models/recipe_tag_model.freezed.dart @@ -22,8 +22,10 @@ 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; @@ -33,32 +35,28 @@ 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; @@ -109,31 +107,23 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> } /// @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. @@ -165,15 +155,13 @@ class __$$RecipeTagModelImplCopyWithImpl<$Res> @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 { @@ -206,17 +194,14 @@ 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() { @@ -232,15 +217,16 @@ 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; @@ -249,8 +235,7 @@ 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) { @@ -261,12 +246,16 @@ 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; @@ -276,14 +265,13 @@ 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, @@ -294,12 +282,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; @@ -340,11 +328,9 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> } /// @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( @@ -356,12 +342,8 @@ abstract class _$$RecipeTagImplCopyWith<$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. @@ -409,8 +391,7 @@ 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") @@ -440,26 +421,21 @@ 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() { @@ -471,28 +447,30 @@ 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; @@ -501,6 +479,5 @@ 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 cd387547..9a6ea20f 100644 --- a/lib/features/recipes/models/recipe_tag_model.g.dart +++ b/lib/features/recipes/models/recipe_tag_model.g.dart @@ -6,25 +6,19 @@ 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(), @@ -32,8 +26,7 @@ _$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => 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.dart b/lib/features/recipes/models/step.dart index 9c22eb76..410e397e 100644 --- a/lib/features/recipes/models/step.dart +++ b/lib/features/recipes/models/step.dart @@ -1,7 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'step.freezed.dart'; - part 'step.g.dart'; @freezed diff --git a/lib/features/recipes/models/step.freezed.dart b/lib/features/recipes/models/step.freezed.dart index 040dd5aa..a0877daa 100644 --- a/lib/features/recipes/models/step.freezed.dart +++ b/lib/features/recipes/models/step.freezed.dart @@ -21,6 +21,7 @@ Step _$StepFromJson(Map json) { /// @nodoc mixin _$Step { String? get image => throw _privateConstructorUsedError; + String? get description => throw _privateConstructorUsedError; /// Serializes this Step to a JSON map. @@ -34,19 +35,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; @@ -73,20 +74,16 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> /// @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. @@ -114,8 +111,7 @@ class __$$StepImplCopyWithImpl<$Res> 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; @@ -133,8 +129,7 @@ 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) @@ -146,8 +141,7 @@ 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() { @@ -158,13 +152,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; @@ -172,6 +166,5 @@ 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 31d97f9f..1ead263e 100644 --- a/lib/features/recipes/models/step.g.dart +++ b/lib/features/recipes/models/step.g.dart @@ -11,8 +11,7 @@ _$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 e15a1a52..a0f3d59f 100644 --- a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart +++ b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart @@ -45,6 +45,7 @@ mixin _$RecipeCreateState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -133,18 +134,16 @@ 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; @@ -154,18 +153,14 @@ class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> /// @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. @@ -183,8 +178,7 @@ 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 @@ -334,20 +328,14 @@ 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 @@ -366,9 +354,7 @@ 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 @@ -518,10 +504,9 @@ 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, @@ -546,19 +531,18 @@ 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. @@ -699,8 +683,7 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> @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)); }); } @@ -763,6 +746,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final TextEditingController youtubeLinkController; final List _stepControllers; + @override List get stepControllers { if (_stepControllers is EqualUnmodifiableListView) return _stepControllers; @@ -773,6 +757,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final XFile? recipeImage; final List _stepImages; + @override List get stepImages { if (_stepImages is EqualUnmodifiableListView) return _stepImages; @@ -781,6 +766,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _ingredients; + @override List get ingredients { if (_ingredients is EqualUnmodifiableListView) return _ingredients; @@ -789,10 +775,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); } @@ -802,6 +788,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final bool ingredientAsItems; final List _types; + @override List get types { if (_types is EqualUnmodifiableListView) return _types; @@ -810,6 +797,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _cookingTimes; + @override List get cookingTimes { if (_cookingTimes is EqualUnmodifiableListView) return _cookingTimes; @@ -818,6 +806,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _statuses; + @override List get statuses { if (_statuses is EqualUnmodifiableListView) return _statuses; @@ -844,41 +833,24 @@ 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 @@ -911,9 +883,8 @@ 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 @@ -1115,74 +1086,86 @@ 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. @@ -1218,8 +1201,7 @@ 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 @@ -1230,9 +1212,8 @@ 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 @@ -1373,14 +1354,12 @@ 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/presentation/pages/recipe_edit_screen.dart b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart index 28387374..5bae7dba 100644 --- a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart @@ -19,10 +19,12 @@ import 'package:image_picker/image_picker.dart'; // ignore: must_be_immutable class RecipeEditScreen extends StatelessWidget { final String recipeID; + const RecipeEditScreen({ required this.recipeID, super.key, }); + Widget build(BuildContext context) { if (recipeID != "0") { context.read().loadRecipeById(recipeID); diff --git a/lib/features/recipes/services/recipe_service.g.dart b/lib/features/recipes/services/recipe_service.g.dart index c32c9e8a..65636a26 100644 --- a/lib/features/recipes/services/recipe_service.g.dart +++ b/lib/features/recipes/services/recipe_service.g.dart @@ -79,11 +79,7 @@ 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; @@ -254,9 +250,7 @@ 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.dart b/lib/features/registration/models/location_model.dart index 01dbe06f..c669bdfd 100644 --- a/lib/features/registration/models/location_model.dart +++ b/lib/features/registration/models/location_model.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'location_model.freezed.dart'; + part 'location_model.g.dart'; @freezed diff --git a/lib/features/registration/models/location_model.freezed.dart b/lib/features/registration/models/location_model.freezed.dart index 95f81d60..052bc27b 100644 --- a/lib/features/registration/models/location_model.freezed.dart +++ b/lib/features/registration/models/location_model.freezed.dart @@ -21,6 +21,7 @@ LocationModel _$LocationModelFromJson(Map json) { /// @nodoc mixin _$LocationModel { List get locations => throw _privateConstructorUsedError; + @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; @@ -30,28 +31,24 @@ 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; @@ -77,25 +74,17 @@ class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> } /// @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. @@ -121,15 +110,12 @@ class __$$LocationModelImplCopyWithImpl<$Res> /// @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; @@ -151,24 +137,20 @@ 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() { @@ -179,16 +161,14 @@ 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; @@ -197,6 +177,5 @@ 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 449630a4..da69ba9b 100644 --- a/lib/features/registration/models/location_model.g.dart +++ b/lib/features/registration/models/location_model.g.dart @@ -6,15 +6,12 @@ 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/data/models/userRegistrationModel/user_registration_model.dart b/lib/features/registration/models/user_registration_model.dart similarity index 99% rename from lib/data/models/userRegistrationModel/user_registration_model.dart rename to lib/features/registration/models/user_registration_model.dart index 419ee5c7..64b9c9e5 100644 --- a/lib/data/models/userRegistrationModel/user_registration_model.dart +++ b/lib/features/registration/models/user_registration_model.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'user_registration_model.freezed.dart'; + part 'user_registration_model.g.dart'; @freezed diff --git a/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart b/lib/features/registration/models/user_registration_model.freezed.dart similarity index 88% rename from lib/data/models/userRegistrationModel/user_registration_model.freezed.dart rename to lib/features/registration/models/user_registration_model.freezed.dart index fd835a26..ed0044cc 100644 --- a/lib/data/models/userRegistrationModel/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 'user_registration_model.dart'; +part of '../../../features/registration/models/user_registration_model.dart'; // ************************************************************************** // FreezedGenerator @@ -14,8 +14,7 @@ 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); } @@ -23,48 +22,74 @@ UserRegistrationSheet _$UserRegistrationSheetFromJson( 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; @@ -74,15 +99,14 @@ 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, @@ -115,13 +139,12 @@ 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; @@ -272,12 +295,10 @@ class _$UserRegistrationSheetCopyWithImpl<$Res, } /// @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( @@ -311,13 +332,9 @@ abstract class _$$UserRegistrationSheetImplCopyWith<$Res> } /// @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. @@ -473,8 +490,7 @@ 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, @@ -498,8 +514,7 @@ 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') @@ -585,54 +600,33 @@ 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) @@ -673,9 +667,8 @@ 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() { @@ -691,8 +684,7 @@ 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, @@ -701,99 +693,119 @@ 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; @@ -802,6 +814,5 @@ 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/data/models/userRegistrationModel/user_registration_model.g.dart b/lib/features/registration/models/user_registration_model.g.dart similarity index 90% rename from lib/data/models/userRegistrationModel/user_registration_model.g.dart rename to lib/features/registration/models/user_registration_model.g.dart index 9500e915..7690dbb1 100644 --- a/lib/data/models/userRegistrationModel/user_registration_model.g.dart +++ b/lib/features/registration/models/user_registration_model.g.dart @@ -6,9 +6,7 @@ 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, @@ -35,13 +33,10 @@ _$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson( favoriteFoods: json['favorite_foods'] as String, unfavoriteFoods: json['unfavorite_foods'] as String, additionalInfo: json['additional_info'] as String, - activityCoefficient: - (json['activity_coefficient'] as num?)?.toDouble() ?? 1.2, + activityCoefficient: (json['activity_coefficient'] as num?)?.toDouble() ?? 1.2, ); -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_cubit.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart index e016a36c..89406741 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart @@ -1,7 +1,7 @@ import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_state.dart'; import 'package:eatvio_app/features/registration/repositories/registration_repository.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.dart index d1e20906..37fe0a43 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'registration_state.freezed.dart'; 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 ae0a9706..eb722a2b 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,15 +21,13 @@ 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}); @@ -37,12 +35,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; @@ -73,11 +71,10 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> } /// @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}); @@ -87,12 +84,9 @@ abstract class _$$RegistrationStateImplCopyWith<$Res> } /// @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. @@ -126,9 +120,7 @@ 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 @@ -139,14 +131,11 @@ 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; @@ -155,6 +144,5 @@ 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/presentation/pages/additional_information_screen.dart b/lib/features/registration/presentation/pages/additional_information_screen.dart index e0a4edbf..01ce3ffa 100644 --- a/lib/features/registration/presentation/pages/additional_information_screen.dart +++ b/lib/features/registration/presentation/pages/additional_information_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; diff --git a/lib/features/registration/presentation/pages/allergies_screen.dart b/lib/features/registration/presentation/pages/allergies_screen.dart index f0d4c61e..d0df3b8d 100644 --- a/lib/features/registration/presentation/pages/allergies_screen.dart +++ b/lib/features/registration/presentation/pages/allergies_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/blood_pressure_screen.dart b/lib/features/registration/presentation/pages/blood_pressure_screen.dart index 7baac4f6..8b735b00 100644 --- a/lib/features/registration/presentation/pages/blood_pressure_screen.dart +++ b/lib/features/registration/presentation/pages/blood_pressure_screen.dart @@ -1,6 +1,6 @@ import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; diff --git a/lib/features/registration/presentation/pages/body_circumferences_screen.dart b/lib/features/registration/presentation/pages/body_circumferences_screen.dart index 5078be08..0e692512 100644 --- a/lib/features/registration/presentation/pages/body_circumferences_screen.dart +++ b/lib/features/registration/presentation/pages/body_circumferences_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/city_of_living_screen.dart b/lib/features/registration/presentation/pages/city_of_living_screen.dart index b901e3b2..46a00fca 100644 --- a/lib/features/registration/presentation/pages/city_of_living_screen.dart +++ b/lib/features/registration/presentation/pages/city_of_living_screen.dart @@ -1,5 +1,5 @@ import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/credentials_screen.dart b/lib/features/registration/presentation/pages/credentials_screen.dart index 5a2c51ca..cc06048d 100644 --- a/lib/features/registration/presentation/pages/credentials_screen.dart +++ b/lib/features/registration/presentation/pages/credentials_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/date_of_birth_screen.dart b/lib/features/registration/presentation/pages/date_of_birth_screen.dart index c980111b..2270e3c6 100644 --- a/lib/features/registration/presentation/pages/date_of_birth_screen.dart +++ b/lib/features/registration/presentation/pages/date_of_birth_screen.dart @@ -1,5 +1,5 @@ import 'package:eatvio_app/core/utils/date_time_utils.dart'; -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; diff --git a/lib/features/registration/presentation/pages/favorite_foods_screen.dart b/lib/features/registration/presentation/pages/favorite_foods_screen.dart index 570f9d15..29fad0db 100644 --- a/lib/features/registration/presentation/pages/favorite_foods_screen.dart +++ b/lib/features/registration/presentation/pages/favorite_foods_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/favorite_sports_screen.dart b/lib/features/registration/presentation/pages/favorite_sports_screen.dart index 53742fc7..3a746e11 100644 --- a/lib/features/registration/presentation/pages/favorite_sports_screen.dart +++ b/lib/features/registration/presentation/pages/favorite_sports_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/gender_screen.dart b/lib/features/registration/presentation/pages/gender_screen.dart index 66549ac2..46d56da3 100644 --- a/lib/features/registration/presentation/pages/gender_screen.dart +++ b/lib/features/registration/presentation/pages/gender_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/features/registration/presentation/pages/height_screen.dart b/lib/features/registration/presentation/pages/height_screen.dart index 38a721ba..2753784a 100644 --- a/lib/features/registration/presentation/pages/height_screen.dart +++ b/lib/features/registration/presentation/pages/height_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/language_select_screen.dart b/lib/features/registration/presentation/pages/language_select_screen.dart index d1e1f885..a9c3dbb5 100644 --- a/lib/features/registration/presentation/pages/language_select_screen.dart +++ b/lib/features/registration/presentation/pages/language_select_screen.dart @@ -1,5 +1,5 @@ import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; diff --git a/lib/features/registration/presentation/pages/medicine_intake_screen.dart b/lib/features/registration/presentation/pages/medicine_intake_screen.dart index 878d418d..86e09604 100644 --- a/lib/features/registration/presentation/pages/medicine_intake_screen.dart +++ b/lib/features/registration/presentation/pages/medicine_intake_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/name_screen.dart b/lib/features/registration/presentation/pages/name_screen.dart index cebd4cd4..e92ce31a 100644 --- a/lib/features/registration/presentation/pages/name_screen.dart +++ b/lib/features/registration/presentation/pages/name_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/weight_screen.dart b/lib/features/registration/presentation/pages/weight_screen.dart index c67cfee9..622cc772 100644 --- a/lib/features/registration/presentation/pages/weight_screen.dart +++ b/lib/features/registration/presentation/pages/weight_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/repositories/registration_repository.dart b/lib/features/registration/repositories/registration_repository.dart index d609ee12..e5a32e94 100644 --- a/lib/features/registration/repositories/registration_repository.dart +++ b/lib/features/registration/repositories/registration_repository.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/models/location_model.dart'; import 'package:eatvio_app/features/registration/services/registration_service.dart'; diff --git a/lib/features/registration/services/registration_service.g.dart b/lib/features/registration/services/registration_service.g.dart index 4aaccede..50d9fd82 100644 --- a/lib/features/registration/services/registration_service.g.dart +++ b/lib/features/registration/services/registration_service.g.dart @@ -22,8 +22,7 @@ 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 = {}; @@ -129,9 +128,7 @@ 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/lib/localization/app_localization.dart b/lib/localization/app_localization.dart index b477c9a4..7390b372 100644 --- a/lib/localization/app_localization.dart +++ b/lib/localization/app_localization.dart @@ -1,5 +1,6 @@ import 'package:eatvio_app/app_router.dart'; import 'package:flutter/cupertino.dart'; + //import 'en_us/en_us_translations.dart'; import 'package:flutter/foundation.dart'; diff --git a/lib/old/auth/auth_screen/auth_screen.dart b/lib/old/auth/auth_screen/auth_screen.dart index f13d77cd..37be6818 100644 --- a/lib/old/auth/auth_screen/auth_screen.dart +++ b/lib/old/auth/auth_screen/auth_screen.dart @@ -1,4 +1,5 @@ import 'dart:convert'; + import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; @@ -12,6 +13,7 @@ import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:url_launcher/url_launcher.dart'; import 'package:validators/validators.dart'; + import 'bloc/auth_bloc.dart'; import 'models/auth_model.dart'; diff --git a/lib/old/auth/auth_screen/bloc/auth_bloc.dart b/lib/old/auth/auth_screen/bloc/auth_bloc.dart index 9d7b76a2..f75da299 100644 --- a/lib/old/auth/auth_screen/bloc/auth_bloc.dart +++ b/lib/old/auth/auth_screen/bloc/auth_bloc.dart @@ -2,6 +2,7 @@ import 'package:eatvio_app/old/auth/auth_screen/models/auth_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; + part 'auth_event.dart'; part 'auth_state.dart'; diff --git a/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart b/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart index 34900450..c1ab8e0f 100644 --- a/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart +++ b/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'diet_create_event.dart'; -part 'diet_create_state.dart'; +part 'diet_create_event.dart';part 'diet_create_state.dart'; /// A bloc that manages the state of a DietCreate according to the event that is dispatched to it. class DietCreateBloc extends Bloc { diff --git a/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart b/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart index cb0c87bf..5069b0ad 100644 --- a/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart +++ b/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'diet_edit_event.dart'; -part 'diet_edit_state.dart'; +part 'diet_edit_event.dart';part 'diet_edit_state.dart'; /// A bloc that manages the state of a DietEdit according to the event that is dispatched to it. class DietEditBloc extends Bloc { diff --git a/lib/old/diets/diet_edit_screen/diet_edit_screen.dart b/lib/old/diets/diet_edit_screen/diet_edit_screen.dart index e5b5052e..14888fcd 100644 --- a/lib/old/diets/diet_edit_screen/diet_edit_screen.dart +++ b/lib/old/diets/diet_edit_screen/diet_edit_screen.dart @@ -1,7 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart b/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart index 2c49b95f..e06469f5 100644 --- a/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart +++ b/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart @@ -13,10 +13,7 @@ import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; - - -part 'diet_select_event.dart'; -part 'diet_select_state.dart'; +part 'diet_select_event.dart';part 'diet_select_state.dart'; /// A bloc that manages the state of a DietSelect according to the event that is dispatched to it. class DietSelectBloc extends Bloc { diff --git a/lib/old/diets/diet_select_screen/diet_select_screen.dart b/lib/old/diets/diet_select_screen/diet_select_screen.dart index dd332673..9f49dd52 100644 --- a/lib/old/diets/diet_select_screen/diet_select_screen.dart +++ b/lib/old/diets/diet_select_screen/diet_select_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; - import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; diff --git a/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart b/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart index 0fd6c0c4..78ed67fd 100644 --- a/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart +++ b/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'diet_show_event.dart'; -part 'diet_show_state.dart'; +part 'diet_show_event.dart';part 'diet_show_state.dart'; /// A bloc that manages the state of a Diet according to the event that is dispatched to it. class DietBloc extends Bloc { diff --git a/lib/old/diets/diet_show_screen/diet_show_screen.dart b/lib/old/diets/diet_show_screen/diet_show_screen.dart index 84d87ced..d7132890 100644 --- a/lib/old/diets/diet_show_screen/diet_show_screen.dart +++ b/lib/old/diets/diet_show_screen/diet_show_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart b/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart index 61a8efeb..58310e30 100644 --- a/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart +++ b/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart @@ -12,10 +12,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'glossary_screen_event.dart'; -part 'glossary_screen_state.dart'; +part 'glossary_screen_event.dart';part 'glossary_screen_state.dart'; /// A bloc that manages the state of a Glossary according to the event that is dispatched to it. class GlossaryBloc extends Bloc { diff --git a/lib/old/glossary/glossary_screen/glossary_screen.dart b/lib/old/glossary/glossary_screen/glossary_screen.dart index 5a49cc2e..25122ff5 100644 --- a/lib/old/glossary/glossary_screen/glossary_screen.dart +++ b/lib/old/glossary/glossary_screen/glossary_screen.dart @@ -1,7 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; - import 'package:eatvio_app/old/glossary/glossary_screen/widgets/glossary_scroll_item.dart'; import 'package:eatvio_app/old/glossary/glossary_screen/widgets/glossary_search_widget.dart'; import 'package:eatvio_app/theme/custom_button_style.dart'; diff --git a/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart b/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart index abd758fa..1b4f5727 100644 --- a/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart +++ b/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'plan_create_event.dart'; -part 'plan_create_state.dart'; +part 'plan_create_event.dart';part 'plan_create_state.dart'; /// A bloc that manages the state of a PlanCreate according to the event that is dispatched to it. class PlanCreateBloc extends Bloc { diff --git a/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart b/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart index 55f3a9a4..d60c7df8 100644 --- a/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart +++ b/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'plan_edit_event.dart'; -part 'plan_edit_state.dart'; +part 'plan_edit_event.dart';part 'plan_edit_state.dart'; /// A bloc that manages the state of a PlanEdit according to the event that is dispatched to it. class PlanEditBloc extends Bloc { diff --git a/lib/old/plans/plan_edit_screen/plan_edit_screen.dart b/lib/old/plans/plan_edit_screen/plan_edit_screen.dart index 39d29424..40e2fd0c 100644 --- a/lib/old/plans/plan_edit_screen/plan_edit_screen.dart +++ b/lib/old/plans/plan_edit_screen/plan_edit_screen.dart @@ -1,7 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart b/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart index 6bfd7331..e471fcc5 100644 --- a/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart +++ b/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart @@ -13,10 +13,7 @@ import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; - - -part 'plan_select_event.dart'; -part 'plan_select_state.dart'; +part 'plan_select_event.dart';part 'plan_select_state.dart'; /// A bloc that manages the state of a PlanSelect according to the event that is dispatched to it. class PlanSelectBloc extends Bloc { diff --git a/lib/old/plans/plan_select_screen/plan_select_screen.dart b/lib/old/plans/plan_select_screen/plan_select_screen.dart index c75c3c98..1e7decc6 100644 --- a/lib/old/plans/plan_select_screen/plan_select_screen.dart +++ b/lib/old/plans/plan_select_screen/plan_select_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; - import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; diff --git a/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart b/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart index 82314d7e..9c7ea9ce 100644 --- a/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart +++ b/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'plan_show_event.dart'; -part 'plan_show_state.dart'; +part 'plan_show_event.dart';part 'plan_show_state.dart'; /// A bloc that manages the state of a Plan according to the event that is dispatched to it. class PlanBloc extends Bloc { diff --git a/lib/old/plans/plan_show_screen/plan_show_screen.dart b/lib/old/plans/plan_show_screen/plan_show_screen.dart index ab173bc3..a2c9649a 100644 --- a/lib/old/plans/plan_show_screen/plan_show_screen.dart +++ b/lib/old/plans/plan_show_screen/plan_show_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart b/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart index 430730a7..c51b8872 100644 --- a/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart +++ b/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:convert'; + import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; @@ -10,6 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; + part 'my_profile_event.dart'; part 'my_profile_state.dart'; diff --git a/lib/old/profile/my_profile_screen/my_profile_screen.dart b/lib/old/profile/my_profile_screen/my_profile_screen.dart index 6bc818e3..d425dd68 100644 --- a/lib/old/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/old/profile/my_profile_screen/my_profile_screen.dart @@ -8,7 +8,6 @@ import 'package:eatvio_app/localization/app_localization.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:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:fl_chart/fl_chart.dart'; diff --git a/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart b/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart index f07114d5..77866907 100644 --- a/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart +++ b/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:convert'; + import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; diff --git a/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart b/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart index 607521cc..2677c64f 100644 --- a/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart +++ b/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart @@ -5,7 +5,6 @@ import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_button_style.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; - import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; diff --git a/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart b/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart index 8ce71b7d..43cad165 100644 --- a/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart +++ b/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart @@ -1,4 +1,5 @@ import 'dart:async'; + import 'package:dio/dio.dart'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/const.dart'; diff --git a/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart b/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart index a871aa7f..10c2f8ca 100644 --- a/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart +++ b/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; - import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; diff --git a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart deleted file mode 100644 index 763f68bf..00000000 --- a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart +++ /dev/null @@ -1,197 +0,0 @@ -import 'dart:async'; -import 'dart:convert'; -import 'package:eatvio_app/app_router.dart'; -import 'package:eatvio_app/core/const.dart'; -import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; -import 'package:eatvio_app/old/recipe/recipe_show_screen/models/recipe_show_model.dart'; -import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:go_router/go_router.dart'; -import 'package:http/http.dart' as http; -import 'package:intl/intl.dart'; -part 'recipe_show_event.dart'; -part 'recipe_show_state.dart'; - -/// A bloc that manages the state of a Recipe according to the event that is dispatched to it. -class RecipeBloc extends Bloc { - RecipeBloc(RecipeState initialState) : super(initialState) { - on(_onInitialize); - on(_deleteEntry); - on(_createComment); - } - - _onInitialize( - RecipeInitialEvent event, - Emitter emit, - ) async { - try { - if (!await TokenStorage.haveTokenInStorage()) { - AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); - } - final String? recipeID = state.recipeModelObj?.recipeID; - final response = await http.get( - Uri.parse(baseUrl + '/api/recipes/show/$recipeID'), - headers: { - 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', - }, - ); - if (response.statusCode == 200) { - final data = jsonDecode(response.body); - if (data is Map) { - if (state is RecipeLoadedState) { - var currentState = state as RecipeLoadedState; - emit( - currentState.copyWith( - recipeModelObj: currentState.recipeModelObj, - recipe: currentState.recipe, - token: currentState.token, - commentController: currentState.commentController, - comments: currentState.comments, - steps: currentState.steps, - author: currentState.author, - ), - ); - } else { - emit( - RecipeLoadedState( - token: await TokenStorage.getTokenFromStorage(), - recipe: data, - steps: data['steps'], - author: await _fetchAuthor(data['id']), - comments: fillCommentList(await _fetchComments(data['id'])), - tags: await _fetchTags(data['id']), - commentController: TextEditingController(), - ), - ); - } - } else { - // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку - emit(RecipeErrorState('Некоторые необходимые данные отсутствуют.')); - } - } else { - // Статус ответа не равен 200, обрабатываем ошибку - emit(RecipeErrorState('Ошибка сервера: ${response.statusCode}')); - } - } catch (e) { - // Ошибка при декодировании JSON или другая ошибка выполнения - emit(RecipeErrorState('Ошибка при получении данных о чатах: $e')); - } - } - - FutureOr _deleteEntry(DeleteEntry event, Emitter emit) async { - if (!await TokenStorage.haveTokenInStorage()) { - AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); - } - final int id = event.id; - final response = await http.post( - Uri.parse(baseUrl + '/api/recipes/delete/$id'), - headers: { - 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', - }, - ); - if (response.statusCode == 200) { - AppRouter.navigatorKey.currentContext?.goNamed('recipeSelectScreen'); - } else { - // Статус ответа не равен 200, обрабатываем ошибку - emit(RecipeErrorState('Ошибка: ${response.statusCode}')); - } - } - - FutureOr _createComment(CreateComment event, Emitter emit) async { - if (state is RecipeLoadedState) { - var currentState = state as RecipeLoadedState; - // Отправляем данные по HTTP маршруту и ждем ответ - var response = await _sendCommentData(currentState.token, event.body, currentState.recipe?['id']); - if (response.statusCode == 200) { - var updatedComments = fillCommentList(await _fetchComments(currentState.recipe?['id'])); - var updatedState = currentState.copyWith( - comments: updatedComments, - commentController: TextEditingController(), // Clear the comment input field - ); - emit(updatedState); // Emit the updated state to trigger a screen update - } - } - } - - _fetchAuthor(int id) async { - if (!await TokenStorage.haveTokenInStorage()) { - AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); - } - - final response = await http.get( - Uri.parse(baseUrl + '/api/recipes/getAuthor/$id'), - headers: { - 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', - }, - ); - final data = jsonDecode(response.body); - return data; - } - - Future _fetchComments(int id) async { - if (!await TokenStorage.haveTokenInStorage()) { - AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); - } - final response = await http.get( - Uri.parse(baseUrl + '/api/recipes/getComments/$id'), - headers: { - 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', - }, - ); - final data = jsonDecode(response.body); - return data; - } - - _fetchTags(int id) async { - if (!await TokenStorage.haveTokenInStorage()) { - AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); - } - - final response = await http.get( - Uri.parse(baseUrl + '/api/recipes/getTags/$id'), - headers: { - 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', - }, - ); - final data = jsonDecode(response.body); - return data; - } - - List fillCommentList(List comments) { - List list = []; - for (int i = 0; i < comments.length; i++) { - list.add( - CommentModel( - id: comments[i]['id'].toString(), - userImage: comments[i]['profile_photo_path'], - username: comments[i]['name'], - dateText: DateFormat('dd.MM').format(DateTime.parse(comments[i]['updated_at'])), - greetingText: comments[i]['body'], - ), - ); - } - return list; - } - - Future _sendCommentData(String? token, String body, int id) async { - String url = baseUrl + '/api/recipes/createComment/$id'; - final Map credentials = { - 'id': id, - 'body': body, - }; - - var response = await http.post( - Uri.parse(url), - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer $token', - }, - body: json.encode(credentials), - encoding: utf8, - ); - - return response; - } -} diff --git a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_event.dart b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_event.dart deleted file mode 100644 index f2e71b7b..00000000 --- a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_event.dart +++ /dev/null @@ -1,34 +0,0 @@ -// ignore_for_file: must_be_immutable - -part of 'recipe_show_bloc.dart'; - -/// Abstract class for all events that can be dispatched from the -///Recipe widget. -/// -/// Events must be immutable and implement the [Equatable] interface. -@immutable -abstract class RecipeEvent extends Equatable {} - -/// Event that is dispatched when the Recipe widget is first created. -class RecipeInitialEvent extends RecipeEvent { - @override - List get props => []; -} - -class DeleteEntry extends RecipeEvent { - DeleteEntry(this.id); - - final int id; - - @override - List get props => [id]; -} - -class CreateComment extends RecipeEvent { - CreateComment(this.body); - - final String body; - - @override - List get props => [body]; -} diff --git a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_state.dart b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_state.dart deleted file mode 100644 index 0b7b2e83..00000000 --- a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_state.dart +++ /dev/null @@ -1,91 +0,0 @@ -// ignore_for_file: must_be_immutable - -part of 'recipe_show_bloc.dart'; - -/// Represents the state of Recipe in the application. -/// - -class RecipeState extends Equatable { - RecipeState({ - this.recipeModelObj, - }); - - RecipeModel? recipeModelObj; - - @override - List get props => [recipeModelObj]; - - RecipeState copyWith({RecipeModel? recipeModelObj}) { - return RecipeState( - recipeModelObj: recipeModelObj ?? this.recipeModelObj, - ); - } -} - -class RecipeLoadedState extends RecipeState { - RecipeLoadedState({ - this.recipeModelObj, - this.recipe, - this.author, - this.comments, - this.token, - this.commentController, - this.tags, - this.steps, - }); - - RecipeModel? recipeModelObj; - Map? recipe; - Map? author; - List? comments; - TextEditingController? commentController; - List? steps; - List? tags; - String? token; - - @override - List get props => [ - recipeModelObj, - recipe, - author, - comments, - token, - commentController, - steps, - ]; - - RecipeLoadedState copyWith({ - RecipeModel? recipeModelObj, - Map? recipe, - Map? author, - TextEditingController? commentController, - String? token, - List? tags, - List? steps, - List? comments, - }) { - return RecipeLoadedState( - recipeModelObj: recipeModelObj ?? this.recipeModelObj, - recipe: recipe ?? this.recipe, - author: author ?? this.author, - tags: tags ?? this.tags, - token: token ?? this.token, - commentController: commentController ?? this.commentController, - steps: steps ?? this.steps, - comments: comments ?? this.comments, - ); - } -} - -class RecipeErrorState extends RecipeState { - final String errorMessage; - - RecipeErrorState(this.errorMessage); - - @override - List get props => [errorMessage]; -} - -class RecipeInitialState extends RecipeState { - RecipeInitialState({required RecipeModel recipeModelObj}) : super(recipeModelObj: recipeModelObj); -} diff --git a/lib/old/recipe/recipe_show_screen/models/recipe_show_model.dart b/lib/old/recipe/recipe_show_screen/models/recipe_show_model.dart deleted file mode 100644 index 1786388e..00000000 --- a/lib/old/recipe/recipe_show_screen/models/recipe_show_model.dart +++ /dev/null @@ -1,19 +0,0 @@ -// ignore_for_file: must_be_immutable - -import 'package:equatable/equatable.dart'; - -/// This class defines the variables used in the [recipe_screen], -/// and is typically used to hold data that is passed between different parts of the application. - -class RecipeModel extends Equatable { - final String recipeID; - - RecipeModel({required String recipeID}) : recipeID = recipeID; - - RecipeModel copyWith(String recipeID) { - return RecipeModel(recipeID: recipeID); - } - - @override - List get props => [recipeID]; -} diff --git a/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart b/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart deleted file mode 100644 index 688e73c0..00000000 --- a/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart +++ /dev/null @@ -1,480 +0,0 @@ -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/const.dart'; -import 'package:eatvio_app/core/utils/image_constant.dart'; - -import 'package:eatvio_app/old/feed/blog_post_screen/widgets/comment_widget.dart'; -import 'package:eatvio_app/theme/app_decoration.dart'; -import 'package:eatvio_app/theme/custom_button_style.dart'; -import 'package:eatvio_app/theme/custom_text_style.dart'; -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; -import 'package:eatvio_app/widgets/custom_image_view.dart'; -import 'package:eatvio_app/widgets/custom_outlined_button.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:go_router/go_router.dart'; -import 'package:intl/intl.dart'; - -import 'bloc/recipe_show_bloc.dart'; -import 'models/recipe_show_model.dart'; - -class RecipeScreen extends StatelessWidget { - const RecipeScreen({Key? key}) : super(key: key); - - static Widget builder(BuildContext context) { - final recipeID = ModalRoute.of(context)!.settings.arguments; - return BlocProvider( - create: (context) => RecipeBloc(RecipeState(recipeModelObj: RecipeModel(recipeID: recipeID.toString())))..add(RecipeInitialEvent()), - child: RecipeScreen(), - ); - } - - Widget build(BuildContext context) { - return BlocBuilder( - builder: (context, state) { - if (state is RecipeInitialState) { - // Это начальное состояние, данные ещё не загружены. - return Container( - color: Colors.white, - ); - } else if (state is RecipeLoadedState) { - // Данные загружены, можно строить экран. - return _buildRecipe(context, state); - } else if (state is RecipeErrorState) { - // Произошла ошибка при загрузке данных. - return Center(child: Text(state.errorMessage)); - } else { - // Другие состояния, если они есть. - return Container(); // Пустой контейнер для необработанных состояний. - } - }, - ); - } - - _buildRecipe(BuildContext context, RecipeLoadedState state) { - List steps = []; - if (state.steps != null) { - for (int i = 0; i < state.steps!.length; i++) { - steps.add(_buildStep(context, state, i)); - } - } - return Scaffold( - appBar: AppBar( - toolbarHeight: 0, - automaticallyImplyLeading: false, - ), - resizeToAvoidBottomInset: false, - body: Container( - width: double.maxFinite, - decoration: AppDecoration.fillGray, - child: ListView( - children: [ - SizedBox(height: 15), - _buildHeaderRow(context, state), - SizedBox(height: 15), - _buildRecipeData(context, state), - SizedBox(height: 15), - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: steps, - ), - SizedBox(height: 15), - _buildTextField(context, state), - SizedBox(height: 15), - _buildCommentSection(context, state), - ], - ), - ), - ); - } - - _buildHeaderRow(BuildContext context, RecipeLoadedState state) { - final String name = state.author?['name']; - return Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - padding: EdgeInsets.symmetric( - horizontal: 24, - vertical: 12, - ), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - CustomImageView( - imagePath: ImageConstant.imgArrowLeft, - onTap: () => GoRouter.of(context).pop(), - ), - Padding( - padding: EdgeInsets.only(top: 1), - child: Row( - children: [ - Align( - alignment: Alignment.centerRight, - child: Text( - "$name", - style: CustomTextStyles.titleMediumBlack, - ), - ), - CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + (state.author?['profile_photo_path'] ?? ''), - imageBuilder: (context, imageProvider) => CircleAvatar( - backgroundImage: imageProvider, - radius: 25, - ), - placeholder: (context, url) => CircularProgressIndicator(), - errorWidget: (context, url, error) => CircleAvatar( - child: Icon(Icons.person), - backgroundColor: Colors.white, - radius: 25, - ), - ), - ], - ), - ), - ], - ), - ); - } - - _buildRecipeData(BuildContext context, RecipeLoadedState state) { - return Container( - margin: EdgeInsets.only( - left: 16, - right: 20, - bottom: 10, - ), - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - children: [ - Text( - state.recipe?['title'], - style: CustomTextStyles.titleMediumBlack, - ), - Spacer(), - PopupMenuButton( - onSelected: (value) => tapMenu(value, context, state), - itemBuilder: (BuildContext context) => >[ - PopupMenuItem( - value: 'edit', - child: Text('Редактировать'), - ), - PopupMenuItem( - value: 'delete', - child: Text('Удалить'), - ), - ], - ), - ], - ), - SizedBox(height: 8.0), - _buildImage(state), - SizedBox(height: 16.0), - Text( - state.recipe?['description'], - style: CustomTextStyles.bodyMediumBluegray800, - ), - SizedBox(height: 16.0), - Align( - alignment: Alignment.topLeft, - child: Text( - DateFormat('dd.MM.yyyy').format(DateTime.parse(state.recipe?['updated_at'])), - style: theme.textTheme.bodyMedium, - ), - ), - SizedBox(height: 16.0), - _buildTags(state.tags), - SizedBox(height: 16.0), - Row( - children: [ - Padding( - padding: EdgeInsets.only(left: 24), - child: Row( - children: [ - Padding( - padding: EdgeInsets.only(right: 8), - child: Icon(Icons.favorite_outline), - ), - Text( - "Нравится", - style: CustomTextStyles.titleMediumSemiBold, - ), - ], - ), - ), - Spacer(), - Padding( - padding: EdgeInsets.only(right: 24), - child: Row( - children: [ - Padding( - padding: const EdgeInsets.only(right: 8), - child: Icon(Icons.share_outlined), - ), - Text( - "Поделиться", - style: CustomTextStyles.titleMediumSemiBold, - ), - ], - ), - ), - ], - ), - ], - ), - ); - } - - _buildTags(List? tags) { - return Wrap( - spacing: 8.0, - runSpacing: 4.0, - children: tags!.map((tag) { - return Chip( - label: Text(tag['name']), - ); - }).toList(), - ); - } - - _buildImage(RecipeLoadedState state) { - return CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + (state.recipe?['image'] ?? ''), - imageBuilder: (context, imageProvider) => Stack( - children: [ - ClipRRect( - borderRadius: const BorderRadius.all(Radius.circular(8.0)), - child: Image( - image: imageProvider, - ), - ), - Positioned( - bottom: 0, - left: 0, - right: 0, - child: Container( - padding: EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.only(left: 48.0), - child: Row( - children: [ - Icon( - Icons.remove_red_eye, - color: Colors.white, - ), - SizedBox(width: 4.0), - Text( - '24', - style: TextStyle(color: Colors.white), - ), - ], - ), - ), - Row( - children: [ - Icon( - Icons.favorite, - color: Colors.white, - ), - SizedBox(width: 4.0), - Text( - '24', - style: TextStyle(color: Colors.white), - ), - ], - ), - Padding( - padding: const EdgeInsets.only(right: 48.0), - child: Row( - children: [ - Icon( - Icons.comment_outlined, - color: Colors.white, - ), - SizedBox(width: 4.0), - Text( - '${state.comments?.length}', - style: TextStyle(color: Colors.white), - ), - ], - ), - ), - ], - ), - ), - ), - ], - ), - placeholder: (context, url) => CircularProgressIndicator(), - ); - } - - void tapMenu(String value, BuildContext context, RecipeLoadedState state) { - if (value == 'edit') { - GoRouter.of(context).goNamed( - 'recipeEditScreen', - extra: state.recipe?['id'].toString(), - ); - } else if (value == 'delete') { - context.read().add(DeleteEntry(state.recipe?['id'])); - } - } - - _buildTextField(BuildContext context, RecipeLoadedState state) { - return Container( - margin: EdgeInsets.only( - left: 16, - right: 20, - bottom: 10, - ), - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Column( - children: [ - CustomTextFormField( - controller: state.commentController, - maxLines: 4, - ), - SizedBox(height: 15), - CustomOutlinedButton( - text: "Оставить отзыв", - margin: EdgeInsets.only(bottom: 5), - buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - decoration: BoxDecoration( - color: Colors.transparent, - ), - onPressed: () => context.read().add(CreateComment(state.commentController!.text)), - // Установите прозрачный фон - ), - ], - ), - ], - ), - ); - } - - _buildCommentSection(BuildContext context, RecipeLoadedState state) { - if (state.comments != null && state.comments!.isNotEmpty) { - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - for (int i = 0; i < state.comments!.length; i++) - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - CommentWidget(state.comments![i]), - SizedBox(height: 10.0), // Separator - ], - ), - ], - ); - } else { - // Return a message or placeholder widget when there are no comments - return Column( - children: [ - Center( - child: Text('No comments available'), - ), - SizedBox( - height: 20, - ), - ], - ); - } - } - - /// Navigates to the previous screen. - onTapArrowleftone(BuildContext context) { - GoRouter.of(context).pop(); - } - - Widget _buildStep(BuildContext context, RecipeLoadedState state, int i) { - return Container( - margin: EdgeInsets.only( - left: 16, - right: 16, - bottom: 10, - ), - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Align( - alignment: Alignment.centerLeft, - child: Text( - "Шаг ${i + 1}", - style: CustomTextStyles.titleMediumSemiBold, - ), - ), - SizedBox(height: 16.0), - CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + (state.steps?[i]['image']), - width: double.infinity, - // Установите ширину равной ширине родительского элемента - height: 200.0, - // Задайте постоянную высоту элемента - fit: BoxFit.cover, - placeholder: (context, url) => CircularProgressIndicator(), - errorWidget: (context, url, error) => Icon(Icons.error), - ), - SizedBox(height: 16.0), - Text(state.steps?[i]['description']), - ], - ), - ); - } -} diff --git a/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart b/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart deleted file mode 100644 index 1ff8e7b8..00000000 --- a/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart +++ /dev/null @@ -1,101 +0,0 @@ -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/const.dart'; -import 'package:eatvio_app/core/utils/image_constant.dart'; -import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; -import 'package:eatvio_app/theme/custom_text_style.dart'; -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/custom_image_view.dart'; -import 'package:flutter/material.dart'; - -class CommentWidget extends StatelessWidget { - const CommentWidget(this.commentModelObj); - - final CommentModel commentModelObj; - - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only( - left: 16, - right: 20, - bottom: 10, - ), - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, // Move the main axis alignment to space between - crossAxisAlignment: CrossAxisAlignment.center, // Center the items vertically - children: [ - CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + commentModelObj.userImage!, - imageBuilder: (context, imageProvider) => CircleAvatar( - backgroundImage: imageProvider, - radius: 25, - ), - placeholder: (context, url) => CircularProgressIndicator(), - errorWidget: (context, url, error) => CircleAvatar( - child: Icon(Icons.person), - backgroundColor: Colors.white, - radius: 25, - ), - ), - Expanded( - child: Padding( - padding: EdgeInsets.only( - left: 12, - top: 2, - bottom: 11, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - width: 227, - child: Row( - children: [ - Text( - commentModelObj.username!.length <= 15 ? commentModelObj.username! : commentModelObj.username!.substring(0, 15) + '...', - style: theme.textTheme.titleMedium, - ), - Spacer(), - Padding( - padding: EdgeInsets.only(left: 6), - child: Text( - commentModelObj.dateText!, - style: theme.textTheme.bodyMedium, - ), - ), - ], - ), - ), - SizedBox(height: 6), - Text( - commentModelObj.greetingText!, - style: CustomTextStyles.bodyMediumBluegray800, - ), - ], - ), - ), - ), - CustomImageView( - imagePath: ImageConstant.imgSend, - height: 30, - width: 30, - margin: EdgeInsets.only(left: 5), - ), - ], - ), - ); - } -} diff --git a/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart b/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart index e0087256..a72d6554 100644 --- a/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart +++ b/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart @@ -1,6 +1,7 @@ //import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'dart:async'; import 'dart:convert'; + import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; @@ -10,6 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; + part 'subscribers_event.dart'; part 'subscribers_state.dart'; diff --git a/lib/old/users/subscribers_screen/subscribers_screen.dart b/lib/old/users/subscribers_screen/subscribers_screen.dart index cf1210fd..55cccb9b 100644 --- a/lib/old/users/subscribers_screen/subscribers_screen.dart +++ b/lib/old/users/subscribers_screen/subscribers_screen.dart @@ -1,8 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; - -import 'package:eatvio_app/old/feed/feed_screen/widgets/feed_search_view.dart'; import 'package:eatvio_app/theme/custom_button_style.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; @@ -126,9 +124,6 @@ class SubscribersScreen extends StatelessWidget { padding: const EdgeInsets.all(12.0), child: Column( children: [ - CustomSearchView( - hintText: "Поиск", - ), SizedBox(height: 10), Row( children: [ diff --git a/lib/widgets/app_bar/appbar_title_circleimage.dart b/lib/widgets/app_bar/appbar_title_circleimage.dart deleted file mode 100644 index 3bf6925e..00000000 --- a/lib/widgets/app_bar/appbar_title_circleimage.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:eatvio_app/theme/app_decoration.dart'; -import 'package:eatvio_app/widgets/custom_image_view.dart'; -import 'package:flutter/material.dart'; - -class AppbarTitleCircleimage extends StatelessWidget { - const AppbarTitleCircleimage({ - this.imagePath, - this.margin, - }); - - final String? imagePath; - final EdgeInsetsGeometry? margin; - - @override - Widget build(BuildContext context) { - return InkWell( - borderRadius: BorderRadiusStyle.circleBorder8, - child: Padding( - padding: margin ?? EdgeInsets.zero, - child: CustomImageView( - imagePath: imagePath, - height: 40, - width: 40, - fit: BoxFit.contain, - radius: BorderRadius.circular( - 20, - ), - ), - ), - ); - } -} diff --git a/lib/widgets/app_bar/exit_button.dart b/lib/widgets/app_bar/exit_button.dart deleted file mode 100644 index 04cd6eac..00000000 --- a/lib/widgets/app_bar/exit_button.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:eatvio_app/theme/custom_text_style.dart'; -import 'package:flutter/material.dart'; - -class ExitButton extends StatelessWidget { - const ExitButton({ - required this.text, - this.margin, - this.onTap, - }); - - final String text; - final EdgeInsetsGeometry? margin; - final Function? onTap; - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: onTapCall, - child: Padding( - padding: margin ?? EdgeInsets.zero, - child: Text( - text, - style: CustomTextStyles.titleSmallRed200.copyWith( - color: Colors.red, - ), - ), - ), - ); - } - - void onTapCall() { - onTap!.call(); - } -} diff --git a/lib/widgets/chart_axis.dart b/lib/widgets/chart_axis.dart deleted file mode 100644 index f137c6d3..00000000 --- a/lib/widgets/chart_axis.dart +++ /dev/null @@ -1,145 +0,0 @@ -/*import 'package:flutter/material.dart'; -import 'package:fl_chart/fl_chart.dart'; - -buildChart( - BuildContext context, List chartPoints, List? dates) { -// Определение осей графика - List spots = []; - for (int i = 0; i < 4; i++) { - spots.add( - FlSpot((i * 10 / 10) + 1, chartPoints[i]), - ); - } - - Widget bottomTitleWidgets( - double value, TitleMeta meta, double chartWidth, List? dates) { - if (value % 1 != 0) { - return Container(); - } - final style = TextStyle( - color: Colors.blue, - fontWeight: FontWeight.bold, - fontSize: min(13, 13 * chartWidth / 300), - ); - int index = value.toInt(); - if (index >= 0 && index < dates!.length) { - // Проверка на допустимый индекс в массиве dates - String formattedDate = - DateFormat('dd.MM').format(DateTime.parse(dates[index])); - return SideTitleWidget( - axisSide: meta.axisSide, - space: 16, - child: Text(formattedDate, style: style), - ); - } else { - return Container(); - } - } - - Widget leftTitleWidgets(double value, TitleMeta meta, double chartWidth) { - final style = TextStyle( - color: Colors.blue, - fontWeight: FontWeight.bold, - fontSize: min(18, 18 * chartWidth / 300), - ); - return SideTitleWidget( - axisSide: meta.axisSide, - space: 16, - child: Text(meta.formattedValue, style: style), - ); - } - - return Padding( - padding: const EdgeInsets.only( - left: 12, - right: 20, - ), - child: AspectRatio( - aspectRatio: 1, - child: LayoutBuilder( - builder: (context, constraints) { - return LineChart( - LineChartData( - lineTouchData: LineTouchData( - touchTooltipData: LineTouchTooltipData( - maxContentWidth: 100, - tooltipBgColor: Colors.black, - getTooltipItems: mapSpots(), - ), - handleBuiltInTouches: true, - getTouchLineStart: (data, index) => 0, - ), - lineBarsData: [ - LineChartBarData( - color: Colors.pink, - spots: spots, - isCurved: true, - isStrokeCapRound: true, - barWidth: 3, - belowBarData: BarAreaData( - show: false, - ), - dotData: const FlDotData(show: false), - ), - ], - minY: chartPoints.reduce( - (value, element) => value < element ? value : element), - maxY: chartPoints.reduce( - (value, element) => value > element ? value : element), - minX: 1, - maxX: 4, - titlesData: FlTitlesData( - leftTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - getTitlesWidget: (value, meta) => - leftTitleWidgets(value, meta, constraints.maxWidth), - reservedSize: 56, - ), - drawBelowEverything: true, - ), - rightTitles: const AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - bottomTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - getTitlesWidget: (value, meta) => bottomTitleWidgets( - value, meta, constraints.maxWidth, dates), - reservedSize: 36, - interval: 1, - ), - drawBelowEverything: true, - ), - topTitles: const AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - ), - gridData: FlGridData( - show: true, - drawHorizontalLine: true, - drawVerticalLine: true, - horizontalInterval: 1.5, - verticalInterval: 5, - checkToShowHorizontalLine: valuteToInt(), - getDrawingHorizontalLine: (_) => FlLine( - color: Colors.blue.withOpacity(1), - dashArray: [8, 2], - strokeWidth: 0.8, - ), - getDrawingVerticalLine: (_) => FlLine( - color: Colors.blue.withOpacity(1), - dashArray: [8, 2], - strokeWidth: 0.8, - ), - checkToShowVerticalLine: valuteToInt(), - ), - borderData: FlBorderData(show: false), - ), - ); - }, - ), - ), - ); -} -*/ diff --git a/lib/widgets/chart_bars.dart b/lib/widgets/chart_bars.dart deleted file mode 100644 index eac9e99c..00000000 --- a/lib/widgets/chart_bars.dart +++ /dev/null @@ -1,79 +0,0 @@ -/*import 'package:flutter/material.dart'; -import 'package:fl_chart/fl_chart.dart'; - -void main() { - runApp(MyApp()); -} - -class MyApp extends StatelessWidget { - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: Text('Nutrition Chart'), - ), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - height: 300, - width: 300, - child: BarChart( - BarChartData( - barTouchData: BarTouchData(enabled: false), - titlesData: FlTitlesData( - show: true, - bottomTitles: SideTitles( - showTitles: true, - getTextStyles: (value) => - const TextStyle(color: Colors.black, fontSize: 14), - margin: 10, - showTitles: (double value) { - switch (value.toInt()) { - case 0: - return 'Calories'; - case 1: - return 'Protein'; - case 2: - return 'Fat'; - case 3: - return 'Carbs'; - default: - return ''; - } - }, - ), - leftTitles: SideTitles(showTitles: false), - ), - borderData: FlBorderData(show: false), - barGroups: [ - BarChartGroupData(x: 0, barRods: [ - BarChartRodData(y: 200, color: Colors.blue), - BarChartRodData(y: 150, color: Colors.blueAccent), - ]), - BarChartGroupData(x: 1, barRods: [ - BarChartRodData(y: 50, color: Colors.red), - BarChartRodData(y: 60, color: Colors.deepOrange), - ]), - BarChartGroupData(x: 2, barRods: [ - BarChartRodData(y: 80, color: Colors.green), - BarChartRodData(y: 70, color: Colors.lightGreen), - ]), - BarChartGroupData(x: 3, barRods: [ - BarChartRodData(y: 100, color: Colors.orange), - BarChartRodData(y: 120, color: Colors.orangeAccent), - ]), - ], - ), - ), - ), - ], - ), - ), - ), - ); - } -} -*/ diff --git a/lib/widgets/custom_autocomplete.dart b/lib/widgets/custom_autocomplete.dart deleted file mode 100644 index 66e042dc..00000000 --- a/lib/widgets/custom_autocomplete.dart +++ /dev/null @@ -1,80 +0,0 @@ -/* -class CustomTextFormField extends StatelessWidget { - // ... - - final AutocompleteOptions autocompleteOptions; - - const CustomTextFormField({ - // ... (остальные параметры) - required this.autocompleteOptions, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return alignment != null - ? Align( - alignment: alignment ?? Alignment.center, - child: autocompleteFieldWidget, - ) - : autocompleteFieldWidget; - } - - Widget get autocompleteFieldWidget => SizedBox( - width: width ?? double.maxFinite, - child: Autocomplete( - optionsBuilder: (TextEditingValue textEditingValue) { - if (textEditingValue.text == '') { - return const Iterable.empty(); - } - return autocompleteOptions.options.where((String option) { - return option - .toLowerCase() - .contains(textEditingValue.text.toLowerCase()); - }); - }, - onSelected: (String value) { - controller?.text = value; - onChanged?.call(value); - }, - fieldViewBuilder: (BuildContext context, - TextEditingController textEditingController, - FocusNode focusNode, - VoidCallback onFieldSubmitted) { - return TextFormField( - controller: textEditingController, - focusNode: focusNode, - autofocus: autofocus!, - style: textStyle ?? theme.textTheme.titleMedium, - obscureText: obscureText!, - textInputAction: textInputAction, - maxLines: maxLines ?? 1, - decoration: decoration, - validator: validator, - keyboardType: keyboardType, - onSaved: onSaved, - onChanged: onChanged, - inputFormatters: inputFormatters, - initialValue: initialValue, - onFieldSubmitted: (_) => onFieldSubmitted(), - ); - }, - optionsViewBuilder: (BuildContext context, - AutocompleteOnSelected onSelected, - Iterable options) { - return Material( - elevation: 4.0, - child: ListView( - children: options.map((String option) { - return ListTile( - title: Text(option), - onTap: () { - onSelected(option); - }, - ); - }).toList(), - ), - ); - }, - ), - ); -}*/ diff --git a/lib/widgets/custom_expandable_list.dart b/lib/widgets/custom_expandable_list.dart index e6f3878a..5f208327 100644 --- a/lib/widgets/custom_expandable_list.dart +++ b/lib/widgets/custom_expandable_list.dart @@ -1,4 +1,5 @@ import 'dart:convert'; + import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/localization/app_localization.dart'; diff --git a/lib/widgets/custom_icon_button.dart b/lib/widgets/custom_icon_button.dart deleted file mode 100644 index d029004a..00000000 --- a/lib/widgets/custom_icon_button.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'package:flutter/material.dart'; - -class CustomIconButton extends StatelessWidget { - CustomIconButton({ - Key? key, - this.alignment, - this.height, - this.width, - this.padding, - this.decoration, - this.child, - this.onTap, - }) : super(key: key); - - final Alignment? alignment; - final double? height; - final double? width; - final EdgeInsetsGeometry? padding; - final BoxDecoration? decoration; - final Widget? child; - final VoidCallback? onTap; - - @override - Widget build(BuildContext context) { - return alignment != null - ? Align( - alignment: alignment ?? Alignment.center, - child: _buildIconButtonWidget(), - ) - : _buildIconButtonWidget(); - } - - _buildIconButtonWidget() { - return SizedBox( - height: height ?? 0, - width: width ?? 0, - child: IconButton( - padding: EdgeInsets.zero, - icon: Container( - height: height ?? 0, - width: width ?? 0, - padding: padding ?? EdgeInsets.zero, - decoration: decoration ?? - BoxDecoration( - color: Colors.black, - borderRadius: const BorderRadius.all(Radius.circular(9)), - border: const Border.fromBorderSide( - BorderSide(color: Colors.blueGrey, width: 1), - ), - ), - child: child, - ), - onPressed: onTap, - ), - ); - } -} - -/// Extension on [CustomIconButton] to facilitate inclusion of all types of border style etc -extension IconButtonStyleHelper on CustomIconButton { - static BoxDecoration get fillBlueA => BoxDecoration( - color: Colors.blue, - borderRadius: const BorderRadius.all(Radius.circular(14)), - ); -} diff --git a/lib/widgets/custom_navigation_menu_item.dart b/lib/widgets/custom_navigation_menu_item.dart deleted file mode 100644 index 44522866..00000000 --- a/lib/widgets/custom_navigation_menu_item.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/custom_image_view.dart'; -import 'package:flutter/material.dart'; - -class MenuItem extends StatelessWidget { - final String icon; - final String text; - final VoidCallback onTap; - - const MenuItem({ - required this.icon, - required this.text, - required this.onTap, - }); - - @override - Widget build(BuildContext context) { - return InkWell( - onTap: onTap, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, // Выравнивание по центру вертикально - children: [ - CustomImageView( - color: appTheme.blueA400, - imagePath: icon, - height: 24.0, - width: 24.0, - ), - SizedBox( - width: 8.0, - ), // Добавляем небольшой отступ между иконкой и текстом - Text(text), - ], - ), - ), - ); - } -} diff --git a/lib/widgets/nutrition_chart.dart b/lib/widgets/nutrition_chart.dart deleted file mode 100644 index 05332f15..00000000 --- a/lib/widgets/nutrition_chart.dart +++ /dev/null @@ -1,89 +0,0 @@ -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/base_button.dart'; -import 'package:flutter/material.dart'; - -class NextStepButton extends BaseButton { - NextStepButton({ - Key? key, - this.decoration, - this.leftIcon, - this.rightIcon, - this.label, - VoidCallback? onPressed, - ButtonStyle? buttonStyle, - TextStyle? buttonTextStyle, - bool? isDisabled, - Alignment? alignment, - double? height, - double? width, - EdgeInsets? margin, - required String text, - }) : super( - text: text, - onPressed: onPressed, - buttonStyle: buttonStyle, - isDisabled: isDisabled, - buttonTextStyle: buttonTextStyle, - height: height, - alignment: alignment, - width: width, - margin: margin, - ); - - final BoxDecoration? decoration; - final Widget? leftIcon; - final Widget? rightIcon; - final Widget? label; - - @override - Widget build(BuildContext context) { - return (alignment != null) - ? Align( - alignment: alignment!, - child: Container( - height: this.height ?? 30, - width: this.width ?? double.maxFinite, - margin: margin, - decoration: decoration, - child: OutlinedButton( - style: buttonStyle, - onPressed: isDisabled ?? false ? null : onPressed ?? () {}, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - leftIcon ?? const SizedBox.shrink(), - Text( - text, - style: buttonTextStyle ?? theme.textTheme.titleSmall, - ), - rightIcon ?? const SizedBox.shrink(), - ], - ), - ), - ), - ) - : Container( - height: this.height ?? 30, - width: this.width ?? double.maxFinite, - margin: margin, - decoration: decoration, - child: OutlinedButton( - style: buttonStyle, - onPressed: isDisabled ?? false ? null : onPressed ?? () {}, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - leftIcon ?? const SizedBox.shrink(), - Text( - text, - style: buttonTextStyle ?? theme.textTheme.titleSmall, - ), - rightIcon ?? const SizedBox.shrink(), - ], - ), - ), - ); - } -}