From 919035a45547c2c07e63ee25b68a9d6163ca3076 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 14 Aug 2024 11:34:29 +0300 Subject: [PATCH] =?UTF-8?q?feat(feed,=20profile):=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85?= =?UTF-8?q?=D0=BE=D0=B4=20=D0=BD=D0=B0=20=D1=81=D1=82=D1=80=D0=B0=D0=B8?= =?UTF-8?q?=D0=BD=D1=86=D1=83=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B0=20?= =?UTF-8?q?=D0=B2=20=D0=BF=D0=BE=D1=81=D1=82=D0=B5,=20=D1=80=D0=B5=D1=86?= =?UTF-8?q?=D0=B5=D0=BF=D1=82=D0=B5=20=D0=B8=20=D0=B4=D0=B5=D1=82=D0=B5.?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D0=BD=D0=B0=D0=B6=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=BD=D0=B0=20=D0=B8=D0=B7=D0=BE=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2=20=D1=80=D0=B5=D1=86?= =?UTF-8?q?=D0=B5=D0=BF=D1=82=D0=B5=20=D0=B8=20=D0=B4=D0=B8=D0=B5=D1=82?= =?UTF-8?q?=D1=8B=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D1=85=D0=BE=D0=B4=20=D0=BD=D0=B0=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=83=20=D1=81=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=D1=80=D0=BE=D0=B1=D0=BD=D0=B5=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/app_router.dart | 4 +- .../initialization_state.freezed.dart | 96 +- .../selection_popup_model.freezed.dart | 53 +- .../user_registration_model.freezed.dart | 183 +- .../user_registration_model.g.dart | 11 +- .../blog_post/models/blog_post_model.dart | 22 - .../models/blog_post_model.freezed.dart | 351 ---- .../blog_post/models/blog_post_model.g.dart | 35 - .../presentation/bloc/blog_post_cubit.dart | 20 - .../presentation/bloc/blog_post_state.dart | 19 - .../bloc/blog_post_state.freezed.dart | 622 ------ .../presentation/pages/blog_post_screen.dart | 189 +- .../repositories/blog_post_repository.dart | 16 - .../blog_post/services/blog_post_service.dart | 13 - .../pages/blog_post_create_screen.dart | 13 +- .../new_messages_state.freezed.dart | 92 +- .../notifications_state.freezed.dart | 95 +- .../calendar/models/calendar_model.dart | 3 +- .../presentation/bloc/calendar_cubit.dart | 3 +- .../presentation/pages/calendar_screen.dart | 89 +- .../models/chat_message_model.freezed.dart | 73 +- .../chat/models/chat_message_model.g.dart | 8 +- .../chat/models/chat_messages_model.dart | 1 - .../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 +- lib/features/diary/models/diary_model.dart | 4 +- lib/features/diary/models/meal.dart | 4 +- lib/features/diary/models/photo.freezed.dart | 59 +- lib/features/diary/models/photo.g.dart | 3 +- lib/features/diary/models/portion.dart | 4 +- lib/features/diary/models/product.dart | 4 +- .../diary/presentation/bloc/diary_bloc.dart | 92 +- .../diary/presentation/bloc/diary_event.dart | 33 +- .../presentation/pages/diary_screen.dart | 77 +- .../diets_pagination_model.freezed.dart | 530 +++-- .../feed/models/diets_pagination_model.g.dart | 46 +- .../feed/models/feed_blog_post_model.dart | 2 + .../models/feed_blog_post_model.freezed.dart | 37 +- .../feed/models/feed_blog_post_model.g.dart | 2 + .../models/feed_blog_post_settings_model.dart | 1 - lib/features/feed/models/recipes_model.dart | 2 + .../feed/models/recipes_model.freezed.dart | 79 +- lib/features/feed/models/recipes_model.g.dart | 2 + .../bloc/diets_cubit/diets_state.freezed.dart | 90 +- .../widgets/blog_post_widget.dart | 2 +- .../presentation/widgets/diets_widget.dart | 20 +- .../presentation/widgets/recipes_widget.dart | 20 +- .../profile/models/profile_model.dart | 82 + .../profile/models/profile_model.freezed.dart | 1817 +++++++++++++++++ .../profile/models/profile_model.g.dart | 139 ++ .../bloc/profile_cubit/profile_cubit.dart | 18 + .../bloc/profile_cubit/profile_state.dart | 19 + .../profile_cubit/profile_state.freezed.dart | 621 ++++++ .../presentation/pages/profile_screen.dart | 76 +- .../repositories/profile_repository.dart | 16 + .../profile/services/profile_service.dart | 15 + .../services/profile_service.g.dart} | 16 +- .../pages/about_recipes_screen.dart | 33 +- .../registration/models/location_model.dart | 3 +- .../registration_state.freezed.dart | 41 +- lib/locator_service.dart | 12 +- .../bloc/diary_edit_state.dart | 2 +- .../diary_edit_screen/diary_edit_screen.dart | 2 +- .../models/diary_edit_model.dart | 1 + .../bloc/diet_edit_state.dart | 3 + .../bloc/blog_post_create_bloc.dart | 6 +- lib/widgets/custom_edit_drop_down.dart | 30 +- lib/widgets/custom_expandable_list.dart | 32 +- 77 files changed, 3943 insertions(+), 2745 deletions(-) delete mode 100644 lib/features/blog_post/models/blog_post_model.dart delete mode 100644 lib/features/blog_post/models/blog_post_model.freezed.dart delete mode 100644 lib/features/blog_post/models/blog_post_model.g.dart delete mode 100644 lib/features/blog_post/presentation/bloc/blog_post_cubit.dart delete mode 100644 lib/features/blog_post/presentation/bloc/blog_post_state.dart delete mode 100644 lib/features/blog_post/presentation/bloc/blog_post_state.freezed.dart delete mode 100644 lib/features/blog_post/repositories/blog_post_repository.dart delete mode 100644 lib/features/blog_post/services/blog_post_service.dart create mode 100644 lib/features/profile/models/profile_model.dart create mode 100644 lib/features/profile/models/profile_model.freezed.dart create mode 100644 lib/features/profile/models/profile_model.g.dart create mode 100644 lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart create mode 100644 lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart create mode 100644 lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart create mode 100644 lib/features/profile/repositories/profile_repository.dart create mode 100644 lib/features/profile/services/profile_service.dart rename lib/features/{blog_post/services/blog_post_service.g.dart => profile/services/profile_service.g.dart} (82%) diff --git a/lib/app_router.dart b/lib/app_router.dart index 698cf7c1..b2d8b20a 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -10,6 +10,7 @@ import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.da import 'package:eatvio_app/features/diary/presentation/pages/diary_screen.dart'; import 'package:eatvio_app/features/diets/presentation/pages/about_diet_screen.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; +import 'package:eatvio_app/features/feed/models/feed_blog_post_model.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/profile/presentation/pages/profile_screen.dart'; @@ -117,8 +118,7 @@ class AppRouter { GoRoute( path: '/blog-post-screen', name: 'blogPostScreen', - builder: (context, state) => - BlogPostScreen(blogPostID: state.extra as String), + builder: (context, state) => BlogPostScreen(blogPost: state.extra as FeedBlogPostModel), ), GoRoute( path: '/blog-post-edit-screen', 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/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.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.dart b/lib/features/blog_post/models/blog_post_model.dart deleted file mode 100644 index 1a428e0c..00000000 --- a/lib/features/blog_post/models/blog_post_model.dart +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'blog_post_model.freezed.dart'; -part 'blog_post_model.g.dart'; - -@freezed -class BlogPostModel with _$BlogPostModel { - const factory BlogPostModel({ - required int id, - required String state, - String? image, - required String description, - String? author_name, - String? author_avatar_path, - @JsonKey(name: "youtube_url") required String youtubeUrl, - @JsonKey(name: "created_at") required DateTime createdAt, - @JsonKey(name: "updated_at") required DateTime updatedAt, - required String title, - }) = _BlogPostModel; - - factory BlogPostModel.fromJson(Map json) => _$BlogPostModelFromJson(json); -} diff --git a/lib/features/blog_post/models/blog_post_model.freezed.dart b/lib/features/blog_post/models/blog_post_model.freezed.dart deleted file mode 100644 index 7c0a750e..00000000 --- a/lib/features/blog_post/models/blog_post_model.freezed.dart +++ /dev/null @@ -1,351 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'blog_post_model.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -BlogPostModel _$BlogPostModelFromJson(Map json) { - return _BlogPostModel.fromJson(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; -} - -/// @nodoc -abstract class $BlogPostModelCopyWith<$Res> { - factory $BlogPostModelCopyWith( - BlogPostModel value, $Res Function(BlogPostModel) then) = - _$BlogPostModelCopyWithImpl<$Res, BlogPostModel>; - @useResult - $Res call( - {int id, - String state, - String? image, - String description, - String? author_name, - String? author_avatar_path, - @JsonKey(name: "youtube_url") String youtubeUrl, - @JsonKey(name: "created_at") DateTime createdAt, - @JsonKey(name: "updated_at") DateTime updatedAt, - String title}); -} - -/// @nodoc -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; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? state = null, - Object? image = freezed, - Object? description = null, - Object? author_name = freezed, - Object? author_avatar_path = freezed, - Object? youtubeUrl = null, - Object? createdAt = null, - Object? updatedAt = null, - Object? title = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - state: null == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String, - image: freezed == image - ? _value.image - : image // ignore: cast_nullable_to_non_nullable - as String?, - description: null == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String, - author_name: freezed == author_name - ? _value.author_name - : author_name // ignore: cast_nullable_to_non_nullable - as String?, - author_avatar_path: freezed == author_avatar_path - ? _value.author_avatar_path - : author_avatar_path // ignore: cast_nullable_to_non_nullable - as String?, - youtubeUrl: null == youtubeUrl - ? _value.youtubeUrl - : youtubeUrl // ignore: cast_nullable_to_non_nullable - as String, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - title: null == title - ? _value.title - : title // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$BlogPostModelImplCopyWith<$Res> - implements $BlogPostModelCopyWith<$Res> { - factory _$$BlogPostModelImplCopyWith( - _$BlogPostModelImpl value, $Res Function(_$BlogPostModelImpl) then) = - __$$BlogPostModelImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {int id, - String state, - String? image, - String description, - String? author_name, - String? author_avatar_path, - @JsonKey(name: "youtube_url") String youtubeUrl, - @JsonKey(name: "created_at") DateTime createdAt, - @JsonKey(name: "updated_at") DateTime updatedAt, - String title}); -} - -/// @nodoc -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 - $Res call({ - Object? id = null, - Object? state = null, - Object? image = freezed, - Object? description = null, - Object? author_name = freezed, - Object? author_avatar_path = freezed, - Object? youtubeUrl = null, - Object? createdAt = null, - Object? updatedAt = null, - Object? title = null, - }) { - return _then(_$BlogPostModelImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - state: null == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String, - image: freezed == image - ? _value.image - : image // ignore: cast_nullable_to_non_nullable - as String?, - description: null == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String, - author_name: freezed == author_name - ? _value.author_name - : author_name // ignore: cast_nullable_to_non_nullable - as String?, - author_avatar_path: freezed == author_avatar_path - ? _value.author_avatar_path - : author_avatar_path // ignore: cast_nullable_to_non_nullable - as String?, - youtubeUrl: null == youtubeUrl - ? _value.youtubeUrl - : youtubeUrl // ignore: cast_nullable_to_non_nullable - as String, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - title: null == title - ? _value.title - : title // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$BlogPostModelImpl implements _BlogPostModel { - const _$BlogPostModelImpl( - {required this.id, - required this.state, - this.image, - required this.description, - this.author_name, - this.author_avatar_path, - @JsonKey(name: "youtube_url") required this.youtubeUrl, - @JsonKey(name: "created_at") required this.createdAt, - @JsonKey(name: "updated_at") required this.updatedAt, - required this.title}); - - factory _$BlogPostModelImpl.fromJson(Map json) => - _$$BlogPostModelImplFromJson(json); - - @override - final int id; - @override - final String state; - @override - final String? image; - @override - final String description; - @override - final String? author_name; - @override - final String? author_avatar_path; - @override - @JsonKey(name: "youtube_url") - final String youtubeUrl; - @override - @JsonKey(name: "created_at") - final DateTime createdAt; - @override - @JsonKey(name: "updated_at") - final DateTime updatedAt; - @override - final String title; - - @override - String toString() { - return 'BlogPostModel(id: $id, state: $state, image: $image, description: $description, author_name: $author_name, author_avatar_path: $author_avatar_path, youtubeUrl: $youtubeUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BlogPostModelImpl && - (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.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); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$BlogPostModelImplCopyWith<_$BlogPostModelImpl> get copyWith => - __$$BlogPostModelImplCopyWithImpl<_$BlogPostModelImpl>(this, _$identity); - - @override - Map toJson() { - return _$$BlogPostModelImplToJson( - this, - ); - } -} - -abstract class _BlogPostModel implements BlogPostModel { - const factory _BlogPostModel( - {required final int id, - required final String state, - final String? image, - required final String description, - final String? author_name, - final String? author_avatar_path, - @JsonKey(name: "youtube_url") required final String youtubeUrl, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") required final DateTime updatedAt, - required final String title}) = _$BlogPostModelImpl; - - 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; -} diff --git a/lib/features/blog_post/models/blog_post_model.g.dart b/lib/features/blog_post/models/blog_post_model.g.dart deleted file mode 100644 index 2e3233c4..00000000 --- a/lib/features/blog_post/models/blog_post_model.g.dart +++ /dev/null @@ -1,35 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'blog_post_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$BlogPostModelImpl _$$BlogPostModelImplFromJson(Map json) => - _$BlogPostModelImpl( - id: (json['id'] as num).toInt(), - state: json['state'] as String, - image: json['image'] as String?, - description: json['description'] as String, - author_name: json['author_name'] as String?, - author_avatar_path: json['author_avatar_path'] as String?, - youtubeUrl: json['youtube_url'] as String, - createdAt: DateTime.parse(json['created_at'] as String), - updatedAt: DateTime.parse(json['updated_at'] as String), - title: json['title'] as String, - ); - -Map _$$BlogPostModelImplToJson(_$BlogPostModelImpl instance) => - { - 'id': instance.id, - 'state': instance.state, - 'image': instance.image, - 'description': instance.description, - 'author_name': instance.author_name, - 'author_avatar_path': instance.author_avatar_path, - 'youtube_url': instance.youtubeUrl, - 'created_at': instance.createdAt.toIso8601String(), - 'updated_at': instance.updatedAt.toIso8601String(), - 'title': instance.title, - }; diff --git a/lib/features/blog_post/presentation/bloc/blog_post_cubit.dart b/lib/features/blog_post/presentation/bloc/blog_post_cubit.dart deleted file mode 100644 index 301e0efc..00000000 --- a/lib/features/blog_post/presentation/bloc/blog_post_cubit.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/features/blog_post/presentation/bloc/blog_post_state.dart'; -import 'package:eatvio_app/features/blog_post/repositories/blog_post_repository.dart'; - -class BlogPostCubit extends Cubit { - final BlogPostRepository blogPostRepository; - - BlogPostCubit({required this.blogPostRepository}) : super(const BlogPostState.loading()); - - loadBlogPost(String blogPostID) async { - emit(const BlogPostState.loading()); - try { - final blogPost = await blogPostRepository.getBlogPost(blogPostID); - emit(BlogPostState.loaded(blogPost: blogPost)); - } catch (e) { - emit(BlogPostState.error(errorMessage: e.toString())); - print(e); - } - } -} diff --git a/lib/features/blog_post/presentation/bloc/blog_post_state.dart b/lib/features/blog_post/presentation/bloc/blog_post_state.dart deleted file mode 100644 index c8a4d0e7..00000000 --- a/lib/features/blog_post/presentation/bloc/blog_post_state.dart +++ /dev/null @@ -1,19 +0,0 @@ -import 'package:eatvio_app/features/blog_post/models/blog_post_model.dart'; -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'blog_post_state.freezed.dart'; - -@freezed -abstract class BlogPostState with _$BlogPostState { - const factory BlogPostState() = _BlogPostState; - - const factory BlogPostState.loading() = BlogPostStateLoading; - - const factory BlogPostState.loaded({ - required BlogPostModel blogPost, - }) = BlogPostStateLoaded; - - const factory BlogPostState.error({ - required String errorMessage, - }) = BlogPostStateError; -} 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 deleted file mode 100644 index 4f99a3cd..00000000 --- a/lib/features/blog_post/presentation/bloc/blog_post_state.freezed.dart +++ /dev/null @@ -1,622 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'blog_post_state.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -/// @nodoc -mixin _$BlogPostState { - @optionalTypeArgs - TResult when( - TResult Function() $default, { - required TResult Function() loading, - required TResult Function(BlogPostModel blogPost) loaded, - required TResult Function(String errorMessage) error, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function()? $default, { - TResult? Function()? loading, - TResult? Function(BlogPostModel blogPost)? loaded, - TResult? Function(String errorMessage)? error, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen( - TResult Function()? $default, { - TResult Function()? loading, - TResult Function(BlogPostModel blogPost)? loaded, - TResult Function(String errorMessage)? error, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map( - TResult Function(_BlogPostState value) $default, { - required TResult Function(BlogPostStateLoading value) loading, - required TResult Function(BlogPostStateLoaded value) loaded, - required TResult Function(BlogPostStateError value) error, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_BlogPostState value)? $default, { - TResult? Function(BlogPostStateLoading value)? loading, - TResult? Function(BlogPostStateLoaded value)? loaded, - TResult? Function(BlogPostStateError value)? error, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap( - TResult Function(_BlogPostState value)? $default, { - TResult Function(BlogPostStateLoading value)? loading, - TResult Function(BlogPostStateLoaded value)? loaded, - TResult Function(BlogPostStateError value)? error, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $BlogPostStateCopyWith<$Res> { - factory $BlogPostStateCopyWith( - BlogPostState value, $Res Function(BlogPostState) then) = - _$BlogPostStateCopyWithImpl<$Res, BlogPostState>; -} - -/// @nodoc -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>; -} - -/// @nodoc -class __$$BlogPostStateImplCopyWithImpl<$Res> - extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateImpl> - implements _$$BlogPostStateImplCopyWith<$Res> { - __$$BlogPostStateImplCopyWithImpl( - _$BlogPostStateImpl _value, $Res Function(_$BlogPostStateImpl) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$BlogPostStateImpl implements _BlogPostState { - const _$BlogPostStateImpl(); - - @override - String toString() { - return 'BlogPostState()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$BlogPostStateImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when( - TResult Function() $default, { - required TResult Function() loading, - required TResult Function(BlogPostModel blogPost) loaded, - required TResult Function(String errorMessage) error, - }) { - return $default(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function()? $default, { - TResult? Function()? loading, - TResult? Function(BlogPostModel blogPost)? loaded, - TResult? Function(String errorMessage)? error, - }) { - return $default?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function()? $default, { - TResult Function()? loading, - TResult Function(BlogPostModel blogPost)? loaded, - TResult Function(String errorMessage)? error, - required TResult orElse(), - }) { - if ($default != null) { - return $default(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map( - TResult Function(_BlogPostState value) $default, { - required TResult Function(BlogPostStateLoading value) loading, - required TResult Function(BlogPostStateLoaded value) loaded, - required TResult Function(BlogPostStateError value) error, - }) { - return $default(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_BlogPostState value)? $default, { - TResult? Function(BlogPostStateLoading value)? loading, - TResult? Function(BlogPostStateLoaded value)? loaded, - TResult? Function(BlogPostStateError value)? error, - }) { - return $default?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_BlogPostState value)? $default, { - TResult Function(BlogPostStateLoading value)? loading, - TResult Function(BlogPostStateLoaded value)? loaded, - TResult Function(BlogPostStateError value)? error, - required TResult orElse(), - }) { - if ($default != null) { - return $default(this); - } - return orElse(); - } -} - -abstract class _BlogPostState implements BlogPostState { - const factory _BlogPostState() = _$BlogPostStateImpl; -} - -/// @nodoc -abstract class _$$BlogPostStateLoadingImplCopyWith<$Res> { - factory _$$BlogPostStateLoadingImplCopyWith(_$BlogPostStateLoadingImpl value, - $Res Function(_$BlogPostStateLoadingImpl) then) = - __$$BlogPostStateLoadingImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$BlogPostStateLoadingImplCopyWithImpl<$Res> - extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateLoadingImpl> - implements _$$BlogPostStateLoadingImplCopyWith<$Res> { - __$$BlogPostStateLoadingImplCopyWithImpl(_$BlogPostStateLoadingImpl _value, - $Res Function(_$BlogPostStateLoadingImpl) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$BlogPostStateLoadingImpl implements BlogPostStateLoading { - const _$BlogPostStateLoadingImpl(); - - @override - String toString() { - return 'BlogPostState.loading()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BlogPostStateLoadingImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when( - TResult Function() $default, { - required TResult Function() loading, - required TResult Function(BlogPostModel blogPost) loaded, - required TResult Function(String errorMessage) error, - }) { - return loading(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function()? $default, { - TResult? Function()? loading, - TResult? Function(BlogPostModel blogPost)? loaded, - TResult? Function(String errorMessage)? error, - }) { - return loading?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function()? $default, { - TResult Function()? loading, - TResult Function(BlogPostModel blogPost)? loaded, - TResult Function(String errorMessage)? error, - required TResult orElse(), - }) { - if (loading != null) { - return loading(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map( - TResult Function(_BlogPostState value) $default, { - required TResult Function(BlogPostStateLoading value) loading, - required TResult Function(BlogPostStateLoaded value) loaded, - required TResult Function(BlogPostStateError value) error, - }) { - return loading(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_BlogPostState value)? $default, { - TResult? Function(BlogPostStateLoading value)? loading, - TResult? Function(BlogPostStateLoaded value)? loaded, - TResult? Function(BlogPostStateError value)? error, - }) { - return loading?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_BlogPostState value)? $default, { - TResult Function(BlogPostStateLoading value)? loading, - TResult Function(BlogPostStateLoaded value)? loaded, - TResult Function(BlogPostStateError value)? error, - required TResult orElse(), - }) { - if (loading != null) { - return loading(this); - } - return orElse(); - } -} - -abstract class BlogPostStateLoading implements BlogPostState { - const factory BlogPostStateLoading() = _$BlogPostStateLoadingImpl; -} - -/// @nodoc -abstract class _$$BlogPostStateLoadedImplCopyWith<$Res> { - factory _$$BlogPostStateLoadedImplCopyWith(_$BlogPostStateLoadedImpl value, - $Res Function(_$BlogPostStateLoadedImpl) then) = - __$$BlogPostStateLoadedImplCopyWithImpl<$Res>; - @useResult - $Res call({BlogPostModel blogPost}); - - $BlogPostModelCopyWith<$Res> get blogPost; -} - -/// @nodoc -class __$$BlogPostStateLoadedImplCopyWithImpl<$Res> - extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateLoadedImpl> - implements _$$BlogPostStateLoadedImplCopyWith<$Res> { - __$$BlogPostStateLoadedImplCopyWithImpl(_$BlogPostStateLoadedImpl _value, - $Res Function(_$BlogPostStateLoadedImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? blogPost = null, - }) { - return _then(_$BlogPostStateLoadedImpl( - blogPost: null == blogPost - ? _value.blogPost - : blogPost // ignore: cast_nullable_to_non_nullable - as BlogPostModel, - )); - } - - @override - @pragma('vm:prefer-inline') - $BlogPostModelCopyWith<$Res> get blogPost { - return $BlogPostModelCopyWith<$Res>(_value.blogPost, (value) { - return _then(_value.copyWith(blogPost: value)); - }); - } -} - -/// @nodoc - -class _$BlogPostStateLoadedImpl implements BlogPostStateLoaded { - const _$BlogPostStateLoadedImpl({required this.blogPost}); - - @override - final BlogPostModel blogPost; - - @override - String toString() { - return 'BlogPostState.loaded(blogPost: $blogPost)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BlogPostStateLoadedImpl && - (identical(other.blogPost, blogPost) || - other.blogPost == blogPost)); - } - - @override - int get hashCode => Object.hash(runtimeType, blogPost); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$BlogPostStateLoadedImplCopyWith<_$BlogPostStateLoadedImpl> get copyWith => - __$$BlogPostStateLoadedImplCopyWithImpl<_$BlogPostStateLoadedImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function() $default, { - required TResult Function() loading, - required TResult Function(BlogPostModel blogPost) loaded, - required TResult Function(String errorMessage) error, - }) { - return loaded(blogPost); - } - - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function()? $default, { - TResult? Function()? loading, - TResult? Function(BlogPostModel blogPost)? loaded, - TResult? Function(String errorMessage)? error, - }) { - return loaded?.call(blogPost); - } - - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function()? $default, { - TResult Function()? loading, - TResult Function(BlogPostModel blogPost)? loaded, - TResult Function(String errorMessage)? error, - required TResult orElse(), - }) { - if (loaded != null) { - return loaded(blogPost); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map( - TResult Function(_BlogPostState value) $default, { - required TResult Function(BlogPostStateLoading value) loading, - required TResult Function(BlogPostStateLoaded value) loaded, - required TResult Function(BlogPostStateError value) error, - }) { - return loaded(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_BlogPostState value)? $default, { - TResult? Function(BlogPostStateLoading value)? loading, - TResult? Function(BlogPostStateLoaded value)? loaded, - TResult? Function(BlogPostStateError value)? error, - }) { - return loaded?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_BlogPostState value)? $default, { - TResult Function(BlogPostStateLoading value)? loading, - TResult Function(BlogPostStateLoaded value)? loaded, - TResult Function(BlogPostStateError value)? error, - required TResult orElse(), - }) { - if (loaded != null) { - return loaded(this); - } - return orElse(); - } -} - -abstract class BlogPostStateLoaded implements BlogPostState { - const factory BlogPostStateLoaded({required final BlogPostModel blogPost}) = - _$BlogPostStateLoadedImpl; - - BlogPostModel get blogPost; - @JsonKey(ignore: true) - _$$BlogPostStateLoadedImplCopyWith<_$BlogPostStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$BlogPostStateErrorImplCopyWith<$Res> { - factory _$$BlogPostStateErrorImplCopyWith(_$BlogPostStateErrorImpl value, - $Res Function(_$BlogPostStateErrorImpl) then) = - __$$BlogPostStateErrorImplCopyWithImpl<$Res>; - @useResult - $Res call({String errorMessage}); -} - -/// @nodoc -class __$$BlogPostStateErrorImplCopyWithImpl<$Res> - extends _$BlogPostStateCopyWithImpl<$Res, _$BlogPostStateErrorImpl> - implements _$$BlogPostStateErrorImplCopyWith<$Res> { - __$$BlogPostStateErrorImplCopyWithImpl(_$BlogPostStateErrorImpl _value, - $Res Function(_$BlogPostStateErrorImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? errorMessage = null, - }) { - return _then(_$BlogPostStateErrorImpl( - errorMessage: null == errorMessage - ? _value.errorMessage - : errorMessage // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$BlogPostStateErrorImpl implements BlogPostStateError { - const _$BlogPostStateErrorImpl({required this.errorMessage}); - - @override - final String errorMessage; - - @override - String toString() { - return 'BlogPostState.error(errorMessage: $errorMessage)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BlogPostStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); - } - - @override - int get hashCode => Object.hash(runtimeType, errorMessage); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$BlogPostStateErrorImplCopyWith<_$BlogPostStateErrorImpl> get copyWith => - __$$BlogPostStateErrorImplCopyWithImpl<_$BlogPostStateErrorImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function() $default, { - required TResult Function() loading, - required TResult Function(BlogPostModel blogPost) loaded, - required TResult Function(String errorMessage) error, - }) { - return error(errorMessage); - } - - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function()? $default, { - TResult? Function()? loading, - TResult? Function(BlogPostModel blogPost)? loaded, - TResult? Function(String errorMessage)? error, - }) { - return error?.call(errorMessage); - } - - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function()? $default, { - TResult Function()? loading, - TResult Function(BlogPostModel blogPost)? loaded, - TResult Function(String errorMessage)? error, - required TResult orElse(), - }) { - if (error != null) { - return error(errorMessage); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map( - TResult Function(_BlogPostState value) $default, { - required TResult Function(BlogPostStateLoading value) loading, - required TResult Function(BlogPostStateLoaded value) loaded, - required TResult Function(BlogPostStateError value) error, - }) { - return error(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_BlogPostState value)? $default, { - TResult? Function(BlogPostStateLoading value)? loading, - TResult? Function(BlogPostStateLoaded value)? loaded, - TResult? Function(BlogPostStateError value)? error, - }) { - return error?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_BlogPostState value)? $default, { - TResult Function(BlogPostStateLoading value)? loading, - TResult Function(BlogPostStateLoaded value)? loaded, - TResult Function(BlogPostStateError value)? error, - required TResult orElse(), - }) { - if (error != null) { - return error(this); - } - return orElse(); - } -} - -abstract class BlogPostStateError implements BlogPostState { - const factory BlogPostStateError({required final String errorMessage}) = - _$BlogPostStateErrorImpl; - - String get errorMessage; - @JsonKey(ignore: true) - _$$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 ad82dece..099c5f2d 100644 --- a/lib/features/blog_post/presentation/pages/blog_post_screen.dart +++ b/lib/features/blog_post/presentation/pages/blog_post_screen.dart @@ -1,123 +1,68 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/features/blog_post/presentation/bloc/blog_post_cubit.dart'; -import 'package:eatvio_app/features/blog_post/presentation/bloc/blog_post_state.dart'; -import 'package:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; import 'package:eatvio_app/widgets/custom_outlined_button.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:intl/intl.dart'; class BlogPostScreen extends StatelessWidget { - final String blogPostID; + final FeedBlogPostModel blogPost; - const BlogPostScreen({super.key, required this.blogPostID}); + const BlogPostScreen({super.key, required this.blogPost}); Widget build(BuildContext context) { - return BlocProvider( - create: (context) => sl()..loadBlogPost(blogPostID), - child: BlocBuilder( - builder: (context, state) { - if (state is BlogPostStateLoaded) { - return _buildBlogPost(context, state); - } else { - return Scaffold( - body: Center( - child: CupertinoActivityIndicator(), + return Scaffold( + appBar: AppBar( + actions: [ + InkWell( + borderRadius: BorderRadius.circular(16), + onTap: () => GoRouter.of(context).pushNamed('profileScreen', extra: blogPost.author), + child: Ink( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CircleAvatar( + maxRadius: 16, + minRadius: 16, + backgroundImage: NetworkImage(blogPost.author.authorProfileIcon), + ), + SizedBox(height: 4), + Text( + blogPost.author.authorName, + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.w400, + height: 1, + ), + ), + ], ), - ); - } - }, - ), - ); - } - - _buildBlogPost(BuildContext context, BlogPostStateLoaded state) { - return SafeArea( - child: Scaffold( - resizeToAvoidBottomInset: false, - body: Container( - width: double.maxFinite, - decoration: AppDecoration.fillGray, - child: ListView( - children: [ - SizedBox(height: 15.v), - _buildHeaderRow(context, state), - SizedBox(height: 15.v), - _buildBlogPostData(context, state), - SizedBox(height: 15.v), - _buildTextField(context, state), - SizedBox(height: 15.v), - _buildCommentSection(context, state), - ], + ), ), + ], + ), + resizeToAvoidBottomInset: false, + body: Container( + width: double.maxFinite, + decoration: AppDecoration.fillGray, + child: ListView( + children: [ + SizedBox(height: 15.v), + _buildBlogPostData(context), + SizedBox(height: 15.v), + _buildTextField(), + SizedBox(height: 15.v), + ], ), ), ); } - _buildHeaderRow(BuildContext context, BlogPostStateLoaded state) { - final String name = state.blogPost.title; - return Container( - margin: EdgeInsets.symmetric(horizontal: 16.h, vertical: 16.h), - padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, - ), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - CustomImageView( - imagePath: ImageConstant.imgArrowLeft, - onTap: () => GoRouter.of(context).pop(), - ), - Padding( - padding: EdgeInsets.only(top: 1.v), - child: Row( - children: [ - Align( - alignment: Alignment.centerRight, - child: Text( - "$name", - style: CustomTextStyles.titleMediumBlack, - ), - ), - CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + (state.blogPost.author_avatar_path ?? ''), - imageBuilder: (context, imageProvider) => CircleAvatar( - backgroundImage: imageProvider, - radius: 25, - ), - placeholder: (context, url) => CircularProgressIndicator(), - errorWidget: (context, url, error) => CircleAvatar( - child: Icon(Icons.person), - backgroundColor: Colors.white, - radius: 25, - ), - ), - ], - ), - ), - ], - ), - ); - } - - _buildBlogPostData(BuildContext context, BlogPostStateLoaded state) { + _buildBlogPostData(BuildContext context) { return Container( margin: EdgeInsets.only( left: 16.h, @@ -143,12 +88,12 @@ class BlogPostScreen extends StatelessWidget { Row( children: [ Text( - state.blogPost.title, + blogPost.title, style: CustomTextStyles.titleMediumBlack, ), Spacer(), PopupMenuButton( - onSelected: (value) => tapMenu(value, context, state), + onSelected: (value) => tapMenu(value, context), itemBuilder: (BuildContext context) => >[ PopupMenuItem( value: 'edit', @@ -163,17 +108,17 @@ class BlogPostScreen extends StatelessWidget { ], ), SizedBox(height: 8.0), - _buildImage(state), + _buildImage(), SizedBox(height: 16.0), Text( - state.blogPost.description, + blogPost.description, style: CustomTextStyles.bodyMediumBluegray800, ), SizedBox(height: 16.0), Align( alignment: Alignment.topLeft, child: Text( - DateFormat('dd.MM.yyyy').format(state.blogPost.updatedAt), + DateFormat('dd.MM.yyyy').format(blogPost.updatedAt), style: theme.textTheme.bodyMedium, ), ), @@ -218,9 +163,9 @@ class BlogPostScreen extends StatelessWidget { ); } - _buildImage(BlogPostStateLoaded state) { + _buildImage() { return CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + (state.blogPost.image ?? ""), + imageUrl: baseUrl + '/storage/' + (blogPost.image), imageBuilder: (context, imageProvider) => Stack( children: [ ClipRRect( @@ -293,18 +238,18 @@ class BlogPostScreen extends StatelessWidget { ); } - void tapMenu(String value, BuildContext context, BlogPostStateLoaded state) { + void tapMenu(String value, BuildContext context) { if (value == 'edit') { GoRouter.of(context).pushNamed( 'blogPostEditScreen', - extra: state.blogPost.id.toString(), + extra: blogPost.id.toString(), ); } else if (value == 'delete') { // context.read().add(DeleteEntry(state.blog_post?['id'])); } } - _buildTextField(BuildContext context, BlogPostStateLoaded state) { + _buildTextField() { return Container( margin: EdgeInsets.only( left: 16.h, @@ -352,28 +297,6 @@ class BlogPostScreen extends StatelessWidget { ), ); } - - _buildCommentSection(BuildContext context, BlogPostStateLoaded state) { - /* if (state.comments != null && state.comments!.isNotEmpty) { - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - for (int i = 0; i < state.comments!.length; i++) - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - CommentWidget(state.comments![i]), - SizedBox(height: 10.0), // Separator - ], - ), - ], - ); - } else { - // Return a message or placeholder widget when there are no comments*/ - return Center( - child: Text('No comments available'), - ); - } } /// Navigates to the previous screen. diff --git a/lib/features/blog_post/repositories/blog_post_repository.dart b/lib/features/blog_post/repositories/blog_post_repository.dart deleted file mode 100644 index b0c5a7a4..00000000 --- a/lib/features/blog_post/repositories/blog_post_repository.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:eatvio_app/features/blog_post/models/blog_post_model.dart'; -import 'package:eatvio_app/features/blog_post/services/blog_post_service.dart'; - -class BlogPostRepository { - final BlogPostService blogPostService; - - BlogPostRepository({required this.blogPostService}); - - Future getBlogPost(String blogPostID) async { - try { - return await blogPostService.getBlogPost(blogPostID); - } catch (e) { - rethrow; - } - } -} diff --git a/lib/features/blog_post/services/blog_post_service.dart b/lib/features/blog_post/services/blog_post_service.dart deleted file mode 100644 index dfbc3618..00000000 --- a/lib/features/blog_post/services/blog_post_service.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:dio/dio.dart'; -import 'package:eatvio_app/features/blog_post/models/blog_post_model.dart'; -import 'package:retrofit/retrofit.dart'; - -part 'blog_post_service.g.dart'; - -@RestApi() -abstract class BlogPostService { - factory BlogPostService(Dio dio, {String baseUrl}) = _BlogPostService; - - @GET('/api/blogPosts/show/{id}') - Future getBlogPost(@Path() String id); -} diff --git a/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart b/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart index eac8aa48..eadcc00c 100644 --- a/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart +++ b/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart @@ -79,9 +79,9 @@ class _BlogPostCreateScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (state.youtubeURL!.text.isEmpty) Text('Изображение поста'), - if (state.youtubeURL!.text.isEmpty) SizedBox(height: 8), - if (state.youtubeURL!.text.isEmpty) _buildAddPhoto(context, state), + Text('Изображение поста'), + SizedBox(height: 8), + _buildAddPhoto(context, state), SizedBox(height: 16), Text('Заголовок'), SizedBox(height: 8), @@ -97,9 +97,9 @@ class _BlogPostCreateScreenState extends State { minLines: 1, ), SizedBox(height: 16), - if (state.image == null) Text('Ссылка на видео'), - if (state.image == null) SizedBox(height: 8), - if (state.image == null) CustomTextFormField( + Text('Ссылка на видео'), + SizedBox(height: 8), + CustomTextFormField( controller: state.youtubeURL, ), SizedBox(height: 80), @@ -116,6 +116,7 @@ _submitForm(BuildContext context, String title, String description, String youtu _buildAddPhoto(BuildContext context, BlogPostCreateLoadedState state) { bool isLoading = state.isLoading; + return GestureDetector( onTap: addImage(context, isLoading), child: Stack( 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/calendar/models/calendar_model.dart b/lib/features/calendar/models/calendar_model.dart index c13d5c5d..44f608d7 100644 --- a/lib/features/calendar/models/calendar_model.dart +++ b/lib/features/calendar/models/calendar_model.dart @@ -10,6 +10,5 @@ class CalendarModel with _$CalendarModel { Object? diary, }) = _CalendarModel; - factory CalendarModel.fromJson(Map json) => - _$CalendarModelFromJson(json); + factory CalendarModel.fromJson(Map json) => _$CalendarModelFromJson(json); } diff --git a/lib/features/calendar/presentation/bloc/calendar_cubit.dart b/lib/features/calendar/presentation/bloc/calendar_cubit.dart index 2b76ab12..cfbc5b07 100644 --- a/lib/features/calendar/presentation/bloc/calendar_cubit.dart +++ b/lib/features/calendar/presentation/bloc/calendar_cubit.dart @@ -5,8 +5,7 @@ import 'package:eatvio_app/features/calendar/repositories/calendar_repository.da class CalendarCubit extends Cubit { final CalendarRepository calendarRepository; - CalendarCubit({required this.calendarRepository}) - : super(const CalendarState.loading()); + CalendarCubit({required this.calendarRepository}) : super(const CalendarState.loading()); loadCalendarList() async { emit(const CalendarState.loading()); diff --git a/lib/features/calendar/presentation/pages/calendar_screen.dart b/lib/features/calendar/presentation/pages/calendar_screen.dart index 320ad2c9..6d1fd2f2 100644 --- a/lib/features/calendar/presentation/pages/calendar_screen.dart +++ b/lib/features/calendar/presentation/pages/calendar_screen.dart @@ -1,17 +1,18 @@ // ignore_for_file: unused_local_variable +import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_cubit.dart'; import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_state.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:go_router/go_router.dart'; import 'package:intl/intl.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter_form_builder/flutter_form_builder.dart'; // ignore: must_be_immutable class CalendarScreen extends StatelessWidget { CalendarScreen({Key? key}) : super(key: key); + Widget build(BuildContext context) { return BlocBuilder( builder: (context, state) { @@ -120,66 +121,52 @@ class CalendarScreen extends StatelessWidget { if (diary['state'] != null) Row(children: [ Container( - padding: EdgeInsets.all( - 4.0), // Отступы внутри контейнера + padding: EdgeInsets.all(4.0), // Отступы внутри контейнера decoration: BoxDecoration( - color: diary['state'] == 'finished' - ? Color.fromRGBO(1, 154, 62, 1) - : Color.fromRGBO(154, 74, 1, 1), - borderRadius: BorderRadius.circular( - 24.0), // Закругленные углы + color: diary['state'] == 'finished' ? Color.fromRGBO(1, 154, 62, 1) : Color.fromRGBO(154, 74, 1, 1), + borderRadius: BorderRadius.circular(24.0), // Закругленные углы ), child: Text( _getStateText(diary['state'] ?? ''), - style: CustomTextStyles - .titleSmallBold, // Предполагается, что текст белый + style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый ), ), SizedBox(width: 4), if (diary['state'] == 'started') Container( - padding: EdgeInsets.all( - 4.0), // Отступы внутри контейнера + padding: EdgeInsets.all(4.0), // Отступы внутри контейнера decoration: BoxDecoration( color: Color.fromRGBO(13, 110, 253, 1), - borderRadius: BorderRadius.circular( - 24.0), // Закругленные углы + borderRadius: BorderRadius.circular(24.0), // Закругленные углы ), child: Text( 'Заполнить отчет', - style: CustomTextStyles - .titleSmallBold, // Предполагается, что текст белый + style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый ), ), if (diary['state'] == 'finished') Container( - padding: EdgeInsets.all( - 4.0), // Отступы внутри контейнера + padding: EdgeInsets.all(4.0), // Отступы внутри контейнера decoration: BoxDecoration( color: Color.fromRGBO(13, 110, 253, 1), - borderRadius: BorderRadius.circular( - 24.0), // Закругленные углы + borderRadius: BorderRadius.circular(24.0), // Закругленные углы ), child: Text( 'Изменить отчет', - style: CustomTextStyles - .titleSmallBold, // Предполагается, что текст белый + style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый ), ), ]), if (state.calendarList[index].diary is List) Container( - padding: EdgeInsets.all( - 4.0), // Отступы внутри контейнера + padding: EdgeInsets.all(4.0), // Отступы внутри контейнера decoration: BoxDecoration( color: Color.fromRGBO(108, 117, 125, 1), - borderRadius: BorderRadius.circular( - 24.0), // Закругленные углы + borderRadius: BorderRadius.circular(24.0), // Закругленные углы ), child: Text( 'Cкоро', - style: CustomTextStyles - .titleSmallBold, // Предполагается, что текст белый + style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый ), ), ], @@ -219,66 +206,52 @@ class CalendarScreen extends StatelessWidget { if (diary['state'] != null) Row(children: [ Container( - padding: EdgeInsets.all( - 4.0), // Отступы внутри контейнера + padding: EdgeInsets.all(4.0), // Отступы внутри контейнера decoration: BoxDecoration( - color: diary['state'] == 'finished' - ? Color.fromRGBO(1, 154, 62, 1) - : Color.fromRGBO(154, 74, 1, 1), - borderRadius: BorderRadius.circular( - 24.0), // Закругленные углы + color: diary['state'] == 'finished' ? Color.fromRGBO(1, 154, 62, 1) : Color.fromRGBO(154, 74, 1, 1), + borderRadius: BorderRadius.circular(24.0), // Закругленные углы ), child: Text( _getStateText(diary['state'] ?? ''), - style: CustomTextStyles - .titleSmallBold, // Предполагается, что текст белый + style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый ), ), SizedBox(width: 4), if (diary['state'] == 'started') Container( - padding: EdgeInsets.all( - 4.0), // Отступы внутри контейнера + padding: EdgeInsets.all(4.0), // Отступы внутри контейнера decoration: BoxDecoration( color: Color.fromRGBO(13, 110, 253, 1), - borderRadius: BorderRadius.circular( - 24.0), // Закругленные углы + borderRadius: BorderRadius.circular(24.0), // Закругленные углы ), child: Text( 'Заполнить отчет', - style: CustomTextStyles - .titleSmallBold, // Предполагается, что текст белый + style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый ), ), if (diary['state'] == 'finished') Container( - padding: EdgeInsets.all( - 4.0), // Отступы внутри контейнера + padding: EdgeInsets.all(4.0), // Отступы внутри контейнера decoration: BoxDecoration( color: Color.fromRGBO(13, 110, 253, 1), - borderRadius: BorderRadius.circular( - 24.0), // Закругленные углы + borderRadius: BorderRadius.circular(24.0), // Закругленные углы ), child: Text( 'Изменить отчет', - style: CustomTextStyles - .titleSmallBold, // Предполагается, что текст белый + style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый ), ), ]), if (state.calendarList[index].diary is List) Container( - padding: EdgeInsets.all( - 4.0), // Отступы внутри контейнера + padding: EdgeInsets.all(4.0), // Отступы внутри контейнера decoration: BoxDecoration( color: Color.fromRGBO(108, 117, 125, 1), - borderRadius: BorderRadius.circular( - 24.0), // Закругленные углы + borderRadius: BorderRadius.circular(24.0), // Закругленные углы ), child: Text( 'Cкоро', - style: CustomTextStyles - .titleSmallBold, // Предполагается, что текст белый + style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый ), ), ], 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 84a51b48..999f598e 100644 --- a/lib/features/chat/models/chat_messages_model.dart +++ b/lib/features/chat/models/chat_messages_model.dart @@ -3,7 +3,6 @@ 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_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/diary/models/diary_model.dart b/lib/features/diary/models/diary_model.dart index 3a899363..9beb22d7 100644 --- a/lib/features/diary/models/diary_model.dart +++ b/lib/features/diary/models/diary_model.dart @@ -1,4 +1,5 @@ import 'package:freezed_annotation/freezed_annotation.dart'; + import './meal.dart'; part 'diary_model.freezed.dart'; @@ -16,6 +17,5 @@ class DiaryModel with _$DiaryModel { DateTime? retire, }) = _DiaryModel; - factory DiaryModel.fromJson(Map json) => - _$DiaryModelFromJson(json); + factory DiaryModel.fromJson(Map json) => _$DiaryModelFromJson(json); } diff --git a/lib/features/diary/models/meal.dart b/lib/features/diary/models/meal.dart index dbf3d062..415242c6 100644 --- a/lib/features/diary/models/meal.dart +++ b/lib/features/diary/models/meal.dart @@ -1,9 +1,9 @@ import 'package:freezed_annotation/freezed_annotation.dart'; -import './portion.dart'; + import './photo.dart'; +import './portion.dart'; part 'meal.freezed.dart'; - part 'meal.g.dart'; @freezed diff --git a/lib/features/diary/models/photo.freezed.dart b/lib/features/diary/models/photo.freezed.dart index 2d9c70bd..81cbdd37 100644 --- a/lib/features/diary/models/photo.freezed.dart +++ b/lib/features/diary/models/photo.freezed.dart @@ -21,33 +21,33 @@ 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; } /// @nodoc abstract class $PhotoCopyWith<$Res> { - factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) = - _$PhotoCopyWithImpl<$Res, Photo>; + factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) = _$PhotoCopyWithImpl<$Res, Photo>; + @useResult - $Res call( - {int id, - @JsonKey(name: 'original_name') String originalName, - String path}); + $Res call({int id, @JsonKey(name: 'original_name') String originalName, String path}); } /// @nodoc -class _$PhotoCopyWithImpl<$Res, $Val extends Photo> - implements $PhotoCopyWith<$Res> { +class _$PhotoCopyWithImpl<$Res, $Val extends Photo> implements $PhotoCopyWith<$Res> { _$PhotoCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -77,24 +77,16 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo> /// @nodoc abstract class _$$PhotoImplCopyWith<$Res> implements $PhotoCopyWith<$Res> { - factory _$$PhotoImplCopyWith( - _$PhotoImpl value, $Res Function(_$PhotoImpl) then) = - __$$PhotoImplCopyWithImpl<$Res>; + factory _$$PhotoImplCopyWith(_$PhotoImpl value, $Res Function(_$PhotoImpl) then) = __$$PhotoImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {int id, - @JsonKey(name: 'original_name') String originalName, - String path}); + $Res call({int id, @JsonKey(name: 'original_name') String originalName, String path}); } /// @nodoc -class __$$PhotoImplCopyWithImpl<$Res> - extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl> - implements _$$PhotoImplCopyWith<$Res> { - __$$PhotoImplCopyWithImpl( - _$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) - : super(_value, _then); +class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl> implements _$$PhotoImplCopyWith<$Res> { + __$$PhotoImplCopyWithImpl(_$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -123,13 +115,9 @@ class __$$PhotoImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$PhotoImpl implements _Photo { - const _$PhotoImpl( - {required this.id, - @JsonKey(name: 'original_name') required this.originalName, - required this.path}); + const _$PhotoImpl({required this.id, @JsonKey(name: 'original_name') required this.originalName, required this.path}); - factory _$PhotoImpl.fromJson(Map json) => - _$$PhotoImplFromJson(json); + factory _$PhotoImpl.fromJson(Map json) => _$$PhotoImplFromJson(json); @override final int id; @@ -150,8 +138,7 @@ class _$PhotoImpl implements _Photo { (other.runtimeType == runtimeType && other is _$PhotoImpl && (identical(other.id, id) || other.id == id) && - (identical(other.originalName, originalName) || - other.originalName == originalName) && + (identical(other.originalName, originalName) || other.originalName == originalName) && (identical(other.path, path) || other.path == path)); } @@ -162,8 +149,7 @@ class _$PhotoImpl implements _Photo { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => - __$$PhotoImplCopyWithImpl<_$PhotoImpl>(this, _$identity); + _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => __$$PhotoImplCopyWithImpl<_$PhotoImpl>(this, _$identity); @override Map toJson() { @@ -174,22 +160,21 @@ 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 => - throw _privateConstructorUsedError; + _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/photo.g.dart b/lib/features/diary/models/photo.g.dart index cacf65ac..1efd15ed 100644 --- a/lib/features/diary/models/photo.g.dart +++ b/lib/features/diary/models/photo.g.dart @@ -12,8 +12,7 @@ _$PhotoImpl _$$PhotoImplFromJson(Map json) => _$PhotoImpl( path: json['path'] as String, ); -Map _$$PhotoImplToJson(_$PhotoImpl instance) => - { +Map _$$PhotoImplToJson(_$PhotoImpl instance) => { 'id': instance.id, 'original_name': instance.originalName, 'path': instance.path, diff --git a/lib/features/diary/models/portion.dart b/lib/features/diary/models/portion.dart index 51ec5bbc..54a46dd6 100644 --- a/lib/features/diary/models/portion.dart +++ b/lib/features/diary/models/portion.dart @@ -1,7 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'portion.freezed.dart'; - part 'portion.g.dart'; @freezed @@ -13,6 +12,5 @@ class Portion with _$Portion { required String portion, }) = _Portion; - factory Portion.fromJson(Map json) => - _$PortionFromJson(json); + factory Portion.fromJson(Map json) => _$PortionFromJson(json); } diff --git a/lib/features/diary/models/product.dart b/lib/features/diary/models/product.dart index d054257b..050b97de 100644 --- a/lib/features/diary/models/product.dart +++ b/lib/features/diary/models/product.dart @@ -1,7 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'product.freezed.dart'; - part 'product.g.dart'; @freezed @@ -11,6 +10,5 @@ class Product with _$Product { required String name, }) = _Product; - factory Product.fromJson(Map json) => - _$ProductFromJson(json); + factory Product.fromJson(Map json) => _$ProductFromJson(json); } diff --git a/lib/features/diary/presentation/bloc/diary_bloc.dart b/lib/features/diary/presentation/bloc/diary_bloc.dart index 379aaeae..da11c3c1 100644 --- a/lib/features/diary/presentation/bloc/diary_bloc.dart +++ b/lib/features/diary/presentation/bloc/diary_bloc.dart @@ -1,14 +1,16 @@ import 'dart:async'; + import 'package:eatvio_app/features/diary/models/diary_model.dart'; import 'package:eatvio_app/features/diary/models/meal.dart'; import 'package:eatvio_app/features/diary/models/product.dart'; +import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; import 'package:eatvio_app/features/diary/repositories/diary_repository.dart'; -import 'package:intl/intl.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; -import '/core/app_export.dart'; import 'package:image_picker/image_picker.dart'; -import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; +import 'package:intl/intl.dart'; + +import '/core/app_export.dart'; part 'diary_event.dart'; @@ -16,8 +18,7 @@ part 'diary_event.dart'; class DiaryBloc extends Bloc { final DiaryRepository diaryRepository; - DiaryBloc({required this.diaryRepository}) - : super(const DiaryState.loading()) { + DiaryBloc({required this.diaryRepository}) : super(const DiaryState.loading()) { on(loadDiary); on(loadDiaryById); on(_changeSatiety); // пользователь нажимает на шкалу сытости @@ -55,29 +56,15 @@ class DiaryBloc extends Bloc { final DiaryModel diary = await diaryRepository.getDiary(diaryID ?? 45); final Meal currentMeal = diary.meals[0]; - List portionList = [ - SelectionPopupModel(title: "gr"), - SelectionPopupModel(title: "pcs") - ]; + List portionList = [SelectionPopupModel(title: "gr"), SelectionPopupModel(title: "pcs")]; - final Map chartData = - await diaryRepository.getChartData(diaryID ?? 45); - final Map dailyNutritionIntake = - chartData['dailyNutritionIntake']!; - final Map dailyNutritionRecommendations = - chartData['dailyNutritionRecommendation']!; - final double ccal = dailyNutritionIntake['energy']! / - dailyNutritionRecommendations['energy']! * - 50; - final double proteins = dailyNutritionIntake['proteins']! / - dailyNutritionRecommendations['proteins']! * - 50; - final double fats = dailyNutritionIntake['fats']! / - dailyNutritionRecommendations['fats']! * - 50; - final double carbs = dailyNutritionIntake['carbohydrates']! / - dailyNutritionRecommendations['carbohydrates']! * - 50; + final Map chartData = await diaryRepository.getChartData(diaryID ?? 45); + final Map dailyNutritionIntake = chartData['dailyNutritionIntake']!; + final Map dailyNutritionRecommendations = chartData['dailyNutritionRecommendation']!; + final double ccal = dailyNutritionIntake['energy']! / dailyNutritionRecommendations['energy']! * 50; + final double proteins = dailyNutritionIntake['proteins']! / dailyNutritionRecommendations['proteins']! * 50; + final double fats = dailyNutritionIntake['fats']! / dailyNutritionRecommendations['fats']! * 50; + final double carbs = dailyNutritionIntake['carbohydrates']! / dailyNutritionRecommendations['carbohydrates']! * 50; Color getColor(double value) { if (value >= 99.1) { @@ -145,29 +132,15 @@ class DiaryBloc extends Bloc { final DiaryModel diary = await diaryRepository.getDiary(diaryID); final Meal currentMeal = diary.meals[0]; - List portionList = [ - SelectionPopupModel(title: "gr"), - SelectionPopupModel(title: "pcs") - ]; + List portionList = [SelectionPopupModel(title: "gr"), SelectionPopupModel(title: "pcs")]; - final Map chartData = - await diaryRepository.getChartData(diaryID); - final Map dailyNutritionIntake = - chartData['dailyNutritionIntake']!; - final Map dailyNutritionRecommendations = - chartData['dailyNutritionRecommendation']!; - final double ccal = dailyNutritionIntake['energy']! / - dailyNutritionRecommendations['energy']! * - 50; - final double proteins = dailyNutritionIntake['proteins']! / - dailyNutritionRecommendations['proteins']! * - 50; - final double fats = dailyNutritionIntake['fats']! / - dailyNutritionRecommendations['fats']! * - 50; - final double carbs = dailyNutritionIntake['carbohydrates']! / - dailyNutritionRecommendations['carbohydrates']! * - 50; + final Map chartData = await diaryRepository.getChartData(diaryID); + final Map dailyNutritionIntake = chartData['dailyNutritionIntake']!; + final Map dailyNutritionRecommendations = chartData['dailyNutritionRecommendation']!; + final double ccal = dailyNutritionIntake['energy']! / dailyNutritionRecommendations['energy']! * 50; + final double proteins = dailyNutritionIntake['proteins']! / dailyNutritionRecommendations['proteins']! * 50; + final double fats = dailyNutritionIntake['fats']! / dailyNutritionRecommendations['fats']! * 50; + final double carbs = dailyNutritionIntake['carbohydrates']! / dailyNutritionRecommendations['carbohydrates']! * 50; Color getColor(double value) { if (value >= 99.1) { @@ -269,11 +242,9 @@ class DiaryBloc extends Bloc { ) async { if (state is DiaryStateLoaded) { var currentState = state as DiaryStateLoaded; - var updatedState = - currentState.copyWith(wakeupController: event.selectedTime); + var updatedState = currentState.copyWith(wakeupController: event.selectedTime); final DateFormat formatter = DateFormat('HH:mm'); - final String wakeupString = formatter.format(DateTime( - 2022, 1, 1, event.selectedTime.hour, event.selectedTime.minute)); + final String wakeupString = formatter.format(DateTime(2022, 1, 1, event.selectedTime.hour, event.selectedTime.minute)); await diaryRepository.changeWakeup( currentState.diary.id, wakeupString, @@ -288,11 +259,9 @@ class DiaryBloc extends Bloc { ) async { if (state is DiaryStateLoaded) { var currentState = state as DiaryStateLoaded; - var updatedState = - currentState.copyWith(retireController: event.selectedTime); + var updatedState = currentState.copyWith(retireController: event.selectedTime); final DateFormat formatter = DateFormat('HH:mm'); - final String retireString = formatter.format(DateTime( - 2022, 1, 1, event.selectedTime.hour, event.selectedTime.minute)); + final String retireString = formatter.format(DateTime(2022, 1, 1, event.selectedTime.hour, event.selectedTime.minute)); await diaryRepository.changeRetire( currentState.diary.id, retireString, @@ -318,8 +287,7 @@ class DiaryBloc extends Bloc { ) async { if (state is DiaryStateLoaded) { final currentState = state as DiaryStateLoaded; - final Meal meal = currentState.diary.meals - .firstWhere((meal) => meal.type == event.value.id); + final Meal meal = currentState.diary.meals.firstWhere((meal) => meal.type == event.value.id); DiaryStateLoaded updatedState = currentState.copyWith( currentMeal: meal, portions: meal.portions, @@ -338,12 +306,10 @@ class DiaryBloc extends Bloc { if (state is DiaryStateLoaded) { var currentState = state as DiaryStateLoaded; - final Map> productNutritionalValues = - await diaryRepository.inputProduct(event.input); + final Map> productNutritionalValues = await diaryRepository.inputProduct(event.input); var updatedState = currentState.copyWith( product_nameController: TextEditingController(text: event.input), - autocompleteList: - productNutritionalValues['product_nutritional_value'] ?? [], + autocompleteList: productNutritionalValues['product_nutritional_value'] ?? [], ); if (event.input.length > 3) { updatedState = updatedState.copyWith(moderationExpanded: true); diff --git a/lib/features/diary/presentation/bloc/diary_event.dart b/lib/features/diary/presentation/bloc/diary_event.dart index 4faa190b..3c190626 100644 --- a/lib/features/diary/presentation/bloc/diary_event.dart +++ b/lib/features/diary/presentation/bloc/diary_event.dart @@ -19,7 +19,9 @@ class LoadDiaryById extends DiaryEvent { LoadDiaryById( this.id, ); + final String? id; + @override List get props => []; } @@ -28,7 +30,9 @@ class ChangeSatiety extends DiaryEvent { ChangeSatiety( this.selectedElement, ); + final int selectedElement; + @override List get props => [selectedElement]; } @@ -37,28 +41,35 @@ class ChangeMood extends DiaryEvent { ChangeMood( this.selectedElement, ); + final int selectedElement; + @override List get props => [selectedElement]; } class ChangeMealTime extends DiaryEvent { ChangeMealTime(this.time); + final TimeOfDay time; + @override List get props => [time]; } class AddComment extends DiaryEvent { AddComment(this.diaryId, this.comment); + final String comment; final int diaryId; + @override List get props => [comment, diaryId]; } class WakeupEvent extends DiaryEvent { WakeupEvent(this.selectedTime); + final TimeOfDay selectedTime; @override @@ -67,6 +78,7 @@ class WakeupEvent extends DiaryEvent { class RetireEvent extends DiaryEvent { RetireEvent(this.selectedTime); + final TimeOfDay selectedTime; @override @@ -85,62 +97,78 @@ class ToggleWakeupExpandedEvent extends DiaryEvent { class AddPortionEvent extends DiaryEvent { AddPortionEvent(); + @override List get props => []; } class RemovePortionEvent extends DiaryEvent { RemovePortionEvent(this.portionId); + final int portionId; + @override List get props => [portionId]; } class UploadImages extends DiaryEvent { UploadImages(this.image); + final XFile image; + @override List get props => [image]; } class RemoveImageEvent extends DiaryEvent { RemoveImageEvent(this.photoID, this.path); + final String photoID; final String path; + @override List get props => [photoID, path]; } class ProductInput extends DiaryEvent { ProductInput(this.input); + final String input; + @override List get props => [input]; } class ChangeMeal extends DiaryEvent { ChangeMeal({required this.value}); + SelectionPopupModel value; + @override List get props => [value]; } class ClearInput extends DiaryEvent { ClearInput({required this.value}); + TextEditingController value; + @override List get props => [value]; } class ChangePortion extends DiaryEvent { ChangePortion({required this.value}); + SelectionPopupModel value; + @override List get props => [value]; } class FinishDay extends DiaryEvent { FinishDay(); + @override List get props => []; } @@ -160,12 +188,13 @@ class SendModeration extends DiaryEvent { required this.fatsOn100gr, required this.carbohydratesOn100gr, }); + String name; String energyOn100gr; String proteinsOn100gr; String fatsOn100gr; String carbohydratesOn100gr; + @override - List get props => - [name, energyOn100gr, proteinsOn100gr, fatsOn100gr, carbohydratesOn100gr]; + List get props => [name, energyOn100gr, proteinsOn100gr, fatsOn100gr, carbohydratesOn100gr]; } diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 047dc64e..2358ea71 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -1,6 +1,7 @@ // ignore_for_file: unused_local_variable import 'package:carousel_slider_plus/carousel_slider_plus.dart'; +import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/diary/models/diary_model.dart'; import 'package:eatvio_app/features/diary/models/meal.dart'; import 'package:eatvio_app/features/diary/models/photo.dart'; @@ -8,15 +9,13 @@ import 'package:eatvio_app/features/diary/models/portion.dart'; import 'package:eatvio_app/features/diary/models/product.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; -import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; import 'package:eatvio_app/widgets/custom_edit_drop_down.dart'; +import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; import 'package:eatvio_app/widgets/custom_outlined_button.dart'; import 'package:eatvio_app/widgets/custom_scale_element.dart'; - +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:image_picker/image_picker.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; @@ -176,14 +175,10 @@ class DiaryScreen extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text( - '${state.chartData![3].nutrition.toStringAsFixed(0)}%'), // Калории - Text( - '${state.chartData![2].nutrition.toStringAsFixed(0)}%'), // Белки - Text( - '${state.chartData![1].nutrition.toStringAsFixed(0)}%'), // Жиры - Text( - '${state.chartData![0].nutrition.toStringAsFixed(0)}% '), // Углеводы + Text('${state.chartData![3].nutrition.toStringAsFixed(0)}%'), // Калории + Text('${state.chartData![2].nutrition.toStringAsFixed(0)}%'), // Белки + Text('${state.chartData![1].nutrition.toStringAsFixed(0)}%'), // Жиры + Text('${state.chartData![0].nutrition.toStringAsFixed(0)}% '), // Углеводы ], ), ], @@ -329,9 +324,7 @@ class DiaryScreen extends StatelessWidget { borderRadius: BorderRadiusStyle.roundedBorder5, ), child: Center( - child: CircularProgressIndicator( - color: appTheme - .blueGray300), // Замените на свой прелоадер при необходимости + child: CircularProgressIndicator(color: appTheme.blueGray300), // Замените на свой прелоадер при необходимости ), ), ], @@ -355,8 +348,7 @@ class DiaryScreen extends StatelessWidget { _buildMeal(BuildContext context, DiaryStateLoaded state) { final digitsOnly = FilteringTextInputFormatter.digitsOnly; - List _options = - state.autocompleteList.map((Product item) => item.name).toList(); + List _options = state.autocompleteList.map((Product item) => item.name).toList(); FocusNode focusNodeName = FocusNode(); return Container( margin: EdgeInsets.symmetric(horizontal: 16.h), @@ -400,9 +392,7 @@ class DiaryScreen extends StatelessWidget { onTap: () => _selectMealTime(context, state), child: AbsorbPointer( child: CustomTextFormField( - hintText: state.mealTimeController - ?.format(context) - .toString(), + hintText: state.mealTimeController?.format(context).toString(), autofocus: false, ), ), @@ -538,9 +528,7 @@ class DiaryScreen extends StatelessWidget { SizedBox(height: 30.v), _buildAddProduct(context, state), SizedBox(height: 30.v), - ...state.portions - .map((portion) => _buildProduct(context, portion)) - .toList(), + ...state.portions.map((portion) => _buildProduct(context, portion)).toList(), SizedBox(height: 30.v), _buildCarousel(context, state), SizedBox(height: 20.v), @@ -689,8 +677,7 @@ class DiaryScreen extends StatelessWidget { popDialog(BuildContext dialogContext) { return () { - Navigator.of(dialogContext) - .pop(); // Dismiss the dialog on Cancel button press + Navigator.of(dialogContext).pop(); // Dismiss the dialog on Cancel button press }; } @@ -700,8 +687,7 @@ class DiaryScreen extends StatelessWidget { }; } - selectProduct(AutocompleteOnSelected onSelected, String option, - DiaryStateLoaded state) { + selectProduct(AutocompleteOnSelected onSelected, String option, DiaryStateLoaded state) { state.product_nameController.text = option; return () { onSelected(option); @@ -769,9 +755,7 @@ class DiaryScreen extends StatelessWidget { top: 5.v, ), child: Text( - portion.product_name.length > 8 - ? portion.product_name.substring(0, 8) - : portion.product_name, + portion.product_name.length > 8 ? portion.product_name.substring(0, 8) : portion.product_name, style: CustomTextStyles.titleMedium16, ), ), @@ -843,9 +827,7 @@ class DiaryScreen extends StatelessWidget { removePhoto(BuildContext context, Photo photo) { return () { - context - .read() - .add(RemoveImageEvent(photo.id.toString(), photo.path)); + context.read().add(RemoveImageEvent(photo.id.toString(), photo.path)); }; } @@ -923,9 +905,7 @@ class DiaryScreen extends StatelessWidget { r"Подъем \ отход ко сну", style: CustomTextStyles.bodyMediumBlack900, ), - Icon(state.wakeupExpanded - ? Icons.arrow_drop_up - : Icons.arrow_drop_down), + Icon(state.wakeupExpanded ? Icons.arrow_drop_up : Icons.arrow_drop_down), ], ), ), @@ -939,8 +919,7 @@ class DiaryScreen extends StatelessWidget { onTap: () => _selectWakeupTime(context, state), child: AbsorbPointer( child: CustomTextFormField( - hintText: - state.wakeupController.format(context).toString(), + hintText: state.wakeupController.format(context).toString(), prefix: Icon(Icons.sunny), autofocus: false, ), @@ -951,8 +930,7 @@ class DiaryScreen extends StatelessWidget { onTap: () => _selectRetireTime(context, state), child: AbsorbPointer( child: CustomTextFormField( - hintText: - state.retireController.format(context).toString(), + hintText: state.retireController.format(context).toString(), prefix: Icon(Icons.bed), autofocus: false, ), @@ -999,8 +977,7 @@ class DiaryScreen extends StatelessWidget { }; } - Function() sendFinishDayData( - BuildContext dialogContext, BuildContext context) { + Function() sendFinishDayData(BuildContext dialogContext, BuildContext context) { return () { closeDialog(dialogContext); context.read().add(FinishDay()); @@ -1043,9 +1020,7 @@ class DiaryScreen extends StatelessWidget { "Ваше настроение после приема пищи", style: CustomTextStyles.bodyMediumBlack900, ), - Icon(state.moodExpanded - ? Icons.arrow_drop_up - : Icons.arrow_drop_down), + Icon(state.moodExpanded ? Icons.arrow_drop_up : Icons.arrow_drop_down), ], ), ), @@ -1105,8 +1080,7 @@ class DiaryScreen extends StatelessWidget { }; } - Future _selectWakeupTime( - BuildContext context, DiaryStateLoaded state) async { + Future _selectWakeupTime(BuildContext context, DiaryStateLoaded state) async { final TimeOfDay? pickedTime = await showTimePicker( context: context, initialTime: state.wakeupController, @@ -1116,8 +1090,7 @@ class DiaryScreen extends StatelessWidget { } } - Future _selectRetireTime( - BuildContext context, DiaryStateLoaded state) async { + Future _selectRetireTime(BuildContext context, DiaryStateLoaded state) async { final TimeOfDay? pickedTime = await showTimePicker( context: context, initialTime: state.retireController, @@ -1127,8 +1100,7 @@ class DiaryScreen extends StatelessWidget { } } - Future _selectMealTime( - BuildContext context, DiaryStateLoaded state) async { + Future _selectMealTime(BuildContext context, DiaryStateLoaded state) async { final TimeOfDay? pickedTime = await showTimePicker( context: context, initialTime: state.mealTimeController ?? TimeOfDay.now(), @@ -1139,8 +1111,7 @@ class DiaryScreen extends StatelessWidget { } } -bool checkConsumedValues( - List recommendedValues, List consumedValues) { +bool checkConsumedValues(List recommendedValues, List consumedValues) { for (int i = 0; i < recommendedValues.length; i++) { if (consumedValues[i] > recommendedValues[i]) { // Если хотя бы одно потребленное значение превышает рекомендованное diff --git a/lib/features/feed/models/diets_pagination_model.freezed.dart b/lib/features/feed/models/diets_pagination_model.freezed.dart index 2c402671..c6965ee7 100644 --- a/lib/features/feed/models/diets_pagination_model.freezed.dart +++ b/lib/features/feed/models/diets_pagination_model.freezed.dart @@ -22,39 +22,38 @@ DietsPagination _$DietsPaginationFromJson(Map json) { mixin _$DietsPagination { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; + @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; + @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $DietsPaginationCopyWith get copyWith => - throw _privateConstructorUsedError; + $DietsPaginationCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DietsPaginationCopyWith<$Res> { - factory $DietsPaginationCopyWith( - DietsPagination value, $Res Function(DietsPagination) then) = - _$DietsPaginationCopyWithImpl<$Res, DietsPagination>; + factory $DietsPaginationCopyWith(DietsPagination value, $Res Function(DietsPagination) then) = _$DietsPaginationCopyWithImpl<$Res, DietsPagination>; + @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; + $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> - implements $DietsPaginationCopyWith<$Res> { +class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> implements $DietsPaginationCopyWith<$Res> { _$DietsPaginationCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -99,31 +98,24 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> } /// @nodoc -abstract class _$$DietsPaginationImplCopyWith<$Res> - implements $DietsPaginationCopyWith<$Res> { - factory _$$DietsPaginationImplCopyWith(_$DietsPaginationImpl value, - $Res Function(_$DietsPaginationImpl) then) = - __$$DietsPaginationImplCopyWithImpl<$Res>; +abstract class _$$DietsPaginationImplCopyWith<$Res> implements $DietsPaginationCopyWith<$Res> { + factory _$$DietsPaginationImplCopyWith(_$DietsPaginationImpl value, $Res Function(_$DietsPaginationImpl) then) = __$$DietsPaginationImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; + @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$DietsPaginationImplCopyWithImpl<$Res> - extends _$DietsPaginationCopyWithImpl<$Res, _$DietsPaginationImpl> +class __$$DietsPaginationImplCopyWithImpl<$Res> extends _$DietsPaginationCopyWithImpl<$Res, _$DietsPaginationImpl> implements _$$DietsPaginationImplCopyWith<$Res> { - __$$DietsPaginationImplCopyWithImpl( - _$DietsPaginationImpl _value, $Res Function(_$DietsPaginationImpl) _then) - : super(_value, _then); + __$$DietsPaginationImplCopyWithImpl(_$DietsPaginationImpl _value, $Res Function(_$DietsPaginationImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -153,15 +145,13 @@ class __$$DietsPaginationImplCopyWithImpl<$Res> @JsonSerializable() class _$DietsPaginationImpl implements _DietsPagination { const _$DietsPaginationImpl( - {@JsonKey(name: "data") required final List data, - @JsonKey(name: "links") required this.links, - @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$DietsPaginationImpl.fromJson(Map json) => - _$$DietsPaginationImplFromJson(json); + factory _$DietsPaginationImpl.fromJson(Map json) => _$$DietsPaginationImplFromJson(json); final List _data; + @override @JsonKey(name: "data") List get data { @@ -194,15 +184,12 @@ class _$DietsPaginationImpl implements _DietsPagination { @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => - __$$DietsPaginationImplCopyWithImpl<_$DietsPaginationImpl>( - this, _$identity); + _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => __$$DietsPaginationImplCopyWithImpl<_$DietsPaginationImpl>(this, _$identity); @override Map toJson() { @@ -218,22 +205,23 @@ abstract class _DietsPagination implements DietsPagination { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$DietsPaginationImpl; - factory _DietsPagination.fromJson(Map json) = - _$DietsPaginationImpl.fromJson; + factory _DietsPagination.fromJson(Map json) = _$DietsPaginationImpl.fromJson; @override @JsonKey(name: "data") List get data; + @override @JsonKey(name: "links") Links get links; + @override @JsonKey(name: "meta") Meta get meta; + @override @JsonKey(ignore: true) - _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => throw _privateConstructorUsedError; } Datum _$DatumFromJson(Map json) { @@ -244,39 +232,50 @@ Datum _$DatumFromJson(Map json) { mixin _$Datum { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; + @JsonKey(name: "image") String get image => throw _privateConstructorUsedError; + @JsonKey(name: "duration") int get duration => throw _privateConstructorUsedError; + @JsonKey(name: "state") String get state => throw _privateConstructorUsedError; + @JsonKey(name: "type") Type get type => throw _privateConstructorUsedError; + @JsonKey(name: "details") String get details => throw _privateConstructorUsedError; + @JsonKey(name: "daily_schedule") - List>> get dailySchedule => - throw _privateConstructorUsedError; + List>> get dailySchedule => throw _privateConstructorUsedError; + @JsonKey(name: "author") Author get author => throw _privateConstructorUsedError; + @JsonKey(name: "total_likes") int get totalLikes => throw _privateConstructorUsedError; + @JsonKey(name: "total_views") int get totalViews => throw _privateConstructorUsedError; + @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $DatumCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DatumCopyWith<$Res> { - factory $DatumCopyWith(Datum value, $Res Function(Datum) then) = - _$DatumCopyWithImpl<$Res, Datum>; + factory $DatumCopyWith(Datum value, $Res Function(Datum) then) = _$DatumCopyWithImpl<$Res, Datum>; + @useResult $Res call( {@JsonKey(name: "id") int id, @@ -286,24 +285,24 @@ abstract class $DatumCopyWith<$Res> { @JsonKey(name: "state") String state, @JsonKey(name: "type") Type type, @JsonKey(name: "details") String details, - @JsonKey(name: "daily_schedule") - List>> dailySchedule, + @JsonKey(name: "daily_schedule") List>> dailySchedule, @JsonKey(name: "author") Author author, @JsonKey(name: "total_likes") int totalLikes, @JsonKey(name: "total_views") int totalViews, @JsonKey(name: "total_comments") int totalComments}); $TypeCopyWith<$Res> get type; + $AuthorCopyWith<$Res> get author; } /// @nodoc -class _$DatumCopyWithImpl<$Res, $Val extends Datum> - implements $DatumCopyWith<$Res> { +class _$DatumCopyWithImpl<$Res, $Val extends Datum> implements $DatumCopyWith<$Res> { _$DatumCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -394,9 +393,8 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> /// @nodoc abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> { - factory _$$DatumImplCopyWith( - _$DatumImpl value, $Res Function(_$DatumImpl) then) = - __$$DatumImplCopyWithImpl<$Res>; + factory _$$DatumImplCopyWith(_$DatumImpl value, $Res Function(_$DatumImpl) then) = __$$DatumImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -407,8 +405,7 @@ abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> { @JsonKey(name: "state") String state, @JsonKey(name: "type") Type type, @JsonKey(name: "details") String details, - @JsonKey(name: "daily_schedule") - List>> dailySchedule, + @JsonKey(name: "daily_schedule") List>> dailySchedule, @JsonKey(name: "author") Author author, @JsonKey(name: "total_likes") int totalLikes, @JsonKey(name: "total_views") int totalViews, @@ -416,17 +413,14 @@ abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> { @override $TypeCopyWith<$Res> get type; + @override $AuthorCopyWith<$Res> get author; } /// @nodoc -class __$$DatumImplCopyWithImpl<$Res> - extends _$DatumCopyWithImpl<$Res, _$DatumImpl> - implements _$$DatumImplCopyWith<$Res> { - __$$DatumImplCopyWithImpl( - _$DatumImpl _value, $Res Function(_$DatumImpl) _then) - : super(_value, _then); +class __$$DatumImplCopyWithImpl<$Res> extends _$DatumCopyWithImpl<$Res, _$DatumImpl> implements _$$DatumImplCopyWith<$Res> { + __$$DatumImplCopyWithImpl(_$DatumImpl _value, $Res Function(_$DatumImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -508,16 +502,14 @@ class _$DatumImpl implements _Datum { @JsonKey(name: "state") required this.state, @JsonKey(name: "type") required this.type, @JsonKey(name: "details") required this.details, - @JsonKey(name: "daily_schedule") - required final List>> dailySchedule, + @JsonKey(name: "daily_schedule") required final List>> dailySchedule, @JsonKey(name: "author") required this.author, @JsonKey(name: "total_likes") required this.totalLikes, @JsonKey(name: "total_views") required this.totalViews, @JsonKey(name: "total_comments") required this.totalComments}) : _dailySchedule = dailySchedule; - factory _$DatumImpl.fromJson(Map json) => - _$$DatumImplFromJson(json); + factory _$DatumImpl.fromJson(Map json) => _$$DatumImplFromJson(json); @override @JsonKey(name: "id") @@ -541,6 +533,7 @@ class _$DatumImpl implements _Datum { @JsonKey(name: "details") final String details; final List>> _dailySchedule; + @override @JsonKey(name: "daily_schedule") List>> get dailySchedule { @@ -575,44 +568,26 @@ class _$DatumImpl implements _Datum { (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.image, image) || other.image == image) && - (identical(other.duration, duration) || - other.duration == duration) && + (identical(other.duration, duration) || other.duration == duration) && (identical(other.state, state) || other.state == state) && (identical(other.type, type) || other.type == type) && (identical(other.details, details) || other.details == details) && - const DeepCollectionEquality() - .equals(other._dailySchedule, _dailySchedule) && + const DeepCollectionEquality().equals(other._dailySchedule, _dailySchedule) && (identical(other.author, author) || other.author == author) && - (identical(other.totalLikes, totalLikes) || - other.totalLikes == totalLikes) && - (identical(other.totalViews, totalViews) || - other.totalViews == totalViews) && - (identical(other.totalComments, totalComments) || - other.totalComments == totalComments)); + (identical(other.totalLikes, totalLikes) || other.totalLikes == totalLikes) && + (identical(other.totalViews, totalViews) || other.totalViews == totalViews) && + (identical(other.totalComments, totalComments) || other.totalComments == totalComments)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - id, - name, - image, - duration, - state, - type, - details, - const DeepCollectionEquality().hash(_dailySchedule), - author, - totalLikes, - totalViews, - totalComments); + int get hashCode => Object.hash(runtimeType, id, name, image, duration, state, type, details, const DeepCollectionEquality().hash(_dailySchedule), author, + totalLikes, totalViews, totalComments); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DatumImplCopyWith<_$DatumImpl> get copyWith => - __$$DatumImplCopyWithImpl<_$DatumImpl>(this, _$identity); + _$$DatumImplCopyWith<_$DatumImpl> get copyWith => __$$DatumImplCopyWithImpl<_$DatumImpl>(this, _$identity); @override Map toJson() { @@ -624,63 +599,72 @@ class _$DatumImpl implements _Datum { abstract class _Datum implements Datum { const factory _Datum( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "image") required final String image, - @JsonKey(name: "duration") required final int duration, - @JsonKey(name: "state") required final String state, - @JsonKey(name: "type") required final Type type, - @JsonKey(name: "details") required final String details, - @JsonKey(name: "daily_schedule") - required final List>> dailySchedule, - @JsonKey(name: "author") required final Author author, - @JsonKey(name: "total_likes") required final int totalLikes, - @JsonKey(name: "total_views") required final int totalViews, - @JsonKey(name: "total_comments") required final int totalComments}) = - _$DatumImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "image") required final String image, + @JsonKey(name: "duration") required final int duration, + @JsonKey(name: "state") required final String state, + @JsonKey(name: "type") required final Type type, + @JsonKey(name: "details") required final String details, + @JsonKey(name: "daily_schedule") required final List>> dailySchedule, + @JsonKey(name: "author") required final Author author, + @JsonKey(name: "total_likes") required final int totalLikes, + @JsonKey(name: "total_views") required final int totalViews, + @JsonKey(name: "total_comments") required final int totalComments}) = _$DatumImpl; factory _Datum.fromJson(Map json) = _$DatumImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "name") String get name; + @override @JsonKey(name: "image") String get image; + @override @JsonKey(name: "duration") int get duration; + @override @JsonKey(name: "state") String get state; + @override @JsonKey(name: "type") Type get type; + @override @JsonKey(name: "details") String get details; + @override @JsonKey(name: "daily_schedule") List>> get dailySchedule; + @override @JsonKey(name: "author") Author get author; + @override @JsonKey(name: "total_likes") int get totalLikes; + @override @JsonKey(name: "total_views") int get totalViews; + @override @JsonKey(name: "total_comments") int get totalComments; + @override @JsonKey(ignore: true) - _$$DatumImplCopyWith<_$DatumImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DatumImplCopyWith<_$DatumImpl> get copyWith => throw _privateConstructorUsedError; } Author _$AuthorFromJson(Map json) { @@ -691,22 +675,26 @@ Author _$AuthorFromJson(Map json) { mixin _$Author { @JsonKey(name: "author_slug") String get authorSlug => throw _privateConstructorUsedError; + @JsonKey(name: "author_name") String get authorName => throw _privateConstructorUsedError; + @JsonKey(name: "author_profile_icon") String get authorProfileIcon => throw _privateConstructorUsedError; + @JsonKey(name: "author_is_me") bool get authorIsMe => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $AuthorCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $AuthorCopyWith<$Res> { - factory $AuthorCopyWith(Author value, $Res Function(Author) then) = - _$AuthorCopyWithImpl<$Res, Author>; + factory $AuthorCopyWith(Author value, $Res Function(Author) then) = _$AuthorCopyWithImpl<$Res, Author>; + @useResult $Res call( {@JsonKey(name: "author_slug") String authorSlug, @@ -716,12 +704,12 @@ abstract class $AuthorCopyWith<$Res> { } /// @nodoc -class _$AuthorCopyWithImpl<$Res, $Val extends Author> - implements $AuthorCopyWith<$Res> { +class _$AuthorCopyWithImpl<$Res, $Val extends Author> implements $AuthorCopyWith<$Res> { _$AuthorCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -756,9 +744,8 @@ class _$AuthorCopyWithImpl<$Res, $Val extends Author> /// @nodoc abstract class _$$AuthorImplCopyWith<$Res> implements $AuthorCopyWith<$Res> { - factory _$$AuthorImplCopyWith( - _$AuthorImpl value, $Res Function(_$AuthorImpl) then) = - __$$AuthorImplCopyWithImpl<$Res>; + factory _$$AuthorImplCopyWith(_$AuthorImpl value, $Res Function(_$AuthorImpl) then) = __$$AuthorImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -769,12 +756,8 @@ abstract class _$$AuthorImplCopyWith<$Res> implements $AuthorCopyWith<$Res> { } /// @nodoc -class __$$AuthorImplCopyWithImpl<$Res> - extends _$AuthorCopyWithImpl<$Res, _$AuthorImpl> - implements _$$AuthorImplCopyWith<$Res> { - __$$AuthorImplCopyWithImpl( - _$AuthorImpl _value, $Res Function(_$AuthorImpl) _then) - : super(_value, _then); +class __$$AuthorImplCopyWithImpl<$Res> extends _$AuthorCopyWithImpl<$Res, _$AuthorImpl> implements _$$AuthorImplCopyWith<$Res> { + __$$AuthorImplCopyWithImpl(_$AuthorImpl _value, $Res Function(_$AuthorImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -814,8 +797,7 @@ class _$AuthorImpl implements _Author { @JsonKey(name: "author_profile_icon") required this.authorProfileIcon, @JsonKey(name: "author_is_me") required this.authorIsMe}); - factory _$AuthorImpl.fromJson(Map json) => - _$$AuthorImplFromJson(json); + factory _$AuthorImpl.fromJson(Map json) => _$$AuthorImplFromJson(json); @override @JsonKey(name: "author_slug") @@ -840,26 +822,20 @@ class _$AuthorImpl implements _Author { return identical(this, other) || (other.runtimeType == runtimeType && other is _$AuthorImpl && - (identical(other.authorSlug, authorSlug) || - other.authorSlug == authorSlug) && - (identical(other.authorName, authorName) || - other.authorName == authorName) && - (identical(other.authorProfileIcon, authorProfileIcon) || - other.authorProfileIcon == authorProfileIcon) && - (identical(other.authorIsMe, authorIsMe) || - other.authorIsMe == authorIsMe)); + (identical(other.authorSlug, authorSlug) || other.authorSlug == authorSlug) && + (identical(other.authorName, authorName) || other.authorName == authorName) && + (identical(other.authorProfileIcon, authorProfileIcon) || other.authorProfileIcon == authorProfileIcon) && + (identical(other.authorIsMe, authorIsMe) || other.authorIsMe == authorIsMe)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, authorSlug, authorName, authorProfileIcon, authorIsMe); + int get hashCode => Object.hash(runtimeType, authorSlug, authorName, authorProfileIcon, authorIsMe); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => - __$$AuthorImplCopyWithImpl<_$AuthorImpl>(this, _$identity); + _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => __$$AuthorImplCopyWithImpl<_$AuthorImpl>(this, _$identity); @override Map toJson() { @@ -871,31 +847,32 @@ class _$AuthorImpl implements _Author { abstract class _Author implements Author { const factory _Author( - {@JsonKey(name: "author_slug") required final String authorSlug, - @JsonKey(name: "author_name") required final String authorName, - @JsonKey(name: "author_profile_icon") - required final String authorProfileIcon, - @JsonKey(name: "author_is_me") required final bool authorIsMe}) = - _$AuthorImpl; + {@JsonKey(name: "author_slug") required final String authorSlug, + @JsonKey(name: "author_name") required final String authorName, + @JsonKey(name: "author_profile_icon") required final String authorProfileIcon, + @JsonKey(name: "author_is_me") required final bool authorIsMe}) = _$AuthorImpl; factory _Author.fromJson(Map json) = _$AuthorImpl.fromJson; @override @JsonKey(name: "author_slug") String get authorSlug; + @override @JsonKey(name: "author_name") String get authorName; + @override @JsonKey(name: "author_profile_icon") String get authorProfileIcon; + @override @JsonKey(name: "author_is_me") bool get authorIsMe; + @override @JsonKey(ignore: true) - _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => throw _privateConstructorUsedError; } DailySchedule _$DailyScheduleFromJson(Map json) { @@ -906,24 +883,26 @@ DailySchedule _$DailyScheduleFromJson(Map json) { mixin _$DailySchedule { @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; + @JsonKey(name: "uniq") String get uniq => throw _privateConstructorUsedError; + @JsonKey(name: "portion") Portion get portion => throw _privateConstructorUsedError; + @JsonKey(name: "quantity") int get quantity => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $DailyScheduleCopyWith get copyWith => - throw _privateConstructorUsedError; + $DailyScheduleCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DailyScheduleCopyWith<$Res> { - factory $DailyScheduleCopyWith( - DailySchedule value, $Res Function(DailySchedule) then) = - _$DailyScheduleCopyWithImpl<$Res, DailySchedule>; + factory $DailyScheduleCopyWith(DailySchedule value, $Res Function(DailySchedule) then) = _$DailyScheduleCopyWithImpl<$Res, DailySchedule>; + @useResult $Res call( {@JsonKey(name: "name") String name, @@ -933,12 +912,12 @@ abstract class $DailyScheduleCopyWith<$Res> { } /// @nodoc -class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> - implements $DailyScheduleCopyWith<$Res> { +class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> implements $DailyScheduleCopyWith<$Res> { _$DailyScheduleCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -972,11 +951,9 @@ class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> } /// @nodoc -abstract class _$$DailyScheduleImplCopyWith<$Res> - implements $DailyScheduleCopyWith<$Res> { - factory _$$DailyScheduleImplCopyWith( - _$DailyScheduleImpl value, $Res Function(_$DailyScheduleImpl) then) = - __$$DailyScheduleImplCopyWithImpl<$Res>; +abstract class _$$DailyScheduleImplCopyWith<$Res> implements $DailyScheduleCopyWith<$Res> { + factory _$$DailyScheduleImplCopyWith(_$DailyScheduleImpl value, $Res Function(_$DailyScheduleImpl) then) = __$$DailyScheduleImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -987,12 +964,8 @@ abstract class _$$DailyScheduleImplCopyWith<$Res> } /// @nodoc -class __$$DailyScheduleImplCopyWithImpl<$Res> - extends _$DailyScheduleCopyWithImpl<$Res, _$DailyScheduleImpl> - implements _$$DailyScheduleImplCopyWith<$Res> { - __$$DailyScheduleImplCopyWithImpl( - _$DailyScheduleImpl _value, $Res Function(_$DailyScheduleImpl) _then) - : super(_value, _then); +class __$$DailyScheduleImplCopyWithImpl<$Res> extends _$DailyScheduleCopyWithImpl<$Res, _$DailyScheduleImpl> implements _$$DailyScheduleImplCopyWith<$Res> { + __$$DailyScheduleImplCopyWithImpl(_$DailyScheduleImpl _value, $Res Function(_$DailyScheduleImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -1032,8 +1005,7 @@ class _$DailyScheduleImpl implements _DailySchedule { @JsonKey(name: "portion") required this.portion, @JsonKey(name: "quantity") required this.quantity}); - factory _$DailyScheduleImpl.fromJson(Map json) => - _$$DailyScheduleImplFromJson(json); + factory _$DailyScheduleImpl.fromJson(Map json) => _$$DailyScheduleImplFromJson(json); @override @JsonKey(name: "name") @@ -1061,8 +1033,7 @@ class _$DailyScheduleImpl implements _DailySchedule { (identical(other.name, name) || other.name == name) && (identical(other.uniq, uniq) || other.uniq == uniq) && (identical(other.portion, portion) || other.portion == portion) && - (identical(other.quantity, quantity) || - other.quantity == quantity)); + (identical(other.quantity, quantity) || other.quantity == quantity)); } @JsonKey(ignore: true) @@ -1072,8 +1043,7 @@ class _$DailyScheduleImpl implements _DailySchedule { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => - __$$DailyScheduleImplCopyWithImpl<_$DailyScheduleImpl>(this, _$identity); + _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => __$$DailyScheduleImplCopyWithImpl<_$DailyScheduleImpl>(this, _$identity); @override Map toJson() { @@ -1085,31 +1055,32 @@ class _$DailyScheduleImpl implements _DailySchedule { abstract class _DailySchedule implements DailySchedule { const factory _DailySchedule( - {@JsonKey(name: "name") required final String name, - @JsonKey(name: "uniq") required final String uniq, - @JsonKey(name: "portion") required final Portion portion, - @JsonKey(name: "quantity") required final int quantity}) = - _$DailyScheduleImpl; + {@JsonKey(name: "name") required final String name, + @JsonKey(name: "uniq") required final String uniq, + @JsonKey(name: "portion") required final Portion portion, + @JsonKey(name: "quantity") required final int quantity}) = _$DailyScheduleImpl; - factory _DailySchedule.fromJson(Map json) = - _$DailyScheduleImpl.fromJson; + factory _DailySchedule.fromJson(Map json) = _$DailyScheduleImpl.fromJson; @override @JsonKey(name: "name") String get name; + @override @JsonKey(name: "uniq") String get uniq; + @override @JsonKey(name: "portion") Portion get portion; + @override @JsonKey(name: "quantity") int get quantity; + @override @JsonKey(ignore: true) - _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => throw _privateConstructorUsedError; } Type _$TypeFromJson(Map json) { @@ -1120,37 +1091,37 @@ Type _$TypeFromJson(Map json) { mixin _$Type { @JsonKey(name: "alko") bool? get alko => throw _privateConstructorUsedError; + @JsonKey(name: "veg") bool? get veg => throw _privateConstructorUsedError; + @JsonKey(name: "corb") bool? get corb => throw _privateConstructorUsedError; + @JsonKey(name: "meat") bool? get meat => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $TypeCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $TypeCopyWith<$Res> { - factory $TypeCopyWith(Type value, $Res Function(Type) then) = - _$TypeCopyWithImpl<$Res, Type>; + factory $TypeCopyWith(Type value, $Res Function(Type) then) = _$TypeCopyWithImpl<$Res, Type>; + @useResult - $Res call( - {@JsonKey(name: "alko") bool? alko, - @JsonKey(name: "veg") bool? veg, - @JsonKey(name: "corb") bool? corb, - @JsonKey(name: "meat") bool? meat}); + $Res call({@JsonKey(name: "alko") bool? alko, @JsonKey(name: "veg") bool? veg, @JsonKey(name: "corb") bool? corb, @JsonKey(name: "meat") bool? meat}); } /// @nodoc -class _$TypeCopyWithImpl<$Res, $Val extends Type> - implements $TypeCopyWith<$Res> { +class _$TypeCopyWithImpl<$Res, $Val extends Type> implements $TypeCopyWith<$Res> { _$TypeCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -1185,24 +1156,16 @@ class _$TypeCopyWithImpl<$Res, $Val extends Type> /// @nodoc abstract class _$$TypeImplCopyWith<$Res> implements $TypeCopyWith<$Res> { - factory _$$TypeImplCopyWith( - _$TypeImpl value, $Res Function(_$TypeImpl) then) = - __$$TypeImplCopyWithImpl<$Res>; + factory _$$TypeImplCopyWith(_$TypeImpl value, $Res Function(_$TypeImpl) then) = __$$TypeImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "alko") bool? alko, - @JsonKey(name: "veg") bool? veg, - @JsonKey(name: "corb") bool? corb, - @JsonKey(name: "meat") bool? meat}); + $Res call({@JsonKey(name: "alko") bool? alko, @JsonKey(name: "veg") bool? veg, @JsonKey(name: "corb") bool? corb, @JsonKey(name: "meat") bool? meat}); } /// @nodoc -class __$$TypeImplCopyWithImpl<$Res> - extends _$TypeCopyWithImpl<$Res, _$TypeImpl> - implements _$$TypeImplCopyWith<$Res> { - __$$TypeImplCopyWithImpl(_$TypeImpl _value, $Res Function(_$TypeImpl) _then) - : super(_value, _then); +class __$$TypeImplCopyWithImpl<$Res> extends _$TypeCopyWithImpl<$Res, _$TypeImpl> implements _$$TypeImplCopyWith<$Res> { + __$$TypeImplCopyWithImpl(_$TypeImpl _value, $Res Function(_$TypeImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -1236,14 +1199,9 @@ class __$$TypeImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$TypeImpl implements _Type { - const _$TypeImpl( - {@JsonKey(name: "alko") this.alko, - @JsonKey(name: "veg") this.veg, - @JsonKey(name: "corb") this.corb, - @JsonKey(name: "meat") this.meat}); + const _$TypeImpl({@JsonKey(name: "alko") this.alko, @JsonKey(name: "veg") this.veg, @JsonKey(name: "corb") this.corb, @JsonKey(name: "meat") this.meat}); - factory _$TypeImpl.fromJson(Map json) => - _$$TypeImplFromJson(json); + factory _$TypeImpl.fromJson(Map json) => _$$TypeImplFromJson(json); @override @JsonKey(name: "alko") @@ -1281,8 +1239,7 @@ class _$TypeImpl implements _Type { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$TypeImplCopyWith<_$TypeImpl> get copyWith => - __$$TypeImplCopyWithImpl<_$TypeImpl>(this, _$identity); + _$$TypeImplCopyWith<_$TypeImpl> get copyWith => __$$TypeImplCopyWithImpl<_$TypeImpl>(this, _$identity); @override Map toJson() { @@ -1304,19 +1261,22 @@ abstract class _Type implements Type { @override @JsonKey(name: "alko") bool? get alko; + @override @JsonKey(name: "veg") bool? get veg; + @override @JsonKey(name: "corb") bool? get corb; + @override @JsonKey(name: "meat") bool? get meat; + @override @JsonKey(ignore: true) - _$$TypeImplCopyWith<_$TypeImpl> get copyWith => - throw _privateConstructorUsedError; + _$$TypeImplCopyWith<_$TypeImpl> get copyWith => throw _privateConstructorUsedError; } Links _$LinksFromJson(Map json) { @@ -1327,37 +1287,38 @@ Links _$LinksFromJson(Map json) { mixin _$Links { @JsonKey(name: "first") String get first => throw _privateConstructorUsedError; + @JsonKey(name: "last") String get last => throw _privateConstructorUsedError; + @JsonKey(name: "prev") dynamic get prev => throw _privateConstructorUsedError; + @JsonKey(name: "next") dynamic get next => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $LinksCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $LinksCopyWith<$Res> { - factory $LinksCopyWith(Links value, $Res Function(Links) then) = - _$LinksCopyWithImpl<$Res, Links>; + factory $LinksCopyWith(Links value, $Res Function(Links) then) = _$LinksCopyWithImpl<$Res, Links>; + @useResult $Res call( - {@JsonKey(name: "first") String first, - @JsonKey(name: "last") String last, - @JsonKey(name: "prev") dynamic prev, - @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); } /// @nodoc -class _$LinksCopyWithImpl<$Res, $Val extends Links> - implements $LinksCopyWith<$Res> { +class _$LinksCopyWithImpl<$Res, $Val extends Links> implements $LinksCopyWith<$Res> { _$LinksCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -1392,25 +1353,17 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links> /// @nodoc abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$Res> { - factory _$$LinksImplCopyWith( - _$LinksImpl value, $Res Function(_$LinksImpl) then) = - __$$LinksImplCopyWithImpl<$Res>; + factory _$$LinksImplCopyWith(_$LinksImpl value, $Res Function(_$LinksImpl) then) = __$$LinksImplCopyWithImpl<$Res>; + @override @useResult $Res call( - {@JsonKey(name: "first") String first, - @JsonKey(name: "last") String last, - @JsonKey(name: "prev") dynamic prev, - @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); } /// @nodoc -class __$$LinksImplCopyWithImpl<$Res> - extends _$LinksCopyWithImpl<$Res, _$LinksImpl> - implements _$$LinksImplCopyWith<$Res> { - __$$LinksImplCopyWithImpl( - _$LinksImpl _value, $Res Function(_$LinksImpl) _then) - : super(_value, _then); +class __$$LinksImplCopyWithImpl<$Res> extends _$LinksCopyWithImpl<$Res, _$LinksImpl> implements _$$LinksImplCopyWith<$Res> { + __$$LinksImplCopyWithImpl(_$LinksImpl _value, $Res Function(_$LinksImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -1450,8 +1403,7 @@ class _$LinksImpl implements _Links { @JsonKey(name: "prev") required this.prev, @JsonKey(name: "next") required this.next}); - factory _$LinksImpl.fromJson(Map json) => - _$$LinksImplFromJson(json); + factory _$LinksImpl.fromJson(Map json) => _$$LinksImplFromJson(json); @override @JsonKey(name: "first") @@ -1484,18 +1436,12 @@ class _$LinksImpl implements _Links { @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - first, - last, - const DeepCollectionEquality().hash(prev), - const DeepCollectionEquality().hash(next)); + int get hashCode => Object.hash(runtimeType, first, last, const DeepCollectionEquality().hash(prev), const DeepCollectionEquality().hash(next)); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => - __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); @override Map toJson() { @@ -1517,19 +1463,22 @@ abstract class _Links implements Links { @override @JsonKey(name: "first") String get first; + @override @JsonKey(name: "last") String get last; + @override @JsonKey(name: "prev") dynamic get prev; + @override @JsonKey(name: "next") dynamic get next; + @override @JsonKey(ignore: true) - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => throw _privateConstructorUsedError; } Meta _$MetaFromJson(Map json) { @@ -1540,30 +1489,38 @@ Meta _$MetaFromJson(Map json) { mixin _$Meta { @JsonKey(name: "current_page") int get currentPage => throw _privateConstructorUsedError; + @JsonKey(name: "from") int get from => throw _privateConstructorUsedError; + @JsonKey(name: "last_page") int get lastPage => throw _privateConstructorUsedError; + @JsonKey(name: "links") List get links => throw _privateConstructorUsedError; + @JsonKey(name: "path") String get path => throw _privateConstructorUsedError; + @JsonKey(name: "per_page") int get perPage => throw _privateConstructorUsedError; + @JsonKey(name: "to") int get to => throw _privateConstructorUsedError; + @JsonKey(name: "total") int get total => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $MetaCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $MetaCopyWith<$Res> { - factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = - _$MetaCopyWithImpl<$Res, Meta>; + factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = _$MetaCopyWithImpl<$Res, Meta>; + @useResult $Res call( {@JsonKey(name: "current_page") int currentPage, @@ -1577,12 +1534,12 @@ abstract class $MetaCopyWith<$Res> { } /// @nodoc -class _$MetaCopyWithImpl<$Res, $Val extends Meta> - implements $MetaCopyWith<$Res> { +class _$MetaCopyWithImpl<$Res, $Val extends Meta> implements $MetaCopyWith<$Res> { _$MetaCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -1637,9 +1594,8 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> /// @nodoc abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { - factory _$$MetaImplCopyWith( - _$MetaImpl value, $Res Function(_$MetaImpl) then) = - __$$MetaImplCopyWithImpl<$Res>; + factory _$$MetaImplCopyWith(_$MetaImpl value, $Res Function(_$MetaImpl) then) = __$$MetaImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -1654,11 +1610,8 @@ abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { } /// @nodoc -class __$$MetaImplCopyWithImpl<$Res> - extends _$MetaCopyWithImpl<$Res, _$MetaImpl> - implements _$$MetaImplCopyWith<$Res> { - __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) - : super(_value, _then); +class __$$MetaImplCopyWithImpl<$Res> extends _$MetaCopyWithImpl<$Res, _$MetaImpl> implements _$$MetaImplCopyWith<$Res> { + __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -1723,8 +1676,7 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "total") required this.total}) : _links = links; - factory _$MetaImpl.fromJson(Map json) => - _$$MetaImplFromJson(json); + factory _$MetaImpl.fromJson(Map json) => _$$MetaImplFromJson(json); @override @JsonKey(name: "current_page") @@ -1736,6 +1688,7 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "last_page") final int lastPage; final List _links; + @override @JsonKey(name: "links") List get links { @@ -1767,11 +1720,9 @@ class _$MetaImpl implements _Meta { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MetaImpl && - (identical(other.currentPage, currentPage) || - other.currentPage == currentPage) && + (identical(other.currentPage, currentPage) || other.currentPage == currentPage) && (identical(other.from, from) || other.from == from) && - (identical(other.lastPage, lastPage) || - other.lastPage == lastPage) && + (identical(other.lastPage, lastPage) || other.lastPage == lastPage) && const DeepCollectionEquality().equals(other._links, _links) && (identical(other.path, path) || other.path == path) && (identical(other.perPage, perPage) || other.perPage == perPage) && @@ -1781,14 +1732,12 @@ class _$MetaImpl implements _Meta { @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, currentPage, from, lastPage, - const DeepCollectionEquality().hash(_links), path, perPage, to, total); + int get hashCode => Object.hash(runtimeType, currentPage, from, lastPage, const DeepCollectionEquality().hash(_links), path, perPage, to, total); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => - __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); @override Map toJson() { @@ -1814,31 +1763,38 @@ abstract class _Meta implements Meta { @override @JsonKey(name: "current_page") int get currentPage; + @override @JsonKey(name: "from") int get from; + @override @JsonKey(name: "last_page") int get lastPage; + @override @JsonKey(name: "links") List get links; + @override @JsonKey(name: "path") String get path; + @override @JsonKey(name: "per_page") int get perPage; + @override @JsonKey(name: "to") int get to; + @override @JsonKey(name: "total") int get total; + @override @JsonKey(ignore: true) - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => - throw _privateConstructorUsedError; + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => throw _privateConstructorUsedError; } Link _$LinkFromJson(Map json) { @@ -1849,34 +1805,34 @@ Link _$LinkFromJson(Map json) { mixin _$Link { @JsonKey(name: "url") String? get url => throw _privateConstructorUsedError; + @JsonKey(name: "label") String get label => throw _privateConstructorUsedError; + @JsonKey(name: "active") bool get active => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) $LinkCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $LinkCopyWith<$Res> { - factory $LinkCopyWith(Link value, $Res Function(Link) then) = - _$LinkCopyWithImpl<$Res, Link>; + factory $LinkCopyWith(Link value, $Res Function(Link) then) = _$LinkCopyWithImpl<$Res, Link>; + @useResult - $Res call( - {@JsonKey(name: "url") String? url, - @JsonKey(name: "label") String label, - @JsonKey(name: "active") bool active}); + $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String label, @JsonKey(name: "active") bool active}); } /// @nodoc -class _$LinkCopyWithImpl<$Res, $Val extends Link> - implements $LinkCopyWith<$Res> { +class _$LinkCopyWithImpl<$Res, $Val extends Link> implements $LinkCopyWith<$Res> { _$LinkCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -1906,23 +1862,16 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link> /// @nodoc abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> { - factory _$$LinkImplCopyWith( - _$LinkImpl value, $Res Function(_$LinkImpl) then) = - __$$LinkImplCopyWithImpl<$Res>; + factory _$$LinkImplCopyWith(_$LinkImpl value, $Res Function(_$LinkImpl) then) = __$$LinkImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "url") String? url, - @JsonKey(name: "label") String label, - @JsonKey(name: "active") bool active}); + $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String label, @JsonKey(name: "active") bool active}); } /// @nodoc -class __$$LinkImplCopyWithImpl<$Res> - extends _$LinkCopyWithImpl<$Res, _$LinkImpl> - implements _$$LinkImplCopyWith<$Res> { - __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) - : super(_value, _then); +class __$$LinkImplCopyWithImpl<$Res> extends _$LinkCopyWithImpl<$Res, _$LinkImpl> implements _$$LinkImplCopyWith<$Res> { + __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -1951,13 +1900,9 @@ class __$$LinkImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$LinkImpl implements _Link { - const _$LinkImpl( - {@JsonKey(name: "url") required this.url, - @JsonKey(name: "label") required this.label, - @JsonKey(name: "active") required this.active}); + const _$LinkImpl({@JsonKey(name: "url") required this.url, @JsonKey(name: "label") required this.label, @JsonKey(name: "active") required this.active}); - factory _$LinkImpl.fromJson(Map json) => - _$$LinkImplFromJson(json); + factory _$LinkImpl.fromJson(Map json) => _$$LinkImplFromJson(json); @override @JsonKey(name: "url") @@ -1991,8 +1936,7 @@ class _$LinkImpl implements _Link { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => - __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); @override Map toJson() { @@ -2013,14 +1957,16 @@ abstract class _Link implements Link { @override @JsonKey(name: "url") String? get url; + @override @JsonKey(name: "label") String get label; + @override @JsonKey(name: "active") bool get active; + @override @JsonKey(ignore: true) - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/diets_pagination_model.g.dart b/lib/features/feed/models/diets_pagination_model.g.dart index 0a745095..ac11372f 100644 --- a/lib/features/feed/models/diets_pagination_model.g.dart +++ b/lib/features/feed/models/diets_pagination_model.g.dart @@ -6,19 +6,13 @@ part of 'diets_pagination_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$DietsPaginationImpl _$$DietsPaginationImplFromJson( - Map json) => - _$DietsPaginationImpl( - data: (json['data'] as List) - .map((e) => Datum.fromJson(e as Map)) - .toList(), +_$DietsPaginationImpl _$$DietsPaginationImplFromJson(Map json) => _$DietsPaginationImpl( + data: (json['data'] as List).map((e) => Datum.fromJson(e as Map)).toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$DietsPaginationImplToJson( - _$DietsPaginationImpl instance) => - { +Map _$$DietsPaginationImplToJson(_$DietsPaginationImpl instance) => { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, @@ -33,11 +27,7 @@ _$DatumImpl _$$DatumImplFromJson(Map json) => _$DatumImpl( type: Type.fromJson(json['type'] as Map), details: json['details'] as String, dailySchedule: (json['daily_schedule'] as List) - .map((e) => (e as List) - .map((e) => (e as List) - .map((e) => DailySchedule.fromJson(e as Map)) - .toList()) - .toList()) + .map((e) => (e as List).map((e) => (e as List).map((e) => DailySchedule.fromJson(e as Map)).toList()).toList()) .toList(), author: Author.fromJson(json['author'] as Map), totalLikes: (json['total_likes'] as num).toInt(), @@ -45,8 +35,7 @@ _$DatumImpl _$$DatumImplFromJson(Map json) => _$DatumImpl( totalComments: (json['total_comments'] as num).toInt(), ); -Map _$$DatumImplToJson(_$DatumImpl instance) => - { +Map _$$DatumImplToJson(_$DatumImpl instance) => { 'id': instance.id, 'name': instance.name, 'image': instance.image, @@ -68,24 +57,21 @@ _$AuthorImpl _$$AuthorImplFromJson(Map json) => _$AuthorImpl( authorIsMe: json['author_is_me'] as bool, ); -Map _$$AuthorImplToJson(_$AuthorImpl instance) => - { +Map _$$AuthorImplToJson(_$AuthorImpl instance) => { 'author_slug': instance.authorSlug, 'author_name': instance.authorName, 'author_profile_icon': instance.authorProfileIcon, 'author_is_me': instance.authorIsMe, }; -_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map json) => - _$DailyScheduleImpl( +_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map json) => _$DailyScheduleImpl( name: json['name'] as String, uniq: json['uniq'] as String, portion: $enumDecode(_$PortionEnumMap, json['portion']), quantity: (json['quantity'] as num).toInt(), ); -Map _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) => - { +Map _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) => { 'name': instance.name, 'uniq': instance.uniq, 'portion': _$PortionEnumMap[instance.portion]!, @@ -105,8 +91,7 @@ _$TypeImpl _$$TypeImplFromJson(Map json) => _$TypeImpl( meat: json['meat'] as bool?, ); -Map _$$TypeImplToJson(_$TypeImpl instance) => - { +Map _$$TypeImplToJson(_$TypeImpl instance) => { 'alko': instance.alko, 'veg': instance.veg, 'corb': instance.corb, @@ -120,8 +105,7 @@ _$LinksImpl _$$LinksImplFromJson(Map json) => _$LinksImpl( next: json['next'], ); -Map _$$LinksImplToJson(_$LinksImpl instance) => - { +Map _$$LinksImplToJson(_$LinksImpl instance) => { 'first': instance.first, 'last': instance.last, 'prev': instance.prev, @@ -132,17 +116,14 @@ _$MetaImpl _$$MetaImplFromJson(Map json) => _$MetaImpl( currentPage: (json['current_page'] as num).toInt(), from: (json['from'] as num).toInt(), lastPage: (json['last_page'] as num).toInt(), - links: (json['links'] as List) - .map((e) => Link.fromJson(e as Map)) - .toList(), + links: (json['links'] as List).map((e) => Link.fromJson(e as Map)).toList(), path: json['path'] as String, perPage: (json['per_page'] as num).toInt(), to: (json['to'] as num).toInt(), total: (json['total'] as num).toInt(), ); -Map _$$MetaImplToJson(_$MetaImpl instance) => - { +Map _$$MetaImplToJson(_$MetaImpl instance) => { 'current_page': instance.currentPage, 'from': instance.from, 'last_page': instance.lastPage, @@ -159,8 +140,7 @@ _$LinkImpl _$$LinkImplFromJson(Map json) => _$LinkImpl( active: json['active'] as bool, ); -Map _$$LinkImplToJson(_$LinkImpl instance) => - { +Map _$$LinkImplToJson(_$LinkImpl instance) => { 'url': instance.url, 'label': instance.label, 'active': instance.active, diff --git a/lib/features/feed/models/feed_blog_post_model.dart b/lib/features/feed/models/feed_blog_post_model.dart index b77fb3f0..60dcb02a 100644 --- a/lib/features/feed/models/feed_blog_post_model.dart +++ b/lib/features/feed/models/feed_blog_post_model.dart @@ -1,3 +1,4 @@ +import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'feed_blog_post_model.freezed.dart'; @@ -10,6 +11,7 @@ class FeedBlogPostModel with _$FeedBlogPostModel { required String state, required String image, required String description, + required Author author, @JsonKey(name: "youtube_url") required String youtubeUrl, @JsonKey(name: "created_at") required DateTime createdAt, @JsonKey(name: "updated_at") required DateTime updatedAt, 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..6f70f668 100644 --- a/lib/features/feed/models/feed_blog_post_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_model.freezed.dart @@ -24,6 +24,7 @@ mixin _$FeedBlogPostModel { String get state => throw _privateConstructorUsedError; String get image => throw _privateConstructorUsedError; String get description => throw _privateConstructorUsedError; + Author get author => throw _privateConstructorUsedError; @JsonKey(name: "youtube_url") String get youtubeUrl => throw _privateConstructorUsedError; @JsonKey(name: "created_at") @@ -49,10 +50,13 @@ abstract class $FeedBlogPostModelCopyWith<$Res> { String state, String image, String description, + Author author, @JsonKey(name: "youtube_url") String youtubeUrl, @JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "updated_at") DateTime updatedAt, String title}); + + $AuthorCopyWith<$Res> get author; } /// @nodoc @@ -72,6 +76,7 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> Object? state = null, Object? image = null, Object? description = null, + Object? author = null, Object? youtubeUrl = null, Object? createdAt = null, Object? updatedAt = null, @@ -94,6 +99,10 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> ? _value.description : description // ignore: cast_nullable_to_non_nullable as String, + author: null == author + ? _value.author + : author // ignore: cast_nullable_to_non_nullable + as Author, youtubeUrl: null == youtubeUrl ? _value.youtubeUrl : youtubeUrl // ignore: cast_nullable_to_non_nullable @@ -112,6 +121,14 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> as String, ) as $Val); } + + @override + @pragma('vm:prefer-inline') + $AuthorCopyWith<$Res> get author { + return $AuthorCopyWith<$Res>(_value.author, (value) { + return _then(_value.copyWith(author: value) as $Val); + }); + } } /// @nodoc @@ -127,10 +144,14 @@ abstract class _$$FeedBlogPostModelImplCopyWith<$Res> String state, String image, String description, + Author author, @JsonKey(name: "youtube_url") String youtubeUrl, @JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "updated_at") DateTime updatedAt, String title}); + + @override + $AuthorCopyWith<$Res> get author; } /// @nodoc @@ -148,6 +169,7 @@ class __$$FeedBlogPostModelImplCopyWithImpl<$Res> Object? state = null, Object? image = null, Object? description = null, + Object? author = null, Object? youtubeUrl = null, Object? createdAt = null, Object? updatedAt = null, @@ -170,6 +192,10 @@ class __$$FeedBlogPostModelImplCopyWithImpl<$Res> ? _value.description : description // ignore: cast_nullable_to_non_nullable as String, + author: null == author + ? _value.author + : author // ignore: cast_nullable_to_non_nullable + as Author, youtubeUrl: null == youtubeUrl ? _value.youtubeUrl : youtubeUrl // ignore: cast_nullable_to_non_nullable @@ -198,6 +224,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { required this.state, required this.image, required this.description, + required this.author, @JsonKey(name: "youtube_url") required this.youtubeUrl, @JsonKey(name: "created_at") required this.createdAt, @JsonKey(name: "updated_at") required this.updatedAt, @@ -215,6 +242,8 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { @override final String description; @override + final Author author; + @override @JsonKey(name: "youtube_url") final String youtubeUrl; @override @@ -228,7 +257,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { @override String toString() { - return 'FeedBlogPostModel(id: $id, state: $state, image: $image, description: $description, youtubeUrl: $youtubeUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title)'; + return 'FeedBlogPostModel(id: $id, state: $state, image: $image, description: $description, author: $author, youtubeUrl: $youtubeUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title)'; } @override @@ -241,6 +270,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { (identical(other.image, image) || other.image == image) && (identical(other.description, description) || other.description == description) && + (identical(other.author, author) || other.author == author) && (identical(other.youtubeUrl, youtubeUrl) || other.youtubeUrl == youtubeUrl) && (identical(other.createdAt, createdAt) || @@ -253,7 +283,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, id, state, image, description, - youtubeUrl, createdAt, updatedAt, title); + author, youtubeUrl, createdAt, updatedAt, title); @JsonKey(ignore: true) @override @@ -276,6 +306,7 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel { required final String state, required final String image, required final String description, + required final Author author, @JsonKey(name: "youtube_url") required final String youtubeUrl, @JsonKey(name: "created_at") required final DateTime createdAt, @JsonKey(name: "updated_at") required final DateTime updatedAt, @@ -293,6 +324,8 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel { @override String get description; @override + Author get author; + @override @JsonKey(name: "youtube_url") String get youtubeUrl; @override 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..07c55ef4 100644 --- a/lib/features/feed/models/feed_blog_post_model.g.dart +++ b/lib/features/feed/models/feed_blog_post_model.g.dart @@ -13,6 +13,7 @@ _$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson( state: json['state'] as String, image: json['image'] as String, description: json['description'] as String, + author: Author.fromJson(json['author'] as Map), youtubeUrl: json['youtube_url'] as String, createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), @@ -26,6 +27,7 @@ Map _$$FeedBlogPostModelImplToJson( 'state': instance.state, 'image': instance.image, 'description': instance.description, + 'author': instance.author, 'youtube_url': instance.youtubeUrl, 'created_at': instance.createdAt.toIso8601String(), 'updated_at': instance.updatedAt.toIso8601String(), 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 a74f2d68..8296a8be 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.dart @@ -2,7 +2,6 @@ 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/recipes_model.dart b/lib/features/feed/models/recipes_model.dart index 1bc93d32..ad61afd1 100644 --- a/lib/features/feed/models/recipes_model.dart +++ b/lib/features/feed/models/recipes_model.dart @@ -1,3 +1,4 @@ +import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'recipes_model.freezed.dart'; @@ -22,6 +23,7 @@ class Recipes with _$Recipes { @JsonKey(name: 'total_comments') required int commentsCount, @JsonKey(name: 'total_likes') required int likesCount, @JsonKey(name: 'total_views') required int viewsCount, + required Author author, }) = _Recipes; factory Recipes.fromJson(Map json) => _$RecipesFromJson(json); diff --git a/lib/features/feed/models/recipes_model.freezed.dart b/lib/features/feed/models/recipes_model.freezed.dart index 9843651e..26cd55e3 100644 --- a/lib/features/feed/models/recipes_model.freezed.dart +++ b/lib/features/feed/models/recipes_model.freezed.dart @@ -43,6 +43,7 @@ mixin _$Recipes { int get likesCount => throw _privateConstructorUsedError; @JsonKey(name: 'total_views') int get viewsCount => throw _privateConstructorUsedError; + Author get author => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -70,7 +71,10 @@ abstract class $RecipesCopyWith<$Res> { String slug, @JsonKey(name: 'total_comments') int commentsCount, @JsonKey(name: 'total_likes') int likesCount, - @JsonKey(name: 'total_views') int viewsCount}); + @JsonKey(name: 'total_views') int viewsCount, + Author author}); + + $AuthorCopyWith<$Res> get author; } /// @nodoc @@ -102,6 +106,7 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> Object? commentsCount = null, Object? likesCount = null, Object? viewsCount = null, + Object? author = null, }) { return _then(_value.copyWith( id: null == id @@ -168,8 +173,20 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> ? _value.viewsCount : viewsCount // ignore: cast_nullable_to_non_nullable as int, + author: null == author + ? _value.author + : author // ignore: cast_nullable_to_non_nullable + as Author, ) as $Val); } + + @override + @pragma('vm:prefer-inline') + $AuthorCopyWith<$Res> get author { + return $AuthorCopyWith<$Res>(_value.author, (value) { + return _then(_value.copyWith(author: value) as $Val); + }); + } } /// @nodoc @@ -195,7 +212,11 @@ abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> { String slug, @JsonKey(name: 'total_comments') int commentsCount, @JsonKey(name: 'total_likes') int likesCount, - @JsonKey(name: 'total_views') int viewsCount}); + @JsonKey(name: 'total_views') int viewsCount, + Author author}); + + @override + $AuthorCopyWith<$Res> get author; } /// @nodoc @@ -225,6 +246,7 @@ class __$$RecipesImplCopyWithImpl<$Res> Object? commentsCount = null, Object? likesCount = null, Object? viewsCount = null, + Object? author = null, }) { return _then(_$RecipesImpl( id: null == id @@ -291,6 +313,10 @@ class __$$RecipesImplCopyWithImpl<$Res> ? _value.viewsCount : viewsCount // ignore: cast_nullable_to_non_nullable as int, + author: null == author + ? _value.author + : author // ignore: cast_nullable_to_non_nullable + as Author, )); } } @@ -314,7 +340,8 @@ class _$RecipesImpl implements _Recipes { required this.slug, @JsonKey(name: 'total_comments') required this.commentsCount, @JsonKey(name: 'total_likes') required this.likesCount, - @JsonKey(name: 'total_views') required this.viewsCount}) + @JsonKey(name: 'total_views') required this.viewsCount, + required this.author}) : _ingredients = ingredients, _steps = steps; @@ -372,10 +399,12 @@ class _$RecipesImpl implements _Recipes { @override @JsonKey(name: 'total_views') final int viewsCount; + @override + final Author author; @override String toString() { - return 'Recipes(id: $id, image: $image, state: $state, cookingTime: $cookingTime, ingredients: $ingredients, description: $description, steps: $steps, videoUrl: $videoUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, type: $type, slug: $slug, commentsCount: $commentsCount, likesCount: $likesCount, viewsCount: $viewsCount)'; + return 'Recipes(id: $id, image: $image, state: $state, cookingTime: $cookingTime, ingredients: $ingredients, description: $description, steps: $steps, videoUrl: $videoUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, type: $type, slug: $slug, commentsCount: $commentsCount, likesCount: $likesCount, viewsCount: $viewsCount, author: $author)'; } @override @@ -407,7 +436,8 @@ class _$RecipesImpl implements _Recipes { (identical(other.likesCount, likesCount) || other.likesCount == likesCount) && (identical(other.viewsCount, viewsCount) || - other.viewsCount == viewsCount)); + other.viewsCount == viewsCount) && + (identical(other.author, author) || other.author == author)); } @JsonKey(ignore: true) @@ -429,7 +459,8 @@ class _$RecipesImpl implements _Recipes { slug, commentsCount, likesCount, - viewsCount); + viewsCount, + author); @JsonKey(ignore: true) @override @@ -447,23 +478,23 @@ 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: 'total_comments') required final int commentsCount, - @JsonKey(name: 'total_likes') required final int likesCount, - @JsonKey(name: 'total_views') required final int viewsCount}) = - _$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: 'total_comments') required final int commentsCount, + @JsonKey(name: 'total_likes') required final int likesCount, + @JsonKey(name: 'total_views') required final int viewsCount, + required final Author author}) = _$RecipesImpl; factory _Recipes.fromJson(Map json) = _$RecipesImpl.fromJson; @@ -507,6 +538,8 @@ abstract class _Recipes implements Recipes { @JsonKey(name: 'total_views') int get viewsCount; @override + Author get author; + @override @JsonKey(ignore: true) _$$RecipesImplCopyWith<_$RecipesImpl> 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 edb4ed6a..7f8c0142 100644 --- a/lib/features/feed/models/recipes_model.g.dart +++ b/lib/features/feed/models/recipes_model.g.dart @@ -28,6 +28,7 @@ _$RecipesImpl _$$RecipesImplFromJson(Map json) => commentsCount: (json['total_comments'] as num).toInt(), likesCount: (json['total_likes'] as num).toInt(), viewsCount: (json['total_views'] as num).toInt(), + author: Author.fromJson(json['author'] as Map), ); Map _$$RecipesImplToJson(_$RecipesImpl instance) => @@ -48,6 +49,7 @@ Map _$$RecipesImplToJson(_$RecipesImpl instance) => 'total_comments': instance.commentsCount, 'total_likes': instance.likesCount, 'total_views': instance.viewsCount, + 'author': instance.author, }; _$IngredientImpl _$$IngredientImplFromJson(Map json) => diff --git a/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart b/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart index adff30f5..84dc0117 100644 --- a/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$DietsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,36 +71,28 @@ mixin _$DietsState { /// @nodoc abstract class $DietsStateCopyWith<$Res> { - factory $DietsStateCopyWith( - DietsState value, $Res Function(DietsState) then) = - _$DietsStateCopyWithImpl<$Res, DietsState>; + factory $DietsStateCopyWith(DietsState value, $Res Function(DietsState) then) = _$DietsStateCopyWithImpl<$Res, DietsState>; } /// @nodoc -class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> - implements $DietsStateCopyWith<$Res> { +class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> implements $DietsStateCopyWith<$Res> { _$DietsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; } /// @nodoc abstract class _$$DietsStateImplCopyWith<$Res> { - factory _$$DietsStateImplCopyWith( - _$DietsStateImpl value, $Res Function(_$DietsStateImpl) then) = - __$$DietsStateImplCopyWithImpl<$Res>; + factory _$$DietsStateImplCopyWith(_$DietsStateImpl value, $Res Function(_$DietsStateImpl) then) = __$$DietsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$DietsStateImplCopyWithImpl<$Res> - extends _$DietsStateCopyWithImpl<$Res, _$DietsStateImpl> - implements _$$DietsStateImplCopyWith<$Res> { - __$$DietsStateImplCopyWithImpl( - _$DietsStateImpl _value, $Res Function(_$DietsStateImpl) _then) - : super(_value, _then); +class __$$DietsStateImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateImpl> implements _$$DietsStateImplCopyWith<$Res> { + __$$DietsStateImplCopyWithImpl(_$DietsStateImpl _value, $Res Function(_$DietsStateImpl) _then) : super(_value, _then); } /// @nodoc @@ -114,8 +107,7 @@ class _$DietsStateImpl implements _DietsState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$DietsStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateImpl); } @override @@ -202,18 +194,14 @@ abstract class _DietsState implements DietsState { /// @nodoc abstract class _$$DietsStateLoadingImplCopyWith<$Res> { - factory _$$DietsStateLoadingImplCopyWith(_$DietsStateLoadingImpl value, - $Res Function(_$DietsStateLoadingImpl) then) = + factory _$$DietsStateLoadingImplCopyWith(_$DietsStateLoadingImpl value, $Res Function(_$DietsStateLoadingImpl) then) = __$$DietsStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$DietsStateLoadingImplCopyWithImpl<$Res> - extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadingImpl> +class __$$DietsStateLoadingImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadingImpl> implements _$$DietsStateLoadingImplCopyWith<$Res> { - __$$DietsStateLoadingImplCopyWithImpl(_$DietsStateLoadingImpl _value, - $Res Function(_$DietsStateLoadingImpl) _then) - : super(_value, _then); + __$$DietsStateLoadingImplCopyWithImpl(_$DietsStateLoadingImpl _value, $Res Function(_$DietsStateLoadingImpl) _then) : super(_value, _then); } /// @nodoc @@ -228,8 +216,7 @@ class _$DietsStateLoadingImpl implements DietsStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$DietsStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateLoadingImpl); } @override @@ -316,9 +303,9 @@ abstract class DietsStateLoading implements DietsState { /// @nodoc abstract class _$$DietsStateLoadedImplCopyWith<$Res> { - factory _$$DietsStateLoadedImplCopyWith(_$DietsStateLoadedImpl value, - $Res Function(_$DietsStateLoadedImpl) then) = + factory _$$DietsStateLoadedImplCopyWith(_$DietsStateLoadedImpl value, $Res Function(_$DietsStateLoadedImpl) then) = __$$DietsStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({DietsPagination diets}); @@ -326,12 +313,9 @@ abstract class _$$DietsStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$DietsStateLoadedImplCopyWithImpl<$Res> - extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadedImpl> +class __$$DietsStateLoadedImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadedImpl> implements _$$DietsStateLoadedImplCopyWith<$Res> { - __$$DietsStateLoadedImplCopyWithImpl(_$DietsStateLoadedImpl _value, - $Res Function(_$DietsStateLoadedImpl) _then) - : super(_value, _then); + __$$DietsStateLoadedImplCopyWithImpl(_$DietsStateLoadedImpl _value, $Res Function(_$DietsStateLoadedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -371,9 +355,7 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$DietsStateLoadedImpl && - (identical(other.diets, diets) || other.diets == diets)); + (other.runtimeType == runtimeType && other is _$DietsStateLoadedImpl && (identical(other.diets, diets) || other.diets == diets)); } @override @@ -382,9 +364,7 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => - __$$DietsStateLoadedImplCopyWithImpl<_$DietsStateLoadedImpl>( - this, _$identity); + _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => __$$DietsStateLoadedImplCopyWithImpl<_$DietsStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -462,31 +442,25 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { } abstract class DietsStateLoaded implements DietsState { - const factory DietsStateLoaded({required final DietsPagination diets}) = - _$DietsStateLoadedImpl; + const factory DietsStateLoaded({required final DietsPagination diets}) = _$DietsStateLoadedImpl; DietsPagination get diets; + @JsonKey(ignore: true) - _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$DietsStateErrorImplCopyWith<$Res> { - factory _$$DietsStateErrorImplCopyWith(_$DietsStateErrorImpl value, - $Res Function(_$DietsStateErrorImpl) then) = - __$$DietsStateErrorImplCopyWithImpl<$Res>; + factory _$$DietsStateErrorImplCopyWith(_$DietsStateErrorImpl value, $Res Function(_$DietsStateErrorImpl) then) = __$$DietsStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$DietsStateErrorImplCopyWithImpl<$Res> - extends _$DietsStateCopyWithImpl<$Res, _$DietsStateErrorImpl> - implements _$$DietsStateErrorImplCopyWith<$Res> { - __$$DietsStateErrorImplCopyWithImpl( - _$DietsStateErrorImpl _value, $Res Function(_$DietsStateErrorImpl) _then) - : super(_value, _then); +class __$$DietsStateErrorImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateErrorImpl> implements _$$DietsStateErrorImplCopyWith<$Res> { + __$$DietsStateErrorImplCopyWithImpl(_$DietsStateErrorImpl _value, $Res Function(_$DietsStateErrorImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -520,8 +494,7 @@ class _$DietsStateErrorImpl implements DietsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -530,9 +503,7 @@ class _$DietsStateErrorImpl implements DietsStateError { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => - __$$DietsStateErrorImplCopyWithImpl<_$DietsStateErrorImpl>( - this, _$identity); + _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => __$$DietsStateErrorImplCopyWithImpl<_$DietsStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -610,11 +581,10 @@ class _$DietsStateErrorImpl implements DietsStateError { } abstract class DietsStateError implements DietsState { - const factory DietsStateError({required final String errorMessage}) = - _$DietsStateErrorImpl; + const factory DietsStateError({required final String errorMessage}) = _$DietsStateErrorImpl; String get errorMessage; + @JsonKey(ignore: true) - _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> 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..bb54c2ad 100644 --- a/lib/features/feed/presentation/widgets/blog_post_widget.dart +++ b/lib/features/feed/presentation/widgets/blog_post_widget.dart @@ -22,7 +22,7 @@ class _BlogPostWidgetState extends State { borderRadius: BorderRadius.circular(12), onTap: () => GoRouter.of(context).pushNamed( 'blogPostScreen', - extra: widget.feedBlogPostModel.id.toString(), + extra: widget.feedBlogPostModel, ), child: Ink( decoration: BoxDecoration( diff --git a/lib/features/feed/presentation/widgets/diets_widget.dart b/lib/features/feed/presentation/widgets/diets_widget.dart index 323c9e24..38f589cf 100644 --- a/lib/features/feed/presentation/widgets/diets_widget.dart +++ b/lib/features/feed/presentation/widgets/diets_widget.dart @@ -1,7 +1,5 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:dismissible_page/dismissible_page.dart'; 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/diets_pagination_model.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; @@ -34,22 +32,8 @@ class _DietsWidgetState extends State { children: [ ClipRRect( borderRadius: BorderRadius.vertical(top: Radius.circular(12)), - child: GestureDetector( - onTap: () { - context.pushTransparentRoute( - rootNavigator: true, - PhotoViewScreen( - imageUrls: [baseUrl + '/storage/' + widget.datum.image], - index: 0, - ), - ); - }, - child: Hero( - tag: baseUrl + '/storage/' + widget.datum.image, - child: CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + widget.datum.image, - ), - ), + child: CachedNetworkImage( + imageUrl: baseUrl + '/storage/' + widget.datum.image, ), ), Positioned( diff --git a/lib/features/feed/presentation/widgets/recipes_widget.dart b/lib/features/feed/presentation/widgets/recipes_widget.dart index 751612fa..c341c5a4 100644 --- a/lib/features/feed/presentation/widgets/recipes_widget.dart +++ b/lib/features/feed/presentation/widgets/recipes_widget.dart @@ -1,7 +1,5 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:dismissible_page/dismissible_page.dart'; 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'; @@ -34,22 +32,8 @@ class _RecipesWidgetState extends State { children: [ ClipRRect( borderRadius: BorderRadius.vertical(top: Radius.circular(12)), - child: GestureDetector( - onTap: () { - context.pushTransparentRoute( - rootNavigator: true, - PhotoViewScreen( - imageUrls: [baseUrl + '/storage/' + widget.recipes.image], - index: 0, - ), - ); - }, - child: Hero( - tag: baseUrl + '/storage/' + widget.recipes.image, - child: CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + widget.recipes.image, - ), - ), + child: CachedNetworkImage( + imageUrl: baseUrl + '/storage/' + widget.recipes.image, ), ), Positioned( diff --git a/lib/features/profile/models/profile_model.dart b/lib/features/profile/models/profile_model.dart new file mode 100644 index 00000000..8ecf3b4f --- /dev/null +++ b/lib/features/profile/models/profile_model.dart @@ -0,0 +1,82 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'profile_model.freezed.dart'; +part 'profile_model.g.dart'; + +@freezed +class Profile with _$Profile { + const factory Profile({ + @JsonKey(name: "user") required User user, + @JsonKey(name: "chartPoints") required List chartPoints, + @JsonKey(name: "userDetails") required UserDetails userDetails, + @JsonKey(name: "circumferences") required List circumferences, + @JsonKey(name: "finishedPlans") required List finishedPlans, + @JsonKey(name: "rejectedPlans") required List rejectedPlans, + @JsonKey(name: "startedPlan") required List startedPlan, + @JsonKey(name: "paidPlan") required List paidPlan, + @JsonKey(name: "requestedPlan") required List requestedPlan, + @JsonKey(name: "initedPlan") required List initedPlan, + }) = _Profile; + + factory Profile.fromJson(Map json) => _$ProfileFromJson(json); +} + +@freezed +class User with _$User { + const factory User({ + @JsonKey(name: "id") required int id, + @JsonKey(name: "name") required String name, + @JsonKey(name: "email") required String email, + @JsonKey(name: "email_verified_at") required DateTime emailVerifiedAt, + @JsonKey(name: "two_factor_confirmed_at") required dynamic twoFactorConfirmedAt, + @JsonKey(name: "current_team_id") required dynamic currentTeamId, + @JsonKey(name: "profile_photo_path") required String profilePhotoPath, + @JsonKey(name: "created_at") required DateTime createdAt, + @JsonKey(name: "updated_at") required DateTime updatedAt, + @JsonKey(name: "is_consultant") required int isConsultant, + @JsonKey(name: "is_public_profile") required int isPublicProfile, + @JsonKey(name: "slug") required String slug, + @JsonKey(name: "user_settings_id") required dynamic userSettingsId, + @JsonKey(name: "profile_photo_url") required String profilePhotoUrl, + @JsonKey(name: "detailz") required UserDetails detailz, + }) = _User; + + factory User.fromJson(Map json) => _$UserFromJson(json); +} + +@freezed +class UserDetails with _$UserDetails { + const factory UserDetails({ + @JsonKey(name: "id") required int id, + @JsonKey(name: "user_id") required int userId, + @JsonKey(name: "first_name") required String firstName, + @JsonKey(name: "last_name") required String lastName, + @JsonKey(name: "birthdate") required DateTime birthdate, + @JsonKey(name: "gender") required String gender, + @JsonKey(name: "country") required String country, + @JsonKey(name: "city") required String city, + @JsonKey(name: "lang") required String lang, + @JsonKey(name: "weight") required int weight, + @JsonKey(name: "height") required int height, + @JsonKey(name: "chest_circumference") required int chestCircumference, + @JsonKey(name: "waist_circumference") required int waistCircumference, + @JsonKey(name: "hip_circumference") required int hipCircumference, + @JsonKey(name: "blood_pressure_up") required int bloodPressureUp, + @JsonKey(name: "blood_pressure_down") required int bloodPressureDown, + @JsonKey(name: "has_hypo") required int hasHypo, + @JsonKey(name: "has_hyper") required int hasHyper, + @JsonKey(name: "about_alergy") required String aboutAlergy, + @JsonKey(name: "about_taking_pils") required String aboutTakingPils, + @JsonKey(name: "about_sport_hobbies") required String aboutSportHobbies, + @JsonKey(name: "favorite_foods") required String favoriteFoods, + @JsonKey(name: "unfavorite_foods") required String unfavoriteFoods, + @JsonKey(name: "additional_info") required String additionalInfo, + @JsonKey(name: "created_at") required DateTime createdAt, + @JsonKey(name: "updated_at") required DateTime updatedAt, + @JsonKey(name: "is_mood_fillable") required int isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") required int isBedtimeFillable, + @JsonKey(name: "activity_coefficient") required double activityCoefficient, + }) = _UserDetails; + + factory UserDetails.fromJson(Map json) => _$UserDetailsFromJson(json); +} diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart new file mode 100644 index 00000000..bd65ac7b --- /dev/null +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -0,0 +1,1817 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'profile_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +Profile _$ProfileFromJson(Map json) { + return _Profile.fromJson(json); +} + +/// @nodoc +mixin _$Profile { + @JsonKey(name: "user") + User get user => throw _privateConstructorUsedError; + @JsonKey(name: "chartPoints") + List get chartPoints => throw _privateConstructorUsedError; + @JsonKey(name: "userDetails") + UserDetails get userDetails => throw _privateConstructorUsedError; + @JsonKey(name: "circumferences") + List get circumferences => throw _privateConstructorUsedError; + @JsonKey(name: "finishedPlans") + List get finishedPlans => throw _privateConstructorUsedError; + @JsonKey(name: "rejectedPlans") + List get rejectedPlans => throw _privateConstructorUsedError; + @JsonKey(name: "startedPlan") + List get startedPlan => throw _privateConstructorUsedError; + @JsonKey(name: "paidPlan") + List get paidPlan => throw _privateConstructorUsedError; + @JsonKey(name: "requestedPlan") + List get requestedPlan => throw _privateConstructorUsedError; + @JsonKey(name: "initedPlan") + List get initedPlan => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $ProfileCopyWith get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ProfileCopyWith<$Res> { + factory $ProfileCopyWith(Profile value, $Res Function(Profile) then) = + _$ProfileCopyWithImpl<$Res, Profile>; + @useResult + $Res call( + {@JsonKey(name: "user") User user, + @JsonKey(name: "chartPoints") List chartPoints, + @JsonKey(name: "userDetails") UserDetails userDetails, + @JsonKey(name: "circumferences") List circumferences, + @JsonKey(name: "finishedPlans") List finishedPlans, + @JsonKey(name: "rejectedPlans") List rejectedPlans, + @JsonKey(name: "startedPlan") List startedPlan, + @JsonKey(name: "paidPlan") List paidPlan, + @JsonKey(name: "requestedPlan") List requestedPlan, + @JsonKey(name: "initedPlan") List initedPlan}); + + $UserCopyWith<$Res> get user; + $UserDetailsCopyWith<$Res> get userDetails; +} + +/// @nodoc +class _$ProfileCopyWithImpl<$Res, $Val extends Profile> + implements $ProfileCopyWith<$Res> { + _$ProfileCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? user = null, + Object? chartPoints = null, + Object? userDetails = null, + Object? circumferences = null, + Object? finishedPlans = null, + Object? rejectedPlans = null, + Object? startedPlan = null, + Object? paidPlan = null, + Object? requestedPlan = null, + Object? initedPlan = null, + }) { + return _then(_value.copyWith( + user: null == user + ? _value.user + : user // ignore: cast_nullable_to_non_nullable + as User, + chartPoints: null == chartPoints + ? _value.chartPoints + : chartPoints // ignore: cast_nullable_to_non_nullable + as List, + userDetails: null == userDetails + ? _value.userDetails + : userDetails // ignore: cast_nullable_to_non_nullable + as UserDetails, + circumferences: null == circumferences + ? _value.circumferences + : circumferences // ignore: cast_nullable_to_non_nullable + as List, + finishedPlans: null == finishedPlans + ? _value.finishedPlans + : finishedPlans // ignore: cast_nullable_to_non_nullable + as List, + rejectedPlans: null == rejectedPlans + ? _value.rejectedPlans + : rejectedPlans // ignore: cast_nullable_to_non_nullable + as List, + startedPlan: null == startedPlan + ? _value.startedPlan + : startedPlan // ignore: cast_nullable_to_non_nullable + as List, + paidPlan: null == paidPlan + ? _value.paidPlan + : paidPlan // ignore: cast_nullable_to_non_nullable + as List, + requestedPlan: null == requestedPlan + ? _value.requestedPlan + : requestedPlan // ignore: cast_nullable_to_non_nullable + as List, + initedPlan: null == initedPlan + ? _value.initedPlan + : initedPlan // ignore: cast_nullable_to_non_nullable + as List, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $UserCopyWith<$Res> get user { + return $UserCopyWith<$Res>(_value.user, (value) { + return _then(_value.copyWith(user: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $UserDetailsCopyWith<$Res> get userDetails { + return $UserDetailsCopyWith<$Res>(_value.userDetails, (value) { + return _then(_value.copyWith(userDetails: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$ProfileImplCopyWith<$Res> implements $ProfileCopyWith<$Res> { + factory _$$ProfileImplCopyWith( + _$ProfileImpl value, $Res Function(_$ProfileImpl) then) = + __$$ProfileImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "user") User user, + @JsonKey(name: "chartPoints") List chartPoints, + @JsonKey(name: "userDetails") UserDetails userDetails, + @JsonKey(name: "circumferences") List circumferences, + @JsonKey(name: "finishedPlans") List finishedPlans, + @JsonKey(name: "rejectedPlans") List rejectedPlans, + @JsonKey(name: "startedPlan") List startedPlan, + @JsonKey(name: "paidPlan") List paidPlan, + @JsonKey(name: "requestedPlan") List requestedPlan, + @JsonKey(name: "initedPlan") List initedPlan}); + + @override + $UserCopyWith<$Res> get user; + @override + $UserDetailsCopyWith<$Res> get userDetails; +} + +/// @nodoc +class __$$ProfileImplCopyWithImpl<$Res> + extends _$ProfileCopyWithImpl<$Res, _$ProfileImpl> + implements _$$ProfileImplCopyWith<$Res> { + __$$ProfileImplCopyWithImpl( + _$ProfileImpl _value, $Res Function(_$ProfileImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? user = null, + Object? chartPoints = null, + Object? userDetails = null, + Object? circumferences = null, + Object? finishedPlans = null, + Object? rejectedPlans = null, + Object? startedPlan = null, + Object? paidPlan = null, + Object? requestedPlan = null, + Object? initedPlan = null, + }) { + return _then(_$ProfileImpl( + user: null == user + ? _value.user + : user // ignore: cast_nullable_to_non_nullable + as User, + chartPoints: null == chartPoints + ? _value._chartPoints + : chartPoints // ignore: cast_nullable_to_non_nullable + as List, + userDetails: null == userDetails + ? _value.userDetails + : userDetails // ignore: cast_nullable_to_non_nullable + as UserDetails, + circumferences: null == circumferences + ? _value._circumferences + : circumferences // ignore: cast_nullable_to_non_nullable + as List, + finishedPlans: null == finishedPlans + ? _value._finishedPlans + : finishedPlans // ignore: cast_nullable_to_non_nullable + as List, + rejectedPlans: null == rejectedPlans + ? _value._rejectedPlans + : rejectedPlans // ignore: cast_nullable_to_non_nullable + as List, + startedPlan: null == startedPlan + ? _value._startedPlan + : startedPlan // ignore: cast_nullable_to_non_nullable + as List, + paidPlan: null == paidPlan + ? _value._paidPlan + : paidPlan // ignore: cast_nullable_to_non_nullable + as List, + requestedPlan: null == requestedPlan + ? _value._requestedPlan + : requestedPlan // ignore: cast_nullable_to_non_nullable + as List, + initedPlan: null == initedPlan + ? _value._initedPlan + : initedPlan // ignore: cast_nullable_to_non_nullable + as List, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$ProfileImpl implements _Profile { + const _$ProfileImpl( + {@JsonKey(name: "user") required this.user, + @JsonKey(name: "chartPoints") required final List chartPoints, + @JsonKey(name: "userDetails") required this.userDetails, + @JsonKey(name: "circumferences") + required final List circumferences, + @JsonKey(name: "finishedPlans") + required final List finishedPlans, + @JsonKey(name: "rejectedPlans") + required final List rejectedPlans, + @JsonKey(name: "startedPlan") required final List startedPlan, + @JsonKey(name: "paidPlan") required final List paidPlan, + @JsonKey(name: "requestedPlan") + required final List requestedPlan, + @JsonKey(name: "initedPlan") required final List initedPlan}) + : _chartPoints = chartPoints, + _circumferences = circumferences, + _finishedPlans = finishedPlans, + _rejectedPlans = rejectedPlans, + _startedPlan = startedPlan, + _paidPlan = paidPlan, + _requestedPlan = requestedPlan, + _initedPlan = initedPlan; + + factory _$ProfileImpl.fromJson(Map json) => + _$$ProfileImplFromJson(json); + + @override + @JsonKey(name: "user") + final User user; + final List _chartPoints; + @override + @JsonKey(name: "chartPoints") + List get chartPoints { + if (_chartPoints is EqualUnmodifiableListView) return _chartPoints; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_chartPoints); + } + + @override + @JsonKey(name: "userDetails") + final UserDetails userDetails; + final List _circumferences; + @override + @JsonKey(name: "circumferences") + List get circumferences { + if (_circumferences is EqualUnmodifiableListView) return _circumferences; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_circumferences); + } + + final List _finishedPlans; + @override + @JsonKey(name: "finishedPlans") + List get finishedPlans { + if (_finishedPlans is EqualUnmodifiableListView) return _finishedPlans; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_finishedPlans); + } + + final List _rejectedPlans; + @override + @JsonKey(name: "rejectedPlans") + List get rejectedPlans { + if (_rejectedPlans is EqualUnmodifiableListView) return _rejectedPlans; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_rejectedPlans); + } + + final List _startedPlan; + @override + @JsonKey(name: "startedPlan") + List get startedPlan { + if (_startedPlan is EqualUnmodifiableListView) return _startedPlan; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_startedPlan); + } + + final List _paidPlan; + @override + @JsonKey(name: "paidPlan") + List get paidPlan { + if (_paidPlan is EqualUnmodifiableListView) return _paidPlan; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_paidPlan); + } + + final List _requestedPlan; + @override + @JsonKey(name: "requestedPlan") + List get requestedPlan { + if (_requestedPlan is EqualUnmodifiableListView) return _requestedPlan; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_requestedPlan); + } + + final List _initedPlan; + @override + @JsonKey(name: "initedPlan") + List get initedPlan { + if (_initedPlan is EqualUnmodifiableListView) return _initedPlan; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_initedPlan); + } + + @override + String toString() { + return 'Profile(user: $user, chartPoints: $chartPoints, userDetails: $userDetails, circumferences: $circumferences, finishedPlans: $finishedPlans, rejectedPlans: $rejectedPlans, startedPlan: $startedPlan, paidPlan: $paidPlan, requestedPlan: $requestedPlan, initedPlan: $initedPlan)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileImpl && + (identical(other.user, user) || other.user == user) && + const DeepCollectionEquality() + .equals(other._chartPoints, _chartPoints) && + (identical(other.userDetails, userDetails) || + other.userDetails == userDetails) && + const DeepCollectionEquality() + .equals(other._circumferences, _circumferences) && + const DeepCollectionEquality() + .equals(other._finishedPlans, _finishedPlans) && + const DeepCollectionEquality() + .equals(other._rejectedPlans, _rejectedPlans) && + const DeepCollectionEquality() + .equals(other._startedPlan, _startedPlan) && + const DeepCollectionEquality().equals(other._paidPlan, _paidPlan) && + const DeepCollectionEquality() + .equals(other._requestedPlan, _requestedPlan) && + const DeepCollectionEquality() + .equals(other._initedPlan, _initedPlan)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, + user, + const DeepCollectionEquality().hash(_chartPoints), + userDetails, + const DeepCollectionEquality().hash(_circumferences), + const DeepCollectionEquality().hash(_finishedPlans), + const DeepCollectionEquality().hash(_rejectedPlans), + const DeepCollectionEquality().hash(_startedPlan), + const DeepCollectionEquality().hash(_paidPlan), + const DeepCollectionEquality().hash(_requestedPlan), + const DeepCollectionEquality().hash(_initedPlan)); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$ProfileImplCopyWith<_$ProfileImpl> get copyWith => + __$$ProfileImplCopyWithImpl<_$ProfileImpl>(this, _$identity); + + @override + Map toJson() { + return _$$ProfileImplToJson( + this, + ); + } +} + +abstract class _Profile implements Profile { + const factory _Profile( + {@JsonKey(name: "user") required final User user, + @JsonKey(name: "chartPoints") required final List chartPoints, + @JsonKey(name: "userDetails") required final UserDetails userDetails, + @JsonKey(name: "circumferences") + required final List circumferences, + @JsonKey(name: "finishedPlans") + required final List finishedPlans, + @JsonKey(name: "rejectedPlans") + required final List rejectedPlans, + @JsonKey(name: "startedPlan") required final List startedPlan, + @JsonKey(name: "paidPlan") required final List paidPlan, + @JsonKey(name: "requestedPlan") + required final List requestedPlan, + @JsonKey(name: "initedPlan") + required final List initedPlan}) = _$ProfileImpl; + + factory _Profile.fromJson(Map json) = _$ProfileImpl.fromJson; + + @override + @JsonKey(name: "user") + User get user; + @override + @JsonKey(name: "chartPoints") + List get chartPoints; + @override + @JsonKey(name: "userDetails") + UserDetails get userDetails; + @override + @JsonKey(name: "circumferences") + List get circumferences; + @override + @JsonKey(name: "finishedPlans") + List get finishedPlans; + @override + @JsonKey(name: "rejectedPlans") + List get rejectedPlans; + @override + @JsonKey(name: "startedPlan") + List get startedPlan; + @override + @JsonKey(name: "paidPlan") + List get paidPlan; + @override + @JsonKey(name: "requestedPlan") + List get requestedPlan; + @override + @JsonKey(name: "initedPlan") + List get initedPlan; + @override + @JsonKey(ignore: true) + _$$ProfileImplCopyWith<_$ProfileImpl> get copyWith => + throw _privateConstructorUsedError; +} + +User _$UserFromJson(Map json) { + return _User.fromJson(json); +} + +/// @nodoc +mixin _$User { + @JsonKey(name: "id") + int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") + String get name => throw _privateConstructorUsedError; + @JsonKey(name: "email") + String get email => throw _privateConstructorUsedError; + @JsonKey(name: "email_verified_at") + DateTime get emailVerifiedAt => throw _privateConstructorUsedError; + @JsonKey(name: "two_factor_confirmed_at") + dynamic get twoFactorConfirmedAt => throw _privateConstructorUsedError; + @JsonKey(name: "current_team_id") + dynamic get currentTeamId => throw _privateConstructorUsedError; + @JsonKey(name: "profile_photo_path") + String get profilePhotoPath => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") + DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") + DateTime get updatedAt => throw _privateConstructorUsedError; + @JsonKey(name: "is_consultant") + int get isConsultant => throw _privateConstructorUsedError; + @JsonKey(name: "is_public_profile") + int get isPublicProfile => throw _privateConstructorUsedError; + @JsonKey(name: "slug") + String get slug => throw _privateConstructorUsedError; + @JsonKey(name: "user_settings_id") + dynamic get userSettingsId => throw _privateConstructorUsedError; + @JsonKey(name: "profile_photo_url") + String get profilePhotoUrl => throw _privateConstructorUsedError; + @JsonKey(name: "detailz") + UserDetails get detailz => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $UserCopyWith get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $UserCopyWith<$Res> { + factory $UserCopyWith(User value, $Res Function(User) then) = + _$UserCopyWithImpl<$Res, User>; + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "name") String name, + @JsonKey(name: "email") String email, + @JsonKey(name: "email_verified_at") DateTime emailVerifiedAt, + @JsonKey(name: "two_factor_confirmed_at") dynamic twoFactorConfirmedAt, + @JsonKey(name: "current_team_id") dynamic currentTeamId, + @JsonKey(name: "profile_photo_path") String profilePhotoPath, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt, + @JsonKey(name: "is_consultant") int isConsultant, + @JsonKey(name: "is_public_profile") int isPublicProfile, + @JsonKey(name: "slug") String slug, + @JsonKey(name: "user_settings_id") dynamic userSettingsId, + @JsonKey(name: "profile_photo_url") String profilePhotoUrl, + @JsonKey(name: "detailz") UserDetails detailz}); + + $UserDetailsCopyWith<$Res> get detailz; +} + +/// @nodoc +class _$UserCopyWithImpl<$Res, $Val extends User> + implements $UserCopyWith<$Res> { + _$UserCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? email = null, + Object? emailVerifiedAt = null, + Object? twoFactorConfirmedAt = freezed, + Object? currentTeamId = freezed, + Object? profilePhotoPath = null, + Object? createdAt = null, + Object? updatedAt = null, + Object? isConsultant = null, + Object? isPublicProfile = null, + Object? slug = null, + Object? userSettingsId = freezed, + Object? profilePhotoUrl = null, + Object? detailz = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + emailVerifiedAt: null == emailVerifiedAt + ? _value.emailVerifiedAt + : emailVerifiedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + twoFactorConfirmedAt: freezed == twoFactorConfirmedAt + ? _value.twoFactorConfirmedAt + : twoFactorConfirmedAt // ignore: cast_nullable_to_non_nullable + as dynamic, + currentTeamId: freezed == currentTeamId + ? _value.currentTeamId + : currentTeamId // ignore: cast_nullable_to_non_nullable + as dynamic, + profilePhotoPath: null == profilePhotoPath + ? _value.profilePhotoPath + : profilePhotoPath // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + isConsultant: null == isConsultant + ? _value.isConsultant + : isConsultant // ignore: cast_nullable_to_non_nullable + as int, + isPublicProfile: null == isPublicProfile + ? _value.isPublicProfile + : isPublicProfile // ignore: cast_nullable_to_non_nullable + as int, + slug: null == slug + ? _value.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + userSettingsId: freezed == userSettingsId + ? _value.userSettingsId + : userSettingsId // ignore: cast_nullable_to_non_nullable + as dynamic, + profilePhotoUrl: null == profilePhotoUrl + ? _value.profilePhotoUrl + : profilePhotoUrl // ignore: cast_nullable_to_non_nullable + as String, + detailz: null == detailz + ? _value.detailz + : detailz // ignore: cast_nullable_to_non_nullable + as UserDetails, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $UserDetailsCopyWith<$Res> get detailz { + return $UserDetailsCopyWith<$Res>(_value.detailz, (value) { + return _then(_value.copyWith(detailz: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$UserImplCopyWith<$Res> implements $UserCopyWith<$Res> { + factory _$$UserImplCopyWith( + _$UserImpl value, $Res Function(_$UserImpl) then) = + __$$UserImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "name") String name, + @JsonKey(name: "email") String email, + @JsonKey(name: "email_verified_at") DateTime emailVerifiedAt, + @JsonKey(name: "two_factor_confirmed_at") dynamic twoFactorConfirmedAt, + @JsonKey(name: "current_team_id") dynamic currentTeamId, + @JsonKey(name: "profile_photo_path") String profilePhotoPath, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt, + @JsonKey(name: "is_consultant") int isConsultant, + @JsonKey(name: "is_public_profile") int isPublicProfile, + @JsonKey(name: "slug") String slug, + @JsonKey(name: "user_settings_id") dynamic userSettingsId, + @JsonKey(name: "profile_photo_url") String profilePhotoUrl, + @JsonKey(name: "detailz") UserDetails detailz}); + + @override + $UserDetailsCopyWith<$Res> get detailz; +} + +/// @nodoc +class __$$UserImplCopyWithImpl<$Res> + extends _$UserCopyWithImpl<$Res, _$UserImpl> + implements _$$UserImplCopyWith<$Res> { + __$$UserImplCopyWithImpl(_$UserImpl _value, $Res Function(_$UserImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? email = null, + Object? emailVerifiedAt = null, + Object? twoFactorConfirmedAt = freezed, + Object? currentTeamId = freezed, + Object? profilePhotoPath = null, + Object? createdAt = null, + Object? updatedAt = null, + Object? isConsultant = null, + Object? isPublicProfile = null, + Object? slug = null, + Object? userSettingsId = freezed, + Object? profilePhotoUrl = null, + Object? detailz = null, + }) { + return _then(_$UserImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + emailVerifiedAt: null == emailVerifiedAt + ? _value.emailVerifiedAt + : emailVerifiedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + twoFactorConfirmedAt: freezed == twoFactorConfirmedAt + ? _value.twoFactorConfirmedAt + : twoFactorConfirmedAt // ignore: cast_nullable_to_non_nullable + as dynamic, + currentTeamId: freezed == currentTeamId + ? _value.currentTeamId + : currentTeamId // ignore: cast_nullable_to_non_nullable + as dynamic, + profilePhotoPath: null == profilePhotoPath + ? _value.profilePhotoPath + : profilePhotoPath // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + isConsultant: null == isConsultant + ? _value.isConsultant + : isConsultant // ignore: cast_nullable_to_non_nullable + as int, + isPublicProfile: null == isPublicProfile + ? _value.isPublicProfile + : isPublicProfile // ignore: cast_nullable_to_non_nullable + as int, + slug: null == slug + ? _value.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + userSettingsId: freezed == userSettingsId + ? _value.userSettingsId + : userSettingsId // ignore: cast_nullable_to_non_nullable + as dynamic, + profilePhotoUrl: null == profilePhotoUrl + ? _value.profilePhotoUrl + : profilePhotoUrl // ignore: cast_nullable_to_non_nullable + as String, + detailz: null == detailz + ? _value.detailz + : detailz // ignore: cast_nullable_to_non_nullable + as UserDetails, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$UserImpl implements _User { + const _$UserImpl( + {@JsonKey(name: "id") required this.id, + @JsonKey(name: "name") required this.name, + @JsonKey(name: "email") required this.email, + @JsonKey(name: "email_verified_at") required this.emailVerifiedAt, + @JsonKey(name: "two_factor_confirmed_at") + required this.twoFactorConfirmedAt, + @JsonKey(name: "current_team_id") required this.currentTeamId, + @JsonKey(name: "profile_photo_path") required this.profilePhotoPath, + @JsonKey(name: "created_at") required this.createdAt, + @JsonKey(name: "updated_at") required this.updatedAt, + @JsonKey(name: "is_consultant") required this.isConsultant, + @JsonKey(name: "is_public_profile") required this.isPublicProfile, + @JsonKey(name: "slug") required this.slug, + @JsonKey(name: "user_settings_id") required this.userSettingsId, + @JsonKey(name: "profile_photo_url") required this.profilePhotoUrl, + @JsonKey(name: "detailz") required this.detailz}); + + factory _$UserImpl.fromJson(Map json) => + _$$UserImplFromJson(json); + + @override + @JsonKey(name: "id") + final int id; + @override + @JsonKey(name: "name") + final String name; + @override + @JsonKey(name: "email") + final String email; + @override + @JsonKey(name: "email_verified_at") + final DateTime emailVerifiedAt; + @override + @JsonKey(name: "two_factor_confirmed_at") + final dynamic twoFactorConfirmedAt; + @override + @JsonKey(name: "current_team_id") + final dynamic currentTeamId; + @override + @JsonKey(name: "profile_photo_path") + final String profilePhotoPath; + @override + @JsonKey(name: "created_at") + final DateTime createdAt; + @override + @JsonKey(name: "updated_at") + final DateTime updatedAt; + @override + @JsonKey(name: "is_consultant") + final int isConsultant; + @override + @JsonKey(name: "is_public_profile") + final int isPublicProfile; + @override + @JsonKey(name: "slug") + final String slug; + @override + @JsonKey(name: "user_settings_id") + final dynamic userSettingsId; + @override + @JsonKey(name: "profile_photo_url") + final String profilePhotoUrl; + @override + @JsonKey(name: "detailz") + final UserDetails detailz; + + @override + String toString() { + return 'User(id: $id, name: $name, email: $email, emailVerifiedAt: $emailVerifiedAt, twoFactorConfirmedAt: $twoFactorConfirmedAt, currentTeamId: $currentTeamId, profilePhotoPath: $profilePhotoPath, createdAt: $createdAt, updatedAt: $updatedAt, isConsultant: $isConsultant, isPublicProfile: $isPublicProfile, slug: $slug, userSettingsId: $userSettingsId, profilePhotoUrl: $profilePhotoUrl, detailz: $detailz)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$UserImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.name, name) || other.name == name) && + (identical(other.email, email) || other.email == email) && + (identical(other.emailVerifiedAt, emailVerifiedAt) || + other.emailVerifiedAt == emailVerifiedAt) && + const DeepCollectionEquality() + .equals(other.twoFactorConfirmedAt, twoFactorConfirmedAt) && + const DeepCollectionEquality() + .equals(other.currentTeamId, currentTeamId) && + (identical(other.profilePhotoPath, profilePhotoPath) || + other.profilePhotoPath == profilePhotoPath) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.isConsultant, isConsultant) || + other.isConsultant == isConsultant) && + (identical(other.isPublicProfile, isPublicProfile) || + other.isPublicProfile == isPublicProfile) && + (identical(other.slug, slug) || other.slug == slug) && + const DeepCollectionEquality() + .equals(other.userSettingsId, userSettingsId) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || + other.profilePhotoUrl == profilePhotoUrl) && + (identical(other.detailz, detailz) || other.detailz == detailz)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, + id, + name, + email, + emailVerifiedAt, + const DeepCollectionEquality().hash(twoFactorConfirmedAt), + const DeepCollectionEquality().hash(currentTeamId), + profilePhotoPath, + createdAt, + updatedAt, + isConsultant, + isPublicProfile, + slug, + const DeepCollectionEquality().hash(userSettingsId), + profilePhotoUrl, + detailz); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$UserImplCopyWith<_$UserImpl> get copyWith => + __$$UserImplCopyWithImpl<_$UserImpl>(this, _$identity); + + @override + Map toJson() { + return _$$UserImplToJson( + this, + ); + } +} + +abstract class _User implements User { + const factory _User( + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "email") required final String email, + @JsonKey(name: "email_verified_at") + required final DateTime emailVerifiedAt, + @JsonKey(name: "two_factor_confirmed_at") + required final dynamic twoFactorConfirmedAt, + @JsonKey(name: "current_team_id") required final dynamic currentTeamId, + @JsonKey(name: "profile_photo_path") + required final String profilePhotoPath, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt, + @JsonKey(name: "is_consultant") required final int isConsultant, + @JsonKey(name: "is_public_profile") required final int isPublicProfile, + @JsonKey(name: "slug") required final String slug, + @JsonKey(name: "user_settings_id") required final dynamic userSettingsId, + @JsonKey(name: "profile_photo_url") required final String profilePhotoUrl, + @JsonKey(name: "detailz") + required final UserDetails detailz}) = _$UserImpl; + + factory _User.fromJson(Map json) = _$UserImpl.fromJson; + + @override + @JsonKey(name: "id") + int get id; + @override + @JsonKey(name: "name") + String get name; + @override + @JsonKey(name: "email") + String get email; + @override + @JsonKey(name: "email_verified_at") + DateTime get emailVerifiedAt; + @override + @JsonKey(name: "two_factor_confirmed_at") + dynamic get twoFactorConfirmedAt; + @override + @JsonKey(name: "current_team_id") + dynamic get currentTeamId; + @override + @JsonKey(name: "profile_photo_path") + String get profilePhotoPath; + @override + @JsonKey(name: "created_at") + DateTime get createdAt; + @override + @JsonKey(name: "updated_at") + DateTime get updatedAt; + @override + @JsonKey(name: "is_consultant") + int get isConsultant; + @override + @JsonKey(name: "is_public_profile") + int get isPublicProfile; + @override + @JsonKey(name: "slug") + String get slug; + @override + @JsonKey(name: "user_settings_id") + dynamic get userSettingsId; + @override + @JsonKey(name: "profile_photo_url") + String get profilePhotoUrl; + @override + @JsonKey(name: "detailz") + UserDetails get detailz; + @override + @JsonKey(ignore: true) + _$$UserImplCopyWith<_$UserImpl> get copyWith => + throw _privateConstructorUsedError; +} + +UserDetails _$UserDetailsFromJson(Map json) { + return _UserDetails.fromJson(json); +} + +/// @nodoc +mixin _$UserDetails { + @JsonKey(name: "id") + int get id => throw _privateConstructorUsedError; + @JsonKey(name: "user_id") + int get userId => throw _privateConstructorUsedError; + @JsonKey(name: "first_name") + String get firstName => throw _privateConstructorUsedError; + @JsonKey(name: "last_name") + String get lastName => throw _privateConstructorUsedError; + @JsonKey(name: "birthdate") + DateTime get birthdate => throw _privateConstructorUsedError; + @JsonKey(name: "gender") + String get gender => throw _privateConstructorUsedError; + @JsonKey(name: "country") + String get country => throw _privateConstructorUsedError; + @JsonKey(name: "city") + String get city => throw _privateConstructorUsedError; + @JsonKey(name: "lang") + String get lang => throw _privateConstructorUsedError; + @JsonKey(name: "weight") + int get weight => throw _privateConstructorUsedError; + @JsonKey(name: "height") + int get height => throw _privateConstructorUsedError; + @JsonKey(name: "chest_circumference") + int get chestCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "waist_circumference") + int get waistCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "hip_circumference") + int get hipCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "blood_pressure_up") + int get bloodPressureUp => throw _privateConstructorUsedError; + @JsonKey(name: "blood_pressure_down") + int get bloodPressureDown => throw _privateConstructorUsedError; + @JsonKey(name: "has_hypo") + int get hasHypo => throw _privateConstructorUsedError; + @JsonKey(name: "has_hyper") + int get hasHyper => throw _privateConstructorUsedError; + @JsonKey(name: "about_alergy") + String get aboutAlergy => throw _privateConstructorUsedError; + @JsonKey(name: "about_taking_pils") + String get aboutTakingPils => throw _privateConstructorUsedError; + @JsonKey(name: "about_sport_hobbies") + String get aboutSportHobbies => throw _privateConstructorUsedError; + @JsonKey(name: "favorite_foods") + String get favoriteFoods => throw _privateConstructorUsedError; + @JsonKey(name: "unfavorite_foods") + String get unfavoriteFoods => throw _privateConstructorUsedError; + @JsonKey(name: "additional_info") + String get additionalInfo => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") + DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") + DateTime get updatedAt => throw _privateConstructorUsedError; + @JsonKey(name: "is_mood_fillable") + int get isMoodFillable => throw _privateConstructorUsedError; + @JsonKey(name: "is_bedtime_fillable") + int get isBedtimeFillable => throw _privateConstructorUsedError; + @JsonKey(name: "activity_coefficient") + double get activityCoefficient => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $UserDetailsCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $UserDetailsCopyWith<$Res> { + factory $UserDetailsCopyWith( + UserDetails value, $Res Function(UserDetails) then) = + _$UserDetailsCopyWithImpl<$Res, UserDetails>; + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "first_name") String firstName, + @JsonKey(name: "last_name") String lastName, + @JsonKey(name: "birthdate") DateTime birthdate, + @JsonKey(name: "gender") String gender, + @JsonKey(name: "country") String country, + @JsonKey(name: "city") String city, + @JsonKey(name: "lang") String lang, + @JsonKey(name: "weight") int weight, + @JsonKey(name: "height") int height, + @JsonKey(name: "chest_circumference") int chestCircumference, + @JsonKey(name: "waist_circumference") int waistCircumference, + @JsonKey(name: "hip_circumference") int hipCircumference, + @JsonKey(name: "blood_pressure_up") int bloodPressureUp, + @JsonKey(name: "blood_pressure_down") int bloodPressureDown, + @JsonKey(name: "has_hypo") int hasHypo, + @JsonKey(name: "has_hyper") int hasHyper, + @JsonKey(name: "about_alergy") String aboutAlergy, + @JsonKey(name: "about_taking_pils") String aboutTakingPils, + @JsonKey(name: "about_sport_hobbies") String aboutSportHobbies, + @JsonKey(name: "favorite_foods") String favoriteFoods, + @JsonKey(name: "unfavorite_foods") String unfavoriteFoods, + @JsonKey(name: "additional_info") String additionalInfo, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt, + @JsonKey(name: "is_mood_fillable") int isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") int isBedtimeFillable, + @JsonKey(name: "activity_coefficient") double activityCoefficient}); +} + +/// @nodoc +class _$UserDetailsCopyWithImpl<$Res, $Val extends UserDetails> + implements $UserDetailsCopyWith<$Res> { + _$UserDetailsCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? firstName = null, + Object? lastName = null, + Object? birthdate = null, + Object? gender = null, + Object? country = null, + Object? city = null, + Object? lang = null, + Object? weight = null, + Object? height = null, + Object? chestCircumference = null, + Object? waistCircumference = null, + Object? hipCircumference = null, + Object? bloodPressureUp = null, + Object? bloodPressureDown = null, + Object? hasHypo = null, + Object? hasHyper = null, + Object? aboutAlergy = null, + Object? aboutTakingPils = null, + Object? aboutSportHobbies = null, + Object? favoriteFoods = null, + Object? unfavoriteFoods = null, + Object? additionalInfo = null, + Object? createdAt = null, + Object? updatedAt = null, + Object? isMoodFillable = null, + Object? isBedtimeFillable = null, + Object? activityCoefficient = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + firstName: null == firstName + ? _value.firstName + : firstName // ignore: cast_nullable_to_non_nullable + as String, + lastName: null == lastName + ? _value.lastName + : lastName // ignore: cast_nullable_to_non_nullable + as String, + birthdate: null == birthdate + ? _value.birthdate + : birthdate // ignore: cast_nullable_to_non_nullable + as DateTime, + gender: null == gender + ? _value.gender + : gender // ignore: cast_nullable_to_non_nullable + as String, + country: null == country + ? _value.country + : country // ignore: cast_nullable_to_non_nullable + as String, + city: null == city + ? _value.city + : city // ignore: cast_nullable_to_non_nullable + as String, + lang: null == lang + ? _value.lang + : lang // ignore: cast_nullable_to_non_nullable + as String, + weight: null == weight + ? _value.weight + : weight // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + chestCircumference: null == chestCircumference + ? _value.chestCircumference + : chestCircumference // ignore: cast_nullable_to_non_nullable + as int, + waistCircumference: null == waistCircumference + ? _value.waistCircumference + : waistCircumference // ignore: cast_nullable_to_non_nullable + as int, + hipCircumference: null == hipCircumference + ? _value.hipCircumference + : hipCircumference // ignore: cast_nullable_to_non_nullable + as int, + bloodPressureUp: null == bloodPressureUp + ? _value.bloodPressureUp + : bloodPressureUp // ignore: cast_nullable_to_non_nullable + as int, + bloodPressureDown: null == bloodPressureDown + ? _value.bloodPressureDown + : bloodPressureDown // ignore: cast_nullable_to_non_nullable + as int, + hasHypo: null == hasHypo + ? _value.hasHypo + : hasHypo // ignore: cast_nullable_to_non_nullable + as int, + hasHyper: null == hasHyper + ? _value.hasHyper + : hasHyper // ignore: cast_nullable_to_non_nullable + as int, + aboutAlergy: null == aboutAlergy + ? _value.aboutAlergy + : aboutAlergy // ignore: cast_nullable_to_non_nullable + as String, + aboutTakingPils: null == aboutTakingPils + ? _value.aboutTakingPils + : aboutTakingPils // ignore: cast_nullable_to_non_nullable + as String, + aboutSportHobbies: null == aboutSportHobbies + ? _value.aboutSportHobbies + : aboutSportHobbies // ignore: cast_nullable_to_non_nullable + as String, + favoriteFoods: null == favoriteFoods + ? _value.favoriteFoods + : favoriteFoods // ignore: cast_nullable_to_non_nullable + as String, + unfavoriteFoods: null == unfavoriteFoods + ? _value.unfavoriteFoods + : unfavoriteFoods // ignore: cast_nullable_to_non_nullable + as String, + additionalInfo: null == additionalInfo + ? _value.additionalInfo + : additionalInfo // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + isMoodFillable: null == isMoodFillable + ? _value.isMoodFillable + : isMoodFillable // ignore: cast_nullable_to_non_nullable + as int, + isBedtimeFillable: null == isBedtimeFillable + ? _value.isBedtimeFillable + : isBedtimeFillable // ignore: cast_nullable_to_non_nullable + as int, + activityCoefficient: null == activityCoefficient + ? _value.activityCoefficient + : activityCoefficient // ignore: cast_nullable_to_non_nullable + as double, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$UserDetailsImplCopyWith<$Res> + implements $UserDetailsCopyWith<$Res> { + factory _$$UserDetailsImplCopyWith( + _$UserDetailsImpl value, $Res Function(_$UserDetailsImpl) then) = + __$$UserDetailsImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "first_name") String firstName, + @JsonKey(name: "last_name") String lastName, + @JsonKey(name: "birthdate") DateTime birthdate, + @JsonKey(name: "gender") String gender, + @JsonKey(name: "country") String country, + @JsonKey(name: "city") String city, + @JsonKey(name: "lang") String lang, + @JsonKey(name: "weight") int weight, + @JsonKey(name: "height") int height, + @JsonKey(name: "chest_circumference") int chestCircumference, + @JsonKey(name: "waist_circumference") int waistCircumference, + @JsonKey(name: "hip_circumference") int hipCircumference, + @JsonKey(name: "blood_pressure_up") int bloodPressureUp, + @JsonKey(name: "blood_pressure_down") int bloodPressureDown, + @JsonKey(name: "has_hypo") int hasHypo, + @JsonKey(name: "has_hyper") int hasHyper, + @JsonKey(name: "about_alergy") String aboutAlergy, + @JsonKey(name: "about_taking_pils") String aboutTakingPils, + @JsonKey(name: "about_sport_hobbies") String aboutSportHobbies, + @JsonKey(name: "favorite_foods") String favoriteFoods, + @JsonKey(name: "unfavorite_foods") String unfavoriteFoods, + @JsonKey(name: "additional_info") String additionalInfo, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt, + @JsonKey(name: "is_mood_fillable") int isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") int isBedtimeFillable, + @JsonKey(name: "activity_coefficient") double activityCoefficient}); +} + +/// @nodoc +class __$$UserDetailsImplCopyWithImpl<$Res> + extends _$UserDetailsCopyWithImpl<$Res, _$UserDetailsImpl> + implements _$$UserDetailsImplCopyWith<$Res> { + __$$UserDetailsImplCopyWithImpl( + _$UserDetailsImpl _value, $Res Function(_$UserDetailsImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? firstName = null, + Object? lastName = null, + Object? birthdate = null, + Object? gender = null, + Object? country = null, + Object? city = null, + Object? lang = null, + Object? weight = null, + Object? height = null, + Object? chestCircumference = null, + Object? waistCircumference = null, + Object? hipCircumference = null, + Object? bloodPressureUp = null, + Object? bloodPressureDown = null, + Object? hasHypo = null, + Object? hasHyper = null, + Object? aboutAlergy = null, + Object? aboutTakingPils = null, + Object? aboutSportHobbies = null, + Object? favoriteFoods = null, + Object? unfavoriteFoods = null, + Object? additionalInfo = null, + Object? createdAt = null, + Object? updatedAt = null, + Object? isMoodFillable = null, + Object? isBedtimeFillable = null, + Object? activityCoefficient = null, + }) { + return _then(_$UserDetailsImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + firstName: null == firstName + ? _value.firstName + : firstName // ignore: cast_nullable_to_non_nullable + as String, + lastName: null == lastName + ? _value.lastName + : lastName // ignore: cast_nullable_to_non_nullable + as String, + birthdate: null == birthdate + ? _value.birthdate + : birthdate // ignore: cast_nullable_to_non_nullable + as DateTime, + gender: null == gender + ? _value.gender + : gender // ignore: cast_nullable_to_non_nullable + as String, + country: null == country + ? _value.country + : country // ignore: cast_nullable_to_non_nullable + as String, + city: null == city + ? _value.city + : city // ignore: cast_nullable_to_non_nullable + as String, + lang: null == lang + ? _value.lang + : lang // ignore: cast_nullable_to_non_nullable + as String, + weight: null == weight + ? _value.weight + : weight // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + chestCircumference: null == chestCircumference + ? _value.chestCircumference + : chestCircumference // ignore: cast_nullable_to_non_nullable + as int, + waistCircumference: null == waistCircumference + ? _value.waistCircumference + : waistCircumference // ignore: cast_nullable_to_non_nullable + as int, + hipCircumference: null == hipCircumference + ? _value.hipCircumference + : hipCircumference // ignore: cast_nullable_to_non_nullable + as int, + bloodPressureUp: null == bloodPressureUp + ? _value.bloodPressureUp + : bloodPressureUp // ignore: cast_nullable_to_non_nullable + as int, + bloodPressureDown: null == bloodPressureDown + ? _value.bloodPressureDown + : bloodPressureDown // ignore: cast_nullable_to_non_nullable + as int, + hasHypo: null == hasHypo + ? _value.hasHypo + : hasHypo // ignore: cast_nullable_to_non_nullable + as int, + hasHyper: null == hasHyper + ? _value.hasHyper + : hasHyper // ignore: cast_nullable_to_non_nullable + as int, + aboutAlergy: null == aboutAlergy + ? _value.aboutAlergy + : aboutAlergy // ignore: cast_nullable_to_non_nullable + as String, + aboutTakingPils: null == aboutTakingPils + ? _value.aboutTakingPils + : aboutTakingPils // ignore: cast_nullable_to_non_nullable + as String, + aboutSportHobbies: null == aboutSportHobbies + ? _value.aboutSportHobbies + : aboutSportHobbies // ignore: cast_nullable_to_non_nullable + as String, + favoriteFoods: null == favoriteFoods + ? _value.favoriteFoods + : favoriteFoods // ignore: cast_nullable_to_non_nullable + as String, + unfavoriteFoods: null == unfavoriteFoods + ? _value.unfavoriteFoods + : unfavoriteFoods // ignore: cast_nullable_to_non_nullable + as String, + additionalInfo: null == additionalInfo + ? _value.additionalInfo + : additionalInfo // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + isMoodFillable: null == isMoodFillable + ? _value.isMoodFillable + : isMoodFillable // ignore: cast_nullable_to_non_nullable + as int, + isBedtimeFillable: null == isBedtimeFillable + ? _value.isBedtimeFillable + : isBedtimeFillable // ignore: cast_nullable_to_non_nullable + as int, + activityCoefficient: null == activityCoefficient + ? _value.activityCoefficient + : activityCoefficient // ignore: cast_nullable_to_non_nullable + as double, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$UserDetailsImpl implements _UserDetails { + const _$UserDetailsImpl( + {@JsonKey(name: "id") required this.id, + @JsonKey(name: "user_id") required this.userId, + @JsonKey(name: "first_name") required this.firstName, + @JsonKey(name: "last_name") required this.lastName, + @JsonKey(name: "birthdate") required this.birthdate, + @JsonKey(name: "gender") required this.gender, + @JsonKey(name: "country") required this.country, + @JsonKey(name: "city") required this.city, + @JsonKey(name: "lang") required this.lang, + @JsonKey(name: "weight") required this.weight, + @JsonKey(name: "height") required this.height, + @JsonKey(name: "chest_circumference") required this.chestCircumference, + @JsonKey(name: "waist_circumference") required this.waistCircumference, + @JsonKey(name: "hip_circumference") required this.hipCircumference, + @JsonKey(name: "blood_pressure_up") required this.bloodPressureUp, + @JsonKey(name: "blood_pressure_down") required this.bloodPressureDown, + @JsonKey(name: "has_hypo") required this.hasHypo, + @JsonKey(name: "has_hyper") required this.hasHyper, + @JsonKey(name: "about_alergy") required this.aboutAlergy, + @JsonKey(name: "about_taking_pils") required this.aboutTakingPils, + @JsonKey(name: "about_sport_hobbies") required this.aboutSportHobbies, + @JsonKey(name: "favorite_foods") required this.favoriteFoods, + @JsonKey(name: "unfavorite_foods") required this.unfavoriteFoods, + @JsonKey(name: "additional_info") required this.additionalInfo, + @JsonKey(name: "created_at") required this.createdAt, + @JsonKey(name: "updated_at") required this.updatedAt, + @JsonKey(name: "is_mood_fillable") required this.isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") required this.isBedtimeFillable, + @JsonKey(name: "activity_coefficient") + required this.activityCoefficient}); + + factory _$UserDetailsImpl.fromJson(Map json) => + _$$UserDetailsImplFromJson(json); + + @override + @JsonKey(name: "id") + final int id; + @override + @JsonKey(name: "user_id") + final int userId; + @override + @JsonKey(name: "first_name") + final String firstName; + @override + @JsonKey(name: "last_name") + final String lastName; + @override + @JsonKey(name: "birthdate") + final DateTime birthdate; + @override + @JsonKey(name: "gender") + final String gender; + @override + @JsonKey(name: "country") + final String country; + @override + @JsonKey(name: "city") + final String city; + @override + @JsonKey(name: "lang") + final String lang; + @override + @JsonKey(name: "weight") + final int weight; + @override + @JsonKey(name: "height") + final int height; + @override + @JsonKey(name: "chest_circumference") + final int chestCircumference; + @override + @JsonKey(name: "waist_circumference") + final int waistCircumference; + @override + @JsonKey(name: "hip_circumference") + final int hipCircumference; + @override + @JsonKey(name: "blood_pressure_up") + final int bloodPressureUp; + @override + @JsonKey(name: "blood_pressure_down") + final int bloodPressureDown; + @override + @JsonKey(name: "has_hypo") + final int hasHypo; + @override + @JsonKey(name: "has_hyper") + final int hasHyper; + @override + @JsonKey(name: "about_alergy") + final String aboutAlergy; + @override + @JsonKey(name: "about_taking_pils") + final String aboutTakingPils; + @override + @JsonKey(name: "about_sport_hobbies") + final String aboutSportHobbies; + @override + @JsonKey(name: "favorite_foods") + final String favoriteFoods; + @override + @JsonKey(name: "unfavorite_foods") + final String unfavoriteFoods; + @override + @JsonKey(name: "additional_info") + final String additionalInfo; + @override + @JsonKey(name: "created_at") + final DateTime createdAt; + @override + @JsonKey(name: "updated_at") + final DateTime updatedAt; + @override + @JsonKey(name: "is_mood_fillable") + final int isMoodFillable; + @override + @JsonKey(name: "is_bedtime_fillable") + final int isBedtimeFillable; + @override + @JsonKey(name: "activity_coefficient") + final double activityCoefficient; + + @override + String toString() { + return 'UserDetails(id: $id, userId: $userId, firstName: $firstName, lastName: $lastName, birthdate: $birthdate, gender: $gender, country: $country, city: $city, lang: $lang, weight: $weight, height: $height, chestCircumference: $chestCircumference, waistCircumference: $waistCircumference, hipCircumference: $hipCircumference, bloodPressureUp: $bloodPressureUp, bloodPressureDown: $bloodPressureDown, hasHypo: $hasHypo, hasHyper: $hasHyper, aboutAlergy: $aboutAlergy, aboutTakingPils: $aboutTakingPils, aboutSportHobbies: $aboutSportHobbies, favoriteFoods: $favoriteFoods, unfavoriteFoods: $unfavoriteFoods, additionalInfo: $additionalInfo, createdAt: $createdAt, updatedAt: $updatedAt, isMoodFillable: $isMoodFillable, isBedtimeFillable: $isBedtimeFillable, activityCoefficient: $activityCoefficient)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$UserDetailsImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.userId, userId) || other.userId == userId) && + (identical(other.firstName, firstName) || + other.firstName == firstName) && + (identical(other.lastName, lastName) || + other.lastName == lastName) && + (identical(other.birthdate, birthdate) || + other.birthdate == birthdate) && + (identical(other.gender, gender) || other.gender == gender) && + (identical(other.country, country) || other.country == country) && + (identical(other.city, city) || other.city == city) && + (identical(other.lang, lang) || other.lang == lang) && + (identical(other.weight, weight) || other.weight == weight) && + (identical(other.height, height) || other.height == height) && + (identical(other.chestCircumference, chestCircumference) || + other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || + other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || + other.hipCircumference == hipCircumference) && + (identical(other.bloodPressureUp, bloodPressureUp) || + other.bloodPressureUp == bloodPressureUp) && + (identical(other.bloodPressureDown, bloodPressureDown) || + other.bloodPressureDown == bloodPressureDown) && + (identical(other.hasHypo, hasHypo) || other.hasHypo == hasHypo) && + (identical(other.hasHyper, hasHyper) || + other.hasHyper == hasHyper) && + (identical(other.aboutAlergy, aboutAlergy) || + other.aboutAlergy == aboutAlergy) && + (identical(other.aboutTakingPils, aboutTakingPils) || + other.aboutTakingPils == aboutTakingPils) && + (identical(other.aboutSportHobbies, aboutSportHobbies) || + other.aboutSportHobbies == aboutSportHobbies) && + (identical(other.favoriteFoods, favoriteFoods) || + other.favoriteFoods == favoriteFoods) && + (identical(other.unfavoriteFoods, unfavoriteFoods) || + other.unfavoriteFoods == unfavoriteFoods) && + (identical(other.additionalInfo, additionalInfo) || + other.additionalInfo == additionalInfo) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.isMoodFillable, isMoodFillable) || + other.isMoodFillable == isMoodFillable) && + (identical(other.isBedtimeFillable, isBedtimeFillable) || + other.isBedtimeFillable == isBedtimeFillable) && + (identical(other.activityCoefficient, activityCoefficient) || + other.activityCoefficient == activityCoefficient)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hashAll([ + runtimeType, + id, + userId, + firstName, + lastName, + birthdate, + gender, + country, + city, + lang, + weight, + height, + chestCircumference, + waistCircumference, + hipCircumference, + bloodPressureUp, + bloodPressureDown, + hasHypo, + hasHyper, + aboutAlergy, + aboutTakingPils, + aboutSportHobbies, + favoriteFoods, + unfavoriteFoods, + additionalInfo, + createdAt, + updatedAt, + isMoodFillable, + isBedtimeFillable, + activityCoefficient + ]); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$UserDetailsImplCopyWith<_$UserDetailsImpl> get copyWith => + __$$UserDetailsImplCopyWithImpl<_$UserDetailsImpl>(this, _$identity); + + @override + Map toJson() { + return _$$UserDetailsImplToJson( + this, + ); + } +} + +abstract class _UserDetails implements UserDetails { + const factory _UserDetails( + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "user_id") required final int userId, + @JsonKey(name: "first_name") required final String firstName, + @JsonKey(name: "last_name") required final String lastName, + @JsonKey(name: "birthdate") required final DateTime birthdate, + @JsonKey(name: "gender") required final String gender, + @JsonKey(name: "country") required final String country, + @JsonKey(name: "city") required final String city, + @JsonKey(name: "lang") required final String lang, + @JsonKey(name: "weight") required final int weight, + @JsonKey(name: "height") required final int height, + @JsonKey(name: "chest_circumference") + required final int chestCircumference, + @JsonKey(name: "waist_circumference") + required final int waistCircumference, + @JsonKey(name: "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: "has_hypo") required final int hasHypo, + @JsonKey(name: "has_hyper") required final int hasHyper, + @JsonKey(name: "about_alergy") required final String aboutAlergy, + @JsonKey(name: "about_taking_pils") required final String aboutTakingPils, + @JsonKey(name: "about_sport_hobbies") + required final String aboutSportHobbies, + @JsonKey(name: "favorite_foods") required final String favoriteFoods, + @JsonKey(name: "unfavorite_foods") required final String unfavoriteFoods, + @JsonKey(name: "additional_info") required final String additionalInfo, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt, + @JsonKey(name: "is_mood_fillable") required final int isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") + required final int isBedtimeFillable, + @JsonKey(name: "activity_coefficient") + required final double activityCoefficient}) = _$UserDetailsImpl; + + factory _UserDetails.fromJson(Map json) = + _$UserDetailsImpl.fromJson; + + @override + @JsonKey(name: "id") + int get id; + @override + @JsonKey(name: "user_id") + int get userId; + @override + @JsonKey(name: "first_name") + String get firstName; + @override + @JsonKey(name: "last_name") + String get lastName; + @override + @JsonKey(name: "birthdate") + DateTime get birthdate; + @override + @JsonKey(name: "gender") + String get gender; + @override + @JsonKey(name: "country") + String get country; + @override + @JsonKey(name: "city") + String get city; + @override + @JsonKey(name: "lang") + String get lang; + @override + @JsonKey(name: "weight") + int get weight; + @override + @JsonKey(name: "height") + int get height; + @override + @JsonKey(name: "chest_circumference") + int get chestCircumference; + @override + @JsonKey(name: "waist_circumference") + int get waistCircumference; + @override + @JsonKey(name: "hip_circumference") + int get hipCircumference; + @override + @JsonKey(name: "blood_pressure_up") + int get bloodPressureUp; + @override + @JsonKey(name: "blood_pressure_down") + int get bloodPressureDown; + @override + @JsonKey(name: "has_hypo") + int get hasHypo; + @override + @JsonKey(name: "has_hyper") + int get hasHyper; + @override + @JsonKey(name: "about_alergy") + String get aboutAlergy; + @override + @JsonKey(name: "about_taking_pils") + String get aboutTakingPils; + @override + @JsonKey(name: "about_sport_hobbies") + String get aboutSportHobbies; + @override + @JsonKey(name: "favorite_foods") + String get favoriteFoods; + @override + @JsonKey(name: "unfavorite_foods") + String get unfavoriteFoods; + @override + @JsonKey(name: "additional_info") + String get additionalInfo; + @override + @JsonKey(name: "created_at") + DateTime get createdAt; + @override + @JsonKey(name: "updated_at") + DateTime get updatedAt; + @override + @JsonKey(name: "is_mood_fillable") + int get isMoodFillable; + @override + @JsonKey(name: "is_bedtime_fillable") + int get isBedtimeFillable; + @override + @JsonKey(name: "activity_coefficient") + double get activityCoefficient; + @override + @JsonKey(ignore: true) + _$$UserDetailsImplCopyWith<_$UserDetailsImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/profile/models/profile_model.g.dart b/lib/features/profile/models/profile_model.g.dart new file mode 100644 index 00000000..e7943fdf --- /dev/null +++ b/lib/features/profile/models/profile_model.g.dart @@ -0,0 +1,139 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'profile_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$ProfileImpl _$$ProfileImplFromJson(Map json) => + _$ProfileImpl( + user: User.fromJson(json['user'] as Map), + chartPoints: json['chartPoints'] as List, + userDetails: + UserDetails.fromJson(json['userDetails'] as Map), + circumferences: json['circumferences'] as List, + finishedPlans: json['finishedPlans'] as List, + rejectedPlans: json['rejectedPlans'] as List, + startedPlan: json['startedPlan'] as List, + paidPlan: json['paidPlan'] as List, + requestedPlan: json['requestedPlan'] as List, + initedPlan: json['initedPlan'] as List, + ); + +Map _$$ProfileImplToJson(_$ProfileImpl instance) => + { + 'user': instance.user, + 'chartPoints': instance.chartPoints, + 'userDetails': instance.userDetails, + 'circumferences': instance.circumferences, + 'finishedPlans': instance.finishedPlans, + 'rejectedPlans': instance.rejectedPlans, + 'startedPlan': instance.startedPlan, + 'paidPlan': instance.paidPlan, + 'requestedPlan': instance.requestedPlan, + 'initedPlan': instance.initedPlan, + }; + +_$UserImpl _$$UserImplFromJson(Map json) => _$UserImpl( + id: (json['id'] as num).toInt(), + name: json['name'] as String, + email: json['email'] as String, + emailVerifiedAt: DateTime.parse(json['email_verified_at'] as String), + twoFactorConfirmedAt: json['two_factor_confirmed_at'], + currentTeamId: json['current_team_id'], + profilePhotoPath: json['profile_photo_path'] as String, + createdAt: DateTime.parse(json['created_at'] as String), + updatedAt: DateTime.parse(json['updated_at'] as String), + isConsultant: (json['is_consultant'] as num).toInt(), + isPublicProfile: (json['is_public_profile'] as num).toInt(), + slug: json['slug'] as String, + userSettingsId: json['user_settings_id'], + profilePhotoUrl: json['profile_photo_url'] as String, + detailz: UserDetails.fromJson(json['detailz'] as Map), + ); + +Map _$$UserImplToJson(_$UserImpl instance) => + { + 'id': instance.id, + 'name': instance.name, + 'email': instance.email, + 'email_verified_at': instance.emailVerifiedAt.toIso8601String(), + 'two_factor_confirmed_at': instance.twoFactorConfirmedAt, + 'current_team_id': instance.currentTeamId, + 'profile_photo_path': instance.profilePhotoPath, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + 'is_consultant': instance.isConsultant, + 'is_public_profile': instance.isPublicProfile, + 'slug': instance.slug, + 'user_settings_id': instance.userSettingsId, + 'profile_photo_url': instance.profilePhotoUrl, + 'detailz': instance.detailz, + }; + +_$UserDetailsImpl _$$UserDetailsImplFromJson(Map json) => + _$UserDetailsImpl( + id: (json['id'] as num).toInt(), + userId: (json['user_id'] as num).toInt(), + firstName: json['first_name'] as String, + lastName: json['last_name'] as String, + birthdate: DateTime.parse(json['birthdate'] as String), + gender: json['gender'] as String, + country: json['country'] as String, + city: json['city'] as String, + lang: json['lang'] as String, + weight: (json['weight'] as num).toInt(), + height: (json['height'] as num).toInt(), + chestCircumference: (json['chest_circumference'] as num).toInt(), + waistCircumference: (json['waist_circumference'] as num).toInt(), + hipCircumference: (json['hip_circumference'] as num).toInt(), + bloodPressureUp: (json['blood_pressure_up'] as num).toInt(), + bloodPressureDown: (json['blood_pressure_down'] as num).toInt(), + hasHypo: (json['has_hypo'] as num).toInt(), + hasHyper: (json['has_hyper'] as num).toInt(), + aboutAlergy: json['about_alergy'] as String, + aboutTakingPils: json['about_taking_pils'] as String, + aboutSportHobbies: json['about_sport_hobbies'] as String, + favoriteFoods: json['favorite_foods'] as String, + unfavoriteFoods: json['unfavorite_foods'] as String, + additionalInfo: json['additional_info'] as String, + createdAt: DateTime.parse(json['created_at'] as String), + updatedAt: DateTime.parse(json['updated_at'] as String), + isMoodFillable: (json['is_mood_fillable'] as num).toInt(), + isBedtimeFillable: (json['is_bedtime_fillable'] as num).toInt(), + activityCoefficient: (json['activity_coefficient'] as num).toDouble(), + ); + +Map _$$UserDetailsImplToJson(_$UserDetailsImpl instance) => + { + 'id': instance.id, + 'user_id': instance.userId, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'birthdate': instance.birthdate.toIso8601String(), + 'gender': instance.gender, + 'country': instance.country, + 'city': instance.city, + 'lang': instance.lang, + 'weight': instance.weight, + 'height': instance.height, + 'chest_circumference': instance.chestCircumference, + 'waist_circumference': instance.waistCircumference, + 'hip_circumference': instance.hipCircumference, + 'blood_pressure_up': instance.bloodPressureUp, + 'blood_pressure_down': instance.bloodPressureDown, + 'has_hypo': instance.hasHypo, + 'has_hyper': instance.hasHyper, + 'about_alergy': instance.aboutAlergy, + 'about_taking_pils': instance.aboutTakingPils, + 'about_sport_hobbies': instance.aboutSportHobbies, + 'favorite_foods': instance.favoriteFoods, + 'unfavorite_foods': instance.unfavoriteFoods, + 'additional_info': instance.additionalInfo, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + 'is_mood_fillable': instance.isMoodFillable, + 'is_bedtime_fillable': instance.isBedtimeFillable, + 'activity_coefficient': instance.activityCoefficient, + }; diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart new file mode 100644 index 00000000..452c1895 --- /dev/null +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -0,0 +1,18 @@ +import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart'; +import 'package:eatvio_app/features/profile/repositories/profile_repository.dart'; + +class ProfileCubit extends Cubit { + final ProfileRepository profileRepository; + + ProfileCubit({required this.profileRepository}) : super(const ProfileState.loading()); + + getProfileBySlug(String slug) async { + try { + emit(ProfileState.loaded(profile: await profileRepository.getProfileBySlug(slug))); + } catch (e) { + emit(ProfileState.error(errorMessage: e.toString())); + print(e); + } + } +} diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart new file mode 100644 index 00000000..1b6ee5ad --- /dev/null +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart @@ -0,0 +1,19 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'profile_state.freezed.dart'; + +@freezed +abstract class ProfileState with _$ProfileState { + const factory ProfileState() = _ProfileState; + + const factory ProfileState.loading() = ProfileStateLoading; + + const factory ProfileState.loaded({ + required Profile profile, + }) = ProfileStateLoaded; + + const factory ProfileState.error({ + required String errorMessage, + }) = ProfileStateError; +} diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart new file mode 100644 index 00000000..f36c6545 --- /dev/null +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart @@ -0,0 +1,621 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'profile_state.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$ProfileState { + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(Profile profile) loaded, + required TResult Function(String errorMessage) error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(Profile profile)? loaded, + TResult? Function(String errorMessage)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(Profile profile)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map( + TResult Function(_ProfileState value) $default, { + required TResult Function(ProfileStateLoading value) loading, + required TResult Function(ProfileStateLoaded value) loaded, + required TResult Function(ProfileStateError value) error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ProfileState value)? $default, { + TResult? Function(ProfileStateLoading value)? loading, + TResult? Function(ProfileStateLoaded value)? loaded, + TResult? Function(ProfileStateError value)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ProfileState value)? $default, { + TResult Function(ProfileStateLoading value)? loading, + TResult Function(ProfileStateLoaded value)? loaded, + TResult Function(ProfileStateError value)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ProfileStateCopyWith<$Res> { + factory $ProfileStateCopyWith( + ProfileState value, $Res Function(ProfileState) then) = + _$ProfileStateCopyWithImpl<$Res, ProfileState>; +} + +/// @nodoc +class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> + implements $ProfileStateCopyWith<$Res> { + _$ProfileStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$ProfileStateImplCopyWith<$Res> { + factory _$$ProfileStateImplCopyWith( + _$ProfileStateImpl value, $Res Function(_$ProfileStateImpl) then) = + __$$ProfileStateImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ProfileStateImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateImpl> + implements _$$ProfileStateImplCopyWith<$Res> { + __$$ProfileStateImplCopyWithImpl( + _$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ProfileStateImpl implements _ProfileState { + const _$ProfileStateImpl(); + + @override + String toString() { + return 'ProfileState()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ProfileStateImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(Profile profile) loaded, + required TResult Function(String errorMessage) error, + }) { + return $default(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(Profile profile)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return $default?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(Profile profile)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if ($default != null) { + return $default(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_ProfileState value) $default, { + required TResult Function(ProfileStateLoading value) loading, + required TResult Function(ProfileStateLoaded value) loaded, + required TResult Function(ProfileStateError value) error, + }) { + return $default(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ProfileState value)? $default, { + TResult? Function(ProfileStateLoading value)? loading, + TResult? Function(ProfileStateLoaded value)? loaded, + TResult? Function(ProfileStateError value)? error, + }) { + return $default?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ProfileState value)? $default, { + TResult Function(ProfileStateLoading value)? loading, + TResult Function(ProfileStateLoaded value)? loaded, + TResult Function(ProfileStateError value)? error, + required TResult orElse(), + }) { + if ($default != null) { + return $default(this); + } + return orElse(); + } +} + +abstract class _ProfileState implements ProfileState { + const factory _ProfileState() = _$ProfileStateImpl; +} + +/// @nodoc +abstract class _$$ProfileStateLoadingImplCopyWith<$Res> { + factory _$$ProfileStateLoadingImplCopyWith(_$ProfileStateLoadingImpl value, + $Res Function(_$ProfileStateLoadingImpl) then) = + __$$ProfileStateLoadingImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ProfileStateLoadingImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadingImpl> + implements _$$ProfileStateLoadingImplCopyWith<$Res> { + __$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value, + $Res Function(_$ProfileStateLoadingImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ProfileStateLoadingImpl implements ProfileStateLoading { + const _$ProfileStateLoadingImpl(); + + @override + String toString() { + return 'ProfileState.loading()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileStateLoadingImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(Profile profile) loaded, + required TResult Function(String errorMessage) error, + }) { + return loading(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(Profile profile)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return loading?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(Profile profile)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_ProfileState value) $default, { + required TResult Function(ProfileStateLoading value) loading, + required TResult Function(ProfileStateLoaded value) loaded, + required TResult Function(ProfileStateError value) error, + }) { + return loading(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ProfileState value)? $default, { + TResult? Function(ProfileStateLoading value)? loading, + TResult? Function(ProfileStateLoaded value)? loaded, + TResult? Function(ProfileStateError value)? error, + }) { + return loading?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ProfileState value)? $default, { + TResult Function(ProfileStateLoading value)? loading, + TResult Function(ProfileStateLoaded value)? loaded, + TResult Function(ProfileStateError value)? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(this); + } + return orElse(); + } +} + +abstract class ProfileStateLoading implements ProfileState { + const factory ProfileStateLoading() = _$ProfileStateLoadingImpl; +} + +/// @nodoc +abstract class _$$ProfileStateLoadedImplCopyWith<$Res> { + factory _$$ProfileStateLoadedImplCopyWith(_$ProfileStateLoadedImpl value, + $Res Function(_$ProfileStateLoadedImpl) then) = + __$$ProfileStateLoadedImplCopyWithImpl<$Res>; + @useResult + $Res call({Profile profile}); + + $ProfileCopyWith<$Res> get profile; +} + +/// @nodoc +class __$$ProfileStateLoadedImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadedImpl> + implements _$$ProfileStateLoadedImplCopyWith<$Res> { + __$$ProfileStateLoadedImplCopyWithImpl(_$ProfileStateLoadedImpl _value, + $Res Function(_$ProfileStateLoadedImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? profile = null, + }) { + return _then(_$ProfileStateLoadedImpl( + profile: null == profile + ? _value.profile + : profile // ignore: cast_nullable_to_non_nullable + as Profile, + )); + } + + @override + @pragma('vm:prefer-inline') + $ProfileCopyWith<$Res> get profile { + return $ProfileCopyWith<$Res>(_value.profile, (value) { + return _then(_value.copyWith(profile: value)); + }); + } +} + +/// @nodoc + +class _$ProfileStateLoadedImpl implements ProfileStateLoaded { + const _$ProfileStateLoadedImpl({required this.profile}); + + @override + final Profile profile; + + @override + String toString() { + return 'ProfileState.loaded(profile: $profile)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileStateLoadedImpl && + (identical(other.profile, profile) || other.profile == profile)); + } + + @override + int get hashCode => Object.hash(runtimeType, profile); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => + __$$ProfileStateLoadedImplCopyWithImpl<_$ProfileStateLoadedImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(Profile profile) loaded, + required TResult Function(String errorMessage) error, + }) { + return loaded(profile); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(Profile profile)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return loaded?.call(profile); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(Profile profile)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (loaded != null) { + return loaded(profile); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_ProfileState value) $default, { + required TResult Function(ProfileStateLoading value) loading, + required TResult Function(ProfileStateLoaded value) loaded, + required TResult Function(ProfileStateError value) error, + }) { + return loaded(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ProfileState value)? $default, { + TResult? Function(ProfileStateLoading value)? loading, + TResult? Function(ProfileStateLoaded value)? loaded, + TResult? Function(ProfileStateError value)? error, + }) { + return loaded?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ProfileState value)? $default, { + TResult Function(ProfileStateLoading value)? loading, + TResult Function(ProfileStateLoaded value)? loaded, + TResult Function(ProfileStateError value)? error, + required TResult orElse(), + }) { + if (loaded != null) { + return loaded(this); + } + return orElse(); + } +} + +abstract class ProfileStateLoaded implements ProfileState { + const factory ProfileStateLoaded({required final Profile profile}) = + _$ProfileStateLoadedImpl; + + Profile get profile; + @JsonKey(ignore: true) + _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$ProfileStateErrorImplCopyWith<$Res> { + factory _$$ProfileStateErrorImplCopyWith(_$ProfileStateErrorImpl value, + $Res Function(_$ProfileStateErrorImpl) then) = + __$$ProfileStateErrorImplCopyWithImpl<$Res>; + @useResult + $Res call({String errorMessage}); +} + +/// @nodoc +class __$$ProfileStateErrorImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateErrorImpl> + implements _$$ProfileStateErrorImplCopyWith<$Res> { + __$$ProfileStateErrorImplCopyWithImpl(_$ProfileStateErrorImpl _value, + $Res Function(_$ProfileStateErrorImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? errorMessage = null, + }) { + return _then(_$ProfileStateErrorImpl( + errorMessage: null == errorMessage + ? _value.errorMessage + : errorMessage // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$ProfileStateErrorImpl implements ProfileStateError { + const _$ProfileStateErrorImpl({required this.errorMessage}); + + @override + final String errorMessage; + + @override + String toString() { + return 'ProfileState.error(errorMessage: $errorMessage)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileStateErrorImpl && + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); + } + + @override + int get hashCode => Object.hash(runtimeType, errorMessage); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => + __$$ProfileStateErrorImplCopyWithImpl<_$ProfileStateErrorImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(Profile profile) loaded, + required TResult Function(String errorMessage) error, + }) { + return error(errorMessage); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(Profile profile)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return error?.call(errorMessage); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(Profile profile)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(errorMessage); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_ProfileState value) $default, { + required TResult Function(ProfileStateLoading value) loading, + required TResult Function(ProfileStateLoaded value) loaded, + required TResult Function(ProfileStateError value) error, + }) { + return error(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ProfileState value)? $default, { + TResult? Function(ProfileStateLoading value)? loading, + TResult? Function(ProfileStateLoaded value)? loaded, + TResult? Function(ProfileStateError value)? error, + }) { + return error?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ProfileState value)? $default, { + TResult Function(ProfileStateLoading value)? loading, + TResult Function(ProfileStateLoaded value)? loaded, + TResult Function(ProfileStateError value)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(this); + } + return orElse(); + } +} + +abstract class ProfileStateError implements ProfileState { + const factory ProfileStateError({required final String errorMessage}) = + _$ProfileStateErrorImpl; + + String get errorMessage; + @JsonKey(ignore: true) + _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index bbfead98..d4cec48f 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -1,4 +1,8 @@ +import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; +import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; +import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart'; +import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; class ProfileScreen extends StatelessWidget { @@ -8,26 +12,58 @@ class ProfileScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(), - body: Column( - children: [ - CircleAvatar( - maxRadius: 128, - minRadius: 128, - backgroundImage: NetworkImage(author.authorProfileIcon), - ), - SizedBox(height: 32), - Text( - author.authorName, - style: TextStyle( - color: Colors.black, - fontSize: 24, - fontWeight: FontWeight.w400, - height: 1, - ), - ), - ], + return BlocProvider( + create: (BuildContext context) => sl()..getProfileBySlug(author.authorSlug), + child: BlocBuilder( + builder: (BuildContext context, ProfileState state) { + if (state is ProfileStateLoaded) { + return Scaffold( + appBar: AppBar( + centerTitle: true, + title: Text( + state.profile.user.name, + style: TextStyle( + color: Colors.black, + fontSize: 24, + fontWeight: FontWeight.w400, + height: 1, + ), + ), + ), + body: SingleChildScrollView( + padding: EdgeInsets.all(16), + child: Column( + children: [ + Center( + child: CircleAvatar( + maxRadius: 128, + minRadius: 128, + backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl), + ), + ), + ], + ), + ), + ); + } else if (state is ProfileStateError) { + return Scaffold( + appBar: AppBar(), + body: Center( + child: Padding( + padding: const EdgeInsets.all(16), + child: Text(state.errorMessage), + ), + ), + ); + } else { + return Scaffold( + appBar: AppBar(), + body: Center( + child: CircularProgressIndicator(), + ), + ); + } + }, ), ); } diff --git a/lib/features/profile/repositories/profile_repository.dart b/lib/features/profile/repositories/profile_repository.dart new file mode 100644 index 00000000..af15d704 --- /dev/null +++ b/lib/features/profile/repositories/profile_repository.dart @@ -0,0 +1,16 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/profile/services/profile_service.dart'; + +class ProfileRepository { + final ProfileService profileService; + + ProfileRepository({required this.profileService}); + + Future getProfileBySlug(String slug) async { + try { + return await profileService.getProfileBySlug(slug: slug); + } catch (e) { + rethrow; + } + } +} diff --git a/lib/features/profile/services/profile_service.dart b/lib/features/profile/services/profile_service.dart new file mode 100644 index 00000000..e9863ca2 --- /dev/null +++ b/lib/features/profile/services/profile_service.dart @@ -0,0 +1,15 @@ +import 'package:dio/dio.dart'; +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:retrofit/retrofit.dart'; + +part 'profile_service.g.dart'; + +@RestApi() +abstract class ProfileService { + factory ProfileService(Dio dio, {String baseUrl}) = _ProfileService; + + @GET('/api/profile/show/{slug}') + Future getProfileBySlug({ + @Path() required String slug, + }); +} diff --git a/lib/features/blog_post/services/blog_post_service.g.dart b/lib/features/profile/services/profile_service.g.dart similarity index 82% rename from lib/features/blog_post/services/blog_post_service.g.dart rename to lib/features/profile/services/profile_service.g.dart index 5ea30fcb..83b66e99 100644 --- a/lib/features/blog_post/services/blog_post_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'blog_post_service.dart'; +part of 'profile_service.dart'; // ************************************************************************** // RetrofitGenerator @@ -8,8 +8,8 @@ part of 'blog_post_service.dart'; // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element -class _BlogPostService implements BlogPostService { - _BlogPostService( +class _ProfileService implements ProfileService { + _ProfileService( this._dio, { this.baseUrl, }); @@ -19,20 +19,20 @@ class _BlogPostService implements BlogPostService { String? baseUrl; @override - Future getBlogPost(String id) async { + Future getProfileBySlug({required String slug}) async { final _extra = {}; 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}', + '/api/profile/show/${slug}', queryParameters: queryParameters, data: _data, ) @@ -41,7 +41,7 @@ class _BlogPostService implements BlogPostService { _dio.options.baseUrl, baseUrl, )))); - final _value = BlogPostModel.fromJson(_result.data!); + final _value = Profile.fromJson(_result.data!); return _value; } diff --git a/lib/features/recipes/presentation/pages/about_recipes_screen.dart b/lib/features/recipes/presentation/pages/about_recipes_screen.dart index d4e03b26..69c4d5b8 100644 --- a/lib/features/recipes/presentation/pages/about_recipes_screen.dart +++ b/lib/features/recipes/presentation/pages/about_recipes_screen.dart @@ -3,6 +3,7 @@ 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'; +import 'package:go_router/go_router.dart'; class AboutRecipesScreen extends StatelessWidget { final Recipes recipes; @@ -12,7 +13,37 @@ class AboutRecipesScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(), + appBar: AppBar( + actions: [ + InkWell( + borderRadius: BorderRadius.circular(16), + onTap: () => GoRouter.of(context).pushNamed('profileScreen', extra: recipes.author), + child: Ink( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CircleAvatar( + maxRadius: 16, + minRadius: 16, + backgroundImage: NetworkImage(recipes.author.authorProfileIcon), + ), + SizedBox(height: 4), + Text( + recipes.author.authorName, + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.w400, + height: 1, + ), + ), + ], + ), + ), + ), + ], + ), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/features/registration/models/location_model.dart b/lib/features/registration/models/location_model.dart index cc6b107e..01dbe06f 100644 --- a/lib/features/registration/models/location_model.dart +++ b/lib/features/registration/models/location_model.dart @@ -1,8 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; -part 'location_model.g.dart'; - part 'location_model.freezed.dart'; +part 'location_model.g.dart'; @freezed class LocationModel with _$LocationModel { 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/locator_service.dart b/lib/locator_service.dart index f08807e0..4e4f0a91 100644 --- a/lib/locator_service.dart +++ b/lib/locator_service.dart @@ -1,9 +1,6 @@ import 'package:dio/dio.dart'; import 'package:eatvio_app/core/constants/constants.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart'; -import 'package:eatvio_app/features/blog_post/presentation/bloc/blog_post_cubit.dart'; -import 'package:eatvio_app/features/blog_post/repositories/blog_post_repository.dart'; -import 'package:eatvio_app/features/blog_post/services/blog_post_service.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_cubit.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart'; import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_cubit.dart'; @@ -20,6 +17,9 @@ import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit 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/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; +import 'package:eatvio_app/features/profile/repositories/profile_repository.dart'; +import 'package:eatvio_app/features/profile/services/profile_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'; @@ -38,25 +38,25 @@ Future init() async { sl.registerFactory(() => FeedCubit(feedRepository: sl())); sl.registerFactory(() => RecipesCubit(feedRepository: sl())); sl.registerFactory(() => DietsCubit(feedRepository: sl())); - sl.registerFactory(() => BlogPostCubit(blogPostRepository: sl())); sl.registerFactory(() => DiaryBloc(diaryRepository: sl())); sl.registerFactory(() => CalendarCubit(calendarRepository: sl())); + sl.registerFactory(() => ProfileCubit(profileRepository: sl())); // Repository sl.registerLazySingleton(() => ChatRepository(chatService: sl())); sl.registerLazySingleton(() => FeedRepository(feedService: sl())); - sl.registerLazySingleton(() => BlogPostRepository(blogPostService: sl())); sl.registerLazySingleton(() => RegistrationRepository(registrationService: sl())); sl.registerLazySingleton(() => DiaryRepository(diaryService: sl())); sl.registerLazySingleton(() => CalendarRepository(calendarService: sl())); + sl.registerLazySingleton(() => ProfileRepository(profileService: sl())); // Services sl.registerLazySingleton(() => ChatService(sl())); sl.registerLazySingleton(() => FeedService(sl())); - sl.registerLazySingleton(() => BlogPostService(sl())); sl.registerLazySingleton(() => RegistrationService(sl())); sl.registerLazySingleton(() => DiaryService(sl())); sl.registerLazySingleton(() => CalendarService(sl())); + sl.registerLazySingleton(() => ProfileService(sl())); // External sl.registerLazySingleton( diff --git a/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_state.dart b/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_state.dart index 352daf75..78ed499f 100644 --- a/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_state.dart +++ b/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_state.dart @@ -182,4 +182,4 @@ class DiaryEditErrorState extends DiaryEditState { @override List get props => [errorMessage]; -}*/ \ No newline at end of file +}*/ diff --git a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart index 1ccb56c7..5237efb6 100644 --- a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart +++ b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart @@ -1250,4 +1250,4 @@ bool checkConsumedValues(List recommendedValues, List consumedValues) // Если ни одно потребленное значение не превышает рекомендованное с соответствующим индексом return false; // Возвращаем true } -*/ \ No newline at end of file +*/ diff --git a/lib/presentation/diary/diary_edit_screen/models/diary_edit_model.dart b/lib/presentation/diary/diary_edit_screen/models/diary_edit_model.dart index d37abbf4..5c58eff0 100644 --- a/lib/presentation/diary/diary_edit_screen/models/diary_edit_model.dart +++ b/lib/presentation/diary/diary_edit_screen/models/diary_edit_model.dart @@ -10,6 +10,7 @@ class DiaryEditModel extends Equatable { List mealList; List? portionList; + DiaryEditModel copyWith({ List? mealList, List? portionList, diff --git a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_state.dart b/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_state.dart index ab0d2ee3..4673ea13 100644 --- a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_state.dart +++ b/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_state.dart @@ -14,6 +14,7 @@ class DietEditState extends Equatable { @override List get props => [dietModelObj]; + DietEditState copyWith({DietEditModel? dietModelObj}) { return DietEditState( dietModelObj: dietModelObj ?? this.dietModelObj, @@ -35,8 +36,10 @@ class DietEditLoadedState extends DietEditState { TextEditingController? name; TextEditingController? details; TextEditingController? duration; + @override List get props => [dietModelObj, diet, name, details, duration]; + DietEditLoadedState copyWith({ DietEditModel? dietModelObj, Map? diet, 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 798b771c..fde96210 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 @@ -81,9 +81,9 @@ class BlogPostCreateBloc extends Bloc String url = baseUrl + '/api/blogPosts/create'; FormData formData = FormData.fromMap({ - 'title': title, - 'description': description, - 'youtube_url': youtubeURL, + 'title': title ?? '', + 'description': description ?? '', + 'youtube_url': youtubeURL ?? '', 'state': 'active', 'image': await MultipartFile.fromFile(image!.path, filename: image.name), }); diff --git a/lib/widgets/custom_edit_drop_down.dart b/lib/widgets/custom_edit_drop_down.dart index 26b42838..7f56bbd8 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,20 +85,14 @@ 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(), @@ -117,10 +111,7 @@ 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, @@ -132,10 +123,7 @@ 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 167c68e0..5678f3e4 100644 --- a/lib/widgets/custom_expandable_list.dart +++ b/lib/widgets/custom_expandable_list.dart @@ -247,10 +247,7 @@ 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), ), ); @@ -395,9 +392,11 @@ 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), @@ -422,17 +421,16 @@ 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'), ), + ], + ), ); }