From 904adbba2fec878f14d9dbee763def394b705bcd Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 2 Aug 2024 11:52:10 +0300 Subject: [PATCH] feat(feed): add recipes screen --- lib/app_router.dart | 9 + .../initialization_state.freezed.dart | 96 +++----- lib/core/utils/image_constant.dart | 1 + .../selection_popup_model.freezed.dart | 53 ++--- .../user_registration_model.dart | 3 +- .../user_registration_model.freezed.dart | 183 ++++++++------- .../user_registration_model.g.dart | 11 +- .../models/blog_post_model.freezed.dart | 81 +++---- .../blog_post/models/blog_post_model.g.dart | 6 +- .../bloc/blog_post_state.freezed.dart | 88 +++---- .../presentation/pages/blog_post_screen.dart | 1 + .../services/blog_post_service.g.dart | 29 +-- .../repositories/blog_repository.dart | 2 +- .../services/blog_service.dart | 2 +- .../new_messages_state.freezed.dart | 92 +++----- .../notifications_state.freezed.dart | 95 +++----- .../models/chat_message_model.freezed.dart | 73 +++--- .../chat/models/chat_message_model.g.dart | 8 +- .../chat/models/chat_messages_model.dart | 1 + .../models/chat_messages_model.freezed.dart | 70 ++---- .../chat/models/chat_messages_model.g.dart | 12 +- .../chat/models/chat_meta_model.freezed.dart | 54 ++--- .../chat/models/chat_meta_model.g.dart | 6 +- .../chat/models/chat_room_model.freezed.dart | 78 +++--- .../chat/models/chat_room_model.g.dart | 12 +- .../chat_room_settings_model.freezed.dart | 78 +++--- .../models/chat_room_settings_model.g.dart | 8 +- .../chat/models/chat_user_model.freezed.dart | 78 +++--- .../chat/models/chat_user_model.g.dart | 6 +- .../models/websocket_info_model.freezed.dart | 81 +++---- .../chat/models/websocket_info_model.g.dart | 8 +- .../chat_room_state.freezed.dart | 171 +++++--------- .../bloc/chat_select_bloc.dart | 15 +- .../models/chat_select_model.dart | 1 + .../chat/services/chat_service.g.dart | 82 +++---- lib/features/diary/models/meal.dart | 1 + lib/features/diary/models/meal.freezed.dart | 136 ++++++----- lib/features/diary/models/meal.g.dart | 3 +- lib/features/diary/models/photo.dart | 4 +- lib/features/diary/models/photo.freezed.dart | 62 ++--- lib/features/diary/models/photo.g.dart | 3 +- lib/features/diary/models/portion.dart | 1 + .../diary/models/portion.freezed.dart | 58 +++-- lib/features/diary/models/product.dart | 1 + .../diary/models/product.freezed.dart | 30 ++- .../models/feed_blog_post_model.freezed.dart | 70 +++--- .../feed/models/feed_blog_post_model.g.dart | 8 +- .../models/feed_blog_post_settings_model.dart | 1 + ...feed_blog_post_settings_model.freezed.dart | 69 ++---- .../feed_blog_post_settings_model.g.dart | 6 +- .../feed/models/recipes_model.freezed.dart | 222 ++++++++---------- lib/features/feed/models/recipes_model.g.dart | 23 +- .../feed/models/recipes_pagination_model.dart | 4 +- .../recipes_pagination_model.freezed.dart | 101 ++++---- .../models/recipes_pagination_model.g.dart | 12 +- .../bloc/feed_cubit/feed_state.freezed.dart | 102 +++----- .../bloc/recipes_cubit/recipes_cubit.dart | 2 +- .../recipes_cubit/recipes_state.freezed.dart | 96 +++----- .../widgets/blog_post_widget.dart | 9 +- .../presentation/widgets/recipes_widget.dart | 150 ++++++------ .../feed/services/feed_service.g.dart | 54 ++--- .../pages/about_recipes_screen.dart | 49 ++++ .../models/location_model.freezed.dart | 71 ++---- .../registration/models/location_model.g.dart | 9 +- .../registration_state.freezed.dart | 41 ++-- .../pages/credentials_screen.dart | 1 + .../services/registration_service.g.dart | 82 +++---- lib/localization/app_localization.dart | 2 + lib/locator_service.dart | 6 +- lib/main.dart | 11 +- .../auth/auth_screen/auth_screen.dart | 1 + .../auth/auth_screen/bloc/auth_state.dart | 1 + .../bloc/diet_create_state.dart | 3 + .../bloc/diet_select_event.dart | 2 + .../bloc/diet_select_state.dart | 2 + .../bloc/diet_show_event.dart | 2 + .../bloc/diet_show_state.dart | 3 + .../bloc/blog_post_create_bloc.dart | 2 +- .../bloc/blog_post_edit_state.dart | 3 + .../models/blog_post_model.dart | 2 + .../bloc/glossary_screen_event.dart | 4 + .../bloc/glossary_screen_state.dart | 3 + .../models/glossary_screen_model.dart | 1 + .../bloc/plan_create_state.dart | 3 + .../bloc/plan_edit_state.dart | 3 + .../bloc/plan_select_event.dart | 2 + .../bloc/plan_select_state.dart | 2 + .../bloc/plan_show_event.dart | 2 + .../bloc/plan_show_state.dart | 3 + .../bloc/my_profile_event.dart | 2 + .../bloc/my_profile_state.dart | 2 + .../bloc/recipe_create_event.dart | 4 + .../bloc/recipe_create_state.dart | 3 + .../bloc/recipe_edit_event.dart | 4 + .../bloc/recipe_edit_state.dart | 3 + .../bloc/recipe_select_event.dart | 2 + .../bloc/recipe_select_state.dart | 2 + .../bloc/recipe_show_event.dart | 4 + .../bloc/recipe_show_state.dart | 3 + .../bloc/subscribers_state.dart | 2 + lib/theme/app_decoration.dart | 17 ++ lib/theme/bloc/theme_state.dart | 1 + lib/theme/custom_button_style.dart | 1 + lib/widgets/custom_drop_down.dart | 31 +-- lib/widgets/custom_edit_drop_down.dart | 30 ++- lib/widgets/custom_expandable_list.dart | 35 +-- lib/widgets/custom_hyper_switch.dart | 1 + lib/widgets/custom_hypo_switch.dart | 1 + lib/widgets/custom_language_drop_down.dart | 3 +- lib/widgets/custom_outlined_button.dart | 2 +- lib/widgets/custom_text_form_field.dart | 4 +- 111 files changed, 1511 insertions(+), 1784 deletions(-) diff --git a/lib/app_router.dart b/lib/app_router.dart index 61fac3e7..19b9f1f5 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -8,7 +8,9 @@ import 'package:eatvio_app/features/chat/presentation/pages/chat_screen.dart'; import 'package:eatvio_app/features/chat/presentation/pages/chat_select_screen/chat_select_screen.dart'; import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart'; import 'package:eatvio_app/features/diary/presentation/pages/diary_screen.dart'; +import 'package:eatvio_app/features/feed/models/recipes_model.dart'; import 'package:eatvio_app/features/feed/presentation/pages/feed_screen.dart'; +import 'package:eatvio_app/features/recipes/presentation/pages/about_recipes_screen.dart'; import 'package:eatvio_app/features/registration/presentation/pages/registration_screen.dart'; import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart'; import 'package:eatvio_app/presentation/diets/diet_create_screen/diet_create_screen.dart'; @@ -79,6 +81,13 @@ class AppRouter { ), ], ), + GoRoute( + path: '/about-recipes-screen', + name: 'aboutRecipesScreen', + builder: (context, state) => AboutRecipesScreen( + recipes: state.extra as Recipes, + ), + ), GoRoute( path: '/blog-post-create-screen', name: 'blogPostCreateScreen', diff --git a/lib/core/initialization_cubit/initialization_state.freezed.dart b/lib/core/initialization_cubit/initialization_state.freezed.dart index 3364e440..5d54500a 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,36 +71,31 @@ 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; } /// @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); } /// @nodoc @@ -114,9 +110,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 @@ -203,20 +197,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); } @@ -232,9 +220,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 @@ -321,22 +307,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); @pragma('vm:prefer-inline') @@ -369,9 +350,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 @@ -380,9 +359,8 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> - get copyWith => __$$InitializationStateSuccessImplCopyWithImpl< - _$InitializationStateSuccessImpl>(this, _$identity); + _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => + __$$InitializationStateSuccessImplCopyWithImpl<_$InitializationStateSuccessImpl>(this, _$identity); @override @optionalTypeArgs @@ -460,34 +438,27 @@ 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; + @JsonKey(ignore: true) - _$$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); @pragma('vm:prefer-inline') @@ -522,8 +493,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 @@ -532,9 +502,8 @@ class _$InitializationStateErrorImpl implements InitializationStateError { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> - get copyWith => __$$InitializationStateErrorImplCopyWithImpl< - _$InitializationStateErrorImpl>(this, _$identity); + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => + __$$InitializationStateErrorImplCopyWithImpl<_$InitializationStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -612,11 +581,10 @@ 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; + @JsonKey(ignore: true) - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/utils/image_constant.dart b/lib/core/utils/image_constant.dart index 6a7785af..791dacca 100644 --- a/lib/core/utils/image_constant.dart +++ b/lib/core/utils/image_constant.dart @@ -15,6 +15,7 @@ class ImageConstant { static String imageNotFound = 'assets/images/image_not_found.png'; static String imaGlass = 'assets/images/image_glass.svg'; + // Настройки images static String imgClose = '$imagePath/img_close.svg'; diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart index 917785c7..79d30b48 100644 --- a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart +++ b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart @@ -17,31 +17,33 @@ final _privateConstructorUsedError = UnsupportedError( /// @nodoc mixin _$SelectionPopupModel { int? get id => throw _privateConstructorUsedError; + String get title => throw _privateConstructorUsedError; + dynamic get value => throw _privateConstructorUsedError; + bool get isSelected => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $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; @@ -75,23 +77,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); @pragma('vm:prefer-inline') @override @@ -125,8 +123,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; @@ -151,39 +148,35 @@ 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); @JsonKey(ignore: true) @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; + @override @JsonKey(ignore: true) - _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/data/models/userRegistrationModel/user_registration_model.dart b/lib/data/models/userRegistrationModel/user_registration_model.dart index 7a7fb3f3..419ee5c7 100644 --- a/lib/data/models/userRegistrationModel/user_registration_model.dart +++ b/lib/data/models/userRegistrationModel/user_registration_model.dart @@ -15,8 +15,7 @@ class UserRegistrationSheet with _$UserRegistrationSheet { required String birthdate, required String gender, required String location, - @JsonKey(name: 'response_body') - required String responseBody, + @JsonKey(name: 'response_body') required String responseBody, required String lang, required int weight, required int height, diff --git a/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart b/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart index 4a15327c..4950c89f 100644 --- a/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart +++ b/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart @@ -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,62 +22,88 @@ 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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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, @@ -111,13 +136,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; @@ -266,12 +290,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( @@ -305,13 +327,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); @pragma('vm:prefer-inline') @override @@ -465,8 +483,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, @@ -490,8 +507,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') @@ -577,54 +593,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(ignore: true) @@ -663,9 +658,8 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> - get copyWith => __$$UserRegistrationSheetImplCopyWithImpl< - _$UserRegistrationSheetImpl>(this, _$identity); + _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => + __$$UserRegistrationSheetImplCopyWithImpl<_$UserRegistrationSheetImpl>(this, _$identity); @override Map toJson() { @@ -681,8 +675,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, @@ -691,104 +684,124 @@ 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; + @override @JsonKey(ignore: true) - _$$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/data/models/userRegistrationModel/user_registration_model.g.dart index 9500e915..7690dbb1 100644 --- a/lib/data/models/userRegistrationModel/user_registration_model.g.dart +++ b/lib/data/models/userRegistrationModel/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/blog_post/models/blog_post_model.freezed.dart b/lib/features/blog_post/models/blog_post_model.freezed.dart index 7c0a750e..058bff6a 100644 --- a/lib/features/blog_post/models/blog_post_model.freezed.dart +++ b/lib/features/blog_post/models/blog_post_model.freezed.dart @@ -21,30 +21,38 @@ BlogPostModel _$BlogPostModelFromJson(Map json) { /// @nodoc mixin _$BlogPostModel { int get id => throw _privateConstructorUsedError; + String get state => throw _privateConstructorUsedError; + String? get image => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; + String? get author_name => throw _privateConstructorUsedError; + String? get author_avatar_path => 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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $BlogPostModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $BlogPostModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $BlogPostModelCopyWith<$Res> { - factory $BlogPostModelCopyWith( - BlogPostModel value, $Res Function(BlogPostModel) then) = - _$BlogPostModelCopyWithImpl<$Res, BlogPostModel>; + factory $BlogPostModelCopyWith(BlogPostModel value, $Res Function(BlogPostModel) then) = _$BlogPostModelCopyWithImpl<$Res, BlogPostModel>; + @useResult $Res call( {int id, @@ -60,12 +68,12 @@ abstract class $BlogPostModelCopyWith<$Res> { } /// @nodoc -class _$BlogPostModelCopyWithImpl<$Res, $Val extends BlogPostModel> - implements $BlogPostModelCopyWith<$Res> { +class _$BlogPostModelCopyWithImpl<$Res, $Val extends BlogPostModel> implements $BlogPostModelCopyWith<$Res> { _$BlogPostModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -129,11 +137,9 @@ class _$BlogPostModelCopyWithImpl<$Res, $Val extends BlogPostModel> } /// @nodoc -abstract class _$$BlogPostModelImplCopyWith<$Res> - implements $BlogPostModelCopyWith<$Res> { - factory _$$BlogPostModelImplCopyWith( - _$BlogPostModelImpl value, $Res Function(_$BlogPostModelImpl) then) = - __$$BlogPostModelImplCopyWithImpl<$Res>; +abstract class _$$BlogPostModelImplCopyWith<$Res> implements $BlogPostModelCopyWith<$Res> { + factory _$$BlogPostModelImplCopyWith(_$BlogPostModelImpl value, $Res Function(_$BlogPostModelImpl) then) = __$$BlogPostModelImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -150,12 +156,8 @@ abstract class _$$BlogPostModelImplCopyWith<$Res> } /// @nodoc -class __$$BlogPostModelImplCopyWithImpl<$Res> - extends _$BlogPostModelCopyWithImpl<$Res, _$BlogPostModelImpl> - implements _$$BlogPostModelImplCopyWith<$Res> { - __$$BlogPostModelImplCopyWithImpl( - _$BlogPostModelImpl _value, $Res Function(_$BlogPostModelImpl) _then) - : super(_value, _then); +class __$$BlogPostModelImplCopyWithImpl<$Res> extends _$BlogPostModelCopyWithImpl<$Res, _$BlogPostModelImpl> implements _$$BlogPostModelImplCopyWith<$Res> { + __$$BlogPostModelImplCopyWithImpl(_$BlogPostModelImpl _value, $Res Function(_$BlogPostModelImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -231,8 +233,7 @@ class _$BlogPostModelImpl implements _BlogPostModel { @JsonKey(name: "updated_at") required this.updatedAt, required this.title}); - factory _$BlogPostModelImpl.fromJson(Map json) => - _$$BlogPostModelImplFromJson(json); + factory _$BlogPostModelImpl.fromJson(Map json) => _$$BlogPostModelImplFromJson(json); @override final int id; @@ -271,31 +272,23 @@ class _$BlogPostModelImpl implements _BlogPostModel { (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.author_name, author_name) || - other.author_name == author_name) && - (identical(other.author_avatar_path, author_avatar_path) || - other.author_avatar_path == author_avatar_path) && - (identical(other.youtubeUrl, youtubeUrl) || - other.youtubeUrl == youtubeUrl) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt) && + (identical(other.description, description) || other.description == description) && + (identical(other.author_name, author_name) || other.author_name == author_name) && + (identical(other.author_avatar_path, author_avatar_path) || other.author_avatar_path == author_avatar_path) && + (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)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, id, state, image, description, - author_name, author_avatar_path, youtubeUrl, createdAt, updatedAt, title); + int get hashCode => Object.hash(runtimeType, id, state, image, description, author_name, author_avatar_path, youtubeUrl, createdAt, updatedAt, title); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$BlogPostModelImplCopyWith<_$BlogPostModelImpl> get copyWith => - __$$BlogPostModelImplCopyWithImpl<_$BlogPostModelImpl>(this, _$identity); + _$$BlogPostModelImplCopyWith<_$BlogPostModelImpl> get copyWith => __$$BlogPostModelImplCopyWithImpl<_$BlogPostModelImpl>(this, _$identity); @override Map toJson() { @@ -318,34 +311,42 @@ abstract class _BlogPostModel implements BlogPostModel { @JsonKey(name: "updated_at") required final DateTime updatedAt, required final String title}) = _$BlogPostModelImpl; - factory _BlogPostModel.fromJson(Map json) = - _$BlogPostModelImpl.fromJson; + factory _BlogPostModel.fromJson(Map json) = _$BlogPostModelImpl.fromJson; @override int get id; + @override String get state; + @override String? get image; + @override String get description; + @override String? get author_name; + @override String? get author_avatar_path; + @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(ignore: true) - _$$BlogPostModelImplCopyWith<_$BlogPostModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$BlogPostModelImplCopyWith<_$BlogPostModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/blog_post/models/blog_post_model.g.dart b/lib/features/blog_post/models/blog_post_model.g.dart index 2e3233c4..137652f2 100644 --- a/lib/features/blog_post/models/blog_post_model.g.dart +++ b/lib/features/blog_post/models/blog_post_model.g.dart @@ -6,8 +6,7 @@ part of 'blog_post_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$BlogPostModelImpl _$$BlogPostModelImplFromJson(Map json) => - _$BlogPostModelImpl( +_$BlogPostModelImpl _$$BlogPostModelImplFromJson(Map json) => _$BlogPostModelImpl( id: (json['id'] as num).toInt(), state: json['state'] as String, image: json['image'] as String?, @@ -20,8 +19,7 @@ _$BlogPostModelImpl _$$BlogPostModelImplFromJson(Map json) => title: json['title'] as String, ); -Map _$$BlogPostModelImplToJson(_$BlogPostModelImpl instance) => - { +Map _$$BlogPostModelImplToJson(_$BlogPostModelImpl instance) => { 'id': instance.id, 'state': instance.state, 'image': instance.image, diff --git a/lib/features/blog_post/presentation/bloc/blog_post_state.freezed.dart b/lib/features/blog_post/presentation/bloc/blog_post_state.freezed.dart index 4f99a3cd..37760001 100644 --- a/lib/features/blog_post/presentation/bloc/blog_post_state.freezed.dart +++ b/lib/features/blog_post/presentation/bloc/blog_post_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$BlogPostState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,36 +71,28 @@ mixin _$BlogPostState { /// @nodoc abstract class $BlogPostStateCopyWith<$Res> { - factory $BlogPostStateCopyWith( - BlogPostState value, $Res Function(BlogPostState) then) = - _$BlogPostStateCopyWithImpl<$Res, BlogPostState>; + factory $BlogPostStateCopyWith(BlogPostState value, $Res Function(BlogPostState) then) = _$BlogPostStateCopyWithImpl<$Res, BlogPostState>; } /// @nodoc -class _$BlogPostStateCopyWithImpl<$Res, $Val extends BlogPostState> - implements $BlogPostStateCopyWith<$Res> { +class _$BlogPostStateCopyWithImpl<$Res, $Val extends BlogPostState> implements $BlogPostStateCopyWith<$Res> { _$BlogPostStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; } /// @nodoc abstract class _$$BlogPostStateImplCopyWith<$Res> { - factory _$$BlogPostStateImplCopyWith( - _$BlogPostStateImpl value, $Res Function(_$BlogPostStateImpl) then) = - __$$BlogPostStateImplCopyWithImpl<$Res>; + factory _$$BlogPostStateImplCopyWith(_$BlogPostStateImpl value, $Res Function(_$BlogPostStateImpl) then) = __$$BlogPostStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$BlogPostStateImplCopyWithImpl<$Res> - extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateImpl> - implements _$$BlogPostStateImplCopyWith<$Res> { - __$$BlogPostStateImplCopyWithImpl( - _$BlogPostStateImpl _value, $Res Function(_$BlogPostStateImpl) _then) - : super(_value, _then); +class __$$BlogPostStateImplCopyWithImpl<$Res> extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateImpl> implements _$$BlogPostStateImplCopyWith<$Res> { + __$$BlogPostStateImplCopyWithImpl(_$BlogPostStateImpl _value, $Res Function(_$BlogPostStateImpl) _then) : super(_value, _then); } /// @nodoc @@ -114,8 +107,7 @@ class _$BlogPostStateImpl implements _BlogPostState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$BlogPostStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$BlogPostStateImpl); } @override @@ -202,18 +194,14 @@ abstract class _BlogPostState implements BlogPostState { /// @nodoc abstract class _$$BlogPostStateLoadingImplCopyWith<$Res> { - factory _$$BlogPostStateLoadingImplCopyWith(_$BlogPostStateLoadingImpl value, - $Res Function(_$BlogPostStateLoadingImpl) then) = + factory _$$BlogPostStateLoadingImplCopyWith(_$BlogPostStateLoadingImpl value, $Res Function(_$BlogPostStateLoadingImpl) then) = __$$BlogPostStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$BlogPostStateLoadingImplCopyWithImpl<$Res> - extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateLoadingImpl> +class __$$BlogPostStateLoadingImplCopyWithImpl<$Res> extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateLoadingImpl> implements _$$BlogPostStateLoadingImplCopyWith<$Res> { - __$$BlogPostStateLoadingImplCopyWithImpl(_$BlogPostStateLoadingImpl _value, - $Res Function(_$BlogPostStateLoadingImpl) _then) - : super(_value, _then); + __$$BlogPostStateLoadingImplCopyWithImpl(_$BlogPostStateLoadingImpl _value, $Res Function(_$BlogPostStateLoadingImpl) _then) : super(_value, _then); } /// @nodoc @@ -228,9 +216,7 @@ class _$BlogPostStateLoadingImpl implements BlogPostStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BlogPostStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$BlogPostStateLoadingImpl); } @override @@ -317,9 +303,9 @@ abstract class BlogPostStateLoading implements BlogPostState { /// @nodoc abstract class _$$BlogPostStateLoadedImplCopyWith<$Res> { - factory _$$BlogPostStateLoadedImplCopyWith(_$BlogPostStateLoadedImpl value, - $Res Function(_$BlogPostStateLoadedImpl) then) = + factory _$$BlogPostStateLoadedImplCopyWith(_$BlogPostStateLoadedImpl value, $Res Function(_$BlogPostStateLoadedImpl) then) = __$$BlogPostStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({BlogPostModel blogPost}); @@ -327,12 +313,9 @@ abstract class _$$BlogPostStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$BlogPostStateLoadedImplCopyWithImpl<$Res> - extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateLoadedImpl> +class __$$BlogPostStateLoadedImplCopyWithImpl<$Res> extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateLoadedImpl> implements _$$BlogPostStateLoadedImplCopyWith<$Res> { - __$$BlogPostStateLoadedImplCopyWithImpl(_$BlogPostStateLoadedImpl _value, - $Res Function(_$BlogPostStateLoadedImpl) _then) - : super(_value, _then); + __$$BlogPostStateLoadedImplCopyWithImpl(_$BlogPostStateLoadedImpl _value, $Res Function(_$BlogPostStateLoadedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -372,10 +355,7 @@ class _$BlogPostStateLoadedImpl implements BlogPostStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BlogPostStateLoadedImpl && - (identical(other.blogPost, blogPost) || - other.blogPost == blogPost)); + (other.runtimeType == runtimeType && other is _$BlogPostStateLoadedImpl && (identical(other.blogPost, blogPost) || other.blogPost == blogPost)); } @override @@ -385,8 +365,7 @@ class _$BlogPostStateLoadedImpl implements BlogPostStateLoaded { @override @pragma('vm:prefer-inline') _$$BlogPostStateLoadedImplCopyWith<_$BlogPostStateLoadedImpl> get copyWith => - __$$BlogPostStateLoadedImplCopyWithImpl<_$BlogPostStateLoadedImpl>( - this, _$identity); + __$$BlogPostStateLoadedImplCopyWithImpl<_$BlogPostStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -464,31 +443,27 @@ class _$BlogPostStateLoadedImpl implements BlogPostStateLoaded { } abstract class BlogPostStateLoaded implements BlogPostState { - const factory BlogPostStateLoaded({required final BlogPostModel blogPost}) = - _$BlogPostStateLoadedImpl; + const factory BlogPostStateLoaded({required final BlogPostModel blogPost}) = _$BlogPostStateLoadedImpl; BlogPostModel get blogPost; + @JsonKey(ignore: true) - _$$BlogPostStateLoadedImplCopyWith<_$BlogPostStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$BlogPostStateLoadedImplCopyWith<_$BlogPostStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$BlogPostStateErrorImplCopyWith<$Res> { - factory _$$BlogPostStateErrorImplCopyWith(_$BlogPostStateErrorImpl value, - $Res Function(_$BlogPostStateErrorImpl) then) = + factory _$$BlogPostStateErrorImplCopyWith(_$BlogPostStateErrorImpl value, $Res Function(_$BlogPostStateErrorImpl) then) = __$$BlogPostStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$BlogPostStateErrorImplCopyWithImpl<$Res> - extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateErrorImpl> +class __$$BlogPostStateErrorImplCopyWithImpl<$Res> extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateErrorImpl> implements _$$BlogPostStateErrorImplCopyWith<$Res> { - __$$BlogPostStateErrorImplCopyWithImpl(_$BlogPostStateErrorImpl _value, - $Res Function(_$BlogPostStateErrorImpl) _then) - : super(_value, _then); + __$$BlogPostStateErrorImplCopyWithImpl(_$BlogPostStateErrorImpl _value, $Res Function(_$BlogPostStateErrorImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -522,8 +497,7 @@ class _$BlogPostStateErrorImpl implements BlogPostStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$BlogPostStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -533,8 +507,7 @@ class _$BlogPostStateErrorImpl implements BlogPostStateError { @override @pragma('vm:prefer-inline') _$$BlogPostStateErrorImplCopyWith<_$BlogPostStateErrorImpl> get copyWith => - __$$BlogPostStateErrorImplCopyWithImpl<_$BlogPostStateErrorImpl>( - this, _$identity); + __$$BlogPostStateErrorImplCopyWithImpl<_$BlogPostStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -612,11 +585,10 @@ class _$BlogPostStateErrorImpl implements BlogPostStateError { } abstract class BlogPostStateError implements BlogPostState { - const factory BlogPostStateError({required final String errorMessage}) = - _$BlogPostStateErrorImpl; + const factory BlogPostStateError({required final String errorMessage}) = _$BlogPostStateErrorImpl; String get errorMessage; + @JsonKey(ignore: true) - _$$BlogPostStateErrorImplCopyWith<_$BlogPostStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$BlogPostStateErrorImplCopyWith<_$BlogPostStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/blog_post/presentation/pages/blog_post_screen.dart b/lib/features/blog_post/presentation/pages/blog_post_screen.dart index 8bb66303..c9f14dc9 100644 --- a/lib/features/blog_post/presentation/pages/blog_post_screen.dart +++ b/lib/features/blog_post/presentation/pages/blog_post_screen.dart @@ -14,6 +14,7 @@ class BlogPostScreen extends StatelessWidget { final String blogPostID; const BlogPostScreen({super.key, required this.blogPostID}); + Widget build(BuildContext context) { return BlocProvider( create: (context) => sl()..loadBlogPost(blogPostID), diff --git a/lib/features/blog_post/services/blog_post_service.g.dart b/lib/features/blog_post/services/blog_post_service.g.dart index 5ea30fcb..422f042e 100644 --- a/lib/features/blog_post/services/blog_post_service.g.dart +++ b/lib/features/blog_post/services/blog_post_service.g.dart @@ -24,31 +24,28 @@ class _BlogPostService implements BlogPostService { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _result = await _dio - .fetch>(_setStreamType(Options( + final _result = await _dio.fetch>(_setStreamType(Options( method: 'GET', headers: _headers, extra: _extra, ) - .compose( - _dio.options, - '/api/blogPosts/show/${id}', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - )))); + .compose( + _dio.options, + '/api/blogPosts/show/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final _value = BlogPostModel.fromJson(_result.data!); return _value; } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/blog_post_create/repositories/blog_repository.dart b/lib/features/blog_post_create/repositories/blog_repository.dart index ee11cd12..3d1846a4 100644 --- a/lib/features/blog_post_create/repositories/blog_repository.dart +++ b/lib/features/blog_post_create/repositories/blog_repository.dart @@ -18,4 +18,4 @@ class BlogRepository { } } } -*/ \ No newline at end of file +*/ diff --git a/lib/features/blog_post_create/services/blog_service.dart b/lib/features/blog_post_create/services/blog_service.dart index d8e94496..4b110622 100644 --- a/lib/features/blog_post_create/services/blog_service.dart +++ b/lib/features/blog_post_create/services/blog_service.dart @@ -13,4 +13,4 @@ abstract class BlogService { Future createBlogPost( BlogPostCreateCredentialsModel model); } -*/ \ No newline at end of file +*/ 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 02a1c4bd..e150ef99 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,36 +71,30 @@ 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; } /// @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); } /// @nodoc @@ -114,8 +109,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 @@ -202,19 +196,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); } /// @nodoc @@ -229,9 +218,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 @@ -318,22 +305,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); @pragma('vm:prefer-inline') @override @@ -367,8 +349,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 @@ -377,9 +358,8 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> - get copyWith => __$$NewMessagesStateLoadedImplCopyWithImpl< - _$NewMessagesStateLoadedImpl>(this, _$identity); + _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => + __$$NewMessagesStateLoadedImplCopyWithImpl<_$NewMessagesStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -457,32 +437,27 @@ 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; + @JsonKey(ignore: true) - _$$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); @pragma('vm:prefer-inline') @override @@ -516,8 +491,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 @@ -526,9 +500,8 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> - get copyWith => __$$NewMessagesStateErrorImplCopyWithImpl< - _$NewMessagesStateErrorImpl>(this, _$identity); + _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => + __$$NewMessagesStateErrorImplCopyWithImpl<_$NewMessagesStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -606,11 +579,10 @@ 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; + @JsonKey(ignore: true) - _$$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 0deeebbd..b4b95e0c 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 @@ -24,6 +24,7 @@ mixin _$NotificationsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,36 +71,31 @@ 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; } /// @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); } /// @nodoc @@ -114,8 +110,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 @@ -202,21 +197,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); } /// @nodoc @@ -231,9 +219,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 @@ -320,22 +306,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({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); @pragma('vm:prefer-inline') @@ -370,8 +351,7 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateLoadedImpl && - (identical(other.notificationsCount, notificationsCount) || - other.notificationsCount == notificationsCount)); + (identical(other.notificationsCount, notificationsCount) || other.notificationsCount == notificationsCount)); } @override @@ -380,9 +360,8 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> - get copyWith => __$$NotificationsStateLoadedImplCopyWithImpl< - _$NotificationsStateLoadedImpl>(this, _$identity); + _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => + __$$NotificationsStateLoadedImplCopyWithImpl<_$NotificationsStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -460,34 +439,27 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { } abstract class NotificationsStateLoaded implements NotificationsState { - const factory NotificationsStateLoaded( - {required final int notificationsCount}) = _$NotificationsStateLoadedImpl; + const factory NotificationsStateLoaded({required final int notificationsCount}) = _$NotificationsStateLoadedImpl; int get notificationsCount; + @JsonKey(ignore: true) - _$$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); @pragma('vm:prefer-inline') @override @@ -521,8 +493,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 @@ -531,9 +502,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> - get copyWith => __$$NotificationsStateErrorImplCopyWithImpl< - _$NotificationsStateErrorImpl>(this, _$identity); + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => + __$$NotificationsStateErrorImplCopyWithImpl<_$NotificationsStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -611,11 +581,10 @@ 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; + @JsonKey(ignore: true) - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_message_model.freezed.dart b/lib/features/chat/models/chat_message_model.freezed.dart index 76a91cbc..6dfda166 100644 --- a/lib/features/chat/models/chat_message_model.freezed.dart +++ b/lib/features/chat/models/chat_message_model.freezed.dart @@ -21,25 +21,28 @@ 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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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, @@ -50,12 +53,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; @@ -94,11 +97,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( @@ -110,12 +112,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); @pragma('vm:prefer-inline') @override @@ -162,14 +161,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 { @@ -199,25 +198,19 @@ 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(ignore: true) @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); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => - __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>( - this, _$identity); + _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>(this, _$identity); @override Map toJson() { @@ -229,31 +222,33 @@ 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; + @override @JsonKey(ignore: true) - _$$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.dart b/lib/features/chat/models/chat_messages_model.dart index 999f598e..84a51b48 100644 --- a/lib/features/chat/models/chat_messages_model.dart +++ b/lib/features/chat/models/chat_messages_model.dart @@ -3,6 +3,7 @@ import 'package:eatvio_app/features/chat/models/chat_meta_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'chat_messages_model.freezed.dart'; + part 'chat_messages_model.g.dart'; @freezed diff --git a/lib/features/chat/models/chat_messages_model.freezed.dart b/lib/features/chat/models/chat_messages_model.freezed.dart index a970241c..88f62787 100644 --- a/lib/features/chat/models/chat_messages_model.freezed.dart +++ b/lib/features/chat/models/chat_messages_model.freezed.dart @@ -22,34 +22,32 @@ ChatMessagesModel _$ChatMessagesModelFromJson(Map json) { mixin _$ChatMessagesModel { @JsonKey(name: 'data') List get messagesList => throw _privateConstructorUsedError; + ChatMetaModel get meta => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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; @@ -81,28 +79,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); @pragma('vm:prefer-inline') @override @@ -126,16 +118,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 { @@ -157,22 +145,18 @@ 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(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => - __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>( - this, _$identity); + _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>(this, _$identity); @override Map toJson() { @@ -183,21 +167,19 @@ 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; + @override @JsonKey(ignore: true) - _$$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 11ecb9e2..206048fa 100644 --- a/lib/features/chat/models/chat_meta_model.freezed.dart +++ b/lib/features/chat/models/chat_meta_model.freezed.dart @@ -24,27 +24,26 @@ mixin _$ChatMetaModel { int get lastPage => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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; @@ -63,23 +62,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); @pragma('vm:prefer-inline') @override @@ -98,11 +91,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") @@ -116,10 +107,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(ignore: true) @@ -129,8 +117,7 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => - __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); + _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); @override Map toJson() { @@ -141,18 +128,15 @@ 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") int get lastPage; + @override @JsonKey(ignore: true) - _$$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 5a0b6e62..26066239 100644 --- a/lib/features/chat/models/chat_room_model.freezed.dart +++ b/lib/features/chat/models/chat_room_model.freezed.dart @@ -21,39 +21,35 @@ 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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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; @@ -83,38 +79,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); @pragma('vm:prefer-inline') @override @@ -144,13 +129,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; @@ -158,6 +140,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; @@ -176,21 +159,18 @@ 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(ignore: true) @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)); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => - __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); + _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); @override Map toJson() { @@ -203,22 +183,22 @@ 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; + @override @JsonKey(ignore: true) - _$$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_settings_model.freezed.dart b/lib/features/chat/models/chat_room_settings_model.freezed.dart index 4f217556..48a11456 100644 --- a/lib/features/chat/models/chat_room_settings_model.freezed.dart +++ b/lib/features/chat/models/chat_room_settings_model.freezed.dart @@ -14,33 +14,36 @@ 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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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, @@ -51,13 +54,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; @@ -96,12 +98,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( @@ -113,13 +113,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); @pragma('vm:prefer-inline') @override @@ -165,8 +161,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; @@ -193,26 +188,21 @@ 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(ignore: true) @override - int get hashCode => - Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); + int get hashCode => Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> - get copyWith => __$$ChatRoomSettingsModelImplCopyWithImpl< - _$ChatRoomSettingsModelImpl>(this, _$identity); + _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => + __$$ChatRoomSettingsModelImplCopyWithImpl<_$ChatRoomSettingsModelImpl>(this, _$identity); @override Map toJson() { @@ -224,31 +214,33 @@ 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; + @override @JsonKey(ignore: true) - _$$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 095c09e2..90774932 100644 --- a/lib/features/chat/models/chat_user_model.freezed.dart +++ b/lib/features/chat/models/chat_user_model.freezed.dart @@ -21,38 +21,36 @@ 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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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; @@ -86,27 +84,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); @pragma('vm:prefer-inline') @override @@ -146,8 +134,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; @@ -172,22 +159,18 @@ 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(ignore: true) @override - int get hashCode => - Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); + int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => - __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); + _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); @override Map toJson() { @@ -199,27 +182,28 @@ 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; + @override @JsonKey(ignore: true) - _$$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 cd383a2b..002f2ec5 100644 --- a/lib/features/chat/models/websocket_info_model.freezed.dart +++ b/lib/features/chat/models/websocket_info_model.freezed.dart @@ -21,39 +21,38 @@ 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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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; @@ -92,28 +91,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); @pragma('vm:prefer-inline') @override @@ -153,14 +143,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; @@ -193,15 +178,13 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @JsonKey(ignore: true) @override - int get hashCode => - Object.hash(runtimeType, key, host, port, cluster, userId); + int get hashCode => Object.hash(runtimeType, key, host, port, cluster, userId); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => - __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>( - this, _$identity); + __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>(this, _$identity); @override Map toJson() { @@ -213,29 +196,31 @@ 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; + @override @JsonKey(ignore: true) - _$$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 43bf9df9..0001c80c 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,36 +71,28 @@ 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; } /// @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); } /// @nodoc @@ -120,8 +107,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 @@ -132,9 +118,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(); @@ -145,9 +129,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(); @@ -158,9 +140,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(), }) { @@ -214,18 +194,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); } /// @nodoc @@ -240,9 +216,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 @@ -253,9 +227,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(); @@ -266,9 +238,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(); @@ -279,9 +249,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(), }) { @@ -335,26 +303,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); @pragma('vm:prefer-inline') @override @@ -396,16 +357,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; @@ -428,35 +386,27 @@ 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); @JsonKey(ignore: true) @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); @@ -467,9 +417,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); @@ -480,9 +428,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(), }) { @@ -538,30 +484,30 @@ abstract class ChatRoomStateLoaded implements ChatRoomState { required final bool isLoading}) = _$ChatRoomStateLoadedImpl; ChatRoomModel get chatRoom; + List get chatMessages; + bool get isTyping; + bool get isLoading; + @JsonKey(ignore: true) - _$$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); @pragma('vm:prefer-inline') @override @@ -595,8 +541,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 @@ -606,17 +551,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); @@ -627,9 +569,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); @@ -640,9 +580,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(), }) { @@ -691,11 +629,10 @@ 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; + @JsonKey(ignore: true) - _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart b/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart index 2eaff048..0985a2f0 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart @@ -14,7 +14,6 @@ import 'package:intl/intl.dart'; import '/core/app_export.dart'; part 'chat_select_event.dart'; - part 'chat_select_state.dart'; /// A bloc that manages the state of a ChatSelect according to the event that is dispatched to it. @@ -29,18 +28,20 @@ class ChatSelectBloc extends Bloc { List chats = []; for (int i = 0; i < chatRooms.length; i++) { String text = chatRooms[i]['last_message'] is List ? '' : chatRooms[i]['last_message']['data']; - if (chatRooms[i]['last_message'] is !List && chatRooms[i]['last_message']['is_author_message_auth_user'] != null) { + if (chatRooms[i]['last_message'] is! List && chatRooms[i]['last_message']['is_author_message_auth_user'] != null) { text = "Вы: " + text; } chats.add( ChatItemModel( id: chatRooms[i]['id'], username: chatRooms[i]['users']['to_chat_user']['name'], - dateText: chatRooms[i]['last_message'] is List ? '' : DateFormat('dd.MM').format( - DateTime.parse( - chatRooms[i]['last_message']['updated_at'], - ), - ), + dateText: chatRooms[i]['last_message'] is List + ? '' + : DateFormat('dd.MM').format( + DateTime.parse( + chatRooms[i]['last_message']['updated_at'], + ), + ), greetingText: text, ), ); diff --git a/lib/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart b/lib/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart index 8a0ae045..e87ffa2b 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart @@ -8,6 +8,7 @@ import 'package:equatable/equatable.dart'; class ChatSelectModel extends Equatable { ChatSelectModel({this.chatList = const []}); + List chatList; ChatSelectModel copyWith({List? chatList}) { diff --git a/lib/features/chat/services/chat_service.g.dart b/lib/features/chat/services/chat_service.g.dart index 2f0674be..8d212c4e 100644 --- a/lib/features/chat/services/chat_service.g.dart +++ b/lib/features/chat/services/chat_service.g.dart @@ -24,25 +24,23 @@ class _ChatService implements ChatService { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _result = await _dio.fetch>( - _setStreamType>(Options( + final _result = await _dio.fetch>(_setStreamType>(Options( method: 'GET', headers: _headers, extra: _extra, ) - .compose( - _dio.options, - '/api/chat/show/${id}', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - )))); - var _value = _result.data!.map((k, dynamic v) => - MapEntry(k, ChatRoomModel.fromJson(v as Map))); + .compose( + _dio.options, + '/api/chat/show/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + var _value = _result.data!.map((k, dynamic v) => MapEntry(k, ChatRoomModel.fromJson(v as Map))); return _value; } @@ -98,23 +96,22 @@ class _ChatService implements ChatService { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _result = await _dio - .fetch>(_setStreamType(Options( + final _result = await _dio.fetch>(_setStreamType(Options( method: 'GET', headers: _headers, extra: _extra, ) - .compose( - _dio.options, - '/api/chat/show/${id}/messages?page=${page}', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - )))); + .compose( + _dio.options, + '/api/chat/show/${id}/messages?page=${page}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final _value = ChatMessagesModel.fromJson(_result.data!); return _value; } @@ -125,31 +122,28 @@ class _ChatService implements ChatService { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _result = await _dio - .fetch>(_setStreamType(Options( + final _result = await _dio.fetch>(_setStreamType(Options( method: 'GET', headers: _headers, extra: _extra, ) - .compose( - _dio.options, - '/api/profile/ws/params', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - )))); + .compose( + _dio.options, + '/api/profile/ws/params', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final _value = WebsocketInfoModel.fromJson(_result.data!); return _value; } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/diary/models/meal.dart b/lib/features/diary/models/meal.dart index a268a470..dbf3d062 100644 --- a/lib/features/diary/models/meal.dart +++ b/lib/features/diary/models/meal.dart @@ -3,6 +3,7 @@ import './portion.dart'; import './photo.dart'; part 'meal.freezed.dart'; + part 'meal.g.dart'; @freezed diff --git a/lib/features/diary/models/meal.freezed.dart b/lib/features/diary/models/meal.freezed.dart index 2c249b06..3f7f068e 100644 --- a/lib/features/diary/models/meal.freezed.dart +++ b/lib/features/diary/models/meal.freezed.dart @@ -21,14 +21,21 @@ 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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $MealCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -36,16 +43,16 @@ mixin _$Meal { /// @nodoc abstract class $MealCopyWith<$Res> { factory $MealCopyWith(Meal value, $Res Function(Meal) then) = - _$MealCopyWithImpl<$Res, Meal>; + _$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 @@ -55,6 +62,7 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal> // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -73,55 +81,53 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal> id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable - as int, + as int, time: null == time ? _value.time : time // ignore: cast_nullable_to_non_nullable - as String, + as String, type: null == type ? _value.type : type // ignore: cast_nullable_to_non_nullable - as int, + as int, satiety: null == satiety ? _value.satiety : satiety // ignore: cast_nullable_to_non_nullable - as int, + as int, mood: null == mood ? _value.mood : mood // ignore: cast_nullable_to_non_nullable - as int, + as int, portions: null == portions ? _value.portions : portions // ignore: cast_nullable_to_non_nullable - as List, + as List, photos: null == photos ? _value.photos : photos // ignore: cast_nullable_to_non_nullable - as List, + as List, ) as $Val); } } /// @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> +class __$$MealImplCopyWithImpl<$Res> extends _$MealCopyWithImpl<$Res, _$MealImpl> implements _$$MealImplCopyWith<$Res> { __$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then) : super(_value, _then); @@ -141,31 +147,31 @@ class __$$MealImplCopyWithImpl<$Res> id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable - as int, + as int, time: null == time ? _value.time : time // ignore: cast_nullable_to_non_nullable - as String, + as String, type: null == type ? _value.type : type // ignore: cast_nullable_to_non_nullable - as int, + as int, satiety: null == satiety ? _value.satiety : satiety // ignore: cast_nullable_to_non_nullable - as int, + as int, mood: null == mood ? _value.mood : mood // ignore: cast_nullable_to_non_nullable - as int, + as int, portions: null == portions ? _value._portions : portions // ignore: cast_nullable_to_non_nullable - as List, + as List, photos: null == photos ? _value._photos : photos // ignore: cast_nullable_to_non_nullable - as List, + as List, )); } } @@ -173,14 +179,13 @@ class __$$MealImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$MealImpl implements _Meal { - const _$MealImpl( - {required this.id, - required this.time, - required this.type, - required this.satiety, - required this.mood, - required final List portions, - required final List photos}) + const _$MealImpl({required this.id, + required this.time, + required this.type, + required this.satiety, + required this.mood, + required final List portions, + required final List photos}) : _portions = portions, _photos = photos; @@ -198,6 +203,7 @@ class _$MealImpl implements _Meal { @override final int mood; final List _portions; + @override List get portions { if (_portions is EqualUnmodifiableListView) return _portions; @@ -206,6 +212,7 @@ class _$MealImpl implements _Meal { } final List _photos; + @override List get photos { if (_photos is EqualUnmodifiableListView) return _photos; @@ -234,15 +241,16 @@ class _$MealImpl implements _Meal { @JsonKey(ignore: true) @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)); @JsonKey(ignore: true) @override @@ -259,31 +267,37 @@ class _$MealImpl implements _Meal { } abstract class _Meal implements Meal { - const factory _Meal( - {required final int id, - required final String time, - required final int type, - required final int satiety, - required final int mood, - required final List portions, - required final List photos}) = _$MealImpl; + const factory _Meal({required final int id, + required final String time, + required final int type, + required final int satiety, + required final int mood, + required final List portions, + required final List photos}) = _$MealImpl; factory _Meal.fromJson(Map json) = _$MealImpl.fromJson; @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; + @override @JsonKey(ignore: true) _$$MealImplCopyWith<_$MealImpl> get copyWith => diff --git a/lib/features/diary/models/meal.g.dart b/lib/features/diary/models/meal.g.dart index 5536ed92..d6c9adf7 100644 --- a/lib/features/diary/models/meal.g.dart +++ b/lib/features/diary/models/meal.g.dart @@ -6,7 +6,8 @@ part of 'meal.dart'; // JsonSerializableGenerator // ************************************************************************** -_$MealImpl _$$MealImplFromJson(Map json) => _$MealImpl( +_$MealImpl _$$MealImplFromJson(Map json) => + _$MealImpl( id: (json['id'] as num).toInt(), time: json['time'] as String, type: (json['type'] as num).toInt(), diff --git a/lib/features/diary/models/photo.dart b/lib/features/diary/models/photo.dart index f25b8f67..d3e4f695 100644 --- a/lib/features/diary/models/photo.dart +++ b/lib/features/diary/models/photo.dart @@ -1,14 +1,14 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'photo.freezed.dart'; + part 'photo.g.dart'; @freezed class Photo with _$Photo { const factory Photo({ required int id, - @JsonKey(name: 'original_name') - required String originalName, + @JsonKey(name: 'original_name') required String originalName, required String path, }) = _Photo; diff --git a/lib/features/diary/models/photo.freezed.dart b/lib/features/diary/models/photo.freezed.dart index 2d9c70bd..b58ecebd 100644 --- a/lib/features/diary/models/photo.freezed.dart +++ b/lib/features/diary/models/photo.freezed.dart @@ -21,11 +21,14 @@ 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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $PhotoCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -33,12 +36,12 @@ mixin _$Photo { /// @nodoc abstract class $PhotoCopyWith<$Res> { factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) = - _$PhotoCopyWithImpl<$Res, Photo>; + _$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 @@ -48,6 +51,7 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo> // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -62,38 +66,35 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo> id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable - as int, + as int, originalName: null == originalName ? _value.originalName : originalName // ignore: cast_nullable_to_non_nullable - as String, + as String, path: null == path ? _value.path : path // ignore: cast_nullable_to_non_nullable - as String, + as String, ) as $Val); } } /// @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> +class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl> implements _$$PhotoImplCopyWith<$Res> { - __$$PhotoImplCopyWithImpl( - _$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) + __$$PhotoImplCopyWithImpl(_$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -107,15 +108,15 @@ class __$$PhotoImplCopyWithImpl<$Res> id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable - as int, + as int, originalName: null == originalName ? _value.originalName : originalName // ignore: cast_nullable_to_non_nullable - as String, + as String, path: null == path ? _value.path : path // ignore: cast_nullable_to_non_nullable - as String, + as String, )); } } @@ -123,10 +124,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); @@ -174,20 +174,22 @@ 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; + @override @JsonKey(ignore: true) _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => diff --git a/lib/features/diary/models/photo.g.dart b/lib/features/diary/models/photo.g.dart index cacf65ac..19711bbb 100644 --- a/lib/features/diary/models/photo.g.dart +++ b/lib/features/diary/models/photo.g.dart @@ -6,7 +6,8 @@ part of 'photo.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PhotoImpl _$$PhotoImplFromJson(Map json) => _$PhotoImpl( +_$PhotoImpl _$$PhotoImplFromJson(Map json) => + _$PhotoImpl( id: (json['id'] as num).toInt(), originalName: json['original_name'] as String, path: json['path'] as String, diff --git a/lib/features/diary/models/portion.dart b/lib/features/diary/models/portion.dart index ec4ab1de..51ec5bbc 100644 --- a/lib/features/diary/models/portion.dart +++ b/lib/features/diary/models/portion.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'portion.freezed.dart'; + part 'portion.g.dart'; @freezed diff --git a/lib/features/diary/models/portion.freezed.dart b/lib/features/diary/models/portion.freezed.dart index a7a35a29..b909af6e 100644 --- a/lib/features/diary/models/portion.freezed.dart +++ b/lib/features/diary/models/portion.freezed.dart @@ -21,11 +21,15 @@ 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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $PortionCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -33,7 +37,8 @@ mixin _$Portion { /// @nodoc abstract class $PortionCopyWith<$Res> { factory $PortionCopyWith(Portion value, $Res Function(Portion) then) = - _$PortionCopyWithImpl<$Res, Portion>; + _$PortionCopyWithImpl<$Res, Portion>; + @useResult $Res call({int id, String product_name, int quantity, String portion}); } @@ -45,6 +50,7 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion> // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -60,39 +66,37 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion> id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable - as int, + as int, product_name: null == product_name ? _value.product_name : product_name // ignore: cast_nullable_to_non_nullable - as String, + as String, quantity: null == quantity ? _value.quantity : quantity // ignore: cast_nullable_to_non_nullable - as int, + as int, portion: null == portion ? _value.portion : portion // ignore: cast_nullable_to_non_nullable - as String, + as String, ) as $Val); } } /// @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}); } /// @nodoc -class __$$PortionImplCopyWithImpl<$Res> - extends _$PortionCopyWithImpl<$Res, _$PortionImpl> +class __$$PortionImplCopyWithImpl<$Res> extends _$PortionCopyWithImpl<$Res, _$PortionImpl> implements _$$PortionImplCopyWith<$Res> { - __$$PortionImplCopyWithImpl( - _$PortionImpl _value, $Res Function(_$PortionImpl) _then) + __$$PortionImplCopyWithImpl(_$PortionImpl _value, $Res Function(_$PortionImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -107,19 +111,19 @@ class __$$PortionImplCopyWithImpl<$Res> id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable - as int, + as int, product_name: null == product_name ? _value.product_name : product_name // ignore: cast_nullable_to_non_nullable - as String, + as String, quantity: null == quantity ? _value.quantity : quantity // ignore: cast_nullable_to_non_nullable - as int, + as int, portion: null == portion ? _value.portion : portion // ignore: cast_nullable_to_non_nullable - as String, + as String, )); } } @@ -127,11 +131,10 @@ class __$$PortionImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$PortionImpl implements _Portion { - const _$PortionImpl( - {required this.id, - required this.product_name, - required this.quantity, - required this.portion}); + const _$PortionImpl({required this.id, + required this.product_name, + required this.quantity, + required this.portion}); factory _$PortionImpl.fromJson(Map json) => _$$PortionImplFromJson(json); @@ -183,22 +186,25 @@ class _$PortionImpl implements _Portion { } abstract class _Portion implements Portion { - const factory _Portion( - {required final int id, - required final String product_name, - required final int quantity, - required final String portion}) = _$PortionImpl; + const factory _Portion({required final int id, + required final String product_name, + required final int quantity, + required final String portion}) = _$PortionImpl; factory _Portion.fromJson(Map json) = _$PortionImpl.fromJson; @override int get id; + @override String get product_name; + @override int get quantity; + @override String get portion; + @override @JsonKey(ignore: true) _$$PortionImplCopyWith<_$PortionImpl> get copyWith => diff --git a/lib/features/diary/models/product.dart b/lib/features/diary/models/product.dart index a11896d3..d054257b 100644 --- a/lib/features/diary/models/product.dart +++ b/lib/features/diary/models/product.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'product.freezed.dart'; + part 'product.g.dart'; @freezed diff --git a/lib/features/diary/models/product.freezed.dart b/lib/features/diary/models/product.freezed.dart index d30ada33..d4c87df5 100644 --- a/lib/features/diary/models/product.freezed.dart +++ b/lib/features/diary/models/product.freezed.dart @@ -21,9 +21,11 @@ Product _$ProductFromJson(Map json) { /// @nodoc mixin _$Product { int get id => throw _privateConstructorUsedError; + String get name => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $ProductCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -31,7 +33,8 @@ mixin _$Product { /// @nodoc abstract class $ProductCopyWith<$Res> { factory $ProductCopyWith(Product value, $Res Function(Product) then) = - _$ProductCopyWithImpl<$Res, Product>; + _$ProductCopyWithImpl<$Res, Product>; + @useResult $Res call({int id, String name}); } @@ -43,6 +46,7 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product> // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -56,31 +60,29 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product> id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable - as int, + as int, name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable - as String, + as String, ) as $Val); } } /// @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> +class __$$ProductImplCopyWithImpl<$Res> extends _$ProductCopyWithImpl<$Res, _$ProductImpl> implements _$$ProductImplCopyWith<$Res> { - __$$ProductImplCopyWithImpl( - _$ProductImpl _value, $Res Function(_$ProductImpl) _then) + __$$ProductImplCopyWithImpl(_$ProductImpl _value, $Res Function(_$ProductImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -93,11 +95,11 @@ class __$$ProductImplCopyWithImpl<$Res> id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable - as int, + as int, name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable - as String, + as String, )); } } @@ -149,14 +151,16 @@ class _$ProductImpl implements _Product { abstract class _Product implements Product { const factory _Product({required final int id, required final String name}) = - _$ProductImpl; + _$ProductImpl; factory _Product.fromJson(Map json) = _$ProductImpl.fromJson; @override int get id; + @override String get name; + @override @JsonKey(ignore: true) _$$ProductImplCopyWith<_$ProductImpl> get copyWith => 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 4d753a10..425591a8 100644 --- a/lib/features/feed/models/feed_blog_post_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_model.freezed.dart @@ -21,28 +21,34 @@ 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; + @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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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, @@ -56,12 +62,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; @@ -115,11 +121,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( @@ -134,12 +139,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); @pragma('vm:prefer-inline') @override @@ -203,8 +205,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { @JsonKey(name: "updated_at") required this.updatedAt, required this.title}); - factory _$FeedBlogPostModelImpl.fromJson(Map json) => - _$$FeedBlogPostModelImplFromJson(json); + factory _$FeedBlogPostModelImpl.fromJson(Map json) => _$$FeedBlogPostModelImplFromJson(json); @override final int id; @@ -239,28 +240,21 @@ 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.youtubeUrl, youtubeUrl) || - other.youtubeUrl == youtubeUrl) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt) && + (identical(other.description, description) || other.description == description) && + (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)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, id, state, image, description, - youtubeUrl, createdAt, updatedAt, title); + int get hashCode => Object.hash(runtimeType, id, state, image, description, youtubeUrl, createdAt, updatedAt, title); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => - __$$FeedBlogPostModelImplCopyWithImpl<_$FeedBlogPostModelImpl>( - this, _$identity); + _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => __$$FeedBlogPostModelImplCopyWithImpl<_$FeedBlogPostModelImpl>(this, _$identity); @override Map toJson() { @@ -281,30 +275,36 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel { @JsonKey(name: "updated_at") required final DateTime updatedAt, required final String title}) = _$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 @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(ignore: true) - _$$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 93cc70fc..e6808649 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, @@ -19,9 +17,7 @@ _$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson( title: json['title'] as String, ); -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 8296a8be..a74f2d68 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.dart @@ -2,6 +2,7 @@ import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'feed_blog_post_settings_model.freezed.dart'; + part 'feed_blog_post_settings_model.g.dart'; @freezed 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 7fd8a12e..7947d806 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,40 +14,37 @@ 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; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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}); } /// @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; @@ -66,25 +63,19 @@ 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}); } /// @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); @pragma('vm:prefer-inline') @@ -104,20 +95,17 @@ class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { - const _$FeedBlogPostSettingsModelImpl( - {@JsonKey(name: 'data') - required final List feedBlogPostList}) + const _$FeedBlogPostSettingsModelImpl({@JsonKey(name: 'data') required final List feedBlogPostList}) : _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); } @@ -132,21 +120,18 @@ 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)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList)); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList)); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> - get copyWith => __$$FeedBlogPostSettingsModelImplCopyWithImpl< - _$FeedBlogPostSettingsModelImpl>(this, _$identity); + _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> get copyWith => + __$$FeedBlogPostSettingsModelImplCopyWithImpl<_$FeedBlogPostSettingsModelImpl>(this, _$identity); @override Map toJson() { @@ -157,19 +142,15 @@ class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { } abstract class _FeedBlogPostSettingsModel implements FeedBlogPostSettingsModel { - const factory _FeedBlogPostSettingsModel( - {@JsonKey(name: 'data') - required final List feedBlogPostList}) = - _$FeedBlogPostSettingsModelImpl; + const factory _FeedBlogPostSettingsModel({@JsonKey(name: 'data') required final List feedBlogPostList}) = _$FeedBlogPostSettingsModelImpl; - factory _FeedBlogPostSettingsModel.fromJson(Map json) = - _$FeedBlogPostSettingsModelImpl.fromJson; + factory _FeedBlogPostSettingsModel.fromJson(Map json) = _$FeedBlogPostSettingsModelImpl.fromJson; @override @JsonKey(name: 'data') List get feedBlogPostList; + @override @JsonKey(ignore: true) - _$$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 3f48be1b..90c6b0e0 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,16 +6,14 @@ part of 'feed_blog_post_settings_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$FeedBlogPostSettingsModelImpl _$$FeedBlogPostSettingsModelImplFromJson( - Map json) => +_$FeedBlogPostSettingsModelImpl _$$FeedBlogPostSettingsModelImplFromJson(Map json) => _$FeedBlogPostSettingsModelImpl( feedBlogPostList: (json['data'] as List) .map((e) => FeedBlogPostModel.fromJson(e as Map)) .toList(), ); -Map _$$FeedBlogPostSettingsModelImplToJson( - _$FeedBlogPostSettingsModelImpl instance) => +Map _$$FeedBlogPostSettingsModelImplToJson(_$FeedBlogPostSettingsModelImpl instance) => { 'data': instance.feedBlogPostList, }; diff --git a/lib/features/feed/models/recipes_model.freezed.dart b/lib/features/feed/models/recipes_model.freezed.dart index cb55e508..9557c032 100644 --- a/lib/features/feed/models/recipes_model.freezed.dart +++ b/lib/features/feed/models/recipes_model.freezed.dart @@ -21,34 +21,48 @@ 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: "comments_count") int get commentsCount => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $RecipesCopyWith get copyWith => throw _privateConstructorUsedError; } /// @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, @@ -68,12 +82,12 @@ abstract class $RecipesCopyWith<$Res> { } /// @nodoc -class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> - implements $RecipesCopyWith<$Res> { +class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> implements $RecipesCopyWith<$Res> { _$RecipesCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -158,9 +172,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( @@ -181,12 +194,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); @pragma('vm:prefer-inline') @override @@ -288,8 +297,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; @@ -301,6 +309,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; @@ -311,6 +320,7 @@ class _$RecipesImpl implements _Recipes { @override final String description; final List _steps; + @override List get steps { if (_steps is EqualUnmodifiableListView) return _steps; @@ -350,50 +360,28 @@ 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.commentsCount, commentsCount) || other.commentsCount == commentsCount)); } @JsonKey(ignore: true) @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); + 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); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => - __$$RecipesImplCopyWithImpl<_$RecipesImpl>(this, _$identity); + _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => __$$RecipesImplCopyWithImpl<_$RecipesImpl>(this, _$identity); @override Map toJson() { @@ -405,61 +393,73 @@ class _$RecipesImpl implements _Recipes { abstract class _Recipes implements Recipes { const factory _Recipes( - {required final int id, - required final String image, - required final String state, - @JsonKey(name: "cooking_time") required final int cookingTime, - required final List ingredients, - required final String description, - required final List steps, - @JsonKey(name: "video_url") required final String videoUrl, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") required final DateTime updatedAt, - required final String title, - required final String type, - required final String slug, - @JsonKey(name: "comments_count") required final int commentsCount}) = - _$RecipesImpl; + {required final int id, + required final String image, + required final String state, + @JsonKey(name: "cooking_time") required final int cookingTime, + required final List ingredients, + required final String description, + required final List steps, + @JsonKey(name: "video_url") required final String videoUrl, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt, + required final String title, + required final String type, + required final String slug, + @JsonKey(name: "comments_count") required final int commentsCount}) = _$RecipesImpl; factory _Recipes.fromJson(Map json) = _$RecipesImpl.fromJson; @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: "comments_count") int get commentsCount; + @override @JsonKey(ignore: true) - _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => throw _privateConstructorUsedError; } Ingredient _$IngredientFromJson(Map json) { @@ -469,31 +469,32 @@ Ingredient _$IngredientFromJson(Map json) { /// @nodoc mixin _$Ingredient { String get name => throw _privateConstructorUsedError; + String? get unit => throw _privateConstructorUsedError; + String get portion => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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; @@ -522,23 +523,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); @pragma('vm:prefer-inline') @override @@ -567,11 +562,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; @@ -602,8 +595,7 @@ class _$IngredientImpl implements _Ingredient { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => - __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); @override Map toJson() { @@ -614,24 +606,22 @@ 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; + @override @JsonKey(ignore: true) - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => - throw _privateConstructorUsedError; + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError; } Step _$StepFromJson(Map json) { @@ -641,28 +631,30 @@ Step _$StepFromJson(Map json) { /// @nodoc mixin _$Step { String get image => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $StepCopyWith get copyWith => throw _privateConstructorUsedError; } /// @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; @@ -687,20 +679,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); @pragma('vm:prefer-inline') @override @@ -726,8 +714,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; @@ -745,8 +732,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(ignore: true) @@ -756,8 +742,7 @@ class _$StepImpl implements _Step { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$StepImplCopyWith<_$StepImpl> get copyWith => - __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); + _$$StepImplCopyWith<_$StepImpl> get copyWith => __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); @override Map toJson() { @@ -768,18 +753,17 @@ 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; + @override @JsonKey(ignore: true) - _$$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 74ecedfb..e905d77d 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), @@ -28,8 +23,7 @@ _$RecipesImpl _$$RecipesImplFromJson(Map json) => commentsCount: (json['comments_count'] as num).toInt(), ); -Map _$$RecipesImplToJson(_$RecipesImpl instance) => - { +Map _$$RecipesImplToJson(_$RecipesImpl instance) => { 'id': instance.id, 'image': instance.image, 'state': instance.state, @@ -46,15 +40,13 @@ Map _$$RecipesImplToJson(_$RecipesImpl instance) => 'comments_count': instance.commentsCount, }; -_$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, @@ -65,8 +57,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.dart b/lib/features/feed/models/recipes_pagination_model.dart index fb27b882..316cf813 100644 --- a/lib/features/feed/models/recipes_pagination_model.dart +++ b/lib/features/feed/models/recipes_pagination_model.dart @@ -2,14 +2,12 @@ import 'package:eatvio_app/features/feed/models/recipes_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'recipes_pagination_model.freezed.dart'; - part 'recipes_pagination_model.g.dart'; @freezed class RecipesPagination with _$RecipesPagination { const factory RecipesPagination({ - @JsonKey(name: 'data') - required List recipesList, + @JsonKey(name: 'data') required List recipesList, @JsonKey(name: "current_page") required int currentPage, @JsonKey(name: "first_page_url") required String firstPageUrl, required int from, diff --git a/lib/features/feed/models/recipes_pagination_model.freezed.dart b/lib/features/feed/models/recipes_pagination_model.freezed.dart index 272422c3..a79dcf03 100644 --- a/lib/features/feed/models/recipes_pagination_model.freezed.dart +++ b/lib/features/feed/models/recipes_pagination_model.freezed.dart @@ -22,36 +22,46 @@ RecipesPagination _$RecipesPaginationFromJson(Map json) { mixin _$RecipesPagination { @JsonKey(name: 'data') List get recipesList => throw _privateConstructorUsedError; + @JsonKey(name: "current_page") int get currentPage => throw _privateConstructorUsedError; + @JsonKey(name: "first_page_url") String get firstPageUrl => throw _privateConstructorUsedError; + int get from => throw _privateConstructorUsedError; + @JsonKey(name: "last_page") int get lastPage => throw _privateConstructorUsedError; + @JsonKey(name: "last_page_url") String get lastPageUrl => throw _privateConstructorUsedError; + @JsonKey(name: "next_page_url") String get nextPageUrl => throw _privateConstructorUsedError; + String get path => throw _privateConstructorUsedError; + @JsonKey(name: "per_page") int get perPage => throw _privateConstructorUsedError; + @JsonKey(name: "prev_page_url") dynamic get prevPageUrl => throw _privateConstructorUsedError; + int get to => throw _privateConstructorUsedError; + int get total => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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, @@ -69,12 +79,12 @@ abstract class $RecipesPaginationCopyWith<$Res> { } /// @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; @@ -148,11 +158,10 @@ 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( @@ -171,12 +180,9 @@ abstract class _$$RecipesPaginationImplCopyWith<$Res> } /// @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); @pragma('vm:prefer-inline') @override @@ -265,10 +271,10 @@ class _$RecipesPaginationImpl implements _RecipesPagination { required this.total}) : _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 { @@ -317,50 +323,29 @@ class _$RecipesPaginationImpl implements _RecipesPagination { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesPaginationImpl && - const DeepCollectionEquality() - .equals(other._recipesList, _recipesList) && - (identical(other.currentPage, currentPage) || - other.currentPage == currentPage) && - (identical(other.firstPageUrl, firstPageUrl) || - other.firstPageUrl == firstPageUrl) && + const DeepCollectionEquality().equals(other._recipesList, _recipesList) && + (identical(other.currentPage, currentPage) || other.currentPage == currentPage) && + (identical(other.firstPageUrl, firstPageUrl) || other.firstPageUrl == firstPageUrl) && (identical(other.from, from) || other.from == from) && - (identical(other.lastPage, lastPage) || - other.lastPage == lastPage) && - (identical(other.lastPageUrl, lastPageUrl) || - other.lastPageUrl == lastPageUrl) && - (identical(other.nextPageUrl, nextPageUrl) || - other.nextPageUrl == nextPageUrl) && + (identical(other.lastPage, lastPage) || other.lastPage == lastPage) && + (identical(other.lastPageUrl, lastPageUrl) || other.lastPageUrl == lastPageUrl) && + (identical(other.nextPageUrl, nextPageUrl) || other.nextPageUrl == nextPageUrl) && (identical(other.path, path) || other.path == path) && (identical(other.perPage, perPage) || other.perPage == perPage) && - const DeepCollectionEquality() - .equals(other.prevPageUrl, prevPageUrl) && + const DeepCollectionEquality().equals(other.prevPageUrl, prevPageUrl) && (identical(other.to, to) || other.to == to) && (identical(other.total, total) || other.total == total)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_recipesList), - currentPage, - firstPageUrl, - from, - lastPage, - lastPageUrl, - nextPageUrl, - path, - perPage, - const DeepCollectionEquality().hash(prevPageUrl), - to, - total); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_recipesList), currentPage, firstPageUrl, from, lastPage, lastPageUrl, + nextPageUrl, path, perPage, const DeepCollectionEquality().hash(prevPageUrl), to, total); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => - __$$RecipesPaginationImplCopyWithImpl<_$RecipesPaginationImpl>( - this, _$identity); + _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => __$$RecipesPaginationImplCopyWithImpl<_$RecipesPaginationImpl>(this, _$identity); @override Map toJson() { @@ -385,43 +370,53 @@ abstract class _RecipesPagination implements RecipesPagination { required final int to, required final int total}) = _$RecipesPaginationImpl; - factory _RecipesPagination.fromJson(Map json) = - _$RecipesPaginationImpl.fromJson; + factory _RecipesPagination.fromJson(Map json) = _$RecipesPaginationImpl.fromJson; @override @JsonKey(name: 'data') List get recipesList; + @override @JsonKey(name: "current_page") int get currentPage; + @override @JsonKey(name: "first_page_url") String get firstPageUrl; + @override int get from; + @override @JsonKey(name: "last_page") int get lastPage; + @override @JsonKey(name: "last_page_url") String get lastPageUrl; + @override @JsonKey(name: "next_page_url") String get nextPageUrl; + @override String get path; + @override @JsonKey(name: "per_page") int get perPage; + @override @JsonKey(name: "prev_page_url") dynamic get prevPageUrl; + @override int get to; + @override int get total; + @override @JsonKey(ignore: true) - _$$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 d1e483f1..fd36d17d 100644 --- a/lib/features/feed/models/recipes_pagination_model.g.dart +++ b/lib/features/feed/models/recipes_pagination_model.g.dart @@ -6,12 +6,8 @@ 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(), currentPage: (json['current_page'] as num).toInt(), firstPageUrl: json['first_page_url'] as String, from: (json['from'] as num).toInt(), @@ -25,9 +21,7 @@ _$RecipesPaginationImpl _$$RecipesPaginationImplFromJson( total: (json['total'] as num).toInt(), ); -Map _$$RecipesPaginationImplToJson( - _$RecipesPaginationImpl instance) => - { +Map _$$RecipesPaginationImplToJson(_$RecipesPaginationImpl instance) => { 'data': instance.recipesList, 'current_page': instance.currentPage, 'first_page_url': instance.firstPageUrl, 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 ab3385f3..1bb34c36 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 @@ -24,6 +24,7 @@ mixin _$FeedState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,35 +71,28 @@ 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; } /// @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); } /// @nodoc @@ -113,8 +107,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 @@ -201,18 +194,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); } /// @nodoc @@ -227,8 +216,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 @@ -315,20 +303,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}); } /// @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); @pragma('vm:prefer-inline') @override @@ -347,15 +330,13 @@ class __$$FeedStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$FeedStateLoadedImpl implements FeedStateLoaded { - const _$FeedStateLoadedImpl( - {required final List feedBlogPostList}) - : _feedBlogPostList = feedBlogPostList; + const _$FeedStateLoadedImpl({required final List feedBlogPostList}) : _feedBlogPostList = feedBlogPostList; final List _feedBlogPostList; + @override List get feedBlogPostList { - if (_feedBlogPostList is EqualUnmodifiableListView) - return _feedBlogPostList; + if (_feedBlogPostList is EqualUnmodifiableListView) return _feedBlogPostList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_feedBlogPostList); } @@ -370,20 +351,16 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateLoadedImpl && - const DeepCollectionEquality() - .equals(other._feedBlogPostList, _feedBlogPostList)); + const DeepCollectionEquality().equals(other._feedBlogPostList, _feedBlogPostList)); } @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList)); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList)); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => - __$$FeedStateLoadedImplCopyWithImpl<_$FeedStateLoadedImpl>( - this, _$identity); + _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => __$$FeedStateLoadedImplCopyWithImpl<_$FeedStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -461,32 +438,25 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { } abstract class FeedStateLoaded implements FeedState { - const factory FeedStateLoaded( - {required final List feedBlogPostList}) = - _$FeedStateLoadedImpl; + const factory FeedStateLoaded({required final List feedBlogPostList}) = _$FeedStateLoadedImpl; List get feedBlogPostList; + @JsonKey(ignore: true) - _$$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); @pragma('vm:prefer-inline') @override @@ -520,8 +490,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 @@ -530,9 +499,7 @@ class _$FeedStateErrorImpl implements FeedStateError { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => - __$$FeedStateErrorImplCopyWithImpl<_$FeedStateErrorImpl>( - this, _$identity); + _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => __$$FeedStateErrorImplCopyWithImpl<_$FeedStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -610,11 +577,10 @@ 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; + @JsonKey(ignore: true) - _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart index 8d8aeb2e..8cd8a522 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart @@ -15,4 +15,4 @@ class RecipesCubit extends Cubit { emit(RecipesState.error(errorMessage: e.toString())); } } -} \ No newline at end of file +} 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 e8aa88e0..928221ed 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 @@ -24,6 +24,7 @@ mixin _$RecipesState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,36 +71,28 @@ 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; } /// @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); } /// @nodoc @@ -114,8 +107,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 @@ -202,18 +194,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); } /// @nodoc @@ -228,9 +216,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 @@ -317,20 +303,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}); } /// @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); @pragma('vm:prefer-inline') @override @@ -349,10 +332,10 @@ class __$$RecipesStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$RecipesStateLoadedImpl implements RecipesStateLoaded { - const _$RecipesStateLoadedImpl({required final List recipesList}) - : _recipesList = recipesList; + const _$RecipesStateLoadedImpl({required final List recipesList}) : _recipesList = recipesList; final List _recipesList; + @override List get recipesList { if (_recipesList is EqualUnmodifiableListView) return _recipesList; @@ -368,22 +351,17 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$RecipesStateLoadedImpl && - const DeepCollectionEquality() - .equals(other._recipesList, _recipesList)); + (other.runtimeType == runtimeType && other is _$RecipesStateLoadedImpl && const DeepCollectionEquality().equals(other._recipesList, _recipesList)); } @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_recipesList)); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_recipesList)); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => - __$$RecipesStateLoadedImplCopyWithImpl<_$RecipesStateLoadedImpl>( - this, _$identity); + __$$RecipesStateLoadedImplCopyWithImpl<_$RecipesStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -461,31 +439,27 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { } abstract class RecipesStateLoaded implements RecipesState { - const factory RecipesStateLoaded({required final List recipesList}) = - _$RecipesStateLoadedImpl; + const factory RecipesStateLoaded({required final List recipesList}) = _$RecipesStateLoadedImpl; List get recipesList; + @JsonKey(ignore: true) - _$$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); @pragma('vm:prefer-inline') @override @@ -519,8 +493,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 @@ -529,9 +502,7 @@ class _$RecipesStateErrorImpl implements RecipesStateError { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => - __$$RecipesStateErrorImplCopyWithImpl<_$RecipesStateErrorImpl>( - this, _$identity); + _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => __$$RecipesStateErrorImplCopyWithImpl<_$RecipesStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -609,11 +580,10 @@ 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; + @JsonKey(ignore: true) - _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/widgets/blog_post_widget.dart b/lib/features/feed/presentation/widgets/blog_post_widget.dart index 1139fe0f..ee629c33 100644 --- a/lib/features/feed/presentation/widgets/blog_post_widget.dart +++ b/lib/features/feed/presentation/widgets/blog_post_widget.dart @@ -20,10 +20,11 @@ class _BlogPostWidgetState extends State { Widget build(BuildContext context) { return InkWell( borderRadius: BorderRadius.circular(12), - onTap: () => GoRouter.of(context).pushNamed( - 'blogPostScreen', - extra: widget.feedBlogPostModel.id.toString(), - ), + onTap: () => + GoRouter.of(context).pushNamed( + 'blogPostScreen', + extra: widget.feedBlogPostModel.id.toString(), + ), child: Ink( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), diff --git a/lib/features/feed/presentation/widgets/recipes_widget.dart b/lib/features/feed/presentation/widgets/recipes_widget.dart index 233e45bb..751612fa 100644 --- a/lib/features/feed/presentation/widgets/recipes_widget.dart +++ b/lib/features/feed/presentation/widgets/recipes_widget.dart @@ -4,6 +4,7 @@ import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart'; import 'package:eatvio_app/features/feed/models/recipes_model.dart'; import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; class RecipesWidget extends StatefulWidget { final Recipes recipes; @@ -19,7 +20,7 @@ class _RecipesWidgetState extends State { Widget build(BuildContext context) { return InkWell( borderRadius: BorderRadius.circular(12), - onTap: () {}, + onTap: () => GoRouter.of(context).pushNamed('aboutRecipesScreen', extra: widget.recipes), child: Ink( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), @@ -30,7 +31,6 @@ class _RecipesWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Stack( - alignment: Alignment.bottomLeft, children: [ ClipRRect( borderRadius: BorderRadius.vertical(top: Radius.circular(12)), @@ -52,64 +52,78 @@ class _RecipesWidgetState extends State { ), ), ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Row( + Positioned( + left: 8, + bottom: 8, + child: Wrap( + runSpacing: 8, children: [ - Container( - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4), - decoration: BoxDecoration( - color: Colors.white54, - borderRadius: BorderRadius.circular(16), - ), - child: Row( - children: [ - Icon( - Icons.visibility_rounded, - size: 20, - color: Colors.black, - ), - SizedBox(width: 4), - Text( - '0', - style: TextStyle( - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w400, - ), - ), - ], - ), - ), + _iconButton(Icons.fastfood, '139.9 ккал'), SizedBox(width: 8), - Container( - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4), - decoration: BoxDecoration( - color: Colors.white54, - borderRadius: BorderRadius.circular(16), - ), - child: Row( - children: [ - Icon( - Icons.favorite_border_rounded, - size: 20, - color: Colors.black, - ), - SizedBox(width: 4), - Text( - '0', - style: TextStyle( - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w400, - ), - ), - ], - ), - ), + _iconButton(Icons.timer_rounded, widget.recipes.cookingTime.toString() + ' минут'), + SizedBox(width: 8), + _iconButton(Icons.fast_forward_rounded, widget.recipes.steps.length.toString() + ' этапов'), ], ), ), + Positioned( + left: 8, + top: 8, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.8), + borderRadius: BorderRadius.circular(16), + ), + child: Row( + children: [ + Icon( + Icons.favorite_rounded, + size: 16, + color: Colors.black, + ), + SizedBox(width: 4), + Text( + '0', + style: TextStyle( + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.w400, + ), + ), + ], + ), + ), + ), + Positioned( + right: 8, + top: 8, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.8), + borderRadius: BorderRadius.circular(16), + ), + child: Row( + children: [ + Icon( + Icons.visibility_rounded, + size: 16, + color: Colors.black, + ), + SizedBox(width: 4), + Text( + '0', + style: TextStyle( + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.w400, + ), + ), + ], + ), + ), + ), ], ), SizedBox(height: 12), @@ -134,20 +148,6 @@ class _RecipesWidgetState extends State { ), ), SizedBox(height: 12), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 12), - child: Wrap( - runSpacing: 8, - children: [ - _iconButton(Icons.fastfood, '139.9 ккал'), - SizedBox(width: 8), - _iconButton(Icons.timer_rounded, widget.recipes.cookingTime.toString() + ' минут'), - SizedBox(width: 8), - _iconButton(Icons.fast_forward_rounded, widget.recipes.steps.length.toString() + ' этапов'), - ], - ), - ), - SizedBox(height: 8), ], ), ), @@ -155,10 +155,10 @@ class _RecipesWidgetState extends State { } _iconButton(IconData icon, [String? text]) { - return Ink( + return Container( padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4), decoration: BoxDecoration( - color: appTheme.gray100, + color: Colors.white.withOpacity(0.8), borderRadius: BorderRadius.circular(16), ), height: 32, @@ -167,16 +167,16 @@ class _RecipesWidgetState extends State { children: [ Icon( icon, - size: 20, - color: appTheme.gray600, + size: 16, + color: Colors.black, ), if (text != null) SizedBox(width: 8), if (text != null) Text( text, style: TextStyle( - fontSize: 14, - color: appTheme.gray600, + fontSize: 12, + color: Colors.black, fontWeight: FontWeight.w500, ), ), diff --git a/lib/features/feed/services/feed_service.g.dart b/lib/features/feed/services/feed_service.g.dart index fbccc937..a8d9ec05 100644 --- a/lib/features/feed/services/feed_service.g.dart +++ b/lib/features/feed/services/feed_service.g.dart @@ -24,23 +24,22 @@ class _FeedService implements FeedService { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _result = await _dio.fetch>( - _setStreamType(Options( + final _result = await _dio.fetch>(_setStreamType(Options( method: 'GET', headers: _headers, extra: _extra, ) - .compose( - _dio.options, - '/api/blogPosts/index', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - )))); + .compose( + _dio.options, + '/api/blogPosts/index', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final _value = FeedBlogPostSettingsModel.fromJson(_result.data!); return _value; } @@ -51,31 +50,28 @@ class _FeedService implements FeedService { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _result = await _dio - .fetch>(_setStreamType(Options( + final _result = await _dio.fetch>(_setStreamType(Options( method: 'GET', headers: _headers, extra: _extra, ) - .compose( - _dio.options, - '/api/recipes/index', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - )))); + .compose( + _dio.options, + '/api/recipes/index', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final _value = RecipesPagination.fromJson(_result.data!); return _value; } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/recipes/presentation/pages/about_recipes_screen.dart b/lib/features/recipes/presentation/pages/about_recipes_screen.dart index e69de29b..aa83ef21 100644 --- a/lib/features/recipes/presentation/pages/about_recipes_screen.dart +++ b/lib/features/recipes/presentation/pages/about_recipes_screen.dart @@ -0,0 +1,49 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/features/feed/models/recipes_model.dart' as step; +import 'package:eatvio_app/features/feed/models/recipes_model.dart'; +import 'package:flutter/material.dart'; + +class AboutRecipesScreen extends StatelessWidget { + final Recipes recipes; + + const AboutRecipesScreen({super.key, required this.recipes}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(), + body: SingleChildScrollView( + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(recipes.title), + Row( + children: [ + Text(recipes.cookingTime.toString() + ' минут'), + SizedBox(width: 16), + Text(recipes.steps.length.toString() + ' этапов'), + ], + ), + Text(recipes.videoUrl), + CachedNetworkImage(imageUrl: baseUrl + '/storage/' + recipes.image), + Text(recipes.ingredients.toString()), + Text('Пошаговый рецепт'), + for (int i = 0; i < recipes.steps.length; i++) ...[_step(recipes.steps[i])], + ], + ), + ), + ); + } + + _step(step.Step step) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(step.description), + if (step.image.length > 1) CachedNetworkImage(imageUrl: baseUrl + '/storage/' + step.image), + ], + ); + } +} diff --git a/lib/features/registration/models/location_model.freezed.dart b/lib/features/registration/models/location_model.freezed.dart index f640ca2e..852b5f25 100644 --- a/lib/features/registration/models/location_model.freezed.dart +++ b/lib/features/registration/models/location_model.freezed.dart @@ -21,33 +21,31 @@ LocationModel _$LocationModelFromJson(Map json) { /// @nodoc mixin _$LocationModel { List get locations => throw _privateConstructorUsedError; + @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $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; @@ -71,25 +69,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); @pragma('vm:prefer-inline') @override @@ -113,15 +103,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; @@ -143,22 +130,18 @@ 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(ignore: true) @override - int get hashCode => Object.hash(runtimeType, - const DeepCollectionEquality().hash(_locations), responseBody); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_locations), responseBody); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => - __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); + _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); @override Map toJson() { @@ -169,21 +152,19 @@ 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; + @override @JsonKey(ignore: true) - _$$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/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart index dcb49236..63ae2c04 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 @@ -19,15 +19,13 @@ mixin _$RegistrationState { UserRegistrationSheet get sheet => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $RegistrationStateCopyWith get copyWith => - throw _privateConstructorUsedError; + $RegistrationStateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RegistrationStateCopyWith<$Res> { - factory $RegistrationStateCopyWith( - RegistrationState value, $Res Function(RegistrationState) then) = - _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; + factory $RegistrationStateCopyWith(RegistrationState value, $Res Function(RegistrationState) then) = _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; + @useResult $Res call({UserRegistrationSheet sheet}); @@ -35,12 +33,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; @@ -67,11 +65,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}); @@ -81,12 +78,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); @pragma('vm:prefer-inline') @override @@ -118,9 +112,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 @@ -129,19 +121,16 @@ class _$RegistrationStateImpl implements _RegistrationState { @JsonKey(ignore: true) @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; + @override @JsonKey(ignore: true) - _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/presentation/pages/credentials_screen.dart b/lib/features/registration/presentation/pages/credentials_screen.dart index dc9d548b..25b0a2a1 100644 --- a/lib/features/registration/presentation/pages/credentials_screen.dart +++ b/lib/features/registration/presentation/pages/credentials_screen.dart @@ -41,6 +41,7 @@ class _CredentialsScreenState extends State { CustomTextFormField( controller: emailController, textInputType: TextInputType.emailAddress, + keyboardType: TextInputType.emailAddress, hintText: 'Введите email', textInputAction: TextInputAction.next, onChanged: (newValue) { diff --git a/lib/features/registration/services/registration_service.g.dart b/lib/features/registration/services/registration_service.g.dart index 9820fd33..d37f0f38 100644 --- a/lib/features/registration/services/registration_service.g.dart +++ b/lib/features/registration/services/registration_service.g.dart @@ -19,30 +19,28 @@ class _RegistrationService implements RegistrationService { String? baseUrl; @override - Future> register( - {required Map sheet}) async { + Future> register({required Map sheet}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(sheet); - final _result = await _dio.fetch>( - _setStreamType>(Options( + final _result = await _dio.fetch>(_setStreamType>(Options( method: 'POST', headers: _headers, extra: _extra, ) - .compose( - _dio.options, - '/api/register', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - )))); + .compose( + _dio.options, + '/api/register', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final _value = _result.data!.cast(); return _value; } @@ -53,23 +51,22 @@ class _RegistrationService implements RegistrationService { final queryParameters = {r'user_address': query}; final _headers = {}; const Map? _data = null; - final _result = await _dio - .fetch>(_setStreamType(Options( + final _result = await _dio.fetch>(_setStreamType(Options( method: 'GET', headers: _headers, extra: _extra, ) - .compose( - _dio.options, - '/api/location_by_address', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - )))); + .compose( + _dio.options, + '/api/location_by_address', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final _value = LocationModel.fromJson(_result.data!); return _value; } @@ -86,31 +83,28 @@ class _RegistrationService implements RegistrationService { }; final _headers = {}; const Map? _data = null; - final _result = await _dio - .fetch>(_setStreamType(Options( + final _result = await _dio.fetch>(_setStreamType(Options( method: 'GET', headers: _headers, extra: _extra, ) - .compose( - _dio.options, - '/api/location_by_coordinate', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - )))); + .compose( + _dio.options, + '/api/location_by_coordinate', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final _value = LocationModel.fromJson(_result.data!); return _value; } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/localization/app_localization.dart b/lib/localization/app_localization.dart index 0c0b2568..b477c9a4 100644 --- a/lib/localization/app_localization.dart +++ b/lib/localization/app_localization.dart @@ -13,6 +13,7 @@ class AppLocalization { static final Map> _localizedValues = { 'ru': ru, }; + /*static final Map> __localizedValues = { 'en': enUs };*/ @@ -33,6 +34,7 @@ class AppLocalization { } static List languages() => _localizedValues.keys.toList(); + String getString(String text) => _localizedValues[locale.languageCode]![text] ?? text; } diff --git a/lib/locator_service.dart b/lib/locator_service.dart index 5947a11c..5ca320fe 100644 --- a/lib/locator_service.dart +++ b/lib/locator_service.dart @@ -12,13 +12,13 @@ import 'package:eatvio_app/features/calendar/services/calendar_service.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart'; import 'package:eatvio_app/features/chat/repositories/chat_repository.dart'; import 'package:eatvio_app/features/chat/services/chat_service.dart'; +import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; +import 'package:eatvio_app/features/diary/repositories/diary_repository.dart'; +import 'package:eatvio_app/features/diary/services/diary_service.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart'; import 'package:eatvio_app/features/feed/repositories/feed_repository.dart'; import 'package:eatvio_app/features/feed/services/feed_service.dart'; -import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; -import 'package:eatvio_app/features/diary/repositories/diary_repository.dart'; -import 'package:eatvio_app/features/diary/services/diary_service.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/features/registration/repositories/registration_repository.dart'; import 'package:eatvio_app/features/registration/services/registration_service.dart'; diff --git a/lib/main.dart b/lib/main.dart index 03f769a7..fdc96e6a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,21 +6,22 @@ import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/noti import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart'; import 'package:eatvio_app/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart'; +import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart'; +import 'package:eatvio_app/locator_service.dart' as di; import 'package:eatvio_app/locator_service.dart'; -import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; import 'package:eatvio_app/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart'; import 'package:eatvio_app/presentation/profile/my_profile_screen/models/my_profile_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'core/app_export.dart'; import 'package:hive_flutter/hive_flutter.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:keyboard_dismisser/keyboard_dismisser.dart'; -import 'package:eatvio_app/locator_service.dart' as di; import 'package:intl/date_symbol_data_local.dart'; +import 'package:keyboard_dismisser/keyboard_dismisser.dart'; +import 'package:path_provider/path_provider.dart'; + +import 'core/app_export.dart'; var globalMessengerKey = GlobalKey(); diff --git a/lib/presentation/auth/auth_screen/auth_screen.dart b/lib/presentation/auth/auth_screen/auth_screen.dart index adf6cf50..5f11a97e 100644 --- a/lib/presentation/auth/auth_screen/auth_screen.dart +++ b/lib/presentation/auth/auth_screen/auth_screen.dart @@ -55,6 +55,7 @@ class _AuthScreenState extends State { return CustomTextFormField( controller: emailController, textInputAction: TextInputAction.next, + keyboardType: TextInputType.emailAddress, textInputType: TextInputType.emailAddress, hintText: 'Введите email', ); diff --git a/lib/presentation/auth/auth_screen/bloc/auth_state.dart b/lib/presentation/auth/auth_screen/bloc/auth_state.dart index 504180f0..86e8e3b0 100644 --- a/lib/presentation/auth/auth_screen/bloc/auth_state.dart +++ b/lib/presentation/auth/auth_screen/bloc/auth_state.dart @@ -22,6 +22,7 @@ class AuthState extends Equatable { passwordController, authModelObj, ]; + AuthState copyWith({ TextEditingController? emailController, TextEditingController? passwordController, diff --git a/lib/presentation/diets/diet_create_screen/bloc/diet_create_state.dart b/lib/presentation/diets/diet_create_screen/bloc/diet_create_state.dart index 6b42e385..e063a438 100644 --- a/lib/presentation/diets/diet_create_screen/bloc/diet_create_state.dart +++ b/lib/presentation/diets/diet_create_screen/bloc/diet_create_state.dart @@ -14,6 +14,7 @@ class DietCreateState extends Equatable { @override List get props => [dietModelObj]; + DietCreateState copyWith({DietCreateModel? dietModelObj}) { return DietCreateState( dietModelObj: dietModelObj ?? this.dietModelObj, @@ -31,12 +32,14 @@ class DietCreateLoadedState extends DietCreateState { DietCreateModel? dietModelObj; TextEditingController? name; TextEditingController? details; + @override List get props => [ dietModelObj, name, details, ]; + DietCreateLoadedState copyWith({ DietCreateModel? dietModelObj, TextEditingController? name, diff --git a/lib/presentation/diets/diet_select_screen/bloc/diet_select_event.dart b/lib/presentation/diets/diet_select_screen/bloc/diet_select_event.dart index 91372953..75a889b6 100644 --- a/lib/presentation/diets/diet_select_screen/bloc/diet_select_event.dart +++ b/lib/presentation/diets/diet_select_screen/bloc/diet_select_event.dart @@ -17,7 +17,9 @@ class DietSelectInitialEvent extends DietSelectEvent { class UploadAvatar extends DietSelectEvent { UploadAvatar(this.image); + final XFile image; + @override List get props => [image]; } diff --git a/lib/presentation/diets/diet_select_screen/bloc/diet_select_state.dart b/lib/presentation/diets/diet_select_screen/bloc/diet_select_state.dart index 85b7d5ab..64014819 100644 --- a/lib/presentation/diets/diet_select_screen/bloc/diet_select_state.dart +++ b/lib/presentation/diets/diet_select_screen/bloc/diet_select_state.dart @@ -21,11 +21,13 @@ class DietSelectLoadedState extends DietSelectState { DietSelectModel? myProfileModelObj; List? posts; + @override List get props => [ myProfileModelObj, posts, ]; + DietSelectLoadedState copyWith({ DietSelectModel? myProfileModelObj, List? posts, diff --git a/lib/presentation/diets/diet_show_screen/bloc/diet_show_event.dart b/lib/presentation/diets/diet_show_screen/bloc/diet_show_event.dart index 6a131d5c..c79eaf3f 100644 --- a/lib/presentation/diets/diet_show_screen/bloc/diet_show_event.dart +++ b/lib/presentation/diets/diet_show_screen/bloc/diet_show_event.dart @@ -17,7 +17,9 @@ class DietInitialEvent extends DietEvent { class DeleteEntry extends DietEvent { DeleteEntry(this.id); + final int id; + @override List get props => [id]; } diff --git a/lib/presentation/diets/diet_show_screen/bloc/diet_show_state.dart b/lib/presentation/diets/diet_show_screen/bloc/diet_show_state.dart index d587263f..32070c14 100644 --- a/lib/presentation/diets/diet_show_screen/bloc/diet_show_state.dart +++ b/lib/presentation/diets/diet_show_screen/bloc/diet_show_state.dart @@ -14,6 +14,7 @@ class DietState extends Equatable { @override List get props => [dietModelObj]; + DietState copyWith({DietModel? dietModelObj}) { return DietState( dietModelObj: dietModelObj ?? this.dietModelObj, @@ -26,8 +27,10 @@ class DietLoadedState extends DietState { DietModel? dietModelObj; Map? diet; + @override List get props => [dietModelObj, diet]; + DietLoadedState copyWith({DietModel? dietModelObj, Map? diet}) { return DietLoadedState( dietModelObj: dietModelObj ?? this.dietModelObj, diff --git a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart b/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart index 184938ad..798b771c 100644 --- a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart +++ b/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_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/locator_service.dart'; @@ -12,7 +13,6 @@ import 'package:image_picker/image_picker.dart'; import '/core/app_export.dart'; part 'blog_post_create_event.dart'; - part 'blog_post_create_state.dart'; /// A bloc that manages the state of a BlogPostCreate according to the event that is dispatched to it. diff --git a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart b/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart index d78db89d..3fa6f7bf 100644 --- a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart +++ b/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart @@ -14,6 +14,7 @@ class BlogPostEditState extends Equatable { @override List get props => [blog_postModelObj]; + BlogPostEditState copyWith({BlogPostEditModel? blog_postModelObj}) { return BlogPostEditState( blog_postModelObj: blog_postModelObj ?? this.blog_postModelObj, @@ -35,8 +36,10 @@ class BlogPostEditLoadedState extends BlogPostEditState { TextEditingController? title; TextEditingController? description; TextEditingController? youtubeURL; + @override List get props => [blog_postModelObj, blog_post, title, description, youtubeURL]; + BlogPostEditLoadedState copyWith({ BlogPostEditModel? blog_postModelObj, Map? blog_post, diff --git a/lib/presentation/feed/blog_post_screen/models/blog_post_model.dart b/lib/presentation/feed/blog_post_screen/models/blog_post_model.dart index 73e9c6ab..106b3b59 100644 --- a/lib/presentation/feed/blog_post_screen/models/blog_post_model.dart +++ b/lib/presentation/feed/blog_post_screen/models/blog_post_model.dart @@ -5,7 +5,9 @@ import 'package:equatable/equatable.dart'; class BlogPostModel extends Equatable { final String blog_postID; + BlogPostModel({required this.blog_postID, this.comments = const []}); + List comments; BlogPostModel copyWith({String? blog_postID, List? comments}) { diff --git a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_event.dart b/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_event.dart index f3fb4dd2..29cabd5f 100644 --- a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_event.dart +++ b/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_event.dart @@ -17,14 +17,18 @@ class GlossaryInitialEvent extends GlossaryEvent { class DeleteEntry extends GlossaryEvent { DeleteEntry(this.id); + final int id; + @override List get props => [id]; } class ChangeProductGroup extends GlossaryEvent { ChangeProductGroup(this.id); + final int id; + @override List get props => [id]; } diff --git a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_state.dart b/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_state.dart index 42119a8c..a3d819f2 100644 --- a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_state.dart +++ b/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_state.dart @@ -14,6 +14,7 @@ class GlossaryState extends Equatable { @override List get props => [glossaryModelObj]; + GlossaryState copyWith({GlossaryModel? glossaryModelObj}) { return GlossaryState( glossaryModelObj: glossaryModelObj ?? this.glossaryModelObj, @@ -33,8 +34,10 @@ class GlossaryLoadedState extends GlossaryState { String? token; List? productGroups; List? productList; + @override List get props => [glossaryModelObj, productGroups, productList, token]; + GlossaryLoadedState copyWith({ GlossaryModel? glossaryModelObj, String? token, diff --git a/lib/presentation/glossary/glossary_screen/models/glossary_screen_model.dart b/lib/presentation/glossary/glossary_screen/models/glossary_screen_model.dart index d19bbb54..1077bd61 100644 --- a/lib/presentation/glossary/glossary_screen/models/glossary_screen_model.dart +++ b/lib/presentation/glossary/glossary_screen/models/glossary_screen_model.dart @@ -7,6 +7,7 @@ import 'package:equatable/equatable.dart'; class GlossaryModel extends Equatable { GlossaryModel(); + GlossaryModel copyWith() { return GlossaryModel(); } diff --git a/lib/presentation/plans/plan_create_screen/bloc/plan_create_state.dart b/lib/presentation/plans/plan_create_screen/bloc/plan_create_state.dart index 4e98812c..f2485655 100644 --- a/lib/presentation/plans/plan_create_screen/bloc/plan_create_state.dart +++ b/lib/presentation/plans/plan_create_screen/bloc/plan_create_state.dart @@ -14,6 +14,7 @@ class PlanCreateState extends Equatable { @override List get props => [planModelObj]; + PlanCreateState copyWith({PlanCreateModel? planModelObj}) { return PlanCreateState( planModelObj: planModelObj ?? this.planModelObj, @@ -31,12 +32,14 @@ class PlanCreateLoadedState extends PlanCreateState { PlanCreateModel? planModelObj; TextEditingController? name; TextEditingController? details; + @override List get props => [ planModelObj, name, details, ]; + PlanCreateLoadedState copyWith({ PlanCreateModel? planModelObj, TextEditingController? name, diff --git a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_state.dart b/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_state.dart index e3cf6b85..57e0a3ab 100644 --- a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_state.dart +++ b/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_state.dart @@ -14,6 +14,7 @@ class PlanEditState extends Equatable { @override List get props => [planModelObj]; + PlanEditState copyWith({PlanEditModel? planModelObj}) { return PlanEditState( planModelObj: planModelObj ?? this.planModelObj, @@ -35,8 +36,10 @@ class PlanEditLoadedState extends PlanEditState { TextEditingController? name; TextEditingController? details; TextEditingController? duration; + @override List get props => [planModelObj, plan, name, details, duration]; + PlanEditLoadedState copyWith({ PlanEditModel? planModelObj, Map? plan, diff --git a/lib/presentation/plans/plan_select_screen/bloc/plan_select_event.dart b/lib/presentation/plans/plan_select_screen/bloc/plan_select_event.dart index 5cb4b41b..1cae632f 100644 --- a/lib/presentation/plans/plan_select_screen/bloc/plan_select_event.dart +++ b/lib/presentation/plans/plan_select_screen/bloc/plan_select_event.dart @@ -17,7 +17,9 @@ class PlanSelectInitialEvent extends PlanSelectEvent { class UploadAvatar extends PlanSelectEvent { UploadAvatar(this.image); + final XFile image; + @override List get props => [image]; } diff --git a/lib/presentation/plans/plan_select_screen/bloc/plan_select_state.dart b/lib/presentation/plans/plan_select_screen/bloc/plan_select_state.dart index 2c8561b0..b5245be7 100644 --- a/lib/presentation/plans/plan_select_screen/bloc/plan_select_state.dart +++ b/lib/presentation/plans/plan_select_screen/bloc/plan_select_state.dart @@ -21,11 +21,13 @@ class PlanSelectLoadedState extends PlanSelectState { PlanSelectModel? myProfileModelObj; List? posts; + @override List get props => [ myProfileModelObj, posts, ]; + PlanSelectLoadedState copyWith({ PlanSelectModel? myProfileModelObj, List? posts, diff --git a/lib/presentation/plans/plan_show_screen/bloc/plan_show_event.dart b/lib/presentation/plans/plan_show_screen/bloc/plan_show_event.dart index fc83e024..6572e250 100644 --- a/lib/presentation/plans/plan_show_screen/bloc/plan_show_event.dart +++ b/lib/presentation/plans/plan_show_screen/bloc/plan_show_event.dart @@ -17,7 +17,9 @@ class PlanInitialEvent extends PlanEvent { class DeleteEntry extends PlanEvent { DeleteEntry(this.id); + final int id; + @override List get props => [id]; } diff --git a/lib/presentation/plans/plan_show_screen/bloc/plan_show_state.dart b/lib/presentation/plans/plan_show_screen/bloc/plan_show_state.dart index 50527102..127be045 100644 --- a/lib/presentation/plans/plan_show_screen/bloc/plan_show_state.dart +++ b/lib/presentation/plans/plan_show_screen/bloc/plan_show_state.dart @@ -14,6 +14,7 @@ class PlanState extends Equatable { @override List get props => [planModelObj]; + PlanState copyWith({PlanModel? planModelObj}) { return PlanState( planModelObj: planModelObj ?? this.planModelObj, @@ -26,8 +27,10 @@ class PlanLoadedState extends PlanState { PlanModel? planModelObj; Map? plan; + @override List get props => [planModelObj, plan]; + PlanLoadedState copyWith({PlanModel? planModelObj, Map? plan}) { return PlanLoadedState( planModelObj: planModelObj ?? this.planModelObj, diff --git a/lib/presentation/profile/my_profile_screen/bloc/my_profile_event.dart b/lib/presentation/profile/my_profile_screen/bloc/my_profile_event.dart index ca76f246..e6822525 100644 --- a/lib/presentation/profile/my_profile_screen/bloc/my_profile_event.dart +++ b/lib/presentation/profile/my_profile_screen/bloc/my_profile_event.dart @@ -17,7 +17,9 @@ class MyProfileInitialEvent extends MyProfileEvent { class UploadAvatar extends MyProfileEvent { UploadAvatar(this.image); + final XFile image; + @override List get props => [image]; } diff --git a/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart b/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart index 85c254d1..002d6f0d 100644 --- a/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart +++ b/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart @@ -90,6 +90,7 @@ class MyProfileLoadedState extends MyProfileState { String? selectedActivity; String? hypoFormController; String? hyperFormController; + @override List get props => [ myProfileModelObj, @@ -127,6 +128,7 @@ class MyProfileLoadedState extends MyProfileState { hypoFormController, hyperFormController, ]; + MyProfileLoadedState copyWith({ MyProfileModel? myProfileModelObj, Map? user, diff --git a/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_event.dart b/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_event.dart index 085045d4..85d8ee4f 100644 --- a/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_event.dart +++ b/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_event.dart @@ -22,19 +22,23 @@ class CreateRecipe extends RecipeCreateEvent { class AddStep extends RecipeCreateEvent { AddStep(); + @override List get props => []; } class RemoveStep extends RecipeCreateEvent { RemoveStep(this.id); + final int id; + @override List get props => [id]; } class ReloadScreen extends RecipeCreateEvent { ReloadScreen(); + @override List get props => []; } diff --git a/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_state.dart b/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_state.dart index d58773af..d2e1b2b9 100644 --- a/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_state.dart +++ b/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_state.dart @@ -14,6 +14,7 @@ class RecipeCreateState extends Equatable { @override List get props => [recipeModelObj]; + RecipeCreateState copyWith({RecipeCreateModel? recipeModelObj}) { return RecipeCreateState( recipeModelObj: recipeModelObj ?? this.recipeModelObj, @@ -41,6 +42,7 @@ class RecipeCreateLoadedState extends RecipeCreateState { TextEditingController? tags; List? steps; List? stepDescriptions; + @override List get props => [ recipeModelObj, @@ -52,6 +54,7 @@ class RecipeCreateLoadedState extends RecipeCreateState { tags, stepDescriptions, ]; + RecipeCreateLoadedState copyWith({ RecipeCreateModel? recipeModelObj, String? token, diff --git a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_event.dart b/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_event.dart index c6d49d38..b4bdd5f5 100644 --- a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_event.dart +++ b/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_event.dart @@ -22,19 +22,23 @@ class EditRecipe extends RecipeEditEvent { class AddStep extends RecipeEditEvent { AddStep(); + @override List get props => []; } class RemoveStep extends RecipeEditEvent { RemoveStep(this.id); + final int id; + @override List get props => [id]; } class ReloadScreen extends RecipeEditEvent { ReloadScreen(); + @override List get props => []; } diff --git a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart b/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart index 57df9f28..c01ffc41 100644 --- a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart +++ b/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart @@ -14,6 +14,7 @@ class RecipeEditState extends Equatable { @override List get props => [recipeModelObj]; + RecipeEditState copyWith({RecipeEditModel? recipeModelObj}) { return RecipeEditState( recipeModelObj: recipeModelObj ?? this.recipeModelObj, @@ -45,8 +46,10 @@ class RecipeEditLoadedState extends RecipeEditState { List? steps; List? tags; List? stepDescriptions; + @override List get props => [recipeModelObj, recipe, title, description, video_url]; + RecipeEditLoadedState copyWith({ RecipeEditModel? recipeModelObj, Map? recipe, diff --git a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_event.dart b/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_event.dart index 460c79c8..416e1f20 100644 --- a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_event.dart +++ b/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_event.dart @@ -17,7 +17,9 @@ class RecipeSelectInitialEvent extends RecipeSelectEvent { class UploadAvatar extends RecipeSelectEvent { UploadAvatar(this.image); + final XFile image; + @override List get props => [image]; } diff --git a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_state.dart b/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_state.dart index d320f903..02b6a79e 100644 --- a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_state.dart +++ b/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_state.dart @@ -21,11 +21,13 @@ class RecipeSelectLoadedState extends RecipeSelectState { RecipeSelectModel? myProfileModelObj; List? posts; + @override List get props => [ myProfileModelObj, posts, ]; + RecipeSelectLoadedState copyWith({ RecipeSelectModel? myProfileModelObj, List? posts, diff --git a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_event.dart b/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_event.dart index 7510c3a1..f2e71b7b 100644 --- a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_event.dart +++ b/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_event.dart @@ -17,14 +17,18 @@ class RecipeInitialEvent extends RecipeEvent { 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/presentation/recipe/recipe_show_screen/bloc/recipe_show_state.dart b/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_state.dart index 335ac202..0b7b2e83 100644 --- a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_state.dart +++ b/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_state.dart @@ -14,6 +14,7 @@ class RecipeState extends Equatable { @override List get props => [recipeModelObj]; + RecipeState copyWith({RecipeModel? recipeModelObj}) { return RecipeState( recipeModelObj: recipeModelObj ?? this.recipeModelObj, @@ -41,6 +42,7 @@ class RecipeLoadedState extends RecipeState { List? steps; List? tags; String? token; + @override List get props => [ recipeModelObj, @@ -51,6 +53,7 @@ class RecipeLoadedState extends RecipeState { commentController, steps, ]; + RecipeLoadedState copyWith({ RecipeModel? recipeModelObj, Map? recipe, diff --git a/lib/presentation/users/subscribers_screen/bloc/subscribers_state.dart b/lib/presentation/users/subscribers_screen/bloc/subscribers_state.dart index f934270d..2b34e5b9 100644 --- a/lib/presentation/users/subscribers_screen/bloc/subscribers_state.dart +++ b/lib/presentation/users/subscribers_screen/bloc/subscribers_state.dart @@ -21,11 +21,13 @@ class SubscribersLoadedState extends SubscribersState { SubscribersModel? myProfileModelObj; dynamic subscribers; + @override List get props => [ myProfileModelObj, subscribers, ]; + SubscribersLoadedState copyWith({ SubscribersModel? myProfileModelObj, dynamic subscribers, diff --git a/lib/theme/app_decoration.dart b/lib/theme/app_decoration.dart index 9ba1b22f..c84477ef 100644 --- a/lib/theme/app_decoration.dart +++ b/lib/theme/app_decoration.dart @@ -15,6 +15,7 @@ class AppDecoration { width: 1.h, ), ); + static BoxDecoration get outlinePrimary => BoxDecoration( color: theme.colorScheme.onPrimary, border: Border.all( @@ -22,27 +23,35 @@ class AppDecoration { width: 1.h, ), ); + static BoxDecoration get fillDeepOrange => BoxDecoration( color: appTheme.deepOrange900.withOpacity(0.8), ); + static BoxDecoration get fillGray => BoxDecoration( color: appTheme.gray50, ); + static BoxDecoration get fillGray100 => BoxDecoration( color: appTheme.gray100, ); + static BoxDecoration get fillGray60002 => BoxDecoration( color: appTheme.gray60002, ); + static BoxDecoration get fillGreenA => BoxDecoration( color: appTheme.greenA700.withOpacity(0.8), ); + static BoxDecoration get fillPrimary => BoxDecoration( color: theme.colorScheme.primary, ); + static BoxDecoration get fillWhiteA => BoxDecoration( color: appTheme.whiteA700, ); + static BoxDecoration get outlineBlueGray => BoxDecoration( border: Border.all( color: appTheme.blueGray800, @@ -78,6 +87,7 @@ class BorderRadiusStyle { ), ], ); + static BoxDecoration get outlineBlueGray => BoxDecoration( border: Border.all( color: appTheme.blueGray800, @@ -85,13 +95,16 @@ class BorderRadiusStyle { strokeAlign: strokeAlignOutside, ), ); + // Circle borders static BorderRadius get circleBorder17 => BorderRadius.circular( 17.h, ); + static BorderRadius get circleBorder20 => BorderRadius.circular( 20.h, ); + static BorderRadius get circleBorder62 => BorderRadius.circular( 62.h, ); @@ -100,9 +113,11 @@ class BorderRadiusStyle { static BorderRadius get customBorderBL8 => BorderRadius.only( bottomLeft: Radius.circular(8.h), ); + static BorderRadius get customBorderTL5 => BorderRadius.vertical( top: Radius.circular(5.h), ); + static BorderRadius get customBorderTL51 => BorderRadius.only( topLeft: Radius.circular(5.h), bottomRight: Radius.circular(5.h), @@ -112,9 +127,11 @@ class BorderRadiusStyle { static BorderRadius get roundedBorder12 => BorderRadius.circular( 12.h, ); + static BorderRadius get roundedBorder5 => BorderRadius.circular( 5.h, ); + static BorderRadius get roundedBorder8 => BorderRadius.circular( 8.h, ); diff --git a/lib/theme/bloc/theme_state.dart b/lib/theme/bloc/theme_state.dart index 2f93fff1..191bcfe4 100644 --- a/lib/theme/bloc/theme_state.dart +++ b/lib/theme/bloc/theme_state.dart @@ -8,6 +8,7 @@ class ThemeState extends Equatable { @override List get props => [themeType]; + ThemeState copyWith({String? themeType}) { return ThemeState(themeType: themeType ?? this.themeType); } diff --git a/lib/theme/custom_button_style.dart b/lib/theme/custom_button_style.dart index 60204f5e..bcd021c1 100644 --- a/lib/theme/custom_button_style.dart +++ b/lib/theme/custom_button_style.dart @@ -14,6 +14,7 @@ class CustomButtonStyles { borderRadius: BorderRadius.circular(15.h), ), ); + // text button style static ButtonStyle get none => ButtonStyle( backgroundColor: WidgetStateProperty.all(Colors.transparent), diff --git a/lib/widgets/custom_drop_down.dart b/lib/widgets/custom_drop_down.dart index fc166b20..96367d61 100644 --- a/lib/widgets/custom_drop_down.dart +++ b/lib/widgets/custom_drop_down.dart @@ -85,20 +85,22 @@ class CustomDropDown extends StatelessWidget { autofocus: autofocus!, value: value, isExpanded: true, - style: textStyle ?? TextStyle( - fontSize: 16, - fontWeight: FontWeight.w400, - ), + style: textStyle ?? + TextStyle( + fontSize: 16, + fontWeight: FontWeight.w400, + ), items: items?.map((SelectionPopupModel item) { return DropdownMenuItem( value: item, child: Text( item.title, - style: hintStyle ?? TextStyle( - fontSize: 16, - fontWeight: FontWeight.w400, - color: Colors.black, - ), + style: hintStyle ?? + TextStyle( + fontSize: 16, + fontWeight: FontWeight.w400, + color: Colors.black, + ), ), ); }).toList(), @@ -115,11 +117,12 @@ class CustomDropDown extends StatelessWidget { InputDecoration _buildInputDecoration(BuildContext context) { return InputDecoration( hintText: hintText ?? "", - hintStyle: hintStyle ?? TextStyle( - fontSize: 16, - fontWeight: FontWeight.w400, - color: Colors.grey.shade400, - ), + hintStyle: hintStyle ?? + TextStyle( + fontSize: 16, + fontWeight: FontWeight.w400, + color: Colors.grey.shade400, + ), prefixIcon: prefix, prefixIconConstraints: prefixConstraints, suffixIcon: suffix, diff --git a/lib/widgets/custom_edit_drop_down.dart b/lib/widgets/custom_edit_drop_down.dart index 7f56bbd8..26b42838 100644 --- a/lib/widgets/custom_edit_drop_down.dart +++ b/lib/widgets/custom_edit_drop_down.dart @@ -25,8 +25,8 @@ class CustomDropDown extends StatelessWidget { this.onChanged, this.defaultValue, }) : super( - key: key, - ); + key: key, + ); final Alignment? alignment; @@ -72,9 +72,9 @@ class CustomDropDown extends StatelessWidget { Widget build(BuildContext context) { return alignment != null ? Align( - alignment: alignment ?? Alignment.center, - child: _buildDropDownWidget(context), - ) + alignment: alignment ?? Alignment.center, + child: _buildDropDownWidget(context), + ) : _buildDropDownWidget(context); } @@ -85,14 +85,20 @@ class CustomDropDown extends StatelessWidget { focusNode: focusNode ?? FocusNode(), icon: icon, autofocus: autofocus!, - style: textStyle ?? Theme.of(context).textTheme.titleMedium, + style: textStyle ?? Theme + .of(context) + .textTheme + .titleMedium, items: items?.map((SelectionPopupModel item) { return DropdownMenuItem( value: item, child: Text( item.title, overflow: TextOverflow.ellipsis, - style: hintStyle ?? Theme.of(context).textTheme.titleMedium, + style: hintStyle ?? Theme + .of(context) + .textTheme + .titleMedium, ), ); }).toList(), @@ -111,7 +117,10 @@ class CustomDropDown extends StatelessWidget { InputDecoration _buildInputDecoration(BuildContext context) { return InputDecoration( hintText: hintText ?? "", - hintStyle: hintStyle ?? Theme.of(context).textTheme.titleMedium, + hintStyle: hintStyle ?? Theme + .of(context) + .textTheme + .titleMedium, prefixIcon: prefix, prefixIconConstraints: prefixConstraints, suffixIcon: suffix, @@ -123,7 +132,10 @@ class CustomDropDown extends StatelessWidget { top: 6, bottom: 6, ), - fillColor: fillColor ?? Theme.of(context).colorScheme.onPrimary, + fillColor: fillColor ?? Theme + .of(context) + .colorScheme + .onPrimary, filled: filled, border: borderDecoration ?? OutlineInputBorder( diff --git a/lib/widgets/custom_expandable_list.dart b/lib/widgets/custom_expandable_list.dart index a98dd33d..167c68e0 100644 --- a/lib/widgets/custom_expandable_list.dart +++ b/lib/widgets/custom_expandable_list.dart @@ -247,12 +247,16 @@ class _ExpandableListState extends State { value: value, child: SizedBox( // Используем SizedBox для ограничения ширины элемента списка - width: MediaQuery.of(context).size.width * 0.8, // Устанавливаем желаемую ширину элемента списка + width: MediaQuery + .of(context) + .size + .width * 0.8, // Устанавливаем желаемую ширину элемента списка child: Text(value), ), ); }).toList(), - isExpanded: true, // Расширяем список на всю доступную ширину + isExpanded: true, + // Расширяем список на всю доступную ширину decoration: InputDecoration(labelText: 'Активность'), ), Row( @@ -391,11 +395,9 @@ class _ExpandableListState extends State { return baseUrl + '/api/profile/update'; } - Future _sendHttpRequest( - Map profileData, - String apiUrl, - String? token, - ) { + Future _sendHttpRequest(Map profileData, + String apiUrl, + String? token,) { return http.post( Uri.parse(apiUrl), body: json.encode(profileData), @@ -420,16 +422,17 @@ class _ExpandableListState extends State { void _showErrorDialog(String errorMessage) { showDialog( context: context, - builder: (context) => AlertDialog( - title: Text('Ошибка'), - content: Text(errorMessage), - actions: [ - TextButton( - onPressed: onTapOk(context), - child: Text('OK'), + builder: (context) => + AlertDialog( + title: Text('Ошибка'), + content: Text(errorMessage), + actions: [ + TextButton( + onPressed: onTapOk(context), + child: Text('OK'), + ), + ], ), - ], - ), ); } diff --git a/lib/widgets/custom_hyper_switch.dart b/lib/widgets/custom_hyper_switch.dart index edad8ec6..3d28d053 100644 --- a/lib/widgets/custom_hyper_switch.dart +++ b/lib/widgets/custom_hyper_switch.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; class HyperSwitch extends StatefulWidget { final String title; final MyProfileLoadedState? state; + HyperSwitch(this.title, this.state); @override diff --git a/lib/widgets/custom_hypo_switch.dart b/lib/widgets/custom_hypo_switch.dart index 2e0c511b..9504e5f1 100644 --- a/lib/widgets/custom_hypo_switch.dart +++ b/lib/widgets/custom_hypo_switch.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; class HypoSwitch extends StatefulWidget { final String title; final MyProfileLoadedState? state; + HypoSwitch(this.title, this.state); @override diff --git a/lib/widgets/custom_language_drop_down.dart b/lib/widgets/custom_language_drop_down.dart index 7f0e3e0f..f04a703a 100644 --- a/lib/widgets/custom_language_drop_down.dart +++ b/lib/widgets/custom_language_drop_down.dart @@ -13,7 +13,8 @@ class _LanguageDropdownState extends State { return DropdownButton( value: selectedLanguage, onChanged: selectLanguage(), - isDense: false, // Установите isDense в false + isDense: false, + // Установите isDense в false selectedItemBuilder: getList(), items: ['Русский'].map((String language) { return DropdownMenuItem( diff --git a/lib/widgets/custom_outlined_button.dart b/lib/widgets/custom_outlined_button.dart index 38a77041..4b17491e 100644 --- a/lib/widgets/custom_outlined_button.dart +++ b/lib/widgets/custom_outlined_button.dart @@ -89,7 +89,7 @@ class CustomOutlinedButton extends BaseButton { } } - /*_buildAppBarbuildOutlinedButtonWidget() { +/*_buildAppBarbuildOutlinedButtonWidget() { return Container( height: this.height ?? 30.v, width: this.width ?? double.maxFinite, diff --git a/lib/widgets/custom_text_form_field.dart b/lib/widgets/custom_text_form_field.dart index 11aa7d4d..a2b6c74f 100644 --- a/lib/widgets/custom_text_form_field.dart +++ b/lib/widgets/custom_text_form_field.dart @@ -11,8 +11,8 @@ class CustomTextFormField extends StatelessWidget { this.autofocus = false, this.textStyle, this.obscureText = false, - this.textInputAction = TextInputAction.next, - this.textInputType = TextInputType.text, + this.textInputAction, + this.textInputType, this.maxLines, this.hintText, this.hintStyle,