From 01d6fea79049b96279555626a4a320d5e60580a5 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 30 Aug 2024 16:36:22 +0300 Subject: [PATCH 01/31] feat(profile): add blogPosts of user, charts --- .../presentation/pages/blog_post_screen.dart | 2 +- .../presentation/pages/about_diet_screen.dart | 3 +- lib/features/feed/models/comment_model.dart | 1 + .../feed/models/comment_model.freezed.dart | 53 ++++-- lib/features/feed/models/comment_model.g.dart | 2 + .../menu/presentation/pages/menu_screen.dart | 5 +- .../profile/models/profile_model.dart | 4 +- .../profile/models/profile_model.freezed.dart | 32 ++-- .../profile/models/profile_model.g.dart | 4 +- .../bloc/profile_cubit/profile_cubit.dart | 5 +- .../bloc/profile_cubit/profile_state.dart | 2 + .../profile_cubit/profile_state.freezed.dart | 88 +++++++--- .../presentation/pages/profile_screen.dart | 166 ++++++++++++++++-- .../widgets/circumference_chart_widget.dart | 124 ++++++++++--- .../widgets/imt_chart_widget.dart | 82 ++++++--- .../widgets/weight_chart_widget.dart | 117 ++++++++---- .../repositories/profile_repository.dart | 14 ++ .../profile/services/profile_service.dart | 6 + .../profile/services/profile_service.g.dart | 34 ++++ .../pages/about_recipes_screen.dart | 2 +- 20 files changed, 582 insertions(+), 164 deletions(-) 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 27d8901a..b2e827cf 100644 --- a/lib/features/blog_post/presentation/pages/blog_post_screen.dart +++ b/lib/features/blog_post/presentation/pages/blog_post_screen.dart @@ -381,7 +381,7 @@ class _BlogPostScreenState extends State { Row( children: [ Text( - widget.blogPost.createdAt.format('dd MMMM', 'ru'), + datum.createdAt.format('dd MMMM', 'ru'), style: TextStyle( color: Colors.grey.shade600, fontSize: 12, diff --git a/lib/features/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart index 42aa3bf4..643f6111 100644 --- a/lib/features/diets/presentation/pages/about_diet_screen.dart +++ b/lib/features/diets/presentation/pages/about_diet_screen.dart @@ -497,8 +497,7 @@ class _AboutDietScreenState extends State { Row( children: [ Text( - '99 августа', - // datum.createdAt.format('dd MMMM', 'ru'), + datum.createdAt.format('dd MMMM', 'ru'), style: TextStyle( color: Colors.grey.shade600, fontSize: 12, diff --git a/lib/features/feed/models/comment_model.dart b/lib/features/feed/models/comment_model.dart index 4c8aa268..52f163e4 100644 --- a/lib/features/feed/models/comment_model.dart +++ b/lib/features/feed/models/comment_model.dart @@ -22,6 +22,7 @@ class Datum with _$Datum { @JsonKey(name: "author_profile_icon") required String authorProfileIcon, @JsonKey(name: "body") required String body, @JsonKey(name: "children_comments") required List childrenComments, + @JsonKey(name: "created_at") required DateTime createdAt, }) = _Datum; factory Datum.fromJson(Map json) => _$DatumFromJson(json); diff --git a/lib/features/feed/models/comment_model.freezed.dart b/lib/features/feed/models/comment_model.freezed.dart index 3f088135..8e33c3bd 100644 --- a/lib/features/feed/models/comment_model.freezed.dart +++ b/lib/features/feed/models/comment_model.freezed.dart @@ -247,6 +247,8 @@ mixin _$Datum { String get body => throw _privateConstructorUsedError; @JsonKey(name: "children_comments") List get childrenComments => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") + DateTime get createdAt => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -263,7 +265,8 @@ abstract class $DatumCopyWith<$Res> { @JsonKey(name: "author_name") String authorName, @JsonKey(name: "author_profile_icon") String authorProfileIcon, @JsonKey(name: "body") String body, - @JsonKey(name: "children_comments") List childrenComments}); + @JsonKey(name: "children_comments") List childrenComments, + @JsonKey(name: "created_at") DateTime createdAt}); } /// @nodoc @@ -284,6 +287,7 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> Object? authorProfileIcon = null, Object? body = null, Object? childrenComments = null, + Object? createdAt = null, }) { return _then(_value.copyWith( id: null == id @@ -306,6 +310,10 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> ? _value.childrenComments : childrenComments // ignore: cast_nullable_to_non_nullable as List, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, ) as $Val); } } @@ -322,7 +330,8 @@ abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> { @JsonKey(name: "author_name") String authorName, @JsonKey(name: "author_profile_icon") String authorProfileIcon, @JsonKey(name: "body") String body, - @JsonKey(name: "children_comments") List childrenComments}); + @JsonKey(name: "children_comments") List childrenComments, + @JsonKey(name: "created_at") DateTime createdAt}); } /// @nodoc @@ -341,6 +350,7 @@ class __$$DatumImplCopyWithImpl<$Res> Object? authorProfileIcon = null, Object? body = null, Object? childrenComments = null, + Object? createdAt = null, }) { return _then(_$DatumImpl( id: null == id @@ -363,6 +373,10 @@ class __$$DatumImplCopyWithImpl<$Res> ? _value._childrenComments : childrenComments // ignore: cast_nullable_to_non_nullable as List, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, )); } } @@ -376,7 +390,8 @@ class _$DatumImpl implements _Datum { @JsonKey(name: "author_profile_icon") required this.authorProfileIcon, @JsonKey(name: "body") required this.body, @JsonKey(name: "children_comments") - required final List childrenComments}) + required final List childrenComments, + @JsonKey(name: "created_at") required this.createdAt}) : _childrenComments = childrenComments; factory _$DatumImpl.fromJson(Map json) => @@ -404,9 +419,13 @@ class _$DatumImpl implements _Datum { return EqualUnmodifiableListView(_childrenComments); } + @override + @JsonKey(name: "created_at") + final DateTime createdAt; + @override String toString() { - return 'Datum(id: $id, authorName: $authorName, authorProfileIcon: $authorProfileIcon, body: $body, childrenComments: $childrenComments)'; + return 'Datum(id: $id, authorName: $authorName, authorProfileIcon: $authorProfileIcon, body: $body, childrenComments: $childrenComments, createdAt: $createdAt)'; } @override @@ -421,7 +440,9 @@ class _$DatumImpl implements _Datum { other.authorProfileIcon == authorProfileIcon) && (identical(other.body, body) || other.body == body) && const DeepCollectionEquality() - .equals(other._childrenComments, _childrenComments)); + .equals(other._childrenComments, _childrenComments) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt)); } @JsonKey(ignore: true) @@ -432,7 +453,8 @@ class _$DatumImpl implements _Datum { authorName, authorProfileIcon, body, - const DeepCollectionEquality().hash(_childrenComments)); + const DeepCollectionEquality().hash(_childrenComments), + createdAt); @JsonKey(ignore: true) @override @@ -450,13 +472,15 @@ class _$DatumImpl implements _Datum { abstract class _Datum implements Datum { const factory _Datum( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "author_name") required final String authorName, - @JsonKey(name: "author_profile_icon") - required final String authorProfileIcon, - @JsonKey(name: "body") required final String body, - @JsonKey(name: "children_comments") - required final List childrenComments}) = _$DatumImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "author_name") required final String authorName, + @JsonKey(name: "author_profile_icon") + required final String authorProfileIcon, + @JsonKey(name: "body") required final String body, + @JsonKey(name: "children_comments") + required final List childrenComments, + @JsonKey(name: "created_at") required final DateTime createdAt}) = + _$DatumImpl; factory _Datum.fromJson(Map json) = _$DatumImpl.fromJson; @@ -476,6 +500,9 @@ abstract class _Datum implements Datum { @JsonKey(name: "children_comments") List get childrenComments; @override + @JsonKey(name: "created_at") + DateTime get createdAt; + @override @JsonKey(ignore: true) _$$DatumImplCopyWith<_$DatumImpl> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/features/feed/models/comment_model.g.dart b/lib/features/feed/models/comment_model.g.dart index ef471dc6..0c92d582 100644 --- a/lib/features/feed/models/comment_model.g.dart +++ b/lib/features/feed/models/comment_model.g.dart @@ -30,6 +30,7 @@ _$DatumImpl _$$DatumImplFromJson(Map json) => _$DatumImpl( childrenComments: (json['children_comments'] as List) .map((e) => Datum.fromJson(e as Map)) .toList(), + createdAt: DateTime.parse(json['created_at'] as String), ); Map _$$DatumImplToJson(_$DatumImpl instance) => @@ -39,6 +40,7 @@ Map _$$DatumImplToJson(_$DatumImpl instance) => 'author_profile_icon': instance.authorProfileIcon, 'body': instance.body, 'children_comments': instance.childrenComments, + 'created_at': instance.createdAt.toIso8601String(), }; _$LinksImpl _$$LinksImplFromJson(Map json) => _$LinksImpl( diff --git a/lib/features/menu/presentation/pages/menu_screen.dart b/lib/features/menu/presentation/pages/menu_screen.dart index 010bf6d3..6f46ac9c 100644 --- a/lib/features/menu/presentation/pages/menu_screen.dart +++ b/lib/features/menu/presentation/pages/menu_screen.dart @@ -1,7 +1,6 @@ import 'package:dio/dio.dart'; -import 'package:eatvio_app/core/constants/constants.dart'; +import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -14,6 +13,7 @@ class MenuScreen extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( + centerTitle: false, title: Text('Меню'), ), body: SingleChildScrollView( @@ -83,6 +83,7 @@ class MenuScreen extends StatelessWidget { leading, height: 24, width: 24, + colorFilter: ColorFilter.mode(appTheme.blueA400, BlendMode.srcIn), ), title: Text(title), trailing: Icon( diff --git a/lib/features/profile/models/profile_model.dart b/lib/features/profile/models/profile_model.dart index 6c72a1fa..62dfc065 100644 --- a/lib/features/profile/models/profile_model.dart +++ b/lib/features/profile/models/profile_model.dart @@ -100,8 +100,8 @@ class ChartPoint with _$ChartPoint { const factory ChartPoint({ @JsonKey(name: "id") required int id, @JsonKey(name: "user_id") required int userId, - @JsonKey(name: "weight") required int weight, - @JsonKey(name: "bmi") required String bmi, + @JsonKey(name: "weight") required double weight, + @JsonKey(name: "bmi") required double bmi, @JsonKey(name: "created_at") required DateTime createdAt, @JsonKey(name: "updated_at") required DateTime updatedAt, }) = _ChartPoint; diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index 0e5607b4..21954c15 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -2121,9 +2121,9 @@ mixin _$ChartPoint { @JsonKey(name: "user_id") int get userId => throw _privateConstructorUsedError; @JsonKey(name: "weight") - int get weight => throw _privateConstructorUsedError; + double get weight => throw _privateConstructorUsedError; @JsonKey(name: "bmi") - String get bmi => throw _privateConstructorUsedError; + double get bmi => throw _privateConstructorUsedError; @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; @JsonKey(name: "updated_at") @@ -2144,8 +2144,8 @@ abstract class $ChartPointCopyWith<$Res> { $Res call( {@JsonKey(name: "id") int id, @JsonKey(name: "user_id") int userId, - @JsonKey(name: "weight") int weight, - @JsonKey(name: "bmi") String bmi, + @JsonKey(name: "weight") double weight, + @JsonKey(name: "bmi") double bmi, @JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "updated_at") DateTime updatedAt}); } @@ -2182,11 +2182,11 @@ class _$ChartPointCopyWithImpl<$Res, $Val extends ChartPoint> weight: null == weight ? _value.weight : weight // ignore: cast_nullable_to_non_nullable - as int, + as double, bmi: null == bmi ? _value.bmi : bmi // ignore: cast_nullable_to_non_nullable - as String, + as double, createdAt: null == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -2210,8 +2210,8 @@ abstract class _$$ChartPointImplCopyWith<$Res> $Res call( {@JsonKey(name: "id") int id, @JsonKey(name: "user_id") int userId, - @JsonKey(name: "weight") int weight, - @JsonKey(name: "bmi") String bmi, + @JsonKey(name: "weight") double weight, + @JsonKey(name: "bmi") double bmi, @JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "updated_at") DateTime updatedAt}); } @@ -2246,11 +2246,11 @@ class __$$ChartPointImplCopyWithImpl<$Res> weight: null == weight ? _value.weight : weight // ignore: cast_nullable_to_non_nullable - as int, + as double, bmi: null == bmi ? _value.bmi : bmi // ignore: cast_nullable_to_non_nullable - as String, + as double, createdAt: null == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -2285,10 +2285,10 @@ class _$ChartPointImpl implements _ChartPoint { final int userId; @override @JsonKey(name: "weight") - final int weight; + final double weight; @override @JsonKey(name: "bmi") - final String bmi; + final double bmi; @override @JsonKey(name: "created_at") final DateTime createdAt; @@ -2339,8 +2339,8 @@ abstract class _ChartPoint implements ChartPoint { const factory _ChartPoint( {@JsonKey(name: "id") required final int id, @JsonKey(name: "user_id") required final int userId, - @JsonKey(name: "weight") required final int weight, - @JsonKey(name: "bmi") required final String bmi, + @JsonKey(name: "weight") required final double weight, + @JsonKey(name: "bmi") required final double bmi, @JsonKey(name: "created_at") required final DateTime createdAt, @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$ChartPointImpl; @@ -2356,10 +2356,10 @@ abstract class _ChartPoint implements ChartPoint { int get userId; @override @JsonKey(name: "weight") - int get weight; + double get weight; @override @JsonKey(name: "bmi") - String get bmi; + double get bmi; @override @JsonKey(name: "created_at") DateTime get createdAt; diff --git a/lib/features/profile/models/profile_model.g.dart b/lib/features/profile/models/profile_model.g.dart index af1c1c4d..020ffca1 100644 --- a/lib/features/profile/models/profile_model.g.dart +++ b/lib/features/profile/models/profile_model.g.dart @@ -168,8 +168,8 @@ _$ChartPointImpl _$$ChartPointImplFromJson(Map json) => _$ChartPointImpl( id: (json['id'] as num).toInt(), userId: (json['user_id'] as num).toInt(), - weight: (json['weight'] as num).toInt(), - bmi: json['bmi'] as String, + weight: (json['weight'] as num).toDouble(), + bmi: (json['bmi'] as num).toDouble(), createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), ); diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index 0a08e8de..d36ff4d5 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -13,6 +13,7 @@ class ProfileCubit extends Cubit { try { emit(ProfileState.loaded( profile: await profileRepository.getProfileBySlug(slug), + blogPosts: await profileRepository.getBlogPostsByAuthorSlug(slug: slug), )); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); @@ -22,8 +23,10 @@ class ProfileCubit extends Cubit { getMyProfile() async { try { + final myProfile = await profileRepository.getMyProfile(); emit(ProfileState.loaded( - profile: await profileRepository.getMyProfile(), + profile: myProfile, + blogPosts: await profileRepository.getBlogPostsByAuthorSlug(slug: myProfile.user.slug), )); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart index 1f06bfe4..f9f4eed1 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart @@ -1,3 +1,4 @@ +import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; @@ -11,6 +12,7 @@ abstract class ProfileState with _$ProfileState { const factory ProfileState.loaded({ required ProfileModel profile, + required List blogPosts, }) = ProfileStateLoaded; const factory ProfileState.error({ diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart index 2658d2e2..dbc10dfd 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart @@ -20,7 +20,9 @@ mixin _$ProfileState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile) loaded, + required TResult Function( + ProfileModel profile, List blogPosts) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; @@ -28,7 +30,8 @@ mixin _$ProfileState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile)? loaded, + TResult? Function(ProfileModel profile, List blogPosts)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -36,7 +39,8 @@ mixin _$ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile)? loaded, + TResult Function(ProfileModel profile, List blogPosts)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -126,7 +130,9 @@ class _$ProfileStateImpl implements _ProfileState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile) loaded, + required TResult Function( + ProfileModel profile, List blogPosts) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -137,7 +143,8 @@ class _$ProfileStateImpl implements _ProfileState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile)? loaded, + TResult? Function(ProfileModel profile, List blogPosts)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -148,7 +155,8 @@ class _$ProfileStateImpl implements _ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile)? loaded, + TResult Function(ProfileModel profile, List blogPosts)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -241,7 +249,9 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile) loaded, + required TResult Function( + ProfileModel profile, List blogPosts) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -252,7 +262,8 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile)? loaded, + TResult? Function(ProfileModel profile, List blogPosts)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -263,7 +274,8 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile)? loaded, + TResult Function(ProfileModel profile, List blogPosts)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -321,7 +333,7 @@ abstract class _$$ProfileStateLoadedImplCopyWith<$Res> { $Res Function(_$ProfileStateLoadedImpl) then) = __$$ProfileStateLoadedImplCopyWithImpl<$Res>; @useResult - $Res call({ProfileModel profile}); + $Res call({ProfileModel profile, List blogPosts}); $ProfileModelCopyWith<$Res> get profile; } @@ -338,12 +350,17 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> @override $Res call({ Object? profile = null, + Object? blogPosts = null, }) { return _then(_$ProfileStateLoadedImpl( profile: null == profile ? _value.profile : profile // ignore: cast_nullable_to_non_nullable as ProfileModel, + blogPosts: null == blogPosts + ? _value._blogPosts + : blogPosts // ignore: cast_nullable_to_non_nullable + as List, )); } @@ -359,14 +376,23 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$ProfileStateLoadedImpl implements ProfileStateLoaded { - const _$ProfileStateLoadedImpl({required this.profile}); + const _$ProfileStateLoadedImpl( + {required this.profile, required final List blogPosts}) + : _blogPosts = blogPosts; @override final ProfileModel profile; + final List _blogPosts; + @override + List get blogPosts { + if (_blogPosts is EqualUnmodifiableListView) return _blogPosts; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_blogPosts); + } @override String toString() { - return 'ProfileState.loaded(profile: $profile)'; + return 'ProfileState.loaded(profile: $profile, blogPosts: $blogPosts)'; } @override @@ -374,11 +400,14 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileStateLoadedImpl && - (identical(other.profile, profile) || other.profile == profile)); + (identical(other.profile, profile) || other.profile == profile) && + const DeepCollectionEquality() + .equals(other._blogPosts, _blogPosts)); } @override - int get hashCode => Object.hash(runtimeType, profile); + int get hashCode => Object.hash( + runtimeType, profile, const DeepCollectionEquality().hash(_blogPosts)); @JsonKey(ignore: true) @override @@ -392,10 +421,12 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile) loaded, + required TResult Function( + ProfileModel profile, List blogPosts) + loaded, required TResult Function(String errorMessage) error, }) { - return loaded(profile); + return loaded(profile, blogPosts); } @override @@ -403,10 +434,11 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile)? loaded, + TResult? Function(ProfileModel profile, List blogPosts)? + loaded, TResult? Function(String errorMessage)? error, }) { - return loaded?.call(profile); + return loaded?.call(profile, blogPosts); } @override @@ -414,12 +446,13 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile)? loaded, + TResult Function(ProfileModel profile, List blogPosts)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { if (loaded != null) { - return loaded(profile); + return loaded(profile, blogPosts); } return orElse(); } @@ -463,10 +496,13 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { } abstract class ProfileStateLoaded implements ProfileState { - const factory ProfileStateLoaded({required final ProfileModel profile}) = + const factory ProfileStateLoaded( + {required final ProfileModel profile, + required final List blogPosts}) = _$ProfileStateLoadedImpl; ProfileModel get profile; + List get blogPosts; @JsonKey(ignore: true) _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; @@ -540,7 +576,9 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile) loaded, + required TResult Function( + ProfileModel profile, List blogPosts) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -551,7 +589,8 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile)? loaded, + TResult? Function(ProfileModel profile, List blogPosts)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -562,7 +601,8 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile)? loaded, + TResult Function(ProfileModel profile, List blogPosts)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index e9e37c56..f85417fa 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -1,5 +1,6 @@ import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; +import 'package:eatvio_app/features/feed/presentation/widgets/blog_post_widget.dart'; import 'package:eatvio_app/features/profile/models/profile_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'; @@ -21,6 +22,10 @@ class ProfileScreen extends StatefulWidget { class _ProfileScreenState extends State { List chartData = []; List chartPoints = []; + final List chipsLabelList = ['Вес', 'Замеры', 'ИМТ']; + final List chipsIntervalLabelList = ['1М', '3М', '6М', '1Г', 'ВСЁ ВРЕМЯ']; + int _selectedChipIndex = 0; + int _selectedIntervalChipIndex = 0; @override Widget build(BuildContext context) { @@ -37,23 +42,111 @@ class _ProfileScreenState extends State { chartData = state.profile.circumferences; chartPoints = state.profile.chartPoints; return Scaffold( - appBar: AppBar( - toolbarHeight: 0, - ), + backgroundColor: Colors.grey.shade200, + appBar: widget.author == null ? AppBar(toolbarHeight: 0) : AppBar(), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: const EdgeInsets.only(left: 16, bottom: 32), - child: CircleAvatar( - radius: 32, - backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl), + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical(bottom: Radius.circular(16)), + color: Colors.white, + ), + child: Row( + children: [ + CircleAvatar( + radius: 32, + backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl), + ), + const SizedBox(width: 12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + state.profile.user.name, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.w500, + height: 1, + ), + ), + if (state.profile.userDetails.additionalInfo.isNotEmpty) + Text( + state.profile.userDetails.additionalInfo, + style: TextStyle( + color: Colors.black.withOpacity(0.4), + height: 1, + ), + ), + ], + ), + ], ), ), - CircumferenceChartWidget(chartData: chartData), - WeightChartWidget(chartPoints: chartPoints), - ImtChartWidget(chartPoints: chartPoints), + if (widget.author == null) SizedBox(height: 8), + if (widget.author == null) + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + color: Colors.white, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 8), + SingleChildScrollView( + padding: EdgeInsets.symmetric(horizontal: 16), + scrollDirection: Axis.horizontal, + child: Row( + children: [ + _choiceChipWidget(0), + SizedBox(width: 8), + _choiceChipWidget(1), + SizedBox(width: 8), + _choiceChipWidget(2), + ], + ), + ), + Builder( + builder: (context) { + if (_selectedChipIndex == 0) return WeightChartWidget(chartPoints: chartPoints); + if (_selectedChipIndex == 1) return CircumferenceChartWidget(chartData: chartData); + if (_selectedChipIndex == 2) + return ImtChartWidget(chartPoints: chartPoints); + else + return Container(); + }, + ), + SizedBox(height: 8), + Row( + children: [ + SizedBox(width: 16), + _choiceIntervalChipWidget(0), + SizedBox(width: 8), + _choiceIntervalChipWidget(1), + SizedBox(width: 8), + _choiceIntervalChipWidget(2), + SizedBox(width: 8), + _choiceIntervalChipWidget(3), + SizedBox(width: 8), + _choiceIntervalChipWidget(4), + ], + ), + SizedBox(height: 8), + ], + ), + ), + SizedBox(height: 16), + ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) => BlogPostWidget(feedBlogPostModel: state.blogPosts[index]), + separatorBuilder: (context, index) => SizedBox(height: 8), + itemCount: state.blogPosts.length, + ), + SizedBox(height: 16), ], ), ), @@ -80,4 +173,55 @@ class _ProfileScreenState extends State { ), ); } + + _choiceIntervalChipWidget(int index) { + return ChoiceChip( + selectedColor: Colors.grey.withOpacity(0.1), + pressElevation: 0, + showCheckmark: false, + side: BorderSide.none, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + label: Text(chipsIntervalLabelList[index]), + labelStyle: TextStyle( + color: appTheme.gray600, + fontWeight: FontWeight.w500, + fontSize: 12, + ), + selected: _selectedIntervalChipIndex == index, + onSelected: (bool selected) { + setState(() { + _selectedIntervalChipIndex = index; + }); + }, + ); + } + + _choiceChipWidget(int index) { + return ChoiceChip( + selectedColor: appTheme.blueA400, + pressElevation: 0, + showCheckmark: false, + side: BorderSide.none, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + label: Text(chipsLabelList[index]), + labelStyle: TextStyle( + color: index == _selectedChipIndex ? Colors.white : appTheme.gray600, + fontWeight: FontWeight.w500, + fontSize: 12, + ), + selected: _selectedChipIndex == index, + backgroundColor: appTheme.gray100, + onSelected: (bool selected) { + setState(() { + _selectedChipIndex = index; + }); + }, + ); + } } diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index a4a6af7a..f4849df1 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -1,7 +1,7 @@ import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:flutter/material.dart'; -import 'package:syncfusion_flutter_charts/charts.dart'; import 'package:intl/intl.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; class CircumferenceChartWidget extends StatelessWidget { final List chartData; @@ -13,35 +13,103 @@ class CircumferenceChartWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return SfCartesianChart( - margin: EdgeInsets.zero, - enableAxisAnimation: true, - enableSideBySideSeriesPlacement: true, - legend: const Legend( - isVisible: true, - opacity: 0.7, - position: LegendPosition.bottom, - ), - plotAreaBorderWidth: 0, - trackballBehavior: TrackballBehavior( - enable: true, - activationMode: ActivationMode.singleTap, - ), - primaryXAxis: DateTimeAxis( - dateFormat: DateFormat.MMMd('ru'), - axisLine: AxisLine( - width: 1, + return Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Text( + 'Грудь ${chartData.last.chestCircumference} см', + style: TextStyle( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + chartData.last.chestCircumference > chartData[chartData.length - 2].chestCircumference + ? Icon( + Icons.arrow_drop_up, + size: 18, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 18, + color: Colors.grey, + ), + Text( + 'Талия ${chartData.last.waistCircumference} см', + style: TextStyle( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + chartData.last.waistCircumference > chartData[chartData.length - 2].waistCircumference + ? Icon( + Icons.arrow_drop_up, + size: 18, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 18, + color: Colors.grey, + ), + Text( + 'Бёдра ${chartData.last.hipCircumference} см', + style: TextStyle( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + chartData.last.hipCircumference > chartData[chartData.length - 2].hipCircumference + ? Icon( + Icons.arrow_drop_up, + size: 18, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 18, + color: Colors.grey, + ), + ], + ), ), - ), - primaryYAxis: NumericAxis( - labelFormat: '{value} см', - axisLine: AxisLine( - width: 1, + SfCartesianChart( + margin: EdgeInsets.zero, + enableAxisAnimation: true, + enableSideBySideSeriesPlacement: true, + legend: const Legend( + isVisible: true, + opacity: 0.7, + position: LegendPosition.bottom, + ), + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + ), + primaryXAxis: DateTimeCategoryAxis( + dateFormat: DateFormat.MMMd('ru'), + axisLine: AxisLine( + width: 1, + ), + ), + primaryYAxis: NumericAxis( + labelFormat: '{value} см', + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), ), - majorTickLines: MajorTickLines(size: 0), - ), - series: _getSplineSeries(), - tooltipBehavior: TooltipBehavior(enable: true), + ], ); } diff --git a/lib/features/profile/presentation/widgets/imt_chart_widget.dart b/lib/features/profile/presentation/widgets/imt_chart_widget.dart index 275a5810..0dc06899 100644 --- a/lib/features/profile/presentation/widgets/imt_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/imt_chart_widget.dart @@ -13,35 +13,61 @@ class ImtChartWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return SfCartesianChart( - margin: EdgeInsets.zero, - enableAxisAnimation: true, - enableSideBySideSeriesPlacement: true, - legend: const Legend( - isVisible: true, - opacity: 0.7, - position: LegendPosition.bottom, - ), - plotAreaBorderWidth: 0, - trackballBehavior: TrackballBehavior( - enable: true, - activationMode: ActivationMode.singleTap, - ), - primaryXAxis: DateTimeAxis( - dateFormat: DateFormat.MMMd('ru'), - axisLine: AxisLine( - width: 1, + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Text( + '${chartPoints.last.bmi.toStringAsFixed(2)} кг/м²', + style: TextStyle( + color: Colors.black, + fontSize: 48, + fontWeight: FontWeight.w500, + ), + ), + chartPoints.last.bmi > chartPoints[chartPoints.length - 2].bmi + ? Icon( + Icons.arrow_drop_up, + size: 48, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 48, + color: Colors.grey, + ), + ], + ), ), - ), - primaryYAxis: NumericAxis( - labelFormat: '{value} кг', - axisLine: AxisLine( - width: 1, + SfCartesianChart( + margin: EdgeInsets.zero, + enableAxisAnimation: true, + enableSideBySideSeriesPlacement: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + ), + primaryXAxis: DateTimeCategoryAxis( + dateFormat: DateFormat.MMMd('ru'), + axisLine: AxisLine( + width: 1, + ), + ), + primaryYAxis: NumericAxis( + labelFormat: '{value} кг/м²', + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), ), - majorTickLines: MajorTickLines(size: 0), - ), - series: _getSplineSeries(), - tooltipBehavior: TooltipBehavior(enable: true), + ], ); } @@ -62,7 +88,7 @@ class ImtChartWidget extends StatelessWidget { color: Colors.blue, name: 'ИМТ', xValueMapper: (ProfileModel.ChartPoint value, int index) => value.createdAt, - yValueMapper: (ProfileModel.ChartPoint value, int index) => double.parse(value.bmi), + yValueMapper: (ProfileModel.ChartPoint value, int index) => value.bmi, ), ]; } diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index eabad3ec..f799cc0d 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -1,7 +1,8 @@ +import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart' as ProfileModel; import 'package:flutter/material.dart'; -import 'package:syncfusion_flutter_charts/charts.dart'; import 'package:intl/intl.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; class WeightChartWidget extends StatelessWidget { final List chartPoints; @@ -13,53 +14,103 @@ class WeightChartWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return SfCartesianChart( - margin: EdgeInsets.zero, - enableAxisAnimation: true, - enableSideBySideSeriesPlacement: true, - legend: const Legend( - isVisible: true, - opacity: 0.7, - position: LegendPosition.bottom, - ), - plotAreaBorderWidth: 0, - trackballBehavior: TrackballBehavior( - enable: true, - activationMode: ActivationMode.singleTap, - ), - primaryXAxis: DateTimeAxis( - dateFormat: DateFormat.MMMd('ru'), - axisLine: AxisLine( - width: 1, + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Text( + '${chartPoints.last.weight} кг', + style: TextStyle( + color: Colors.black, + fontSize: 48, + fontWeight: FontWeight.w500, + ), + ), + chartPoints.last.weight > chartPoints[chartPoints.length - 2].weight + ? Icon( + Icons.arrow_drop_up, + size: 48, + color: Colors.grey.withOpacity(0.4), + ) + : Icon( + Icons.arrow_drop_down, + size: 48, + color: Colors.grey.withOpacity(0.4), + ), + ], + ), ), - ), - primaryYAxis: NumericAxis( - labelFormat: '{value} кг', - axisLine: AxisLine( - width: 1, + SfCartesianChart( + margin: EdgeInsets.symmetric(horizontal: 8), + enableAxisAnimation: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, + ), + primaryXAxis: DateTimeCategoryAxis( + initialVisibleMinimum: chartPoints.first.createdAt, + initialVisibleMaximum: chartPoints.last.createdAt, + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, + dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + axisLine: AxisLine( + color: Colors.grey.withOpacity(0.3), + width: 0.4, + ), + ), + primaryYAxis: NumericAxis( + isVisible: false, + labelFormat: '{value} кг', + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), ), - majorTickLines: MajorTickLines(size: 0), - ), - series: _getSplineSeries(), - tooltipBehavior: TooltipBehavior(enable: true), + ], ); } List> _getSplineSeries() { return >[ - SplineSeries( + SplineAreaSeries( markerSettings: MarkerSettings( isVisible: true, - color: Colors.blue, - height: 12, - width: 12, + color: appTheme.blueA400, + height: 8, + width: 8, ), dataLabelSettings: DataLabelSettings( labelAlignment: ChartDataLabelAlignment.top, isVisible: true, ), dataSource: chartPoints, - color: Colors.blue, + borderColor: appTheme.blueA400, + gradient: LinearGradient( + colors: [ + appTheme.blueA400.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), name: 'Вес', xValueMapper: (ProfileModel.ChartPoint value, int index) => value.createdAt, yValueMapper: (ProfileModel.ChartPoint value, int index) => value.weight, diff --git a/lib/features/profile/repositories/profile_repository.dart b/lib/features/profile/repositories/profile_repository.dart index e859c8d6..d03e39d8 100644 --- a/lib/features/profile/repositories/profile_repository.dart +++ b/lib/features/profile/repositories/profile_repository.dart @@ -1,3 +1,4 @@ +import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:eatvio_app/features/profile/services/profile_service.dart'; @@ -53,4 +54,17 @@ class ProfileRepository { rethrow; } } + + Future> getBlogPostsByAuthorSlug({ + required String slug, + }) async { + try { + return (await profileService.getBlogPostByAuthorSlug( + slug: slug, + )) + .feedBlogPostList; + } catch (e) { + rethrow; + } + } } diff --git a/lib/features/profile/services/profile_service.dart b/lib/features/profile/services/profile_service.dart index 9966a82d..2ec6cee0 100644 --- a/lib/features/profile/services/profile_service.dart +++ b/lib/features/profile/services/profile_service.dart @@ -1,4 +1,5 @@ import 'package:dio/dio.dart'; +import 'package:eatvio_app/features/feed/models/feed_blog_post_settings_model.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:retrofit/retrofit.dart'; @@ -27,4 +28,9 @@ abstract class ProfileService { Future> addWeight({ @Part() required int weight, }); + + @GET('/api/blogPosts/search_by_author/{slug}') + Future getBlogPostByAuthorSlug({ + @Path() required String slug, + }); } diff --git a/lib/features/profile/services/profile_service.g.dart b/lib/features/profile/services/profile_service.g.dart index 96b65b4d..ab9461bf 100644 --- a/lib/features/profile/services/profile_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -175,6 +175,40 @@ class _ProfileService implements ProfileService { return _value; } + @override + Future getBlogPostByAuthorSlug( + {required String slug}) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/blogPosts/search_by_author/${slug}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late FeedBlogPostSettingsModel _value; + try { + _value = FeedBlogPostSettingsModel.fromJson(_result.data!); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + RequestOptions _setStreamType(RequestOptions requestOptions) { if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || diff --git a/lib/features/recipes/presentation/pages/about_recipes_screen.dart b/lib/features/recipes/presentation/pages/about_recipes_screen.dart index 6955aa72..fdb23673 100644 --- a/lib/features/recipes/presentation/pages/about_recipes_screen.dart +++ b/lib/features/recipes/presentation/pages/about_recipes_screen.dart @@ -455,7 +455,7 @@ class _AboutRecipesScreenState extends State { Row( children: [ Text( - widget.recipes.createdAt.format('dd MMMM', 'ru'), + datum.createdAt.format('dd MMMM', 'ru'), style: TextStyle( color: Colors.grey.shade600, fontSize: 12, From 5a651cad9ec357c37908fa6ac24b0f87f15c0562 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 2 Sep 2024 16:12:13 +0300 Subject: [PATCH 02/31] =?UTF-8?q?feat(=D0=9B=D0=B5=D0=BD=D1=82=D0=B0):=20?= =?UTF-8?q?=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0=D1=86=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=80=D0=B5=D1=86=D0=B5=D0=BF=D1=82=D0=BE=D0=B2=20=D0=BF=D0=BE?= =?UTF-8?q?=20=D1=82=D0=B5=D0=B3=D0=B0=D0=BC,=20=D0=BF=D0=BE=D0=B8=D1=81?= =?UTF-8?q?=D0=BA=20=D0=BF=D0=BE=20=D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/features/recipes/models/recipe_tag.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/features/recipes/models/recipe_tag.dart diff --git a/lib/features/recipes/models/recipe_tag.dart b/lib/features/recipes/models/recipe_tag.dart new file mode 100644 index 00000000..e69de29b From 334a6b097096a5169f78e77cb381fb5ca6396a7a Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 2 Sep 2024 16:12:54 +0300 Subject: [PATCH 03/31] =?UTF-8?q?feat(=D0=9B=D0=B5=D0=BD=D1=82=D0=B0):=20?= =?UTF-8?q?=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0=D1=86=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=80=D0=B5=D1=86=D0=B5=D0=BF=D1=82=D0=BE=D0=B2=20=D0=BF=D0=BE?= =?UTF-8?q?=20=D1=82=D0=B5=D0=B3=D0=B0=D0=BC,=20=D0=BF=D0=BE=D0=B8=D1=81?= =?UTF-8?q?=D0=BA=20=D0=BF=D0=BE=20=D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/app_router.dart | 2 +- lib/core/models/base_models.dart | 43 + lib/core/models/base_models.freezed.dart | 721 ++++++++++++++ lib/core/models/base_models.g.dart | 60 ++ .../presentation/pages/blog_post_screen.dart | 32 +- .../presentation/pages/about_diet_screen.dart | 52 +- lib/features/feed/models/comment_model.dart | 60 +- .../feed/models/comment_model.freezed.dart | 886 ++--------------- lib/features/feed/models/comment_model.g.dart | 68 +- .../feed/models/diets_pagination_model.dart | 60 +- .../diets_pagination_model.freezed.dart | 887 ++---------------- .../feed/models/diets_pagination_model.g.dart | 66 +- .../models/feed_blog_post_settings_model.dart | 2 +- .../bloc/comments_cubit/comments_state.dart | 2 +- .../comments_state.freezed.dart | 46 +- .../bloc/recipes_cubit/recipes_cubit.dart | 37 +- .../bloc/recipes_cubit/recipes_state.dart | 4 + .../recipes_cubit/recipes_state.freezed.dart | 159 +++- .../feed/presentation/pages/feed_screen.dart | 65 +- .../presentation/widgets/diets_widget.dart | 20 +- .../widgets/tags_modal_widget.dart | 65 ++ .../feed/repositories/feed_repository.dart | 17 +- lib/features/feed/services/feed_service.dart | 11 +- .../feed/services/feed_service.g.dart | 35 +- .../profile/models/profile_model.dart | 10 +- .../profile/models/profile_model.freezed.dart | 97 +- .../profile/models/profile_model.g.dart | 10 +- .../presentation/pages/profile_screen.dart | 174 ++-- .../widgets/circumference_chart_widget.dart | 105 ++- .../widgets/imt_chart_widget.dart | 73 +- .../widgets/weight_chart_widget.dart | 16 +- .../repositories/profile_repository.dart | 2 +- .../profile/services/profile_service.dart | 2 +- .../profile/services/profile_service.g.dart | 8 +- lib/features/recipes/models/recipe_tag.dart | 0 .../recipes/models/recipe_tag_model.dart | 28 + .../models/recipe_tag_model.freezed.dart | 451 +++++++++ .../recipes/models/recipe_tag_model.g.dart | 40 + .../pages/about_recipes_screen.dart | 16 +- .../reporitories/recipe_repository.dart | 9 + .../recipes/services/recipe_service.dart | 4 + .../recipes/services/recipe_service.g.dart | 33 + lib/locator_service.dart | 2 +- 43 files changed, 2320 insertions(+), 2160 deletions(-) create mode 100644 lib/core/models/base_models.dart create mode 100644 lib/core/models/base_models.freezed.dart create mode 100644 lib/core/models/base_models.g.dart create mode 100644 lib/features/feed/presentation/widgets/tags_modal_widget.dart delete mode 100644 lib/features/recipes/models/recipe_tag.dart create mode 100644 lib/features/recipes/models/recipe_tag_model.dart create mode 100644 lib/features/recipes/models/recipe_tag_model.freezed.dart create mode 100644 lib/features/recipes/models/recipe_tag_model.g.dart diff --git a/lib/app_router.dart b/lib/app_router.dart index f872ddc9..9b5b46de 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -133,7 +133,7 @@ class AppRouter { path: '/about-diet-screen', name: 'aboutDietScreen', builder: (context, state) => AboutDietScreen( - datum: state.extra as Datum, + diet: state.extra as Diet, ), ), GoRoute( diff --git a/lib/core/models/base_models.dart b/lib/core/models/base_models.dart new file mode 100644 index 00000000..48de60ef --- /dev/null +++ b/lib/core/models/base_models.dart @@ -0,0 +1,43 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'base_models.freezed.dart'; +part 'base_models.g.dart'; + +@freezed +class Links with _$Links { + const factory Links({ + @JsonKey(name: "first") required String first, + @JsonKey(name: "last") required String last, + @JsonKey(name: "prev") required dynamic prev, + @JsonKey(name: "next") required dynamic next, + }) = _Links; + + factory Links.fromJson(Map json) => _$LinksFromJson(json); +} + +@freezed +class Meta with _$Meta { + const factory Meta({ + @JsonKey(name: "current_page") required int currentPage, + @JsonKey(name: "from") required int from, + @JsonKey(name: "last_page") required int lastPage, + @JsonKey(name: "links") required List links, + @JsonKey(name: "path") required String path, + @JsonKey(name: "per_page") required int perPage, + @JsonKey(name: "to") required int to, + @JsonKey(name: "total") required int total, + }) = _Meta; + + factory Meta.fromJson(Map json) => _$MetaFromJson(json); +} + +@freezed +class Link with _$Link { + const factory Link({ + @JsonKey(name: "url") required String? url, + @JsonKey(name: "label") required String label, + @JsonKey(name: "active") required bool active, + }) = _Link; + + factory Link.fromJson(Map json) => _$LinkFromJson(json); +} diff --git a/lib/core/models/base_models.freezed.dart b/lib/core/models/base_models.freezed.dart new file mode 100644 index 00000000..b62824d5 --- /dev/null +++ b/lib/core/models/base_models.freezed.dart @@ -0,0 +1,721 @@ +// 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 'base_models.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'); + +Links _$LinksFromJson(Map json) { + return _Links.fromJson(json); +} + +/// @nodoc +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>; + @useResult + $Res call( + {@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> { + _$LinksCopyWithImpl(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? first = null, + Object? last = null, + Object? prev = freezed, + Object? next = freezed, + }) { + return _then(_value.copyWith( + first: null == first + ? _value.first + : first // ignore: cast_nullable_to_non_nullable + as String, + last: null == last + ? _value.last + : last // ignore: cast_nullable_to_non_nullable + as String, + prev: freezed == prev + ? _value.prev + : prev // ignore: cast_nullable_to_non_nullable + as dynamic, + next: freezed == next + ? _value.next + : next // ignore: cast_nullable_to_non_nullable + as dynamic, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$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}); +} + +/// @nodoc +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 + $Res call({ + Object? first = null, + Object? last = null, + Object? prev = freezed, + Object? next = freezed, + }) { + return _then(_$LinksImpl( + first: null == first + ? _value.first + : first // ignore: cast_nullable_to_non_nullable + as String, + last: null == last + ? _value.last + : last // ignore: cast_nullable_to_non_nullable + as String, + prev: freezed == prev + ? _value.prev + : prev // ignore: cast_nullable_to_non_nullable + as dynamic, + next: freezed == next + ? _value.next + : next // ignore: cast_nullable_to_non_nullable + as dynamic, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$LinksImpl implements _Links { + const _$LinksImpl( + {@JsonKey(name: "first") required this.first, + @JsonKey(name: "last") required this.last, + @JsonKey(name: "prev") required this.prev, + @JsonKey(name: "next") required this.next}); + + factory _$LinksImpl.fromJson(Map json) => + _$$LinksImplFromJson(json); + + @override + @JsonKey(name: "first") + final String first; + @override + @JsonKey(name: "last") + final String last; + @override + @JsonKey(name: "prev") + final dynamic prev; + @override + @JsonKey(name: "next") + final dynamic next; + + @override + String toString() { + return 'Links(first: $first, last: $last, prev: $prev, next: $next)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LinksImpl && + (identical(other.first, first) || other.first == first) && + (identical(other.last, last) || other.last == last) && + const DeepCollectionEquality().equals(other.prev, prev) && + const DeepCollectionEquality().equals(other.next, next)); + } + + @JsonKey(ignore: true) + @override + 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); + + @override + Map toJson() { + return _$$LinksImplToJson( + this, + ); + } +} + +abstract class _Links implements Links { + const factory _Links( + {@JsonKey(name: "first") required final String first, + @JsonKey(name: "last") required final String last, + @JsonKey(name: "prev") required final dynamic prev, + @JsonKey(name: "next") required final dynamic next}) = _$LinksImpl; + + factory _Links.fromJson(Map json) = _$LinksImpl.fromJson; + + @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; +} + +Meta _$MetaFromJson(Map json) { + return _Meta.fromJson(json); +} + +/// @nodoc +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>; + @useResult + $Res call( + {@JsonKey(name: "current_page") int currentPage, + @JsonKey(name: "from") int from, + @JsonKey(name: "last_page") int lastPage, + @JsonKey(name: "links") List links, + @JsonKey(name: "path") String path, + @JsonKey(name: "per_page") int perPage, + @JsonKey(name: "to") int to, + @JsonKey(name: "total") int total}); +} + +/// @nodoc +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; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? currentPage = null, + Object? from = null, + Object? lastPage = null, + Object? links = null, + Object? path = null, + Object? perPage = null, + Object? to = null, + Object? total = null, + }) { + return _then(_value.copyWith( + currentPage: null == currentPage + ? _value.currentPage + : currentPage // ignore: cast_nullable_to_non_nullable + as int, + from: null == from + ? _value.from + : from // ignore: cast_nullable_to_non_nullable + as int, + lastPage: null == lastPage + ? _value.lastPage + : lastPage // ignore: cast_nullable_to_non_nullable + as int, + links: null == links + ? _value.links + : links // ignore: cast_nullable_to_non_nullable + as List, + path: null == path + ? _value.path + : path // ignore: cast_nullable_to_non_nullable + as String, + perPage: null == perPage + ? _value.perPage + : perPage // ignore: cast_nullable_to_non_nullable + as int, + to: null == to + ? _value.to + : to // ignore: cast_nullable_to_non_nullable + as int, + total: null == total + ? _value.total + : total // ignore: cast_nullable_to_non_nullable + as int, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { + factory _$$MetaImplCopyWith( + _$MetaImpl value, $Res Function(_$MetaImpl) then) = + __$$MetaImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "current_page") int currentPage, + @JsonKey(name: "from") int from, + @JsonKey(name: "last_page") int lastPage, + @JsonKey(name: "links") List links, + @JsonKey(name: "path") String path, + @JsonKey(name: "per_page") int perPage, + @JsonKey(name: "to") int to, + @JsonKey(name: "total") int total}); +} + +/// @nodoc +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 + $Res call({ + Object? currentPage = null, + Object? from = null, + Object? lastPage = null, + Object? links = null, + Object? path = null, + Object? perPage = null, + Object? to = null, + Object? total = null, + }) { + return _then(_$MetaImpl( + currentPage: null == currentPage + ? _value.currentPage + : currentPage // ignore: cast_nullable_to_non_nullable + as int, + from: null == from + ? _value.from + : from // ignore: cast_nullable_to_non_nullable + as int, + lastPage: null == lastPage + ? _value.lastPage + : lastPage // ignore: cast_nullable_to_non_nullable + as int, + links: null == links + ? _value._links + : links // ignore: cast_nullable_to_non_nullable + as List, + path: null == path + ? _value.path + : path // ignore: cast_nullable_to_non_nullable + as String, + perPage: null == perPage + ? _value.perPage + : perPage // ignore: cast_nullable_to_non_nullable + as int, + to: null == to + ? _value.to + : to // ignore: cast_nullable_to_non_nullable + as int, + total: null == total + ? _value.total + : total // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$MetaImpl implements _Meta { + const _$MetaImpl( + {@JsonKey(name: "current_page") required this.currentPage, + @JsonKey(name: "from") required this.from, + @JsonKey(name: "last_page") required this.lastPage, + @JsonKey(name: "links") required final List links, + @JsonKey(name: "path") required this.path, + @JsonKey(name: "per_page") required this.perPage, + @JsonKey(name: "to") required this.to, + @JsonKey(name: "total") required this.total}) + : _links = links; + + factory _$MetaImpl.fromJson(Map json) => + _$$MetaImplFromJson(json); + + @override + @JsonKey(name: "current_page") + final int currentPage; + @override + @JsonKey(name: "from") + final int from; + @override + @JsonKey(name: "last_page") + final int lastPage; + final List _links; + @override + @JsonKey(name: "links") + List get links { + if (_links is EqualUnmodifiableListView) return _links; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_links); + } + + @override + @JsonKey(name: "path") + final String path; + @override + @JsonKey(name: "per_page") + final int perPage; + @override + @JsonKey(name: "to") + final int to; + @override + @JsonKey(name: "total") + final int total; + + @override + String toString() { + return 'Meta(currentPage: $currentPage, from: $from, lastPage: $lastPage, links: $links, path: $path, perPage: $perPage, to: $to, total: $total)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$MetaImpl && + (identical(other.currentPage, currentPage) || + other.currentPage == currentPage) && + (identical(other.from, from) || other.from == from) && + (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) && + (identical(other.to, to) || other.to == to) && + (identical(other.total, total) || other.total == total)); + } + + @JsonKey(ignore: true) + @override + 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); + + @override + Map toJson() { + return _$$MetaImplToJson( + this, + ); + } +} + +abstract class _Meta implements Meta { + const factory _Meta( + {@JsonKey(name: "current_page") required final int currentPage, + @JsonKey(name: "from") required final int from, + @JsonKey(name: "last_page") required final int lastPage, + @JsonKey(name: "links") required final List links, + @JsonKey(name: "path") required final String path, + @JsonKey(name: "per_page") required final int perPage, + @JsonKey(name: "to") required final int to, + @JsonKey(name: "total") required final int total}) = _$MetaImpl; + + factory _Meta.fromJson(Map json) = _$MetaImpl.fromJson; + + @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; +} + +Link _$LinkFromJson(Map json) { + return _Link.fromJson(json); +} + +/// @nodoc +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>; + @useResult + $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> { + _$LinkCopyWithImpl(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? url = freezed, + Object? label = null, + Object? active = null, + }) { + return _then(_value.copyWith( + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + label: null == label + ? _value.label + : label // ignore: cast_nullable_to_non_nullable + as String, + active: null == active + ? _value.active + : active // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$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}); +} + +/// @nodoc +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 + $Res call({ + Object? url = freezed, + Object? label = null, + Object? active = null, + }) { + return _then(_$LinkImpl( + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + label: null == label + ? _value.label + : label // ignore: cast_nullable_to_non_nullable + as String, + active: null == active + ? _value.active + : active // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @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}); + + factory _$LinkImpl.fromJson(Map json) => + _$$LinkImplFromJson(json); + + @override + @JsonKey(name: "url") + final String? url; + @override + @JsonKey(name: "label") + final String label; + @override + @JsonKey(name: "active") + final bool active; + + @override + String toString() { + return 'Link(url: $url, label: $label, active: $active)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$LinkImpl && + (identical(other.url, url) || other.url == url) && + (identical(other.label, label) || other.label == label) && + (identical(other.active, active) || other.active == active)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, url, label, active); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => + __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); + + @override + Map toJson() { + return _$$LinkImplToJson( + this, + ); + } +} + +abstract class _Link implements Link { + const factory _Link( + {@JsonKey(name: "url") required final String? url, + @JsonKey(name: "label") required final String label, + @JsonKey(name: "active") required final bool active}) = _$LinkImpl; + + factory _Link.fromJson(Map json) = _$LinkImpl.fromJson; + + @override + @JsonKey(name: "url") + String? get url; + @override + @JsonKey(name: "label") + String get label; + @override + @JsonKey(name: "active") + bool get active; + @override + @JsonKey(ignore: true) + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/core/models/base_models.g.dart b/lib/core/models/base_models.g.dart new file mode 100644 index 00000000..5eec9fa3 --- /dev/null +++ b/lib/core/models/base_models.g.dart @@ -0,0 +1,60 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_models.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$LinksImpl _$$LinksImplFromJson(Map json) => _$LinksImpl( + first: json['first'] as String, + last: json['last'] as String, + prev: json['prev'], + next: json['next'], + ); + +Map _$$LinksImplToJson(_$LinksImpl instance) => + { + 'first': instance.first, + 'last': instance.last, + 'prev': instance.prev, + 'next': instance.next, + }; + +_$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(), + 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) => + { + 'current_page': instance.currentPage, + 'from': instance.from, + 'last_page': instance.lastPage, + 'links': instance.links, + 'path': instance.path, + 'per_page': instance.perPage, + 'to': instance.to, + 'total': instance.total, + }; + +_$LinkImpl _$$LinkImplFromJson(Map json) => _$LinkImpl( + url: json['url'] as String?, + label: json['label'] as String, + active: json['active'] as bool, + ); + +Map _$$LinkImplToJson(_$LinkImpl instance) => + { + 'url': instance.url, + 'label': instance.label, + 'active': instance.active, + }; 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 b2e827cf..bd4db44e 100644 --- a/lib/features/blog_post/presentation/pages/blog_post_screen.dart +++ b/lib/features/blog_post/presentation/pages/blog_post_screen.dart @@ -320,31 +320,31 @@ class _BlogPostScreenState extends State { ); } - _buildComments(Comment comment) { + _buildComments(CommentModel comment) { return Column( children: [ for (int i = 0; i < comment.data.length; i++) ...[ _comment(comment.data[i]), - if (comment.data[i].childrenComments.isNotEmpty) - for (int j = 0; j < comment.data[i].childrenComments.length; j++) - Padding( - padding: EdgeInsets.only(left: 40), - child: _comment( - comment.data[i].childrenComments[j], - 12, - ), + if (comment.data[i].childrenComments.isNotEmpty) SizedBox(height: 8), + for (int j = 0; j < comment.data[i].childrenComments.length; j++) + Padding( + padding: EdgeInsets.only(left: 40), + child: _comment( + comment.data[i].childrenComments[j], + 12, ), + ), SizedBox(height: 8), ], ], ); } - _comment(Datum datum, [double radius = 16]) { + _comment(Comment comment, [double radius = 16]) { return Container( width: MediaQuery.of(context).size.width, decoration: BoxDecoration( - color: replyId == datum.id ? appTheme.blueA400.withOpacity(0.1) : Colors.white, + color: replyId == comment.id ? appTheme.blueA400.withOpacity(0.1) : Colors.white, borderRadius: BorderRadius.circular(16), ), child: Padding( @@ -353,7 +353,7 @@ class _BlogPostScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ CircleAvatar( - foregroundImage: NetworkImage(datum.authorProfileIcon), + foregroundImage: NetworkImage(comment.authorProfileIcon), radius: radius, ), SizedBox(width: 8), @@ -362,7 +362,7 @@ class _BlogPostScreenState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - datum.authorName, + comment.authorName, style: TextStyle( height: 1, color: Colors.grey.shade600, @@ -371,7 +371,7 @@ class _BlogPostScreenState extends State { ), SizedBox(width: 4), Text( - datum.body, + comment.body, style: TextStyle( height: 1, color: Colors.black, @@ -381,7 +381,7 @@ class _BlogPostScreenState extends State { Row( children: [ Text( - datum.createdAt.format('dd MMMM', 'ru'), + comment.createdAt.format('dd MMMM', 'ru'), style: TextStyle( color: Colors.grey.shade600, fontSize: 12, @@ -393,7 +393,7 @@ class _BlogPostScreenState extends State { GestureDetector( onTap: () { setState(() { - replyId = datum.id; + replyId = comment.id; }); }, child: Text( diff --git a/lib/features/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart index 643f6111..d21de813 100644 --- a/lib/features/diets/presentation/pages/about_diet_screen.dart +++ b/lib/features/diets/presentation/pages/about_diet_screen.dart @@ -3,7 +3,7 @@ import 'dart:io'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/feed/models/comment_model.dart'; -import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart' as Diets; +import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart'; import 'package:eatvio_app/locator_service.dart'; @@ -12,11 +12,11 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class AboutDietScreen extends StatefulWidget { - final Diets.Datum datum; + final Diet diet; late final List selectedIndexes; - AboutDietScreen({super.key, required this.datum}) { - selectedIndexes = List.generate(datum.dailySchedule.length, (_) => 0); + AboutDietScreen({super.key, required this.diet}) { + selectedIndexes = List.generate(diet.dailySchedule.length, (_) => 0); } @override @@ -31,7 +31,7 @@ class _AboutDietScreenState extends State { @override void initState() { super.initState(); - commentsCubit.getDietsComments(widget.datum.id); + commentsCubit.getDietsComments(widget.diet.id); } @override @@ -157,7 +157,7 @@ class _AboutDietScreenState extends State { onTap: () { if (textEditingController.text.length > 2) { commentsCubit.sendDietsComment( - id: widget.datum.id, + id: widget.diet.id, commentText: textEditingController.text, parentCommentId: replyId, ); @@ -210,7 +210,7 @@ class _AboutDietScreenState extends State { actions: [ InkWell( borderRadius: BorderRadius.circular(16), - onTap: () => GoRouter.of(context).pushNamed('profileScreen', extra: widget.datum.author), + onTap: () => GoRouter.of(context).pushNamed('profileScreen', extra: widget.diet.author), child: Ink( padding: const EdgeInsets.symmetric(horizontal: 16), child: Column( @@ -219,11 +219,11 @@ class _AboutDietScreenState extends State { CircleAvatar( maxRadius: 16, minRadius: 16, - backgroundImage: NetworkImage(widget.datum.author.authorProfileIcon), + backgroundImage: NetworkImage(widget.diet.author.authorProfileIcon), ), SizedBox(height: 4), Text( - widget.datum.author.authorName, + widget.diet.author.authorName, style: TextStyle( color: Colors.black, fontSize: 14, @@ -245,7 +245,7 @@ class _AboutDietScreenState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Text( - widget.datum.name, + widget.diet.name, style: TextStyle( color: Colors.black, fontSize: 24, @@ -262,7 +262,7 @@ class _AboutDietScreenState extends State { Icon(Icons.timer_outlined), SizedBox(width: 4), Text( - widget.datum.duration.toString() + ' дней', + widget.diet.duration.toString() + ' дней', style: TextStyle( color: Colors.black, fontSize: 12, @@ -277,7 +277,7 @@ class _AboutDietScreenState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Text( - widget.datum.details, + widget.diet.details, style: TextStyle( color: Colors.black, fontSize: 14, @@ -288,7 +288,7 @@ class _AboutDietScreenState extends State { ), SizedBox(height: 12), CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + widget.datum.image, + imageUrl: baseUrl + '/storage/' + widget.diet.image, ), SizedBox(height: 12), ListView.separated( @@ -296,7 +296,7 @@ class _AboutDietScreenState extends State { physics: NeverScrollableScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { - return _dayOfPlan(widget.datum.dailySchedule[index], index); + return _dayOfPlan(widget.diet.dailySchedule[index], index); }, separatorBuilder: (context, index) => Padding( padding: const EdgeInsets.symmetric(vertical: 16), @@ -308,14 +308,14 @@ class _AboutDietScreenState extends State { ), ), ), - itemCount: widget.datum.dailySchedule.length, + itemCount: widget.diet.dailySchedule.length, ), SizedBox(height: 32), Container( padding: EdgeInsets.symmetric(horizontal: 16), alignment: Alignment.centerLeft, child: Text( - widget.datum.totalComments.toString() + ' КОММЕНТАРИЕВ', + widget.diet.totalComments.toString() + ' КОММЕНТАРИЕВ', style: TextStyle( fontSize: 12, color: appTheme.gray500, @@ -339,7 +339,7 @@ class _AboutDietScreenState extends State { ); } - _dayOfPlan(List> day, int dayNumber) { + _dayOfPlan(List> day, int dayNumber) { _choiceChipWidget(int index) { return ChoiceChip( selectedColor: appTheme.blueA400, @@ -410,7 +410,7 @@ class _AboutDietScreenState extends State { ); } - _daily(Diets.DailySchedule daily) { + _daily(DailySchedule daily) { return Row( children: [ Text( @@ -436,7 +436,7 @@ class _AboutDietScreenState extends State { ); } - _buildComments(Comment comment) { + _buildComments(CommentModel comment) { return Column( children: [ for (int i = 0; i < comment.data.length; i++) ...[ @@ -456,11 +456,11 @@ class _AboutDietScreenState extends State { ); } - _comment(Datum datum, [double radius = 16]) { + _comment(Comment diet, [double radius = 16]) { return Container( width: MediaQuery.of(context).size.width, decoration: BoxDecoration( - color: replyId == datum.id ? appTheme.blueA400.withOpacity(0.1) : Colors.white, + color: replyId == diet.id ? appTheme.blueA400.withOpacity(0.1) : Colors.white, borderRadius: BorderRadius.circular(16), ), child: Padding( @@ -469,7 +469,7 @@ class _AboutDietScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ CircleAvatar( - foregroundImage: NetworkImage(datum.authorProfileIcon), + foregroundImage: NetworkImage(diet.authorProfileIcon), radius: radius, ), SizedBox(width: 8), @@ -478,7 +478,7 @@ class _AboutDietScreenState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - datum.authorName, + diet.authorName, style: TextStyle( height: 1, color: Colors.grey.shade600, @@ -487,7 +487,7 @@ class _AboutDietScreenState extends State { ), SizedBox(width: 4), Text( - datum.body, + diet.body, style: TextStyle( height: 1, color: Colors.black, @@ -497,7 +497,7 @@ class _AboutDietScreenState extends State { Row( children: [ Text( - datum.createdAt.format('dd MMMM', 'ru'), + diet.createdAt.format('dd MMMM', 'ru'), style: TextStyle( color: Colors.grey.shade600, fontSize: 12, @@ -509,7 +509,7 @@ class _AboutDietScreenState extends State { GestureDetector( onTap: () { setState(() { - replyId = datum.id; + replyId = diet.id; }); }, child: Text( diff --git a/lib/features/feed/models/comment_model.dart b/lib/features/feed/models/comment_model.dart index 52f163e4..edcc722a 100644 --- a/lib/features/feed/models/comment_model.dart +++ b/lib/features/feed/models/comment_model.dart @@ -1,68 +1,30 @@ +import 'package:eatvio_app/core/models/base_models.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'comment_model.freezed.dart'; part 'comment_model.g.dart'; @freezed -class Comment with _$Comment { - const factory Comment({ - @JsonKey(name: "data") required List data, +class CommentModel with _$CommentModel { + const factory CommentModel({ + @JsonKey(name: "data") required List data, @JsonKey(name: "links") required Links links, @JsonKey(name: "meta") required Meta meta, - }) = _Comment; + }) = _CommentModel; - factory Comment.fromJson(Map json) => _$CommentFromJson(json); + factory CommentModel.fromJson(Map json) => _$CommentModelFromJson(json); } @freezed -class Datum with _$Datum { - const factory Datum({ +class Comment with _$Comment { + const factory Comment({ @JsonKey(name: "id") required int id, @JsonKey(name: "author_name") required String authorName, @JsonKey(name: "author_profile_icon") required String authorProfileIcon, @JsonKey(name: "body") required String body, - @JsonKey(name: "children_comments") required List childrenComments, + @JsonKey(name: "children_comments") required List childrenComments, @JsonKey(name: "created_at") required DateTime createdAt, - }) = _Datum; + }) = _Comment; - factory Datum.fromJson(Map json) => _$DatumFromJson(json); -} - -@freezed -class Links with _$Links { - const factory Links({ - @JsonKey(name: "first") required String first, - @JsonKey(name: "last") required String last, - @JsonKey(name: "prev") required dynamic prev, - @JsonKey(name: "next") required dynamic next, - }) = _Links; - - factory Links.fromJson(Map json) => _$LinksFromJson(json); -} - -@freezed -class Meta with _$Meta { - const factory Meta({ - @JsonKey(name: "current_page") required int currentPage, - @JsonKey(name: "from") required int from, - @JsonKey(name: "last_page") required int lastPage, - @JsonKey(name: "links") required List links, - @JsonKey(name: "path") required String path, - @JsonKey(name: "per_page") required int perPage, - @JsonKey(name: "to") required int to, - @JsonKey(name: "total") required int total, - }) = _Meta; - - factory Meta.fromJson(Map json) => _$MetaFromJson(json); -} - -@freezed -class Link with _$Link { - const factory Link({ - @JsonKey(name: "url") required String? url, - @JsonKey(name: "label") required String label, - @JsonKey(name: "active") required bool active, - }) = _Link; - - factory Link.fromJson(Map json) => _$LinkFromJson(json); + factory Comment.fromJson(Map json) => _$CommentFromJson(json); } diff --git a/lib/features/feed/models/comment_model.freezed.dart b/lib/features/feed/models/comment_model.freezed.dart index 8e33c3bd..d294267f 100644 --- a/lib/features/feed/models/comment_model.freezed.dart +++ b/lib/features/feed/models/comment_model.freezed.dart @@ -14,14 +14,14 @@ 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'); -Comment _$CommentFromJson(Map json) { - return _Comment.fromJson(json); +CommentModel _$CommentModelFromJson(Map json) { + return _CommentModel.fromJson(json); } /// @nodoc -mixin _$Comment { +mixin _$CommentModel { @JsonKey(name: "data") - List get data => throw _privateConstructorUsedError; + List get data => throw _privateConstructorUsedError; @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; @JsonKey(name: "meta") @@ -29,16 +29,18 @@ mixin _$Comment { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $CommentCopyWith get copyWith => throw _privateConstructorUsedError; + $CommentModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class $CommentCopyWith<$Res> { - factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = - _$CommentCopyWithImpl<$Res, Comment>; +abstract class $CommentModelCopyWith<$Res> { + factory $CommentModelCopyWith( + CommentModel value, $Res Function(CommentModel) then) = + _$CommentModelCopyWithImpl<$Res, CommentModel>; @useResult $Res call( - {@JsonKey(name: "data") List data, + {@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); @@ -47,9 +49,9 @@ abstract class $CommentCopyWith<$Res> { } /// @nodoc -class _$CommentCopyWithImpl<$Res, $Val extends Comment> - implements $CommentCopyWith<$Res> { - _$CommentCopyWithImpl(this._value, this._then); +class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> + implements $CommentModelCopyWith<$Res> { + _$CommentModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -67,7 +69,7 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable - as List, + as List, links: null == links ? _value.links : links // ignore: cast_nullable_to_non_nullable @@ -97,14 +99,15 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> } /// @nodoc -abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { - factory _$$CommentImplCopyWith( - _$CommentImpl value, $Res Function(_$CommentImpl) then) = - __$$CommentImplCopyWithImpl<$Res>; +abstract class _$$CommentModelImplCopyWith<$Res> + implements $CommentModelCopyWith<$Res> { + factory _$$CommentModelImplCopyWith( + _$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) = + __$$CommentModelImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey(name: "data") List data, + {@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); @@ -115,11 +118,11 @@ abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { } /// @nodoc -class __$$CommentImplCopyWithImpl<$Res> - extends _$CommentCopyWithImpl<$Res, _$CommentImpl> - implements _$$CommentImplCopyWith<$Res> { - __$$CommentImplCopyWithImpl( - _$CommentImpl _value, $Res Function(_$CommentImpl) _then) +class __$$CommentModelImplCopyWithImpl<$Res> + extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl> + implements _$$CommentModelImplCopyWith<$Res> { + __$$CommentModelImplCopyWithImpl( + _$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -129,11 +132,11 @@ class __$$CommentImplCopyWithImpl<$Res> Object? links = null, Object? meta = null, }) { - return _then(_$CommentImpl( + return _then(_$CommentModelImpl( data: null == data ? _value._data : data // ignore: cast_nullable_to_non_nullable - as List, + as List, links: null == links ? _value.links : links // ignore: cast_nullable_to_non_nullable @@ -148,20 +151,20 @@ class __$$CommentImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$CommentImpl implements _Comment { - const _$CommentImpl( - {@JsonKey(name: "data") required final List data, +class _$CommentModelImpl implements _CommentModel { + const _$CommentModelImpl( + {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$CommentImpl.fromJson(Map json) => - _$$CommentImplFromJson(json); + factory _$CommentModelImpl.fromJson(Map json) => + _$$CommentModelImplFromJson(json); - final List _data; + final List _data; @override @JsonKey(name: "data") - List get data { + List get data { if (_data is EqualUnmodifiableListView) return _data; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_data); @@ -176,14 +179,14 @@ class _$CommentImpl implements _Comment { @override String toString() { - return 'Comment(data: $data, links: $links, meta: $meta)'; + return 'CommentModel(data: $data, links: $links, meta: $meta)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$CommentImpl && + other is _$CommentModelImpl && const DeepCollectionEquality().equals(other._data, _data) && (identical(other.links, links) || other.links == links) && (identical(other.meta, meta) || other.meta == meta)); @@ -197,28 +200,29 @@ class _$CommentImpl implements _Comment { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => - __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => + __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity); @override Map toJson() { - return _$$CommentImplToJson( + return _$$CommentModelImplToJson( this, ); } } -abstract class _Comment implements Comment { - const factory _Comment( - {@JsonKey(name: "data") required final List data, +abstract class _CommentModel implements CommentModel { + const factory _CommentModel( + {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required final Links links, - @JsonKey(name: "meta") required final Meta meta}) = _$CommentImpl; + @JsonKey(name: "meta") required final Meta meta}) = _$CommentModelImpl; - factory _Comment.fromJson(Map json) = _$CommentImpl.fromJson; + factory _CommentModel.fromJson(Map json) = + _$CommentModelImpl.fromJson; @override @JsonKey(name: "data") - List get data; + List get data; @override @JsonKey(name: "links") Links get links; @@ -227,16 +231,16 @@ abstract class _Comment implements Comment { Meta get meta; @override @JsonKey(ignore: true) - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => throw _privateConstructorUsedError; } -Datum _$DatumFromJson(Map json) { - return _Datum.fromJson(json); +Comment _$CommentFromJson(Map json) { + return _Comment.fromJson(json); } /// @nodoc -mixin _$Datum { +mixin _$Comment { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; @JsonKey(name: "author_name") @@ -246,33 +250,33 @@ mixin _$Datum { @JsonKey(name: "body") String get body => throw _privateConstructorUsedError; @JsonKey(name: "children_comments") - List get childrenComments => throw _privateConstructorUsedError; + List get childrenComments => throw _privateConstructorUsedError; @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $DatumCopyWith get copyWith => throw _privateConstructorUsedError; + $CommentCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $DatumCopyWith<$Res> { - factory $DatumCopyWith(Datum value, $Res Function(Datum) then) = - _$DatumCopyWithImpl<$Res, Datum>; +abstract class $CommentCopyWith<$Res> { + factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = + _$CommentCopyWithImpl<$Res, Comment>; @useResult $Res call( {@JsonKey(name: "id") int id, @JsonKey(name: "author_name") String authorName, @JsonKey(name: "author_profile_icon") String authorProfileIcon, @JsonKey(name: "body") String body, - @JsonKey(name: "children_comments") List childrenComments, + @JsonKey(name: "children_comments") List childrenComments, @JsonKey(name: "created_at") DateTime createdAt}); } /// @nodoc -class _$DatumCopyWithImpl<$Res, $Val extends Datum> - implements $DatumCopyWith<$Res> { - _$DatumCopyWithImpl(this._value, this._then); +class _$CommentCopyWithImpl<$Res, $Val extends Comment> + implements $CommentCopyWith<$Res> { + _$CommentCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -309,7 +313,7 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> childrenComments: null == childrenComments ? _value.childrenComments : childrenComments // ignore: cast_nullable_to_non_nullable - as List, + as List, createdAt: null == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -319,10 +323,10 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> } /// @nodoc -abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> { - factory _$$DatumImplCopyWith( - _$DatumImpl value, $Res Function(_$DatumImpl) then) = - __$$DatumImplCopyWithImpl<$Res>; +abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { + factory _$$CommentImplCopyWith( + _$CommentImpl value, $Res Function(_$CommentImpl) then) = + __$$CommentImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -330,16 +334,16 @@ abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> { @JsonKey(name: "author_name") String authorName, @JsonKey(name: "author_profile_icon") String authorProfileIcon, @JsonKey(name: "body") String body, - @JsonKey(name: "children_comments") List childrenComments, + @JsonKey(name: "children_comments") List childrenComments, @JsonKey(name: "created_at") DateTime createdAt}); } /// @nodoc -class __$$DatumImplCopyWithImpl<$Res> - extends _$DatumCopyWithImpl<$Res, _$DatumImpl> - implements _$$DatumImplCopyWith<$Res> { - __$$DatumImplCopyWithImpl( - _$DatumImpl _value, $Res Function(_$DatumImpl) _then) +class __$$CommentImplCopyWithImpl<$Res> + extends _$CommentCopyWithImpl<$Res, _$CommentImpl> + implements _$$CommentImplCopyWith<$Res> { + __$$CommentImplCopyWithImpl( + _$CommentImpl _value, $Res Function(_$CommentImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -352,7 +356,7 @@ class __$$DatumImplCopyWithImpl<$Res> Object? childrenComments = null, Object? createdAt = null, }) { - return _then(_$DatumImpl( + return _then(_$CommentImpl( id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -372,7 +376,7 @@ class __$$DatumImplCopyWithImpl<$Res> childrenComments: null == childrenComments ? _value._childrenComments : childrenComments // ignore: cast_nullable_to_non_nullable - as List, + as List, createdAt: null == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -383,19 +387,19 @@ class __$$DatumImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$DatumImpl implements _Datum { - const _$DatumImpl( +class _$CommentImpl implements _Comment { + const _$CommentImpl( {@JsonKey(name: "id") required this.id, @JsonKey(name: "author_name") required this.authorName, @JsonKey(name: "author_profile_icon") required this.authorProfileIcon, @JsonKey(name: "body") required this.body, @JsonKey(name: "children_comments") - required final List childrenComments, + required final List childrenComments, @JsonKey(name: "created_at") required this.createdAt}) : _childrenComments = childrenComments; - factory _$DatumImpl.fromJson(Map json) => - _$$DatumImplFromJson(json); + factory _$CommentImpl.fromJson(Map json) => + _$$CommentImplFromJson(json); @override @JsonKey(name: "id") @@ -409,10 +413,10 @@ class _$DatumImpl implements _Datum { @override @JsonKey(name: "body") final String body; - final List _childrenComments; + final List _childrenComments; @override @JsonKey(name: "children_comments") - List get childrenComments { + List get childrenComments { if (_childrenComments is EqualUnmodifiableListView) return _childrenComments; // ignore: implicit_dynamic_type @@ -425,14 +429,14 @@ class _$DatumImpl implements _Datum { @override String toString() { - return 'Datum(id: $id, authorName: $authorName, authorProfileIcon: $authorProfileIcon, body: $body, childrenComments: $childrenComments, createdAt: $createdAt)'; + return 'Comment(id: $id, authorName: $authorName, authorProfileIcon: $authorProfileIcon, body: $body, childrenComments: $childrenComments, createdAt: $createdAt)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$DatumImpl && + other is _$CommentImpl && (identical(other.id, id) || other.id == id) && (identical(other.authorName, authorName) || other.authorName == authorName) && @@ -459,30 +463,30 @@ class _$DatumImpl implements _Datum { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DatumImplCopyWith<_$DatumImpl> get copyWith => - __$$DatumImplCopyWithImpl<_$DatumImpl>(this, _$identity); + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => + __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); @override Map toJson() { - return _$$DatumImplToJson( + return _$$CommentImplToJson( this, ); } } -abstract class _Datum implements Datum { - const factory _Datum( +abstract class _Comment implements Comment { + const factory _Comment( {@JsonKey(name: "id") required final int id, @JsonKey(name: "author_name") required final String authorName, @JsonKey(name: "author_profile_icon") required final String authorProfileIcon, @JsonKey(name: "body") required final String body, @JsonKey(name: "children_comments") - required final List childrenComments, + required final List childrenComments, @JsonKey(name: "created_at") required final DateTime createdAt}) = - _$DatumImpl; + _$CommentImpl; - factory _Datum.fromJson(Map json) = _$DatumImpl.fromJson; + factory _Comment.fromJson(Map json) = _$CommentImpl.fromJson; @override @JsonKey(name: "id") @@ -498,718 +502,12 @@ abstract class _Datum implements Datum { String get body; @override @JsonKey(name: "children_comments") - List get childrenComments; + List get childrenComments; @override @JsonKey(name: "created_at") DateTime get createdAt; @override @JsonKey(ignore: true) - _$$DatumImplCopyWith<_$DatumImpl> get copyWith => - throw _privateConstructorUsedError; -} - -Links _$LinksFromJson(Map json) { - return _Links.fromJson(json); -} - -/// @nodoc -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>; - @useResult - $Res call( - {@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> { - _$LinksCopyWithImpl(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? first = null, - Object? last = null, - Object? prev = freezed, - Object? next = freezed, - }) { - return _then(_value.copyWith( - first: null == first - ? _value.first - : first // ignore: cast_nullable_to_non_nullable - as String, - last: null == last - ? _value.last - : last // ignore: cast_nullable_to_non_nullable - as String, - prev: freezed == prev - ? _value.prev - : prev // ignore: cast_nullable_to_non_nullable - as dynamic, - next: freezed == next - ? _value.next - : next // ignore: cast_nullable_to_non_nullable - as dynamic, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$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}); -} - -/// @nodoc -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 - $Res call({ - Object? first = null, - Object? last = null, - Object? prev = freezed, - Object? next = freezed, - }) { - return _then(_$LinksImpl( - first: null == first - ? _value.first - : first // ignore: cast_nullable_to_non_nullable - as String, - last: null == last - ? _value.last - : last // ignore: cast_nullable_to_non_nullable - as String, - prev: freezed == prev - ? _value.prev - : prev // ignore: cast_nullable_to_non_nullable - as dynamic, - next: freezed == next - ? _value.next - : next // ignore: cast_nullable_to_non_nullable - as dynamic, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$LinksImpl implements _Links { - const _$LinksImpl( - {@JsonKey(name: "first") required this.first, - @JsonKey(name: "last") required this.last, - @JsonKey(name: "prev") required this.prev, - @JsonKey(name: "next") required this.next}); - - factory _$LinksImpl.fromJson(Map json) => - _$$LinksImplFromJson(json); - - @override - @JsonKey(name: "first") - final String first; - @override - @JsonKey(name: "last") - final String last; - @override - @JsonKey(name: "prev") - final dynamic prev; - @override - @JsonKey(name: "next") - final dynamic next; - - @override - String toString() { - return 'Links(first: $first, last: $last, prev: $prev, next: $next)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$LinksImpl && - (identical(other.first, first) || other.first == first) && - (identical(other.last, last) || other.last == last) && - const DeepCollectionEquality().equals(other.prev, prev) && - const DeepCollectionEquality().equals(other.next, next)); - } - - @JsonKey(ignore: true) - @override - 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); - - @override - Map toJson() { - return _$$LinksImplToJson( - this, - ); - } -} - -abstract class _Links implements Links { - const factory _Links( - {@JsonKey(name: "first") required final String first, - @JsonKey(name: "last") required final String last, - @JsonKey(name: "prev") required final dynamic prev, - @JsonKey(name: "next") required final dynamic next}) = _$LinksImpl; - - factory _Links.fromJson(Map json) = _$LinksImpl.fromJson; - - @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; -} - -Meta _$MetaFromJson(Map json) { - return _Meta.fromJson(json); -} - -/// @nodoc -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>; - @useResult - $Res call( - {@JsonKey(name: "current_page") int currentPage, - @JsonKey(name: "from") int from, - @JsonKey(name: "last_page") int lastPage, - @JsonKey(name: "links") List links, - @JsonKey(name: "path") String path, - @JsonKey(name: "per_page") int perPage, - @JsonKey(name: "to") int to, - @JsonKey(name: "total") int total}); -} - -/// @nodoc -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; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? currentPage = null, - Object? from = null, - Object? lastPage = null, - Object? links = null, - Object? path = null, - Object? perPage = null, - Object? to = null, - Object? total = null, - }) { - return _then(_value.copyWith( - currentPage: null == currentPage - ? _value.currentPage - : currentPage // ignore: cast_nullable_to_non_nullable - as int, - from: null == from - ? _value.from - : from // ignore: cast_nullable_to_non_nullable - as int, - lastPage: null == lastPage - ? _value.lastPage - : lastPage // ignore: cast_nullable_to_non_nullable - as int, - links: null == links - ? _value.links - : links // ignore: cast_nullable_to_non_nullable - as List, - path: null == path - ? _value.path - : path // ignore: cast_nullable_to_non_nullable - as String, - perPage: null == perPage - ? _value.perPage - : perPage // ignore: cast_nullable_to_non_nullable - as int, - to: null == to - ? _value.to - : to // ignore: cast_nullable_to_non_nullable - as int, - total: null == total - ? _value.total - : total // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { - factory _$$MetaImplCopyWith( - _$MetaImpl value, $Res Function(_$MetaImpl) then) = - __$$MetaImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: "current_page") int currentPage, - @JsonKey(name: "from") int from, - @JsonKey(name: "last_page") int lastPage, - @JsonKey(name: "links") List links, - @JsonKey(name: "path") String path, - @JsonKey(name: "per_page") int perPage, - @JsonKey(name: "to") int to, - @JsonKey(name: "total") int total}); -} - -/// @nodoc -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 - $Res call({ - Object? currentPage = null, - Object? from = null, - Object? lastPage = null, - Object? links = null, - Object? path = null, - Object? perPage = null, - Object? to = null, - Object? total = null, - }) { - return _then(_$MetaImpl( - currentPage: null == currentPage - ? _value.currentPage - : currentPage // ignore: cast_nullable_to_non_nullable - as int, - from: null == from - ? _value.from - : from // ignore: cast_nullable_to_non_nullable - as int, - lastPage: null == lastPage - ? _value.lastPage - : lastPage // ignore: cast_nullable_to_non_nullable - as int, - links: null == links - ? _value._links - : links // ignore: cast_nullable_to_non_nullable - as List, - path: null == path - ? _value.path - : path // ignore: cast_nullable_to_non_nullable - as String, - perPage: null == perPage - ? _value.perPage - : perPage // ignore: cast_nullable_to_non_nullable - as int, - to: null == to - ? _value.to - : to // ignore: cast_nullable_to_non_nullable - as int, - total: null == total - ? _value.total - : total // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$MetaImpl implements _Meta { - const _$MetaImpl( - {@JsonKey(name: "current_page") required this.currentPage, - @JsonKey(name: "from") required this.from, - @JsonKey(name: "last_page") required this.lastPage, - @JsonKey(name: "links") required final List links, - @JsonKey(name: "path") required this.path, - @JsonKey(name: "per_page") required this.perPage, - @JsonKey(name: "to") required this.to, - @JsonKey(name: "total") required this.total}) - : _links = links; - - factory _$MetaImpl.fromJson(Map json) => - _$$MetaImplFromJson(json); - - @override - @JsonKey(name: "current_page") - final int currentPage; - @override - @JsonKey(name: "from") - final int from; - @override - @JsonKey(name: "last_page") - final int lastPage; - final List _links; - @override - @JsonKey(name: "links") - List get links { - if (_links is EqualUnmodifiableListView) return _links; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_links); - } - - @override - @JsonKey(name: "path") - final String path; - @override - @JsonKey(name: "per_page") - final int perPage; - @override - @JsonKey(name: "to") - final int to; - @override - @JsonKey(name: "total") - final int total; - - @override - String toString() { - return 'Meta(currentPage: $currentPage, from: $from, lastPage: $lastPage, links: $links, path: $path, perPage: $perPage, to: $to, total: $total)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$MetaImpl && - (identical(other.currentPage, currentPage) || - other.currentPage == currentPage) && - (identical(other.from, from) || other.from == from) && - (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) && - (identical(other.to, to) || other.to == to) && - (identical(other.total, total) || other.total == total)); - } - - @JsonKey(ignore: true) - @override - 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); - - @override - Map toJson() { - return _$$MetaImplToJson( - this, - ); - } -} - -abstract class _Meta implements Meta { - const factory _Meta( - {@JsonKey(name: "current_page") required final int currentPage, - @JsonKey(name: "from") required final int from, - @JsonKey(name: "last_page") required final int lastPage, - @JsonKey(name: "links") required final List links, - @JsonKey(name: "path") required final String path, - @JsonKey(name: "per_page") required final int perPage, - @JsonKey(name: "to") required final int to, - @JsonKey(name: "total") required final int total}) = _$MetaImpl; - - factory _Meta.fromJson(Map json) = _$MetaImpl.fromJson; - - @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; -} - -Link _$LinkFromJson(Map json) { - return _Link.fromJson(json); -} - -/// @nodoc -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>; - @useResult - $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> { - _$LinkCopyWithImpl(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? url = freezed, - Object? label = null, - Object? active = null, - }) { - return _then(_value.copyWith( - url: freezed == url - ? _value.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - active: null == active - ? _value.active - : active // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$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}); -} - -/// @nodoc -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 - $Res call({ - Object? url = freezed, - Object? label = null, - Object? active = null, - }) { - return _then(_$LinkImpl( - url: freezed == url - ? _value.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - active: null == active - ? _value.active - : active // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// @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}); - - factory _$LinkImpl.fromJson(Map json) => - _$$LinkImplFromJson(json); - - @override - @JsonKey(name: "url") - final String? url; - @override - @JsonKey(name: "label") - final String label; - @override - @JsonKey(name: "active") - final bool active; - - @override - String toString() { - return 'Link(url: $url, label: $label, active: $active)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$LinkImpl && - (identical(other.url, url) || other.url == url) && - (identical(other.label, label) || other.label == label) && - (identical(other.active, active) || other.active == active)); - } - - @JsonKey(ignore: true) - @override - int get hashCode => Object.hash(runtimeType, url, label, active); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => - __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); - - @override - Map toJson() { - return _$$LinkImplToJson( - this, - ); - } -} - -abstract class _Link implements Link { - const factory _Link( - {@JsonKey(name: "url") required final String? url, - @JsonKey(name: "label") required final String label, - @JsonKey(name: "active") required final bool active}) = _$LinkImpl; - - factory _Link.fromJson(Map json) = _$LinkImpl.fromJson; - - @override - @JsonKey(name: "url") - String? get url; - @override - @JsonKey(name: "label") - String get label; - @override - @JsonKey(name: "active") - bool get active; - @override - @JsonKey(ignore: true) - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/comment_model.g.dart b/lib/features/feed/models/comment_model.g.dart index 0c92d582..1410cfcc 100644 --- a/lib/features/feed/models/comment_model.g.dart +++ b/lib/features/feed/models/comment_model.g.dart @@ -6,34 +6,35 @@ part of 'comment_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CommentImpl _$$CommentImplFromJson(Map json) => - _$CommentImpl( +_$CommentModelImpl _$$CommentModelImplFromJson(Map json) => + _$CommentModelImpl( data: (json['data'] as List) - .map((e) => Datum.fromJson(e as Map)) + .map((e) => Comment.fromJson(e as Map)) .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$CommentImplToJson(_$CommentImpl instance) => +Map _$$CommentModelImplToJson(_$CommentModelImpl instance) => { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$DatumImpl _$$DatumImplFromJson(Map json) => _$DatumImpl( +_$CommentImpl _$$CommentImplFromJson(Map json) => + _$CommentImpl( id: (json['id'] as num).toInt(), authorName: json['author_name'] as String, authorProfileIcon: json['author_profile_icon'] as String, body: json['body'] as String, childrenComments: (json['children_comments'] as List) - .map((e) => Datum.fromJson(e as Map)) + .map((e) => Comment.fromJson(e as Map)) .toList(), createdAt: DateTime.parse(json['created_at'] as String), ); -Map _$$DatumImplToJson(_$DatumImpl instance) => +Map _$$CommentImplToJson(_$CommentImpl instance) => { 'id': instance.id, 'author_name': instance.authorName, @@ -42,56 +43,3 @@ Map _$$DatumImplToJson(_$DatumImpl instance) => 'children_comments': instance.childrenComments, 'created_at': instance.createdAt.toIso8601String(), }; - -_$LinksImpl _$$LinksImplFromJson(Map json) => _$LinksImpl( - first: json['first'] as String, - last: json['last'] as String, - prev: json['prev'], - next: json['next'], - ); - -Map _$$LinksImplToJson(_$LinksImpl instance) => - { - 'first': instance.first, - 'last': instance.last, - 'prev': instance.prev, - 'next': instance.next, - }; - -_$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(), - 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) => - { - 'current_page': instance.currentPage, - 'from': instance.from, - 'last_page': instance.lastPage, - 'links': instance.links, - 'path': instance.path, - 'per_page': instance.perPage, - 'to': instance.to, - 'total': instance.total, - }; - -_$LinkImpl _$$LinkImplFromJson(Map json) => _$LinkImpl( - url: json['url'] as String?, - label: json['label'] as String, - active: json['active'] as bool, - ); - -Map _$$LinkImplToJson(_$LinkImpl instance) => - { - 'url': instance.url, - 'label': instance.label, - 'active': instance.active, - }; diff --git a/lib/features/feed/models/diets_pagination_model.dart b/lib/features/feed/models/diets_pagination_model.dart index 10fb6afb..f56c606c 100644 --- a/lib/features/feed/models/diets_pagination_model.dart +++ b/lib/features/feed/models/diets_pagination_model.dart @@ -1,3 +1,4 @@ +import 'package:eatvio_app/core/models/base_models.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'diets_pagination_model.freezed.dart'; @@ -6,7 +7,7 @@ part 'diets_pagination_model.g.dart'; @freezed class DietsPagination with _$DietsPagination { const factory DietsPagination({ - @JsonKey(name: "data") required List data, + @JsonKey(name: "data") required List data, @JsonKey(name: "links") required Links links, @JsonKey(name: "meta") required Meta meta, }) = _DietsPagination; @@ -15,23 +16,23 @@ class DietsPagination with _$DietsPagination { } @freezed -class Datum with _$Datum { - const factory Datum({ +class Diet with _$Diet { + const factory Diet({ @JsonKey(name: "id") required int id, @JsonKey(name: "name") required String name, @JsonKey(name: "image") required String image, @JsonKey(name: "duration") required int duration, @JsonKey(name: "state") required String state, - @JsonKey(name: "type") required Type type, + @JsonKey(name: "type") required DietType type, @JsonKey(name: "details") required String details, @JsonKey(name: "daily_schedule") required List>> dailySchedule, @JsonKey(name: "author") required Author author, @JsonKey(name: "total_likes") required int totalLikes, @JsonKey(name: "total_views") required int totalViews, @JsonKey(name: "total_comments") required int totalComments, - }) = _Datum; + }) = _Diet; - factory Datum.fromJson(Map json) => _$DatumFromJson(json); + factory Diet.fromJson(Map json) => _$DietFromJson(json); } @freezed @@ -70,54 +71,15 @@ enum Portion { final portionValues = EnumValues({"grams": Portion.GRAMS, "milliliters": Portion.MILLILITERS, "pcs": Portion.PCS}); @freezed -class Type with _$Type { - const factory Type({ +class DietType with _$DietType { + const factory DietType({ @JsonKey(name: "alko") bool? alko, @JsonKey(name: "veg") bool? veg, @JsonKey(name: "corb") bool? corb, @JsonKey(name: "meat") bool? meat, - }) = _Type; + }) = _DietType; - factory Type.fromJson(Map json) => _$TypeFromJson(json); -} - -@freezed -class Links with _$Links { - const factory Links({ - @JsonKey(name: "first") required String first, - @JsonKey(name: "last") required String last, - @JsonKey(name: "prev") required dynamic prev, - @JsonKey(name: "next") required dynamic next, - }) = _Links; - - factory Links.fromJson(Map json) => _$LinksFromJson(json); -} - -@freezed -class Meta with _$Meta { - const factory Meta({ - @JsonKey(name: "current_page") required int currentPage, - @JsonKey(name: "from") required int from, - @JsonKey(name: "last_page") required int lastPage, - @JsonKey(name: "links") required List links, - @JsonKey(name: "path") required String path, - @JsonKey(name: "per_page") required int perPage, - @JsonKey(name: "to") required int to, - @JsonKey(name: "total") required int total, - }) = _Meta; - - factory Meta.fromJson(Map json) => _$MetaFromJson(json); -} - -@freezed -class Link with _$Link { - const factory Link({ - @JsonKey(name: "url") required String? url, - @JsonKey(name: "label") required String label, - @JsonKey(name: "active") required bool active, - }) = _Link; - - factory Link.fromJson(Map json) => _$LinkFromJson(json); + factory DietType.fromJson(Map json) => _$DietTypeFromJson(json); } class EnumValues { diff --git a/lib/features/feed/models/diets_pagination_model.freezed.dart b/lib/features/feed/models/diets_pagination_model.freezed.dart index 2c402671..04835daf 100644 --- a/lib/features/feed/models/diets_pagination_model.freezed.dart +++ b/lib/features/feed/models/diets_pagination_model.freezed.dart @@ -21,7 +21,7 @@ DietsPagination _$DietsPaginationFromJson(Map json) { /// @nodoc mixin _$DietsPagination { @JsonKey(name: "data") - List get data => throw _privateConstructorUsedError; + List get data => throw _privateConstructorUsedError; @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; @JsonKey(name: "meta") @@ -40,7 +40,7 @@ abstract class $DietsPaginationCopyWith<$Res> { _$DietsPaginationCopyWithImpl<$Res, DietsPagination>; @useResult $Res call( - {@JsonKey(name: "data") List data, + {@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); @@ -69,7 +69,7 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable - as List, + as List, links: null == links ? _value.links : links // ignore: cast_nullable_to_non_nullable @@ -107,7 +107,7 @@ abstract class _$$DietsPaginationImplCopyWith<$Res> @override @useResult $Res call( - {@JsonKey(name: "data") List data, + {@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); @@ -136,7 +136,7 @@ class __$$DietsPaginationImplCopyWithImpl<$Res> data: null == data ? _value._data : data // ignore: cast_nullable_to_non_nullable - as List, + as List, links: null == links ? _value.links : links // ignore: cast_nullable_to_non_nullable @@ -153,7 +153,7 @@ class __$$DietsPaginationImplCopyWithImpl<$Res> @JsonSerializable() class _$DietsPaginationImpl implements _DietsPagination { const _$DietsPaginationImpl( - {@JsonKey(name: "data") required final List data, + {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) : _data = data; @@ -161,10 +161,10 @@ class _$DietsPaginationImpl implements _DietsPagination { factory _$DietsPaginationImpl.fromJson(Map json) => _$$DietsPaginationImplFromJson(json); - final List _data; + final List _data; @override @JsonKey(name: "data") - List get data { + List get data { if (_data is EqualUnmodifiableListView) return _data; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_data); @@ -214,7 +214,7 @@ class _$DietsPaginationImpl implements _DietsPagination { abstract class _DietsPagination implements DietsPagination { const factory _DietsPagination( - {@JsonKey(name: "data") required final List data, + {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$DietsPaginationImpl; @@ -223,7 +223,7 @@ abstract class _DietsPagination implements DietsPagination { @override @JsonKey(name: "data") - List get data; + List get data; @override @JsonKey(name: "links") Links get links; @@ -236,12 +236,12 @@ abstract class _DietsPagination implements DietsPagination { throw _privateConstructorUsedError; } -Datum _$DatumFromJson(Map json) { - return _Datum.fromJson(json); +Diet _$DietFromJson(Map json) { + return _Diet.fromJson(json); } /// @nodoc -mixin _$Datum { +mixin _$Diet { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; @JsonKey(name: "name") @@ -253,7 +253,7 @@ mixin _$Datum { @JsonKey(name: "state") String get state => throw _privateConstructorUsedError; @JsonKey(name: "type") - Type get type => throw _privateConstructorUsedError; + DietType get type => throw _privateConstructorUsedError; @JsonKey(name: "details") String get details => throw _privateConstructorUsedError; @JsonKey(name: "daily_schedule") @@ -270,13 +270,13 @@ mixin _$Datum { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $DatumCopyWith get copyWith => throw _privateConstructorUsedError; + $DietCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $DatumCopyWith<$Res> { - factory $DatumCopyWith(Datum value, $Res Function(Datum) then) = - _$DatumCopyWithImpl<$Res, Datum>; +abstract class $DietCopyWith<$Res> { + factory $DietCopyWith(Diet value, $Res Function(Diet) then) = + _$DietCopyWithImpl<$Res, Diet>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -284,7 +284,7 @@ abstract class $DatumCopyWith<$Res> { @JsonKey(name: "image") String image, @JsonKey(name: "duration") int duration, @JsonKey(name: "state") String state, - @JsonKey(name: "type") Type type, + @JsonKey(name: "type") DietType type, @JsonKey(name: "details") String details, @JsonKey(name: "daily_schedule") List>> dailySchedule, @@ -293,14 +293,14 @@ abstract class $DatumCopyWith<$Res> { @JsonKey(name: "total_views") int totalViews, @JsonKey(name: "total_comments") int totalComments}); - $TypeCopyWith<$Res> get type; + $DietTypeCopyWith<$Res> get type; $AuthorCopyWith<$Res> get author; } /// @nodoc -class _$DatumCopyWithImpl<$Res, $Val extends Datum> - implements $DatumCopyWith<$Res> { - _$DatumCopyWithImpl(this._value, this._then); +class _$DietCopyWithImpl<$Res, $Val extends Diet> + implements $DietCopyWith<$Res> { + _$DietCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -347,7 +347,7 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> type: null == type ? _value.type : type // ignore: cast_nullable_to_non_nullable - as Type, + as DietType, details: null == details ? _value.details : details // ignore: cast_nullable_to_non_nullable @@ -377,8 +377,8 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> @override @pragma('vm:prefer-inline') - $TypeCopyWith<$Res> get type { - return $TypeCopyWith<$Res>(_value.type, (value) { + $DietTypeCopyWith<$Res> get type { + return $DietTypeCopyWith<$Res>(_value.type, (value) { return _then(_value.copyWith(type: value) as $Val); }); } @@ -393,10 +393,10 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> } /// @nodoc -abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> { - factory _$$DatumImplCopyWith( - _$DatumImpl value, $Res Function(_$DatumImpl) then) = - __$$DatumImplCopyWithImpl<$Res>; +abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> { + factory _$$DietImplCopyWith( + _$DietImpl value, $Res Function(_$DietImpl) then) = + __$$DietImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -405,7 +405,7 @@ abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> { @JsonKey(name: "image") String image, @JsonKey(name: "duration") int duration, @JsonKey(name: "state") String state, - @JsonKey(name: "type") Type type, + @JsonKey(name: "type") DietType type, @JsonKey(name: "details") String details, @JsonKey(name: "daily_schedule") List>> dailySchedule, @@ -415,17 +415,16 @@ abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> { @JsonKey(name: "total_comments") int totalComments}); @override - $TypeCopyWith<$Res> get type; + $DietTypeCopyWith<$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) +class __$$DietImplCopyWithImpl<$Res> + extends _$DietCopyWithImpl<$Res, _$DietImpl> + implements _$$DietImplCopyWith<$Res> { + __$$DietImplCopyWithImpl(_$DietImpl _value, $Res Function(_$DietImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -444,7 +443,7 @@ class __$$DatumImplCopyWithImpl<$Res> Object? totalViews = null, Object? totalComments = null, }) { - return _then(_$DatumImpl( + return _then(_$DietImpl( id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -468,7 +467,7 @@ class __$$DatumImplCopyWithImpl<$Res> type: null == type ? _value.type : type // ignore: cast_nullable_to_non_nullable - as Type, + as DietType, details: null == details ? _value.details : details // ignore: cast_nullable_to_non_nullable @@ -499,8 +498,8 @@ class __$$DatumImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$DatumImpl implements _Datum { - const _$DatumImpl( +class _$DietImpl implements _Diet { + const _$DietImpl( {@JsonKey(name: "id") required this.id, @JsonKey(name: "name") required this.name, @JsonKey(name: "image") required this.image, @@ -516,8 +515,8 @@ class _$DatumImpl implements _Datum { @JsonKey(name: "total_comments") required this.totalComments}) : _dailySchedule = dailySchedule; - factory _$DatumImpl.fromJson(Map json) => - _$$DatumImplFromJson(json); + factory _$DietImpl.fromJson(Map json) => + _$$DietImplFromJson(json); @override @JsonKey(name: "id") @@ -536,7 +535,7 @@ class _$DatumImpl implements _Datum { final String state; @override @JsonKey(name: "type") - final Type type; + final DietType type; @override @JsonKey(name: "details") final String details; @@ -564,14 +563,14 @@ class _$DatumImpl implements _Datum { @override String toString() { - return 'Datum(id: $id, name: $name, image: $image, duration: $duration, state: $state, type: $type, details: $details, dailySchedule: $dailySchedule, author: $author, totalLikes: $totalLikes, totalViews: $totalViews, totalComments: $totalComments)'; + return 'Diet(id: $id, name: $name, image: $image, duration: $duration, state: $state, type: $type, details: $details, dailySchedule: $dailySchedule, author: $author, totalLikes: $totalLikes, totalViews: $totalViews, totalComments: $totalComments)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$DatumImpl && + other is _$DietImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.image, image) || other.image == image) && @@ -611,25 +610,25 @@ class _$DatumImpl implements _Datum { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DatumImplCopyWith<_$DatumImpl> get copyWith => - __$$DatumImplCopyWithImpl<_$DatumImpl>(this, _$identity); + _$$DietImplCopyWith<_$DietImpl> get copyWith => + __$$DietImplCopyWithImpl<_$DietImpl>(this, _$identity); @override Map toJson() { - return _$$DatumImplToJson( + return _$$DietImplToJson( this, ); } } -abstract class _Datum implements Datum { - const factory _Datum( +abstract class _Diet implements Diet { + const factory _Diet( {@JsonKey(name: "id") required final int id, @JsonKey(name: "name") required final String name, @JsonKey(name: "image") required final String image, @JsonKey(name: "duration") required final int duration, @JsonKey(name: "state") required final String state, - @JsonKey(name: "type") required final Type type, + @JsonKey(name: "type") required final DietType type, @JsonKey(name: "details") required final String details, @JsonKey(name: "daily_schedule") required final List>> dailySchedule, @@ -637,9 +636,9 @@ abstract class _Datum implements Datum { @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; + _$DietImpl; - factory _Datum.fromJson(Map json) = _$DatumImpl.fromJson; + factory _Diet.fromJson(Map json) = _$DietImpl.fromJson; @override @JsonKey(name: "id") @@ -658,7 +657,7 @@ abstract class _Datum implements Datum { String get state; @override @JsonKey(name: "type") - Type get type; + DietType get type; @override @JsonKey(name: "details") String get details; @@ -679,7 +678,7 @@ abstract class _Datum implements Datum { int get totalComments; @override @JsonKey(ignore: true) - _$$DatumImplCopyWith<_$DatumImpl> get copyWith => + _$$DietImplCopyWith<_$DietImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1112,12 +1111,12 @@ abstract class _DailySchedule implements DailySchedule { throw _privateConstructorUsedError; } -Type _$TypeFromJson(Map json) { - return _Type.fromJson(json); +DietType _$DietTypeFromJson(Map json) { + return _DietType.fromJson(json); } /// @nodoc -mixin _$Type { +mixin _$DietType { @JsonKey(name: "alko") bool? get alko => throw _privateConstructorUsedError; @JsonKey(name: "veg") @@ -1129,13 +1128,14 @@ mixin _$Type { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $TypeCopyWith get copyWith => throw _privateConstructorUsedError; + $DietTypeCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class $TypeCopyWith<$Res> { - factory $TypeCopyWith(Type value, $Res Function(Type) then) = - _$TypeCopyWithImpl<$Res, Type>; +abstract class $DietTypeCopyWith<$Res> { + factory $DietTypeCopyWith(DietType value, $Res Function(DietType) then) = + _$DietTypeCopyWithImpl<$Res, DietType>; @useResult $Res call( {@JsonKey(name: "alko") bool? alko, @@ -1145,9 +1145,9 @@ abstract class $TypeCopyWith<$Res> { } /// @nodoc -class _$TypeCopyWithImpl<$Res, $Val extends Type> - implements $TypeCopyWith<$Res> { - _$TypeCopyWithImpl(this._value, this._then); +class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> + implements $DietTypeCopyWith<$Res> { + _$DietTypeCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -1184,10 +1184,11 @@ class _$TypeCopyWithImpl<$Res, $Val extends Type> } /// @nodoc -abstract class _$$TypeImplCopyWith<$Res> implements $TypeCopyWith<$Res> { - factory _$$TypeImplCopyWith( - _$TypeImpl value, $Res Function(_$TypeImpl) then) = - __$$TypeImplCopyWithImpl<$Res>; +abstract class _$$DietTypeImplCopyWith<$Res> + implements $DietTypeCopyWith<$Res> { + factory _$$DietTypeImplCopyWith( + _$DietTypeImpl value, $Res Function(_$DietTypeImpl) then) = + __$$DietTypeImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -1198,10 +1199,11 @@ abstract class _$$TypeImplCopyWith<$Res> implements $TypeCopyWith<$Res> { } /// @nodoc -class __$$TypeImplCopyWithImpl<$Res> - extends _$TypeCopyWithImpl<$Res, _$TypeImpl> - implements _$$TypeImplCopyWith<$Res> { - __$$TypeImplCopyWithImpl(_$TypeImpl _value, $Res Function(_$TypeImpl) _then) +class __$$DietTypeImplCopyWithImpl<$Res> + extends _$DietTypeCopyWithImpl<$Res, _$DietTypeImpl> + implements _$$DietTypeImplCopyWith<$Res> { + __$$DietTypeImplCopyWithImpl( + _$DietTypeImpl _value, $Res Function(_$DietTypeImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1212,7 +1214,7 @@ class __$$TypeImplCopyWithImpl<$Res> Object? corb = freezed, Object? meat = freezed, }) { - return _then(_$TypeImpl( + return _then(_$DietTypeImpl( alko: freezed == alko ? _value.alko : alko // ignore: cast_nullable_to_non_nullable @@ -1235,15 +1237,15 @@ class __$$TypeImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$TypeImpl implements _Type { - const _$TypeImpl( +class _$DietTypeImpl implements _DietType { + const _$DietTypeImpl( {@JsonKey(name: "alko") this.alko, @JsonKey(name: "veg") this.veg, @JsonKey(name: "corb") this.corb, @JsonKey(name: "meat") this.meat}); - factory _$TypeImpl.fromJson(Map json) => - _$$TypeImplFromJson(json); + factory _$DietTypeImpl.fromJson(Map json) => + _$$DietTypeImplFromJson(json); @override @JsonKey(name: "alko") @@ -1260,14 +1262,14 @@ class _$TypeImpl implements _Type { @override String toString() { - return 'Type(alko: $alko, veg: $veg, corb: $corb, meat: $meat)'; + return 'DietType(alko: $alko, veg: $veg, corb: $corb, meat: $meat)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$TypeImpl && + other is _$DietTypeImpl && (identical(other.alko, alko) || other.alko == alko) && (identical(other.veg, veg) || other.veg == veg) && (identical(other.corb, corb) || other.corb == corb) && @@ -1281,25 +1283,26 @@ class _$TypeImpl implements _Type { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$TypeImplCopyWith<_$TypeImpl> get copyWith => - __$$TypeImplCopyWithImpl<_$TypeImpl>(this, _$identity); + _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => + __$$DietTypeImplCopyWithImpl<_$DietTypeImpl>(this, _$identity); @override Map toJson() { - return _$$TypeImplToJson( + return _$$DietTypeImplToJson( this, ); } } -abstract class _Type implements Type { - const factory _Type( +abstract class _DietType implements DietType { + const factory _DietType( {@JsonKey(name: "alko") final bool? alko, @JsonKey(name: "veg") final bool? veg, @JsonKey(name: "corb") final bool? corb, - @JsonKey(name: "meat") final bool? meat}) = _$TypeImpl; + @JsonKey(name: "meat") final bool? meat}) = _$DietTypeImpl; - factory _Type.fromJson(Map json) = _$TypeImpl.fromJson; + factory _DietType.fromJson(Map json) = + _$DietTypeImpl.fromJson; @override @JsonKey(name: "alko") @@ -1315,712 +1318,6 @@ abstract class _Type implements Type { bool? get meat; @override @JsonKey(ignore: true) - _$$TypeImplCopyWith<_$TypeImpl> get copyWith => - throw _privateConstructorUsedError; -} - -Links _$LinksFromJson(Map json) { - return _Links.fromJson(json); -} - -/// @nodoc -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>; - @useResult - $Res call( - {@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> { - _$LinksCopyWithImpl(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? first = null, - Object? last = null, - Object? prev = freezed, - Object? next = freezed, - }) { - return _then(_value.copyWith( - first: null == first - ? _value.first - : first // ignore: cast_nullable_to_non_nullable - as String, - last: null == last - ? _value.last - : last // ignore: cast_nullable_to_non_nullable - as String, - prev: freezed == prev - ? _value.prev - : prev // ignore: cast_nullable_to_non_nullable - as dynamic, - next: freezed == next - ? _value.next - : next // ignore: cast_nullable_to_non_nullable - as dynamic, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$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}); -} - -/// @nodoc -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 - $Res call({ - Object? first = null, - Object? last = null, - Object? prev = freezed, - Object? next = freezed, - }) { - return _then(_$LinksImpl( - first: null == first - ? _value.first - : first // ignore: cast_nullable_to_non_nullable - as String, - last: null == last - ? _value.last - : last // ignore: cast_nullable_to_non_nullable - as String, - prev: freezed == prev - ? _value.prev - : prev // ignore: cast_nullable_to_non_nullable - as dynamic, - next: freezed == next - ? _value.next - : next // ignore: cast_nullable_to_non_nullable - as dynamic, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$LinksImpl implements _Links { - const _$LinksImpl( - {@JsonKey(name: "first") required this.first, - @JsonKey(name: "last") required this.last, - @JsonKey(name: "prev") required this.prev, - @JsonKey(name: "next") required this.next}); - - factory _$LinksImpl.fromJson(Map json) => - _$$LinksImplFromJson(json); - - @override - @JsonKey(name: "first") - final String first; - @override - @JsonKey(name: "last") - final String last; - @override - @JsonKey(name: "prev") - final dynamic prev; - @override - @JsonKey(name: "next") - final dynamic next; - - @override - String toString() { - return 'Links(first: $first, last: $last, prev: $prev, next: $next)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$LinksImpl && - (identical(other.first, first) || other.first == first) && - (identical(other.last, last) || other.last == last) && - const DeepCollectionEquality().equals(other.prev, prev) && - const DeepCollectionEquality().equals(other.next, next)); - } - - @JsonKey(ignore: true) - @override - 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); - - @override - Map toJson() { - return _$$LinksImplToJson( - this, - ); - } -} - -abstract class _Links implements Links { - const factory _Links( - {@JsonKey(name: "first") required final String first, - @JsonKey(name: "last") required final String last, - @JsonKey(name: "prev") required final dynamic prev, - @JsonKey(name: "next") required final dynamic next}) = _$LinksImpl; - - factory _Links.fromJson(Map json) = _$LinksImpl.fromJson; - - @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; -} - -Meta _$MetaFromJson(Map json) { - return _Meta.fromJson(json); -} - -/// @nodoc -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>; - @useResult - $Res call( - {@JsonKey(name: "current_page") int currentPage, - @JsonKey(name: "from") int from, - @JsonKey(name: "last_page") int lastPage, - @JsonKey(name: "links") List links, - @JsonKey(name: "path") String path, - @JsonKey(name: "per_page") int perPage, - @JsonKey(name: "to") int to, - @JsonKey(name: "total") int total}); -} - -/// @nodoc -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; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? currentPage = null, - Object? from = null, - Object? lastPage = null, - Object? links = null, - Object? path = null, - Object? perPage = null, - Object? to = null, - Object? total = null, - }) { - return _then(_value.copyWith( - currentPage: null == currentPage - ? _value.currentPage - : currentPage // ignore: cast_nullable_to_non_nullable - as int, - from: null == from - ? _value.from - : from // ignore: cast_nullable_to_non_nullable - as int, - lastPage: null == lastPage - ? _value.lastPage - : lastPage // ignore: cast_nullable_to_non_nullable - as int, - links: null == links - ? _value.links - : links // ignore: cast_nullable_to_non_nullable - as List, - path: null == path - ? _value.path - : path // ignore: cast_nullable_to_non_nullable - as String, - perPage: null == perPage - ? _value.perPage - : perPage // ignore: cast_nullable_to_non_nullable - as int, - to: null == to - ? _value.to - : to // ignore: cast_nullable_to_non_nullable - as int, - total: null == total - ? _value.total - : total // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { - factory _$$MetaImplCopyWith( - _$MetaImpl value, $Res Function(_$MetaImpl) then) = - __$$MetaImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: "current_page") int currentPage, - @JsonKey(name: "from") int from, - @JsonKey(name: "last_page") int lastPage, - @JsonKey(name: "links") List links, - @JsonKey(name: "path") String path, - @JsonKey(name: "per_page") int perPage, - @JsonKey(name: "to") int to, - @JsonKey(name: "total") int total}); -} - -/// @nodoc -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 - $Res call({ - Object? currentPage = null, - Object? from = null, - Object? lastPage = null, - Object? links = null, - Object? path = null, - Object? perPage = null, - Object? to = null, - Object? total = null, - }) { - return _then(_$MetaImpl( - currentPage: null == currentPage - ? _value.currentPage - : currentPage // ignore: cast_nullable_to_non_nullable - as int, - from: null == from - ? _value.from - : from // ignore: cast_nullable_to_non_nullable - as int, - lastPage: null == lastPage - ? _value.lastPage - : lastPage // ignore: cast_nullable_to_non_nullable - as int, - links: null == links - ? _value._links - : links // ignore: cast_nullable_to_non_nullable - as List, - path: null == path - ? _value.path - : path // ignore: cast_nullable_to_non_nullable - as String, - perPage: null == perPage - ? _value.perPage - : perPage // ignore: cast_nullable_to_non_nullable - as int, - to: null == to - ? _value.to - : to // ignore: cast_nullable_to_non_nullable - as int, - total: null == total - ? _value.total - : total // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$MetaImpl implements _Meta { - const _$MetaImpl( - {@JsonKey(name: "current_page") required this.currentPage, - @JsonKey(name: "from") required this.from, - @JsonKey(name: "last_page") required this.lastPage, - @JsonKey(name: "links") required final List links, - @JsonKey(name: "path") required this.path, - @JsonKey(name: "per_page") required this.perPage, - @JsonKey(name: "to") required this.to, - @JsonKey(name: "total") required this.total}) - : _links = links; - - factory _$MetaImpl.fromJson(Map json) => - _$$MetaImplFromJson(json); - - @override - @JsonKey(name: "current_page") - final int currentPage; - @override - @JsonKey(name: "from") - final int from; - @override - @JsonKey(name: "last_page") - final int lastPage; - final List _links; - @override - @JsonKey(name: "links") - List get links { - if (_links is EqualUnmodifiableListView) return _links; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_links); - } - - @override - @JsonKey(name: "path") - final String path; - @override - @JsonKey(name: "per_page") - final int perPage; - @override - @JsonKey(name: "to") - final int to; - @override - @JsonKey(name: "total") - final int total; - - @override - String toString() { - return 'Meta(currentPage: $currentPage, from: $from, lastPage: $lastPage, links: $links, path: $path, perPage: $perPage, to: $to, total: $total)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$MetaImpl && - (identical(other.currentPage, currentPage) || - other.currentPage == currentPage) && - (identical(other.from, from) || other.from == from) && - (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) && - (identical(other.to, to) || other.to == to) && - (identical(other.total, total) || other.total == total)); - } - - @JsonKey(ignore: true) - @override - 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); - - @override - Map toJson() { - return _$$MetaImplToJson( - this, - ); - } -} - -abstract class _Meta implements Meta { - const factory _Meta( - {@JsonKey(name: "current_page") required final int currentPage, - @JsonKey(name: "from") required final int from, - @JsonKey(name: "last_page") required final int lastPage, - @JsonKey(name: "links") required final List links, - @JsonKey(name: "path") required final String path, - @JsonKey(name: "per_page") required final int perPage, - @JsonKey(name: "to") required final int to, - @JsonKey(name: "total") required final int total}) = _$MetaImpl; - - factory _Meta.fromJson(Map json) = _$MetaImpl.fromJson; - - @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; -} - -Link _$LinkFromJson(Map json) { - return _Link.fromJson(json); -} - -/// @nodoc -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>; - @useResult - $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> { - _$LinkCopyWithImpl(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? url = freezed, - Object? label = null, - Object? active = null, - }) { - return _then(_value.copyWith( - url: freezed == url - ? _value.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - active: null == active - ? _value.active - : active // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$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}); -} - -/// @nodoc -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 - $Res call({ - Object? url = freezed, - Object? label = null, - Object? active = null, - }) { - return _then(_$LinkImpl( - url: freezed == url - ? _value.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - active: null == active - ? _value.active - : active // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// @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}); - - factory _$LinkImpl.fromJson(Map json) => - _$$LinkImplFromJson(json); - - @override - @JsonKey(name: "url") - final String? url; - @override - @JsonKey(name: "label") - final String label; - @override - @JsonKey(name: "active") - final bool active; - - @override - String toString() { - return 'Link(url: $url, label: $label, active: $active)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$LinkImpl && - (identical(other.url, url) || other.url == url) && - (identical(other.label, label) || other.label == label) && - (identical(other.active, active) || other.active == active)); - } - - @JsonKey(ignore: true) - @override - int get hashCode => Object.hash(runtimeType, url, label, active); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => - __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); - - @override - Map toJson() { - return _$$LinkImplToJson( - this, - ); - } -} - -abstract class _Link implements Link { - const factory _Link( - {@JsonKey(name: "url") required final String? url, - @JsonKey(name: "label") required final String label, - @JsonKey(name: "active") required final bool active}) = _$LinkImpl; - - factory _Link.fromJson(Map json) = _$LinkImpl.fromJson; - - @override - @JsonKey(name: "url") - String? get url; - @override - @JsonKey(name: "label") - String get label; - @override - @JsonKey(name: "active") - bool get active; - @override - @JsonKey(ignore: true) - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => + _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/diets_pagination_model.g.dart b/lib/features/feed/models/diets_pagination_model.g.dart index 0a745095..7fcab8cd 100644 --- a/lib/features/feed/models/diets_pagination_model.g.dart +++ b/lib/features/feed/models/diets_pagination_model.g.dart @@ -10,7 +10,7 @@ _$DietsPaginationImpl _$$DietsPaginationImplFromJson( Map json) => _$DietsPaginationImpl( data: (json['data'] as List) - .map((e) => Datum.fromJson(e as Map)) + .map((e) => Diet.fromJson(e as Map)) .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), @@ -24,13 +24,13 @@ Map _$$DietsPaginationImplToJson( 'meta': instance.meta, }; -_$DatumImpl _$$DatumImplFromJson(Map json) => _$DatumImpl( +_$DietImpl _$$DietImplFromJson(Map json) => _$DietImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, image: json['image'] as String, duration: (json['duration'] as num).toInt(), state: json['state'] as String, - type: Type.fromJson(json['type'] as Map), + type: DietType.fromJson(json['type'] as Map), details: json['details'] as String, dailySchedule: (json['daily_schedule'] as List) .map((e) => (e as List) @@ -45,7 +45,7 @@ _$DatumImpl _$$DatumImplFromJson(Map json) => _$DatumImpl( totalComments: (json['total_comments'] as num).toInt(), ); -Map _$$DatumImplToJson(_$DatumImpl instance) => +Map _$$DietImplToJson(_$DietImpl instance) => { 'id': instance.id, 'name': instance.name, @@ -98,70 +98,18 @@ const _$PortionEnumMap = { Portion.PCS: 'pcs', }; -_$TypeImpl _$$TypeImplFromJson(Map json) => _$TypeImpl( +_$DietTypeImpl _$$DietTypeImplFromJson(Map json) => + _$DietTypeImpl( alko: json['alko'] as bool?, veg: json['veg'] as bool?, corb: json['corb'] as bool?, meat: json['meat'] as bool?, ); -Map _$$TypeImplToJson(_$TypeImpl instance) => +Map _$$DietTypeImplToJson(_$DietTypeImpl instance) => { 'alko': instance.alko, 'veg': instance.veg, 'corb': instance.corb, 'meat': instance.meat, }; - -_$LinksImpl _$$LinksImplFromJson(Map json) => _$LinksImpl( - first: json['first'] as String, - last: json['last'] as String, - prev: json['prev'], - next: json['next'], - ); - -Map _$$LinksImplToJson(_$LinksImpl instance) => - { - 'first': instance.first, - 'last': instance.last, - 'prev': instance.prev, - 'next': instance.next, - }; - -_$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(), - 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) => - { - 'current_page': instance.currentPage, - 'from': instance.from, - 'last_page': instance.lastPage, - 'links': instance.links, - 'path': instance.path, - 'per_page': instance.perPage, - 'to': instance.to, - 'total': instance.total, - }; - -_$LinkImpl _$$LinkImplFromJson(Map json) => _$LinkImpl( - url: json['url'] as String?, - label: json['label'] as String, - active: json['active'] as bool, - ); - -Map _$$LinkImplToJson(_$LinkImpl instance) => - { - 'url': instance.url, - 'label': instance.label, - 'active': instance.active, - }; 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 66e0ecf3..2dcd22a1 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; +import 'package:eatvio_app/core/models/base_models.dart'; import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.dart index 2f910856..1be83081 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.dart @@ -10,7 +10,7 @@ abstract class CommentsState with _$CommentsState { const factory CommentsState.loading() = CommentsStateLoading; const factory CommentsState.loaded({ - required Comment comment, + required CommentModel comment, }) = CommentsStateLoaded; const factory CommentsState.error({ diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart index da3d0345..d4993b5b 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart @@ -20,7 +20,7 @@ mixin _$CommentsState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(Comment comment) loaded, + required TResult Function(CommentModel comment) loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; @@ -28,7 +28,7 @@ mixin _$CommentsState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(Comment comment)? loaded, + TResult? Function(CommentModel comment)? loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -36,7 +36,7 @@ mixin _$CommentsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(Comment comment)? loaded, + TResult Function(CommentModel comment)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -126,7 +126,7 @@ class _$CommentsStateImpl implements _CommentsState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(Comment comment) loaded, + required TResult Function(CommentModel comment) loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -137,7 +137,7 @@ class _$CommentsStateImpl implements _CommentsState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(Comment comment)? loaded, + TResult? Function(CommentModel comment)? loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -148,7 +148,7 @@ class _$CommentsStateImpl implements _CommentsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(Comment comment)? loaded, + TResult Function(CommentModel comment)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -241,7 +241,7 @@ class _$CommentsStateLoadingImpl implements CommentsStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(Comment comment) loaded, + required TResult Function(CommentModel comment) loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -252,7 +252,7 @@ class _$CommentsStateLoadingImpl implements CommentsStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(Comment comment)? loaded, + TResult? Function(CommentModel comment)? loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -263,7 +263,7 @@ class _$CommentsStateLoadingImpl implements CommentsStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(Comment comment)? loaded, + TResult Function(CommentModel comment)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -321,9 +321,9 @@ abstract class _$$CommentsStateLoadedImplCopyWith<$Res> { $Res Function(_$CommentsStateLoadedImpl) then) = __$$CommentsStateLoadedImplCopyWithImpl<$Res>; @useResult - $Res call({Comment comment}); + $Res call({CommentModel comment}); - $CommentCopyWith<$Res> get comment; + $CommentModelCopyWith<$Res> get comment; } /// @nodoc @@ -343,14 +343,14 @@ class __$$CommentsStateLoadedImplCopyWithImpl<$Res> comment: null == comment ? _value.comment : comment // ignore: cast_nullable_to_non_nullable - as Comment, + as CommentModel, )); } @override @pragma('vm:prefer-inline') - $CommentCopyWith<$Res> get comment { - return $CommentCopyWith<$Res>(_value.comment, (value) { + $CommentModelCopyWith<$Res> get comment { + return $CommentModelCopyWith<$Res>(_value.comment, (value) { return _then(_value.copyWith(comment: value)); }); } @@ -362,7 +362,7 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { const _$CommentsStateLoadedImpl({required this.comment}); @override - final Comment comment; + final CommentModel comment; @override String toString() { @@ -392,7 +392,7 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(Comment comment) loaded, + required TResult Function(CommentModel comment) loaded, required TResult Function(String errorMessage) error, }) { return loaded(comment); @@ -403,7 +403,7 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(Comment comment)? loaded, + TResult? Function(CommentModel comment)? loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(comment); @@ -414,7 +414,7 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(Comment comment)? loaded, + TResult Function(CommentModel comment)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -463,10 +463,10 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { } abstract class CommentsStateLoaded implements CommentsState { - const factory CommentsStateLoaded({required final Comment comment}) = + const factory CommentsStateLoaded({required final CommentModel comment}) = _$CommentsStateLoadedImpl; - Comment get comment; + CommentModel get comment; @JsonKey(ignore: true) _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; @@ -540,7 +540,7 @@ class _$CommentsStateErrorImpl implements CommentsStateError { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(Comment comment) loaded, + required TResult Function(CommentModel comment) loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -551,7 +551,7 @@ class _$CommentsStateErrorImpl implements CommentsStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(Comment comment)? loaded, + TResult? Function(CommentModel comment)? loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -562,7 +562,7 @@ class _$CommentsStateErrorImpl implements CommentsStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(Comment comment)? loaded, + TResult Function(CommentModel comment)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart index 8cd8a522..abad1c19 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart @@ -1,18 +1,47 @@ import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart'; import 'package:eatvio_app/features/feed/repositories/feed_repository.dart'; +import 'package:eatvio_app/features/recipes/models/recipe_tag_model.dart'; +import 'package:eatvio_app/features/recipes/reporitories/recipe_repository.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class RecipesCubit extends Cubit { final FeedRepository feedRepository; + final RecipeRepository recipeRepository; + Set _selectedTags = {}; - RecipesCubit({required this.feedRepository}) : super(const RecipesState.loading()); + RecipesCubit({ + required this.feedRepository, + required this.recipeRepository, + }) : super(const RecipesState.loading()); - loadRecipesList() async { + loadRecipesList({ + String? query, + }) async { + emit(const RecipesState.loading()); try { - final recipesList = await feedRepository.getRecipes(); - emit(RecipesState.loaded(recipesList: recipesList)); + print('asdasdasdasda'); + print(query); + final recipesList = await feedRepository.getRecipes( + tags: _selectedTags.toList(), + query: query, + ); + final recipesTags = (await recipeRepository.getRecipesTags()); + emit(RecipesState.loaded( + recipesList: recipesList, + recipesTags: recipesTags, + selectedTags: _selectedTags, + selectedTagsCounter: _selectedTags.length, + )); } catch (e) { emit(RecipesState.error(errorMessage: e.toString())); } } + + updateTags(RecipeTag tag) { + _selectedTags.contains(tag.id) ? _selectedTags.remove(tag.id) : _selectedTags.add(tag.id); + emit((state as RecipesStateLoaded).copyWith( + selectedTags: _selectedTags, + selectedTagsCounter: _selectedTags.length, + )); + } } diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart index ecdf17c2..1c2e7f23 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart @@ -1,4 +1,5 @@ import 'package:eatvio_app/features/feed/models/recipes_model.dart'; +import 'package:eatvio_app/features/recipes/models/recipe_tag_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'recipes_state.freezed.dart'; @@ -11,6 +12,9 @@ abstract class RecipesState with _$RecipesState { const factory RecipesState.loaded({ required List recipesList, + required List recipesTags, + required Set selectedTags, + required int selectedTagsCounter, }) = RecipesStateLoaded; const factory RecipesState.error({ diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart index e8aa88e0..fc7fe0c6 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart @@ -20,7 +20,12 @@ mixin _$RecipesState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; @@ -28,7 +33,9 @@ mixin _$RecipesState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -36,7 +43,9 @@ mixin _$RecipesState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -126,7 +135,12 @@ class _$RecipesStateImpl implements _RecipesState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -137,7 +151,9 @@ class _$RecipesStateImpl implements _RecipesState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -148,7 +164,9 @@ class _$RecipesStateImpl implements _RecipesState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -241,7 +259,12 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -252,7 +275,9 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -263,7 +288,9 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -321,7 +348,11 @@ abstract class _$$RecipesStateLoadedImplCopyWith<$Res> { $Res Function(_$RecipesStateLoadedImpl) then) = __$$RecipesStateLoadedImplCopyWithImpl<$Res>; @useResult - $Res call({List recipesList}); + $Res call( + {List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter}); } /// @nodoc @@ -336,12 +367,27 @@ class __$$RecipesStateLoadedImplCopyWithImpl<$Res> @override $Res call({ Object? recipesList = null, + Object? recipesTags = null, + Object? selectedTags = null, + Object? selectedTagsCounter = null, }) { return _then(_$RecipesStateLoadedImpl( recipesList: null == recipesList ? _value._recipesList : recipesList // ignore: cast_nullable_to_non_nullable as List, + recipesTags: null == recipesTags + ? _value._recipesTags + : recipesTags // ignore: cast_nullable_to_non_nullable + as List, + selectedTags: null == selectedTags + ? _value._selectedTags + : selectedTags // ignore: cast_nullable_to_non_nullable + as Set, + selectedTagsCounter: null == selectedTagsCounter + ? _value.selectedTagsCounter + : selectedTagsCounter // ignore: cast_nullable_to_non_nullable + as int, )); } } @@ -349,8 +395,14 @@ class __$$RecipesStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$RecipesStateLoadedImpl implements RecipesStateLoaded { - const _$RecipesStateLoadedImpl({required final List recipesList}) - : _recipesList = recipesList; + const _$RecipesStateLoadedImpl( + {required final List recipesList, + required final List recipesTags, + required final Set selectedTags, + required this.selectedTagsCounter}) + : _recipesList = recipesList, + _recipesTags = recipesTags, + _selectedTags = selectedTags; final List _recipesList; @override @@ -360,9 +412,28 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { return EqualUnmodifiableListView(_recipesList); } + final List _recipesTags; + @override + List get recipesTags { + if (_recipesTags is EqualUnmodifiableListView) return _recipesTags; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_recipesTags); + } + + final Set _selectedTags; + @override + Set get selectedTags { + if (_selectedTags is EqualUnmodifiableSetView) return _selectedTags; + // ignore: implicit_dynamic_type + return EqualUnmodifiableSetView(_selectedTags); + } + + @override + final int selectedTagsCounter; + @override String toString() { - return 'RecipesState.loaded(recipesList: $recipesList)'; + return 'RecipesState.loaded(recipesList: $recipesList, recipesTags: $recipesTags, selectedTags: $selectedTags, selectedTagsCounter: $selectedTagsCounter)'; } @override @@ -371,12 +442,22 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { (other.runtimeType == runtimeType && other is _$RecipesStateLoadedImpl && const DeepCollectionEquality() - .equals(other._recipesList, _recipesList)); + .equals(other._recipesList, _recipesList) && + const DeepCollectionEquality() + .equals(other._recipesTags, _recipesTags) && + const DeepCollectionEquality() + .equals(other._selectedTags, _selectedTags) && + (identical(other.selectedTagsCounter, selectedTagsCounter) || + other.selectedTagsCounter == selectedTagsCounter)); } @override int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_recipesList)); + runtimeType, + const DeepCollectionEquality().hash(_recipesList), + const DeepCollectionEquality().hash(_recipesTags), + const DeepCollectionEquality().hash(_selectedTags), + selectedTagsCounter); @JsonKey(ignore: true) @override @@ -390,10 +471,15 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter) + loaded, required TResult Function(String errorMessage) error, }) { - return loaded(recipesList); + return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter); } @override @@ -401,10 +487,13 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter)? + loaded, TResult? Function(String errorMessage)? error, }) { - return loaded?.call(recipesList); + return loaded?.call( + recipesList, recipesTags, selectedTags, selectedTagsCounter); } @override @@ -412,12 +501,15 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { if (loaded != null) { - return loaded(recipesList); + return loaded( + recipesList, recipesTags, selectedTags, selectedTagsCounter); } return orElse(); } @@ -461,10 +553,16 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { } abstract class RecipesStateLoaded implements RecipesState { - const factory RecipesStateLoaded({required final List recipesList}) = - _$RecipesStateLoadedImpl; + const factory RecipesStateLoaded( + {required final List recipesList, + required final List recipesTags, + required final Set selectedTags, + required final int selectedTagsCounter}) = _$RecipesStateLoadedImpl; List get recipesList; + List get recipesTags; + Set get selectedTags; + int get selectedTagsCounter; @JsonKey(ignore: true) _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; @@ -538,7 +636,12 @@ class _$RecipesStateErrorImpl implements RecipesStateError { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -549,7 +652,9 @@ class _$RecipesStateErrorImpl implements RecipesStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -560,7 +665,9 @@ class _$RecipesStateErrorImpl implements RecipesStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { diff --git a/lib/features/feed/presentation/pages/feed_screen.dart b/lib/features/feed/presentation/pages/feed_screen.dart index 662c06ec..241d454a 100644 --- a/lib/features/feed/presentation/pages/feed_screen.dart +++ b/lib/features/feed/presentation/pages/feed_screen.dart @@ -1,3 +1,4 @@ +import 'package:easy_debounce/easy_debounce.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_state.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; @@ -7,6 +8,7 @@ import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes import 'package:eatvio_app/features/feed/presentation/widgets/blog_post_widget.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/diets_widget.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/recipes_widget.dart'; +import 'package:eatvio_app/features/feed/presentation/widgets/tags_modal_widget.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -21,13 +23,44 @@ class FeedScreen extends StatefulWidget { } class _FeedScreenState extends State { + final searchController = TextEditingController(); final List chipsLabelList = ['Все', 'Рецепты', 'Диеты', 'Планы питания', 'Консультанты']; - int _selectedChipIndex = 0; @override Widget build(BuildContext context) { return Scaffold( + floatingActionButton: _selectedChipIndex == 1 + ? FloatingActionButton.small( + backgroundColor: appTheme.blueA400, + shape: CircleBorder(), + child: Icon( + Icons.filter_list_rounded, + color: Colors.white, + ), + onPressed: () async { + await showModalBottomSheet( + useRootNavigator: true, + context: context, + builder: (context) { + return BlocBuilder( + builder: (BuildContext context, RecipesState state) { + if (state is RecipesStateLoaded) { + return TagsModalWidget( + tagsList: state.recipesTags, + selectedTags: state.selectedTags, + ); + } else { + return Container(); + } + }, + ); + }, + ); + context.read().loadRecipesList(); + }, + ) + : null, appBar: AppBar( backgroundColor: Colors.white, toolbarHeight: 0, @@ -85,7 +118,7 @@ class _FeedScreenState extends State { shrinkWrap: true, physics: BouncingScrollPhysics(), itemBuilder: (context, index) { - return DietsWidget(datum: state.diets.data[index]); + return DietsWidget(diet: state.diets.data[index]); }, separatorBuilder: (context, index) { return SizedBox(height: 8); @@ -247,9 +280,35 @@ class _FeedScreenState extends State { height: 40, width: MediaQuery.of(context).size.width - 84, child: TextFormField( + controller: searchController, style: TextStyle( fontSize: 12, ), + onChanged: (query) { + if (query.length > 2) { + EasyDebounce.debounce( + 'searchFeed', + Duration(milliseconds: 500), + () { + switch (_selectedChipIndex) { + case 1: + context.read().loadRecipesList(query: query); + } + }, + ); + } else { + EasyDebounce.debounce( + 'searchFeed', + Duration(milliseconds: 500), + () { + switch (_selectedChipIndex) { + case 1: + context.read().loadRecipesList(query: query); + } + }, + ); + } + }, decoration: InputDecoration( hintText: 'Поиск', hintStyle: TextStyle( @@ -304,6 +363,8 @@ class _FeedScreenState extends State { onSelected: (bool selected) { setState(() { _selectedChipIndex = index; + searchController.clear(); + FocusScope.of(context).requestFocus(new FocusNode()); }); }, ); diff --git a/lib/features/feed/presentation/widgets/diets_widget.dart b/lib/features/feed/presentation/widgets/diets_widget.dart index 38f589cf..bf94f9aa 100644 --- a/lib/features/feed/presentation/widgets/diets_widget.dart +++ b/lib/features/feed/presentation/widgets/diets_widget.dart @@ -5,9 +5,9 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class DietsWidget extends StatefulWidget { - final Datum datum; + final Diet diet; - const DietsWidget({super.key, required this.datum}); + const DietsWidget({super.key, required this.diet}); @override State createState() => _DietsWidgetState(); @@ -18,7 +18,7 @@ class _DietsWidgetState extends State { Widget build(BuildContext context) { return InkWell( borderRadius: BorderRadius.circular(12), - onTap: () => GoRouter.of(context).pushNamed('aboutDietScreen', extra: widget.datum), + onTap: () => GoRouter.of(context).pushNamed('aboutDietScreen', extra: widget.diet), child: Ink( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), @@ -33,7 +33,7 @@ class _DietsWidgetState extends State { ClipRRect( borderRadius: BorderRadius.vertical(top: Radius.circular(12)), child: CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + widget.datum.image, + imageUrl: baseUrl + '/storage/' + widget.diet.image, ), ), Positioned( @@ -44,9 +44,9 @@ class _DietsWidgetState extends State { children: [ _iconButton(Icons.fastfood, '139.9 ккал'), SizedBox(width: 8), - _iconButton(Icons.timer_rounded, widget.datum.state), + _iconButton(Icons.timer_rounded, widget.diet.state), SizedBox(width: 8), - _iconButton(Icons.fast_forward_rounded, widget.datum.duration.toString()), + _iconButton(Icons.fast_forward_rounded, widget.diet.duration.toString()), ], ), ), @@ -68,7 +68,7 @@ class _DietsWidgetState extends State { ), SizedBox(width: 4), Text( - widget.datum.totalLikes.toString(), + widget.diet.totalLikes.toString(), style: TextStyle( fontSize: 12, color: Colors.black, @@ -97,7 +97,7 @@ class _DietsWidgetState extends State { ), SizedBox(width: 4), Text( - widget.datum.totalViews.toString(), + widget.diet.totalViews.toString(), style: TextStyle( fontSize: 12, color: Colors.black, @@ -114,7 +114,7 @@ class _DietsWidgetState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 12), child: Text( - widget.datum.name, + widget.diet.name, style: TextStyle( fontWeight: FontWeight.w600, color: Colors.black87, @@ -125,7 +125,7 @@ class _DietsWidgetState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 12), child: Text( - widget.datum.details, + widget.diet.details, style: TextStyle( color: Colors.black87, ), diff --git a/lib/features/feed/presentation/widgets/tags_modal_widget.dart b/lib/features/feed/presentation/widgets/tags_modal_widget.dart new file mode 100644 index 00000000..724f91a8 --- /dev/null +++ b/lib/features/feed/presentation/widgets/tags_modal_widget.dart @@ -0,0 +1,65 @@ +import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart'; +import 'package:eatvio_app/features/recipes/models/recipe_tag_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +class TagsModalWidget extends StatefulWidget { + final List tagsList; + final Set selectedTags; + + const TagsModalWidget({ + super.key, + required this.tagsList, + required this.selectedTags, + }); + + @override + State createState() => _TagsModalWidgetState(); +} + +class _TagsModalWidgetState extends State { + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(16), + width: MediaQuery.of(context).size.width, + child: Wrap( + spacing: 8, + runSpacing: -8, + children: [ + for (int i = 0; i < widget.tagsList.length; i++) + _tagChip( + tag: widget.tagsList[i], + isSelected: widget.selectedTags.contains(widget.tagsList[i].id), + ), + ], + ), + ); + } + + _tagChip({ + required RecipeTag tag, + required bool isSelected, + }) { + return ChoiceChip( + selectedColor: appTheme.blueA400, + pressElevation: 0, + showCheckmark: false, + side: BorderSide.none, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + label: Text(tag.name), + labelStyle: TextStyle( + color: isSelected ? Colors.white : appTheme.gray600, + fontWeight: FontWeight.w500, + fontSize: 12, + ), + selected: isSelected, + backgroundColor: appTheme.gray100, + onSelected: (bool selected) => context.read().updateTags(tag), + ); + } +} diff --git a/lib/features/feed/repositories/feed_repository.dart b/lib/features/feed/repositories/feed_repository.dart index 78cc2106..23089824 100644 --- a/lib/features/feed/repositories/feed_repository.dart +++ b/lib/features/feed/repositories/feed_repository.dart @@ -17,9 +17,16 @@ class FeedRepository { } } - Future> getRecipes() async { + Future> getRecipes({ + String? query, + List? tags, + }) async { try { - return (await feedService.getRecipes()).recipesList; + return (await feedService.getRecipes( + query: query, + tags: tags, + )) + .recipesList; } catch (e) { rethrow; } @@ -33,7 +40,7 @@ class FeedRepository { } } - Future getBlogPostComments(int id) async { + Future getBlogPostComments(int id) async { try { return (await feedService.getBlogPostComments(id: id)); } catch (e) { @@ -57,7 +64,7 @@ class FeedRepository { } } - Future getDietsComments(int id) async { + Future getDietsComments(int id) async { try { return (await feedService.getDietsComments(id: id)); } catch (e) { @@ -81,7 +88,7 @@ class FeedRepository { } } - Future getRecipesComments(String id) async { + Future getRecipesComments(String id) async { try { return (await feedService.getRecipesComments(id: id)); } catch (e) { diff --git a/lib/features/feed/services/feed_service.dart b/lib/features/feed/services/feed_service.dart index 44f5e33f..f282547e 100644 --- a/lib/features/feed/services/feed_service.dart +++ b/lib/features/feed/services/feed_service.dart @@ -17,13 +17,16 @@ abstract class FeedService { }); @GET('/api/recipes/index') - Future getRecipes(); + Future getRecipes({ + @Query('filters[tags][tags.id][\$in][]') required List? tags, + @Query('filters[title][\$contains]') required String? query, + }); @GET('/api/diets/index') Future getDiets(); @GET('/api/blogPosts/{id}/comments/show') - Future getBlogPostComments({ + Future getBlogPostComments({ @Path() required int id, }); @@ -35,7 +38,7 @@ abstract class FeedService { }); @GET('/api/diets/{id}/comments/show') - Future getDietsComments({ + Future getDietsComments({ @Path() required int id, }); @@ -47,7 +50,7 @@ abstract class FeedService { }); @GET('/api/recipes/{id}/comments/show') - Future getRecipesComments({ + Future getRecipesComments({ @Path() required String id, }); diff --git a/lib/features/feed/services/feed_service.g.dart b/lib/features/feed/services/feed_service.g.dart index 6ae8ffef..84016757 100644 --- a/lib/features/feed/services/feed_service.g.dart +++ b/lib/features/feed/services/feed_service.g.dart @@ -55,9 +55,16 @@ class _FeedService implements FeedService { } @override - Future getRecipes() async { + Future getRecipes({ + List? tags, + String? query, + }) async { final _extra = {}; - final queryParameters = {}; + final queryParameters = { + r'filters[tags][tags.id][$in][]': tags, + r'filters[title][$contains]': query, + }; + queryParameters.removeWhere((k, v) => v == null); final _headers = {}; const Map? _data = null; final _options = _setStreamType(Options( @@ -121,12 +128,12 @@ class _FeedService implements FeedService { } @override - Future getBlogPostComments({required int id}) async { + Future getBlogPostComments({required int id}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType(Options( + final _options = _setStreamType(Options( method: 'GET', headers: _headers, extra: _extra, @@ -143,9 +150,9 @@ class _FeedService implements FeedService { baseUrl, ))); final _result = await _dio.fetch>(_options); - late Comment _value; + late CommentModel _value; try { - _value = Comment.fromJson(_result.data!); + _value = CommentModel.fromJson(_result.data!); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -194,12 +201,12 @@ class _FeedService implements FeedService { } @override - Future getDietsComments({required int id}) async { + Future getDietsComments({required int id}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType(Options( + final _options = _setStreamType(Options( method: 'GET', headers: _headers, extra: _extra, @@ -216,9 +223,9 @@ class _FeedService implements FeedService { baseUrl, ))); final _result = await _dio.fetch>(_options); - late Comment _value; + late CommentModel _value; try { - _value = Comment.fromJson(_result.data!); + _value = CommentModel.fromJson(_result.data!); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -267,12 +274,12 @@ class _FeedService implements FeedService { } @override - Future getRecipesComments({required String id}) async { + Future getRecipesComments({required String id}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType(Options( + final _options = _setStreamType(Options( method: 'GET', headers: _headers, extra: _extra, @@ -289,9 +296,9 @@ class _FeedService implements FeedService { baseUrl, ))); final _result = await _dio.fetch>(_options); - late Comment _value; + late CommentModel _value; try { - _value = Comment.fromJson(_result.data!); + _value = CommentModel.fromJson(_result.data!); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; diff --git a/lib/features/profile/models/profile_model.dart b/lib/features/profile/models/profile_model.dart index 62dfc065..6aa5fc1a 100644 --- a/lib/features/profile/models/profile_model.dart +++ b/lib/features/profile/models/profile_model.dart @@ -6,7 +6,7 @@ part 'profile_model.g.dart'; class ProfileModel with _$ProfileModel { const factory ProfileModel({ @JsonKey(name: "user") required User user, - @JsonKey(name: "chartPoints") required List chartPoints, + @JsonKey(name: "chartPoints") required List chartPoints, @JsonKey(name: "userDetails") required UserDetails userDetails, @JsonKey(name: "circumferences") required List circumferences, @JsonKey(name: "finishedPlans") required List finishedPlans, @@ -96,15 +96,15 @@ class UserDetails with _$UserDetails { } @freezed -class ChartPoint with _$ChartPoint { - const factory ChartPoint({ +class ChartPointModel with _$ChartPointModel { + const factory ChartPointModel({ @JsonKey(name: "id") required int id, @JsonKey(name: "user_id") required int userId, @JsonKey(name: "weight") required double weight, @JsonKey(name: "bmi") required double bmi, @JsonKey(name: "created_at") required DateTime createdAt, @JsonKey(name: "updated_at") required DateTime updatedAt, - }) = _ChartPoint; + }) = _ChartPointModel; - factory ChartPoint.fromJson(Map json) => _$ChartPointFromJson(json); + factory ChartPointModel.fromJson(Map json) => _$ChartPointModelFromJson(json); } diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index 21954c15..ed199108 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -23,7 +23,7 @@ mixin _$ProfileModel { @JsonKey(name: "user") User get user => throw _privateConstructorUsedError; @JsonKey(name: "chartPoints") - List get chartPoints => throw _privateConstructorUsedError; + List get chartPoints => throw _privateConstructorUsedError; @JsonKey(name: "userDetails") UserDetails get userDetails => throw _privateConstructorUsedError; @JsonKey(name: "circumferences") @@ -55,7 +55,7 @@ abstract class $ProfileModelCopyWith<$Res> { @useResult $Res call( {@JsonKey(name: "user") User user, - @JsonKey(name: "chartPoints") List chartPoints, + @JsonKey(name: "chartPoints") List chartPoints, @JsonKey(name: "userDetails") UserDetails userDetails, @JsonKey(name: "circumferences") List circumferences, @JsonKey(name: "finishedPlans") List finishedPlans, @@ -101,7 +101,7 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> chartPoints: null == chartPoints ? _value.chartPoints : chartPoints // ignore: cast_nullable_to_non_nullable - as List, + as List, userDetails: null == userDetails ? _value.userDetails : userDetails // ignore: cast_nullable_to_non_nullable @@ -164,7 +164,7 @@ abstract class _$$ProfileModelImplCopyWith<$Res> @useResult $Res call( {@JsonKey(name: "user") User user, - @JsonKey(name: "chartPoints") List chartPoints, + @JsonKey(name: "chartPoints") List chartPoints, @JsonKey(name: "userDetails") UserDetails userDetails, @JsonKey(name: "circumferences") List circumferences, @JsonKey(name: "finishedPlans") List finishedPlans, @@ -210,7 +210,7 @@ class __$$ProfileModelImplCopyWithImpl<$Res> chartPoints: null == chartPoints ? _value._chartPoints : chartPoints // ignore: cast_nullable_to_non_nullable - as List, + as List, userDetails: null == userDetails ? _value.userDetails : userDetails // ignore: cast_nullable_to_non_nullable @@ -252,7 +252,8 @@ class __$$ProfileModelImplCopyWithImpl<$Res> class _$ProfileModelImpl implements _ProfileModel { const _$ProfileModelImpl( {@JsonKey(name: "user") required this.user, - @JsonKey(name: "chartPoints") required final List chartPoints, + @JsonKey(name: "chartPoints") + required final List chartPoints, @JsonKey(name: "userDetails") required this.userDetails, @JsonKey(name: "circumferences") required final List circumferences, @@ -280,10 +281,10 @@ class _$ProfileModelImpl implements _ProfileModel { @override @JsonKey(name: "user") final User user; - final List _chartPoints; + final List _chartPoints; @override @JsonKey(name: "chartPoints") - List get chartPoints { + List get chartPoints { if (_chartPoints is EqualUnmodifiableListView) return _chartPoints; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_chartPoints); @@ -417,7 +418,8 @@ class _$ProfileModelImpl implements _ProfileModel { abstract class _ProfileModel implements ProfileModel { const factory _ProfileModel( {@JsonKey(name: "user") required final User user, - @JsonKey(name: "chartPoints") required final List chartPoints, + @JsonKey(name: "chartPoints") + required final List chartPoints, @JsonKey(name: "userDetails") required final UserDetails userDetails, @JsonKey(name: "circumferences") required final List circumferences, @@ -440,7 +442,7 @@ abstract class _ProfileModel implements ProfileModel { User get user; @override @JsonKey(name: "chartPoints") - List get chartPoints; + List get chartPoints; @override @JsonKey(name: "userDetails") UserDetails get userDetails; @@ -2110,12 +2112,12 @@ abstract class _UserDetails implements UserDetails { throw _privateConstructorUsedError; } -ChartPoint _$ChartPointFromJson(Map json) { - return _ChartPoint.fromJson(json); +ChartPointModel _$ChartPointModelFromJson(Map json) { + return _ChartPointModel.fromJson(json); } /// @nodoc -mixin _$ChartPoint { +mixin _$ChartPointModel { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; @JsonKey(name: "user_id") @@ -2131,15 +2133,15 @@ mixin _$ChartPoint { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ChartPointCopyWith get copyWith => + $ChartPointModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $ChartPointCopyWith<$Res> { - factory $ChartPointCopyWith( - ChartPoint value, $Res Function(ChartPoint) then) = - _$ChartPointCopyWithImpl<$Res, ChartPoint>; +abstract class $ChartPointModelCopyWith<$Res> { + factory $ChartPointModelCopyWith( + ChartPointModel value, $Res Function(ChartPointModel) then) = + _$ChartPointModelCopyWithImpl<$Res, ChartPointModel>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -2151,9 +2153,9 @@ abstract class $ChartPointCopyWith<$Res> { } /// @nodoc -class _$ChartPointCopyWithImpl<$Res, $Val extends ChartPoint> - implements $ChartPointCopyWith<$Res> { - _$ChartPointCopyWithImpl(this._value, this._then); +class _$ChartPointModelCopyWithImpl<$Res, $Val extends ChartPointModel> + implements $ChartPointModelCopyWith<$Res> { + _$ChartPointModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -2200,11 +2202,11 @@ class _$ChartPointCopyWithImpl<$Res, $Val extends ChartPoint> } /// @nodoc -abstract class _$$ChartPointImplCopyWith<$Res> - implements $ChartPointCopyWith<$Res> { - factory _$$ChartPointImplCopyWith( - _$ChartPointImpl value, $Res Function(_$ChartPointImpl) then) = - __$$ChartPointImplCopyWithImpl<$Res>; +abstract class _$$ChartPointModelImplCopyWith<$Res> + implements $ChartPointModelCopyWith<$Res> { + factory _$$ChartPointModelImplCopyWith(_$ChartPointModelImpl value, + $Res Function(_$ChartPointModelImpl) then) = + __$$ChartPointModelImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -2217,11 +2219,11 @@ abstract class _$$ChartPointImplCopyWith<$Res> } /// @nodoc -class __$$ChartPointImplCopyWithImpl<$Res> - extends _$ChartPointCopyWithImpl<$Res, _$ChartPointImpl> - implements _$$ChartPointImplCopyWith<$Res> { - __$$ChartPointImplCopyWithImpl( - _$ChartPointImpl _value, $Res Function(_$ChartPointImpl) _then) +class __$$ChartPointModelImplCopyWithImpl<$Res> + extends _$ChartPointModelCopyWithImpl<$Res, _$ChartPointModelImpl> + implements _$$ChartPointModelImplCopyWith<$Res> { + __$$ChartPointModelImplCopyWithImpl( + _$ChartPointModelImpl _value, $Res Function(_$ChartPointModelImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -2234,7 +2236,7 @@ class __$$ChartPointImplCopyWithImpl<$Res> Object? createdAt = null, Object? updatedAt = null, }) { - return _then(_$ChartPointImpl( + return _then(_$ChartPointModelImpl( id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -2265,8 +2267,8 @@ class __$$ChartPointImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$ChartPointImpl implements _ChartPoint { - const _$ChartPointImpl( +class _$ChartPointModelImpl implements _ChartPointModel { + const _$ChartPointModelImpl( {@JsonKey(name: "id") required this.id, @JsonKey(name: "user_id") required this.userId, @JsonKey(name: "weight") required this.weight, @@ -2274,8 +2276,8 @@ class _$ChartPointImpl implements _ChartPoint { @JsonKey(name: "created_at") required this.createdAt, @JsonKey(name: "updated_at") required this.updatedAt}); - factory _$ChartPointImpl.fromJson(Map json) => - _$$ChartPointImplFromJson(json); + factory _$ChartPointModelImpl.fromJson(Map json) => + _$$ChartPointModelImplFromJson(json); @override @JsonKey(name: "id") @@ -2298,14 +2300,14 @@ class _$ChartPointImpl implements _ChartPoint { @override String toString() { - return 'ChartPoint(id: $id, userId: $userId, weight: $weight, bmi: $bmi, createdAt: $createdAt, updatedAt: $updatedAt)'; + return 'ChartPointModel(id: $id, userId: $userId, weight: $weight, bmi: $bmi, createdAt: $createdAt, updatedAt: $updatedAt)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$ChartPointImpl && + other is _$ChartPointModelImpl && (identical(other.id, id) || other.id == id) && (identical(other.userId, userId) || other.userId == userId) && (identical(other.weight, weight) || other.weight == weight) && @@ -2324,29 +2326,30 @@ class _$ChartPointImpl implements _ChartPoint { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChartPointImplCopyWith<_$ChartPointImpl> get copyWith => - __$$ChartPointImplCopyWithImpl<_$ChartPointImpl>(this, _$identity); + _$$ChartPointModelImplCopyWith<_$ChartPointModelImpl> get copyWith => + __$$ChartPointModelImplCopyWithImpl<_$ChartPointModelImpl>( + this, _$identity); @override Map toJson() { - return _$$ChartPointImplToJson( + return _$$ChartPointModelImplToJson( this, ); } } -abstract class _ChartPoint implements ChartPoint { - const factory _ChartPoint( +abstract class _ChartPointModel implements ChartPointModel { + const factory _ChartPointModel( {@JsonKey(name: "id") required final int id, @JsonKey(name: "user_id") required final int userId, @JsonKey(name: "weight") required final double weight, @JsonKey(name: "bmi") required final double bmi, @JsonKey(name: "created_at") required final DateTime createdAt, @JsonKey(name: "updated_at") required final DateTime updatedAt}) = - _$ChartPointImpl; + _$ChartPointModelImpl; - factory _ChartPoint.fromJson(Map json) = - _$ChartPointImpl.fromJson; + factory _ChartPointModel.fromJson(Map json) = + _$ChartPointModelImpl.fromJson; @override @JsonKey(name: "id") @@ -2368,6 +2371,6 @@ abstract class _ChartPoint implements ChartPoint { DateTime get updatedAt; @override @JsonKey(ignore: true) - _$$ChartPointImplCopyWith<_$ChartPointImpl> get copyWith => + _$$ChartPointModelImplCopyWith<_$ChartPointModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/profile/models/profile_model.g.dart b/lib/features/profile/models/profile_model.g.dart index 020ffca1..42ee3d8c 100644 --- a/lib/features/profile/models/profile_model.g.dart +++ b/lib/features/profile/models/profile_model.g.dart @@ -10,7 +10,7 @@ _$ProfileModelImpl _$$ProfileModelImplFromJson(Map json) => _$ProfileModelImpl( user: User.fromJson(json['user'] as Map), chartPoints: (json['chartPoints'] as List) - .map((e) => ChartPoint.fromJson(e as Map)) + .map((e) => ChartPointModel.fromJson(e as Map)) .toList(), userDetails: UserDetails.fromJson(json['userDetails'] as Map), @@ -164,8 +164,9 @@ Map _$$UserDetailsImplToJson(_$UserDetailsImpl instance) => 'activity_coefficient': instance.activityCoefficient, }; -_$ChartPointImpl _$$ChartPointImplFromJson(Map json) => - _$ChartPointImpl( +_$ChartPointModelImpl _$$ChartPointModelImplFromJson( + Map json) => + _$ChartPointModelImpl( id: (json['id'] as num).toInt(), userId: (json['user_id'] as num).toInt(), weight: (json['weight'] as num).toDouble(), @@ -174,7 +175,8 @@ _$ChartPointImpl _$$ChartPointImplFromJson(Map json) => updatedAt: DateTime.parse(json['updated_at'] as String), ); -Map _$$ChartPointImplToJson(_$ChartPointImpl instance) => +Map _$$ChartPointModelImplToJson( + _$ChartPointModelImpl instance) => { 'id': instance.id, 'user_id': instance.userId, diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index f85417fa..b0aeb788 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -21,7 +21,7 @@ class ProfileScreen extends StatefulWidget { class _ProfileScreenState extends State { List chartData = []; - List chartPoints = []; + List chartPoints = []; final List chipsLabelList = ['Вес', 'Замеры', 'ИМТ']; final List chipsIntervalLabelList = ['1М', '3М', '6М', '1Г', 'ВСЁ ВРЕМЯ']; int _selectedChipIndex = 0; @@ -49,95 +49,98 @@ class _ProfileScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - padding: const EdgeInsets.all(16), decoration: BoxDecoration( - borderRadius: BorderRadius.vertical(bottom: Radius.circular(16)), color: Colors.white, + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(16), + ), ), - child: Row( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, children: [ - CircleAvatar( - radius: 32, - backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl), - ), - const SizedBox(width: 12), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - state.profile.user.name, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.w500, - height: 1, + Padding( + padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16), + child: Row( + children: [ + CircleAvatar( + radius: 32, + backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl), ), - ), - if (state.profile.userDetails.additionalInfo.isNotEmpty) - Text( - state.profile.userDetails.additionalInfo, - style: TextStyle( - color: Colors.black.withOpacity(0.4), - height: 1, + const SizedBox(width: 12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + state.profile.user.name, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.w500, + height: 1, + ), + ), + if (state.profile.userDetails.additionalInfo.isNotEmpty) + Text( + state.profile.userDetails.additionalInfo, + style: TextStyle( + color: Colors.black.withOpacity(0.4), + height: 1, + ), + ), + ], + ), + ], + ), + ), + if (widget.author == null) _divider(context), + if (widget.author == null) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 8), + SingleChildScrollView( + padding: EdgeInsets.symmetric(horizontal: 16), + scrollDirection: Axis.horizontal, + child: Row( + children: [ + _choiceChipWidget(0), + SizedBox(width: 8), + _choiceChipWidget(1), + SizedBox(width: 8), + _choiceChipWidget(2), + ], ), ), - ], - ), + Builder( + builder: (context) { + if (_selectedChipIndex == 0) return WeightChartWidget(chartPoints: chartPoints); + if (_selectedChipIndex == 1) return CircumferenceChartWidget(chartData: chartData); + if (_selectedChipIndex == 2) + return ImtChartWidget(chartPoints: chartPoints); + else + return Container(); + }, + ), + SizedBox(height: 8), + Row( + children: [ + SizedBox(width: 16), + _choiceIntervalChipWidget(0), + SizedBox(width: 8), + _choiceIntervalChipWidget(1), + SizedBox(width: 8), + _choiceIntervalChipWidget(2), + SizedBox(width: 8), + _choiceIntervalChipWidget(3), + SizedBox(width: 8), + _choiceIntervalChipWidget(4), + ], + ), + SizedBox(height: 8), + ], + ), ], ), ), - if (widget.author == null) SizedBox(height: 8), - if (widget.author == null) - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16), - color: Colors.white, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox(height: 8), - SingleChildScrollView( - padding: EdgeInsets.symmetric(horizontal: 16), - scrollDirection: Axis.horizontal, - child: Row( - children: [ - _choiceChipWidget(0), - SizedBox(width: 8), - _choiceChipWidget(1), - SizedBox(width: 8), - _choiceChipWidget(2), - ], - ), - ), - Builder( - builder: (context) { - if (_selectedChipIndex == 0) return WeightChartWidget(chartPoints: chartPoints); - if (_selectedChipIndex == 1) return CircumferenceChartWidget(chartData: chartData); - if (_selectedChipIndex == 2) - return ImtChartWidget(chartPoints: chartPoints); - else - return Container(); - }, - ), - SizedBox(height: 8), - Row( - children: [ - SizedBox(width: 16), - _choiceIntervalChipWidget(0), - SizedBox(width: 8), - _choiceIntervalChipWidget(1), - SizedBox(width: 8), - _choiceIntervalChipWidget(2), - SizedBox(width: 8), - _choiceIntervalChipWidget(3), - SizedBox(width: 8), - _choiceIntervalChipWidget(4), - ], - ), - SizedBox(height: 8), - ], - ), - ), SizedBox(height: 16), ListView.separated( shrinkWrap: true, @@ -174,6 +177,17 @@ class _ProfileScreenState extends State { ); } + _divider(BuildContext context) { + return Container( + height: 0.4, + width: MediaQuery.of(context).size.width - 32, + decoration: BoxDecoration( + color: Colors.black26, + borderRadius: BorderRadius.circular(16), + ), + ); + } + _choiceIntervalChipWidget(int index) { return ChoiceChip( selectedColor: Colors.grey.withOpacity(0.1), diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index f4849df1..9294a361 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -1,3 +1,4 @@ +import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; @@ -15,91 +16,101 @@ class CircumferenceChartWidget extends StatelessWidget { Widget build(BuildContext context) { return Column( children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + SingleChildScrollView( + padding: EdgeInsets.symmetric(horizontal: 16), + scrollDirection: Axis.horizontal, + physics: const BouncingScrollPhysics(), child: Row( children: [ Text( - 'Грудь ${chartData.last.chestCircumference} см', + '${chartData.last.chestCircumference} см', style: TextStyle( color: Colors.black, - fontSize: 18, + fontSize: 48, fontWeight: FontWeight.w500, ), ), chartData.last.chestCircumference > chartData[chartData.length - 2].chestCircumference ? Icon( Icons.arrow_drop_up, - size: 18, + size: 48, color: Colors.grey, ) : Icon( Icons.arrow_drop_down, - size: 18, + size: 48, color: Colors.grey, ), Text( - 'Талия ${chartData.last.waistCircumference} см', + '${chartData.last.waistCircumference} см', style: TextStyle( color: Colors.black, - fontSize: 18, + fontSize: 48, fontWeight: FontWeight.w500, ), ), chartData.last.waistCircumference > chartData[chartData.length - 2].waistCircumference ? Icon( Icons.arrow_drop_up, - size: 18, + size: 48, color: Colors.grey, ) : Icon( Icons.arrow_drop_down, - size: 18, + size: 48, color: Colors.grey, ), Text( - 'Бёдра ${chartData.last.hipCircumference} см', + '${chartData.last.hipCircumference} см', style: TextStyle( color: Colors.black, - fontSize: 18, + fontSize: 48, fontWeight: FontWeight.w500, ), ), chartData.last.hipCircumference > chartData[chartData.length - 2].hipCircumference ? Icon( Icons.arrow_drop_up, - size: 18, + size: 48, color: Colors.grey, ) : Icon( Icons.arrow_drop_down, - size: 18, + size: 48, color: Colors.grey, ), ], ), ), SfCartesianChart( - margin: EdgeInsets.zero, + margin: EdgeInsets.symmetric(horizontal: 8), enableAxisAnimation: true, - enableSideBySideSeriesPlacement: true, - legend: const Legend( - isVisible: true, - opacity: 0.7, - position: LegendPosition.bottom, - ), plotAreaBorderWidth: 0, trackballBehavior: TrackballBehavior( enable: true, activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, ), primaryXAxis: DateTimeCategoryAxis( + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), axisLine: AxisLine( - width: 1, + color: Colors.grey.withOpacity(0.3), + width: 0.4, ), ), primaryYAxis: NumericAxis( + isVisible: false, labelFormat: '{value} см', axisLine: AxisLine( width: 1, @@ -115,57 +126,81 @@ class CircumferenceChartWidget extends StatelessWidget { List> _getSplineSeries() { final Color seriesColor1 = Colors.red; - final Color seriesColor2 = Colors.blue; + final Color seriesColor2 = appTheme.blueA400; final Color seriesColor3 = Colors.green; return >[ - SplineSeries( + SplineAreaSeries( markerSettings: MarkerSettings( isVisible: true, color: seriesColor1, - height: 12, - width: 12, + height: 8, + width: 8, ), dataLabelSettings: DataLabelSettings( labelAlignment: ChartDataLabelAlignment.top, isVisible: true, ), dataSource: chartData, - color: seriesColor1, + borderColor: seriesColor1, + gradient: LinearGradient( + colors: [ + seriesColor1.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), name: 'Грудь', xValueMapper: (Circumference value, int index) => value.createdAt, yValueMapper: (Circumference value, int index) => value.chestCircumference, ), - SplineSeries( + SplineAreaSeries( markerSettings: MarkerSettings( isVisible: true, color: seriesColor2, - height: 12, - width: 12, + height: 8, + width: 8, ), dataLabelSettings: DataLabelSettings( labelAlignment: ChartDataLabelAlignment.top, isVisible: true, ), dataSource: chartData, - color: seriesColor2, + borderColor: seriesColor2, + gradient: LinearGradient( + colors: [ + seriesColor2.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), name: 'Талия', xValueMapper: (Circumference value, int index) => value.createdAt, yValueMapper: (Circumference value, int index) => value.waistCircumference, ), - SplineSeries( + SplineAreaSeries( markerSettings: MarkerSettings( isVisible: true, color: seriesColor3, - height: 12, - width: 12, + height: 8, + width: 8, ), dataLabelSettings: DataLabelSettings( labelAlignment: ChartDataLabelAlignment.top, isVisible: true, ), dataSource: chartData, - color: seriesColor3, + borderColor: seriesColor3, + gradient: LinearGradient( + colors: [ + seriesColor3.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), name: 'Бёдра', xValueMapper: (Circumference value, int index) => value.createdAt, yValueMapper: (Circumference value, int index) => value.hipCircumference, diff --git a/lib/features/profile/presentation/widgets/imt_chart_widget.dart b/lib/features/profile/presentation/widgets/imt_chart_widget.dart index 0dc06899..eaf5808a 100644 --- a/lib/features/profile/presentation/widgets/imt_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/imt_chart_widget.dart @@ -1,10 +1,11 @@ -import 'package:eatvio_app/features/profile/models/profile_model.dart' as ProfileModel; +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; import 'package:intl/intl.dart'; class ImtChartWidget extends StatelessWidget { - final List chartPoints; + final List chartPoints; const ImtChartWidget({ super.key, @@ -30,39 +31,49 @@ class ImtChartWidget extends StatelessWidget { ), chartPoints.last.bmi > chartPoints[chartPoints.length - 2].bmi ? Icon( - Icons.arrow_drop_up, - size: 48, - color: Colors.grey, - ) + Icons.arrow_drop_up, + size: 48, + color: Colors.grey, + ) : Icon( - Icons.arrow_drop_down, - size: 48, - color: Colors.grey, - ), + Icons.arrow_drop_down, + size: 48, + color: Colors.grey, + ), ], ), ), SfCartesianChart( - margin: EdgeInsets.zero, + margin: EdgeInsets.symmetric(horizontal: 8), enableAxisAnimation: true, - enableSideBySideSeriesPlacement: true, plotAreaBorderWidth: 0, trackballBehavior: TrackballBehavior( enable: true, activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, ), primaryXAxis: DateTimeCategoryAxis( + initialVisibleMinimum: chartPoints.first.createdAt, + initialVisibleMaximum: chartPoints.last.createdAt, + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), axisLine: AxisLine( - width: 1, + color: Colors.grey.withOpacity(0.3), + width: 0.4, ), ), primaryYAxis: NumericAxis( - labelFormat: '{value} кг/м²', - axisLine: AxisLine( - width: 1, - ), - majorTickLines: MajorTickLines(size: 0), + isVisible: false, ), series: _getSplineSeries(), tooltipBehavior: TooltipBehavior(enable: true), @@ -71,24 +82,32 @@ class ImtChartWidget extends StatelessWidget { ); } - List> _getSplineSeries() { - return >[ - SplineSeries( + List> _getSplineSeries() { + return >[ + SplineAreaSeries( markerSettings: MarkerSettings( isVisible: true, - color: Colors.blue, - height: 12, - width: 12, + color: appTheme.blueA400, + height: 8, + width: 8, ), dataLabelSettings: DataLabelSettings( labelAlignment: ChartDataLabelAlignment.top, isVisible: true, ), dataSource: chartPoints, - color: Colors.blue, + borderColor: appTheme.blueA400, + gradient: LinearGradient( + colors: [ + appTheme.blueA400.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), name: 'ИМТ', - xValueMapper: (ProfileModel.ChartPoint value, int index) => value.createdAt, - yValueMapper: (ProfileModel.ChartPoint value, int index) => value.bmi, + xValueMapper: (ChartPointModel value, int index) => value.createdAt, + yValueMapper: (ChartPointModel value, int index) => double.parse(value.bmi.toStringAsFixed(2)), ), ]; } diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index f799cc0d..7c75ad61 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -1,11 +1,11 @@ import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/features/profile/models/profile_model.dart' as ProfileModel; +import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; class WeightChartWidget extends StatelessWidget { - final List chartPoints; + final List chartPoints; const WeightChartWidget({ super.key, @@ -22,7 +22,7 @@ class WeightChartWidget extends StatelessWidget { child: Row( children: [ Text( - '${chartPoints.last.weight} кг', + '${chartPoints.last.weight.toStringAsFixed(2)} кг', style: TextStyle( color: Colors.black, fontSize: 48, @@ -88,9 +88,9 @@ class WeightChartWidget extends StatelessWidget { ); } - List> _getSplineSeries() { - return >[ - SplineAreaSeries( + List> _getSplineSeries() { + return >[ + SplineAreaSeries( markerSettings: MarkerSettings( isVisible: true, color: appTheme.blueA400, @@ -112,8 +112,8 @@ class WeightChartWidget extends StatelessWidget { end: Alignment(0, 0.6), ), name: 'Вес', - xValueMapper: (ProfileModel.ChartPoint value, int index) => value.createdAt, - yValueMapper: (ProfileModel.ChartPoint value, int index) => value.weight, + xValueMapper: (ChartPointModel value, int index) => value.createdAt, + yValueMapper: (ChartPointModel value, int index) => value.weight, ), ]; } diff --git a/lib/features/profile/repositories/profile_repository.dart b/lib/features/profile/repositories/profile_repository.dart index d03e39d8..2261f74b 100644 --- a/lib/features/profile/repositories/profile_repository.dart +++ b/lib/features/profile/repositories/profile_repository.dart @@ -41,7 +41,7 @@ class ProfileRepository { } } - Future addWeight({ + Future addWeight({ required int weight, }) async { try { diff --git a/lib/features/profile/services/profile_service.dart b/lib/features/profile/services/profile_service.dart index 2ec6cee0..94a4bdc9 100644 --- a/lib/features/profile/services/profile_service.dart +++ b/lib/features/profile/services/profile_service.dart @@ -25,7 +25,7 @@ abstract class ProfileService { }); @POST('/api/profile/addWeight') - Future> addWeight({ + Future> addWeight({ @Part() required int weight, }); diff --git a/lib/features/profile/services/profile_service.g.dart b/lib/features/profile/services/profile_service.g.dart index ab9461bf..366a5226 100644 --- a/lib/features/profile/services/profile_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -138,7 +138,7 @@ class _ProfileService implements ProfileService { } @override - Future> addWeight({required int weight}) async { + Future> addWeight({required int weight}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -147,7 +147,7 @@ class _ProfileService implements ProfileService { 'weight', weight.toString(), )); - final _options = _setStreamType>(Options( + final _options = _setStreamType>(Options( method: 'POST', headers: _headers, extra: _extra, @@ -164,10 +164,10 @@ class _ProfileService implements ProfileService { baseUrl, ))); final _result = await _dio.fetch>(_options); - late Map _value; + late Map _value; try { _value = _result.data!.map((k, dynamic v) => - MapEntry(k, ChartPoint.fromJson(v as Map))); + MapEntry(k, ChartPointModel.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; diff --git a/lib/features/recipes/models/recipe_tag.dart b/lib/features/recipes/models/recipe_tag.dart deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/features/recipes/models/recipe_tag_model.dart b/lib/features/recipes/models/recipe_tag_model.dart new file mode 100644 index 00000000..8cd13054 --- /dev/null +++ b/lib/features/recipes/models/recipe_tag_model.dart @@ -0,0 +1,28 @@ +import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'recipe_tag_model.freezed.dart'; +part 'recipe_tag_model.g.dart'; + +@freezed +class RecipeTagModel with _$RecipeTagModel { + const factory RecipeTagModel({ + @JsonKey(name: "data") required List data, + @JsonKey(name: "links") required Links links, + @JsonKey(name: "meta") required Meta meta, + }) = _RecipeTagModel; + + factory RecipeTagModel.fromJson(Map json) => _$RecipeTagModelFromJson(json); +} + +@freezed +class RecipeTag with _$RecipeTag { + const factory RecipeTag({ + @JsonKey(name: "id") required int id, + @JsonKey(name: "name") required String name, + @JsonKey(name: "created_at") required DateTime createdAt, + @JsonKey(name: "updated_at") required DateTime updatedAt, + }) = _RecipeTag; + + factory RecipeTag.fromJson(Map json) => _$RecipeTagFromJson(json); +} diff --git a/lib/features/recipes/models/recipe_tag_model.freezed.dart b/lib/features/recipes/models/recipe_tag_model.freezed.dart new file mode 100644 index 00000000..db917d4a --- /dev/null +++ b/lib/features/recipes/models/recipe_tag_model.freezed.dart @@ -0,0 +1,451 @@ +// 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 'recipe_tag_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'); + +RecipeTagModel _$RecipeTagModelFromJson(Map json) { + return _RecipeTagModel.fromJson(json); +} + +/// @nodoc +mixin _$RecipeTagModel { + @JsonKey(name: "data") + List get data => throw _privateConstructorUsedError; + @JsonKey(name: "links") + Links get links => throw _privateConstructorUsedError; + @JsonKey(name: "meta") + Meta get meta => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $RecipeTagModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $RecipeTagModelCopyWith<$Res> { + factory $RecipeTagModelCopyWith( + RecipeTagModel value, $Res Function(RecipeTagModel) then) = + _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>; + @useResult + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); + + $LinksCopyWith<$Res> get links; + $MetaCopyWith<$Res> get meta; +} + +/// @nodoc +class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> + implements $RecipeTagModelCopyWith<$Res> { + _$RecipeTagModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? data = null, + Object? links = null, + Object? meta = null, + }) { + return _then(_value.copyWith( + data: null == data + ? _value.data + : data // ignore: cast_nullable_to_non_nullable + as List, + links: null == links + ? _value.links + : links // ignore: cast_nullable_to_non_nullable + as Links, + meta: null == meta + ? _value.meta + : meta // ignore: cast_nullable_to_non_nullable + as Meta, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $LinksCopyWith<$Res> get links { + return $LinksCopyWith<$Res>(_value.links, (value) { + return _then(_value.copyWith(links: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $MetaCopyWith<$Res> get meta { + return $MetaCopyWith<$Res>(_value.meta, (value) { + return _then(_value.copyWith(meta: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$RecipeTagModelImplCopyWith<$Res> + implements $RecipeTagModelCopyWith<$Res> { + factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value, + $Res Function(_$RecipeTagModelImpl) then) = + __$$RecipeTagModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); + + @override + $LinksCopyWith<$Res> get links; + @override + $MetaCopyWith<$Res> get meta; +} + +/// @nodoc +class __$$RecipeTagModelImplCopyWithImpl<$Res> + extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl> + implements _$$RecipeTagModelImplCopyWith<$Res> { + __$$RecipeTagModelImplCopyWithImpl( + _$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? data = null, + Object? links = null, + Object? meta = null, + }) { + return _then(_$RecipeTagModelImpl( + data: null == data + ? _value._data + : data // ignore: cast_nullable_to_non_nullable + as List, + links: null == links + ? _value.links + : links // ignore: cast_nullable_to_non_nullable + as Links, + meta: null == meta + ? _value.meta + : meta // ignore: cast_nullable_to_non_nullable + as Meta, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$RecipeTagModelImpl implements _RecipeTagModel { + const _$RecipeTagModelImpl( + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) + : _data = data; + + factory _$RecipeTagModelImpl.fromJson(Map json) => + _$$RecipeTagModelImplFromJson(json); + + final List _data; + @override + @JsonKey(name: "data") + List get data { + if (_data is EqualUnmodifiableListView) return _data; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_data); + } + + @override + @JsonKey(name: "links") + final Links links; + @override + @JsonKey(name: "meta") + final Meta meta; + + @override + String toString() { + return 'RecipeTagModel(data: $data, links: $links, meta: $meta)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$RecipeTagModelImpl && + const DeepCollectionEquality().equals(other._data, _data) && + (identical(other.links, links) || other.links == links) && + (identical(other.meta, meta) || other.meta == meta)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => + __$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$RecipeTagModelImplToJson( + this, + ); + } +} + +abstract class _RecipeTagModel implements RecipeTagModel { + const factory _RecipeTagModel( + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required final Links links, + @JsonKey(name: "meta") required final Meta meta}) = _$RecipeTagModelImpl; + + factory _RecipeTagModel.fromJson(Map json) = + _$RecipeTagModelImpl.fromJson; + + @override + @JsonKey(name: "data") + List get data; + @override + @JsonKey(name: "links") + Links get links; + @override + @JsonKey(name: "meta") + Meta get meta; + @override + @JsonKey(ignore: true) + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => + throw _privateConstructorUsedError; +} + +RecipeTag _$RecipeTagFromJson(Map json) { + return _RecipeTag.fromJson(json); +} + +/// @nodoc +mixin _$RecipeTag { + @JsonKey(name: "id") + int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") + String get name => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") + DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") + DateTime get updatedAt => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $RecipeTagCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $RecipeTagCopyWith<$Res> { + factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) = + _$RecipeTagCopyWithImpl<$Res, RecipeTag>; + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "name") String name, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt}); +} + +/// @nodoc +class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> + implements $RecipeTagCopyWith<$Res> { + _$RecipeTagCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + name: null == name + ? _value.name + : name // 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, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$RecipeTagImplCopyWith<$Res> + implements $RecipeTagCopyWith<$Res> { + factory _$$RecipeTagImplCopyWith( + _$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) = + __$$RecipeTagImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "name") String name, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt}); +} + +/// @nodoc +class __$$RecipeTagImplCopyWithImpl<$Res> + extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl> + implements _$$RecipeTagImplCopyWith<$Res> { + __$$RecipeTagImplCopyWithImpl( + _$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then(_$RecipeTagImpl( + 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, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$RecipeTagImpl implements _RecipeTag { + const _$RecipeTagImpl( + {@JsonKey(name: "id") required this.id, + @JsonKey(name: "name") required this.name, + @JsonKey(name: "created_at") required this.createdAt, + @JsonKey(name: "updated_at") required this.updatedAt}); + + factory _$RecipeTagImpl.fromJson(Map json) => + _$$RecipeTagImplFromJson(json); + + @override + @JsonKey(name: "id") + final int id; + @override + @JsonKey(name: "name") + final String name; + @override + @JsonKey(name: "created_at") + final DateTime createdAt; + @override + @JsonKey(name: "updated_at") + final DateTime updatedAt; + + @override + String toString() { + return 'RecipeTag(id: $id, name: $name, createdAt: $createdAt, updatedAt: $updatedAt)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$RecipeTagImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.name, name) || other.name == name) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, id, name, createdAt, updatedAt); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => + __$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity); + + @override + Map toJson() { + return _$$RecipeTagImplToJson( + this, + ); + } +} + +abstract class _RecipeTag implements RecipeTag { + const factory _RecipeTag( + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = + _$RecipeTagImpl; + + factory _RecipeTag.fromJson(Map json) = + _$RecipeTagImpl.fromJson; + + @override + @JsonKey(name: "id") + int get id; + @override + @JsonKey(name: "name") + String get name; + @override + @JsonKey(name: "created_at") + DateTime get createdAt; + @override + @JsonKey(name: "updated_at") + DateTime get updatedAt; + @override + @JsonKey(ignore: true) + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/recipes/models/recipe_tag_model.g.dart b/lib/features/recipes/models/recipe_tag_model.g.dart new file mode 100644 index 00000000..6ab2a853 --- /dev/null +++ b/lib/features/recipes/models/recipe_tag_model.g.dart @@ -0,0 +1,40 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'recipe_tag_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map json) => + _$RecipeTagModelImpl( + data: (json['data'] as List) + .map((e) => RecipeTag.fromJson(e as Map)) + .toList(), + links: Links.fromJson(json['links'] as Map), + meta: Meta.fromJson(json['meta'] as Map), + ); + +Map _$$RecipeTagModelImplToJson( + _$RecipeTagModelImpl instance) => + { + 'data': instance.data, + 'links': instance.links, + 'meta': instance.meta, + }; + +_$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => + _$RecipeTagImpl( + id: (json['id'] as num).toInt(), + name: json['name'] as String, + createdAt: DateTime.parse(json['created_at'] as String), + updatedAt: DateTime.parse(json['updated_at'] as String), + ); + +Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => + { + 'id': instance.id, + 'name': instance.name, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + }; diff --git a/lib/features/recipes/presentation/pages/about_recipes_screen.dart b/lib/features/recipes/presentation/pages/about_recipes_screen.dart index fdb23673..645af00b 100644 --- a/lib/features/recipes/presentation/pages/about_recipes_screen.dart +++ b/lib/features/recipes/presentation/pages/about_recipes_screen.dart @@ -394,7 +394,7 @@ class _AboutRecipesScreenState extends State { ); } - _buildComments(Comment comment) { + _buildComments(CommentModel comment) { return Column( children: [ for (int i = 0; i < comment.data.length; i++) ...[ @@ -414,11 +414,11 @@ class _AboutRecipesScreenState extends State { ); } - _comment(Datum datum, [double radius = 16]) { + _comment(Comment comment, [double radius = 16]) { return Container( width: MediaQuery.of(context).size.width, decoration: BoxDecoration( - color: replyId == datum.id ? appTheme.blueA400.withOpacity(0.1) : Colors.white, + color: replyId == comment.id ? appTheme.blueA400.withOpacity(0.1) : Colors.white, borderRadius: BorderRadius.circular(16), ), child: Padding( @@ -427,7 +427,7 @@ class _AboutRecipesScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ CircleAvatar( - foregroundImage: NetworkImage(datum.authorProfileIcon), + foregroundImage: NetworkImage(comment.authorProfileIcon), radius: radius, ), SizedBox(width: 8), @@ -436,7 +436,7 @@ class _AboutRecipesScreenState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - datum.authorName, + comment.authorName, style: TextStyle( height: 1, color: Colors.grey.shade600, @@ -445,7 +445,7 @@ class _AboutRecipesScreenState extends State { ), SizedBox(width: 4), Text( - datum.body, + comment.body, style: TextStyle( height: 1, color: Colors.black, @@ -455,7 +455,7 @@ class _AboutRecipesScreenState extends State { Row( children: [ Text( - datum.createdAt.format('dd MMMM', 'ru'), + comment.createdAt.format('dd MMMM', 'ru'), style: TextStyle( color: Colors.grey.shade600, fontSize: 12, @@ -467,7 +467,7 @@ class _AboutRecipesScreenState extends State { GestureDetector( onTap: () { setState(() { - replyId = datum.id; + replyId = comment.id; }); }, child: Text( diff --git a/lib/features/recipes/reporitories/recipe_repository.dart b/lib/features/recipes/reporitories/recipe_repository.dart index e27013c7..cf9a355e 100644 --- a/lib/features/recipes/reporitories/recipe_repository.dart +++ b/lib/features/recipes/reporitories/recipe_repository.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:eatvio_app/features/recipes/models/recipe_model.dart'; +import 'package:eatvio_app/features/recipes/models/recipe_tag_model.dart'; import 'package:eatvio_app/features/recipes/services/recipe_service.dart'; import 'package:eatvio_app/features/diary/models/product.dart'; @@ -71,4 +72,12 @@ class RecipeRepository { rethrow; } } + + Future> getRecipesTags() async { + try { + return (await recipeService.getTags()).data; + } catch (e) { + rethrow; + } + } } diff --git a/lib/features/recipes/services/recipe_service.dart b/lib/features/recipes/services/recipe_service.dart index d92e6b9c..f0a5e200 100644 --- a/lib/features/recipes/services/recipe_service.dart +++ b/lib/features/recipes/services/recipe_service.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:eatvio_app/features/recipes/models/recipe_model.dart'; +import 'package:eatvio_app/features/recipes/models/recipe_tag_model.dart'; import 'package:retrofit/retrofit.dart'; import 'package:eatvio_app/features/diary/models/product.dart'; @@ -33,4 +34,7 @@ abstract class RecipeService { @POST('/api/recipes/update/{id}') Future editRecipe(@Part() Map recipe, String id); + + @GET('/api/recipes/tags') + Future getTags(); } diff --git a/lib/features/recipes/services/recipe_service.g.dart b/lib/features/recipes/services/recipe_service.g.dart index 43cb10a8..c32c9e8a 100644 --- a/lib/features/recipes/services/recipe_service.g.dart +++ b/lib/features/recipes/services/recipe_service.g.dart @@ -220,6 +220,39 @@ class _RecipeService implements RecipeService { return _value; } + @override + Future getTags() async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/recipes/tags', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late RecipeTagModel _value; + try { + _value = RecipeTagModel.fromJson(_result.data!); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + RequestOptions _setStreamType(RequestOptions requestOptions) { if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || diff --git a/lib/locator_service.dart b/lib/locator_service.dart index a73d21f1..30e45db8 100644 --- a/lib/locator_service.dart +++ b/lib/locator_service.dart @@ -42,7 +42,7 @@ Future init() async { sl.registerFactory(() => RegistrationCubit(registrationRepository: sl())); sl.registerFactory(() => ChatRoomCubit(chatRepository: sl(), initializationCubit: sl())); sl.registerFactory(() => FeedCubit(feedRepository: sl())); - sl.registerFactory(() => RecipesCubit(feedRepository: sl())); + sl.registerFactory(() => RecipesCubit(feedRepository: sl(), recipeRepository: sl())); sl.registerFactory(() => DiaryBloc(diaryRepository: sl())); sl.registerFactory(() => CalendarCubit(calendarRepository: sl())); sl.registerFactory(() => ProfileCubit(profileRepository: sl())); From 8335cf4a6e910e2870a4a565c11ef578bfd9692f Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 2 Sep 2024 16:30:53 +0300 Subject: [PATCH 04/31] =?UTF-8?q?feat(=D1=80=D0=B5=D1=86=D0=B5=D0=BF=D1=82?= =?UTF-8?q?=D1=8B):=20=D0=BA=D0=BE=D0=BB=D0=B8=D1=87=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=B2=D0=BE=20=D1=80=D0=B5=D1=86=D0=B5=D0=BF=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BF=D0=BE=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widgets/tags_modal_widget.dart | 4 ++- .../recipes/models/recipe_tag_model.dart | 1 + .../models/recipe_tag_model.freezed.dart | 29 +++++++++++++++++-- .../recipes/models/recipe_tag_model.g.dart | 2 ++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/lib/features/feed/presentation/widgets/tags_modal_widget.dart b/lib/features/feed/presentation/widgets/tags_modal_widget.dart index 724f91a8..5d66b330 100644 --- a/lib/features/feed/presentation/widgets/tags_modal_widget.dart +++ b/lib/features/feed/presentation/widgets/tags_modal_widget.dart @@ -51,7 +51,6 @@ class _TagsModalWidgetState extends State { borderRadius: BorderRadius.circular(16), ), padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), - label: Text(tag.name), labelStyle: TextStyle( color: isSelected ? Colors.white : appTheme.gray600, fontWeight: FontWeight.w500, @@ -60,6 +59,9 @@ class _TagsModalWidgetState extends State { selected: isSelected, backgroundColor: appTheme.gray100, onSelected: (bool selected) => context.read().updateTags(tag), + label: Text( + '${tag.name} ${tag.recipesCount}', + ), ); } } diff --git a/lib/features/recipes/models/recipe_tag_model.dart b/lib/features/recipes/models/recipe_tag_model.dart index 8cd13054..004f4f29 100644 --- a/lib/features/recipes/models/recipe_tag_model.dart +++ b/lib/features/recipes/models/recipe_tag_model.dart @@ -20,6 +20,7 @@ class RecipeTag with _$RecipeTag { const factory RecipeTag({ @JsonKey(name: "id") required int id, @JsonKey(name: "name") required String name, + @JsonKey(name: "recipes_count") required int recipesCount, @JsonKey(name: "created_at") required DateTime createdAt, @JsonKey(name: "updated_at") required DateTime updatedAt, }) = _RecipeTag; diff --git a/lib/features/recipes/models/recipe_tag_model.freezed.dart b/lib/features/recipes/models/recipe_tag_model.freezed.dart index db917d4a..25970a55 100644 --- a/lib/features/recipes/models/recipe_tag_model.freezed.dart +++ b/lib/features/recipes/models/recipe_tag_model.freezed.dart @@ -246,6 +246,8 @@ mixin _$RecipeTag { int get id => throw _privateConstructorUsedError; @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; + @JsonKey(name: "recipes_count") + int get recipesCount => throw _privateConstructorUsedError; @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; @JsonKey(name: "updated_at") @@ -265,6 +267,7 @@ abstract class $RecipeTagCopyWith<$Res> { $Res call( {@JsonKey(name: "id") int id, @JsonKey(name: "name") String name, + @JsonKey(name: "recipes_count") int recipesCount, @JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "updated_at") DateTime updatedAt}); } @@ -284,6 +287,7 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> $Res call({ Object? id = null, Object? name = null, + Object? recipesCount = null, Object? createdAt = null, Object? updatedAt = null, }) { @@ -296,6 +300,10 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, + recipesCount: null == recipesCount + ? _value.recipesCount + : recipesCount // ignore: cast_nullable_to_non_nullable + as int, createdAt: null == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -319,6 +327,7 @@ abstract class _$$RecipeTagImplCopyWith<$Res> $Res call( {@JsonKey(name: "id") int id, @JsonKey(name: "name") String name, + @JsonKey(name: "recipes_count") int recipesCount, @JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "updated_at") DateTime updatedAt}); } @@ -336,6 +345,7 @@ class __$$RecipeTagImplCopyWithImpl<$Res> $Res call({ Object? id = null, Object? name = null, + Object? recipesCount = null, Object? createdAt = null, Object? updatedAt = null, }) { @@ -348,6 +358,10 @@ class __$$RecipeTagImplCopyWithImpl<$Res> ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, + recipesCount: null == recipesCount + ? _value.recipesCount + : recipesCount // ignore: cast_nullable_to_non_nullable + as int, createdAt: null == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -366,6 +380,7 @@ class _$RecipeTagImpl implements _RecipeTag { const _$RecipeTagImpl( {@JsonKey(name: "id") required this.id, @JsonKey(name: "name") required this.name, + @JsonKey(name: "recipes_count") required this.recipesCount, @JsonKey(name: "created_at") required this.createdAt, @JsonKey(name: "updated_at") required this.updatedAt}); @@ -379,6 +394,9 @@ class _$RecipeTagImpl implements _RecipeTag { @JsonKey(name: "name") final String name; @override + @JsonKey(name: "recipes_count") + final int recipesCount; + @override @JsonKey(name: "created_at") final DateTime createdAt; @override @@ -387,7 +405,7 @@ class _$RecipeTagImpl implements _RecipeTag { @override String toString() { - return 'RecipeTag(id: $id, name: $name, createdAt: $createdAt, updatedAt: $updatedAt)'; + return 'RecipeTag(id: $id, name: $name, recipesCount: $recipesCount, createdAt: $createdAt, updatedAt: $updatedAt)'; } @override @@ -397,6 +415,8 @@ class _$RecipeTagImpl implements _RecipeTag { other is _$RecipeTagImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && + (identical(other.recipesCount, recipesCount) || + other.recipesCount == recipesCount) && (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && (identical(other.updatedAt, updatedAt) || @@ -405,7 +425,8 @@ class _$RecipeTagImpl implements _RecipeTag { @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, id, name, createdAt, updatedAt); + int get hashCode => + Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); @JsonKey(ignore: true) @override @@ -425,6 +446,7 @@ abstract class _RecipeTag implements RecipeTag { const factory _RecipeTag( {@JsonKey(name: "id") required final int id, @JsonKey(name: "name") required final String name, + @JsonKey(name: "recipes_count") required final int recipesCount, @JsonKey(name: "created_at") required final DateTime createdAt, @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$RecipeTagImpl; @@ -439,6 +461,9 @@ abstract class _RecipeTag implements RecipeTag { @JsonKey(name: "name") String get name; @override + @JsonKey(name: "recipes_count") + int get recipesCount; + @override @JsonKey(name: "created_at") DateTime get createdAt; @override diff --git a/lib/features/recipes/models/recipe_tag_model.g.dart b/lib/features/recipes/models/recipe_tag_model.g.dart index 6ab2a853..cd387547 100644 --- a/lib/features/recipes/models/recipe_tag_model.g.dart +++ b/lib/features/recipes/models/recipe_tag_model.g.dart @@ -27,6 +27,7 @@ _$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => _$RecipeTagImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, + recipesCount: (json['recipes_count'] as num).toInt(), createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), ); @@ -35,6 +36,7 @@ Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => { 'id': instance.id, 'name': instance.name, + 'recipes_count': instance.recipesCount, 'created_at': instance.createdAt.toIso8601String(), 'updated_at': instance.updatedAt.toIso8601String(), }; From d519c505e7e5ed4f77b44383e55a546eb5898523 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Tue, 3 Sep 2024 10:30:42 +0300 Subject: [PATCH 05/31] fix(feed): fix comments ui --- .../widgets/chat_bubble_widget.dart | 23 ++++++------ .../presentation/pages/about_diet_screen.dart | 11 ++++++ .../bloc/recipes_cubit/recipes_cubit.dart | 3 -- .../pages/about_recipes_screen.dart | 36 +++++++++++++------ 4 files changed, 50 insertions(+), 23 deletions(-) diff --git a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart index eeba8f1e..ce24b69a 100644 --- a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart @@ -51,7 +51,7 @@ class ChatBubbleWidget extends StatelessWidget { !mediaData[index].toString().contains('.jpg') && !mediaData[index].toString().contains('.jpeg')) { return ListTile( - contentPadding: EdgeInsets.zero, + contentPadding: EdgeInsets.all(4), horizontalTitleGap: 8, onTap: () async { if (!await launchUrl(Uri.parse(baseUrl + '/storage/' + mediaData[index].toString()))) { @@ -60,17 +60,17 @@ class ChatBubbleWidget extends StatelessWidget { }, leading: Icon( Icons.file_copy_outlined, - color: Color(0xFF2F80ED), + color: Colors.white, ), trailing: Icon( Icons.download_outlined, - color: Color(0xFF2F80ED), + color: Colors.white, ), title: Text( mediaData[index].toString().replaceAll('chat_files/', ''), maxLines: 2, style: TextStyle( - color: Color(0xFF323F4B), + color: Colors.white, fontSize: 12, overflow: TextOverflow.ellipsis, ), @@ -110,12 +110,15 @@ class ChatBubbleWidget extends StatelessWidget { style: TextStyle(color: isCurrentUser ? Colors.white : Color(0xFF323F4B), height: 1), ), SizedBox(height: 4), - Text( - DateTime.parse(sendTime).format('hh:mm'), - style: TextStyle( - color: isCurrentUser ? Colors.white.withOpacity(0.4) : Color(0xFF323F4B).withOpacity(0.4), - height: 1, - fontSize: 10, + Padding( + padding: mediaData.length > 0 ? const EdgeInsets.only(right: 8, top: 4, left: 8) : EdgeInsets.zero, + child: Text( + DateTime.parse(sendTime).format('hh:mm'), + style: TextStyle( + color: isCurrentUser ? Colors.white.withOpacity(0.4) : Color(0xFF323F4B).withOpacity(0.4), + height: 1, + fontSize: 10, + ), ), ), ], diff --git a/lib/features/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart index d21de813..ab1e69ff 100644 --- a/lib/features/diets/presentation/pages/about_diet_screen.dart +++ b/lib/features/diets/presentation/pages/about_diet_screen.dart @@ -311,6 +311,17 @@ class _AboutDietScreenState extends State { itemCount: widget.diet.dailySchedule.length, ), SizedBox(height: 32), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Container( + height: 0.4, + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(16), + ), + ), + ), + SizedBox(height: 8), Container( padding: EdgeInsets.symmetric(horizontal: 16), alignment: Alignment.centerLeft, diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart index abad1c19..75eb5b07 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart @@ -17,10 +17,7 @@ class RecipesCubit extends Cubit { loadRecipesList({ String? query, }) async { - emit(const RecipesState.loading()); try { - print('asdasdasdasda'); - print(query); final recipesList = await feedRepository.getRecipes( tags: _selectedTags.toList(), query: query, diff --git a/lib/features/recipes/presentation/pages/about_recipes_screen.dart b/lib/features/recipes/presentation/pages/about_recipes_screen.dart index 645af00b..620580a0 100644 --- a/lib/features/recipes/presentation/pages/about_recipes_screen.dart +++ b/lib/features/recipes/presentation/pages/about_recipes_screen.dart @@ -300,18 +300,31 @@ class _AboutRecipesScreenState extends State { shrinkWrap: true, physics: NeverScrollableScrollPhysics(), itemBuilder: (context, index) => _step(widget.recipes.steps[index], index + 1), - separatorBuilder: (context, index) => Padding( - padding: const EdgeInsets.all(16), - child: Container( - height: 0.4, - decoration: BoxDecoration( - color: Colors.grey, - borderRadius: BorderRadius.circular(16), + separatorBuilder: (context, index) => + Padding( + padding: const EdgeInsets.all(16), + child: Container( + height: 0.4, + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(16), + ), + ), ), - ), - ), itemCount: widget.recipes.steps.length, ), + SizedBox(height: 8), + Padding( + padding: const EdgeInsets.all(16), + child: Container( + height: 0.4, + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(16), + ), + ), + ), + SizedBox(height: 8), Container( padding: EdgeInsets.symmetric(horizontal: 16), alignment: Alignment.centerLeft, @@ -416,7 +429,10 @@ class _AboutRecipesScreenState extends State { _comment(Comment comment, [double radius = 16]) { return Container( - width: MediaQuery.of(context).size.width, + width: MediaQuery + .of(context) + .size + .width, decoration: BoxDecoration( color: replyId == comment.id ? appTheme.blueA400.withOpacity(0.1) : Colors.white, borderRadius: BorderRadius.circular(16), From 0316ea9228134cf6ca0eb376c9e4101562c98db5 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 4 Sep 2024 11:51:03 +0300 Subject: [PATCH 06/31] feat(profile): add button for weight and circumferences --- .../feed/presentation/pages/feed_screen.dart | 1 + .../bloc/profile_cubit/profile_cubit.dart | 14 +- .../presentation/pages/profile_screen.dart | 12 +- .../widgets/circumference_chart_widget.dart | 223 ++++++++++++++---- .../widgets/weight_chart_widget.dart | 192 +++++++++++---- .../repositories/profile_repository.dart | 16 +- .../profile/services/profile_service.dart | 6 +- .../profile/services/profile_service.g.dart | 30 +-- lib/main.dart | 42 ++-- pubspec.yaml | 2 +- 10 files changed, 385 insertions(+), 153 deletions(-) diff --git a/lib/features/feed/presentation/pages/feed_screen.dart b/lib/features/feed/presentation/pages/feed_screen.dart index 241d454a..824c5840 100644 --- a/lib/features/feed/presentation/pages/feed_screen.dart +++ b/lib/features/feed/presentation/pages/feed_screen.dart @@ -32,6 +32,7 @@ class _FeedScreenState extends State { return Scaffold( floatingActionButton: _selectedChipIndex == 1 ? FloatingActionButton.small( + heroTag: 'recipesTagsFilter', backgroundColor: appTheme.blueA400, shape: CircleBorder(), child: Icon( diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index d36ff4d5..8ff0939d 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -45,6 +45,12 @@ class ProfileCubit extends Cubit { waistCircumference: waistCircumference, hipCircumference: hipCircumference, ); + emit( + ProfileState.loaded( + profile: await profileRepository.getMyProfile(), + blogPosts: (state as ProfileStateLoaded).blogPosts, + ), + ); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); print(e); @@ -52,12 +58,18 @@ class ProfileCubit extends Cubit { } addWeight({ - required int weight, + required double weight, }) async { try { await profileRepository.addWeight( weight: weight, ); + emit( + ProfileState.loaded( + profile: await profileRepository.getMyProfile(), + blogPosts: (state as ProfileStateLoaded).blogPosts, + ), + ); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); print(e); diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index b0aeb788..05f53ce8 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -112,8 +112,16 @@ class _ProfileScreenState extends State { ), Builder( builder: (context) { - if (_selectedChipIndex == 0) return WeightChartWidget(chartPoints: chartPoints); - if (_selectedChipIndex == 1) return CircumferenceChartWidget(chartData: chartData); + if (_selectedChipIndex == 0) + return WeightChartWidget( + chartPoints: chartPoints, + profileCubit: context.read(), + ); + if (_selectedChipIndex == 1) + return CircumferenceChartWidget( + chartData: chartData, + profileCubit: context.read(), + ); if (_selectedChipIndex == 2) return ImtChartWidget(chartPoints: chartPoints); else diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index 9294a361..23f9c55d 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -1,36 +1,63 @@ import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; -class CircumferenceChartWidget extends StatelessWidget { +class CircumferenceChartWidget extends StatefulWidget { final List chartData; + final ProfileCubit profileCubit; const CircumferenceChartWidget({ super.key, required this.chartData, + required this.profileCubit, }); + @override + State createState() => _CircumferenceChartWidgetState(); +} + +class _CircumferenceChartWidgetState extends State { + late final chestController; + late final hipController; + late final waistController; + late int chest; + late int hip; + late int waist; + + @override + void initState() { + super.initState(); + chestController = FixedExtentScrollController(initialItem: int.parse(widget.chartData.last.chestCircumference.toString())); + hipController = FixedExtentScrollController(initialItem: int.parse(widget.chartData.last.hipCircumference.toString())); + waistController = FixedExtentScrollController(initialItem: int.parse(widget.chartData.last.waistCircumference.toString())); + chest = widget.chartData.last.chestCircumference; + hip = widget.chartData.last.hipCircumference; + waist = widget.chartData.last.waistCircumference; + } + @override Widget build(BuildContext context) { return Column( children: [ SingleChildScrollView( - padding: EdgeInsets.symmetric(horizontal: 16), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), scrollDirection: Axis.horizontal, physics: const BouncingScrollPhysics(), child: Row( children: [ Text( - '${chartData.last.chestCircumference} см', + '${widget.chartData.last.chestCircumference} см', style: TextStyle( color: Colors.black, fontSize: 48, fontWeight: FontWeight.w500, ), ), - chartData.last.chestCircumference > chartData[chartData.length - 2].chestCircumference + widget.chartData.last.chestCircumference > widget.chartData[widget.chartData.length - 2].chestCircumference ? Icon( Icons.arrow_drop_up, size: 48, @@ -42,14 +69,14 @@ class CircumferenceChartWidget extends StatelessWidget { color: Colors.grey, ), Text( - '${chartData.last.waistCircumference} см', + '${widget.chartData.last.waistCircumference} см', style: TextStyle( color: Colors.black, fontSize: 48, fontWeight: FontWeight.w500, ), ), - chartData.last.waistCircumference > chartData[chartData.length - 2].waistCircumference + widget.chartData.last.waistCircumference > widget.chartData[widget.chartData.length - 2].waistCircumference ? Icon( Icons.arrow_drop_up, size: 48, @@ -61,14 +88,14 @@ class CircumferenceChartWidget extends StatelessWidget { color: Colors.grey, ), Text( - '${chartData.last.hipCircumference} см', + '${widget.chartData.last.hipCircumference} см', style: TextStyle( color: Colors.black, fontSize: 48, fontWeight: FontWeight.w500, ), ), - chartData.last.hipCircumference > chartData[chartData.length - 2].hipCircumference + widget.chartData.last.hipCircumference > widget.chartData[widget.chartData.length - 2].hipCircumference ? Icon( Icons.arrow_drop_up, size: 48, @@ -82,43 +109,147 @@ class CircumferenceChartWidget extends StatelessWidget { ], ), ), - SfCartesianChart( - margin: EdgeInsets.symmetric(horizontal: 8), - enableAxisAnimation: true, - plotAreaBorderWidth: 0, - trackballBehavior: TrackballBehavior( - enable: true, - activationMode: ActivationMode.singleTap, - tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, - tooltipSettings: InteractiveTooltip(), - lineType: TrackballLineType.vertical, - ), - primaryXAxis: DateTimeCategoryAxis( - tickPosition: TickPosition.inside, - majorTickLines: MajorTickLines( - size: 0, + Stack( + alignment: Alignment.bottomRight, + children: [ + SfCartesianChart( + margin: EdgeInsets.symmetric(horizontal: 8), + enableAxisAnimation: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, + ), + primaryXAxis: DateTimeCategoryAxis( + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, + dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + axisLine: AxisLine( + color: Colors.grey.withOpacity(0.3), + width: 0.4, + ), + ), + primaryYAxis: NumericAxis( + isVisible: false, + labelFormat: '{value} см', + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), ), - edgeLabelPlacement: EdgeLabelPlacement.shift, - dateFormat: DateFormat.MMMd('ru'), - labelStyle: TextStyle( - color: Colors.grey, + FloatingActionButton.small( + heroTag: 'addWeight', + onPressed: () { + showModalBottomSheet( + useRootNavigator: true, + context: context, + builder: (context) { + return Column( + children: [ + Expanded( + child: Row( + children: [ + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: chestController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + chest = value; + }, + children: [ + for (int i = 0; i < 301; i++) Text('$i'), + ], + ), + ), + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: hipController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + hip = value; + }, + children: [ + for (int i = 0; i < 301; i++) Text('$i'), + ], + ), + ), + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: waistController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + waist = value; + }, + children: [ + for (int i = 0; i < 301; i++) Text('$i'), + ], + ), + ), + ], + ), + ), + InkWell( + onTap: () { + widget.profileCubit.addCircumference( + chestCircumference: chest, + waistCircumference: waist, + hipCircumference: hip, + ); + Navigator.of(context).pop(); + }, + borderRadius: BorderRadius.circular(16), + child: Ink( + width: MediaQuery.of(context).size.width - 32, + padding: EdgeInsets.all(16), + decoration: BoxDecoration( + color: appTheme.blueA400, + borderRadius: BorderRadius.circular(16), + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + ), + ), + ), + ), + ), + ], + ); + }, + ); + }, + backgroundColor: Colors.red, + shape: CircleBorder(), + child: Icon( + Icons.add, + color: Colors.white, + ), ), - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), - axisLine: AxisLine( - color: Colors.grey.withOpacity(0.3), - width: 0.4, - ), - ), - primaryYAxis: NumericAxis( - isVisible: false, - labelFormat: '{value} см', - axisLine: AxisLine( - width: 1, - ), - majorTickLines: MajorTickLines(size: 0), - ), - series: _getSplineSeries(), - tooltipBehavior: TooltipBehavior(enable: true), + ], ), ], ); @@ -141,7 +272,7 @@ class CircumferenceChartWidget extends StatelessWidget { labelAlignment: ChartDataLabelAlignment.top, isVisible: true, ), - dataSource: chartData, + dataSource: widget.chartData, borderColor: seriesColor1, gradient: LinearGradient( colors: [ @@ -166,7 +297,7 @@ class CircumferenceChartWidget extends StatelessWidget { labelAlignment: ChartDataLabelAlignment.top, isVisible: true, ), - dataSource: chartData, + dataSource: widget.chartData, borderColor: seriesColor2, gradient: LinearGradient( colors: [ @@ -191,7 +322,7 @@ class CircumferenceChartWidget extends StatelessWidget { labelAlignment: ChartDataLabelAlignment.top, isVisible: true, ), - dataSource: chartData, + dataSource: widget.chartData, borderColor: seriesColor3, gradient: LinearGradient( colors: [ diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index 7c75ad61..684a052c 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -1,17 +1,40 @@ import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; -class WeightChartWidget extends StatelessWidget { +class WeightChartWidget extends StatefulWidget { final List chartPoints; + final ProfileCubit profileCubit; const WeightChartWidget({ super.key, required this.chartPoints, + required this.profileCubit, }); + @override + State createState() => _WeightChartWidgetState(); +} + +class _WeightChartWidgetState extends State { + late final weightKiloController; + late final weightGramsController; + late int weightKilo; + late int weightGrams; + + @override + void initState() { + super.initState(); + weightKiloController = FixedExtentScrollController(initialItem: int.parse(widget.chartPoints.last.weight.toString().split('.')[0]) - 20); + weightGramsController = FixedExtentScrollController(initialItem: int.parse(widget.chartPoints.last.weight.toString().split('.')[1][0])); + weightKilo = int.parse(widget.chartPoints.last.weight.toString().split('.')[0]); + weightGrams = int.parse(widget.chartPoints.last.weight.toString().split('.')[1][0]); + } + @override Widget build(BuildContext context) { return Column( @@ -22,14 +45,14 @@ class WeightChartWidget extends StatelessWidget { child: Row( children: [ Text( - '${chartPoints.last.weight.toStringAsFixed(2)} кг', + '${widget.chartPoints.last.weight.toStringAsFixed(1)} кг', style: TextStyle( color: Colors.black, fontSize: 48, fontWeight: FontWeight.w500, ), ), - chartPoints.last.weight > chartPoints[chartPoints.length - 2].weight + widget.chartPoints.last.weight > widget.chartPoints[widget.chartPoints.length - 2].weight ? Icon( Icons.arrow_drop_up, size: 48, @@ -43,46 +66,131 @@ class WeightChartWidget extends StatelessWidget { ], ), ), - SfCartesianChart( - margin: EdgeInsets.symmetric(horizontal: 8), - enableAxisAnimation: true, - plotAreaBorderWidth: 0, - trackballBehavior: TrackballBehavior( - enable: true, - activationMode: ActivationMode.singleTap, - tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, - tooltipSettings: InteractiveTooltip(), - lineType: TrackballLineType.vertical, - ), - primaryXAxis: DateTimeCategoryAxis( - initialVisibleMinimum: chartPoints.first.createdAt, - initialVisibleMaximum: chartPoints.last.createdAt, - tickPosition: TickPosition.inside, - majorTickLines: MajorTickLines( - size: 0, + Stack( + alignment: Alignment.bottomRight, + children: [ + SfCartesianChart( + margin: EdgeInsets.symmetric(horizontal: 8), + enableAxisAnimation: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, + ), + primaryXAxis: DateTimeCategoryAxis( + initialVisibleMinimum: widget.chartPoints.first.createdAt, + initialVisibleMaximum: widget.chartPoints.last.createdAt, + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, + dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + axisLine: AxisLine( + color: Colors.grey.withOpacity(0.3), + width: 0.4, + ), + ), + primaryYAxis: NumericAxis( + isVisible: false, + labelFormat: '{value} кг', + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), ), - edgeLabelPlacement: EdgeLabelPlacement.shift, - dateFormat: DateFormat.MMMd('ru'), - labelStyle: TextStyle( - color: Colors.grey, + FloatingActionButton.small( + heroTag: 'addWeight', + onPressed: () { + showModalBottomSheet( + useRootNavigator: true, + context: context, + builder: (context) { + return Column( + children: [ + Expanded( + child: Row( + children: [ + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: weightKiloController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + weightKilo = value + 20; + }, + children: [ + for (int i = 20; i < 301; i++) Text('$i'), + ], + ), + ), + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: weightGramsController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + weightGrams = value; + }, + children: [ + for (int i = 0; i < 10; i++) Text('$i'), + ], + ), + ), + ], + ), + ), + InkWell( + onTap: () { + widget.profileCubit.addWeight(weight: double.parse('$weightKilo.$weightGrams')); + Navigator.of(context).pop(); + }, + borderRadius: BorderRadius.circular(16), + child: Ink( + width: MediaQuery.of(context).size.width - 32, + padding: EdgeInsets.all(16), + decoration: BoxDecoration( + color: appTheme.blueA400, + borderRadius: BorderRadius.circular(16), + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + ), + ), + ), + ), + ), + ], + ); + }, + ); + }, + backgroundColor: Colors.red, + shape: CircleBorder(), + child: Icon( + Icons.add, + color: Colors.white, + ), ), - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), - axisLine: AxisLine( - color: Colors.grey.withOpacity(0.3), - width: 0.4, - ), - ), - primaryYAxis: NumericAxis( - isVisible: false, - labelFormat: '{value} кг', - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), - axisLine: AxisLine( - width: 1, - ), - majorTickLines: MajorTickLines(size: 0), - ), - series: _getSplineSeries(), - tooltipBehavior: TooltipBehavior(enable: true), + ], ), ], ); @@ -101,7 +209,7 @@ class WeightChartWidget extends StatelessWidget { labelAlignment: ChartDataLabelAlignment.top, isVisible: true, ), - dataSource: chartPoints, + dataSource: widget.chartPoints, borderColor: appTheme.blueA400, gradient: LinearGradient( colors: [ diff --git a/lib/features/profile/repositories/profile_repository.dart b/lib/features/profile/repositories/profile_repository.dart index 2261f74b..0520188f 100644 --- a/lib/features/profile/repositories/profile_repository.dart +++ b/lib/features/profile/repositories/profile_repository.dart @@ -23,7 +23,7 @@ class ProfileRepository { } } - Future addCircumference({ + Future addCircumference({ required int chestCircumference, required int waistCircumference, required int hipCircumference, @@ -33,23 +33,17 @@ class ProfileRepository { chestCircumference: chestCircumference, waistCircumference: waistCircumference, hipCircumference: hipCircumference, - )) - .values - .first; + )); } catch (e) { rethrow; } } - Future addWeight({ - required int weight, + Future addWeight({ + required double weight, }) async { try { - return (await profileService.addWeight( - weight: weight, - )) - .values - .first; + return (await profileService.addWeight(weight: weight)); } catch (e) { rethrow; } diff --git a/lib/features/profile/services/profile_service.dart b/lib/features/profile/services/profile_service.dart index 94a4bdc9..8ab452c9 100644 --- a/lib/features/profile/services/profile_service.dart +++ b/lib/features/profile/services/profile_service.dart @@ -18,15 +18,15 @@ abstract class ProfileService { Future getMyProfile(); @POST('/api/profile/addCircumference') - Future> addCircumference({ + Future addCircumference({ @Part(name: 'chest_circumference') required int chestCircumference, @Part(name: 'waist_circumference') required int waistCircumference, @Part(name: 'hip_circumference') required int hipCircumference, }); @POST('/api/profile/addWeight') - Future> addWeight({ - @Part() required int weight, + Future addWeight({ + @Part() required double weight, }); @GET('/api/blogPosts/search_by_author/{slug}') diff --git a/lib/features/profile/services/profile_service.g.dart b/lib/features/profile/services/profile_service.g.dart index 366a5226..cbab3e03 100644 --- a/lib/features/profile/services/profile_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -88,7 +88,7 @@ class _ProfileService implements ProfileService { } @override - Future> addCircumference({ + Future addCircumference({ required int chestCircumference, required int waistCircumference, required int hipCircumference, @@ -109,7 +109,7 @@ class _ProfileService implements ProfileService { 'hip_circumference', hipCircumference.toString(), )); - final _options = _setStreamType>(Options( + final _options = _setStreamType(Options( method: 'POST', headers: _headers, extra: _extra, @@ -125,20 +125,11 @@ class _ProfileService implements ProfileService { _dio.options.baseUrl, baseUrl, ))); - final _result = await _dio.fetch>(_options); - late Map _value; - try { - _value = _result.data!.map((k, dynamic v) => - MapEntry(k, Circumference.fromJson(v as Map))); - } on Object catch (e, s) { - errorLogger?.logError(e, s, _options); - rethrow; - } - return _value; + await _dio.fetch(_options); } @override - Future> addWeight({required int weight}) async { + Future addWeight({required double weight}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -147,7 +138,7 @@ class _ProfileService implements ProfileService { 'weight', weight.toString(), )); - final _options = _setStreamType>(Options( + final _options = _setStreamType(Options( method: 'POST', headers: _headers, extra: _extra, @@ -163,16 +154,7 @@ class _ProfileService implements ProfileService { _dio.options.baseUrl, baseUrl, ))); - final _result = await _dio.fetch>(_options); - late Map _value; - try { - _value = _result.data!.map((k, dynamic v) => - MapEntry(k, ChartPointModel.fromJson(v as Map))); - } on Object catch (e, s) { - errorLogger?.logError(e, s, _options); - rethrow; - } - return _value; + await _dio.fetch(_options); } @override diff --git a/lib/main.dart b/lib/main.dart index a0867795..948cdf34 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,5 @@ import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart'; -import 'package:eatvio_app/core/initialization_cubit/initialization_state.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/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; @@ -53,29 +52,26 @@ class MyApp extends StatelessWidget { BlocProvider(create: (context) => sl()..loadCalendarList()), BlocProvider(create: (context) => sl()..loadRecipeCreate()), ], - child: BlocListener( - listener: (BuildContext context, InitializationState state) {}, - child: KeyboardDismisser( - gestures: [ - GestureType.onTap, - GestureType.onPanUpdateDownDirection, + child: KeyboardDismisser( + gestures: [ + GestureType.onTap, + GestureType.onPanUpdateDownDirection, + ], + child: MaterialApp.router( + theme: theme, + routerConfig: AppRouter.appRouter, + debugShowCheckedModeBanner: false, + localizationsDelegates: [ + AppLocalizationDelegate(), + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + supportedLocales: [ + Locale( + 'ru', + ), ], - child: MaterialApp.router( - theme: theme, - routerConfig: AppRouter.appRouter, - debugShowCheckedModeBanner: false, - localizationsDelegates: [ - AppLocalizationDelegate(), - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - ], - supportedLocales: [ - Locale( - 'ru', - ), - ], - ), ), ), ); diff --git a/pubspec.yaml b/pubspec.yaml index 514eb4a2..a70e6c94 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,7 +42,7 @@ dependencies: badges: ^3.1.2 google_fonts: ^6.2.1 location: ^6.0.2 - syncfusion_flutter_charts: ^26.2.11 + syncfusion_flutter_charts: ^26.2.12 table_calendar: ^3.1.2 flutter_keyboard_visibility: ^6.0.0 share_plus: ^10.0.0 From d76f5356631960d5b9e942d5edb0ab5956c44348 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 4 Sep 2024 13:03:57 +0300 Subject: [PATCH 07/31] feat(profile): fix pickers --- .../widgets/blog_post_widget.dart | 6 -- .../presentation/pages/profile_screen.dart | 29 +++--- .../widgets/circumference_chart_widget.dart | 89 +++++++++---------- .../widgets/imt_chart_widget.dart | 8 +- .../widgets/weight_chart_widget.dart | 25 +++--- 5 files changed, 70 insertions(+), 87 deletions(-) diff --git a/lib/features/feed/presentation/widgets/blog_post_widget.dart b/lib/features/feed/presentation/widgets/blog_post_widget.dart index 290560a6..8753bb64 100644 --- a/lib/features/feed/presentation/widgets/blog_post_widget.dart +++ b/lib/features/feed/presentation/widgets/blog_post_widget.dart @@ -86,12 +86,6 @@ class _BlogPostWidgetState extends State { child: Html( data: widget.feedBlogPostModel.description, ), - // child: Text( - // widget.feedBlogPostModel.description, - // style: TextStyle( - // color: Colors.black87, - // ), - // ), ), if (widget.feedBlogPostModel.title.isNotEmpty || widget.feedBlogPostModel.description.isNotEmpty) SizedBox(height: 8), GestureDetector( diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index 05f53ce8..de0336fc 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -112,20 +112,21 @@ class _ProfileScreenState extends State { ), Builder( builder: (context) { - if (_selectedChipIndex == 0) - return WeightChartWidget( - chartPoints: chartPoints, - profileCubit: context.read(), - ); - if (_selectedChipIndex == 1) - return CircumferenceChartWidget( - chartData: chartData, - profileCubit: context.read(), - ); - if (_selectedChipIndex == 2) - return ImtChartWidget(chartPoints: chartPoints); - else - return Container(); + switch (_selectedChipIndex) { + case 0: + return WeightChartWidget( + chartPoints: chartPoints, + profileCubit: context.read(), + ); + case 1: + return CircumferenceChartWidget( + chartData: chartData, + profileCubit: context.read(), + ); + case 2: + return ImtChartWidget(chartPoints: chartPoints); + } + return SizedBox.shrink(); }, ), SizedBox(height: 8), diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index 23f9c55d..650c0990 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -21,89 +21,76 @@ class CircumferenceChartWidget extends StatefulWidget { } class _CircumferenceChartWidgetState extends State { - late final chestController; - late final hipController; - late final waistController; + late FixedExtentScrollController chestController; + late FixedExtentScrollController waistController; + late FixedExtentScrollController hipController; late int chest; - late int hip; late int waist; - - @override - void initState() { - super.initState(); - chestController = FixedExtentScrollController(initialItem: int.parse(widget.chartData.last.chestCircumference.toString())); - hipController = FixedExtentScrollController(initialItem: int.parse(widget.chartData.last.hipCircumference.toString())); - waistController = FixedExtentScrollController(initialItem: int.parse(widget.chartData.last.waistCircumference.toString())); - chest = widget.chartData.last.chestCircumference; - hip = widget.chartData.last.hipCircumference; - waist = widget.chartData.last.waistCircumference; - } + late int hip; @override Widget build(BuildContext context) { return Column( children: [ - SingleChildScrollView( + Padding( padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - scrollDirection: Axis.horizontal, - physics: const BouncingScrollPhysics(), child: Row( children: [ Text( - '${widget.chartData.last.chestCircumference} см', + '${widget.chartData.last.chestCircumference}', style: TextStyle( color: Colors.black, - fontSize: 48, + fontSize: 40, fontWeight: FontWeight.w500, ), ), widget.chartData.last.chestCircumference > widget.chartData[widget.chartData.length - 2].chestCircumference ? Icon( Icons.arrow_drop_up, - size: 48, + size: 40, color: Colors.grey, ) : Icon( Icons.arrow_drop_down, - size: 48, + size: 40, color: Colors.grey, ), Text( - '${widget.chartData.last.waistCircumference} см', + '${widget.chartData.last.waistCircumference}', style: TextStyle( color: Colors.black, - fontSize: 48, + fontSize: 40, fontWeight: FontWeight.w500, ), ), widget.chartData.last.waistCircumference > widget.chartData[widget.chartData.length - 2].waistCircumference ? Icon( Icons.arrow_drop_up, - size: 48, + size: 40, color: Colors.grey, ) : Icon( Icons.arrow_drop_down, - size: 48, + size: 40, color: Colors.grey, ), Text( - '${widget.chartData.last.hipCircumference} см', + '${widget.chartData.last.hipCircumference}', style: TextStyle( color: Colors.black, - fontSize: 48, + fontSize: 40, fontWeight: FontWeight.w500, ), ), widget.chartData.last.hipCircumference > widget.chartData[widget.chartData.length - 2].hipCircumference ? Icon( Icons.arrow_drop_up, - size: 48, + size: 40, color: Colors.grey, ) : Icon( Icons.arrow_drop_down, - size: 48, + size: 40, color: Colors.grey, ), ], @@ -151,8 +138,14 @@ class _CircumferenceChartWidgetState extends State { tooltipBehavior: TooltipBehavior(enable: true), ), FloatingActionButton.small( - heroTag: 'addWeight', + heroTag: 'addCircumference', onPressed: () { + chest = widget.chartData.last.chestCircumference; + waist = widget.chartData.last.waistCircumference; + hip = widget.chartData.last.hipCircumference; + chestController = FixedExtentScrollController(initialItem: chest - 20); + waistController = FixedExtentScrollController(initialItem: waist - 20); + hipController = FixedExtentScrollController(initialItem: hip - 20); showModalBottomSheet( useRootNavigator: true, context: context, @@ -173,22 +166,7 @@ class _CircumferenceChartWidgetState extends State { chest = value; }, children: [ - for (int i = 0; i < 301; i++) Text('$i'), - ], - ), - ), - Expanded( - child: CupertinoPicker( - magnification: 1.22, - squeeze: 1.2, - useMagnifier: true, - scrollController: hipController, - itemExtent: 24, - onSelectedItemChanged: (int value) { - hip = value; - }, - children: [ - for (int i = 0; i < 301; i++) Text('$i'), + for (int i = 20; i < 200; i++) Text('$i'), ], ), ), @@ -203,7 +181,22 @@ class _CircumferenceChartWidgetState extends State { waist = value; }, children: [ - for (int i = 0; i < 301; i++) Text('$i'), + for (int i = 20; i < 200; i++) Text('$i'), + ], + ), + ), + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: hipController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + hip = value; + }, + children: [ + for (int i = 20; i < 200; i++) Text('$i'), ], ), ), diff --git a/lib/features/profile/presentation/widgets/imt_chart_widget.dart b/lib/features/profile/presentation/widgets/imt_chart_widget.dart index eaf5808a..6646367e 100644 --- a/lib/features/profile/presentation/widgets/imt_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/imt_chart_widget.dart @@ -22,22 +22,22 @@ class ImtChartWidget extends StatelessWidget { child: Row( children: [ Text( - '${chartPoints.last.bmi.toStringAsFixed(2)} кг/м²', + '${chartPoints.last.bmi.toStringAsFixed(2)}', style: TextStyle( color: Colors.black, - fontSize: 48, + fontSize: 40, fontWeight: FontWeight.w500, ), ), chartPoints.last.bmi > chartPoints[chartPoints.length - 2].bmi ? Icon( Icons.arrow_drop_up, - size: 48, + size: 40, color: Colors.grey, ) : Icon( Icons.arrow_drop_down, - size: 48, + size: 40, color: Colors.grey, ), ], diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index 684a052c..ce3222c8 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -21,20 +21,11 @@ class WeightChartWidget extends StatefulWidget { } class _WeightChartWidgetState extends State { - late final weightKiloController; - late final weightGramsController; + late FixedExtentScrollController weightKiloController; + late FixedExtentScrollController weightGramsController; late int weightKilo; late int weightGrams; - @override - void initState() { - super.initState(); - weightKiloController = FixedExtentScrollController(initialItem: int.parse(widget.chartPoints.last.weight.toString().split('.')[0]) - 20); - weightGramsController = FixedExtentScrollController(initialItem: int.parse(widget.chartPoints.last.weight.toString().split('.')[1][0])); - weightKilo = int.parse(widget.chartPoints.last.weight.toString().split('.')[0]); - weightGrams = int.parse(widget.chartPoints.last.weight.toString().split('.')[1][0]); - } - @override Widget build(BuildContext context) { return Column( @@ -48,19 +39,19 @@ class _WeightChartWidgetState extends State { '${widget.chartPoints.last.weight.toStringAsFixed(1)} кг', style: TextStyle( color: Colors.black, - fontSize: 48, + fontSize: 40, fontWeight: FontWeight.w500, ), ), widget.chartPoints.last.weight > widget.chartPoints[widget.chartPoints.length - 2].weight ? Icon( Icons.arrow_drop_up, - size: 48, + size: 40, color: Colors.grey.withOpacity(0.4), ) : Icon( Icons.arrow_drop_down, - size: 48, + size: 40, color: Colors.grey.withOpacity(0.4), ), ], @@ -113,6 +104,10 @@ class _WeightChartWidgetState extends State { FloatingActionButton.small( heroTag: 'addWeight', onPressed: () { + weightKilo = int.parse(widget.chartPoints.last.weight.toString().split('.')[0]); + weightGrams = int.parse(widget.chartPoints.last.weight.toString().split('.')[1][0]); + weightKiloController = FixedExtentScrollController(initialItem: weightKilo - 20); + weightGramsController = FixedExtentScrollController(initialItem: weightGrams); showModalBottomSheet( useRootNavigator: true, context: context, @@ -133,7 +128,7 @@ class _WeightChartWidgetState extends State { weightKilo = value + 20; }, children: [ - for (int i = 20; i < 301; i++) Text('$i'), + for (int i = 20; i < 300; i++) Text('$i'), ], ), ), From f9c10047b2b4ba5895bf3377086f9ad94f2124e3 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 4 Sep 2024 17:27:46 +0300 Subject: [PATCH 08/31] feat(profile): some fixes, add buttons --- assets/icons/chat.svg | 18 ++ assets/icons/comment.svg | 18 ++ assets/icons/copy.svg | 19 ++ assets/icons/diary.svg | 18 ++ assets/icons/exit.svg | 18 ++ assets/icons/favorite_blog_posts.svg | 22 +++ assets/icons/favorite_recipes.svg | 18 ++ assets/icons/feed.svg | 19 ++ assets/icons/finance.svg | 18 ++ assets/icons/glosasry.svg | 18 ++ assets/icons/like.svg | 22 +++ assets/icons/like_filled.svg | 22 +++ assets/icons/meat.svg | 20 +++ assets/icons/my_blog_posts.svg | 18 ++ assets/icons/my_diets.svg | 24 +++ assets/icons/my_plans.svg | 35 ++++ assets/icons/my_rating.svg | 18 ++ assets/icons/my_recipes.svg | 18 ++ assets/icons/notifications.svg | 18 ++ assets/icons/paste.svg | 18 ++ assets/icons/profile_settings.svg | 18 ++ assets/icons/send.svg | 18 ++ assets/icons/share.svg | 18 ++ assets/icons/subscribers.svg | 18 ++ assets/icons/time.svg | 18 ++ assets/icons/views.svg | 23 +++ assets/icons/Консультации.svg | 18 ++ assets/icons/Шаги.svg | 18 ++ assets/icons/калорийность.svg | 18 ++ assets/icons/легкая.svg | 18 ++ assets/icons/овощи.svg | 18 ++ assets/icons/поддержание формы.svg | 18 ++ assets/icons/поддержка.svg | 18 ++ assets/icons/похудения.svg | 18 ++ assets/icons/углеводная.svg | 18 ++ assets/icons/улучшение самочувствия.svg | 18 ++ assets/icons/формирование пище.svg | 18 ++ assets/icons/хорошее.svg | 18 ++ assets/icons/хорошеее.svg | 18 ++ assets/icons/этапы шаги.svg | 18 ++ lib/app_router.dart | 16 +- lib/core/models/base_models.dart | 4 +- lib/core/models/base_models.freezed.dart | 64 ++++--- lib/core/models/base_models.g.dart | 4 +- .../pages/blog_post_create_screen.dart | 5 +- .../widgets/bottom_navigation_bar_widget.dart | 4 +- .../widgets/blog_post_widget.dart | 70 ++++++-- .../profile/models/profile_model.dart | 6 +- .../profile/models/profile_model.freezed.dart | 83 +++++---- .../profile/models/profile_model.g.dart | 8 +- .../presentation/pages/profile_screen.dart | 129 ++++++++++++-- .../widgets/circumference_chart_widget.dart | 166 +++++++++++------- .../widgets/weight_chart_widget.dart | 148 +++++++++------- lib/main.dart | 4 +- .../auth/auth_screen/auth_screen.dart | 0 .../auth/auth_screen/bloc/auth_bloc.dart | 2 +- .../auth/auth_screen/bloc/auth_event.dart | 0 .../auth/auth_screen/bloc/auth_state.dart | 0 .../auth/auth_screen/models/auth_model.dart | 0 .../bloc/diary_edit_state.dart | 0 .../diary_edit_screen/diary_edit_screen.dart | 0 .../models/diary_edit_model.dart | 0 .../bloc/diet_create_bloc.dart | 2 +- .../bloc/diet_create_event.dart | 0 .../bloc/diet_create_state.dart | 0 .../diet_create_screen.dart | 0 .../models/diet_create_model.dart | 0 .../diet_edit_screen/bloc/diet_edit_bloc.dart | 2 +- .../bloc/diet_edit_event.dart | 0 .../bloc/diet_edit_state.dart | 0 .../diet_edit_screen/diet_edit_screen.dart | 0 .../models/diet_edit_model.dart | 0 .../bloc/diet_select_bloc.dart | 4 +- .../bloc/diet_select_event.dart | 0 .../bloc/diet_select_state.dart | 0 .../diet_select_screen.dart | 0 .../models/diet_select_model.dart | 0 .../diet_show_screen/bloc/diet_show_bloc.dart | 2 +- .../bloc/diet_show_event.dart | 0 .../bloc/diet_show_state.dart | 0 .../diet_show_screen/diet_show_screen.dart | 0 .../models/diet_show_model.dart | 0 .../bloc/blog_post_create_bloc.dart | 2 +- .../bloc/blog_post_create_event.dart | 0 .../bloc/blog_post_create_state.dart | 0 .../models/blog_post_create_model.dart | 0 .../bloc/blog_post_edit_bloc.dart | 2 +- .../bloc/blog_post_edit_event.dart | 0 .../bloc/blog_post_edit_state.dart | 0 .../blog_post_edit_screen.dart | 0 .../models/blog_post_edit_model.dart | 0 .../models/blog_post_model.dart | 2 +- .../models/comment_model.dart | 0 .../widgets/comment_widget.dart | 2 +- .../feed_screen/widgets/feed_scroll_item.dart | 0 .../feed_screen/widgets/feed_search_view.dart | 0 .../bloc/glossary_screen_bloc.dart | 2 +- .../bloc/glossary_screen_event.dart | 0 .../bloc/glossary_screen_state.dart | 0 .../glossary_screen/glossary_screen.dart | 4 +- .../models/glossary_screen_model.dart | 0 .../widgets/glossary_scroll_item.dart | 0 .../widgets/glossary_search_widget.dart | 0 .../bloc/plan_create_bloc.dart | 2 +- .../bloc/plan_create_event.dart | 0 .../bloc/plan_create_state.dart | 0 .../models/plan_create_model.dart | 0 .../plan_create_screen.dart | 0 .../plan_edit_screen/bloc/plan_edit_bloc.dart | 2 +- .../bloc/plan_edit_event.dart | 0 .../bloc/plan_edit_state.dart | 0 .../models/plan_edit_model.dart | 0 .../plan_edit_screen/plan_edit_screen.dart | 0 .../bloc/plan_select_bloc.dart | 4 +- .../bloc/plan_select_event.dart | 0 .../bloc/plan_select_state.dart | 0 .../models/plan_select_model.dart | 0 .../plan_select_screen.dart | 0 .../plan_show_screen/bloc/plan_show_bloc.dart | 2 +- .../bloc/plan_show_event.dart | 0 .../bloc/plan_show_state.dart | 0 .../models/plan_show_model.dart | 0 .../plan_show_screen/plan_show_screen.dart | 0 .../bloc/my_profile_bloc.dart | 4 +- .../bloc/my_profile_event.dart | 0 .../bloc/my_profile_state.dart | 0 .../models/my_profile_model.dart | 0 .../my_profile_screen/my_profile_screen.dart | 0 .../my_profile_screen/my_settings_screen.dart | 0 .../bloc/recipe_edit_bloc.dart | 2 +- .../bloc/recipe_edit_event.dart | 0 .../bloc/recipe_edit_state.dart | 0 .../models/recipe_edit_model.dart | 0 .../recipe_edit_screen.dart | 0 .../bloc/recipe_select_bloc.dart | 2 +- .../bloc/recipe_select_event.dart | 0 .../bloc/recipe_select_state.dart | 0 .../models/recipe_select_model.dart | 0 .../recipe_select_screen.dart | 0 .../bloc/recipe_show_bloc.dart | 4 +- .../bloc/recipe_show_event.dart | 0 .../bloc/recipe_show_state.dart | 0 .../models/recipe_show_model.dart | 0 .../recipe_show_screen.dart | 2 +- .../widgets/comment_widget.dart | 2 +- .../bloc/subscribers_bloc.dart | 4 +- .../bloc/subscribers_event.dart | 0 .../bloc/subscribers_state.dart | 0 .../models/subscribers_model.dart | 0 .../subscribers_screen.dart | 2 +- lib/widgets/custom_expandable_list.dart | 2 +- lib/widgets/custom_hyper_switch.dart | 2 +- lib/widgets/custom_hypo_switch.dart | 2 +- test/auth_test.dart | 6 +- 154 files changed, 1249 insertions(+), 296 deletions(-) create mode 100644 assets/icons/chat.svg create mode 100644 assets/icons/comment.svg create mode 100644 assets/icons/copy.svg create mode 100644 assets/icons/diary.svg create mode 100644 assets/icons/exit.svg create mode 100644 assets/icons/favorite_blog_posts.svg create mode 100644 assets/icons/favorite_recipes.svg create mode 100644 assets/icons/feed.svg create mode 100644 assets/icons/finance.svg create mode 100644 assets/icons/glosasry.svg create mode 100644 assets/icons/like.svg create mode 100644 assets/icons/like_filled.svg create mode 100644 assets/icons/meat.svg create mode 100644 assets/icons/my_blog_posts.svg create mode 100644 assets/icons/my_diets.svg create mode 100644 assets/icons/my_plans.svg create mode 100644 assets/icons/my_rating.svg create mode 100644 assets/icons/my_recipes.svg create mode 100644 assets/icons/notifications.svg create mode 100644 assets/icons/paste.svg create mode 100644 assets/icons/profile_settings.svg create mode 100644 assets/icons/send.svg create mode 100644 assets/icons/share.svg create mode 100644 assets/icons/subscribers.svg create mode 100644 assets/icons/time.svg create mode 100644 assets/icons/views.svg create mode 100644 assets/icons/Консультации.svg create mode 100644 assets/icons/Шаги.svg create mode 100644 assets/icons/калорийность.svg create mode 100644 assets/icons/легкая.svg create mode 100644 assets/icons/овощи.svg create mode 100644 assets/icons/поддержание формы.svg create mode 100644 assets/icons/поддержка.svg create mode 100644 assets/icons/похудения.svg create mode 100644 assets/icons/углеводная.svg create mode 100644 assets/icons/улучшение самочувствия.svg create mode 100644 assets/icons/формирование пище.svg create mode 100644 assets/icons/хорошее.svg create mode 100644 assets/icons/хорошеее.svg create mode 100644 assets/icons/этапы шаги.svg rename lib/{presentation => old}/auth/auth_screen/auth_screen.dart (100%) rename lib/{presentation => old}/auth/auth_screen/bloc/auth_bloc.dart (88%) rename lib/{presentation => old}/auth/auth_screen/bloc/auth_event.dart (100%) rename lib/{presentation => old}/auth/auth_screen/bloc/auth_state.dart (100%) rename lib/{presentation => old}/auth/auth_screen/models/auth_model.dart (100%) rename lib/{presentation => old}/diary/diary_edit_screen/bloc/diary_edit_state.dart (100%) rename lib/{presentation => old}/diary/diary_edit_screen/diary_edit_screen.dart (100%) rename lib/{presentation => old}/diary/diary_edit_screen/models/diary_edit_model.dart (100%) rename lib/{presentation => old}/diets/diet_create_screen/bloc/diet_create_bloc.dart (99%) rename lib/{presentation => old}/diets/diet_create_screen/bloc/diet_create_event.dart (100%) rename lib/{presentation => old}/diets/diet_create_screen/bloc/diet_create_state.dart (100%) rename lib/{presentation => old}/diets/diet_create_screen/diet_create_screen.dart (100%) rename lib/{presentation => old}/diets/diet_create_screen/models/diet_create_model.dart (100%) rename lib/{presentation => old}/diets/diet_edit_screen/bloc/diet_edit_bloc.dart (97%) rename lib/{presentation => old}/diets/diet_edit_screen/bloc/diet_edit_event.dart (100%) rename lib/{presentation => old}/diets/diet_edit_screen/bloc/diet_edit_state.dart (100%) rename lib/{presentation => old}/diets/diet_edit_screen/diet_edit_screen.dart (100%) rename lib/{presentation => old}/diets/diet_edit_screen/models/diet_edit_model.dart (100%) rename lib/{presentation => old}/diets/diet_select_screen/bloc/diet_select_bloc.dart (93%) rename lib/{presentation => old}/diets/diet_select_screen/bloc/diet_select_event.dart (100%) rename lib/{presentation => old}/diets/diet_select_screen/bloc/diet_select_state.dart (100%) rename lib/{presentation => old}/diets/diet_select_screen/diet_select_screen.dart (100%) rename lib/{presentation => old}/diets/diet_select_screen/models/diet_select_model.dart (100%) rename lib/{presentation => old}/diets/diet_show_screen/bloc/diet_show_bloc.dart (97%) rename lib/{presentation => old}/diets/diet_show_screen/bloc/diet_show_event.dart (100%) rename lib/{presentation => old}/diets/diet_show_screen/bloc/diet_show_state.dart (100%) rename lib/{presentation => old}/diets/diet_show_screen/diet_show_screen.dart (100%) rename lib/{presentation => old}/diets/diet_show_screen/models/diet_show_model.dart (100%) rename lib/{presentation => old}/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart (96%) rename lib/{presentation => old}/feed/blog_post_create_screen/bloc/blog_post_create_event.dart (100%) rename lib/{presentation => old}/feed/blog_post_create_screen/bloc/blog_post_create_state.dart (100%) rename lib/{presentation => old}/feed/blog_post_create_screen/models/blog_post_create_model.dart (100%) rename lib/{presentation => old}/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart (97%) rename lib/{presentation => old}/feed/blog_post_edit_screen/bloc/blog_post_edit_event.dart (100%) rename lib/{presentation => old}/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart (100%) rename lib/{presentation => old}/feed/blog_post_edit_screen/blog_post_edit_screen.dart (100%) rename lib/{presentation => old}/feed/blog_post_edit_screen/models/blog_post_edit_model.dart (100%) rename lib/{presentation => old}/feed/blog_post_screen/models/blog_post_model.dart (85%) rename lib/{presentation => old}/feed/blog_post_screen/models/comment_model.dart (100%) rename lib/{presentation => old}/feed/blog_post_screen/widgets/comment_widget.dart (97%) rename lib/{presentation => old}/feed/feed_screen/widgets/feed_scroll_item.dart (100%) rename lib/{presentation => old}/feed/feed_screen/widgets/feed_search_view.dart (100%) rename lib/{presentation => old}/glossary/glossary_screen/bloc/glossary_screen_bloc.dart (97%) rename lib/{presentation => old}/glossary/glossary_screen/bloc/glossary_screen_event.dart (100%) rename lib/{presentation => old}/glossary/glossary_screen/bloc/glossary_screen_state.dart (100%) rename lib/{presentation => old}/glossary/glossary_screen/glossary_screen.dart (98%) rename lib/{presentation => old}/glossary/glossary_screen/models/glossary_screen_model.dart (100%) rename lib/{presentation => old}/glossary/glossary_screen/widgets/glossary_scroll_item.dart (100%) rename lib/{presentation => old}/glossary/glossary_screen/widgets/glossary_search_widget.dart (100%) rename lib/{presentation => old}/plans/plan_create_screen/bloc/plan_create_bloc.dart (99%) rename lib/{presentation => old}/plans/plan_create_screen/bloc/plan_create_event.dart (100%) rename lib/{presentation => old}/plans/plan_create_screen/bloc/plan_create_state.dart (100%) rename lib/{presentation => old}/plans/plan_create_screen/models/plan_create_model.dart (100%) rename lib/{presentation => old}/plans/plan_create_screen/plan_create_screen.dart (100%) rename lib/{presentation => old}/plans/plan_edit_screen/bloc/plan_edit_bloc.dart (97%) rename lib/{presentation => old}/plans/plan_edit_screen/bloc/plan_edit_event.dart (100%) rename lib/{presentation => old}/plans/plan_edit_screen/bloc/plan_edit_state.dart (100%) rename lib/{presentation => old}/plans/plan_edit_screen/models/plan_edit_model.dart (100%) rename lib/{presentation => old}/plans/plan_edit_screen/plan_edit_screen.dart (100%) rename lib/{presentation => old}/plans/plan_select_screen/bloc/plan_select_bloc.dart (93%) rename lib/{presentation => old}/plans/plan_select_screen/bloc/plan_select_event.dart (100%) rename lib/{presentation => old}/plans/plan_select_screen/bloc/plan_select_state.dart (100%) rename lib/{presentation => old}/plans/plan_select_screen/models/plan_select_model.dart (100%) rename lib/{presentation => old}/plans/plan_select_screen/plan_select_screen.dart (100%) rename lib/{presentation => old}/plans/plan_show_screen/bloc/plan_show_bloc.dart (97%) rename lib/{presentation => old}/plans/plan_show_screen/bloc/plan_show_event.dart (100%) rename lib/{presentation => old}/plans/plan_show_screen/bloc/plan_show_state.dart (100%) rename lib/{presentation => old}/plans/plan_show_screen/models/plan_show_model.dart (100%) rename lib/{presentation => old}/plans/plan_show_screen/plan_show_screen.dart (100%) rename lib/{presentation => old}/profile/my_profile_screen/bloc/my_profile_bloc.dart (98%) rename lib/{presentation => old}/profile/my_profile_screen/bloc/my_profile_event.dart (100%) rename lib/{presentation => old}/profile/my_profile_screen/bloc/my_profile_state.dart (100%) rename lib/{presentation => old}/profile/my_profile_screen/models/my_profile_model.dart (100%) rename lib/{presentation => old}/profile/my_profile_screen/my_profile_screen.dart (100%) rename lib/{presentation => old}/profile/my_profile_screen/my_settings_screen.dart (100%) rename lib/{presentation => old}/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart (99%) rename lib/{presentation => old}/recipe/recipe_edit_screen/bloc/recipe_edit_event.dart (100%) rename lib/{presentation => old}/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart (100%) rename lib/{presentation => old}/recipe/recipe_edit_screen/models/recipe_edit_model.dart (100%) rename lib/{presentation => old}/recipe/recipe_edit_screen/recipe_edit_screen.dart (100%) rename lib/{presentation => old}/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart (96%) rename lib/{presentation => old}/recipe/recipe_select_screen/bloc/recipe_select_event.dart (100%) rename lib/{presentation => old}/recipe/recipe_select_screen/bloc/recipe_select_state.dart (100%) rename lib/{presentation => old}/recipe/recipe_select_screen/models/recipe_select_model.dart (100%) rename lib/{presentation => old}/recipe/recipe_select_screen/recipe_select_screen.dart (100%) rename lib/{presentation => old}/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart (97%) rename lib/{presentation => old}/recipe/recipe_show_screen/bloc/recipe_show_event.dart (100%) rename lib/{presentation => old}/recipe/recipe_show_screen/bloc/recipe_show_state.dart (100%) rename lib/{presentation => old}/recipe/recipe_show_screen/models/recipe_show_model.dart (100%) rename lib/{presentation => old}/recipe/recipe_show_screen/recipe_show_screen.dart (99%) rename lib/{presentation => old}/recipe/recipe_show_screen/widgets/comment_widget.dart (97%) rename lib/{presentation => old}/users/subscribers_screen/bloc/subscribers_bloc.dart (93%) rename lib/{presentation => old}/users/subscribers_screen/bloc/subscribers_event.dart (100%) rename lib/{presentation => old}/users/subscribers_screen/bloc/subscribers_state.dart (100%) rename lib/{presentation => old}/users/subscribers_screen/models/subscribers_model.dart (100%) rename lib/{presentation => old}/users/subscribers_screen/subscribers_screen.dart (98%) diff --git a/assets/icons/chat.svg b/assets/icons/chat.svg new file mode 100644 index 00000000..01f615fe --- /dev/null +++ b/assets/icons/chat.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/comment.svg b/assets/icons/comment.svg new file mode 100644 index 00000000..60b1e584 --- /dev/null +++ b/assets/icons/comment.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/copy.svg b/assets/icons/copy.svg new file mode 100644 index 00000000..4ddffa65 --- /dev/null +++ b/assets/icons/copy.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/assets/icons/diary.svg b/assets/icons/diary.svg new file mode 100644 index 00000000..3ddc00d2 --- /dev/null +++ b/assets/icons/diary.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/exit.svg b/assets/icons/exit.svg new file mode 100644 index 00000000..11e622be --- /dev/null +++ b/assets/icons/exit.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/favorite_blog_posts.svg b/assets/icons/favorite_blog_posts.svg new file mode 100644 index 00000000..b4c30bc7 --- /dev/null +++ b/assets/icons/favorite_blog_posts.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/assets/icons/favorite_recipes.svg b/assets/icons/favorite_recipes.svg new file mode 100644 index 00000000..028fb5b3 --- /dev/null +++ b/assets/icons/favorite_recipes.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/feed.svg b/assets/icons/feed.svg new file mode 100644 index 00000000..3cefd68a --- /dev/null +++ b/assets/icons/feed.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/assets/icons/finance.svg b/assets/icons/finance.svg new file mode 100644 index 00000000..3bb33357 --- /dev/null +++ b/assets/icons/finance.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/glosasry.svg b/assets/icons/glosasry.svg new file mode 100644 index 00000000..1cb5ba2c --- /dev/null +++ b/assets/icons/glosasry.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/like.svg b/assets/icons/like.svg new file mode 100644 index 00000000..4fe0f919 --- /dev/null +++ b/assets/icons/like.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/assets/icons/like_filled.svg b/assets/icons/like_filled.svg new file mode 100644 index 00000000..6233ab3a --- /dev/null +++ b/assets/icons/like_filled.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/assets/icons/meat.svg b/assets/icons/meat.svg new file mode 100644 index 00000000..5205a78c --- /dev/null +++ b/assets/icons/meat.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + diff --git a/assets/icons/my_blog_posts.svg b/assets/icons/my_blog_posts.svg new file mode 100644 index 00000000..4dd28718 --- /dev/null +++ b/assets/icons/my_blog_posts.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/my_diets.svg b/assets/icons/my_diets.svg new file mode 100644 index 00000000..7714b3fa --- /dev/null +++ b/assets/icons/my_diets.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/my_plans.svg b/assets/icons/my_plans.svg new file mode 100644 index 00000000..5e100f69 --- /dev/null +++ b/assets/icons/my_plans.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/my_rating.svg b/assets/icons/my_rating.svg new file mode 100644 index 00000000..8b5e069f --- /dev/null +++ b/assets/icons/my_rating.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/my_recipes.svg b/assets/icons/my_recipes.svg new file mode 100644 index 00000000..246014c5 --- /dev/null +++ b/assets/icons/my_recipes.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/notifications.svg b/assets/icons/notifications.svg new file mode 100644 index 00000000..fe550083 --- /dev/null +++ b/assets/icons/notifications.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/paste.svg b/assets/icons/paste.svg new file mode 100644 index 00000000..a6fe95bf --- /dev/null +++ b/assets/icons/paste.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/profile_settings.svg b/assets/icons/profile_settings.svg new file mode 100644 index 00000000..b3852d07 --- /dev/null +++ b/assets/icons/profile_settings.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/send.svg b/assets/icons/send.svg new file mode 100644 index 00000000..d4b7b65e --- /dev/null +++ b/assets/icons/send.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/share.svg b/assets/icons/share.svg new file mode 100644 index 00000000..711847c2 --- /dev/null +++ b/assets/icons/share.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/subscribers.svg b/assets/icons/subscribers.svg new file mode 100644 index 00000000..4006d4b4 --- /dev/null +++ b/assets/icons/subscribers.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/time.svg b/assets/icons/time.svg new file mode 100644 index 00000000..5037d404 --- /dev/null +++ b/assets/icons/time.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/views.svg b/assets/icons/views.svg new file mode 100644 index 00000000..60ff0928 --- /dev/null +++ b/assets/icons/views.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + diff --git a/assets/icons/Консультации.svg b/assets/icons/Консультации.svg new file mode 100644 index 00000000..0bb87eaa --- /dev/null +++ b/assets/icons/Консультации.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/Шаги.svg b/assets/icons/Шаги.svg new file mode 100644 index 00000000..14563821 --- /dev/null +++ b/assets/icons/Шаги.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/калорийность.svg b/assets/icons/калорийность.svg new file mode 100644 index 00000000..329d1bda --- /dev/null +++ b/assets/icons/калорийность.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/легкая.svg b/assets/icons/легкая.svg new file mode 100644 index 00000000..1f752bc3 --- /dev/null +++ b/assets/icons/легкая.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/овощи.svg b/assets/icons/овощи.svg new file mode 100644 index 00000000..3d0d4eba --- /dev/null +++ b/assets/icons/овощи.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/поддержание формы.svg b/assets/icons/поддержание формы.svg new file mode 100644 index 00000000..eb3aca15 --- /dev/null +++ b/assets/icons/поддержание формы.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/поддержка.svg b/assets/icons/поддержка.svg new file mode 100644 index 00000000..84b48d66 --- /dev/null +++ b/assets/icons/поддержка.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/похудения.svg b/assets/icons/похудения.svg new file mode 100644 index 00000000..680582a8 --- /dev/null +++ b/assets/icons/похудения.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/углеводная.svg b/assets/icons/углеводная.svg new file mode 100644 index 00000000..3926c874 --- /dev/null +++ b/assets/icons/углеводная.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/улучшение самочувствия.svg b/assets/icons/улучшение самочувствия.svg new file mode 100644 index 00000000..0a66c836 --- /dev/null +++ b/assets/icons/улучшение самочувствия.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/формирование пище.svg b/assets/icons/формирование пище.svg new file mode 100644 index 00000000..a50c9209 --- /dev/null +++ b/assets/icons/формирование пище.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/хорошее.svg b/assets/icons/хорошее.svg new file mode 100644 index 00000000..430bea61 --- /dev/null +++ b/assets/icons/хорошее.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/хорошеее.svg b/assets/icons/хорошеее.svg new file mode 100644 index 00000000..8f45b384 --- /dev/null +++ b/assets/icons/хорошеее.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/assets/icons/этапы шаги.svg b/assets/icons/этапы шаги.svg new file mode 100644 index 00000000..8bb51a1c --- /dev/null +++ b/assets/icons/этапы шаги.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/lib/app_router.dart b/lib/app_router.dart index 9b5b46de..6e4bac50 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -20,14 +20,14 @@ import 'package:eatvio_app/features/recipes/presentation/pages/about_recipes_scr import 'package:eatvio_app/features/recipes/presentation/pages/recipe_create_screen.dart'; import 'package:eatvio_app/features/recipes/presentation/pages/recipe_edit_screen.dart'; import 'package:eatvio_app/features/registration/presentation/pages/registration_screen.dart'; -import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart'; -import 'package:eatvio_app/presentation/diets/diet_create_screen/diet_create_screen.dart'; -import 'package:eatvio_app/presentation/diets/diet_select_screen/diet_select_screen.dart'; -import 'package:eatvio_app/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart'; -import 'package:eatvio_app/presentation/glossary/glossary_screen/glossary_screen.dart'; -import 'package:eatvio_app/presentation/plans/plan_select_screen/plan_select_screen.dart'; -import 'package:eatvio_app/presentation/profile/my_profile_screen/my_settings_screen.dart'; -import 'package:eatvio_app/presentation/recipe/recipe_select_screen/recipe_select_screen.dart'; +import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; +import 'package:eatvio_app/old/diets/diet_create_screen/diet_create_screen.dart'; +import 'package:eatvio_app/old/diets/diet_select_screen/diet_select_screen.dart'; +import 'package:eatvio_app/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart'; +import 'package:eatvio_app/old/glossary/glossary_screen/glossary_screen.dart'; +import 'package:eatvio_app/old/plans/plan_select_screen/plan_select_screen.dart'; +import 'package:eatvio_app/old/profile/my_profile_screen/my_settings_screen.dart'; +import 'package:eatvio_app/old/recipe/recipe_select_screen/recipe_select_screen.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/core/models/base_models.dart b/lib/core/models/base_models.dart index 48de60ef..2293cb9f 100644 --- a/lib/core/models/base_models.dart +++ b/lib/core/models/base_models.dart @@ -19,12 +19,12 @@ class Links with _$Links { class Meta with _$Meta { const factory Meta({ @JsonKey(name: "current_page") required int currentPage, - @JsonKey(name: "from") required int from, + @JsonKey(name: "from") required dynamic from, @JsonKey(name: "last_page") required int lastPage, @JsonKey(name: "links") required List links, @JsonKey(name: "path") required String path, @JsonKey(name: "per_page") required int perPage, - @JsonKey(name: "to") required int to, + @JsonKey(name: "to") required dynamic to, @JsonKey(name: "total") required int total, }) = _Meta; diff --git a/lib/core/models/base_models.freezed.dart b/lib/core/models/base_models.freezed.dart index b62824d5..6571812b 100644 --- a/lib/core/models/base_models.freezed.dart +++ b/lib/core/models/base_models.freezed.dart @@ -236,7 +236,7 @@ mixin _$Meta { @JsonKey(name: "current_page") int get currentPage => throw _privateConstructorUsedError; @JsonKey(name: "from") - int get from => throw _privateConstructorUsedError; + dynamic get from => throw _privateConstructorUsedError; @JsonKey(name: "last_page") int get lastPage => throw _privateConstructorUsedError; @JsonKey(name: "links") @@ -246,7 +246,7 @@ mixin _$Meta { @JsonKey(name: "per_page") int get perPage => throw _privateConstructorUsedError; @JsonKey(name: "to") - int get to => throw _privateConstructorUsedError; + dynamic get to => throw _privateConstructorUsedError; @JsonKey(name: "total") int get total => throw _privateConstructorUsedError; @@ -262,12 +262,12 @@ abstract class $MetaCopyWith<$Res> { @useResult $Res call( {@JsonKey(name: "current_page") int currentPage, - @JsonKey(name: "from") int from, + @JsonKey(name: "from") dynamic from, @JsonKey(name: "last_page") int lastPage, @JsonKey(name: "links") List links, @JsonKey(name: "path") String path, @JsonKey(name: "per_page") int perPage, - @JsonKey(name: "to") int to, + @JsonKey(name: "to") dynamic to, @JsonKey(name: "total") int total}); } @@ -285,12 +285,12 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> @override $Res call({ Object? currentPage = null, - Object? from = null, + Object? from = freezed, Object? lastPage = null, Object? links = null, Object? path = null, Object? perPage = null, - Object? to = null, + Object? to = freezed, Object? total = null, }) { return _then(_value.copyWith( @@ -298,10 +298,10 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> ? _value.currentPage : currentPage // ignore: cast_nullable_to_non_nullable as int, - from: null == from + from: freezed == from ? _value.from : from // ignore: cast_nullable_to_non_nullable - as int, + as dynamic, lastPage: null == lastPage ? _value.lastPage : lastPage // ignore: cast_nullable_to_non_nullable @@ -318,10 +318,10 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> ? _value.perPage : perPage // ignore: cast_nullable_to_non_nullable as int, - to: null == to + to: freezed == to ? _value.to : to // ignore: cast_nullable_to_non_nullable - as int, + as dynamic, total: null == total ? _value.total : total // ignore: cast_nullable_to_non_nullable @@ -339,12 +339,12 @@ abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { @useResult $Res call( {@JsonKey(name: "current_page") int currentPage, - @JsonKey(name: "from") int from, + @JsonKey(name: "from") dynamic from, @JsonKey(name: "last_page") int lastPage, @JsonKey(name: "links") List links, @JsonKey(name: "path") String path, @JsonKey(name: "per_page") int perPage, - @JsonKey(name: "to") int to, + @JsonKey(name: "to") dynamic to, @JsonKey(name: "total") int total}); } @@ -359,12 +359,12 @@ class __$$MetaImplCopyWithImpl<$Res> @override $Res call({ Object? currentPage = null, - Object? from = null, + Object? from = freezed, Object? lastPage = null, Object? links = null, Object? path = null, Object? perPage = null, - Object? to = null, + Object? to = freezed, Object? total = null, }) { return _then(_$MetaImpl( @@ -372,10 +372,10 @@ class __$$MetaImplCopyWithImpl<$Res> ? _value.currentPage : currentPage // ignore: cast_nullable_to_non_nullable as int, - from: null == from + from: freezed == from ? _value.from : from // ignore: cast_nullable_to_non_nullable - as int, + as dynamic, lastPage: null == lastPage ? _value.lastPage : lastPage // ignore: cast_nullable_to_non_nullable @@ -392,10 +392,10 @@ class __$$MetaImplCopyWithImpl<$Res> ? _value.perPage : perPage // ignore: cast_nullable_to_non_nullable as int, - to: null == to + to: freezed == to ? _value.to : to // ignore: cast_nullable_to_non_nullable - as int, + as dynamic, total: null == total ? _value.total : total // ignore: cast_nullable_to_non_nullable @@ -426,7 +426,7 @@ class _$MetaImpl implements _Meta { final int currentPage; @override @JsonKey(name: "from") - final int from; + final dynamic from; @override @JsonKey(name: "last_page") final int lastPage; @@ -447,7 +447,7 @@ class _$MetaImpl implements _Meta { final int perPage; @override @JsonKey(name: "to") - final int to; + final dynamic to; @override @JsonKey(name: "total") final int total; @@ -464,20 +464,28 @@ class _$MetaImpl implements _Meta { other is _$MetaImpl && (identical(other.currentPage, currentPage) || other.currentPage == currentPage) && - (identical(other.from, from) || other.from == from) && + const DeepCollectionEquality().equals(other.from, from) && (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) && - (identical(other.to, to) || other.to == to) && + const DeepCollectionEquality().equals(other.to, to) && (identical(other.total, total) || other.total == total)); } @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, + const DeepCollectionEquality().hash(from), + lastPage, + const DeepCollectionEquality().hash(_links), + path, + perPage, + const DeepCollectionEquality().hash(to), + total); @JsonKey(ignore: true) @override @@ -496,12 +504,12 @@ class _$MetaImpl implements _Meta { abstract class _Meta implements Meta { const factory _Meta( {@JsonKey(name: "current_page") required final int currentPage, - @JsonKey(name: "from") required final int from, + @JsonKey(name: "from") required final dynamic from, @JsonKey(name: "last_page") required final int lastPage, @JsonKey(name: "links") required final List links, @JsonKey(name: "path") required final String path, @JsonKey(name: "per_page") required final int perPage, - @JsonKey(name: "to") required final int to, + @JsonKey(name: "to") required final dynamic to, @JsonKey(name: "total") required final int total}) = _$MetaImpl; factory _Meta.fromJson(Map json) = _$MetaImpl.fromJson; @@ -511,7 +519,7 @@ abstract class _Meta implements Meta { int get currentPage; @override @JsonKey(name: "from") - int get from; + dynamic get from; @override @JsonKey(name: "last_page") int get lastPage; @@ -526,7 +534,7 @@ abstract class _Meta implements Meta { int get perPage; @override @JsonKey(name: "to") - int get to; + dynamic get to; @override @JsonKey(name: "total") int get total; diff --git a/lib/core/models/base_models.g.dart b/lib/core/models/base_models.g.dart index 5eec9fa3..3c061e32 100644 --- a/lib/core/models/base_models.g.dart +++ b/lib/core/models/base_models.g.dart @@ -23,14 +23,14 @@ Map _$$LinksImplToJson(_$LinksImpl instance) => _$MetaImpl _$$MetaImplFromJson(Map json) => _$MetaImpl( currentPage: (json['current_page'] as num).toInt(), - from: (json['from'] as num).toInt(), + from: json['from'], lastPage: (json['last_page'] as num).toInt(), links: (json['links'] as List) .map((e) => Link.fromJson(e as Map)) .toList(), path: json['path'] as String, perPage: (json['per_page'] as num).toInt(), - to: (json['to'] as num).toInt(), + to: json['to'], total: (json['total'] as num).toInt(), ); 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 d8fc116e..cbd8f03c 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 @@ -2,14 +2,13 @@ import 'dart:async'; import 'dart:io'; import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart'; +import 'package:eatvio_app/old/feed/blog_post_create_screen/models/blog_post_create_model.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; import 'package:image_picker/image_picker.dart'; -import '../../../../presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart'; -import '../../../../presentation/feed/blog_post_create_screen/models/blog_post_create_model.dart'; - class BlogPostCreateScreen extends StatefulWidget { const BlogPostCreateScreen({Key? key}) : super(key: key); diff --git a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart index 356d3cc7..a4bd7924 100644 --- a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart +++ b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart @@ -190,9 +190,9 @@ class _BottomNavigationBarWidgetState extends State { label: '', icon: BlocBuilder( builder: (BuildContext context, ProfileAvatarState state) { - if (state is ProfileAvatarStateLoaded && state.profile.user.profilePhotoUrl.isNotEmpty) { + if (state is ProfileAvatarStateLoaded && state.profile.user.profilePhotoUrl != null) { return CircleAvatar( - backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl), + backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl!), radius: 16, ); } diff --git a/lib/features/feed/presentation/widgets/blog_post_widget.dart b/lib/features/feed/presentation/widgets/blog_post_widget.dart index 8753bb64..e262e067 100644 --- a/lib/features/feed/presentation/widgets/blog_post_widget.dart +++ b/lib/features/feed/presentation/widgets/blog_post_widget.dart @@ -6,6 +6,7 @@ import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:go_router/go_router.dart'; import 'package:share_plus/share_plus.dart'; @@ -62,8 +63,24 @@ class _BlogPostWidgetState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(widget.feedBlogPostModel.author.authorName), - Text(calculateDifference(widget.feedBlogPostModel.createdAt)), + Text( + widget.feedBlogPostModel.author.authorName, + style: TextStyle( + height: 1, + color: Colors.black87, + fontWeight: FontWeight.w500, + ), + ), + const SizedBox(height: 4), + Text( + calculateDifference( + widget.feedBlogPostModel.createdAt, + ), + style: TextStyle( + height: 1, + color: Colors.black45, + ), + ), ], ), ], @@ -81,12 +98,18 @@ class _BlogPostWidgetState extends State { ), ), if (widget.feedBlogPostModel.title.isNotEmpty && widget.feedBlogPostModel.description.isNotEmpty) SizedBox(height: 8), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 12), - child: Html( - data: widget.feedBlogPostModel.description, + if (widget.feedBlogPostModel.description.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Html( + data: widget.feedBlogPostModel.description, + style: { + "*": Style( + color: Colors.black87, + ), + }, + ), ), - ), if (widget.feedBlogPostModel.title.isNotEmpty || widget.feedBlogPostModel.description.isNotEmpty) SizedBox(height: 8), GestureDetector( onTap: () { @@ -112,7 +135,7 @@ class _BlogPostWidgetState extends State { child: Row( children: [ _iconButton( - icon: Icons.favorite_border_rounded, + icon: isLiked ? Icons.favorite_rounded : Icons.favorite_border_rounded, text: totalLikes.toString(), iconColor: isLiked ? Colors.red.withOpacity(0.8) : null, backgroundColor: isLiked ? Colors.red.withOpacity(0.1) : null, @@ -130,7 +153,15 @@ class _BlogPostWidgetState extends State { ), SizedBox(width: 8), _iconButton( - icon: Icons.mode_comment_outlined, + svgIcon: SvgPicture.asset( + 'assets/icons/comment.svg', + height: 20, + width: 20, + colorFilter: ColorFilter.mode( + appTheme.gray600, + BlendMode.srcIn, + ), + ), text: widget.feedBlogPostModel.totalComments.toString(), onTap: () => GoRouter.of(context).pushNamed( 'blogPostScreen', @@ -139,7 +170,12 @@ class _BlogPostWidgetState extends State { ), SizedBox(width: 8), _iconButton( - icon: Icons.reply_rounded, + svgIcon: SvgPicture.asset( + height: 20, + width: 20, + 'assets/icons/share.svg', + colorFilter: ColorFilter.mode(appTheme.gray600, BlendMode.srcIn), + ), onTap: () => Share.shareUri( Uri.parse( baseUrl + '/ru/blog_post/' + widget.feedBlogPostModel.id.toString(), @@ -171,7 +207,7 @@ class _BlogPostWidgetState extends State { ); } - _iconButton({required IconData icon, String? text, Function()? onTap, Color? iconColor, Color? backgroundColor, Color? textColor}) { + _iconButton({IconData? icon, SvgPicture? svgIcon, String? text, Function()? onTap, Color? iconColor, Color? backgroundColor, Color? textColor}) { return InkWell( onTap: onTap ?? () {}, borderRadius: BorderRadius.circular(16), @@ -185,11 +221,13 @@ class _BlogPostWidgetState extends State { child: Row( mainAxisSize: MainAxisSize.min, children: [ - Icon( - icon, - size: 20, - color: iconColor ?? appTheme.gray600, - ), + if (svgIcon != null) svgIcon, + if (icon != null) + Icon( + icon, + size: 20, + color: iconColor ?? appTheme.gray600, + ), if (text != null) SizedBox(width: 8), if (text != null) Text( diff --git a/lib/features/profile/models/profile_model.dart b/lib/features/profile/models/profile_model.dart index 6aa5fc1a..b6e47d6a 100644 --- a/lib/features/profile/models/profile_model.dart +++ b/lib/features/profile/models/profile_model.dart @@ -41,17 +41,17 @@ class User with _$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: "email_verified_at") required dynamic 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: "profile_photo_path") 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: "profile_photo_url") String? profilePhotoUrl, @JsonKey(name: "detailz") required UserDetails detailz, }) = _User; diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index ed199108..da499a03 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -776,13 +776,13 @@ mixin _$User { @JsonKey(name: "email") String get email => throw _privateConstructorUsedError; @JsonKey(name: "email_verified_at") - DateTime get emailVerifiedAt => throw _privateConstructorUsedError; + dynamic 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; + String? get profilePhotoPath => throw _privateConstructorUsedError; @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; @JsonKey(name: "updated_at") @@ -796,7 +796,7 @@ mixin _$User { @JsonKey(name: "user_settings_id") dynamic get userSettingsId => throw _privateConstructorUsedError; @JsonKey(name: "profile_photo_url") - String get profilePhotoUrl => throw _privateConstructorUsedError; + String? get profilePhotoUrl => throw _privateConstructorUsedError; @JsonKey(name: "detailz") UserDetails get detailz => throw _privateConstructorUsedError; @@ -814,17 +814,17 @@ abstract class $UserCopyWith<$Res> { {@JsonKey(name: "id") int id, @JsonKey(name: "name") String name, @JsonKey(name: "email") String email, - @JsonKey(name: "email_verified_at") DateTime emailVerifiedAt, + @JsonKey(name: "email_verified_at") dynamic 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: "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: "profile_photo_url") String? profilePhotoUrl, @JsonKey(name: "detailz") UserDetails detailz}); $UserDetailsCopyWith<$Res> get detailz; @@ -846,17 +846,17 @@ class _$UserCopyWithImpl<$Res, $Val extends User> Object? id = null, Object? name = null, Object? email = null, - Object? emailVerifiedAt = null, + Object? emailVerifiedAt = freezed, Object? twoFactorConfirmedAt = freezed, Object? currentTeamId = freezed, - Object? profilePhotoPath = null, + Object? profilePhotoPath = freezed, Object? createdAt = null, Object? updatedAt = null, Object? isConsultant = null, Object? isPublicProfile = null, Object? slug = null, Object? userSettingsId = freezed, - Object? profilePhotoUrl = null, + Object? profilePhotoUrl = freezed, Object? detailz = null, }) { return _then(_value.copyWith( @@ -872,10 +872,10 @@ class _$UserCopyWithImpl<$Res, $Val extends User> ? _value.email : email // ignore: cast_nullable_to_non_nullable as String, - emailVerifiedAt: null == emailVerifiedAt + emailVerifiedAt: freezed == emailVerifiedAt ? _value.emailVerifiedAt : emailVerifiedAt // ignore: cast_nullable_to_non_nullable - as DateTime, + as dynamic, twoFactorConfirmedAt: freezed == twoFactorConfirmedAt ? _value.twoFactorConfirmedAt : twoFactorConfirmedAt // ignore: cast_nullable_to_non_nullable @@ -884,10 +884,10 @@ class _$UserCopyWithImpl<$Res, $Val extends User> ? _value.currentTeamId : currentTeamId // ignore: cast_nullable_to_non_nullable as dynamic, - profilePhotoPath: null == profilePhotoPath + profilePhotoPath: freezed == profilePhotoPath ? _value.profilePhotoPath : profilePhotoPath // ignore: cast_nullable_to_non_nullable - as String, + as String?, createdAt: null == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -912,10 +912,10 @@ class _$UserCopyWithImpl<$Res, $Val extends User> ? _value.userSettingsId : userSettingsId // ignore: cast_nullable_to_non_nullable as dynamic, - profilePhotoUrl: null == profilePhotoUrl + profilePhotoUrl: freezed == profilePhotoUrl ? _value.profilePhotoUrl : profilePhotoUrl // ignore: cast_nullable_to_non_nullable - as String, + as String?, detailz: null == detailz ? _value.detailz : detailz // ignore: cast_nullable_to_non_nullable @@ -943,17 +943,17 @@ abstract class _$$UserImplCopyWith<$Res> implements $UserCopyWith<$Res> { {@JsonKey(name: "id") int id, @JsonKey(name: "name") String name, @JsonKey(name: "email") String email, - @JsonKey(name: "email_verified_at") DateTime emailVerifiedAt, + @JsonKey(name: "email_verified_at") dynamic 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: "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: "profile_photo_url") String? profilePhotoUrl, @JsonKey(name: "detailz") UserDetails detailz}); @override @@ -973,17 +973,17 @@ class __$$UserImplCopyWithImpl<$Res> Object? id = null, Object? name = null, Object? email = null, - Object? emailVerifiedAt = null, + Object? emailVerifiedAt = freezed, Object? twoFactorConfirmedAt = freezed, Object? currentTeamId = freezed, - Object? profilePhotoPath = null, + Object? profilePhotoPath = freezed, Object? createdAt = null, Object? updatedAt = null, Object? isConsultant = null, Object? isPublicProfile = null, Object? slug = null, Object? userSettingsId = freezed, - Object? profilePhotoUrl = null, + Object? profilePhotoUrl = freezed, Object? detailz = null, }) { return _then(_$UserImpl( @@ -999,10 +999,10 @@ class __$$UserImplCopyWithImpl<$Res> ? _value.email : email // ignore: cast_nullable_to_non_nullable as String, - emailVerifiedAt: null == emailVerifiedAt + emailVerifiedAt: freezed == emailVerifiedAt ? _value.emailVerifiedAt : emailVerifiedAt // ignore: cast_nullable_to_non_nullable - as DateTime, + as dynamic, twoFactorConfirmedAt: freezed == twoFactorConfirmedAt ? _value.twoFactorConfirmedAt : twoFactorConfirmedAt // ignore: cast_nullable_to_non_nullable @@ -1011,10 +1011,10 @@ class __$$UserImplCopyWithImpl<$Res> ? _value.currentTeamId : currentTeamId // ignore: cast_nullable_to_non_nullable as dynamic, - profilePhotoPath: null == profilePhotoPath + profilePhotoPath: freezed == profilePhotoPath ? _value.profilePhotoPath : profilePhotoPath // ignore: cast_nullable_to_non_nullable - as String, + as String?, createdAt: null == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -1039,10 +1039,10 @@ class __$$UserImplCopyWithImpl<$Res> ? _value.userSettingsId : userSettingsId // ignore: cast_nullable_to_non_nullable as dynamic, - profilePhotoUrl: null == profilePhotoUrl + profilePhotoUrl: freezed == profilePhotoUrl ? _value.profilePhotoUrl : profilePhotoUrl // ignore: cast_nullable_to_non_nullable - as String, + as String?, detailz: null == detailz ? _value.detailz : detailz // ignore: cast_nullable_to_non_nullable @@ -1062,14 +1062,14 @@ class _$UserImpl implements _User { @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: "profile_photo_path") 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: "profile_photo_url") this.profilePhotoUrl, @JsonKey(name: "detailz") required this.detailz}); factory _$UserImpl.fromJson(Map json) => @@ -1086,7 +1086,7 @@ class _$UserImpl implements _User { final String email; @override @JsonKey(name: "email_verified_at") - final DateTime emailVerifiedAt; + final dynamic emailVerifiedAt; @override @JsonKey(name: "two_factor_confirmed_at") final dynamic twoFactorConfirmedAt; @@ -1095,7 +1095,7 @@ class _$UserImpl implements _User { final dynamic currentTeamId; @override @JsonKey(name: "profile_photo_path") - final String profilePhotoPath; + final String? profilePhotoPath; @override @JsonKey(name: "created_at") final DateTime createdAt; @@ -1116,7 +1116,7 @@ class _$UserImpl implements _User { final dynamic userSettingsId; @override @JsonKey(name: "profile_photo_url") - final String profilePhotoUrl; + final String? profilePhotoUrl; @override @JsonKey(name: "detailz") final UserDetails detailz; @@ -1134,8 +1134,8 @@ class _$UserImpl implements _User { (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.emailVerifiedAt, emailVerifiedAt) && const DeepCollectionEquality() .equals(other.twoFactorConfirmedAt, twoFactorConfirmedAt) && const DeepCollectionEquality() @@ -1165,7 +1165,7 @@ class _$UserImpl implements _User { id, name, email, - emailVerifiedAt, + const DeepCollectionEquality().hash(emailVerifiedAt), const DeepCollectionEquality().hash(twoFactorConfirmedAt), const DeepCollectionEquality().hash(currentTeamId), profilePhotoPath, @@ -1198,19 +1198,18 @@ abstract class _User implements User { @JsonKey(name: "name") required final String name, @JsonKey(name: "email") required final String email, @JsonKey(name: "email_verified_at") - required final DateTime emailVerifiedAt, + required final dynamic 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: "profile_photo_path") 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: "profile_photo_url") final String? profilePhotoUrl, @JsonKey(name: "detailz") required final UserDetails detailz}) = _$UserImpl; @@ -1227,7 +1226,7 @@ abstract class _User implements User { String get email; @override @JsonKey(name: "email_verified_at") - DateTime get emailVerifiedAt; + dynamic get emailVerifiedAt; @override @JsonKey(name: "two_factor_confirmed_at") dynamic get twoFactorConfirmedAt; @@ -1236,7 +1235,7 @@ abstract class _User implements User { dynamic get currentTeamId; @override @JsonKey(name: "profile_photo_path") - String get profilePhotoPath; + String? get profilePhotoPath; @override @JsonKey(name: "created_at") DateTime get createdAt; @@ -1257,7 +1256,7 @@ abstract class _User implements User { dynamic get userSettingsId; @override @JsonKey(name: "profile_photo_url") - String get profilePhotoUrl; + String? get profilePhotoUrl; @override @JsonKey(name: "detailz") UserDetails get detailz; diff --git a/lib/features/profile/models/profile_model.g.dart b/lib/features/profile/models/profile_model.g.dart index 42ee3d8c..f0d74ea0 100644 --- a/lib/features/profile/models/profile_model.g.dart +++ b/lib/features/profile/models/profile_model.g.dart @@ -65,17 +65,17 @@ _$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), + emailVerifiedAt: json['email_verified_at'], twoFactorConfirmedAt: json['two_factor_confirmed_at'], currentTeamId: json['current_team_id'], - profilePhotoPath: json['profile_photo_path'] as String, + 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, + profilePhotoUrl: json['profile_photo_url'] as String?, detailz: UserDetails.fromJson(json['detailz'] as Map), ); @@ -84,7 +84,7 @@ Map _$$UserImplToJson(_$UserImpl instance) => 'id': instance.id, 'name': instance.name, 'email': instance.email, - 'email_verified_at': instance.emailVerifiedAt.toIso8601String(), + 'email_verified_at': instance.emailVerifiedAt, 'two_factor_confirmed_at': instance.twoFactorConfirmedAt, 'current_team_id': instance.currentTeamId, 'profile_photo_path': instance.profilePhotoPath, diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index de0336fc..f044b17d 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -9,6 +9,7 @@ import 'package:eatvio_app/features/profile/presentation/widgets/imt_chart_widge import 'package:eatvio_app/features/profile/presentation/widgets/weight_chart_widget.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; class ProfileScreen extends StatefulWidget { final Author? author; @@ -62,35 +63,125 @@ class _ProfileScreenState extends State { padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16), child: Row( children: [ - CircleAvatar( - radius: 32, - backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl), - ), + state.profile.user.profilePhotoUrl != null + ? CircleAvatar( + radius: 32, + backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl!), + ) + : CircleAvatar( + radius: 32, + ), const SizedBox(width: 12), - Column( - crossAxisAlignment: CrossAxisAlignment.start, + Text( + state.profile.user.name, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.w500, + height: 1, + ), + ), + const Spacer(), + Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( - state.profile.user.name, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.w500, - height: 1, + Container( + child: SvgPicture.asset( + height: 28, + width: 28, + 'assets/icons/subscribers.svg', + colorFilter: ColorFilter.mode(appTheme.blueA400, BlendMode.srcIn), ), ), - if (state.profile.userDetails.additionalInfo.isNotEmpty) - Text( - state.profile.userDetails.additionalInfo, - style: TextStyle( - color: Colors.black.withOpacity(0.4), - height: 1, + SizedBox(width: 8), + Column( + children: [ + Text( + '123', + style: TextStyle( + height: 1, + fontSize: 18, + fontWeight: FontWeight.w500, + color: Colors.black87, + ), ), - ), + Text( + 'Подписчика', + style: TextStyle( + height: 1, + fontSize: 12, + fontWeight: FontWeight.w400, + color: Colors.black38, + ), + ), + ], + ), ], ), + Container( + padding: EdgeInsets.only(left: 16), + child: SvgPicture.asset( + height: 24, + width: 24, + 'assets/icons/share.svg', + colorFilter: ColorFilter.mode(appTheme.blueA400, BlendMode.srcIn), + ), + ), ], ), ), + if (state.profile.userDetails.additionalInfo.isNotEmpty) + Container( + alignment: Alignment.centerLeft, + padding: const EdgeInsets.all(16), + child: Text( + state.profile.userDetails.additionalInfo, + style: TextStyle( + color: Colors.black.withOpacity(0.4), + height: 1, + ), + ), + ), + if (widget.author != null) const SizedBox(height: 8), + if (widget.author != null) + Row( + children: [ + SizedBox(width: 16), + Container( + alignment: Alignment.center, + padding: EdgeInsets.all(8), + width: (MediaQuery.of(context).size.width - 40) / 2, + decoration: BoxDecoration( + color: appTheme.blueA400.withOpacity(0.1), + borderRadius: BorderRadius.circular(16), + ), + child: Text( + 'Сообщение', + style: TextStyle( + color: appTheme.blueA400, + ), + ), + ), + SizedBox(width: 8), + Container( + alignment: Alignment.center, + padding: EdgeInsets.all(8), + width: (MediaQuery.of(context).size.width - 40) / 2, + decoration: BoxDecoration( + color: appTheme.blueA400, + borderRadius: BorderRadius.circular(16), + ), + child: Text( + 'Подписаться', + style: TextStyle( + color: Colors.white, + ), + ), + ), + SizedBox(width: 16), + ], + ), + if (widget.author != null) SizedBox(height: 16), if (widget.author == null) _divider(context), if (widget.author == null) Column( diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index 650c0990..bbf76a4e 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -32,70 +32,104 @@ class _CircumferenceChartWidgetState extends State { Widget build(BuildContext context) { return Column( children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: Row( - children: [ - Text( - '${widget.chartData.last.chestCircumference}', - style: TextStyle( - color: Colors.black, - fontSize: 40, - fontWeight: FontWeight.w500, + if (widget.chartData.isNotEmpty) + Padding( + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Text( + '${widget.chartData.last.chestCircumference}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), ), - ), - widget.chartData.last.chestCircumference > widget.chartData[widget.chartData.length - 2].chestCircumference - ? Icon( - Icons.arrow_drop_up, - size: 40, - color: Colors.grey, - ) - : Icon( - Icons.arrow_drop_down, - size: 40, - color: Colors.grey, + if (widget.chartData.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, ), - Text( - '${widget.chartData.last.waistCircumference}', - style: TextStyle( - color: Colors.black, - fontSize: 40, - fontWeight: FontWeight.w500, + ), + if (widget.chartData.length > 1) + widget.chartData.last.chestCircumference > widget.chartData[widget.chartData.length - 2].chestCircumference + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey, + ), + Text( + '${widget.chartData.last.waistCircumference}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), ), - ), - widget.chartData.last.waistCircumference > widget.chartData[widget.chartData.length - 2].waistCircumference - ? Icon( - Icons.arrow_drop_up, - size: 40, - color: Colors.grey, - ) - : Icon( - Icons.arrow_drop_down, - size: 40, - color: Colors.grey, + if (widget.chartData.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, ), - Text( - '${widget.chartData.last.hipCircumference}', - style: TextStyle( - color: Colors.black, - fontSize: 40, - fontWeight: FontWeight.w500, + ), + if (widget.chartData.length > 1) + widget.chartData.last.waistCircumference > widget.chartData[widget.chartData.length - 2].waistCircumference + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey, + ), + Text( + '${widget.chartData.last.hipCircumference}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), ), - ), - widget.chartData.last.hipCircumference > widget.chartData[widget.chartData.length - 2].hipCircumference - ? Icon( - Icons.arrow_drop_up, - size: 40, - color: Colors.grey, - ) - : Icon( - Icons.arrow_drop_down, - size: 40, - color: Colors.grey, + if (widget.chartData.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, ), - ], + ), + if (widget.chartData.length > 1) + widget.chartData.last.hipCircumference > widget.chartData[widget.chartData.length - 2].hipCircumference + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey, + ), + ], + ), ), - ), Stack( alignment: Alignment.bottomRight, children: [ @@ -140,12 +174,18 @@ class _CircumferenceChartWidgetState extends State { FloatingActionButton.small( heroTag: 'addCircumference', onPressed: () { - chest = widget.chartData.last.chestCircumference; - waist = widget.chartData.last.waistCircumference; - hip = widget.chartData.last.hipCircumference; - chestController = FixedExtentScrollController(initialItem: chest - 20); - waistController = FixedExtentScrollController(initialItem: waist - 20); - hipController = FixedExtentScrollController(initialItem: hip - 20); + if (widget.chartData.isNotEmpty) { + chest = widget.chartData.last.chestCircumference; + waist = widget.chartData.last.waistCircumference; + hip = widget.chartData.last.hipCircumference; + chestController = FixedExtentScrollController(initialItem: chest - 20); + waistController = FixedExtentScrollController(initialItem: waist - 20); + hipController = FixedExtentScrollController(initialItem: hip - 20); + } else { + chestController = FixedExtentScrollController(); + waistController = FixedExtentScrollController(); + hipController = FixedExtentScrollController(); + } showModalBottomSheet( useRootNavigator: true, context: context, diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index ce3222c8..a2d68a58 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -31,83 +31,97 @@ class _WeightChartWidgetState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: Row( - children: [ - Text( - '${widget.chartPoints.last.weight.toStringAsFixed(1)} кг', - style: TextStyle( - color: Colors.black, - fontSize: 40, - fontWeight: FontWeight.w500, + if (widget.chartPoints.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Text( + '${widget.chartPoints.last.weight.toStringAsFixed(1)} кг', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), ), - ), - widget.chartPoints.last.weight > widget.chartPoints[widget.chartPoints.length - 2].weight - ? Icon( - Icons.arrow_drop_up, - size: 40, - color: Colors.grey.withOpacity(0.4), - ) - : Icon( - Icons.arrow_drop_down, - size: 40, - color: Colors.grey.withOpacity(0.4), + if (widget.chartPoints.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, ), - ], + ), + if (widget.chartPoints.length > 1) widget.chartPoints.last.weight > widget.chartPoints[widget.chartPoints.length - 2].weight + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey.withOpacity(0.4), + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey.withOpacity(0.4), + ), + ], + ), ), - ), Stack( alignment: Alignment.bottomRight, children: [ - SfCartesianChart( - margin: EdgeInsets.symmetric(horizontal: 8), - enableAxisAnimation: true, - plotAreaBorderWidth: 0, - trackballBehavior: TrackballBehavior( - enable: true, - activationMode: ActivationMode.singleTap, - tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, - tooltipSettings: InteractiveTooltip(), - lineType: TrackballLineType.vertical, + SfCartesianChart( + margin: EdgeInsets.symmetric(horizontal: 8), + enableAxisAnimation: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, + ), + primaryXAxis: DateTimeCategoryAxis( + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, + dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + axisLine: AxisLine( + color: Colors.grey.withOpacity(0.3), + width: 0.4, + ), + ), + primaryYAxis: NumericAxis( + isVisible: false, + labelFormat: '{value} кг', + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), ), - primaryXAxis: DateTimeCategoryAxis( - initialVisibleMinimum: widget.chartPoints.first.createdAt, - initialVisibleMaximum: widget.chartPoints.last.createdAt, - tickPosition: TickPosition.inside, - majorTickLines: MajorTickLines( - size: 0, - ), - edgeLabelPlacement: EdgeLabelPlacement.shift, - dateFormat: DateFormat.MMMd('ru'), - labelStyle: TextStyle( - color: Colors.grey, - ), - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), - axisLine: AxisLine( - color: Colors.grey.withOpacity(0.3), - width: 0.4, - ), - ), - primaryYAxis: NumericAxis( - isVisible: false, - labelFormat: '{value} кг', - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), - axisLine: AxisLine( - width: 1, - ), - majorTickLines: MajorTickLines(size: 0), - ), - series: _getSplineSeries(), - tooltipBehavior: TooltipBehavior(enable: true), - ), FloatingActionButton.small( heroTag: 'addWeight', onPressed: () { - weightKilo = int.parse(widget.chartPoints.last.weight.toString().split('.')[0]); - weightGrams = int.parse(widget.chartPoints.last.weight.toString().split('.')[1][0]); - weightKiloController = FixedExtentScrollController(initialItem: weightKilo - 20); - weightGramsController = FixedExtentScrollController(initialItem: weightGrams); + if (widget.chartPoints.isNotEmpty) { + weightKilo = int.parse(widget.chartPoints.last.weight.toString().split('.')[0]); + weightGrams = int.parse(widget.chartPoints.last.weight.toString().split('.')[1][0]); + weightKiloController = FixedExtentScrollController(initialItem: weightKilo - 20); + weightGramsController = FixedExtentScrollController(initialItem: weightGrams); + } else { + weightKiloController = FixedExtentScrollController(); + weightGramsController = FixedExtentScrollController(); + } showModalBottomSheet( useRootNavigator: true, context: context, diff --git a/lib/main.dart b/lib/main.dart index 948cdf34..355eb3ce 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -12,8 +12,8 @@ import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_cubit.dart'; import 'package:eatvio_app/locator_service.dart' as di; import 'package:eatvio_app/locator_service.dart'; -import 'package:eatvio_app/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart'; -import 'package:eatvio_app/presentation/profile/my_profile_screen/models/my_profile_model.dart'; +import 'package:eatvio_app/old/profile/my_profile_screen/bloc/my_profile_bloc.dart'; +import 'package:eatvio_app/old/profile/my_profile_screen/models/my_profile_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; diff --git a/lib/presentation/auth/auth_screen/auth_screen.dart b/lib/old/auth/auth_screen/auth_screen.dart similarity index 100% rename from lib/presentation/auth/auth_screen/auth_screen.dart rename to lib/old/auth/auth_screen/auth_screen.dart diff --git a/lib/presentation/auth/auth_screen/bloc/auth_bloc.dart b/lib/old/auth/auth_screen/bloc/auth_bloc.dart similarity index 88% rename from lib/presentation/auth/auth_screen/bloc/auth_bloc.dart rename to lib/old/auth/auth_screen/bloc/auth_bloc.dart index 0d8f67ad..cc7fb9d4 100644 --- a/lib/presentation/auth/auth_screen/bloc/auth_bloc.dart +++ b/lib/old/auth/auth_screen/bloc/auth_bloc.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/presentation/auth/auth_screen/models/auth_model.dart'; +import 'package:eatvio_app/old/auth/auth_screen/models/auth_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; diff --git a/lib/presentation/auth/auth_screen/bloc/auth_event.dart b/lib/old/auth/auth_screen/bloc/auth_event.dart similarity index 100% rename from lib/presentation/auth/auth_screen/bloc/auth_event.dart rename to lib/old/auth/auth_screen/bloc/auth_event.dart diff --git a/lib/presentation/auth/auth_screen/bloc/auth_state.dart b/lib/old/auth/auth_screen/bloc/auth_state.dart similarity index 100% rename from lib/presentation/auth/auth_screen/bloc/auth_state.dart rename to lib/old/auth/auth_screen/bloc/auth_state.dart diff --git a/lib/presentation/auth/auth_screen/models/auth_model.dart b/lib/old/auth/auth_screen/models/auth_model.dart similarity index 100% rename from lib/presentation/auth/auth_screen/models/auth_model.dart rename to lib/old/auth/auth_screen/models/auth_model.dart diff --git a/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_state.dart b/lib/old/diary/diary_edit_screen/bloc/diary_edit_state.dart similarity index 100% rename from lib/presentation/diary/diary_edit_screen/bloc/diary_edit_state.dart rename to lib/old/diary/diary_edit_screen/bloc/diary_edit_state.dart diff --git a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart b/lib/old/diary/diary_edit_screen/diary_edit_screen.dart similarity index 100% rename from lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart rename to lib/old/diary/diary_edit_screen/diary_edit_screen.dart diff --git a/lib/presentation/diary/diary_edit_screen/models/diary_edit_model.dart b/lib/old/diary/diary_edit_screen/models/diary_edit_model.dart similarity index 100% rename from lib/presentation/diary/diary_edit_screen/models/diary_edit_model.dart rename to lib/old/diary/diary_edit_screen/models/diary_edit_model.dart diff --git a/lib/presentation/diets/diet_create_screen/bloc/diet_create_bloc.dart b/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart similarity index 99% rename from lib/presentation/diets/diet_create_screen/bloc/diet_create_bloc.dart rename to lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart index db2f02a9..6f14062d 100644 --- a/lib/presentation/diets/diet_create_screen/bloc/diet_create_bloc.dart +++ b/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/diets/diet_create_screen/models/diet_create_model.dart'; +import 'package:eatvio_app/old/diets/diet_create_screen/models/diet_create_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/diets/diet_create_screen/bloc/diet_create_event.dart b/lib/old/diets/diet_create_screen/bloc/diet_create_event.dart similarity index 100% rename from lib/presentation/diets/diet_create_screen/bloc/diet_create_event.dart rename to lib/old/diets/diet_create_screen/bloc/diet_create_event.dart diff --git a/lib/presentation/diets/diet_create_screen/bloc/diet_create_state.dart b/lib/old/diets/diet_create_screen/bloc/diet_create_state.dart similarity index 100% rename from lib/presentation/diets/diet_create_screen/bloc/diet_create_state.dart rename to lib/old/diets/diet_create_screen/bloc/diet_create_state.dart diff --git a/lib/presentation/diets/diet_create_screen/diet_create_screen.dart b/lib/old/diets/diet_create_screen/diet_create_screen.dart similarity index 100% rename from lib/presentation/diets/diet_create_screen/diet_create_screen.dart rename to lib/old/diets/diet_create_screen/diet_create_screen.dart diff --git a/lib/presentation/diets/diet_create_screen/models/diet_create_model.dart b/lib/old/diets/diet_create_screen/models/diet_create_model.dart similarity index 100% rename from lib/presentation/diets/diet_create_screen/models/diet_create_model.dart rename to lib/old/diets/diet_create_screen/models/diet_create_model.dart diff --git a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_bloc.dart b/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart similarity index 97% rename from lib/presentation/diets/diet_edit_screen/bloc/diet_edit_bloc.dart rename to lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart index 5f92e25b..4635fc11 100644 --- a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_bloc.dart +++ b/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/diets/diet_edit_screen/models/diet_edit_model.dart'; +import 'package:eatvio_app/old/diets/diet_edit_screen/models/diet_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_event.dart b/lib/old/diets/diet_edit_screen/bloc/diet_edit_event.dart similarity index 100% rename from lib/presentation/diets/diet_edit_screen/bloc/diet_edit_event.dart rename to lib/old/diets/diet_edit_screen/bloc/diet_edit_event.dart diff --git a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_state.dart b/lib/old/diets/diet_edit_screen/bloc/diet_edit_state.dart similarity index 100% rename from lib/presentation/diets/diet_edit_screen/bloc/diet_edit_state.dart rename to lib/old/diets/diet_edit_screen/bloc/diet_edit_state.dart diff --git a/lib/presentation/diets/diet_edit_screen/diet_edit_screen.dart b/lib/old/diets/diet_edit_screen/diet_edit_screen.dart similarity index 100% rename from lib/presentation/diets/diet_edit_screen/diet_edit_screen.dart rename to lib/old/diets/diet_edit_screen/diet_edit_screen.dart diff --git a/lib/presentation/diets/diet_edit_screen/models/diet_edit_model.dart b/lib/old/diets/diet_edit_screen/models/diet_edit_model.dart similarity index 100% rename from lib/presentation/diets/diet_edit_screen/models/diet_edit_model.dart rename to lib/old/diets/diet_edit_screen/models/diet_edit_model.dart diff --git a/lib/presentation/diets/diet_select_screen/bloc/diet_select_bloc.dart b/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart similarity index 93% rename from lib/presentation/diets/diet_select_screen/bloc/diet_select_bloc.dart rename to lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart index 6910f250..26622a74 100644 --- a/lib/presentation/diets/diet_select_screen/bloc/diet_select_bloc.dart +++ b/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart @@ -1,10 +1,10 @@ -//import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart'; +//import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/diets/diet_select_screen/models/diet_select_model.dart'; +import 'package:eatvio_app/old/diets/diet_select_screen/models/diet_select_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/diets/diet_select_screen/bloc/diet_select_event.dart b/lib/old/diets/diet_select_screen/bloc/diet_select_event.dart similarity index 100% rename from lib/presentation/diets/diet_select_screen/bloc/diet_select_event.dart rename to lib/old/diets/diet_select_screen/bloc/diet_select_event.dart diff --git a/lib/presentation/diets/diet_select_screen/bloc/diet_select_state.dart b/lib/old/diets/diet_select_screen/bloc/diet_select_state.dart similarity index 100% rename from lib/presentation/diets/diet_select_screen/bloc/diet_select_state.dart rename to lib/old/diets/diet_select_screen/bloc/diet_select_state.dart diff --git a/lib/presentation/diets/diet_select_screen/diet_select_screen.dart b/lib/old/diets/diet_select_screen/diet_select_screen.dart similarity index 100% rename from lib/presentation/diets/diet_select_screen/diet_select_screen.dart rename to lib/old/diets/diet_select_screen/diet_select_screen.dart diff --git a/lib/presentation/diets/diet_select_screen/models/diet_select_model.dart b/lib/old/diets/diet_select_screen/models/diet_select_model.dart similarity index 100% rename from lib/presentation/diets/diet_select_screen/models/diet_select_model.dart rename to lib/old/diets/diet_select_screen/models/diet_select_model.dart diff --git a/lib/presentation/diets/diet_show_screen/bloc/diet_show_bloc.dart b/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart similarity index 97% rename from lib/presentation/diets/diet_show_screen/bloc/diet_show_bloc.dart rename to lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart index b680d054..008e566a 100644 --- a/lib/presentation/diets/diet_show_screen/bloc/diet_show_bloc.dart +++ b/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/diets/diet_show_screen/models/diet_show_model.dart'; +import 'package:eatvio_app/old/diets/diet_show_screen/models/diet_show_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/diets/diet_show_screen/bloc/diet_show_event.dart b/lib/old/diets/diet_show_screen/bloc/diet_show_event.dart similarity index 100% rename from lib/presentation/diets/diet_show_screen/bloc/diet_show_event.dart rename to lib/old/diets/diet_show_screen/bloc/diet_show_event.dart diff --git a/lib/presentation/diets/diet_show_screen/bloc/diet_show_state.dart b/lib/old/diets/diet_show_screen/bloc/diet_show_state.dart similarity index 100% rename from lib/presentation/diets/diet_show_screen/bloc/diet_show_state.dart rename to lib/old/diets/diet_show_screen/bloc/diet_show_state.dart diff --git a/lib/presentation/diets/diet_show_screen/diet_show_screen.dart b/lib/old/diets/diet_show_screen/diet_show_screen.dart similarity index 100% rename from lib/presentation/diets/diet_show_screen/diet_show_screen.dart rename to lib/old/diets/diet_show_screen/diet_show_screen.dart diff --git a/lib/presentation/diets/diet_show_screen/models/diet_show_model.dart b/lib/old/diets/diet_show_screen/models/diet_show_model.dart similarity index 100% rename from lib/presentation/diets/diet_show_screen/models/diet_show_model.dart rename to lib/old/diets/diet_show_screen/models/diet_show_model.dart diff --git a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart b/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart similarity index 96% rename from lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart rename to lib/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart index 0cfd4cc4..5133d85b 100644 --- a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart +++ b/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart @@ -4,7 +4,7 @@ import 'package:dio/dio.dart'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/locator_service.dart'; -import 'package:eatvio_app/presentation/feed/blog_post_create_screen/models/blog_post_create_model.dart'; +import 'package:eatvio_app/old/feed/blog_post_create_screen/models/blog_post_create_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_event.dart b/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_event.dart similarity index 100% rename from lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_event.dart rename to lib/old/feed/blog_post_create_screen/bloc/blog_post_create_event.dart diff --git a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_state.dart b/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_state.dart similarity index 100% rename from lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_state.dart rename to lib/old/feed/blog_post_create_screen/bloc/blog_post_create_state.dart diff --git a/lib/presentation/feed/blog_post_create_screen/models/blog_post_create_model.dart b/lib/old/feed/blog_post_create_screen/models/blog_post_create_model.dart similarity index 100% rename from lib/presentation/feed/blog_post_create_screen/models/blog_post_create_model.dart rename to lib/old/feed/blog_post_create_screen/models/blog_post_create_model.dart diff --git a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart b/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart similarity index 97% rename from lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart rename to lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart index 813a66d0..fd369ec2 100644 --- a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart +++ b/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/feed/blog_post_edit_screen/models/blog_post_edit_model.dart'; +import 'package:eatvio_app/old/feed/blog_post_edit_screen/models/blog_post_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_event.dart b/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_event.dart similarity index 100% rename from lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_event.dart rename to lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_event.dart diff --git a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart b/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart similarity index 100% rename from lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart rename to lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart diff --git a/lib/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart b/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart similarity index 100% rename from lib/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart rename to lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart diff --git a/lib/presentation/feed/blog_post_edit_screen/models/blog_post_edit_model.dart b/lib/old/feed/blog_post_edit_screen/models/blog_post_edit_model.dart similarity index 100% rename from lib/presentation/feed/blog_post_edit_screen/models/blog_post_edit_model.dart rename to lib/old/feed/blog_post_edit_screen/models/blog_post_edit_model.dart diff --git a/lib/presentation/feed/blog_post_screen/models/blog_post_model.dart b/lib/old/feed/blog_post_screen/models/blog_post_model.dart similarity index 85% rename from lib/presentation/feed/blog_post_screen/models/blog_post_model.dart rename to lib/old/feed/blog_post_screen/models/blog_post_model.dart index 106b3b59..1230d998 100644 --- a/lib/presentation/feed/blog_post_screen/models/blog_post_model.dart +++ b/lib/old/feed/blog_post_screen/models/blog_post_model.dart @@ -1,6 +1,6 @@ // ignore_for_file: must_be_immutable -import 'package:eatvio_app/presentation/feed/blog_post_screen/models/comment_model.dart'; +import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; import 'package:equatable/equatable.dart'; class BlogPostModel extends Equatable { diff --git a/lib/presentation/feed/blog_post_screen/models/comment_model.dart b/lib/old/feed/blog_post_screen/models/comment_model.dart similarity index 100% rename from lib/presentation/feed/blog_post_screen/models/comment_model.dart rename to lib/old/feed/blog_post_screen/models/comment_model.dart diff --git a/lib/presentation/feed/blog_post_screen/widgets/comment_widget.dart b/lib/old/feed/blog_post_screen/widgets/comment_widget.dart similarity index 97% rename from lib/presentation/feed/blog_post_screen/widgets/comment_widget.dart rename to lib/old/feed/blog_post_screen/widgets/comment_widget.dart index ed2e075c..421c2c71 100644 --- a/lib/presentation/feed/blog_post_screen/widgets/comment_widget.dart +++ b/lib/old/feed/blog_post_screen/widgets/comment_widget.dart @@ -2,7 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/presentation/feed/blog_post_screen/models/comment_model.dart'; +import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; import 'package:flutter/material.dart'; class CommentWidget extends StatelessWidget { diff --git a/lib/presentation/feed/feed_screen/widgets/feed_scroll_item.dart b/lib/old/feed/feed_screen/widgets/feed_scroll_item.dart similarity index 100% rename from lib/presentation/feed/feed_screen/widgets/feed_scroll_item.dart rename to lib/old/feed/feed_screen/widgets/feed_scroll_item.dart diff --git a/lib/presentation/feed/feed_screen/widgets/feed_search_view.dart b/lib/old/feed/feed_screen/widgets/feed_search_view.dart similarity index 100% rename from lib/presentation/feed/feed_screen/widgets/feed_search_view.dart rename to lib/old/feed/feed_screen/widgets/feed_search_view.dart diff --git a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_bloc.dart b/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart similarity index 97% rename from lib/presentation/glossary/glossary_screen/bloc/glossary_screen_bloc.dart rename to lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart index c45d5569..f642ee1d 100644 --- a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_bloc.dart +++ b/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/glossary/glossary_screen/models/glossary_screen_model.dart'; +import 'package:eatvio_app/old/glossary/glossary_screen/models/glossary_screen_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_event.dart b/lib/old/glossary/glossary_screen/bloc/glossary_screen_event.dart similarity index 100% rename from lib/presentation/glossary/glossary_screen/bloc/glossary_screen_event.dart rename to lib/old/glossary/glossary_screen/bloc/glossary_screen_event.dart diff --git a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_state.dart b/lib/old/glossary/glossary_screen/bloc/glossary_screen_state.dart similarity index 100% rename from lib/presentation/glossary/glossary_screen/bloc/glossary_screen_state.dart rename to lib/old/glossary/glossary_screen/bloc/glossary_screen_state.dart diff --git a/lib/presentation/glossary/glossary_screen/glossary_screen.dart b/lib/old/glossary/glossary_screen/glossary_screen.dart similarity index 98% rename from lib/presentation/glossary/glossary_screen/glossary_screen.dart rename to lib/old/glossary/glossary_screen/glossary_screen.dart index e8453187..0e56aaaa 100644 --- a/lib/presentation/glossary/glossary_screen/glossary_screen.dart +++ b/lib/old/glossary/glossary_screen/glossary_screen.dart @@ -1,7 +1,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/presentation/glossary/glossary_screen/widgets/glossary_scroll_item.dart'; -import 'package:eatvio_app/presentation/glossary/glossary_screen/widgets/glossary_search_widget.dart'; +import 'package:eatvio_app/old/glossary/glossary_screen/widgets/glossary_scroll_item.dart'; +import 'package:eatvio_app/old/glossary/glossary_screen/widgets/glossary_search_widget.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:eatvio_app/widgets/custom_outlined_button.dart'; import 'package:flutter/material.dart'; diff --git a/lib/presentation/glossary/glossary_screen/models/glossary_screen_model.dart b/lib/old/glossary/glossary_screen/models/glossary_screen_model.dart similarity index 100% rename from lib/presentation/glossary/glossary_screen/models/glossary_screen_model.dart rename to lib/old/glossary/glossary_screen/models/glossary_screen_model.dart diff --git a/lib/presentation/glossary/glossary_screen/widgets/glossary_scroll_item.dart b/lib/old/glossary/glossary_screen/widgets/glossary_scroll_item.dart similarity index 100% rename from lib/presentation/glossary/glossary_screen/widgets/glossary_scroll_item.dart rename to lib/old/glossary/glossary_screen/widgets/glossary_scroll_item.dart diff --git a/lib/presentation/glossary/glossary_screen/widgets/glossary_search_widget.dart b/lib/old/glossary/glossary_screen/widgets/glossary_search_widget.dart similarity index 100% rename from lib/presentation/glossary/glossary_screen/widgets/glossary_search_widget.dart rename to lib/old/glossary/glossary_screen/widgets/glossary_search_widget.dart diff --git a/lib/presentation/plans/plan_create_screen/bloc/plan_create_bloc.dart b/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart similarity index 99% rename from lib/presentation/plans/plan_create_screen/bloc/plan_create_bloc.dart rename to lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart index 871c2dc1..09eb839b 100644 --- a/lib/presentation/plans/plan_create_screen/bloc/plan_create_bloc.dart +++ b/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/plans/plan_create_screen/models/plan_create_model.dart'; +import 'package:eatvio_app/old/plans/plan_create_screen/models/plan_create_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/plans/plan_create_screen/bloc/plan_create_event.dart b/lib/old/plans/plan_create_screen/bloc/plan_create_event.dart similarity index 100% rename from lib/presentation/plans/plan_create_screen/bloc/plan_create_event.dart rename to lib/old/plans/plan_create_screen/bloc/plan_create_event.dart diff --git a/lib/presentation/plans/plan_create_screen/bloc/plan_create_state.dart b/lib/old/plans/plan_create_screen/bloc/plan_create_state.dart similarity index 100% rename from lib/presentation/plans/plan_create_screen/bloc/plan_create_state.dart rename to lib/old/plans/plan_create_screen/bloc/plan_create_state.dart diff --git a/lib/presentation/plans/plan_create_screen/models/plan_create_model.dart b/lib/old/plans/plan_create_screen/models/plan_create_model.dart similarity index 100% rename from lib/presentation/plans/plan_create_screen/models/plan_create_model.dart rename to lib/old/plans/plan_create_screen/models/plan_create_model.dart diff --git a/lib/presentation/plans/plan_create_screen/plan_create_screen.dart b/lib/old/plans/plan_create_screen/plan_create_screen.dart similarity index 100% rename from lib/presentation/plans/plan_create_screen/plan_create_screen.dart rename to lib/old/plans/plan_create_screen/plan_create_screen.dart diff --git a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart b/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart similarity index 97% rename from lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart rename to lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart index 656e671c..4c8949c3 100644 --- a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart +++ b/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/plans/plan_edit_screen/models/plan_edit_model.dart'; +import 'package:eatvio_app/old/plans/plan_edit_screen/models/plan_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_event.dart b/lib/old/plans/plan_edit_screen/bloc/plan_edit_event.dart similarity index 100% rename from lib/presentation/plans/plan_edit_screen/bloc/plan_edit_event.dart rename to lib/old/plans/plan_edit_screen/bloc/plan_edit_event.dart diff --git a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_state.dart b/lib/old/plans/plan_edit_screen/bloc/plan_edit_state.dart similarity index 100% rename from lib/presentation/plans/plan_edit_screen/bloc/plan_edit_state.dart rename to lib/old/plans/plan_edit_screen/bloc/plan_edit_state.dart diff --git a/lib/presentation/plans/plan_edit_screen/models/plan_edit_model.dart b/lib/old/plans/plan_edit_screen/models/plan_edit_model.dart similarity index 100% rename from lib/presentation/plans/plan_edit_screen/models/plan_edit_model.dart rename to lib/old/plans/plan_edit_screen/models/plan_edit_model.dart diff --git a/lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart b/lib/old/plans/plan_edit_screen/plan_edit_screen.dart similarity index 100% rename from lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart rename to lib/old/plans/plan_edit_screen/plan_edit_screen.dart diff --git a/lib/presentation/plans/plan_select_screen/bloc/plan_select_bloc.dart b/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart similarity index 93% rename from lib/presentation/plans/plan_select_screen/bloc/plan_select_bloc.dart rename to lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart index fa32b77f..d2ffb5be 100644 --- a/lib/presentation/plans/plan_select_screen/bloc/plan_select_bloc.dart +++ b/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart @@ -1,10 +1,10 @@ -//import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart'; +//import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/plans/plan_select_screen/models/plan_select_model.dart'; +import 'package:eatvio_app/old/plans/plan_select_screen/models/plan_select_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/plans/plan_select_screen/bloc/plan_select_event.dart b/lib/old/plans/plan_select_screen/bloc/plan_select_event.dart similarity index 100% rename from lib/presentation/plans/plan_select_screen/bloc/plan_select_event.dart rename to lib/old/plans/plan_select_screen/bloc/plan_select_event.dart diff --git a/lib/presentation/plans/plan_select_screen/bloc/plan_select_state.dart b/lib/old/plans/plan_select_screen/bloc/plan_select_state.dart similarity index 100% rename from lib/presentation/plans/plan_select_screen/bloc/plan_select_state.dart rename to lib/old/plans/plan_select_screen/bloc/plan_select_state.dart diff --git a/lib/presentation/plans/plan_select_screen/models/plan_select_model.dart b/lib/old/plans/plan_select_screen/models/plan_select_model.dart similarity index 100% rename from lib/presentation/plans/plan_select_screen/models/plan_select_model.dart rename to lib/old/plans/plan_select_screen/models/plan_select_model.dart diff --git a/lib/presentation/plans/plan_select_screen/plan_select_screen.dart b/lib/old/plans/plan_select_screen/plan_select_screen.dart similarity index 100% rename from lib/presentation/plans/plan_select_screen/plan_select_screen.dart rename to lib/old/plans/plan_select_screen/plan_select_screen.dart diff --git a/lib/presentation/plans/plan_show_screen/bloc/plan_show_bloc.dart b/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart similarity index 97% rename from lib/presentation/plans/plan_show_screen/bloc/plan_show_bloc.dart rename to lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart index f09463a9..48b16f9b 100644 --- a/lib/presentation/plans/plan_show_screen/bloc/plan_show_bloc.dart +++ b/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/plans/plan_show_screen/models/plan_show_model.dart'; +import 'package:eatvio_app/old/plans/plan_show_screen/models/plan_show_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/plans/plan_show_screen/bloc/plan_show_event.dart b/lib/old/plans/plan_show_screen/bloc/plan_show_event.dart similarity index 100% rename from lib/presentation/plans/plan_show_screen/bloc/plan_show_event.dart rename to lib/old/plans/plan_show_screen/bloc/plan_show_event.dart diff --git a/lib/presentation/plans/plan_show_screen/bloc/plan_show_state.dart b/lib/old/plans/plan_show_screen/bloc/plan_show_state.dart similarity index 100% rename from lib/presentation/plans/plan_show_screen/bloc/plan_show_state.dart rename to lib/old/plans/plan_show_screen/bloc/plan_show_state.dart diff --git a/lib/presentation/plans/plan_show_screen/models/plan_show_model.dart b/lib/old/plans/plan_show_screen/models/plan_show_model.dart similarity index 100% rename from lib/presentation/plans/plan_show_screen/models/plan_show_model.dart rename to lib/old/plans/plan_show_screen/models/plan_show_model.dart diff --git a/lib/presentation/plans/plan_show_screen/plan_show_screen.dart b/lib/old/plans/plan_show_screen/plan_show_screen.dart similarity index 100% rename from lib/presentation/plans/plan_show_screen/plan_show_screen.dart rename to lib/old/plans/plan_show_screen/plan_show_screen.dart diff --git a/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart b/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart similarity index 98% rename from lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart rename to lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart index 4678416e..6179d623 100644 --- a/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart +++ b/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart @@ -1,10 +1,10 @@ -//import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart'; +//import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/profile/my_profile_screen/models/my_profile_model.dart'; +import 'package:eatvio_app/old/profile/my_profile_screen/models/my_profile_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/profile/my_profile_screen/bloc/my_profile_event.dart b/lib/old/profile/my_profile_screen/bloc/my_profile_event.dart similarity index 100% rename from lib/presentation/profile/my_profile_screen/bloc/my_profile_event.dart rename to lib/old/profile/my_profile_screen/bloc/my_profile_event.dart diff --git a/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart b/lib/old/profile/my_profile_screen/bloc/my_profile_state.dart similarity index 100% rename from lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart rename to lib/old/profile/my_profile_screen/bloc/my_profile_state.dart diff --git a/lib/presentation/profile/my_profile_screen/models/my_profile_model.dart b/lib/old/profile/my_profile_screen/models/my_profile_model.dart similarity index 100% rename from lib/presentation/profile/my_profile_screen/models/my_profile_model.dart rename to lib/old/profile/my_profile_screen/models/my_profile_model.dart diff --git a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart b/lib/old/profile/my_profile_screen/my_profile_screen.dart similarity index 100% rename from lib/presentation/profile/my_profile_screen/my_profile_screen.dart rename to lib/old/profile/my_profile_screen/my_profile_screen.dart diff --git a/lib/presentation/profile/my_profile_screen/my_settings_screen.dart b/lib/old/profile/my_profile_screen/my_settings_screen.dart similarity index 100% rename from lib/presentation/profile/my_profile_screen/my_settings_screen.dart rename to lib/old/profile/my_profile_screen/my_settings_screen.dart diff --git a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart b/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart similarity index 99% rename from lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart rename to lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart index fa817935..33ee84ff 100644 --- a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart +++ b/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/recipe/recipe_edit_screen/models/recipe_edit_model.dart'; +import 'package:eatvio_app/old/recipe/recipe_edit_screen/models/recipe_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_event.dart b/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_event.dart similarity index 100% rename from lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_event.dart rename to lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_event.dart diff --git a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart b/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart similarity index 100% rename from lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart rename to lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart diff --git a/lib/presentation/recipe/recipe_edit_screen/models/recipe_edit_model.dart b/lib/old/recipe/recipe_edit_screen/models/recipe_edit_model.dart similarity index 100% rename from lib/presentation/recipe/recipe_edit_screen/models/recipe_edit_model.dart rename to lib/old/recipe/recipe_edit_screen/models/recipe_edit_model.dart diff --git a/lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart b/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart similarity index 100% rename from lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart rename to lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart diff --git a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart b/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart similarity index 96% rename from lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart rename to lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart index 21f14634..70bab591 100644 --- a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart +++ b/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart @@ -4,7 +4,7 @@ import 'package:dio/dio.dart'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/locator_service.dart'; -import 'package:eatvio_app/presentation/recipe/recipe_select_screen/models/recipe_select_model.dart'; +import 'package:eatvio_app/old/recipe/recipe_select_screen/models/recipe_select_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_event.dart b/lib/old/recipe/recipe_select_screen/bloc/recipe_select_event.dart similarity index 100% rename from lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_event.dart rename to lib/old/recipe/recipe_select_screen/bloc/recipe_select_event.dart diff --git a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_state.dart b/lib/old/recipe/recipe_select_screen/bloc/recipe_select_state.dart similarity index 100% rename from lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_state.dart rename to lib/old/recipe/recipe_select_screen/bloc/recipe_select_state.dart diff --git a/lib/presentation/recipe/recipe_select_screen/models/recipe_select_model.dart b/lib/old/recipe/recipe_select_screen/models/recipe_select_model.dart similarity index 100% rename from lib/presentation/recipe/recipe_select_screen/models/recipe_select_model.dart rename to lib/old/recipe/recipe_select_screen/models/recipe_select_model.dart diff --git a/lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart b/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart similarity index 100% rename from lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart rename to lib/old/recipe/recipe_select_screen/recipe_select_screen.dart diff --git a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart similarity index 97% rename from lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart rename to lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart index 2ae1d76d..bfd81864 100644 --- a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart +++ b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart @@ -3,8 +3,8 @@ import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/feed/blog_post_screen/models/comment_model.dart'; -import 'package:eatvio_app/presentation/recipe/recipe_show_screen/models/recipe_show_model.dart'; +import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; +import 'package:eatvio_app/old/recipe/recipe_show_screen/models/recipe_show_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_event.dart b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_event.dart similarity index 100% rename from lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_event.dart rename to lib/old/recipe/recipe_show_screen/bloc/recipe_show_event.dart diff --git a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_state.dart b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_state.dart similarity index 100% rename from lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_state.dart rename to lib/old/recipe/recipe_show_screen/bloc/recipe_show_state.dart diff --git a/lib/presentation/recipe/recipe_show_screen/models/recipe_show_model.dart b/lib/old/recipe/recipe_show_screen/models/recipe_show_model.dart similarity index 100% rename from lib/presentation/recipe/recipe_show_screen/models/recipe_show_model.dart rename to lib/old/recipe/recipe_show_screen/models/recipe_show_model.dart diff --git a/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart b/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart similarity index 99% rename from lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart rename to lib/old/recipe/recipe_show_screen/recipe_show_screen.dart index c42813d4..33f7cfc3 100644 --- a/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart +++ b/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart @@ -1,6 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/presentation/feed/blog_post_screen/widgets/comment_widget.dart'; +import 'package:eatvio_app/old/feed/blog_post_screen/widgets/comment_widget.dart'; import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; import 'package:eatvio_app/widgets/custom_outlined_button.dart'; import 'package:flutter/material.dart'; diff --git a/lib/presentation/recipe/recipe_show_screen/widgets/comment_widget.dart b/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart similarity index 97% rename from lib/presentation/recipe/recipe_show_screen/widgets/comment_widget.dart rename to lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart index ed2e075c..421c2c71 100644 --- a/lib/presentation/recipe/recipe_show_screen/widgets/comment_widget.dart +++ b/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart @@ -2,7 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/presentation/feed/blog_post_screen/models/comment_model.dart'; +import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; import 'package:flutter/material.dart'; class CommentWidget extends StatelessWidget { diff --git a/lib/presentation/users/subscribers_screen/bloc/subscribers_bloc.dart b/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart similarity index 93% rename from lib/presentation/users/subscribers_screen/bloc/subscribers_bloc.dart rename to lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart index f29ace07..d4adda62 100644 --- a/lib/presentation/users/subscribers_screen/bloc/subscribers_bloc.dart +++ b/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart @@ -1,10 +1,10 @@ -//import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart'; +//import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/users/subscribers_screen/models/subscribers_model.dart'; +import 'package:eatvio_app/old/users/subscribers_screen/models/subscribers_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/presentation/users/subscribers_screen/bloc/subscribers_event.dart b/lib/old/users/subscribers_screen/bloc/subscribers_event.dart similarity index 100% rename from lib/presentation/users/subscribers_screen/bloc/subscribers_event.dart rename to lib/old/users/subscribers_screen/bloc/subscribers_event.dart diff --git a/lib/presentation/users/subscribers_screen/bloc/subscribers_state.dart b/lib/old/users/subscribers_screen/bloc/subscribers_state.dart similarity index 100% rename from lib/presentation/users/subscribers_screen/bloc/subscribers_state.dart rename to lib/old/users/subscribers_screen/bloc/subscribers_state.dart diff --git a/lib/presentation/users/subscribers_screen/models/subscribers_model.dart b/lib/old/users/subscribers_screen/models/subscribers_model.dart similarity index 100% rename from lib/presentation/users/subscribers_screen/models/subscribers_model.dart rename to lib/old/users/subscribers_screen/models/subscribers_model.dart diff --git a/lib/presentation/users/subscribers_screen/subscribers_screen.dart b/lib/old/users/subscribers_screen/subscribers_screen.dart similarity index 98% rename from lib/presentation/users/subscribers_screen/subscribers_screen.dart rename to lib/old/users/subscribers_screen/subscribers_screen.dart index bb968f23..51fde5d3 100644 --- a/lib/presentation/users/subscribers_screen/subscribers_screen.dart +++ b/lib/old/users/subscribers_screen/subscribers_screen.dart @@ -1,6 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/presentation/feed/feed_screen/widgets/feed_search_view.dart'; +import 'package:eatvio_app/old/feed/feed_screen/widgets/feed_search_view.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; diff --git a/lib/widgets/custom_expandable_list.dart b/lib/widgets/custom_expandable_list.dart index 2489c0d7..99709dfb 100644 --- a/lib/widgets/custom_expandable_list.dart +++ b/lib/widgets/custom_expandable_list.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart'; +import 'package:eatvio_app/old/profile/my_profile_screen/bloc/my_profile_bloc.dart'; import 'package:eatvio_app/widgets/custom_hyper_switch.dart'; import 'package:eatvio_app/widgets/custom_hypo_switch.dart'; import 'package:eatvio_app/widgets/next_step_button.dart'; diff --git a/lib/widgets/custom_hyper_switch.dart b/lib/widgets/custom_hyper_switch.dart index 3d28d053..b67f553a 100644 --- a/lib/widgets/custom_hyper_switch.dart +++ b/lib/widgets/custom_hyper_switch.dart @@ -1,5 +1,5 @@ import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart'; +import 'package:eatvio_app/old/profile/my_profile_screen/bloc/my_profile_bloc.dart'; import 'package:flutter/material.dart'; class HyperSwitch extends StatefulWidget { diff --git a/lib/widgets/custom_hypo_switch.dart b/lib/widgets/custom_hypo_switch.dart index 9504e5f1..14a926fd 100644 --- a/lib/widgets/custom_hypo_switch.dart +++ b/lib/widgets/custom_hypo_switch.dart @@ -1,5 +1,5 @@ import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart'; +import 'package:eatvio_app/old/profile/my_profile_screen/bloc/my_profile_bloc.dart'; import 'package:flutter/material.dart'; class HypoSwitch extends StatefulWidget { diff --git a/test/auth_test.dart b/test/auth_test.dart index e131dc88..49a9f19c 100644 --- a/test/auth_test.dart +++ b/test/auth_test.dart @@ -2,9 +2,9 @@ import 'package:eatvio_app/core/app_export.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart'; -import 'package:eatvio_app/presentation/auth/auth_screen/bloc/auth_bloc.dart'; -import 'package:eatvio_app/presentation/auth/auth_screen/models/auth_model.dart'; +import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; +import 'package:eatvio_app/old/auth/auth_screen/bloc/auth_bloc.dart'; +import 'package:eatvio_app/old/auth/auth_screen/models/auth_model.dart'; void main() { group('AuthScreen', () { From 3ccf5b6d92a42558f03636c92f13895c5e9c0b96 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 9 Sep 2024 12:58:25 +0300 Subject: [PATCH 09/31] refactor: scroll --- assets/icons/filter.svg | 67 ++++++++ assets/icons/like.svg | 44 +++-- assets/icons/like_filled.svg | 44 +++-- .../presentation/pages/blog_post_screen.dart | 132 +++----------- .../chat/presentation/pages/chat_screen.dart | 79 +++++---- .../presentation/pages/about_diet_screen.dart | 155 +++-------------- .../bloc/comments_cubit/comments_cubit.dart | 106 +++++------- .../bloc/comments_cubit/comments_state.dart | 1 + .../comments_state.freezed.dart | 60 ++++--- .../bloc/feed_cubit/feed_cubit.dart | 46 ++--- .../feed/presentation/pages/feed_screen.dart | 111 +++++++----- .../widgets/blog_post_widget.dart | 2 + .../presentation/widgets/comments_widget.dart | 119 +++++++++++++ .../presentation/widgets/diets_widget.dart | 2 + .../presentation/widgets/recipes_widget.dart | 2 + .../feed/repositories/feed_repository.dart | 8 +- lib/features/feed/services/feed_service.dart | 8 +- .../feed/services/feed_service.g.dart | 8 +- .../presentation/pages/profile_screen.dart | 50 +++--- .../pages/about_recipes_screen.dart | 161 ++++-------------- .../diet_create_screen.dart | 1 - .../diet_edit_screen/diet_edit_screen.dart | 1 - .../diet_show_screen/diet_show_screen.dart | 1 - .../blog_post_edit_screen.dart | 1 - .../plan_create_screen.dart | 1 - .../plan_edit_screen/plan_edit_screen.dart | 1 - .../plan_show_screen/plan_show_screen.dart | 1 - .../my_profile_screen/my_profile_screen.dart | 1 - .../recipe_edit_screen.dart | 1 - .../recipe_show_screen.dart | 1 - pubspec.yaml | 3 +- 31 files changed, 610 insertions(+), 608 deletions(-) create mode 100644 assets/icons/filter.svg create mode 100644 lib/features/feed/presentation/widgets/comments_widget.dart diff --git a/assets/icons/filter.svg b/assets/icons/filter.svg new file mode 100644 index 00000000..7f5491ff --- /dev/null +++ b/assets/icons/filter.svg @@ -0,0 +1,67 @@ + + + + + + + + + + + + diff --git a/assets/icons/like.svg b/assets/icons/like.svg index 4fe0f919..11397221 100644 --- a/assets/icons/like.svg +++ b/assets/icons/like.svg @@ -1,22 +1,42 @@ - - + - - - get copyWith => throw _privateConstructorUsedError; } @@ -265,7 +282,7 @@ abstract class $MetaCopyWith<$Res> { @JsonKey(name: "from") dynamic from, @JsonKey(name: "last_page") int lastPage, @JsonKey(name: "links") List links, - @JsonKey(name: "path") String path, + @JsonKey(name: "path") String? path, @JsonKey(name: "per_page") int perPage, @JsonKey(name: "to") dynamic to, @JsonKey(name: "total") int total}); @@ -281,6 +298,8 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Meta + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -288,7 +307,7 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> Object? from = freezed, Object? lastPage = null, Object? links = null, - Object? path = null, + Object? path = freezed, Object? perPage = null, Object? to = freezed, Object? total = null, @@ -310,10 +329,10 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> ? _value.links : links // ignore: cast_nullable_to_non_nullable as List, - path: null == path + path: freezed == path ? _value.path : path // ignore: cast_nullable_to_non_nullable - as String, + as String?, perPage: null == perPage ? _value.perPage : perPage // ignore: cast_nullable_to_non_nullable @@ -342,7 +361,7 @@ abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { @JsonKey(name: "from") dynamic from, @JsonKey(name: "last_page") int lastPage, @JsonKey(name: "links") List links, - @JsonKey(name: "path") String path, + @JsonKey(name: "path") String? path, @JsonKey(name: "per_page") int perPage, @JsonKey(name: "to") dynamic to, @JsonKey(name: "total") int total}); @@ -355,6 +374,8 @@ class __$$MetaImplCopyWithImpl<$Res> __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) : super(_value, _then); + /// Create a copy of Meta + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -362,7 +383,7 @@ class __$$MetaImplCopyWithImpl<$Res> Object? from = freezed, Object? lastPage = null, Object? links = null, - Object? path = null, + Object? path = freezed, Object? perPage = null, Object? to = freezed, Object? total = null, @@ -384,10 +405,10 @@ class __$$MetaImplCopyWithImpl<$Res> ? _value._links : links // ignore: cast_nullable_to_non_nullable as List, - path: null == path + path: freezed == path ? _value.path : path // ignore: cast_nullable_to_non_nullable - as String, + as String?, perPage: null == perPage ? _value.perPage : perPage // ignore: cast_nullable_to_non_nullable @@ -412,7 +433,7 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "from") required this.from, @JsonKey(name: "last_page") required this.lastPage, @JsonKey(name: "links") required final List links, - @JsonKey(name: "path") required this.path, + @JsonKey(name: "path") this.path, @JsonKey(name: "per_page") required this.perPage, @JsonKey(name: "to") required this.to, @JsonKey(name: "total") required this.total}) @@ -441,7 +462,7 @@ class _$MetaImpl implements _Meta { @override @JsonKey(name: "path") - final String path; + final String? path; @override @JsonKey(name: "per_page") final int perPage; @@ -474,7 +495,7 @@ class _$MetaImpl implements _Meta { (identical(other.total, total) || other.total == total)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -487,7 +508,9 @@ class _$MetaImpl implements _Meta { const DeepCollectionEquality().hash(to), total); - @JsonKey(ignore: true) + /// Create a copy of Meta + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$MetaImplCopyWith<_$MetaImpl> get copyWith => @@ -507,7 +530,7 @@ abstract class _Meta implements Meta { @JsonKey(name: "from") required final dynamic from, @JsonKey(name: "last_page") required final int lastPage, @JsonKey(name: "links") required final List links, - @JsonKey(name: "path") required final String path, + @JsonKey(name: "path") final String? path, @JsonKey(name: "per_page") required final int perPage, @JsonKey(name: "to") required final dynamic to, @JsonKey(name: "total") required final int total}) = _$MetaImpl; @@ -528,7 +551,7 @@ abstract class _Meta implements Meta { List get links; @override @JsonKey(name: "path") - String get path; + String? get path; @override @JsonKey(name: "per_page") int get perPage; @@ -538,8 +561,11 @@ abstract class _Meta implements Meta { @override @JsonKey(name: "total") int get total; + + /// Create a copy of Meta + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$MetaImplCopyWith<_$MetaImpl> get copyWith => throw _privateConstructorUsedError; } @@ -553,12 +579,16 @@ mixin _$Link { @JsonKey(name: "url") String? get url => throw _privateConstructorUsedError; @JsonKey(name: "label") - String get label => throw _privateConstructorUsedError; + String? get label => throw _privateConstructorUsedError; @JsonKey(name: "active") - bool get active => throw _privateConstructorUsedError; + bool? get active => throw _privateConstructorUsedError; + /// Serializes this Link to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Link + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $LinkCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -569,8 +599,8 @@ abstract class $LinkCopyWith<$Res> { @useResult $Res call( {@JsonKey(name: "url") String? url, - @JsonKey(name: "label") String label, - @JsonKey(name: "active") bool active}); + @JsonKey(name: "label") String? label, + @JsonKey(name: "active") bool? active}); } /// @nodoc @@ -583,26 +613,28 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Link + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? url = freezed, - Object? label = null, - Object? active = null, + Object? label = freezed, + Object? active = freezed, }) { return _then(_value.copyWith( url: freezed == url ? _value.url : url // ignore: cast_nullable_to_non_nullable as String?, - label: null == label + label: freezed == label ? _value.label : label // ignore: cast_nullable_to_non_nullable - as String, - active: null == active + as String?, + active: freezed == active ? _value.active : active // ignore: cast_nullable_to_non_nullable - as bool, + as bool?, ) as $Val); } } @@ -616,8 +648,8 @@ abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> { @useResult $Res call( {@JsonKey(name: "url") String? url, - @JsonKey(name: "label") String label, - @JsonKey(name: "active") bool active}); + @JsonKey(name: "label") String? label, + @JsonKey(name: "active") bool? active}); } /// @nodoc @@ -627,26 +659,28 @@ class __$$LinkImplCopyWithImpl<$Res> __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) : super(_value, _then); + /// Create a copy of Link + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? url = freezed, - Object? label = null, - Object? active = null, + Object? label = freezed, + Object? active = freezed, }) { return _then(_$LinkImpl( url: freezed == url ? _value.url : url // ignore: cast_nullable_to_non_nullable as String?, - label: null == label + label: freezed == label ? _value.label : label // ignore: cast_nullable_to_non_nullable - as String, - active: null == active + as String?, + active: freezed == active ? _value.active : active // ignore: cast_nullable_to_non_nullable - as bool, + as bool?, )); } } @@ -655,9 +689,9 @@ class __$$LinkImplCopyWithImpl<$Res> @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}); + {@JsonKey(name: "url") this.url, + @JsonKey(name: "label") this.label, + @JsonKey(name: "active") this.active}); factory _$LinkImpl.fromJson(Map json) => _$$LinkImplFromJson(json); @@ -667,10 +701,10 @@ class _$LinkImpl implements _Link { final String? url; @override @JsonKey(name: "label") - final String label; + final String? label; @override @JsonKey(name: "active") - final bool active; + final bool? active; @override String toString() { @@ -687,11 +721,13 @@ class _$LinkImpl implements _Link { (identical(other.active, active) || other.active == active)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, url, label, active); - @JsonKey(ignore: true) + /// Create a copy of Link + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$LinkImplCopyWith<_$LinkImpl> get copyWith => @@ -707,9 +743,9 @@ class _$LinkImpl implements _Link { abstract class _Link implements Link { const factory _Link( - {@JsonKey(name: "url") required final String? url, - @JsonKey(name: "label") required final String label, - @JsonKey(name: "active") required final bool active}) = _$LinkImpl; + {@JsonKey(name: "url") final String? url, + @JsonKey(name: "label") final String? label, + @JsonKey(name: "active") final bool? active}) = _$LinkImpl; factory _Link.fromJson(Map json) = _$LinkImpl.fromJson; @@ -718,12 +754,15 @@ abstract class _Link implements Link { String? get url; @override @JsonKey(name: "label") - String get label; + String? get label; @override @JsonKey(name: "active") - bool get active; + bool? get active; + + /// Create a copy of Link + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$LinkImplCopyWith<_$LinkImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/models/base_models.g.dart b/lib/core/models/base_models.g.dart index 3c061e32..ada8e71f 100644 --- a/lib/core/models/base_models.g.dart +++ b/lib/core/models/base_models.g.dart @@ -28,7 +28,7 @@ _$MetaImpl _$$MetaImplFromJson(Map json) => _$MetaImpl( links: (json['links'] as List) .map((e) => Link.fromJson(e as Map)) .toList(), - path: json['path'] as String, + path: json['path'] as String?, perPage: (json['per_page'] as num).toInt(), to: json['to'], total: (json['total'] as num).toInt(), @@ -48,8 +48,8 @@ Map _$$MetaImplToJson(_$MetaImpl instance) => _$LinkImpl _$$LinkImplFromJson(Map json) => _$LinkImpl( url: json['url'] as String?, - label: json['label'] as String, - active: json['active'] as bool, + label: json['label'] as String?, + active: json['active'] as bool?, ); Map _$$LinkImplToJson(_$LinkImpl instance) => diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart index 917785c7..97ab368c 100644 --- a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart +++ b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart @@ -21,7 +21,9 @@ mixin _$SelectionPopupModel { dynamic get value => throw _privateConstructorUsedError; bool get isSelected => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of SelectionPopupModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $SelectionPopupModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -45,6 +47,8 @@ class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of SelectionPopupModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -93,6 +97,8 @@ class __$$SelectionPopupModelImplCopyWithImpl<$Res> $Res Function(_$SelectionPopupModelImpl) _then) : super(_value, _then); + /// Create a copy of SelectionPopupModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -159,7 +165,9 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { int get hashCode => Object.hash(runtimeType, id, title, const DeepCollectionEquality().hash(value), isSelected); - @JsonKey(ignore: true) + /// Create a copy of SelectionPopupModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => @@ -182,8 +190,11 @@ abstract class _SelectionPopupModel implements SelectionPopupModel { dynamic get value; @override bool get isSelected; + + /// Create a copy of SelectionPopupModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$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..fd835a26 100644 --- a/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart +++ b/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart @@ -68,8 +68,12 @@ mixin _$UserRegistrationSheet { @JsonKey(name: 'activity_coefficient') double get activityCoefficient => throw _privateConstructorUsedError; + /// Serializes this UserRegistrationSheet to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of UserRegistrationSheet + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $UserRegistrationSheetCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -121,6 +125,8 @@ class _$UserRegistrationSheetCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of UserRegistrationSheet + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -313,6 +319,8 @@ class __$$UserRegistrationSheetImplCopyWithImpl<$Res> $Res Function(_$UserRegistrationSheetImpl) _then) : super(_value, _then); + /// Create a copy of UserRegistrationSheet + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -627,7 +635,7 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { other.activityCoefficient == activityCoefficient)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hashAll([ runtimeType, @@ -660,7 +668,9 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { activityCoefficient ]); - @JsonKey(ignore: true) + /// Create a copy of UserRegistrationSheet + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> @@ -787,8 +797,11 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { @override @JsonKey(name: 'activity_coefficient') double get activityCoefficient; + + /// Create a copy of UserRegistrationSheet + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> 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 0c375699..3114518a 100644 --- a/lib/features/blog_post/presentation/pages/blog_post_screen.dart +++ b/lib/features/blog_post/presentation/pages/blog_post_screen.dart @@ -8,7 +8,6 @@ import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/commen import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart'; import 'package:eatvio_app/locator_service.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:share_plus/share_plus.dart'; @@ -322,7 +321,7 @@ class _BlogPostScreenState extends State { if (state is CommentsStateLoading) Padding( padding: const EdgeInsets.all(32), - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), if (state is CommentsStateLoaded) CommentsWidget( 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..7c5d7ffd 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart @@ -84,6 +84,9 @@ class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of NewMessagesState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -100,6 +103,9 @@ class __$$NewMessagesStateImplCopyWithImpl<$Res> __$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value, $Res Function(_$NewMessagesStateImpl) _then) : super(_value, _then); + + /// Create a copy of NewMessagesState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -215,6 +221,9 @@ class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res> __$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value, $Res Function(_$NewMessagesStateEmptyImpl) _then) : super(_value, _then); + + /// Create a copy of NewMessagesState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -335,6 +344,8 @@ class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res> $Res Function(_$NewMessagesStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of NewMessagesState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -374,7 +385,9 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { @override int get hashCode => Object.hash(runtimeType, messagesCount); - @JsonKey(ignore: true) + /// Create a copy of NewMessagesState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> @@ -461,7 +474,10 @@ abstract class NewMessagesStateLoaded implements NewMessagesState { _$NewMessagesStateLoadedImpl; int get messagesCount; - @JsonKey(ignore: true) + + /// Create a copy of NewMessagesState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -484,6 +500,8 @@ class __$$NewMessagesStateErrorImplCopyWithImpl<$Res> $Res Function(_$NewMessagesStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of NewMessagesState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -523,7 +541,9 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of NewMessagesState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> @@ -610,7 +630,10 @@ abstract class NewMessagesStateError implements NewMessagesState { _$NewMessagesStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of NewMessagesState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } 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 4ba18f06..d634b318 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart @@ -88,6 +88,9 @@ class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of NotificationsState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -104,6 +107,9 @@ class __$$NotificationsStateImplCopyWithImpl<$Res> __$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value, $Res Function(_$NotificationsStateImpl) _then) : super(_value, _then); + + /// Create a copy of NotificationsState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -225,6 +231,9 @@ class __$$NotificationsStateEmptyImplCopyWithImpl<$Res> _$NotificationsStateEmptyImpl _value, $Res Function(_$NotificationsStateEmptyImpl) _then) : super(_value, _then); + + /// Create a copy of NotificationsState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -350,6 +359,8 @@ class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> $Res Function(_$NotificationsStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of NotificationsState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -408,7 +419,9 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_notifications), notificationsCount); - @JsonKey(ignore: true) + /// Create a copy of NotificationsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> @@ -501,7 +514,10 @@ abstract class NotificationsStateLoaded implements NotificationsState { List get notifications; int get notificationsCount; - @JsonKey(ignore: true) + + /// Create a copy of NotificationsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -526,6 +542,8 @@ class __$$NotificationsStateErrorImplCopyWithImpl<$Res> $Res Function(_$NotificationsStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of NotificationsState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -565,7 +583,9 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of NotificationsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> @@ -656,7 +676,10 @@ abstract class NotificationsStateError implements NotificationsState { _$NotificationsStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of NotificationsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart index 5d8de7ff..b629d579 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart @@ -84,6 +84,9 @@ class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of ProfileAvatarState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -100,6 +103,9 @@ class __$$ProfileAvatarStateImplCopyWithImpl<$Res> __$$ProfileAvatarStateImplCopyWithImpl(_$ProfileAvatarStateImpl _value, $Res Function(_$ProfileAvatarStateImpl) _then) : super(_value, _then); + + /// Create a copy of ProfileAvatarState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -217,6 +223,9 @@ class __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res> _$ProfileAvatarStateLoadingImpl _value, $Res Function(_$ProfileAvatarStateLoadingImpl) _then) : super(_value, _then); + + /// Create a copy of ProfileAvatarState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -340,6 +349,8 @@ class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res> $Res Function(_$ProfileAvatarStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of ProfileAvatarState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -353,6 +364,8 @@ class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res> )); } + /// Create a copy of ProfileAvatarState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $ProfileModelCopyWith<$Res> get profile { @@ -386,7 +399,9 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded { @override int get hashCode => Object.hash(runtimeType, profile); - @JsonKey(ignore: true) + /// Create a copy of ProfileAvatarState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> @@ -473,7 +488,10 @@ abstract class ProfileAvatarStateLoaded implements ProfileAvatarState { {required final ProfileModel profile}) = _$ProfileAvatarStateLoadedImpl; ProfileModel get profile; - @JsonKey(ignore: true) + + /// Create a copy of ProfileAvatarState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -498,6 +516,8 @@ class __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res> $Res Function(_$ProfileAvatarStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of ProfileAvatarState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -537,7 +557,9 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of ProfileAvatarState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> @@ -624,7 +646,10 @@ abstract class ProfileAvatarStateError implements ProfileAvatarState { _$ProfileAvatarStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of ProfileAvatarState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart index a4bd7924..6f730432 100644 --- a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart +++ b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart @@ -190,9 +190,9 @@ class _BottomNavigationBarWidgetState extends State { label: '', icon: BlocBuilder( builder: (BuildContext context, ProfileAvatarState state) { - if (state is ProfileAvatarStateLoaded && state.profile.user.profilePhotoUrl != null) { + if (state is ProfileAvatarStateLoaded) { return CircleAvatar( - backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl!), + backgroundImage: NetworkImage(state.profile.profilePhotoUrl), radius: 16, ); } diff --git a/lib/features/calendar/models/calendar_model.freezed.dart b/lib/features/calendar/models/calendar_model.freezed.dart index 5e47f848..d10fc8f2 100644 --- a/lib/features/calendar/models/calendar_model.freezed.dart +++ b/lib/features/calendar/models/calendar_model.freezed.dart @@ -25,8 +25,12 @@ mixin _$CalendarModel { throw _privateConstructorUsedError; Object? get diary => throw _privateConstructorUsedError; + /// Serializes this CalendarModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of CalendarModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $CalendarModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -53,6 +57,8 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of CalendarModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -97,6 +103,8 @@ class __$$CalendarModelImplCopyWithImpl<$Res> _$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then) : super(_value, _then); + /// Create a copy of CalendarModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -157,7 +165,7 @@ class _$CalendarModelImpl implements _CalendarModel { const DeepCollectionEquality().equals(other.diary, diary)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -165,7 +173,9 @@ class _$CalendarModelImpl implements _CalendarModel { is_current_day_included_in_the_chosen_diet_progression, const DeepCollectionEquality().hash(diary)); - @JsonKey(ignore: true) + /// Create a copy of CalendarModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => @@ -195,8 +205,11 @@ abstract class _CalendarModel implements CalendarModel { bool get is_current_day_included_in_the_chosen_diet_progression; @override Object? get diary; + + /// Create a copy of CalendarModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart index c71d5226..0e7bdbcd 100644 --- a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart +++ b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart @@ -84,6 +84,9 @@ class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of CalendarState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -100,6 +103,9 @@ class __$$CalendarStateImplCopyWithImpl<$Res> __$$CalendarStateImplCopyWithImpl( _$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then) : super(_value, _then); + + /// Create a copy of CalendarState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -214,6 +220,9 @@ class __$$CalendarStateLoadingImplCopyWithImpl<$Res> __$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value, $Res Function(_$CalendarStateLoadingImpl) _then) : super(_value, _then); + + /// Create a copy of CalendarState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -332,6 +341,8 @@ class __$$CalendarStateLoadedImplCopyWithImpl<$Res> $Res Function(_$CalendarStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of CalendarState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -379,7 +390,9 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_calendarList)); - @JsonKey(ignore: true) + /// Create a copy of CalendarState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => @@ -467,7 +480,10 @@ abstract class CalendarStateLoaded implements CalendarState { _$CalendarStateLoadedImpl; List get calendarList; - @JsonKey(ignore: true) + + /// Create a copy of CalendarState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -489,6 +505,8 @@ class __$$CalendarStateErrorImplCopyWithImpl<$Res> $Res Function(_$CalendarStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of CalendarState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -528,7 +546,9 @@ class _$CalendarStateErrorImpl implements CalendarStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of CalendarState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => @@ -615,7 +635,10 @@ abstract class CalendarStateError implements CalendarState { _$CalendarStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of CalendarState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/presentation/pages/calendar_screen.dart b/lib/features/calendar/presentation/pages/calendar_screen.dart index bcd365c2..ab31b68b 100644 --- a/lib/features/calendar/presentation/pages/calendar_screen.dart +++ b/lib/features/calendar/presentation/pages/calendar_screen.dart @@ -6,7 +6,6 @@ import 'package:eatvio_app/core/app_export.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 @@ -20,7 +19,7 @@ class CalendarScreen extends StatelessWidget { } else if (state is CalendarStateLoading) { return Scaffold( body: Center( - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), ); } else if (state is CalendarStateError) { diff --git a/lib/features/chat/models/chat_message_model.freezed.dart b/lib/features/chat/models/chat_message_model.freezed.dart index 76a91cbc..8f921425 100644 --- a/lib/features/chat/models/chat_message_model.freezed.dart +++ b/lib/features/chat/models/chat_message_model.freezed.dart @@ -29,8 +29,12 @@ mixin _$ChatMessageModel { @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; + /// Serializes this ChatMessageModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ChatMessageModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ChatMessageModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -59,6 +63,8 @@ class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ChatMessageModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -117,6 +123,8 @@ class __$$ChatMessageModelImplCopyWithImpl<$Res> $Res Function(_$ChatMessageModelImpl) _then) : super(_value, _then); + /// Create a copy of ChatMessageModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -207,12 +215,14 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { other.updatedAt == updatedAt)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); - @JsonKey(ignore: true) + /// Create a copy of ChatMessageModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => @@ -252,8 +262,11 @@ abstract class _ChatMessageModel implements ChatMessageModel { @override @JsonKey(name: 'updated_at') String get updatedAt; + + /// Create a copy of ChatMessageModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_messages_model.freezed.dart b/lib/features/chat/models/chat_messages_model.freezed.dart index a970241c..852b33e4 100644 --- a/lib/features/chat/models/chat_messages_model.freezed.dart +++ b/lib/features/chat/models/chat_messages_model.freezed.dart @@ -24,8 +24,12 @@ mixin _$ChatMessagesModel { List get messagesList => throw _privateConstructorUsedError; ChatMetaModel get meta => throw _privateConstructorUsedError; + /// Serializes this ChatMessagesModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ChatMessagesModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ChatMessagesModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -53,6 +57,8 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ChatMessagesModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -71,6 +77,8 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> ) as $Val); } + /// Create a copy of ChatMessagesModel + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $ChatMetaModelCopyWith<$Res> get meta { @@ -104,6 +112,8 @@ class __$$ChatMessagesModelImplCopyWithImpl<$Res> $Res Function(_$ChatMessagesModelImpl) _then) : super(_value, _then); + /// Create a copy of ChatMessagesModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -162,12 +172,14 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { (identical(other.meta, meta) || other.meta == meta)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); - @JsonKey(ignore: true) + /// Create a copy of ChatMessagesModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => @@ -196,8 +208,11 @@ abstract class _ChatMessagesModel implements ChatMessagesModel { List get messagesList; @override ChatMetaModel get meta; + + /// Create a copy of ChatMessagesModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_meta_model.freezed.dart b/lib/features/chat/models/chat_meta_model.freezed.dart index 11ecb9e2..e8e4e96b 100644 --- a/lib/features/chat/models/chat_meta_model.freezed.dart +++ b/lib/features/chat/models/chat_meta_model.freezed.dart @@ -23,8 +23,12 @@ mixin _$ChatMetaModel { @JsonKey(name: "last_page") int get lastPage => throw _privateConstructorUsedError; + /// Serializes this ChatMetaModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ChatMetaModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ChatMetaModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -48,6 +52,8 @@ class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ChatMetaModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -81,6 +87,8 @@ class __$$ChatMetaModelImplCopyWithImpl<$Res> _$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then) : super(_value, _then); + /// Create a copy of ChatMetaModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -122,11 +130,13 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { other.lastPage == lastPage)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, lastPage); - @JsonKey(ignore: true) + /// Create a copy of ChatMetaModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => @@ -151,8 +161,11 @@ abstract class _ChatMetaModel implements ChatMetaModel { @override @JsonKey(name: "last_page") int get lastPage; + + /// Create a copy of ChatMetaModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_model.freezed.dart b/lib/features/chat/models/chat_room_model.freezed.dart index 5a0b6e62..6afb3a94 100644 --- a/lib/features/chat/models/chat_room_model.freezed.dart +++ b/lib/features/chat/models/chat_room_model.freezed.dart @@ -26,8 +26,12 @@ mixin _$ChatRoomModel { throw _privateConstructorUsedError; Map get users => throw _privateConstructorUsedError; + /// Serializes this ChatRoomModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ChatRoomModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ChatRoomModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -57,6 +61,8 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ChatRoomModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -80,6 +86,8 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> ) as $Val); } + /// Create a copy of ChatRoomModel + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings { @@ -116,6 +124,8 @@ class __$$ChatRoomModelImplCopyWithImpl<$Res> _$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then) : super(_value, _then); + /// Create a copy of ChatRoomModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -181,12 +191,14 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { const DeepCollectionEquality().equals(other._users, _users)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, const DeepCollectionEquality().hash(_users)); - @JsonKey(ignore: true) + /// Create a copy of ChatRoomModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => @@ -217,8 +229,11 @@ abstract class _ChatRoomModel implements ChatRoomModel { ChatRoomSettingsModel get chatRoomSettings; @override Map get users; + + /// Create a copy of ChatRoomModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_preview_model.freezed.dart b/lib/features/chat/models/chat_room_preview_model.freezed.dart index 8d41bd4b..4b006cf0 100644 --- a/lib/features/chat/models/chat_room_preview_model.freezed.dart +++ b/lib/features/chat/models/chat_room_preview_model.freezed.dart @@ -23,8 +23,12 @@ mixin _$ChatRoomPreviewModel { @JsonKey(name: "chatRooms") List get chatRooms => throw _privateConstructorUsedError; + /// Serializes this ChatRoomPreviewModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ChatRoomPreviewModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ChatRoomPreviewModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -49,6 +53,8 @@ class _$ChatRoomPreviewModelCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ChatRoomPreviewModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -82,6 +88,8 @@ class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> $Res Function(_$ChatRoomPreviewModelImpl) _then) : super(_value, _then); + /// Create a copy of ChatRoomPreviewModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -129,12 +137,14 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { .equals(other._chatRooms, _chatRooms)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); - @JsonKey(ignore: true) + /// Create a copy of ChatRoomPreviewModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> @@ -161,8 +171,11 @@ abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel { @override @JsonKey(name: "chatRooms") List get chatRooms; + + /// Create a copy of ChatRoomPreviewModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => throw _privateConstructorUsedError; } @@ -182,8 +195,12 @@ mixin _$ChatRoom { @JsonKey(name: "users") Users get users => throw _privateConstructorUsedError; + /// Serializes this ChatRoom to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ChatRoom + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ChatRoomCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -212,6 +229,8 @@ class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ChatRoom + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -240,6 +259,8 @@ class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> ) as $Val); } + /// Create a copy of ChatRoom + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $UsersCopyWith<$Res> get users { @@ -275,6 +296,8 @@ class __$$ChatRoomImplCopyWithImpl<$Res> _$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then) : super(_value, _then); + /// Create a copy of ChatRoom + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -347,12 +370,14 @@ class _$ChatRoomImpl implements _ChatRoom { (identical(other.users, users) || other.users == users)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, roomName, const DeepCollectionEquality().hash(lastMessage), users); - @JsonKey(ignore: true) + /// Create a copy of ChatRoom + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => @@ -388,8 +413,11 @@ abstract class _ChatRoom implements ChatRoom { @override @JsonKey(name: "users") Users get users; + + /// Create a copy of ChatRoom + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => throw _privateConstructorUsedError; } @@ -415,8 +443,12 @@ mixin _$LastMessageClass { @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; + /// Serializes this LastMessageClass to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of LastMessageClass + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $LastMessageClassCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -448,6 +480,8 @@ class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of LastMessageClass + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -519,6 +553,8 @@ class __$$LastMessageClassImplCopyWithImpl<$Res> $Res Function(_$LastMessageClassImpl) _then) : super(_value, _then); + /// Create a copy of LastMessageClass + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -633,7 +669,7 @@ class _$LastMessageClassImpl implements _LastMessageClass { other.updatedAt == updatedAt)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -645,7 +681,9 @@ class _$LastMessageClassImpl implements _LastMessageClass { readByToUser, updatedAt); - @JsonKey(ignore: true) + /// Create a copy of LastMessageClass + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => @@ -696,8 +734,11 @@ abstract class _LastMessageClass implements LastMessageClass { @override @JsonKey(name: "updated_at") DateTime get updatedAt; + + /// Create a copy of LastMessageClass + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => throw _privateConstructorUsedError; } @@ -713,8 +754,12 @@ mixin _$Users { @JsonKey(name: "to_chat_user") ChatUser get toChatUser => throw _privateConstructorUsedError; + /// Serializes this Users to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Users + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $UsersCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -741,6 +786,8 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Users + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -759,6 +806,8 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users> ) as $Val); } + /// Create a copy of Users + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $ChatUserCopyWith<$Res> get fromChatUser { @@ -767,6 +816,8 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users> }); } + /// Create a copy of Users + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $ChatUserCopyWith<$Res> get toChatUser { @@ -801,6 +852,8 @@ class __$$UsersImplCopyWithImpl<$Res> _$UsersImpl _value, $Res Function(_$UsersImpl) _then) : super(_value, _then); + /// Create a copy of Users + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -853,11 +906,13 @@ class _$UsersImpl implements _Users { other.toChatUser == toChatUser)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, fromChatUser, toChatUser); - @JsonKey(ignore: true) + /// Create a copy of Users + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$UsersImplCopyWith<_$UsersImpl> get copyWith => @@ -885,8 +940,11 @@ abstract class _Users implements Users { @override @JsonKey(name: "to_chat_user") ChatUser get toChatUser; + + /// Create a copy of Users + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$UsersImplCopyWith<_$UsersImpl> get copyWith => throw _privateConstructorUsedError; } @@ -906,8 +964,12 @@ mixin _$ChatUser { @JsonKey(name: "profile_photo_url") String get profilePhotoUrl => throw _privateConstructorUsedError; + /// Serializes this ChatUser to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ChatUser + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ChatUserCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -934,6 +996,8 @@ class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ChatUser + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -986,6 +1050,8 @@ class __$$ChatUserImplCopyWithImpl<$Res> _$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then) : super(_value, _then); + /// Create a copy of ChatUser + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1058,12 +1124,14 @@ class _$ChatUserImpl implements _ChatUser { other.profilePhotoUrl == profilePhotoUrl)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); - @JsonKey(ignore: true) + /// Create a copy of ChatUser + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => @@ -1101,8 +1169,11 @@ abstract class _ChatUser implements ChatUser { @override @JsonKey(name: "profile_photo_url") String get profilePhotoUrl; + + /// Create a copy of ChatUser + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => throw _privateConstructorUsedError; } 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..9d12eefa 100644 --- a/lib/features/chat/models/chat_room_settings_model.freezed.dart +++ b/lib/features/chat/models/chat_room_settings_model.freezed.dart @@ -30,8 +30,12 @@ mixin _$ChatRoomSettingsModel { @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; + /// Serializes this ChatRoomSettingsModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ChatRoomSettingsModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ChatRoomSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -61,6 +65,8 @@ class _$ChatRoomSettingsModelCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ChatRoomSettingsModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -121,6 +127,8 @@ class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res> $Res Function(_$ChatRoomSettingsModelImpl) _then) : super(_value, _then); + /// Create a copy of ChatRoomSettingsModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -202,12 +210,14 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { other.updatedAt == updatedAt)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); - @JsonKey(ignore: true) + /// Create a copy of ChatRoomSettingsModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> @@ -247,8 +257,11 @@ abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel { @override @JsonKey(name: 'updated_at') String get updatedAt; + + /// Create a copy of ChatRoomSettingsModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_user_model.freezed.dart b/lib/features/chat/models/chat_user_model.freezed.dart index 095c09e2..94718168 100644 --- a/lib/features/chat/models/chat_user_model.freezed.dart +++ b/lib/features/chat/models/chat_user_model.freezed.dart @@ -27,8 +27,12 @@ mixin _$ChatUserModel { @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl => throw _privateConstructorUsedError; + /// Serializes this ChatUserModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ChatUserModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ChatUserModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -56,6 +60,8 @@ class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ChatUserModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -108,6 +114,8 @@ class __$$ChatUserModelImplCopyWithImpl<$Res> _$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then) : super(_value, _then); + /// Create a copy of ChatUserModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -178,12 +186,14 @@ class _$ChatUserModelImpl implements _ChatUserModel { other.profilePhotoUrl == profilePhotoUrl)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); - @JsonKey(ignore: true) + /// Create a copy of ChatUserModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => @@ -218,8 +228,11 @@ abstract class _ChatUserModel implements ChatUserModel { @override @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl; + + /// Create a copy of ChatUserModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/websocket_info_model.freezed.dart b/lib/features/chat/models/websocket_info_model.freezed.dart index cd383a2b..9cddabee 100644 --- a/lib/features/chat/models/websocket_info_model.freezed.dart +++ b/lib/features/chat/models/websocket_info_model.freezed.dart @@ -27,8 +27,12 @@ mixin _$WebsocketInfoModel { @JsonKey(name: 'user_id') int get userId => throw _privateConstructorUsedError; + /// Serializes this WebsocketInfoModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of WebsocketInfoModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $WebsocketInfoModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -57,6 +61,8 @@ class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of WebsocketInfoModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -115,6 +121,8 @@ class __$$WebsocketInfoModelImplCopyWithImpl<$Res> $Res Function(_$WebsocketInfoModelImpl) _then) : super(_value, _then); + /// Create a copy of WebsocketInfoModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -191,12 +199,14 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { (identical(other.userId, userId) || other.userId == userId)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, key, host, port, cluster, userId); - @JsonKey(ignore: true) + /// Create a copy of WebsocketInfoModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => @@ -234,8 +244,11 @@ abstract class _WebsocketInfoModel implements WebsocketInfoModel { @override @JsonKey(name: 'user_id') int get userId; + + /// Create a copy of WebsocketInfoModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => throw _privateConstructorUsedError; } 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..4695b4ad 100644 --- a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart @@ -90,6 +90,9 @@ class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of ChatRoomState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -106,6 +109,9 @@ class __$$ChatRoomStateImplCopyWithImpl<$Res> __$$ChatRoomStateImplCopyWithImpl( _$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then) : super(_value, _then); + + /// Create a copy of ChatRoomState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -226,6 +232,9 @@ class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res> __$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value, $Res Function(_$ChatRoomStateLoadingImpl) _then) : super(_value, _then); + + /// Create a copy of ChatRoomState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -356,6 +365,8 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> $Res Function(_$ChatRoomStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of ChatRoomState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -384,6 +395,8 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> )); } + /// Create a copy of ChatRoomState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $ChatRoomModelCopyWith<$Res> get chatRoom { @@ -442,7 +455,9 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { int get hashCode => Object.hash(runtimeType, chatRoom, const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); - @JsonKey(ignore: true) + /// Create a copy of ChatRoomState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => @@ -541,7 +556,10 @@ abstract class ChatRoomStateLoaded implements ChatRoomState { List get chatMessages; bool get isTyping; bool get isLoading; - @JsonKey(ignore: true) + + /// Create a copy of ChatRoomState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -563,6 +581,8 @@ class __$$ChatRoomStateErrorImplCopyWithImpl<$Res> $Res Function(_$ChatRoomStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of ChatRoomState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -602,7 +622,9 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of ChatRoomState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => @@ -695,7 +717,10 @@ abstract class ChatRoomStateError implements ChatRoomState { _$ChatRoomStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of ChatRoomState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart index 9a05918d..99fa9054 100644 --- a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart @@ -84,6 +84,9 @@ class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of ChatSelectState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -100,6 +103,9 @@ class __$$ChatSelectStateImplCopyWithImpl<$Res> __$$ChatSelectStateImplCopyWithImpl( _$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then) : super(_value, _then); + + /// Create a copy of ChatSelectState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -216,6 +222,9 @@ class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res> _$ChatSelectStateLoadingImpl _value, $Res Function(_$ChatSelectStateLoadingImpl) _then) : super(_value, _then); + + /// Create a copy of ChatSelectState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -334,6 +343,8 @@ class __$$ChatSelectStateErrorImplCopyWithImpl<$Res> $Res Function(_$ChatSelectStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of ChatSelectState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -373,7 +384,9 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of ChatSelectState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> @@ -461,7 +474,10 @@ abstract class ChatSelectStateError implements ChatSelectState { _$ChatSelectStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of ChatSelectState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } @@ -484,6 +500,8 @@ class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> $Res Function(_$ChatSelectStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of ChatSelectState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -530,7 +548,9 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); - @JsonKey(ignore: true) + /// Create a copy of ChatSelectState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> @@ -617,7 +637,10 @@ abstract class ChatSelectStateLoaded implements ChatSelectState { {required final List chatRooms}) = _$ChatSelectStateLoadedImpl; List get chatRooms; - @JsonKey(ignore: true) + + /// Create a copy of ChatSelectState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index c11a4652..9a1fb838 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -1,12 +1,11 @@ import 'dart:io'; - +import 'package:intl/intl.dart'; import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_bubble_widget.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:file_picker/file_picker.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ChatScreen extends StatefulWidget { @@ -60,7 +59,7 @@ class _ChatScreenState extends State { } else { return Scaffold( body: Center( - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), ); } @@ -145,16 +144,25 @@ class _ChatScreenState extends State { delegate: SliverChildBuilderDelegate( (context, index) { if (index < state.chatMessages.length) { - return ChatBubbleWidget( - sendTime: state.chatMessages[index].updatedAt, - text: state.chatMessages[index].data.trim(), - isCurrentUser: state.chatRoom.users['to_chat_user']!.id != state.chatMessages[index].authorId, - mediaData: state.chatMessages[index].mediaData ?? [], + return Column( + children: [ + if ((index + 1 != state.chatMessages.length && + DateTime.parse(state.chatMessages[index].updatedAt).day != + DateTime.parse(state.chatMessages[index + 1].updatedAt).day) || + index + 1 == state.chatMessages.length) + _messageDate(state.chatMessages[index].updatedAt), + ChatBubbleWidget( + sendTime: state.chatMessages[index].updatedAt, + text: state.chatMessages[index].data.trim(), + isCurrentUser: state.chatRoom.users['to_chat_user']!.id != state.chatMessages[index].authorId, + mediaData: state.chatMessages[index].mediaData ?? [], + ), + ], ); } else { return Padding( padding: const EdgeInsets.all(8), - child: Center(child: CupertinoActivityIndicator()), + child: Center(child: CircularProgressIndicator()), ); } }, @@ -311,4 +319,20 @@ class _ChatScreenState extends State { ), ); } + + _messageDate(String date) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Text( + DateFormat.MMMMd('RU').format( + DateTime.parse(date), + ), + style: const TextStyle( + height: 1, + color: Color(0xFF8393A1), + fontWeight: FontWeight.w500, + ), + ), + ); + } } diff --git a/lib/features/chat/presentation/pages/chat_select_screen.dart b/lib/features/chat/presentation/pages/chat_select_screen.dart index 74925e29..245b9f25 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen.dart @@ -4,7 +4,7 @@ import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/cha import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_entry_widget.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_search_bar_widget.dart'; -import 'package:flutter/cupertino.dart'; +import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; class ChatSelectScreen extends StatefulWidget { @@ -15,58 +15,62 @@ class ChatSelectScreen extends StatefulWidget { } class _ChatSelectScreenState extends State { + final ChatSelectCubit chatSelectCubit = sl(); final searchController = TextEditingController(); Widget build(BuildContext context) { - return BlocBuilder( - builder: (context, state) { - return Scaffold( - appBar: AppBar( - backgroundColor: Colors.white, - toolbarHeight: 0, - ), - body: NestedScrollView( - headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { - return [ - SliverPadding( - padding: const EdgeInsets.only(top: 8), - sliver: SliverAppBar( - automaticallyImplyLeading: false, - stretchTriggerOffset: 1, - scrolledUnderElevation: 0, - floating: true, - snap: true, - title: Padding( - padding: const EdgeInsets.only(top: 8), - child: ChatSearchBarWidget( - onSuffixIconTap: () => context.read().getChatRooms(), - onChanged: (query) { - if (query.length > 2) { - EasyDebounce.debounce( - 'searchChatRoom', - Duration(milliseconds: 300), - () => context.read().getChatRooms(query: query), - ); - } else { - context.read().getChatRooms(); - } - }, - controller: searchController, - fillColor: Color(0xFFF0F2F5), - hintText: "Поиск", - hintStyle: TextStyle( - color: Color(0xFF7B8794), + return BlocProvider( + create: (context) => chatSelectCubit..getChatRooms(), + child: BlocBuilder( + builder: (context, state) { + return Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + toolbarHeight: 0, + ), + body: NestedScrollView( + headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { + return [ + SliverPadding( + padding: const EdgeInsets.only(top: 8), + sliver: SliverAppBar( + automaticallyImplyLeading: false, + stretchTriggerOffset: 1, + scrolledUnderElevation: 0, + floating: true, + snap: true, + title: Padding( + padding: const EdgeInsets.only(top: 8), + child: ChatSearchBarWidget( + onSuffixIconTap: () => context.read().getChatRooms(), + onChanged: (query) { + if (query.length > 2) { + EasyDebounce.debounce( + 'searchChatRoom', + Duration(milliseconds: 300), + () => context.read().getChatRooms(query: query), + ); + } else { + context.read().getChatRooms(); + } + }, + controller: searchController, + fillColor: Color(0xFFF0F2F5), + hintText: "Поиск", + hintStyle: TextStyle( + color: Color(0xFF7B8794), + ), ), ), ), ), - ), - ]; - }, - body: stateBuilder(state), - ), - ); - }, + ]; + }, + body: stateBuilder(state), + ), + ); + }, + ), ); } @@ -74,7 +78,7 @@ class _ChatSelectScreenState extends State { if (state is ChatSelectStateLoading) { return Scaffold( body: Center( - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), ); } else if (state is ChatSelectStateLoaded) { @@ -87,7 +91,7 @@ class _ChatSelectScreenState extends State { } else { return Scaffold( body: Center( - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), ); } diff --git a/lib/features/diary/models/diary_model.freezed.dart b/lib/features/diary/models/diary_model.freezed.dart index a02a4621..ceabd5db 100644 --- a/lib/features/diary/models/diary_model.freezed.dart +++ b/lib/features/diary/models/diary_model.freezed.dart @@ -29,8 +29,12 @@ mixin _$DiaryModel { DateTime? get wakeup => throw _privateConstructorUsedError; DateTime? get retire => throw _privateConstructorUsedError; + /// Serializes this DiaryModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of DiaryModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $DiaryModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -64,6 +68,8 @@ class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of DiaryModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -112,6 +118,8 @@ class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> ) as $Val); } + /// Create a copy of DiaryModel + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $StateCopyWith<$Res> get state { @@ -151,6 +159,8 @@ class __$$DiaryModelImplCopyWithImpl<$Res> _$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then) : super(_value, _then); + /// Create a copy of DiaryModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -260,7 +270,7 @@ class _$DiaryModelImpl implements _DiaryModel { (identical(other.retire, retire) || other.retire == retire)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -273,7 +283,9 @@ class _$DiaryModelImpl implements _DiaryModel { wakeup, retire); - @JsonKey(ignore: true) + /// Create a copy of DiaryModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => @@ -317,8 +329,11 @@ abstract class _DiaryModel implements DiaryModel { DateTime? get wakeup; @override DateTime? get retire; + + /// Create a copy of DiaryModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/meal.freezed.dart b/lib/features/diary/models/meal.freezed.dart index 2c249b06..2bd6c478 100644 --- a/lib/features/diary/models/meal.freezed.dart +++ b/lib/features/diary/models/meal.freezed.dart @@ -28,8 +28,12 @@ mixin _$Meal { List get portions => throw _privateConstructorUsedError; List get photos => throw _privateConstructorUsedError; + /// Serializes this Meal to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Meal + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $MealCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -58,6 +62,8 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Meal + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -126,6 +132,8 @@ class __$$MealImplCopyWithImpl<$Res> __$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then) : super(_value, _then); + /// Create a copy of Meal + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -232,7 +240,7 @@ class _$MealImpl implements _Meal { const DeepCollectionEquality().equals(other._photos, _photos)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -244,7 +252,9 @@ class _$MealImpl implements _Meal { const DeepCollectionEquality().hash(_portions), const DeepCollectionEquality().hash(_photos)); - @JsonKey(ignore: true) + /// Create a copy of Meal + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$MealImplCopyWith<_$MealImpl> get copyWith => @@ -284,8 +294,11 @@ abstract class _Meal implements Meal { List get portions; @override List get photos; + + /// Create a copy of Meal + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$MealImplCopyWith<_$MealImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/photo.freezed.dart b/lib/features/diary/models/photo.freezed.dart index 2d9c70bd..8f5e0152 100644 --- a/lib/features/diary/models/photo.freezed.dart +++ b/lib/features/diary/models/photo.freezed.dart @@ -25,8 +25,12 @@ mixin _$Photo { String get originalName => throw _privateConstructorUsedError; String get path => throw _privateConstructorUsedError; + /// Serializes this Photo to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Photo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $PhotoCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -51,6 +55,8 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Photo + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -96,6 +102,8 @@ class __$$PhotoImplCopyWithImpl<$Res> _$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) : super(_value, _then); + /// Create a copy of Photo + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -155,11 +163,13 @@ class _$PhotoImpl implements _Photo { (identical(other.path, path) || other.path == path)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, originalName, path); - @JsonKey(ignore: true) + /// Create a copy of Photo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => @@ -188,8 +198,11 @@ abstract class _Photo implements Photo { String get originalName; @override String get path; + + /// Create a copy of Photo + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/portion.freezed.dart b/lib/features/diary/models/portion.freezed.dart index 77627c29..4bef02d4 100644 --- a/lib/features/diary/models/portion.freezed.dart +++ b/lib/features/diary/models/portion.freezed.dart @@ -26,8 +26,12 @@ mixin _$Portion { String get portion => throw _privateConstructorUsedError; bool get from_diet => throw _privateConstructorUsedError; + /// Serializes this Portion to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Portion + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $PortionCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -54,6 +58,8 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Portion + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -111,6 +117,8 @@ class __$$PortionImplCopyWithImpl<$Res> _$PortionImpl _value, $Res Function(_$PortionImpl) _then) : super(_value, _then); + /// Create a copy of Portion + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -189,12 +197,14 @@ class _$PortionImpl implements _Portion { other.from_diet == from_diet)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, product_name, quantity, portion, from_diet); - @JsonKey(ignore: true) + /// Create a copy of Portion + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$PortionImplCopyWith<_$PortionImpl> get copyWith => @@ -228,8 +238,11 @@ abstract class _Portion implements Portion { String get portion; @override bool get from_diet; + + /// Create a copy of Portion + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$PortionImplCopyWith<_$PortionImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/product.freezed.dart b/lib/features/diary/models/product.freezed.dart index d30ada33..610656fb 100644 --- a/lib/features/diary/models/product.freezed.dart +++ b/lib/features/diary/models/product.freezed.dart @@ -23,8 +23,12 @@ mixin _$Product { int get id => throw _privateConstructorUsedError; String get name => throw _privateConstructorUsedError; + /// Serializes this Product to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Product + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProductCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -46,6 +50,8 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Product + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -83,6 +89,8 @@ class __$$ProductImplCopyWithImpl<$Res> _$ProductImpl _value, $Res Function(_$ProductImpl) _then) : super(_value, _then); + /// Create a copy of Product + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -129,11 +137,13 @@ class _$ProductImpl implements _Product { (identical(other.name, name) || other.name == name)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, name); - @JsonKey(ignore: true) + /// Create a copy of Product + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProductImplCopyWith<_$ProductImpl> get copyWith => @@ -157,8 +167,11 @@ abstract class _Product implements Product { int get id; @override String get name; + + /// Create a copy of Product + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProductImplCopyWith<_$ProductImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/state.freezed.dart b/lib/features/diary/models/state.freezed.dart index 599ec29f..6b9c50fb 100644 --- a/lib/features/diary/models/state.freezed.dart +++ b/lib/features/diary/models/state.freezed.dart @@ -23,8 +23,12 @@ mixin _$State { bool get has_chosen_diet => throw _privateConstructorUsedError; bool get has_chosen_plan => throw _privateConstructorUsedError; + /// Serializes this State to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of State + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $StateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -46,6 +50,8 @@ class _$StateCopyWithImpl<$Res, $Val extends State> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of State + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -83,6 +89,8 @@ class __$$StateImplCopyWithImpl<$Res> _$StateImpl _value, $Res Function(_$StateImpl) _then) : super(_value, _then); + /// Create a copy of State + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -132,12 +140,14 @@ class _$StateImpl implements _State { other.has_chosen_plan == has_chosen_plan)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, has_chosen_diet, has_chosen_plan); - @JsonKey(ignore: true) + /// Create a copy of State + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$StateImplCopyWith<_$StateImpl> get copyWith => @@ -162,8 +172,11 @@ abstract class _State implements State { bool get has_chosen_diet; @override bool get has_chosen_plan; + + /// Create a copy of State + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$StateImplCopyWith<_$StateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/presentation/bloc/diary_state.freezed.dart b/lib/features/diary/presentation/bloc/diary_state.freezed.dart index 5a9bbc12..98d7019f 100644 --- a/lib/features/diary/presentation/bloc/diary_state.freezed.dart +++ b/lib/features/diary/presentation/bloc/diary_state.freezed.dart @@ -174,6 +174,9 @@ class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -190,6 +193,9 @@ class __$$DiaryStateImplCopyWithImpl<$Res> __$$DiaryStateImplCopyWithImpl( _$DiaryStateImpl _value, $Res Function(_$DiaryStateImpl) _then) : super(_value, _then); + + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -397,6 +403,8 @@ class __$$DiaryStateLoadingImplCopyWithImpl<$Res> $Res Function(_$DiaryStateLoadingImpl) _then) : super(_value, _then); + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -435,7 +443,9 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { @override int get hashCode => Object.hash(runtimeType, id); - @JsonKey(ignore: true) + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => @@ -611,7 +621,10 @@ abstract class DiaryStateLoading implements DiaryState { const factory DiaryStateLoading({final int? id}) = _$DiaryStateLoadingImpl; int? get id; - @JsonKey(ignore: true) + + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => throw _privateConstructorUsedError; } @@ -666,6 +679,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> $Res Function(_$DiaryStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -819,6 +834,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> )); } + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $DiaryModelCopyWith<$Res> get diary { @@ -827,6 +844,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> }); } + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $MealCopyWith<$Res> get currentMeal { @@ -835,6 +854,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> }); } + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get portionController { @@ -1100,7 +1121,9 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { const DeepCollectionEquality().hash(_chartDataCounted) ]); - @JsonKey(ignore: true) + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => @@ -1420,7 +1443,10 @@ abstract class DiaryStateLoaded implements DiaryState { bool get isLoading; bool get isAdded; List? get chartDataCounted; - @JsonKey(ignore: true) + + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1442,6 +1468,8 @@ class __$$DiaryStateErrorImplCopyWithImpl<$Res> _$DiaryStateErrorImpl _value, $Res Function(_$DiaryStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1481,7 +1509,9 @@ class _$DiaryStateErrorImpl implements DiaryStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => @@ -1658,7 +1688,10 @@ abstract class DiaryStateError implements DiaryState { _$DiaryStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart index 6c9f3a12..3c299e8c 100644 --- a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart +++ b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart @@ -6,7 +6,6 @@ import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; import 'package:eatvio_app/core/app_export.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; // ignore: must_be_immutable @@ -29,7 +28,7 @@ class DiaryRecommendationsScreen extends StatelessWidget { } else if (state is DiaryStateLoading) { return Scaffold( body: Center( - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), ); } else if (state is DiaryStateError) { diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index d79b4aab..a6c0df8d 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -15,7 +15,6 @@ import 'package:eatvio_app/widgets/custom_scale_element.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'; @@ -39,7 +38,7 @@ class DiaryScreen extends StatelessWidget { } else if (state is DiaryStateLoading) { return Scaffold( body: Center( - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), ); } else if (state is DiaryStateError) { diff --git a/lib/features/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart index 627c7a68..9262b194 100644 --- a/lib/features/diets/presentation/pages/about_diet_screen.dart +++ b/lib/features/diets/presentation/pages/about_diet_screen.dart @@ -6,7 +6,6 @@ import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/commen import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart'; import 'package:eatvio_app/locator_service.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; @@ -327,7 +326,7 @@ class _AboutDietScreenState extends State { if (state is CommentsStateLoading) Padding( padding: const EdgeInsets.all(32), - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), if (state is CommentsStateLoaded) CommentsWidget( diff --git a/lib/features/feed/models/comment_model.freezed.dart b/lib/features/feed/models/comment_model.freezed.dart index d294267f..4e520131 100644 --- a/lib/features/feed/models/comment_model.freezed.dart +++ b/lib/features/feed/models/comment_model.freezed.dart @@ -27,8 +27,12 @@ mixin _$CommentModel { @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; + /// Serializes this CommentModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of CommentModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $CommentModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -58,6 +62,8 @@ class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of CommentModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -81,6 +87,8 @@ class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> ) as $Val); } + /// Create a copy of CommentModel + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $LinksCopyWith<$Res> get links { @@ -89,6 +97,8 @@ class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> }); } + /// Create a copy of CommentModel + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $MetaCopyWith<$Res> get meta { @@ -125,6 +135,8 @@ class __$$CommentModelImplCopyWithImpl<$Res> _$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) : super(_value, _then); + /// Create a copy of CommentModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -192,12 +204,14 @@ class _$CommentModelImpl implements _CommentModel { (identical(other.meta, meta) || other.meta == meta)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_data), links, meta); - @JsonKey(ignore: true) + /// Create a copy of CommentModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => @@ -229,8 +243,11 @@ abstract class _CommentModel implements CommentModel { @override @JsonKey(name: "meta") Meta get meta; + + /// Create a copy of CommentModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => throw _privateConstructorUsedError; } @@ -254,8 +271,12 @@ mixin _$Comment { @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; + /// Serializes this Comment to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Comment + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $CommentCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -283,6 +304,8 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Comment + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -346,6 +369,8 @@ class __$$CommentImplCopyWithImpl<$Res> _$CommentImpl _value, $Res Function(_$CommentImpl) _then) : super(_value, _then); + /// Create a copy of Comment + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -449,7 +474,7 @@ class _$CommentImpl implements _Comment { other.createdAt == createdAt)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -460,7 +485,9 @@ class _$CommentImpl implements _Comment { const DeepCollectionEquality().hash(_childrenComments), createdAt); - @JsonKey(ignore: true) + /// Create a copy of Comment + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$CommentImplCopyWith<_$CommentImpl> get copyWith => @@ -506,8 +533,11 @@ abstract class _Comment implements Comment { @override @JsonKey(name: "created_at") DateTime get createdAt; + + /// Create a copy of Comment + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$CommentImplCopyWith<_$CommentImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/diets_pagination_model.freezed.dart b/lib/features/feed/models/diets_pagination_model.freezed.dart index 04835daf..15b651f3 100644 --- a/lib/features/feed/models/diets_pagination_model.freezed.dart +++ b/lib/features/feed/models/diets_pagination_model.freezed.dart @@ -27,8 +27,12 @@ mixin _$DietsPagination { @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; + /// Serializes this DietsPagination to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of DietsPagination + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $DietsPaginationCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -58,6 +62,8 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of DietsPagination + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -81,6 +87,8 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> ) as $Val); } + /// Create a copy of DietsPagination + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $LinksCopyWith<$Res> get links { @@ -89,6 +97,8 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> }); } + /// Create a copy of DietsPagination + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $MetaCopyWith<$Res> get meta { @@ -125,6 +135,8 @@ class __$$DietsPaginationImplCopyWithImpl<$Res> _$DietsPaginationImpl _value, $Res Function(_$DietsPaginationImpl) _then) : super(_value, _then); + /// Create a copy of DietsPagination + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -192,12 +204,14 @@ class _$DietsPaginationImpl implements _DietsPagination { (identical(other.meta, meta) || other.meta == meta)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_data), links, meta); - @JsonKey(ignore: true) + /// Create a copy of DietsPagination + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => @@ -230,8 +244,11 @@ abstract class _DietsPagination implements DietsPagination { @override @JsonKey(name: "meta") Meta get meta; + + /// Create a copy of DietsPagination + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => throw _privateConstructorUsedError; } @@ -268,8 +285,12 @@ mixin _$Diet { @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; + /// Serializes this Diet to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Diet + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $DietCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -307,6 +328,8 @@ class _$DietCopyWithImpl<$Res, $Val extends Diet> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Diet + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -375,6 +398,8 @@ class _$DietCopyWithImpl<$Res, $Val extends Diet> ) as $Val); } + /// Create a copy of Diet + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $DietTypeCopyWith<$Res> get type { @@ -383,6 +408,8 @@ class _$DietCopyWithImpl<$Res, $Val extends Diet> }); } + /// Create a copy of Diet + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $AuthorCopyWith<$Res> get author { @@ -427,6 +454,8 @@ class __$$DietImplCopyWithImpl<$Res> __$$DietImplCopyWithImpl(_$DietImpl _value, $Res Function(_$DietImpl) _then) : super(_value, _then); + /// Create a copy of Diet + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -590,7 +619,7 @@ class _$DietImpl implements _Diet { other.totalComments == totalComments)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -607,7 +636,9 @@ class _$DietImpl implements _Diet { totalViews, totalComments); - @JsonKey(ignore: true) + /// Create a copy of Diet + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DietImplCopyWith<_$DietImpl> get copyWith => @@ -676,8 +707,11 @@ abstract class _Diet implements Diet { @override @JsonKey(name: "total_comments") int get totalComments; + + /// Create a copy of Diet + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$DietImplCopyWith<_$DietImpl> get copyWith => throw _privateConstructorUsedError; } @@ -697,8 +731,12 @@ mixin _$Author { @JsonKey(name: "author_is_me") bool get authorIsMe => throw _privateConstructorUsedError; + /// Serializes this Author to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Author + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $AuthorCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -724,6 +762,8 @@ class _$AuthorCopyWithImpl<$Res, $Val extends Author> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Author + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -775,6 +815,8 @@ class __$$AuthorImplCopyWithImpl<$Res> _$AuthorImpl _value, $Res Function(_$AuthorImpl) _then) : super(_value, _then); + /// Create a copy of Author + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -849,12 +891,14 @@ class _$AuthorImpl implements _Author { other.authorIsMe == authorIsMe)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, authorSlug, authorName, authorProfileIcon, authorIsMe); - @JsonKey(ignore: true) + /// Create a copy of Author + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => @@ -891,8 +935,11 @@ abstract class _Author implements Author { @override @JsonKey(name: "author_is_me") bool get authorIsMe; + + /// Create a copy of Author + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => throw _privateConstructorUsedError; } @@ -912,8 +959,12 @@ mixin _$DailySchedule { @JsonKey(name: "quantity") int get quantity => throw _privateConstructorUsedError; + /// Serializes this DailySchedule to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of DailySchedule + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $DailyScheduleCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -941,6 +992,8 @@ class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of DailySchedule + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -993,6 +1046,8 @@ class __$$DailyScheduleImplCopyWithImpl<$Res> _$DailyScheduleImpl _value, $Res Function(_$DailyScheduleImpl) _then) : super(_value, _then); + /// Create a copy of DailySchedule + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1064,11 +1119,13 @@ class _$DailyScheduleImpl implements _DailySchedule { other.quantity == quantity)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, name, uniq, portion, quantity); - @JsonKey(ignore: true) + /// Create a copy of DailySchedule + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => @@ -1105,8 +1162,11 @@ abstract class _DailySchedule implements DailySchedule { @override @JsonKey(name: "quantity") int get quantity; + + /// Create a copy of DailySchedule + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1126,8 +1186,12 @@ mixin _$DietType { @JsonKey(name: "meat") bool? get meat => throw _privateConstructorUsedError; + /// Serializes this DietType to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of DietType + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $DietTypeCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1154,6 +1218,8 @@ class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of DietType + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1206,6 +1272,8 @@ class __$$DietTypeImplCopyWithImpl<$Res> _$DietTypeImpl _value, $Res Function(_$DietTypeImpl) _then) : super(_value, _then); + /// Create a copy of DietType + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1276,11 +1344,13 @@ class _$DietTypeImpl implements _DietType { (identical(other.meat, meat) || other.meat == meat)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, alko, veg, corb, meat); - @JsonKey(ignore: true) + /// Create a copy of DietType + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => @@ -1316,8 +1386,11 @@ abstract class _DietType implements DietType { @override @JsonKey(name: "meat") bool? get meat; + + /// Create a copy of DietType + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => throw _privateConstructorUsedError; } 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 08d5527a..89087373 100644 --- a/lib/features/feed/models/feed_blog_post_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_model.freezed.dart @@ -41,8 +41,12 @@ mixin _$FeedBlogPostModel { @JsonKey(name: "was_liked_by_me") bool get wasLikedByMe => throw _privateConstructorUsedError; + /// Serializes this FeedBlogPostModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of FeedBlogPostModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $FeedBlogPostModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -81,6 +85,8 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of FeedBlogPostModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -154,6 +160,8 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> ) as $Val); } + /// Create a copy of FeedBlogPostModel + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $AuthorCopyWith<$Res> get author { @@ -198,6 +206,8 @@ class __$$FeedBlogPostModelImplCopyWithImpl<$Res> $Res Function(_$FeedBlogPostModelImpl) _then) : super(_value, _then); + /// Create a copy of FeedBlogPostModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -360,7 +370,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { other.wasLikedByMe == wasLikedByMe)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -378,7 +388,9 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { totalComments, wasLikedByMe); - @JsonKey(ignore: true) + /// Create a copy of FeedBlogPostModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => @@ -446,8 +458,11 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel { @override @JsonKey(name: "was_liked_by_me") bool get wasLikedByMe; + + /// Create a copy of FeedBlogPostModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart b/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart index c680d82e..9bddceae 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart @@ -26,8 +26,12 @@ mixin _$FeedBlogPostSettingsModel { throw _privateConstructorUsedError; Meta get meta => throw _privateConstructorUsedError; + /// Serializes this FeedBlogPostSettingsModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of FeedBlogPostSettingsModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $FeedBlogPostSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -56,6 +60,8 @@ class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of FeedBlogPostSettingsModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -74,6 +80,8 @@ class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, ) as $Val); } + /// Create a copy of FeedBlogPostSettingsModel + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $MetaCopyWith<$Res> get meta { @@ -110,6 +118,8 @@ class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> $Res Function(_$FeedBlogPostSettingsModelImpl) _then) : super(_value, _then); + /// Create a copy of FeedBlogPostSettingsModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -169,12 +179,14 @@ class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { (identical(other.meta, meta) || other.meta == meta)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList), meta); - @JsonKey(ignore: true) + /// Create a copy of FeedBlogPostSettingsModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> @@ -203,8 +215,11 @@ abstract class _FeedBlogPostSettingsModel implements FeedBlogPostSettingsModel { List get feedBlogPostList; @override Meta get meta; + + /// Create a copy of FeedBlogPostSettingsModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/recipes_model.freezed.dart b/lib/features/feed/models/recipes_model.freezed.dart index 26cd55e3..9dd4f54e 100644 --- a/lib/features/feed/models/recipes_model.freezed.dart +++ b/lib/features/feed/models/recipes_model.freezed.dart @@ -45,8 +45,12 @@ mixin _$Recipes { int get viewsCount => throw _privateConstructorUsedError; Author get author => throw _privateConstructorUsedError; + /// Serializes this Recipes to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Recipes + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $RecipesCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -87,6 +91,8 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Recipes + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -180,6 +186,8 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> ) as $Val); } + /// Create a copy of Recipes + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $AuthorCopyWith<$Res> get author { @@ -227,6 +235,8 @@ class __$$RecipesImplCopyWithImpl<$Res> _$RecipesImpl _value, $Res Function(_$RecipesImpl) _then) : super(_value, _then); + /// Create a copy of Recipes + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -440,7 +450,7 @@ class _$RecipesImpl implements _Recipes { (identical(other.author, author) || other.author == author)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -462,7 +472,9 @@ class _$RecipesImpl implements _Recipes { viewsCount, author); - @JsonKey(ignore: true) + /// Create a copy of Recipes + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => @@ -539,8 +551,11 @@ abstract class _Recipes implements Recipes { int get viewsCount; @override Author get author; + + /// Create a copy of Recipes + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => throw _privateConstructorUsedError; } @@ -555,8 +570,12 @@ mixin _$Ingredient { String? get unit => throw _privateConstructorUsedError; String get portion => throw _privateConstructorUsedError; + /// Serializes this Ingredient to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Ingredient + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $IngredientCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -580,6 +599,8 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Ingredient + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -623,6 +644,8 @@ class __$$IngredientImplCopyWithImpl<$Res> _$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) : super(_value, _then); + /// Create a copy of Ingredient + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -678,11 +701,13 @@ class _$IngredientImpl implements _Ingredient { (identical(other.portion, portion) || other.portion == portion)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, name, unit, portion); - @JsonKey(ignore: true) + /// Create a copy of Ingredient + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => @@ -711,8 +736,11 @@ abstract class _Ingredient implements Ingredient { String? get unit; @override String get portion; + + /// Create a copy of Ingredient + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError; } @@ -726,8 +754,12 @@ mixin _$Step { String get image => throw _privateConstructorUsedError; String get description => throw _privateConstructorUsedError; + /// Serializes this Step to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Step + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $StepCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -749,6 +781,8 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Step + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -785,6 +819,8 @@ class __$$StepImplCopyWithImpl<$Res> __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) : super(_value, _then); + /// Create a copy of Step + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -832,11 +868,13 @@ class _$StepImpl implements _Step { other.description == description)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, image, description); - @JsonKey(ignore: true) + /// Create a copy of Step + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$StepImplCopyWith<_$StepImpl> get copyWith => @@ -861,8 +899,11 @@ abstract class _Step implements Step { String get image; @override String get description; + + /// Create a copy of Step + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$StepImplCopyWith<_$StepImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/recipes_pagination_model.freezed.dart b/lib/features/feed/models/recipes_pagination_model.freezed.dart index 2f0d43fb..ca8e9f92 100644 --- a/lib/features/feed/models/recipes_pagination_model.freezed.dart +++ b/lib/features/feed/models/recipes_pagination_model.freezed.dart @@ -23,8 +23,12 @@ mixin _$RecipesPagination { @JsonKey(name: 'data') List get recipesList => throw _privateConstructorUsedError; + /// Serializes this RecipesPagination to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of RecipesPagination + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $RecipesPaginationCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -48,6 +52,8 @@ class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of RecipesPagination + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -81,6 +87,8 @@ class __$$RecipesPaginationImplCopyWithImpl<$Res> $Res Function(_$RecipesPaginationImpl) _then) : super(_value, _then); + /// Create a copy of RecipesPagination + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -128,12 +136,14 @@ class _$RecipesPaginationImpl implements _RecipesPagination { .equals(other._recipesList, _recipesList)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_recipesList)); - @JsonKey(ignore: true) + /// Create a copy of RecipesPagination + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => @@ -159,8 +169,11 @@ abstract class _RecipesPagination implements RecipesPagination { @override @JsonKey(name: 'data') List get recipesList; + + /// Create a copy of RecipesPagination + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart index 58463106..c3b582ce 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart @@ -84,6 +84,9 @@ class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of CommentsState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -100,6 +103,9 @@ class __$$CommentsStateImplCopyWithImpl<$Res> __$$CommentsStateImplCopyWithImpl( _$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) : super(_value, _then); + + /// Create a copy of CommentsState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -214,6 +220,9 @@ class __$$CommentsStateLoadingImplCopyWithImpl<$Res> __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, $Res Function(_$CommentsStateLoadingImpl) _then) : super(_value, _then); + + /// Create a copy of CommentsState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -334,6 +343,8 @@ class __$$CommentsStateLoadedImplCopyWithImpl<$Res> $Res Function(_$CommentsStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of CommentsState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -352,6 +363,8 @@ class __$$CommentsStateLoadedImplCopyWithImpl<$Res> )); } + /// Create a copy of CommentsState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $CommentModelCopyWith<$Res> get comment { @@ -388,7 +401,9 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { @override int get hashCode => Object.hash(runtimeType, comment, replyId); - @JsonKey(ignore: true) + /// Create a copy of CommentsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => @@ -477,7 +492,10 @@ abstract class CommentsStateLoaded implements CommentsState { CommentModel get comment; int? get replyId; - @JsonKey(ignore: true) + + /// Create a copy of CommentsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -499,6 +517,8 @@ class __$$CommentsStateErrorImplCopyWithImpl<$Res> $Res Function(_$CommentsStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of CommentsState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -538,7 +558,9 @@ class _$CommentsStateErrorImpl implements CommentsStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of CommentsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => @@ -625,7 +647,10 @@ abstract class CommentsStateError implements CommentsState { _$CommentsStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of CommentsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } 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..dd30f73d 100644 --- a/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart @@ -84,6 +84,9 @@ class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of DietsState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -100,6 +103,9 @@ class __$$DietsStateImplCopyWithImpl<$Res> __$$DietsStateImplCopyWithImpl( _$DietsStateImpl _value, $Res Function(_$DietsStateImpl) _then) : super(_value, _then); + + /// Create a copy of DietsState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -214,6 +220,9 @@ class __$$DietsStateLoadingImplCopyWithImpl<$Res> __$$DietsStateLoadingImplCopyWithImpl(_$DietsStateLoadingImpl _value, $Res Function(_$DietsStateLoadingImpl) _then) : super(_value, _then); + + /// Create a copy of DietsState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -333,6 +342,8 @@ class __$$DietsStateLoadedImplCopyWithImpl<$Res> $Res Function(_$DietsStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of DietsState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -346,6 +357,8 @@ class __$$DietsStateLoadedImplCopyWithImpl<$Res> )); } + /// Create a copy of DietsState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $DietsPaginationCopyWith<$Res> get diets { @@ -379,7 +392,9 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { @override int get hashCode => Object.hash(runtimeType, diets); - @JsonKey(ignore: true) + /// Create a copy of DietsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => @@ -466,7 +481,10 @@ abstract class DietsStateLoaded implements DietsState { _$DietsStateLoadedImpl; DietsPagination get diets; - @JsonKey(ignore: true) + + /// Create a copy of DietsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -488,6 +506,8 @@ class __$$DietsStateErrorImplCopyWithImpl<$Res> _$DietsStateErrorImpl _value, $Res Function(_$DietsStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of DietsState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -527,7 +547,9 @@ class _$DietsStateErrorImpl implements DietsStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of DietsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => @@ -614,7 +636,10 @@ abstract class DietsStateError implements DietsState { _$DietsStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of DietsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart b/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart index 779dcdb5..70cb30d4 100644 --- a/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart @@ -87,6 +87,9 @@ class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of FeedState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -103,6 +106,9 @@ class __$$FeedStateImplCopyWithImpl<$Res> __$$FeedStateImplCopyWithImpl( _$FeedStateImpl _value, $Res Function(_$FeedStateImpl) _then) : super(_value, _then); + + /// Create a copy of FeedState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -221,6 +227,9 @@ class __$$FeedStateLoadingImplCopyWithImpl<$Res> __$$FeedStateLoadingImplCopyWithImpl(_$FeedStateLoadingImpl _value, $Res Function(_$FeedStateLoadingImpl) _then) : super(_value, _then); + + /// Create a copy of FeedState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -342,6 +351,8 @@ class __$$FeedStateLoadedImplCopyWithImpl<$Res> _$FeedStateLoadedImpl _value, $Res Function(_$FeedStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of FeedState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -401,7 +412,9 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList), isLoading); - @JsonKey(ignore: true) + /// Create a copy of FeedState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => @@ -494,7 +507,10 @@ abstract class FeedStateLoaded implements FeedState { List get feedBlogPostList; bool get isLoading; - @JsonKey(ignore: true) + + /// Create a copy of FeedState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -516,6 +532,8 @@ class __$$FeedStateErrorImplCopyWithImpl<$Res> _$FeedStateErrorImpl _value, $Res Function(_$FeedStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of FeedState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -555,7 +573,9 @@ class _$FeedStateErrorImpl implements FeedStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of FeedState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => @@ -646,7 +666,10 @@ abstract class FeedStateError implements FeedState { _$FeedStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of FeedState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart index 75eb5b07..93bcf399 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart @@ -8,6 +8,10 @@ class RecipesCubit extends Cubit { final FeedRepository feedRepository; final RecipeRepository recipeRepository; Set _selectedTags = {}; + int currentPage = 1; + late int lastPage; + bool isLoading = false; + String? _query; RecipesCubit({ required this.feedRepository, @@ -18,6 +22,7 @@ class RecipesCubit extends Cubit { String? query, }) async { try { + _query = query; final recipesList = await feedRepository.getRecipes( tags: _selectedTags.toList(), query: query, @@ -28,12 +33,42 @@ class RecipesCubit extends Cubit { recipesTags: recipesTags, selectedTags: _selectedTags, selectedTagsCounter: _selectedTags.length, + isLoading: isLoading, )); } catch (e) { emit(RecipesState.error(errorMessage: e.toString())); } } + loadNextPage() async { + if (currentPage < lastPage && !isLoading) { + isLoading = true; + + emit((state as RecipesStateLoaded).copyWith(isLoading: isLoading)); + + try { + if (currentPage < lastPage) { + currentPage++; + final recipesList = await feedRepository.getRecipes( + page: currentPage, + tags: _selectedTags.toList(), + query: _query, + ); + isLoading = false; + emit((state as RecipesStateLoaded).copyWith( + recipesList: [ + ...(state as RecipesStateLoaded).recipesList, + ...recipesList, + ], + isLoading: isLoading, + )); + } + } catch (e) { + emit(RecipesState.error(errorMessage: e.toString())); + } + } + } + updateTags(RecipeTag tag) { _selectedTags.contains(tag.id) ? _selectedTags.remove(tag.id) : _selectedTags.add(tag.id); emit((state as RecipesStateLoaded).copyWith( diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart index 1c2e7f23..dc6dcb66 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart @@ -15,6 +15,7 @@ abstract class RecipesState with _$RecipesState { required List recipesTags, required Set selectedTags, required int selectedTagsCounter, + required bool isLoading, }) = RecipesStateLoaded; const factory RecipesState.error({ diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart index fc7fe0c6..34100adb 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart @@ -24,7 +24,8 @@ mixin _$RecipesState { List recipesList, List recipesTags, Set selectedTags, - int selectedTagsCounter) + int selectedTagsCounter, + bool isLoading) loaded, required TResult Function(String errorMessage) error, }) => @@ -34,7 +35,7 @@ mixin _$RecipesState { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter)? + Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) => @@ -44,7 +45,7 @@ mixin _$RecipesState { TResult Function()? $default, { TResult Function()? loading, TResult Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter)? + Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -93,6 +94,9 @@ class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of RecipesState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -109,6 +113,9 @@ class __$$RecipesStateImplCopyWithImpl<$Res> __$$RecipesStateImplCopyWithImpl( _$RecipesStateImpl _value, $Res Function(_$RecipesStateImpl) _then) : super(_value, _then); + + /// Create a copy of RecipesState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -139,7 +146,8 @@ class _$RecipesStateImpl implements _RecipesState { List recipesList, List recipesTags, Set selectedTags, - int selectedTagsCounter) + int selectedTagsCounter, + bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { @@ -152,7 +160,7 @@ class _$RecipesStateImpl implements _RecipesState { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter)? + Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { @@ -165,7 +173,7 @@ class _$RecipesStateImpl implements _RecipesState { TResult Function()? $default, { TResult Function()? loading, TResult Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter)? + Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -232,6 +240,9 @@ class __$$RecipesStateLoadingImplCopyWithImpl<$Res> __$$RecipesStateLoadingImplCopyWithImpl(_$RecipesStateLoadingImpl _value, $Res Function(_$RecipesStateLoadingImpl) _then) : super(_value, _then); + + /// Create a copy of RecipesState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -263,7 +274,8 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { List recipesList, List recipesTags, Set selectedTags, - int selectedTagsCounter) + int selectedTagsCounter, + bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { @@ -276,7 +288,7 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter)? + Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { @@ -289,7 +301,7 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult Function()? $default, { TResult Function()? loading, TResult Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter)? + Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -352,7 +364,8 @@ abstract class _$$RecipesStateLoadedImplCopyWith<$Res> { {List recipesList, List recipesTags, Set selectedTags, - int selectedTagsCounter}); + int selectedTagsCounter, + bool isLoading}); } /// @nodoc @@ -363,6 +376,8 @@ class __$$RecipesStateLoadedImplCopyWithImpl<$Res> $Res Function(_$RecipesStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of RecipesState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -370,6 +385,7 @@ class __$$RecipesStateLoadedImplCopyWithImpl<$Res> Object? recipesTags = null, Object? selectedTags = null, Object? selectedTagsCounter = null, + Object? isLoading = null, }) { return _then(_$RecipesStateLoadedImpl( recipesList: null == recipesList @@ -388,6 +404,10 @@ class __$$RecipesStateLoadedImplCopyWithImpl<$Res> ? _value.selectedTagsCounter : selectedTagsCounter // ignore: cast_nullable_to_non_nullable as int, + isLoading: null == isLoading + ? _value.isLoading + : isLoading // ignore: cast_nullable_to_non_nullable + as bool, )); } } @@ -399,7 +419,8 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { {required final List recipesList, required final List recipesTags, required final Set selectedTags, - required this.selectedTagsCounter}) + required this.selectedTagsCounter, + required this.isLoading}) : _recipesList = recipesList, _recipesTags = recipesTags, _selectedTags = selectedTags; @@ -430,10 +451,12 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { @override final int selectedTagsCounter; + @override + final bool isLoading; @override String toString() { - return 'RecipesState.loaded(recipesList: $recipesList, recipesTags: $recipesTags, selectedTags: $selectedTags, selectedTagsCounter: $selectedTagsCounter)'; + return 'RecipesState.loaded(recipesList: $recipesList, recipesTags: $recipesTags, selectedTags: $selectedTags, selectedTagsCounter: $selectedTagsCounter, isLoading: $isLoading)'; } @override @@ -448,7 +471,9 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { const DeepCollectionEquality() .equals(other._selectedTags, _selectedTags) && (identical(other.selectedTagsCounter, selectedTagsCounter) || - other.selectedTagsCounter == selectedTagsCounter)); + other.selectedTagsCounter == selectedTagsCounter) && + (identical(other.isLoading, isLoading) || + other.isLoading == isLoading)); } @override @@ -457,9 +482,12 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { const DeepCollectionEquality().hash(_recipesList), const DeepCollectionEquality().hash(_recipesTags), const DeepCollectionEquality().hash(_selectedTags), - selectedTagsCounter); + selectedTagsCounter, + isLoading); - @JsonKey(ignore: true) + /// Create a copy of RecipesState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => @@ -475,11 +503,13 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { List recipesList, List recipesTags, Set selectedTags, - int selectedTagsCounter) + int selectedTagsCounter, + bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { - return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter); + return loaded( + recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); } @override @@ -488,12 +518,12 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter)? + Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call( - recipesList, recipesTags, selectedTags, selectedTagsCounter); + recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); } @override @@ -502,14 +532,14 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { TResult Function()? $default, { TResult Function()? loading, TResult Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter)? + Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { if (loaded != null) { - return loaded( - recipesList, recipesTags, selectedTags, selectedTagsCounter); + return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter, + isLoading); } return orElse(); } @@ -557,13 +587,18 @@ abstract class RecipesStateLoaded implements RecipesState { {required final List recipesList, required final List recipesTags, required final Set selectedTags, - required final int selectedTagsCounter}) = _$RecipesStateLoadedImpl; + required final int selectedTagsCounter, + required final bool isLoading}) = _$RecipesStateLoadedImpl; List get recipesList; List get recipesTags; Set get selectedTags; int get selectedTagsCounter; - @JsonKey(ignore: true) + bool get isLoading; + + /// Create a copy of RecipesState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -585,6 +620,8 @@ class __$$RecipesStateErrorImplCopyWithImpl<$Res> $Res Function(_$RecipesStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of RecipesState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -624,7 +661,9 @@ class _$RecipesStateErrorImpl implements RecipesStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of RecipesState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => @@ -640,7 +679,8 @@ class _$RecipesStateErrorImpl implements RecipesStateError { List recipesList, List recipesTags, Set selectedTags, - int selectedTagsCounter) + int selectedTagsCounter, + bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { @@ -653,7 +693,7 @@ class _$RecipesStateErrorImpl implements RecipesStateError { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter)? + Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { @@ -666,7 +706,7 @@ class _$RecipesStateErrorImpl implements RecipesStateError { TResult Function()? $default, { TResult Function()? loading, TResult Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter)? + Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -720,7 +760,10 @@ abstract class RecipesStateError implements RecipesState { _$RecipesStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of RecipesState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/pages/feed_screen.dart b/lib/features/feed/presentation/pages/feed_screen.dart index 2200a6e6..e5f1afa6 100644 --- a/lib/features/feed/presentation/pages/feed_screen.dart +++ b/lib/features/feed/presentation/pages/feed_screen.dart @@ -10,11 +10,12 @@ import 'package:eatvio_app/features/feed/presentation/widgets/diets_widget.dart' import 'package:eatvio_app/features/feed/presentation/widgets/recipes_widget.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/tags_modal_widget.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +final bucket = PageStorageBucket(); + class FeedScreen extends StatefulWidget { const FeedScreen({super.key}); @@ -32,11 +33,25 @@ class _FeedScreenState extends State { @override void initState() { - blogPostsScrollController.addListener(_onScroll); + blogPostsScrollController.addListener(_onScrollBlogPosts); + recipesScrollController.addListener(_onScrollBlogRecipes); + dietsScrollController.addListener(_onScrollBlogDiets); super.initState(); } - _onScroll() { + _onScrollBlogPosts() { + if (blogPostsScrollController.offset >= blogPostsScrollController.position.maxScrollExtent && !blogPostsScrollController.position.outOfRange) { + context.read().loadNextPage(); + } + } + + _onScrollBlogRecipes() { + if (blogPostsScrollController.offset >= blogPostsScrollController.position.maxScrollExtent && !blogPostsScrollController.position.outOfRange) { + context.read().loadNextPage(); + } + } + + _onScrollBlogDiets() { if (blogPostsScrollController.offset >= blogPostsScrollController.position.maxScrollExtent && !blogPostsScrollController.position.outOfRange) { context.read().loadNextPage(); } @@ -45,6 +60,8 @@ class _FeedScreenState extends State { @override void dispose() { blogPostsScrollController.dispose(); + recipesScrollController.dispose(); + dietsScrollController.dispose(); super.dispose(); } @@ -89,7 +106,11 @@ class _FeedScreenState extends State { ), backgroundColor: Colors.grey.shade200, body: NestedScrollView( - controller: blogPostsScrollController, + controller: _selectedChipIndex == 0 + ? blogPostsScrollController + : _selectedChipIndex == 1 + ? recipesScrollController + : dietsScrollController, headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { return [ SliverAppBar( @@ -139,10 +160,10 @@ class _FeedScreenState extends State { return ListView.separated( padding: EdgeInsets.symmetric(vertical: 8), shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: BouncingScrollPhysics(), itemBuilder: (context, index) { if (index == state.feedBlogPostList.length) { - return CupertinoActivityIndicator(); + return CircularProgressIndicator(); } return BlogPostWidget(feedBlogPostModel: state.feedBlogPostList[index]); }, @@ -165,7 +186,7 @@ class _FeedScreenState extends State { return Scaffold( backgroundColor: Colors.grey.shade200, body: Center( - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), ); } @@ -206,7 +227,7 @@ class _FeedScreenState extends State { return Scaffold( backgroundColor: Colors.grey.shade200, body: Center( - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), ); } @@ -247,7 +268,7 @@ class _FeedScreenState extends State { return Scaffold( backgroundColor: Colors.grey.shade200, body: Center( - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), ); } @@ -319,6 +340,7 @@ class _FeedScreenState extends State { switch (_selectedChipIndex) { case 1: context.read().loadRecipesList(query: query); + break; } }, ); diff --git a/lib/features/feed/repositories/feed_repository.dart b/lib/features/feed/repositories/feed_repository.dart index 1696d948..e90f2680 100644 --- a/lib/features/feed/repositories/feed_repository.dart +++ b/lib/features/feed/repositories/feed_repository.dart @@ -11,7 +11,7 @@ class FeedRepository { Future getFeedBlogPosts({int page = 1}) async { try { - return (await feedService.getBlocPostList(page: page)); + return (await feedService.getBlogPostList(page: page)); } catch (e) { rethrow; } @@ -20,11 +20,13 @@ class FeedRepository { Future> getRecipes({ String? query, List? tags, + int page = 1 }) async { try { return (await feedService.getRecipes( query: query, tags: tags, + page: page, )) .recipesList; } catch (e) { @@ -32,9 +34,9 @@ class FeedRepository { } } - Future getDiets() async { + Future getDiets({int page = 1}) async { try { - return (await feedService.getDiets()); + return (await feedService.getDiets(page: page)); } catch (e) { rethrow; } diff --git a/lib/features/feed/services/feed_service.dart b/lib/features/feed/services/feed_service.dart index 8a75d44f..db211b26 100644 --- a/lib/features/feed/services/feed_service.dart +++ b/lib/features/feed/services/feed_service.dart @@ -12,18 +12,21 @@ abstract class FeedService { factory FeedService(Dio dio, {String baseUrl}) = _FeedService; @GET('/api/blogPosts/index?page={page}') - Future getBlocPostList({ + Future getBlogPostList({ @Path() required int page, }); @GET('/api/recipes/index') Future getRecipes({ + @Path() required int page, @Query('filters[tags][tags.id][\$in][]') required List? tags, @Query('filters[title][\$contains]') required String? query, }); @GET('/api/diets/index') - Future getDiets(); + Future getDiets({ + @Path() required int page, + }); @GET('/api/blogPosts/{id}/comments/show') Future getBlogPostComments({ diff --git a/lib/features/feed/services/feed_service.g.dart b/lib/features/feed/services/feed_service.g.dart index bc3f08f1..3f513034 100644 --- a/lib/features/feed/services/feed_service.g.dart +++ b/lib/features/feed/services/feed_service.g.dart @@ -22,7 +22,7 @@ class _FeedService implements FeedService { final ParseErrorLogger? errorLogger; @override - Future getBlocPostList({required int page}) async { + Future getBlogPostList({required int page}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -56,6 +56,7 @@ class _FeedService implements FeedService { @override Future getRecipes({ + required int page, List? tags, String? query, }) async { @@ -95,7 +96,7 @@ class _FeedService implements FeedService { } @override - Future getDiets() async { + Future getDiets({required int page}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; diff --git a/lib/features/profile/models/profile_model.dart b/lib/features/profile/models/profile_model.dart index b6e47d6a..d209e6d7 100644 --- a/lib/features/profile/models/profile_model.dart +++ b/lib/features/profile/models/profile_model.dart @@ -1,110 +1,57 @@ import 'package:freezed_annotation/freezed_annotation.dart'; + part 'profile_model.freezed.dart'; + part 'profile_model.g.dart'; @freezed class ProfileModel with _$ProfileModel { const factory ProfileModel({ - @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, + @JsonKey(name: "id") required int id, + @JsonKey(name: "name") required String name, + @JsonKey(name: "email") required String email, + @JsonKey(name: "email_verified_at") DateTime? emailVerifiedAt, + @JsonKey(name: "created_at") DateTime? createdAt, + @JsonKey(name: "updated_at") DateTime? updatedAt, + @JsonKey(name: "is_public_profile") required bool isPublicProfile, + @JsonKey(name: "slug") required String slug, + @JsonKey(name: "profile_photo_url") required String profilePhotoUrl, }) = _ProfileModel; factory ProfileModel.fromJson(Map json) => _$ProfileModelFromJson(json); } @freezed -class Circumference with _$Circumference { - const factory Circumference({ - @JsonKey(name: "id") required int id, - @JsonKey(name: "user_id") required int userId, - @JsonKey(name: "chest_circumference") required int chestCircumference, - @JsonKey(name: "waist_circumference") required int waistCircumference, - @JsonKey(name: "hip_circumference") required int hipCircumference, - @JsonKey(name: "created_at") required DateTime createdAt, - @JsonKey(name: "updated_at") required DateTime updatedAt, - }) = _Circumference; - - factory Circumference.fromJson(Map json) => _$CircumferenceFromJson(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 dynamic emailVerifiedAt, - @JsonKey(name: "two_factor_confirmed_at") required dynamic twoFactorConfirmedAt, - @JsonKey(name: "current_team_id") required dynamic currentTeamId, - @JsonKey(name: "profile_photo_path") 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") 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, +class ProfileDetailsModel with _$ProfileDetailsModel { + const factory ProfileDetailsModel({ @JsonKey(name: "first_name") required String firstName, @JsonKey(name: "last_name") required String lastName, - @JsonKey(name: "birthdate") required DateTime birthdate, + @JsonKey(name: "birthdate") required String 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: "weight") required double 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: "has_hypo") required bool hasHypo, + @JsonKey(name: "has_hyper") required bool 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: "created_at") DateTime? createdAt, + @JsonKey(name: "updated_at") DateTime? updatedAt, + @JsonKey(name: "is_mood_fillable") required bool isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") required bool isBedtimeFillable, @JsonKey(name: "activity_coefficient") required double activityCoefficient, - }) = _UserDetails; + }) = _ProfileDetailsModel; - factory UserDetails.fromJson(Map json) => _$UserDetailsFromJson(json); -} - -@freezed -class ChartPointModel with _$ChartPointModel { - const factory ChartPointModel({ - @JsonKey(name: "id") required int id, - @JsonKey(name: "user_id") required int userId, - @JsonKey(name: "weight") required double weight, - @JsonKey(name: "bmi") required double bmi, - @JsonKey(name: "created_at") required DateTime createdAt, - @JsonKey(name: "updated_at") required DateTime updatedAt, - }) = _ChartPointModel; - - factory ChartPointModel.fromJson(Map json) => _$ChartPointModelFromJson(json); + factory ProfileDetailsModel.fromJson(Map json) => _$ProfileDetailsModelFromJson(json); } diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index da499a03..94b860a3 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -20,29 +20,31 @@ ProfileModel _$ProfileModelFromJson(Map json) { /// @nodoc mixin _$ProfileModel { - @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; + @JsonKey(name: "id") + int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") + String get name => throw _privateConstructorUsedError; + @JsonKey(name: "email") + String get email => throw _privateConstructorUsedError; + @JsonKey(name: "email_verified_at") + DateTime? get emailVerifiedAt => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") + DateTime? get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") + DateTime? get updatedAt => throw _privateConstructorUsedError; + @JsonKey(name: "is_public_profile") + bool get isPublicProfile => throw _privateConstructorUsedError; + @JsonKey(name: "slug") + String get slug => throw _privateConstructorUsedError; + @JsonKey(name: "profile_photo_url") + String get profilePhotoUrl => throw _privateConstructorUsedError; + /// Serializes this ProfileModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ProfileModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProfileModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -54,19 +56,15 @@ abstract class $ProfileModelCopyWith<$Res> { _$ProfileModelCopyWithImpl<$Res, ProfileModel>; @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; + {@JsonKey(name: "id") int id, + @JsonKey(name: "name") String name, + @JsonKey(name: "email") String email, + @JsonKey(name: "email_verified_at") DateTime? emailVerifiedAt, + @JsonKey(name: "created_at") DateTime? createdAt, + @JsonKey(name: "updated_at") DateTime? updatedAt, + @JsonKey(name: "is_public_profile") bool isPublicProfile, + @JsonKey(name: "slug") String slug, + @JsonKey(name: "profile_photo_url") String profilePhotoUrl}); } /// @nodoc @@ -79,79 +77,60 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProfileModel + /// with the given fields replaced by the non-null parameter values. @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, + Object? id = null, + Object? name = null, + Object? email = null, + Object? emailVerifiedAt = freezed, + Object? createdAt = freezed, + Object? updatedAt = freezed, + Object? isPublicProfile = null, + Object? slug = null, + Object? profilePhotoUrl = 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, + 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: freezed == emailVerifiedAt + ? _value.emailVerifiedAt + : emailVerifiedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + createdAt: freezed == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + updatedAt: freezed == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + isPublicProfile: null == isPublicProfile + ? _value.isPublicProfile + : isPublicProfile // ignore: cast_nullable_to_non_nullable + as bool, + slug: null == slug + ? _value.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + profilePhotoUrl: null == profilePhotoUrl + ? _value.profilePhotoUrl + : profilePhotoUrl // ignore: cast_nullable_to_non_nullable + as String, ) 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 @@ -163,21 +142,15 @@ abstract class _$$ProfileModelImplCopyWith<$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; + {@JsonKey(name: "id") int id, + @JsonKey(name: "name") String name, + @JsonKey(name: "email") String email, + @JsonKey(name: "email_verified_at") DateTime? emailVerifiedAt, + @JsonKey(name: "created_at") DateTime? createdAt, + @JsonKey(name: "updated_at") DateTime? updatedAt, + @JsonKey(name: "is_public_profile") bool isPublicProfile, + @JsonKey(name: "slug") String slug, + @JsonKey(name: "profile_photo_url") String profilePhotoUrl}); } /// @nodoc @@ -188,61 +161,58 @@ class __$$ProfileModelImplCopyWithImpl<$Res> _$ProfileModelImpl _value, $Res Function(_$ProfileModelImpl) _then) : super(_value, _then); + /// Create a copy of ProfileModel + /// with the given fields replaced by the non-null parameter values. @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, + Object? id = null, + Object? name = null, + Object? email = null, + Object? emailVerifiedAt = freezed, + Object? createdAt = freezed, + Object? updatedAt = freezed, + Object? isPublicProfile = null, + Object? slug = null, + Object? profilePhotoUrl = null, }) { return _then(_$ProfileModelImpl( - 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, + 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: freezed == emailVerifiedAt + ? _value.emailVerifiedAt + : emailVerifiedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + createdAt: freezed == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + updatedAt: freezed == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + isPublicProfile: null == isPublicProfile + ? _value.isPublicProfile + : isPublicProfile // ignore: cast_nullable_to_non_nullable + as bool, + slug: null == slug + ? _value.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + profilePhotoUrl: null == profilePhotoUrl + ? _value.profilePhotoUrl + : profilePhotoUrl // ignore: cast_nullable_to_non_nullable + as String, )); } } @@ -251,114 +221,50 @@ class __$$ProfileModelImplCopyWithImpl<$Res> @JsonSerializable() class _$ProfileModelImpl implements _ProfileModel { const _$ProfileModelImpl( - {@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; + {@JsonKey(name: "id") required this.id, + @JsonKey(name: "name") required this.name, + @JsonKey(name: "email") required this.email, + @JsonKey(name: "email_verified_at") this.emailVerifiedAt, + @JsonKey(name: "created_at") this.createdAt, + @JsonKey(name: "updated_at") this.updatedAt, + @JsonKey(name: "is_public_profile") required this.isPublicProfile, + @JsonKey(name: "slug") required this.slug, + @JsonKey(name: "profile_photo_url") required this.profilePhotoUrl}); factory _$ProfileModelImpl.fromJson(Map json) => _$$ProfileModelImplFromJson(json); @override - @JsonKey(name: "user") - final User user; - final List _chartPoints; + @JsonKey(name: "id") + final int id; @override - @JsonKey(name: "chartPoints") - List get chartPoints { - if (_chartPoints is EqualUnmodifiableListView) return _chartPoints; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_chartPoints); - } - + @JsonKey(name: "name") + final String name; @override - @JsonKey(name: "userDetails") - final UserDetails userDetails; - final List _circumferences; + @JsonKey(name: "email") + final String email; @override - @JsonKey(name: "circumferences") - List get circumferences { - if (_circumferences is EqualUnmodifiableListView) return _circumferences; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_circumferences); - } - - final List _finishedPlans; + @JsonKey(name: "email_verified_at") + final DateTime? emailVerifiedAt; @override - @JsonKey(name: "finishedPlans") - List get finishedPlans { - if (_finishedPlans is EqualUnmodifiableListView) return _finishedPlans; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_finishedPlans); - } - - final List _rejectedPlans; + @JsonKey(name: "created_at") + final DateTime? createdAt; @override - @JsonKey(name: "rejectedPlans") - List get rejectedPlans { - if (_rejectedPlans is EqualUnmodifiableListView) return _rejectedPlans; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_rejectedPlans); - } - - final List _startedPlan; + @JsonKey(name: "updated_at") + final DateTime? updatedAt; @override - @JsonKey(name: "startedPlan") - List get startedPlan { - if (_startedPlan is EqualUnmodifiableListView) return _startedPlan; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_startedPlan); - } - - final List _paidPlan; + @JsonKey(name: "is_public_profile") + final bool isPublicProfile; @override - @JsonKey(name: "paidPlan") - List get paidPlan { - if (_paidPlan is EqualUnmodifiableListView) return _paidPlan; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_paidPlan); - } - - final List _requestedPlan; + @JsonKey(name: "slug") + final String slug; @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); - } + @JsonKey(name: "profile_photo_url") + final String profilePhotoUrl; @override String toString() { - return 'ProfileModel(user: $user, chartPoints: $chartPoints, userDetails: $userDetails, circumferences: $circumferences, finishedPlans: $finishedPlans, rejectedPlans: $rejectedPlans, startedPlan: $startedPlan, paidPlan: $paidPlan, requestedPlan: $requestedPlan, initedPlan: $initedPlan)'; + return 'ProfileModel(id: $id, name: $name, email: $email, emailVerifiedAt: $emailVerifiedAt, createdAt: $createdAt, updatedAt: $updatedAt, isPublicProfile: $isPublicProfile, slug: $slug, profilePhotoUrl: $profilePhotoUrl)'; } @override @@ -366,42 +272,30 @@ class _$ProfileModelImpl implements _ProfileModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileModelImpl && - (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)); + (identical(other.id, id) || other.id == id) && + (identical(other.name, name) || other.name == name) && + (identical(other.email, email) || other.email == email) && + (identical(other.emailVerifiedAt, emailVerifiedAt) || + other.emailVerifiedAt == emailVerifiedAt) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.isPublicProfile, isPublicProfile) || + other.isPublicProfile == isPublicProfile) && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || + other.profilePhotoUrl == profilePhotoUrl)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @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)); + int get hashCode => Object.hash(runtimeType, id, name, email, emailVerifiedAt, + createdAt, updatedAt, isPublicProfile, slug, profilePhotoUrl); - @JsonKey(ignore: true) + /// Create a copy of ProfileModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => @@ -417,803 +311,19 @@ class _$ProfileModelImpl implements _ProfileModel { abstract class _ProfileModel implements ProfileModel { const factory _ProfileModel( - {@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}) = _$ProfileModelImpl; - - factory _ProfileModel.fromJson(Map json) = - _$ProfileModelImpl.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) - _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => - throw _privateConstructorUsedError; -} - -Circumference _$CircumferenceFromJson(Map json) { - return _Circumference.fromJson(json); -} - -/// @nodoc -mixin _$Circumference { - @JsonKey(name: "id") - int get id => throw _privateConstructorUsedError; - @JsonKey(name: "user_id") - int get userId => throw _privateConstructorUsedError; - @JsonKey(name: "chest_circumference") - int get chestCircumference => throw _privateConstructorUsedError; - @JsonKey(name: "waist_circumference") - int get waistCircumference => throw _privateConstructorUsedError; - @JsonKey(name: "hip_circumference") - int get hipCircumference => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") - DateTime get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") - DateTime get updatedAt => throw _privateConstructorUsedError; - - Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $CircumferenceCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $CircumferenceCopyWith<$Res> { - factory $CircumferenceCopyWith( - Circumference value, $Res Function(Circumference) then) = - _$CircumferenceCopyWithImpl<$Res, Circumference>; - @useResult - $Res call( - {@JsonKey(name: "id") int id, - @JsonKey(name: "user_id") int userId, - @JsonKey(name: "chest_circumference") int chestCircumference, - @JsonKey(name: "waist_circumference") int waistCircumference, - @JsonKey(name: "hip_circumference") int hipCircumference, - @JsonKey(name: "created_at") DateTime createdAt, - @JsonKey(name: "updated_at") DateTime updatedAt}); -} - -/// @nodoc -class _$CircumferenceCopyWithImpl<$Res, $Val extends Circumference> - implements $CircumferenceCopyWith<$Res> { - _$CircumferenceCopyWithImpl(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? chestCircumference = null, - Object? waistCircumference = null, - Object? hipCircumference = null, - Object? createdAt = null, - Object? updatedAt = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - userId: null == userId - ? _value.userId - : userId // ignore: cast_nullable_to_non_nullable - as int, - chestCircumference: null == chestCircumference - ? _value.chestCircumference - : chestCircumference // ignore: cast_nullable_to_non_nullable - as int, - waistCircumference: null == waistCircumference - ? _value.waistCircumference - : waistCircumference // ignore: cast_nullable_to_non_nullable - as int, - hipCircumference: null == hipCircumference - ? _value.hipCircumference - : hipCircumference // ignore: cast_nullable_to_non_nullable - as int, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$CircumferenceImplCopyWith<$Res> - implements $CircumferenceCopyWith<$Res> { - factory _$$CircumferenceImplCopyWith( - _$CircumferenceImpl value, $Res Function(_$CircumferenceImpl) then) = - __$$CircumferenceImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: "id") int id, - @JsonKey(name: "user_id") int userId, - @JsonKey(name: "chest_circumference") int chestCircumference, - @JsonKey(name: "waist_circumference") int waistCircumference, - @JsonKey(name: "hip_circumference") int hipCircumference, - @JsonKey(name: "created_at") DateTime createdAt, - @JsonKey(name: "updated_at") DateTime updatedAt}); -} - -/// @nodoc -class __$$CircumferenceImplCopyWithImpl<$Res> - extends _$CircumferenceCopyWithImpl<$Res, _$CircumferenceImpl> - implements _$$CircumferenceImplCopyWith<$Res> { - __$$CircumferenceImplCopyWithImpl( - _$CircumferenceImpl _value, $Res Function(_$CircumferenceImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? userId = null, - Object? chestCircumference = null, - Object? waistCircumference = null, - Object? hipCircumference = null, - Object? createdAt = null, - Object? updatedAt = null, - }) { - return _then(_$CircumferenceImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - userId: null == userId - ? _value.userId - : userId // ignore: cast_nullable_to_non_nullable - as int, - chestCircumference: null == chestCircumference - ? _value.chestCircumference - : chestCircumference // ignore: cast_nullable_to_non_nullable - as int, - waistCircumference: null == waistCircumference - ? _value.waistCircumference - : waistCircumference // ignore: cast_nullable_to_non_nullable - as int, - hipCircumference: null == hipCircumference - ? _value.hipCircumference - : hipCircumference // ignore: cast_nullable_to_non_nullable - as int, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$CircumferenceImpl implements _Circumference { - const _$CircumferenceImpl( - {@JsonKey(name: "id") required this.id, - @JsonKey(name: "user_id") required this.userId, - @JsonKey(name: "chest_circumference") required this.chestCircumference, - @JsonKey(name: "waist_circumference") required this.waistCircumference, - @JsonKey(name: "hip_circumference") required this.hipCircumference, - @JsonKey(name: "created_at") required this.createdAt, - @JsonKey(name: "updated_at") required this.updatedAt}); - - factory _$CircumferenceImpl.fromJson(Map json) => - _$$CircumferenceImplFromJson(json); - - @override - @JsonKey(name: "id") - final int id; - @override - @JsonKey(name: "user_id") - final int userId; - @override - @JsonKey(name: "chest_circumference") - final int chestCircumference; - @override - @JsonKey(name: "waist_circumference") - final int waistCircumference; - @override - @JsonKey(name: "hip_circumference") - final int hipCircumference; - @override - @JsonKey(name: "created_at") - final DateTime createdAt; - @override - @JsonKey(name: "updated_at") - final DateTime updatedAt; - - @override - String toString() { - return 'Circumference(id: $id, userId: $userId, chestCircumference: $chestCircumference, waistCircumference: $waistCircumference, hipCircumference: $hipCircumference, createdAt: $createdAt, updatedAt: $updatedAt)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CircumferenceImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.userId, userId) || other.userId == userId) && - (identical(other.chestCircumference, chestCircumference) || - other.chestCircumference == chestCircumference) && - (identical(other.waistCircumference, waistCircumference) || - other.waistCircumference == waistCircumference) && - (identical(other.hipCircumference, hipCircumference) || - other.hipCircumference == hipCircumference) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); - } - - @JsonKey(ignore: true) - @override - int get hashCode => Object.hash(runtimeType, id, userId, chestCircumference, - waistCircumference, hipCircumference, createdAt, updatedAt); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$CircumferenceImplCopyWith<_$CircumferenceImpl> get copyWith => - __$$CircumferenceImplCopyWithImpl<_$CircumferenceImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CircumferenceImplToJson( - this, - ); - } -} - -abstract class _Circumference implements Circumference { - const factory _Circumference( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "user_id") required final int userId, - @JsonKey(name: "chest_circumference") - required final int chestCircumference, - @JsonKey(name: "waist_circumference") - required final int waistCircumference, - @JsonKey(name: "hip_circumference") required final int hipCircumference, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") - required final DateTime updatedAt}) = _$CircumferenceImpl; - - factory _Circumference.fromJson(Map json) = - _$CircumferenceImpl.fromJson; - - @override - @JsonKey(name: "id") - int get id; - @override - @JsonKey(name: "user_id") - int get userId; - @override - @JsonKey(name: "chest_circumference") - int get chestCircumference; - @override - @JsonKey(name: "waist_circumference") - int get waistCircumference; - @override - @JsonKey(name: "hip_circumference") - int get hipCircumference; - @override - @JsonKey(name: "created_at") - DateTime get createdAt; - @override - @JsonKey(name: "updated_at") - DateTime get updatedAt; - @override - @JsonKey(ignore: true) - _$$CircumferenceImplCopyWith<_$CircumferenceImpl> 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") - dynamic 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") dynamic 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 = freezed, - Object? twoFactorConfirmedAt = freezed, - Object? currentTeamId = freezed, - Object? profilePhotoPath = freezed, - Object? createdAt = null, - Object? updatedAt = null, - Object? isConsultant = null, - Object? isPublicProfile = null, - Object? slug = null, - Object? userSettingsId = freezed, - Object? profilePhotoUrl = freezed, - 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: freezed == emailVerifiedAt - ? _value.emailVerifiedAt - : emailVerifiedAt // ignore: cast_nullable_to_non_nullable - as dynamic, - 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: freezed == 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: freezed == 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") dynamic 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 = freezed, - Object? twoFactorConfirmedAt = freezed, - Object? currentTeamId = freezed, - Object? profilePhotoPath = freezed, - Object? createdAt = null, - Object? updatedAt = null, - Object? isConsultant = null, - Object? isPublicProfile = null, - Object? slug = null, - Object? userSettingsId = freezed, - Object? profilePhotoUrl = freezed, - 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: freezed == emailVerifiedAt - ? _value.emailVerifiedAt - : emailVerifiedAt // ignore: cast_nullable_to_non_nullable - as dynamic, - 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: freezed == 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: freezed == 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") 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") 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 dynamic 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) && - const DeepCollectionEquality() - .equals(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, - const DeepCollectionEquality().hash(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 dynamic 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") 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: "email_verified_at") final DateTime? emailVerifiedAt, + @JsonKey(name: "created_at") final DateTime? createdAt, + @JsonKey(name: "updated_at") final DateTime? updatedAt, + @JsonKey(name: "is_public_profile") required final bool isPublicProfile, @JsonKey(name: "slug") required final String slug, - @JsonKey(name: "user_settings_id") required final dynamic userSettingsId, - @JsonKey(name: "profile_photo_url") final String? profilePhotoUrl, - @JsonKey(name: "detailz") - required final UserDetails detailz}) = _$UserImpl; + @JsonKey(name: "profile_photo_url") + required final String profilePhotoUrl}) = _$ProfileModelImpl; - factory _User.fromJson(Map json) = _$UserImpl.fromJson; + factory _ProfileModel.fromJson(Map json) = + _$ProfileModelImpl.fromJson; @override @JsonKey(name: "id") @@ -1226,62 +336,43 @@ abstract class _User implements User { String get email; @override @JsonKey(name: "email_verified_at") - dynamic 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; + DateTime? get emailVerifiedAt; @override @JsonKey(name: "created_at") - DateTime get createdAt; + DateTime? get createdAt; @override @JsonKey(name: "updated_at") - DateTime get updatedAt; - @override - @JsonKey(name: "is_consultant") - int get isConsultant; + DateTime? get updatedAt; @override @JsonKey(name: "is_public_profile") - int get isPublicProfile; + bool 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; + String get profilePhotoUrl; + + /// Create a copy of ProfileModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(name: "detailz") - UserDetails get detailz; - @override - @JsonKey(ignore: true) - _$$UserImplCopyWith<_$UserImpl> get copyWith => + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => throw _privateConstructorUsedError; } -UserDetails _$UserDetailsFromJson(Map json) { - return _UserDetails.fromJson(json); +ProfileDetailsModel _$ProfileDetailsModelFromJson(Map json) { + return _ProfileDetailsModel.fromJson(json); } /// @nodoc -mixin _$UserDetails { - @JsonKey(name: "id") - int get id => throw _privateConstructorUsedError; - @JsonKey(name: "user_id") - int get userId => throw _privateConstructorUsedError; +mixin _$ProfileDetailsModel { @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; + String get birthdate => throw _privateConstructorUsedError; @JsonKey(name: "gender") String get gender => throw _privateConstructorUsedError; @JsonKey(name: "country") @@ -1291,7 +382,7 @@ mixin _$UserDetails { @JsonKey(name: "lang") String get lang => throw _privateConstructorUsedError; @JsonKey(name: "weight") - int get weight => throw _privateConstructorUsedError; + double get weight => throw _privateConstructorUsedError; @JsonKey(name: "height") int get height => throw _privateConstructorUsedError; @JsonKey(name: "chest_circumference") @@ -1305,9 +396,9 @@ mixin _$UserDetails { @JsonKey(name: "blood_pressure_down") int get bloodPressureDown => throw _privateConstructorUsedError; @JsonKey(name: "has_hypo") - int get hasHypo => throw _privateConstructorUsedError; + bool get hasHypo => throw _privateConstructorUsedError; @JsonKey(name: "has_hyper") - int get hasHyper => throw _privateConstructorUsedError; + bool get hasHyper => throw _privateConstructorUsedError; @JsonKey(name: "about_alergy") String get aboutAlergy => throw _privateConstructorUsedError; @JsonKey(name: "about_taking_pils") @@ -1321,75 +412,77 @@ mixin _$UserDetails { @JsonKey(name: "additional_info") String get additionalInfo => throw _privateConstructorUsedError; @JsonKey(name: "created_at") - DateTime get createdAt => throw _privateConstructorUsedError; + DateTime? get createdAt => throw _privateConstructorUsedError; @JsonKey(name: "updated_at") - DateTime get updatedAt => throw _privateConstructorUsedError; + DateTime? get updatedAt => throw _privateConstructorUsedError; @JsonKey(name: "is_mood_fillable") - int get isMoodFillable => throw _privateConstructorUsedError; + bool get isMoodFillable => throw _privateConstructorUsedError; @JsonKey(name: "is_bedtime_fillable") - int get isBedtimeFillable => throw _privateConstructorUsedError; + bool get isBedtimeFillable => throw _privateConstructorUsedError; @JsonKey(name: "activity_coefficient") double get activityCoefficient => throw _privateConstructorUsedError; + /// Serializes this ProfileDetailsModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $UserDetailsCopyWith get copyWith => + + /// Create a copy of ProfileDetailsModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ProfileDetailsModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $UserDetailsCopyWith<$Res> { - factory $UserDetailsCopyWith( - UserDetails value, $Res Function(UserDetails) then) = - _$UserDetailsCopyWithImpl<$Res, UserDetails>; +abstract class $ProfileDetailsModelCopyWith<$Res> { + factory $ProfileDetailsModelCopyWith( + ProfileDetailsModel value, $Res Function(ProfileDetailsModel) then) = + _$ProfileDetailsModelCopyWithImpl<$Res, ProfileDetailsModel>; @useResult $Res call( - {@JsonKey(name: "id") int id, - @JsonKey(name: "user_id") int userId, - @JsonKey(name: "first_name") String firstName, + {@JsonKey(name: "first_name") String firstName, @JsonKey(name: "last_name") String lastName, - @JsonKey(name: "birthdate") DateTime birthdate, + @JsonKey(name: "birthdate") String 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: "weight") double 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: "has_hypo") bool hasHypo, + @JsonKey(name: "has_hyper") bool 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: "created_at") DateTime? createdAt, + @JsonKey(name: "updated_at") DateTime? updatedAt, + @JsonKey(name: "is_mood_fillable") bool isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") bool isBedtimeFillable, @JsonKey(name: "activity_coefficient") double activityCoefficient}); } /// @nodoc -class _$UserDetailsCopyWithImpl<$Res, $Val extends UserDetails> - implements $UserDetailsCopyWith<$Res> { - _$UserDetailsCopyWithImpl(this._value, this._then); +class _$ProfileDetailsModelCopyWithImpl<$Res, $Val extends ProfileDetailsModel> + implements $ProfileDetailsModelCopyWith<$Res> { + _$ProfileDetailsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProfileDetailsModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? id = null, - Object? userId = null, Object? firstName = null, Object? lastName = null, Object? birthdate = null, @@ -1412,21 +505,13 @@ class _$UserDetailsCopyWithImpl<$Res, $Val extends UserDetails> Object? favoriteFoods = null, Object? unfavoriteFoods = null, Object? additionalInfo = null, - Object? createdAt = null, - Object? updatedAt = null, + Object? createdAt = freezed, + Object? updatedAt = freezed, 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 @@ -1438,7 +523,7 @@ class _$UserDetailsCopyWithImpl<$Res, $Val extends UserDetails> birthdate: null == birthdate ? _value.birthdate : birthdate // ignore: cast_nullable_to_non_nullable - as DateTime, + as String, gender: null == gender ? _value.gender : gender // ignore: cast_nullable_to_non_nullable @@ -1458,7 +543,7 @@ class _$UserDetailsCopyWithImpl<$Res, $Val extends UserDetails> weight: null == weight ? _value.weight : weight // ignore: cast_nullable_to_non_nullable - as int, + as double, height: null == height ? _value.height : height // ignore: cast_nullable_to_non_nullable @@ -1486,11 +571,11 @@ class _$UserDetailsCopyWithImpl<$Res, $Val extends UserDetails> hasHypo: null == hasHypo ? _value.hasHypo : hasHypo // ignore: cast_nullable_to_non_nullable - as int, + as bool, hasHyper: null == hasHyper ? _value.hasHyper : hasHyper // ignore: cast_nullable_to_non_nullable - as int, + as bool, aboutAlergy: null == aboutAlergy ? _value.aboutAlergy : aboutAlergy // ignore: cast_nullable_to_non_nullable @@ -1515,22 +600,22 @@ class _$UserDetailsCopyWithImpl<$Res, $Val extends UserDetails> ? _value.additionalInfo : additionalInfo // ignore: cast_nullable_to_non_nullable as String, - createdAt: null == createdAt + createdAt: freezed == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt + as DateTime?, + updatedAt: freezed == updatedAt ? _value.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, + as DateTime?, isMoodFillable: null == isMoodFillable ? _value.isMoodFillable : isMoodFillable // ignore: cast_nullable_to_non_nullable - as int, + as bool, isBedtimeFillable: null == isBedtimeFillable ? _value.isBedtimeFillable : isBedtimeFillable // ignore: cast_nullable_to_non_nullable - as int, + as bool, activityCoefficient: null == activityCoefficient ? _value.activityCoefficient : activityCoefficient // ignore: cast_nullable_to_non_nullable @@ -1540,58 +625,56 @@ class _$UserDetailsCopyWithImpl<$Res, $Val extends UserDetails> } /// @nodoc -abstract class _$$UserDetailsImplCopyWith<$Res> - implements $UserDetailsCopyWith<$Res> { - factory _$$UserDetailsImplCopyWith( - _$UserDetailsImpl value, $Res Function(_$UserDetailsImpl) then) = - __$$UserDetailsImplCopyWithImpl<$Res>; +abstract class _$$ProfileDetailsModelImplCopyWith<$Res> + implements $ProfileDetailsModelCopyWith<$Res> { + factory _$$ProfileDetailsModelImplCopyWith(_$ProfileDetailsModelImpl value, + $Res Function(_$ProfileDetailsModelImpl) then) = + __$$ProfileDetailsModelImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey(name: "id") int id, - @JsonKey(name: "user_id") int userId, - @JsonKey(name: "first_name") String firstName, + {@JsonKey(name: "first_name") String firstName, @JsonKey(name: "last_name") String lastName, - @JsonKey(name: "birthdate") DateTime birthdate, + @JsonKey(name: "birthdate") String 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: "weight") double 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: "has_hypo") bool hasHypo, + @JsonKey(name: "has_hyper") bool 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: "created_at") DateTime? createdAt, + @JsonKey(name: "updated_at") DateTime? updatedAt, + @JsonKey(name: "is_mood_fillable") bool isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") bool 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) +class __$$ProfileDetailsModelImplCopyWithImpl<$Res> + extends _$ProfileDetailsModelCopyWithImpl<$Res, _$ProfileDetailsModelImpl> + implements _$$ProfileDetailsModelImplCopyWith<$Res> { + __$$ProfileDetailsModelImplCopyWithImpl(_$ProfileDetailsModelImpl _value, + $Res Function(_$ProfileDetailsModelImpl) _then) : super(_value, _then); + /// Create a copy of ProfileDetailsModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ - Object? id = null, - Object? userId = null, Object? firstName = null, Object? lastName = null, Object? birthdate = null, @@ -1614,21 +697,13 @@ class __$$UserDetailsImplCopyWithImpl<$Res> Object? favoriteFoods = null, Object? unfavoriteFoods = null, Object? additionalInfo = null, - Object? createdAt = null, - Object? updatedAt = null, + Object? createdAt = freezed, + Object? updatedAt = freezed, 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, + return _then(_$ProfileDetailsModelImpl( firstName: null == firstName ? _value.firstName : firstName // ignore: cast_nullable_to_non_nullable @@ -1640,7 +715,7 @@ class __$$UserDetailsImplCopyWithImpl<$Res> birthdate: null == birthdate ? _value.birthdate : birthdate // ignore: cast_nullable_to_non_nullable - as DateTime, + as String, gender: null == gender ? _value.gender : gender // ignore: cast_nullable_to_non_nullable @@ -1660,7 +735,7 @@ class __$$UserDetailsImplCopyWithImpl<$Res> weight: null == weight ? _value.weight : weight // ignore: cast_nullable_to_non_nullable - as int, + as double, height: null == height ? _value.height : height // ignore: cast_nullable_to_non_nullable @@ -1688,11 +763,11 @@ class __$$UserDetailsImplCopyWithImpl<$Res> hasHypo: null == hasHypo ? _value.hasHypo : hasHypo // ignore: cast_nullable_to_non_nullable - as int, + as bool, hasHyper: null == hasHyper ? _value.hasHyper : hasHyper // ignore: cast_nullable_to_non_nullable - as int, + as bool, aboutAlergy: null == aboutAlergy ? _value.aboutAlergy : aboutAlergy // ignore: cast_nullable_to_non_nullable @@ -1717,22 +792,22 @@ class __$$UserDetailsImplCopyWithImpl<$Res> ? _value.additionalInfo : additionalInfo // ignore: cast_nullable_to_non_nullable as String, - createdAt: null == createdAt + createdAt: freezed == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt + as DateTime?, + updatedAt: freezed == updatedAt ? _value.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, + as DateTime?, isMoodFillable: null == isMoodFillable ? _value.isMoodFillable : isMoodFillable // ignore: cast_nullable_to_non_nullable - as int, + as bool, isBedtimeFillable: null == isBedtimeFillable ? _value.isBedtimeFillable : isBedtimeFillable // ignore: cast_nullable_to_non_nullable - as int, + as bool, activityCoefficient: null == activityCoefficient ? _value.activityCoefficient : activityCoefficient // ignore: cast_nullable_to_non_nullable @@ -1743,11 +818,9 @@ class __$$UserDetailsImplCopyWithImpl<$Res> /// @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, +class _$ProfileDetailsModelImpl implements _ProfileDetailsModel { + const _$ProfileDetailsModelImpl( + {@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, @@ -1769,22 +842,16 @@ class _$UserDetailsImpl implements _UserDetails { @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: "created_at") this.createdAt, + @JsonKey(name: "updated_at") this.updatedAt, @JsonKey(name: "is_mood_fillable") required this.isMoodFillable, @JsonKey(name: "is_bedtime_fillable") required this.isBedtimeFillable, @JsonKey(name: "activity_coefficient") required this.activityCoefficient}); - factory _$UserDetailsImpl.fromJson(Map json) => - _$$UserDetailsImplFromJson(json); + factory _$ProfileDetailsModelImpl.fromJson(Map json) => + _$$ProfileDetailsModelImplFromJson(json); - @override - @JsonKey(name: "id") - final int id; - @override - @JsonKey(name: "user_id") - final int userId; @override @JsonKey(name: "first_name") final String firstName; @@ -1793,7 +860,7 @@ class _$UserDetailsImpl implements _UserDetails { final String lastName; @override @JsonKey(name: "birthdate") - final DateTime birthdate; + final String birthdate; @override @JsonKey(name: "gender") final String gender; @@ -1808,7 +875,7 @@ class _$UserDetailsImpl implements _UserDetails { final String lang; @override @JsonKey(name: "weight") - final int weight; + final double weight; @override @JsonKey(name: "height") final int height; @@ -1829,10 +896,10 @@ class _$UserDetailsImpl implements _UserDetails { final int bloodPressureDown; @override @JsonKey(name: "has_hypo") - final int hasHypo; + final bool hasHypo; @override @JsonKey(name: "has_hyper") - final int hasHyper; + final bool hasHyper; @override @JsonKey(name: "about_alergy") final String aboutAlergy; @@ -1853,32 +920,30 @@ class _$UserDetailsImpl implements _UserDetails { final String additionalInfo; @override @JsonKey(name: "created_at") - final DateTime createdAt; + final DateTime? createdAt; @override @JsonKey(name: "updated_at") - final DateTime updatedAt; + final DateTime? updatedAt; @override @JsonKey(name: "is_mood_fillable") - final int isMoodFillable; + final bool isMoodFillable; @override @JsonKey(name: "is_bedtime_fillable") - final int isBedtimeFillable; + final bool 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)'; + return 'ProfileDetailsModel(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) && + other is _$ProfileDetailsModelImpl && (identical(other.firstName, firstName) || other.firstName == firstName) && (identical(other.lastName, lastName) || @@ -1928,12 +993,10 @@ class _$UserDetailsImpl implements _UserDetails { other.activityCoefficient == activityCoefficient)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hashAll([ runtimeType, - id, - userId, firstName, lastName, birthdate, @@ -1963,32 +1026,33 @@ class _$UserDetailsImpl implements _UserDetails { activityCoefficient ]); - @JsonKey(ignore: true) + /// Create a copy of ProfileDetailsModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UserDetailsImplCopyWith<_$UserDetailsImpl> get copyWith => - __$$UserDetailsImplCopyWithImpl<_$UserDetailsImpl>(this, _$identity); + _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => + __$$ProfileDetailsModelImplCopyWithImpl<_$ProfileDetailsModelImpl>( + this, _$identity); @override Map toJson() { - return _$$UserDetailsImplToJson( + return _$$ProfileDetailsModelImplToJson( 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, +abstract class _ProfileDetailsModel implements ProfileDetailsModel { + const factory _ProfileDetailsModel( + {@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: "birthdate") required final String 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: "weight") required final double weight, @JsonKey(name: "height") required final int height, @JsonKey(name: "chest_circumference") required final int chestCircumference, @@ -1998,8 +1062,8 @@ abstract class _UserDetails implements UserDetails { @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: "has_hypo") required final bool hasHypo, + @JsonKey(name: "has_hyper") required final bool hasHyper, @JsonKey(name: "about_alergy") required final String aboutAlergy, @JsonKey(name: "about_taking_pils") required final String aboutTakingPils, @JsonKey(name: "about_sport_hobbies") @@ -2007,23 +1071,17 @@ abstract class _UserDetails implements UserDetails { @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: "created_at") final DateTime? createdAt, + @JsonKey(name: "updated_at") final DateTime? updatedAt, + @JsonKey(name: "is_mood_fillable") required final bool isMoodFillable, @JsonKey(name: "is_bedtime_fillable") - required final int isBedtimeFillable, + required final bool isBedtimeFillable, @JsonKey(name: "activity_coefficient") - required final double activityCoefficient}) = _$UserDetailsImpl; + required final double activityCoefficient}) = _$ProfileDetailsModelImpl; - factory _UserDetails.fromJson(Map json) = - _$UserDetailsImpl.fromJson; + factory _ProfileDetailsModel.fromJson(Map json) = + _$ProfileDetailsModelImpl.fromJson; - @override - @JsonKey(name: "id") - int get id; - @override - @JsonKey(name: "user_id") - int get userId; @override @JsonKey(name: "first_name") String get firstName; @@ -2032,7 +1090,7 @@ abstract class _UserDetails implements UserDetails { String get lastName; @override @JsonKey(name: "birthdate") - DateTime get birthdate; + String get birthdate; @override @JsonKey(name: "gender") String get gender; @@ -2047,7 +1105,7 @@ abstract class _UserDetails implements UserDetails { String get lang; @override @JsonKey(name: "weight") - int get weight; + double get weight; @override @JsonKey(name: "height") int get height; @@ -2068,10 +1126,10 @@ abstract class _UserDetails implements UserDetails { int get bloodPressureDown; @override @JsonKey(name: "has_hypo") - int get hasHypo; + bool get hasHypo; @override @JsonKey(name: "has_hyper") - int get hasHyper; + bool get hasHyper; @override @JsonKey(name: "about_alergy") String get aboutAlergy; @@ -2092,284 +1150,24 @@ abstract class _UserDetails implements UserDetails { String get additionalInfo; @override @JsonKey(name: "created_at") - DateTime get createdAt; + DateTime? get createdAt; @override @JsonKey(name: "updated_at") - DateTime get updatedAt; + DateTime? get updatedAt; @override @JsonKey(name: "is_mood_fillable") - int get isMoodFillable; + bool get isMoodFillable; @override @JsonKey(name: "is_bedtime_fillable") - int get isBedtimeFillable; + bool get isBedtimeFillable; @override @JsonKey(name: "activity_coefficient") double get activityCoefficient; + + /// Create a copy of ProfileDetailsModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) - _$$UserDetailsImplCopyWith<_$UserDetailsImpl> get copyWith => - throw _privateConstructorUsedError; -} - -ChartPointModel _$ChartPointModelFromJson(Map json) { - return _ChartPointModel.fromJson(json); -} - -/// @nodoc -mixin _$ChartPointModel { - @JsonKey(name: "id") - int get id => throw _privateConstructorUsedError; - @JsonKey(name: "user_id") - int get userId => throw _privateConstructorUsedError; - @JsonKey(name: "weight") - double get weight => throw _privateConstructorUsedError; - @JsonKey(name: "bmi") - double get bmi => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") - DateTime get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") - DateTime get updatedAt => throw _privateConstructorUsedError; - - Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $ChartPointModelCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ChartPointModelCopyWith<$Res> { - factory $ChartPointModelCopyWith( - ChartPointModel value, $Res Function(ChartPointModel) then) = - _$ChartPointModelCopyWithImpl<$Res, ChartPointModel>; - @useResult - $Res call( - {@JsonKey(name: "id") int id, - @JsonKey(name: "user_id") int userId, - @JsonKey(name: "weight") double weight, - @JsonKey(name: "bmi") double bmi, - @JsonKey(name: "created_at") DateTime createdAt, - @JsonKey(name: "updated_at") DateTime updatedAt}); -} - -/// @nodoc -class _$ChartPointModelCopyWithImpl<$Res, $Val extends ChartPointModel> - implements $ChartPointModelCopyWith<$Res> { - _$ChartPointModelCopyWithImpl(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? weight = null, - Object? bmi = null, - Object? createdAt = null, - Object? updatedAt = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - userId: null == userId - ? _value.userId - : userId // ignore: cast_nullable_to_non_nullable - as int, - weight: null == weight - ? _value.weight - : weight // ignore: cast_nullable_to_non_nullable - as double, - bmi: null == bmi - ? _value.bmi - : bmi // ignore: cast_nullable_to_non_nullable - as double, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$ChartPointModelImplCopyWith<$Res> - implements $ChartPointModelCopyWith<$Res> { - factory _$$ChartPointModelImplCopyWith(_$ChartPointModelImpl value, - $Res Function(_$ChartPointModelImpl) then) = - __$$ChartPointModelImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: "id") int id, - @JsonKey(name: "user_id") int userId, - @JsonKey(name: "weight") double weight, - @JsonKey(name: "bmi") double bmi, - @JsonKey(name: "created_at") DateTime createdAt, - @JsonKey(name: "updated_at") DateTime updatedAt}); -} - -/// @nodoc -class __$$ChartPointModelImplCopyWithImpl<$Res> - extends _$ChartPointModelCopyWithImpl<$Res, _$ChartPointModelImpl> - implements _$$ChartPointModelImplCopyWith<$Res> { - __$$ChartPointModelImplCopyWithImpl( - _$ChartPointModelImpl _value, $Res Function(_$ChartPointModelImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? userId = null, - Object? weight = null, - Object? bmi = null, - Object? createdAt = null, - Object? updatedAt = null, - }) { - return _then(_$ChartPointModelImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - userId: null == userId - ? _value.userId - : userId // ignore: cast_nullable_to_non_nullable - as int, - weight: null == weight - ? _value.weight - : weight // ignore: cast_nullable_to_non_nullable - as double, - bmi: null == bmi - ? _value.bmi - : bmi // ignore: cast_nullable_to_non_nullable - as double, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$ChartPointModelImpl implements _ChartPointModel { - const _$ChartPointModelImpl( - {@JsonKey(name: "id") required this.id, - @JsonKey(name: "user_id") required this.userId, - @JsonKey(name: "weight") required this.weight, - @JsonKey(name: "bmi") required this.bmi, - @JsonKey(name: "created_at") required this.createdAt, - @JsonKey(name: "updated_at") required this.updatedAt}); - - factory _$ChartPointModelImpl.fromJson(Map json) => - _$$ChartPointModelImplFromJson(json); - - @override - @JsonKey(name: "id") - final int id; - @override - @JsonKey(name: "user_id") - final int userId; - @override - @JsonKey(name: "weight") - final double weight; - @override - @JsonKey(name: "bmi") - final double bmi; - @override - @JsonKey(name: "created_at") - final DateTime createdAt; - @override - @JsonKey(name: "updated_at") - final DateTime updatedAt; - - @override - String toString() { - return 'ChartPointModel(id: $id, userId: $userId, weight: $weight, bmi: $bmi, createdAt: $createdAt, updatedAt: $updatedAt)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChartPointModelImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.userId, userId) || other.userId == userId) && - (identical(other.weight, weight) || other.weight == weight) && - (identical(other.bmi, bmi) || other.bmi == bmi) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); - } - - @JsonKey(ignore: true) - @override - int get hashCode => - Object.hash(runtimeType, id, userId, weight, bmi, createdAt, updatedAt); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$ChartPointModelImplCopyWith<_$ChartPointModelImpl> get copyWith => - __$$ChartPointModelImplCopyWithImpl<_$ChartPointModelImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$ChartPointModelImplToJson( - this, - ); - } -} - -abstract class _ChartPointModel implements ChartPointModel { - const factory _ChartPointModel( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "user_id") required final int userId, - @JsonKey(name: "weight") required final double weight, - @JsonKey(name: "bmi") required final double bmi, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") required final DateTime updatedAt}) = - _$ChartPointModelImpl; - - factory _ChartPointModel.fromJson(Map json) = - _$ChartPointModelImpl.fromJson; - - @override - @JsonKey(name: "id") - int get id; - @override - @JsonKey(name: "user_id") - int get userId; - @override - @JsonKey(name: "weight") - double get weight; - @override - @JsonKey(name: "bmi") - double get bmi; - @override - @JsonKey(name: "created_at") - DateTime get createdAt; - @override - @JsonKey(name: "updated_at") - DateTime get updatedAt; - @override - @JsonKey(ignore: true) - _$$ChartPointModelImplCopyWith<_$ChartPointModelImpl> get copyWith => + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/profile/models/profile_model.g.dart b/lib/features/profile/models/profile_model.g.dart index f0d74ea0..28e10ccf 100644 --- a/lib/features/profile/models/profile_model.g.dart +++ b/lib/features/profile/models/profile_model.g.dart @@ -8,136 +8,78 @@ part of 'profile_model.dart'; _$ProfileModelImpl _$$ProfileModelImplFromJson(Map json) => _$ProfileModelImpl( - user: User.fromJson(json['user'] as Map), - chartPoints: (json['chartPoints'] as List) - .map((e) => ChartPointModel.fromJson(e as Map)) - .toList(), - userDetails: - UserDetails.fromJson(json['userDetails'] as Map), - circumferences: (json['circumferences'] as List) - .map((e) => Circumference.fromJson(e as Map)) - .toList(), - 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, + id: (json['id'] as num).toInt(), + name: json['name'] as String, + email: json['email'] as String, + emailVerifiedAt: json['email_verified_at'] == null + ? null + : DateTime.parse(json['email_verified_at'] as String), + createdAt: json['created_at'] == null + ? null + : DateTime.parse(json['created_at'] as String), + updatedAt: json['updated_at'] == null + ? null + : DateTime.parse(json['updated_at'] as String), + isPublicProfile: json['is_public_profile'] as bool, + slug: json['slug'] as String, + profilePhotoUrl: json['profile_photo_url'] as String, ); Map _$$ProfileModelImplToJson(_$ProfileModelImpl 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, - }; - -_$CircumferenceImpl _$$CircumferenceImplFromJson(Map json) => - _$CircumferenceImpl( - id: (json['id'] as num).toInt(), - userId: (json['user_id'] as num).toInt(), - chestCircumference: (json['chest_circumference'] as num).toInt(), - waistCircumference: (json['waist_circumference'] as num).toInt(), - hipCircumference: (json['hip_circumference'] as num).toInt(), - createdAt: DateTime.parse(json['created_at'] as String), - updatedAt: DateTime.parse(json['updated_at'] as String), - ); - -Map _$$CircumferenceImplToJson(_$CircumferenceImpl instance) => - { - 'id': instance.id, - 'user_id': instance.userId, - 'chest_circumference': instance.chestCircumference, - 'waist_circumference': instance.waistCircumference, - 'hip_circumference': instance.hipCircumference, - 'created_at': instance.createdAt.toIso8601String(), - 'updated_at': instance.updatedAt.toIso8601String(), - }; - -_$UserImpl _$$UserImplFromJson(Map json) => _$UserImpl( - id: (json['id'] as num).toInt(), - name: json['name'] as String, - email: json['email'] as String, - emailVerifiedAt: json['email_verified_at'], - 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, - '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, + 'email_verified_at': instance.emailVerifiedAt?.toIso8601String(), + 'created_at': instance.createdAt?.toIso8601String(), + 'updated_at': instance.updatedAt?.toIso8601String(), '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(), +_$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson( + Map json) => + _$ProfileDetailsModelImpl( firstName: json['first_name'] as String, lastName: json['last_name'] as String, - birthdate: DateTime.parse(json['birthdate'] as String), + birthdate: 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(), + weight: (json['weight'] as num).toDouble(), 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(), + hasHypo: json['has_hypo'] as bool, + hasHyper: json['has_hyper'] as bool, 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(), + createdAt: json['created_at'] == null + ? null + : DateTime.parse(json['created_at'] as String), + updatedAt: json['updated_at'] == null + ? null + : DateTime.parse(json['updated_at'] as String), + isMoodFillable: json['is_mood_fillable'] as bool, + isBedtimeFillable: json['is_bedtime_fillable'] as bool, activityCoefficient: (json['activity_coefficient'] as num).toDouble(), ); -Map _$$UserDetailsImplToJson(_$UserDetailsImpl instance) => +Map _$$ProfileDetailsModelImplToJson( + _$ProfileDetailsModelImpl instance) => { - 'id': instance.id, - 'user_id': instance.userId, 'first_name': instance.firstName, 'last_name': instance.lastName, - 'birthdate': instance.birthdate.toIso8601String(), + 'birthdate': instance.birthdate, 'gender': instance.gender, 'country': instance.country, 'city': instance.city, @@ -157,31 +99,9 @@ Map _$$UserDetailsImplToJson(_$UserDetailsImpl instance) => 'favorite_foods': instance.favoriteFoods, 'unfavorite_foods': instance.unfavoriteFoods, 'additional_info': instance.additionalInfo, - 'created_at': instance.createdAt.toIso8601String(), - 'updated_at': instance.updatedAt.toIso8601String(), + 'created_at': instance.createdAt?.toIso8601String(), + 'updated_at': instance.updatedAt?.toIso8601String(), 'is_mood_fillable': instance.isMoodFillable, 'is_bedtime_fillable': instance.isBedtimeFillable, 'activity_coefficient': instance.activityCoefficient, }; - -_$ChartPointModelImpl _$$ChartPointModelImplFromJson( - Map json) => - _$ChartPointModelImpl( - id: (json['id'] as num).toInt(), - userId: (json['user_id'] as num).toInt(), - weight: (json['weight'] as num).toDouble(), - bmi: (json['bmi'] as num).toDouble(), - createdAt: DateTime.parse(json['created_at'] as String), - updatedAt: DateTime.parse(json['updated_at'] as String), - ); - -Map _$$ChartPointModelImplToJson( - _$ChartPointModelImpl instance) => - { - 'id': instance.id, - 'user_id': instance.userId, - 'weight': instance.weight, - 'bmi': instance.bmi, - 'created_at': instance.createdAt.toIso8601String(), - 'updated_at': instance.updatedAt.toIso8601String(), - }; diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index 8ff0939d..05f33fe7 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -13,6 +13,7 @@ class ProfileCubit extends Cubit { try { emit(ProfileState.loaded( profile: await profileRepository.getProfileBySlug(slug), + profileDetails: await profileRepository.getMyProfileDetails(), blogPosts: await profileRepository.getBlogPostsByAuthorSlug(slug: slug), )); } catch (e) { @@ -23,10 +24,11 @@ class ProfileCubit extends Cubit { getMyProfile() async { try { - final myProfile = await profileRepository.getMyProfile(); + final profile = await profileRepository.getMyProfile(); emit(ProfileState.loaded( - profile: myProfile, - blogPosts: await profileRepository.getBlogPostsByAuthorSlug(slug: myProfile.user.slug), + profile: profile, + profileDetails: await profileRepository.getMyProfileDetails(), + blogPosts: await profileRepository.getBlogPostsByAuthorSlug(slug: profile.slug), )); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); @@ -45,12 +47,7 @@ class ProfileCubit extends Cubit { waistCircumference: waistCircumference, hipCircumference: hipCircumference, ); - emit( - ProfileState.loaded( - profile: await profileRepository.getMyProfile(), - blogPosts: (state as ProfileStateLoaded).blogPosts, - ), - ); + emit((state as ProfileStateLoaded).copyWith()); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); print(e); @@ -61,15 +58,8 @@ class ProfileCubit extends Cubit { required double weight, }) async { try { - await profileRepository.addWeight( - weight: weight, - ); - emit( - ProfileState.loaded( - profile: await profileRepository.getMyProfile(), - blogPosts: (state as ProfileStateLoaded).blogPosts, - ), - ); + await profileRepository.addWeight(weight: weight); + emit((state as ProfileStateLoaded).copyWith()); } 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 index f9f4eed1..ff3c148f 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart @@ -12,6 +12,7 @@ abstract class ProfileState with _$ProfileState { const factory ProfileState.loaded({ required ProfileModel profile, + required ProfileDetailsModel profileDetails, required List blogPosts, }) = ProfileStateLoaded; diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart index dbc10dfd..9e574749 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart @@ -21,7 +21,9 @@ mixin _$ProfileState { TResult Function() $default, { required TResult Function() loading, required TResult Function( - ProfileModel profile, List blogPosts) + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts) loaded, required TResult Function(String errorMessage) error, }) => @@ -30,7 +32,8 @@ mixin _$ProfileState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, List blogPosts)? + TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, + List blogPosts)? loaded, TResult? Function(String errorMessage)? error, }) => @@ -39,7 +42,8 @@ mixin _$ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, List blogPosts)? + TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, + List blogPosts)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -88,6 +92,9 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of ProfileState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -104,6 +111,9 @@ class __$$ProfileStateImplCopyWithImpl<$Res> __$$ProfileStateImplCopyWithImpl( _$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then) : super(_value, _then); + + /// Create a copy of ProfileState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -131,7 +141,9 @@ class _$ProfileStateImpl implements _ProfileState { TResult Function() $default, { required TResult Function() loading, required TResult Function( - ProfileModel profile, List blogPosts) + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts) loaded, required TResult Function(String errorMessage) error, }) { @@ -143,7 +155,8 @@ class _$ProfileStateImpl implements _ProfileState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, List blogPosts)? + TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, + List blogPosts)? loaded, TResult? Function(String errorMessage)? error, }) { @@ -155,7 +168,8 @@ class _$ProfileStateImpl implements _ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, List blogPosts)? + TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, + List blogPosts)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -222,6 +236,9 @@ class __$$ProfileStateLoadingImplCopyWithImpl<$Res> __$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value, $Res Function(_$ProfileStateLoadingImpl) _then) : super(_value, _then); + + /// Create a copy of ProfileState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -250,7 +267,9 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult Function() $default, { required TResult Function() loading, required TResult Function( - ProfileModel profile, List blogPosts) + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts) loaded, required TResult Function(String errorMessage) error, }) { @@ -262,7 +281,8 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, List blogPosts)? + TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, + List blogPosts)? loaded, TResult? Function(String errorMessage)? error, }) { @@ -274,7 +294,8 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, List blogPosts)? + TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, + List blogPosts)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -333,9 +354,13 @@ abstract class _$$ProfileStateLoadedImplCopyWith<$Res> { $Res Function(_$ProfileStateLoadedImpl) then) = __$$ProfileStateLoadedImplCopyWithImpl<$Res>; @useResult - $Res call({ProfileModel profile, List blogPosts}); + $Res call( + {ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts}); $ProfileModelCopyWith<$Res> get profile; + $ProfileDetailsModelCopyWith<$Res> get profileDetails; } /// @nodoc @@ -346,10 +371,13 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> $Res Function(_$ProfileStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of ProfileState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? profile = null, + Object? profileDetails = null, Object? blogPosts = null, }) { return _then(_$ProfileStateLoadedImpl( @@ -357,6 +385,10 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> ? _value.profile : profile // ignore: cast_nullable_to_non_nullable as ProfileModel, + profileDetails: null == profileDetails + ? _value.profileDetails + : profileDetails // ignore: cast_nullable_to_non_nullable + as ProfileDetailsModel, blogPosts: null == blogPosts ? _value._blogPosts : blogPosts // ignore: cast_nullable_to_non_nullable @@ -364,6 +396,8 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> )); } + /// Create a copy of ProfileState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $ProfileModelCopyWith<$Res> get profile { @@ -371,17 +405,31 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> return _then(_value.copyWith(profile: value)); }); } + + /// Create a copy of ProfileState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ProfileDetailsModelCopyWith<$Res> get profileDetails { + return $ProfileDetailsModelCopyWith<$Res>(_value.profileDetails, (value) { + return _then(_value.copyWith(profileDetails: value)); + }); + } } /// @nodoc class _$ProfileStateLoadedImpl implements ProfileStateLoaded { const _$ProfileStateLoadedImpl( - {required this.profile, required final List blogPosts}) + {required this.profile, + required this.profileDetails, + required final List blogPosts}) : _blogPosts = blogPosts; @override final ProfileModel profile; + @override + final ProfileDetailsModel profileDetails; final List _blogPosts; @override List get blogPosts { @@ -392,7 +440,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { @override String toString() { - return 'ProfileState.loaded(profile: $profile, blogPosts: $blogPosts)'; + return 'ProfileState.loaded(profile: $profile, profileDetails: $profileDetails, blogPosts: $blogPosts)'; } @override @@ -401,15 +449,19 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { (other.runtimeType == runtimeType && other is _$ProfileStateLoadedImpl && (identical(other.profile, profile) || other.profile == profile) && + (identical(other.profileDetails, profileDetails) || + other.profileDetails == profileDetails) && const DeepCollectionEquality() .equals(other._blogPosts, _blogPosts)); } @override - int get hashCode => Object.hash( - runtimeType, profile, const DeepCollectionEquality().hash(_blogPosts)); + int get hashCode => Object.hash(runtimeType, profile, profileDetails, + const DeepCollectionEquality().hash(_blogPosts)); - @JsonKey(ignore: true) + /// Create a copy of ProfileState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => @@ -422,11 +474,13 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult Function() $default, { required TResult Function() loading, required TResult Function( - ProfileModel profile, List blogPosts) + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts) loaded, required TResult Function(String errorMessage) error, }) { - return loaded(profile, blogPosts); + return loaded(profile, profileDetails, blogPosts); } @override @@ -434,11 +488,12 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, List blogPosts)? + TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, + List blogPosts)? loaded, TResult? Function(String errorMessage)? error, }) { - return loaded?.call(profile, blogPosts); + return loaded?.call(profile, profileDetails, blogPosts); } @override @@ -446,13 +501,14 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, List blogPosts)? + TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, + List blogPosts)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { if (loaded != null) { - return loaded(profile, blogPosts); + return loaded(profile, profileDetails, blogPosts); } return orElse(); } @@ -498,12 +554,17 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { abstract class ProfileStateLoaded implements ProfileState { const factory ProfileStateLoaded( {required final ProfileModel profile, + required final ProfileDetailsModel profileDetails, required final List blogPosts}) = _$ProfileStateLoadedImpl; ProfileModel get profile; + ProfileDetailsModel get profileDetails; List get blogPosts; - @JsonKey(ignore: true) + + /// Create a copy of ProfileState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -525,6 +586,8 @@ class __$$ProfileStateErrorImplCopyWithImpl<$Res> $Res Function(_$ProfileStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of ProfileState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -564,7 +627,9 @@ class _$ProfileStateErrorImpl implements ProfileStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of ProfileState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => @@ -577,7 +642,9 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult Function() $default, { required TResult Function() loading, required TResult Function( - ProfileModel profile, List blogPosts) + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts) loaded, required TResult Function(String errorMessage) error, }) { @@ -589,7 +656,8 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, List blogPosts)? + TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, + List blogPosts)? loaded, TResult? Function(String errorMessage)? error, }) { @@ -601,7 +669,8 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, List blogPosts)? + TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, + List blogPosts)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -655,7 +724,10 @@ abstract class ProfileStateError implements ProfileState { _$ProfileStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of ProfileState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index a1d0d15a..af8cf4ec 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -1,12 +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/feed/presentation/widgets/blog_post_widget.dart'; -import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart'; -import 'package:eatvio_app/features/profile/presentation/widgets/circumference_chart_widget.dart'; -import 'package:eatvio_app/features/profile/presentation/widgets/imt_chart_widget.dart'; -import 'package:eatvio_app/features/profile/presentation/widgets/weight_chart_widget.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -23,8 +19,8 @@ class ProfileScreen extends StatefulWidget { } class _ProfileScreenState extends State { - List chartData = []; - List chartPoints = []; + // List chartData = []; + // List chartPoints = []; final List chipsLabelList = ['Вес', 'Замеры', 'ИМТ']; final List chipsIntervalLabelList = ['1М', '3М', '6М', '1Г', 'ВСЁ ВРЕМЯ']; int _selectedChipIndex = 0; @@ -42,8 +38,8 @@ class _ProfileScreenState extends State { child: BlocBuilder( builder: (BuildContext context, ProfileState state) { if (state is ProfileStateLoaded) { - chartData = state.profile.circumferences; - chartPoints = state.profile.chartPoints; + // chartData = state.profile.circumferences; + // chartPoints = state.profile.chartPoints; return Scaffold( backgroundColor: Colors.grey.shade200, appBar: widget.author == null ? AppBar(toolbarHeight: 0) : AppBar(), @@ -65,17 +61,13 @@ class _ProfileScreenState extends State { padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16), child: Row( children: [ - state.profile.user.profilePhotoUrl != null - ? CircleAvatar( - radius: 32, - backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl!), - ) - : CircleAvatar( - radius: 32, - ), + CircleAvatar( + radius: 32, + backgroundImage: NetworkImage(state.profile.profilePhotoUrl), + ), const SizedBox(width: 12), Text( - state.profile.user.name, + state.profile.name, style: TextStyle( color: Colors.black, fontWeight: FontWeight.w500, @@ -123,7 +115,7 @@ class _ProfileScreenState extends State { GestureDetector( onTap: () => Share.shareUri( Uri.parse( - baseUrl + '/ru/profile/' + state.profile.user.slug, + baseUrl + '/ru/profile/' + state.profile.slug, ), ), child: Container( @@ -139,12 +131,12 @@ class _ProfileScreenState extends State { ], ), ), - if (state.profile.userDetails.additionalInfo.isNotEmpty) + if (state.profileDetails.additionalInfo.isNotEmpty) Container( alignment: Alignment.centerLeft, padding: const EdgeInsets.all(16), child: Text( - state.profile.userDetails.additionalInfo, + state.profileDetails.additionalInfo, style: TextStyle( color: Colors.black.withOpacity(0.4), height: 1, @@ -157,7 +149,9 @@ class _ProfileScreenState extends State { children: [ SizedBox(width: 16), GestureDetector( - onTap: () => GoRouter.of(context).pushNamed('chatScreen', ), + onTap: () => GoRouter.of(context).pushNamed( + 'chatScreen', + ), child: Container( alignment: Alignment.center, padding: EdgeInsets.all(8), @@ -213,25 +207,25 @@ class _ProfileScreenState extends State { ], ), ), - Builder( - builder: (context) { - switch (_selectedChipIndex) { - case 0: - return WeightChartWidget( - chartPoints: chartPoints, - profileCubit: context.read(), - ); - case 1: - return CircumferenceChartWidget( - chartData: chartData, - profileCubit: context.read(), - ); - case 2: - return ImtChartWidget(chartPoints: chartPoints); - } - return SizedBox.shrink(); - }, - ), + // Builder( + // builder: (context) { + // switch (_selectedChipIndex) { + // case 0: + // return WeightChartWidget( + // chartPoints: chartPoints, + // profileCubit: context.read(), + // ); + // case 1: + // return CircumferenceChartWidget( + // chartData: chartData, + // profileCubit: context.read(), + // ); + // case 2: + // return ImtChartWidget(chartPoints: chartPoints); + // } + // return SizedBox.shrink(); + // }, + // ), SizedBox(height: 8), Row( children: [ diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index bbf76a4e..4d718b9b 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -1,374 +1,374 @@ -import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/features/profile/models/profile_model.dart'; -import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; -import 'package:syncfusion_flutter_charts/charts.dart'; - -class CircumferenceChartWidget extends StatefulWidget { - final List chartData; - final ProfileCubit profileCubit; - - const CircumferenceChartWidget({ - super.key, - required this.chartData, - required this.profileCubit, - }); - - @override - State createState() => _CircumferenceChartWidgetState(); -} - -class _CircumferenceChartWidgetState extends State { - late FixedExtentScrollController chestController; - late FixedExtentScrollController waistController; - late FixedExtentScrollController hipController; - late int chest; - late int waist; - late int hip; - - @override - Widget build(BuildContext context) { - return Column( - children: [ - if (widget.chartData.isNotEmpty) - Padding( - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: Row( - children: [ - Text( - '${widget.chartData.last.chestCircumference}', - style: TextStyle( - color: Colors.black, - fontSize: 40, - fontWeight: FontWeight.w500, - ), - ), - if (widget.chartData.length == 1) - Container( - margin: EdgeInsets.symmetric(horizontal: 12), - width: 8, - height: 8, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.black12, - ), - ), - if (widget.chartData.length > 1) - widget.chartData.last.chestCircumference > widget.chartData[widget.chartData.length - 2].chestCircumference - ? Icon( - Icons.arrow_drop_up, - size: 40, - color: Colors.grey, - ) - : Icon( - Icons.arrow_drop_down, - size: 40, - color: Colors.grey, - ), - Text( - '${widget.chartData.last.waistCircumference}', - style: TextStyle( - color: Colors.black, - fontSize: 40, - fontWeight: FontWeight.w500, - ), - ), - if (widget.chartData.length == 1) - Container( - margin: EdgeInsets.symmetric(horizontal: 12), - width: 8, - height: 8, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.black12, - ), - ), - if (widget.chartData.length > 1) - widget.chartData.last.waistCircumference > widget.chartData[widget.chartData.length - 2].waistCircumference - ? Icon( - Icons.arrow_drop_up, - size: 40, - color: Colors.grey, - ) - : Icon( - Icons.arrow_drop_down, - size: 40, - color: Colors.grey, - ), - Text( - '${widget.chartData.last.hipCircumference}', - style: TextStyle( - color: Colors.black, - fontSize: 40, - fontWeight: FontWeight.w500, - ), - ), - if (widget.chartData.length == 1) - Container( - margin: EdgeInsets.symmetric(horizontal: 12), - width: 8, - height: 8, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.black12, - ), - ), - if (widget.chartData.length > 1) - widget.chartData.last.hipCircumference > widget.chartData[widget.chartData.length - 2].hipCircumference - ? Icon( - Icons.arrow_drop_up, - size: 40, - color: Colors.grey, - ) - : Icon( - Icons.arrow_drop_down, - size: 40, - color: Colors.grey, - ), - ], - ), - ), - Stack( - alignment: Alignment.bottomRight, - children: [ - SfCartesianChart( - margin: EdgeInsets.symmetric(horizontal: 8), - enableAxisAnimation: true, - plotAreaBorderWidth: 0, - trackballBehavior: TrackballBehavior( - enable: true, - activationMode: ActivationMode.singleTap, - tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, - tooltipSettings: InteractiveTooltip(), - lineType: TrackballLineType.vertical, - ), - primaryXAxis: DateTimeCategoryAxis( - tickPosition: TickPosition.inside, - majorTickLines: MajorTickLines( - size: 0, - ), - edgeLabelPlacement: EdgeLabelPlacement.shift, - dateFormat: DateFormat.MMMd('ru'), - labelStyle: TextStyle( - color: Colors.grey, - ), - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), - axisLine: AxisLine( - color: Colors.grey.withOpacity(0.3), - width: 0.4, - ), - ), - primaryYAxis: NumericAxis( - isVisible: false, - labelFormat: '{value} см', - axisLine: AxisLine( - width: 1, - ), - majorTickLines: MajorTickLines(size: 0), - ), - series: _getSplineSeries(), - tooltipBehavior: TooltipBehavior(enable: true), - ), - FloatingActionButton.small( - heroTag: 'addCircumference', - onPressed: () { - if (widget.chartData.isNotEmpty) { - chest = widget.chartData.last.chestCircumference; - waist = widget.chartData.last.waistCircumference; - hip = widget.chartData.last.hipCircumference; - chestController = FixedExtentScrollController(initialItem: chest - 20); - waistController = FixedExtentScrollController(initialItem: waist - 20); - hipController = FixedExtentScrollController(initialItem: hip - 20); - } else { - chestController = FixedExtentScrollController(); - waistController = FixedExtentScrollController(); - hipController = FixedExtentScrollController(); - } - showModalBottomSheet( - useRootNavigator: true, - context: context, - builder: (context) { - return Column( - children: [ - Expanded( - child: Row( - children: [ - Expanded( - child: CupertinoPicker( - magnification: 1.22, - squeeze: 1.2, - useMagnifier: true, - scrollController: chestController, - itemExtent: 24, - onSelectedItemChanged: (int value) { - chest = value; - }, - children: [ - for (int i = 20; i < 200; i++) Text('$i'), - ], - ), - ), - Expanded( - child: CupertinoPicker( - magnification: 1.22, - squeeze: 1.2, - useMagnifier: true, - scrollController: waistController, - itemExtent: 24, - onSelectedItemChanged: (int value) { - waist = value; - }, - children: [ - for (int i = 20; i < 200; i++) Text('$i'), - ], - ), - ), - Expanded( - child: CupertinoPicker( - magnification: 1.22, - squeeze: 1.2, - useMagnifier: true, - scrollController: hipController, - itemExtent: 24, - onSelectedItemChanged: (int value) { - hip = value; - }, - children: [ - for (int i = 20; i < 200; i++) Text('$i'), - ], - ), - ), - ], - ), - ), - InkWell( - onTap: () { - widget.profileCubit.addCircumference( - chestCircumference: chest, - waistCircumference: waist, - hipCircumference: hip, - ); - Navigator.of(context).pop(); - }, - borderRadius: BorderRadius.circular(16), - child: Ink( - width: MediaQuery.of(context).size.width - 32, - padding: EdgeInsets.all(16), - decoration: BoxDecoration( - color: appTheme.blueA400, - borderRadius: BorderRadius.circular(16), - ), - child: Center( - child: Text( - 'Сохранить', - style: TextStyle( - color: Colors.white, - ), - ), - ), - ), - ), - ], - ); - }, - ); - }, - backgroundColor: Colors.red, - shape: CircleBorder(), - child: Icon( - Icons.add, - color: Colors.white, - ), - ), - ], - ), - ], - ); - } - - List> _getSplineSeries() { - final Color seriesColor1 = Colors.red; - final Color seriesColor2 = appTheme.blueA400; - final Color seriesColor3 = Colors.green; - - return >[ - SplineAreaSeries( - markerSettings: MarkerSettings( - isVisible: true, - color: seriesColor1, - height: 8, - width: 8, - ), - dataLabelSettings: DataLabelSettings( - labelAlignment: ChartDataLabelAlignment.top, - isVisible: true, - ), - dataSource: widget.chartData, - borderColor: seriesColor1, - gradient: LinearGradient( - colors: [ - seriesColor1.withOpacity(0.14), - Colors.transparent, - ], - begin: Alignment.topCenter, - end: Alignment(0, 0.6), - ), - name: 'Грудь', - xValueMapper: (Circumference value, int index) => value.createdAt, - yValueMapper: (Circumference value, int index) => value.chestCircumference, - ), - SplineAreaSeries( - markerSettings: MarkerSettings( - isVisible: true, - color: seriesColor2, - height: 8, - width: 8, - ), - dataLabelSettings: DataLabelSettings( - labelAlignment: ChartDataLabelAlignment.top, - isVisible: true, - ), - dataSource: widget.chartData, - borderColor: seriesColor2, - gradient: LinearGradient( - colors: [ - seriesColor2.withOpacity(0.14), - Colors.transparent, - ], - begin: Alignment.topCenter, - end: Alignment(0, 0.6), - ), - name: 'Талия', - xValueMapper: (Circumference value, int index) => value.createdAt, - yValueMapper: (Circumference value, int index) => value.waistCircumference, - ), - SplineAreaSeries( - markerSettings: MarkerSettings( - isVisible: true, - color: seriesColor3, - height: 8, - width: 8, - ), - dataLabelSettings: DataLabelSettings( - labelAlignment: ChartDataLabelAlignment.top, - isVisible: true, - ), - dataSource: widget.chartData, - borderColor: seriesColor3, - gradient: LinearGradient( - colors: [ - seriesColor3.withOpacity(0.14), - Colors.transparent, - ], - begin: Alignment.topCenter, - end: Alignment(0, 0.6), - ), - name: 'Бёдра', - xValueMapper: (Circumference value, int index) => value.createdAt, - yValueMapper: (Circumference value, int index) => value.hipCircumference, - ), - ]; - } -} +// import 'package:eatvio_app/core/app_export.dart'; +// import 'package:eatvio_app/features/profile/models/profile_model.dart'; +// import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/material.dart'; +// import 'package:intl/intl.dart'; +// import 'package:syncfusion_flutter_charts/charts.dart'; +// +// class CircumferenceChartWidget extends StatefulWidget { +// final List chartData; +// final ProfileCubit profileCubit; +// +// const CircumferenceChartWidget({ +// super.key, +// required this.chartData, +// required this.profileCubit, +// }); +// +// @override +// State createState() => _CircumferenceChartWidgetState(); +// } +// +// class _CircumferenceChartWidgetState extends State { +// late FixedExtentScrollController chestController; +// late FixedExtentScrollController waistController; +// late FixedExtentScrollController hipController; +// late int chest; +// late int waist; +// late int hip; +// +// @override +// Widget build(BuildContext context) { +// return Column( +// children: [ +// if (widget.chartData.isNotEmpty) +// Padding( +// padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), +// child: Row( +// children: [ +// Text( +// '${widget.chartData.last.chestCircumference}', +// style: TextStyle( +// color: Colors.black, +// fontSize: 40, +// fontWeight: FontWeight.w500, +// ), +// ), +// if (widget.chartData.length == 1) +// Container( +// margin: EdgeInsets.symmetric(horizontal: 12), +// width: 8, +// height: 8, +// decoration: BoxDecoration( +// shape: BoxShape.circle, +// color: Colors.black12, +// ), +// ), +// if (widget.chartData.length > 1) +// widget.chartData.last.chestCircumference > widget.chartData[widget.chartData.length - 2].chestCircumference +// ? Icon( +// Icons.arrow_drop_up, +// size: 40, +// color: Colors.grey, +// ) +// : Icon( +// Icons.arrow_drop_down, +// size: 40, +// color: Colors.grey, +// ), +// Text( +// '${widget.chartData.last.waistCircumference}', +// style: TextStyle( +// color: Colors.black, +// fontSize: 40, +// fontWeight: FontWeight.w500, +// ), +// ), +// if (widget.chartData.length == 1) +// Container( +// margin: EdgeInsets.symmetric(horizontal: 12), +// width: 8, +// height: 8, +// decoration: BoxDecoration( +// shape: BoxShape.circle, +// color: Colors.black12, +// ), +// ), +// if (widget.chartData.length > 1) +// widget.chartData.last.waistCircumference > widget.chartData[widget.chartData.length - 2].waistCircumference +// ? Icon( +// Icons.arrow_drop_up, +// size: 40, +// color: Colors.grey, +// ) +// : Icon( +// Icons.arrow_drop_down, +// size: 40, +// color: Colors.grey, +// ), +// Text( +// '${widget.chartData.last.hipCircumference}', +// style: TextStyle( +// color: Colors.black, +// fontSize: 40, +// fontWeight: FontWeight.w500, +// ), +// ), +// if (widget.chartData.length == 1) +// Container( +// margin: EdgeInsets.symmetric(horizontal: 12), +// width: 8, +// height: 8, +// decoration: BoxDecoration( +// shape: BoxShape.circle, +// color: Colors.black12, +// ), +// ), +// if (widget.chartData.length > 1) +// widget.chartData.last.hipCircumference > widget.chartData[widget.chartData.length - 2].hipCircumference +// ? Icon( +// Icons.arrow_drop_up, +// size: 40, +// color: Colors.grey, +// ) +// : Icon( +// Icons.arrow_drop_down, +// size: 40, +// color: Colors.grey, +// ), +// ], +// ), +// ), +// Stack( +// alignment: Alignment.bottomRight, +// children: [ +// SfCartesianChart( +// margin: EdgeInsets.symmetric(horizontal: 8), +// enableAxisAnimation: true, +// plotAreaBorderWidth: 0, +// trackballBehavior: TrackballBehavior( +// enable: true, +// activationMode: ActivationMode.singleTap, +// tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, +// tooltipSettings: InteractiveTooltip(), +// lineType: TrackballLineType.vertical, +// ), +// primaryXAxis: DateTimeCategoryAxis( +// tickPosition: TickPosition.inside, +// majorTickLines: MajorTickLines( +// size: 0, +// ), +// edgeLabelPlacement: EdgeLabelPlacement.shift, +// dateFormat: DateFormat.MMMd('ru'), +// labelStyle: TextStyle( +// color: Colors.grey, +// ), +// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), +// axisLine: AxisLine( +// color: Colors.grey.withOpacity(0.3), +// width: 0.4, +// ), +// ), +// primaryYAxis: NumericAxis( +// isVisible: false, +// labelFormat: '{value} см', +// axisLine: AxisLine( +// width: 1, +// ), +// majorTickLines: MajorTickLines(size: 0), +// ), +// series: _getSplineSeries(), +// tooltipBehavior: TooltipBehavior(enable: true), +// ), +// FloatingActionButton.small( +// heroTag: 'addCircumference', +// onPressed: () { +// if (widget.chartData.isNotEmpty) { +// chest = widget.chartData.last.chestCircumference; +// waist = widget.chartData.last.waistCircumference; +// hip = widget.chartData.last.hipCircumference; +// chestController = FixedExtentScrollController(initialItem: chest - 20); +// waistController = FixedExtentScrollController(initialItem: waist - 20); +// hipController = FixedExtentScrollController(initialItem: hip - 20); +// } else { +// chestController = FixedExtentScrollController(); +// waistController = FixedExtentScrollController(); +// hipController = FixedExtentScrollController(); +// } +// showModalBottomSheet( +// useRootNavigator: true, +// context: context, +// builder: (context) { +// return Column( +// children: [ +// Expanded( +// child: Row( +// children: [ +// Expanded( +// child: CupertinoPicker( +// magnification: 1.22, +// squeeze: 1.2, +// useMagnifier: true, +// scrollController: chestController, +// itemExtent: 24, +// onSelectedItemChanged: (int value) { +// chest = value; +// }, +// children: [ +// for (int i = 20; i < 200; i++) Text('$i'), +// ], +// ), +// ), +// Expanded( +// child: CupertinoPicker( +// magnification: 1.22, +// squeeze: 1.2, +// useMagnifier: true, +// scrollController: waistController, +// itemExtent: 24, +// onSelectedItemChanged: (int value) { +// waist = value; +// }, +// children: [ +// for (int i = 20; i < 200; i++) Text('$i'), +// ], +// ), +// ), +// Expanded( +// child: CupertinoPicker( +// magnification: 1.22, +// squeeze: 1.2, +// useMagnifier: true, +// scrollController: hipController, +// itemExtent: 24, +// onSelectedItemChanged: (int value) { +// hip = value; +// }, +// children: [ +// for (int i = 20; i < 200; i++) Text('$i'), +// ], +// ), +// ), +// ], +// ), +// ), +// InkWell( +// onTap: () { +// widget.profileCubit.addCircumference( +// chestCircumference: chest, +// waistCircumference: waist, +// hipCircumference: hip, +// ); +// Navigator.of(context).pop(); +// }, +// borderRadius: BorderRadius.circular(16), +// child: Ink( +// width: MediaQuery.of(context).size.width - 32, +// padding: EdgeInsets.all(16), +// decoration: BoxDecoration( +// color: appTheme.blueA400, +// borderRadius: BorderRadius.circular(16), +// ), +// child: Center( +// child: Text( +// 'Сохранить', +// style: TextStyle( +// color: Colors.white, +// ), +// ), +// ), +// ), +// ), +// ], +// ); +// }, +// ); +// }, +// backgroundColor: Colors.red, +// shape: CircleBorder(), +// child: Icon( +// Icons.add, +// color: Colors.white, +// ), +// ), +// ], +// ), +// ], +// ); +// } +// +// List> _getSplineSeries() { +// final Color seriesColor1 = Colors.red; +// final Color seriesColor2 = appTheme.blueA400; +// final Color seriesColor3 = Colors.green; +// +// return >[ +// SplineAreaSeries( +// markerSettings: MarkerSettings( +// isVisible: true, +// color: seriesColor1, +// height: 8, +// width: 8, +// ), +// dataLabelSettings: DataLabelSettings( +// labelAlignment: ChartDataLabelAlignment.top, +// isVisible: true, +// ), +// dataSource: widget.chartData, +// borderColor: seriesColor1, +// gradient: LinearGradient( +// colors: [ +// seriesColor1.withOpacity(0.14), +// Colors.transparent, +// ], +// begin: Alignment.topCenter, +// end: Alignment(0, 0.6), +// ), +// name: 'Грудь', +// xValueMapper: (Circumference value, int index) => value.createdAt, +// yValueMapper: (Circumference value, int index) => value.chestCircumference, +// ), +// SplineAreaSeries( +// markerSettings: MarkerSettings( +// isVisible: true, +// color: seriesColor2, +// height: 8, +// width: 8, +// ), +// dataLabelSettings: DataLabelSettings( +// labelAlignment: ChartDataLabelAlignment.top, +// isVisible: true, +// ), +// dataSource: widget.chartData, +// borderColor: seriesColor2, +// gradient: LinearGradient( +// colors: [ +// seriesColor2.withOpacity(0.14), +// Colors.transparent, +// ], +// begin: Alignment.topCenter, +// end: Alignment(0, 0.6), +// ), +// name: 'Талия', +// xValueMapper: (Circumference value, int index) => value.createdAt, +// yValueMapper: (Circumference value, int index) => value.waistCircumference, +// ), +// SplineAreaSeries( +// markerSettings: MarkerSettings( +// isVisible: true, +// color: seriesColor3, +// height: 8, +// width: 8, +// ), +// dataLabelSettings: DataLabelSettings( +// labelAlignment: ChartDataLabelAlignment.top, +// isVisible: true, +// ), +// dataSource: widget.chartData, +// borderColor: seriesColor3, +// gradient: LinearGradient( +// colors: [ +// seriesColor3.withOpacity(0.14), +// Colors.transparent, +// ], +// begin: Alignment.topCenter, +// end: Alignment(0, 0.6), +// ), +// name: 'Бёдра', +// xValueMapper: (Circumference value, int index) => value.createdAt, +// yValueMapper: (Circumference value, int index) => value.hipCircumference, +// ), +// ]; +// } +// } diff --git a/lib/features/profile/presentation/widgets/imt_chart_widget.dart b/lib/features/profile/presentation/widgets/imt_chart_widget.dart index 6646367e..258bd004 100644 --- a/lib/features/profile/presentation/widgets/imt_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/imt_chart_widget.dart @@ -1,114 +1,114 @@ -import 'package:eatvio_app/features/profile/models/profile_model.dart'; -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:flutter/material.dart'; -import 'package:syncfusion_flutter_charts/charts.dart'; -import 'package:intl/intl.dart'; - -class ImtChartWidget extends StatelessWidget { - final List chartPoints; - - const ImtChartWidget({ - super.key, - required this.chartPoints, - }); - - @override - Widget build(BuildContext context) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: Row( - children: [ - Text( - '${chartPoints.last.bmi.toStringAsFixed(2)}', - style: TextStyle( - color: Colors.black, - fontSize: 40, - fontWeight: FontWeight.w500, - ), - ), - chartPoints.last.bmi > chartPoints[chartPoints.length - 2].bmi - ? Icon( - Icons.arrow_drop_up, - size: 40, - color: Colors.grey, - ) - : Icon( - Icons.arrow_drop_down, - size: 40, - color: Colors.grey, - ), - ], - ), - ), - SfCartesianChart( - margin: EdgeInsets.symmetric(horizontal: 8), - enableAxisAnimation: true, - plotAreaBorderWidth: 0, - trackballBehavior: TrackballBehavior( - enable: true, - activationMode: ActivationMode.singleTap, - tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, - tooltipSettings: InteractiveTooltip(), - lineType: TrackballLineType.vertical, - ), - primaryXAxis: DateTimeCategoryAxis( - initialVisibleMinimum: chartPoints.first.createdAt, - initialVisibleMaximum: chartPoints.last.createdAt, - tickPosition: TickPosition.inside, - majorTickLines: MajorTickLines( - size: 0, - ), - edgeLabelPlacement: EdgeLabelPlacement.shift, - dateFormat: DateFormat.MMMd('ru'), - labelStyle: TextStyle( - color: Colors.grey, - ), - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), - axisLine: AxisLine( - color: Colors.grey.withOpacity(0.3), - width: 0.4, - ), - ), - primaryYAxis: NumericAxis( - isVisible: false, - ), - series: _getSplineSeries(), - tooltipBehavior: TooltipBehavior(enable: true), - ), - ], - ); - } - - List> _getSplineSeries() { - return >[ - SplineAreaSeries( - markerSettings: MarkerSettings( - isVisible: true, - color: appTheme.blueA400, - height: 8, - width: 8, - ), - dataLabelSettings: DataLabelSettings( - labelAlignment: ChartDataLabelAlignment.top, - isVisible: true, - ), - dataSource: chartPoints, - borderColor: appTheme.blueA400, - gradient: LinearGradient( - colors: [ - appTheme.blueA400.withOpacity(0.14), - Colors.transparent, - ], - begin: Alignment.topCenter, - end: Alignment(0, 0.6), - ), - name: 'ИМТ', - xValueMapper: (ChartPointModel value, int index) => value.createdAt, - yValueMapper: (ChartPointModel value, int index) => double.parse(value.bmi.toStringAsFixed(2)), - ), - ]; - } -} +// import 'package:eatvio_app/features/profile/models/profile_model.dart'; +// import 'package:eatvio_app/theme/theme_helper.dart'; +// import 'package:flutter/material.dart'; +// import 'package:syncfusion_flutter_charts/charts.dart'; +// import 'package:intl/intl.dart'; +// +// class ImtChartWidget extends StatelessWidget { +// final List chartPoints; +// +// const ImtChartWidget({ +// super.key, +// required this.chartPoints, +// }); +// +// @override +// Widget build(BuildContext context) { +// return Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Padding( +// padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), +// child: Row( +// children: [ +// Text( +// '${chartPoints.last.bmi.toStringAsFixed(2)}', +// style: TextStyle( +// color: Colors.black, +// fontSize: 40, +// fontWeight: FontWeight.w500, +// ), +// ), +// chartPoints.last.bmi > chartPoints[chartPoints.length - 2].bmi +// ? Icon( +// Icons.arrow_drop_up, +// size: 40, +// color: Colors.grey, +// ) +// : Icon( +// Icons.arrow_drop_down, +// size: 40, +// color: Colors.grey, +// ), +// ], +// ), +// ), +// SfCartesianChart( +// margin: EdgeInsets.symmetric(horizontal: 8), +// enableAxisAnimation: true, +// plotAreaBorderWidth: 0, +// trackballBehavior: TrackballBehavior( +// enable: true, +// activationMode: ActivationMode.singleTap, +// tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, +// tooltipSettings: InteractiveTooltip(), +// lineType: TrackballLineType.vertical, +// ), +// primaryXAxis: DateTimeCategoryAxis( +// initialVisibleMinimum: chartPoints.first.createdAt, +// initialVisibleMaximum: chartPoints.last.createdAt, +// tickPosition: TickPosition.inside, +// majorTickLines: MajorTickLines( +// size: 0, +// ), +// edgeLabelPlacement: EdgeLabelPlacement.shift, +// dateFormat: DateFormat.MMMd('ru'), +// labelStyle: TextStyle( +// color: Colors.grey, +// ), +// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), +// axisLine: AxisLine( +// color: Colors.grey.withOpacity(0.3), +// width: 0.4, +// ), +// ), +// primaryYAxis: NumericAxis( +// isVisible: false, +// ), +// series: _getSplineSeries(), +// tooltipBehavior: TooltipBehavior(enable: true), +// ), +// ], +// ); +// } +// +// List> _getSplineSeries() { +// return >[ +// SplineAreaSeries( +// markerSettings: MarkerSettings( +// isVisible: true, +// color: appTheme.blueA400, +// height: 8, +// width: 8, +// ), +// dataLabelSettings: DataLabelSettings( +// labelAlignment: ChartDataLabelAlignment.top, +// isVisible: true, +// ), +// dataSource: chartPoints, +// borderColor: appTheme.blueA400, +// gradient: LinearGradient( +// colors: [ +// appTheme.blueA400.withOpacity(0.14), +// Colors.transparent, +// ], +// begin: Alignment.topCenter, +// end: Alignment(0, 0.6), +// ), +// name: 'ИМТ', +// xValueMapper: (ChartPointModel value, int index) => value.createdAt, +// yValueMapper: (ChartPointModel value, int index) => double.parse(value.bmi.toStringAsFixed(2)), +// ), +// ]; +// } +// } diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index a2d68a58..7c9dca82 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -1,237 +1,237 @@ -import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/features/profile/models/profile_model.dart'; -import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; -import 'package:syncfusion_flutter_charts/charts.dart'; - -class WeightChartWidget extends StatefulWidget { - final List chartPoints; - final ProfileCubit profileCubit; - - const WeightChartWidget({ - super.key, - required this.chartPoints, - required this.profileCubit, - }); - - @override - State createState() => _WeightChartWidgetState(); -} - -class _WeightChartWidgetState extends State { - late FixedExtentScrollController weightKiloController; - late FixedExtentScrollController weightGramsController; - late int weightKilo; - late int weightGrams; - - @override - Widget build(BuildContext context) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (widget.chartPoints.isNotEmpty) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: Row( - children: [ - Text( - '${widget.chartPoints.last.weight.toStringAsFixed(1)} кг', - style: TextStyle( - color: Colors.black, - fontSize: 40, - fontWeight: FontWeight.w500, - ), - ), - if (widget.chartPoints.length == 1) - Container( - margin: EdgeInsets.symmetric(horizontal: 12), - width: 8, - height: 8, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.black12, - ), - ), - if (widget.chartPoints.length > 1) widget.chartPoints.last.weight > widget.chartPoints[widget.chartPoints.length - 2].weight - ? Icon( - Icons.arrow_drop_up, - size: 40, - color: Colors.grey.withOpacity(0.4), - ) - : Icon( - Icons.arrow_drop_down, - size: 40, - color: Colors.grey.withOpacity(0.4), - ), - ], - ), - ), - Stack( - alignment: Alignment.bottomRight, - children: [ - SfCartesianChart( - margin: EdgeInsets.symmetric(horizontal: 8), - enableAxisAnimation: true, - plotAreaBorderWidth: 0, - trackballBehavior: TrackballBehavior( - enable: true, - activationMode: ActivationMode.singleTap, - tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, - tooltipSettings: InteractiveTooltip(), - lineType: TrackballLineType.vertical, - ), - primaryXAxis: DateTimeCategoryAxis( - tickPosition: TickPosition.inside, - majorTickLines: MajorTickLines( - size: 0, - ), - edgeLabelPlacement: EdgeLabelPlacement.shift, - dateFormat: DateFormat.MMMd('ru'), - labelStyle: TextStyle( - color: Colors.grey, - ), - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), - axisLine: AxisLine( - color: Colors.grey.withOpacity(0.3), - width: 0.4, - ), - ), - primaryYAxis: NumericAxis( - isVisible: false, - labelFormat: '{value} кг', - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), - axisLine: AxisLine( - width: 1, - ), - majorTickLines: MajorTickLines(size: 0), - ), - series: _getSplineSeries(), - tooltipBehavior: TooltipBehavior(enable: true), - ), - FloatingActionButton.small( - heroTag: 'addWeight', - onPressed: () { - if (widget.chartPoints.isNotEmpty) { - weightKilo = int.parse(widget.chartPoints.last.weight.toString().split('.')[0]); - weightGrams = int.parse(widget.chartPoints.last.weight.toString().split('.')[1][0]); - weightKiloController = FixedExtentScrollController(initialItem: weightKilo - 20); - weightGramsController = FixedExtentScrollController(initialItem: weightGrams); - } else { - weightKiloController = FixedExtentScrollController(); - weightGramsController = FixedExtentScrollController(); - } - showModalBottomSheet( - useRootNavigator: true, - context: context, - builder: (context) { - return Column( - children: [ - Expanded( - child: Row( - children: [ - Expanded( - child: CupertinoPicker( - magnification: 1.22, - squeeze: 1.2, - useMagnifier: true, - scrollController: weightKiloController, - itemExtent: 24, - onSelectedItemChanged: (int value) { - weightKilo = value + 20; - }, - children: [ - for (int i = 20; i < 300; i++) Text('$i'), - ], - ), - ), - Expanded( - child: CupertinoPicker( - magnification: 1.22, - squeeze: 1.2, - useMagnifier: true, - scrollController: weightGramsController, - itemExtent: 24, - onSelectedItemChanged: (int value) { - weightGrams = value; - }, - children: [ - for (int i = 0; i < 10; i++) Text('$i'), - ], - ), - ), - ], - ), - ), - InkWell( - onTap: () { - widget.profileCubit.addWeight(weight: double.parse('$weightKilo.$weightGrams')); - Navigator.of(context).pop(); - }, - borderRadius: BorderRadius.circular(16), - child: Ink( - width: MediaQuery.of(context).size.width - 32, - padding: EdgeInsets.all(16), - decoration: BoxDecoration( - color: appTheme.blueA400, - borderRadius: BorderRadius.circular(16), - ), - child: Center( - child: Text( - 'Сохранить', - style: TextStyle( - color: Colors.white, - ), - ), - ), - ), - ), - ], - ); - }, - ); - }, - backgroundColor: Colors.red, - shape: CircleBorder(), - child: Icon( - Icons.add, - color: Colors.white, - ), - ), - ], - ), - ], - ); - } - - List> _getSplineSeries() { - return >[ - SplineAreaSeries( - markerSettings: MarkerSettings( - isVisible: true, - color: appTheme.blueA400, - height: 8, - width: 8, - ), - dataLabelSettings: DataLabelSettings( - labelAlignment: ChartDataLabelAlignment.top, - isVisible: true, - ), - dataSource: widget.chartPoints, - borderColor: appTheme.blueA400, - gradient: LinearGradient( - colors: [ - appTheme.blueA400.withOpacity(0.14), - Colors.transparent, - ], - begin: Alignment.topCenter, - end: Alignment(0, 0.6), - ), - name: 'Вес', - xValueMapper: (ChartPointModel value, int index) => value.createdAt, - yValueMapper: (ChartPointModel value, int index) => value.weight, - ), - ]; - } -} +// import 'package:eatvio_app/core/app_export.dart'; +// import 'package:eatvio_app/features/profile/models/profile_model.dart'; +// import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/material.dart'; +// import 'package:intl/intl.dart'; +// import 'package:syncfusion_flutter_charts/charts.dart'; +// +// class WeightChartWidget extends StatefulWidget { +// final List chartPoints; +// final ProfileCubit profileCubit; +// +// const WeightChartWidget({ +// super.key, +// required this.chartPoints, +// required this.profileCubit, +// }); +// +// @override +// State createState() => _WeightChartWidgetState(); +// } +// +// class _WeightChartWidgetState extends State { +// late FixedExtentScrollController weightKiloController; +// late FixedExtentScrollController weightGramsController; +// late int weightKilo; +// late int weightGrams; +// +// @override +// Widget build(BuildContext context) { +// return Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// if (widget.chartPoints.isNotEmpty) +// Padding( +// padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), +// child: Row( +// children: [ +// Text( +// '${widget.chartPoints.last.weight.toStringAsFixed(1)} кг', +// style: TextStyle( +// color: Colors.black, +// fontSize: 40, +// fontWeight: FontWeight.w500, +// ), +// ), +// if (widget.chartPoints.length == 1) +// Container( +// margin: EdgeInsets.symmetric(horizontal: 12), +// width: 8, +// height: 8, +// decoration: BoxDecoration( +// shape: BoxShape.circle, +// color: Colors.black12, +// ), +// ), +// if (widget.chartPoints.length > 1) widget.chartPoints.last.weight > widget.chartPoints[widget.chartPoints.length - 2].weight +// ? Icon( +// Icons.arrow_drop_up, +// size: 40, +// color: Colors.grey.withOpacity(0.4), +// ) +// : Icon( +// Icons.arrow_drop_down, +// size: 40, +// color: Colors.grey.withOpacity(0.4), +// ), +// ], +// ), +// ), +// Stack( +// alignment: Alignment.bottomRight, +// children: [ +// SfCartesianChart( +// margin: EdgeInsets.symmetric(horizontal: 8), +// enableAxisAnimation: true, +// plotAreaBorderWidth: 0, +// trackballBehavior: TrackballBehavior( +// enable: true, +// activationMode: ActivationMode.singleTap, +// tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, +// tooltipSettings: InteractiveTooltip(), +// lineType: TrackballLineType.vertical, +// ), +// primaryXAxis: DateTimeCategoryAxis( +// tickPosition: TickPosition.inside, +// majorTickLines: MajorTickLines( +// size: 0, +// ), +// edgeLabelPlacement: EdgeLabelPlacement.shift, +// dateFormat: DateFormat.MMMd('ru'), +// labelStyle: TextStyle( +// color: Colors.grey, +// ), +// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), +// axisLine: AxisLine( +// color: Colors.grey.withOpacity(0.3), +// width: 0.4, +// ), +// ), +// primaryYAxis: NumericAxis( +// isVisible: false, +// labelFormat: '{value} кг', +// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), +// axisLine: AxisLine( +// width: 1, +// ), +// majorTickLines: MajorTickLines(size: 0), +// ), +// series: _getSplineSeries(), +// tooltipBehavior: TooltipBehavior(enable: true), +// ), +// FloatingActionButton.small( +// heroTag: 'addWeight', +// onPressed: () { +// if (widget.chartPoints.isNotEmpty) { +// weightKilo = int.parse(widget.chartPoints.last.weight.toString().split('.')[0]); +// weightGrams = int.parse(widget.chartPoints.last.weight.toString().split('.')[1][0]); +// weightKiloController = FixedExtentScrollController(initialItem: weightKilo - 20); +// weightGramsController = FixedExtentScrollController(initialItem: weightGrams); +// } else { +// weightKiloController = FixedExtentScrollController(); +// weightGramsController = FixedExtentScrollController(); +// } +// showModalBottomSheet( +// useRootNavigator: true, +// context: context, +// builder: (context) { +// return Column( +// children: [ +// Expanded( +// child: Row( +// children: [ +// Expanded( +// child: CupertinoPicker( +// magnification: 1.22, +// squeeze: 1.2, +// useMagnifier: true, +// scrollController: weightKiloController, +// itemExtent: 24, +// onSelectedItemChanged: (int value) { +// weightKilo = value + 20; +// }, +// children: [ +// for (int i = 20; i < 300; i++) Text('$i'), +// ], +// ), +// ), +// Expanded( +// child: CupertinoPicker( +// magnification: 1.22, +// squeeze: 1.2, +// useMagnifier: true, +// scrollController: weightGramsController, +// itemExtent: 24, +// onSelectedItemChanged: (int value) { +// weightGrams = value; +// }, +// children: [ +// for (int i = 0; i < 10; i++) Text('$i'), +// ], +// ), +// ), +// ], +// ), +// ), +// InkWell( +// onTap: () { +// widget.profileCubit.addWeight(weight: double.parse('$weightKilo.$weightGrams')); +// Navigator.of(context).pop(); +// }, +// borderRadius: BorderRadius.circular(16), +// child: Ink( +// width: MediaQuery.of(context).size.width - 32, +// padding: EdgeInsets.all(16), +// decoration: BoxDecoration( +// color: appTheme.blueA400, +// borderRadius: BorderRadius.circular(16), +// ), +// child: Center( +// child: Text( +// 'Сохранить', +// style: TextStyle( +// color: Colors.white, +// ), +// ), +// ), +// ), +// ), +// ], +// ); +// }, +// ); +// }, +// backgroundColor: Colors.red, +// shape: CircleBorder(), +// child: Icon( +// Icons.add, +// color: Colors.white, +// ), +// ), +// ], +// ), +// ], +// ); +// } +// +// List> _getSplineSeries() { +// return >[ +// SplineAreaSeries( +// markerSettings: MarkerSettings( +// isVisible: true, +// color: appTheme.blueA400, +// height: 8, +// width: 8, +// ), +// dataLabelSettings: DataLabelSettings( +// labelAlignment: ChartDataLabelAlignment.top, +// isVisible: true, +// ), +// dataSource: widget.chartPoints, +// borderColor: appTheme.blueA400, +// gradient: LinearGradient( +// colors: [ +// appTheme.blueA400.withOpacity(0.14), +// Colors.transparent, +// ], +// begin: Alignment.topCenter, +// end: Alignment(0, 0.6), +// ), +// name: 'Вес', +// xValueMapper: (ChartPointModel value, int index) => value.createdAt, +// yValueMapper: (ChartPointModel value, int index) => value.weight, +// ), +// ]; +// } +// } diff --git a/lib/features/profile/repositories/profile_repository.dart b/lib/features/profile/repositories/profile_repository.dart index 0520188f..de8c37cf 100644 --- a/lib/features/profile/repositories/profile_repository.dart +++ b/lib/features/profile/repositories/profile_repository.dart @@ -23,6 +23,14 @@ class ProfileRepository { } } + Future getMyProfileDetails() async { + try { + return await profileService.getMyProfileDetails(); + } catch (e) { + rethrow; + } + } + Future addCircumference({ required int chestCircumference, required int waistCircumference, diff --git a/lib/features/profile/services/profile_service.dart b/lib/features/profile/services/profile_service.dart index 8ab452c9..078eb61d 100644 --- a/lib/features/profile/services/profile_service.dart +++ b/lib/features/profile/services/profile_service.dart @@ -17,6 +17,9 @@ abstract class ProfileService { @GET('/api/profile/index') Future getMyProfile(); + @GET('/api/profile/detailz') + Future getMyProfileDetails(); + @POST('/api/profile/addCircumference') Future addCircumference({ @Part(name: 'chest_circumference') required int chestCircumference, diff --git a/lib/features/profile/services/profile_service.g.dart b/lib/features/profile/services/profile_service.g.dart index cbab3e03..a7f855ff 100644 --- a/lib/features/profile/services/profile_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -87,6 +87,39 @@ class _ProfileService implements ProfileService { return _value; } + @override + Future getMyProfileDetails() async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/detailz', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late ProfileDetailsModel _value; + try { + _value = ProfileDetailsModel.fromJson(_result.data!); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + @override Future addCircumference({ required int chestCircumference, diff --git a/lib/features/recipes/models/ingredient.freezed.dart b/lib/features/recipes/models/ingredient.freezed.dart index 63f3facb..2bf96fb3 100644 --- a/lib/features/recipes/models/ingredient.freezed.dart +++ b/lib/features/recipes/models/ingredient.freezed.dart @@ -24,8 +24,12 @@ mixin _$Ingredient { String get unit => throw _privateConstructorUsedError; String get portion => throw _privateConstructorUsedError; + /// Serializes this Ingredient to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Ingredient + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $IngredientCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -49,6 +53,8 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Ingredient + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -92,6 +98,8 @@ class __$$IngredientImplCopyWithImpl<$Res> _$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) : super(_value, _then); + /// Create a copy of Ingredient + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -147,11 +155,13 @@ class _$IngredientImpl implements _Ingredient { (identical(other.portion, portion) || other.portion == portion)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, name, unit, portion); - @JsonKey(ignore: true) + /// Create a copy of Ingredient + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => @@ -180,8 +190,11 @@ abstract class _Ingredient implements Ingredient { String get unit; @override String get portion; + + /// Create a copy of Ingredient + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/recipe_model.freezed.dart b/lib/features/recipes/models/recipe_model.freezed.dart index fb93e70a..691ac1f3 100644 --- a/lib/features/recipes/models/recipe_model.freezed.dart +++ b/lib/features/recipes/models/recipe_model.freezed.dart @@ -30,8 +30,12 @@ mixin _$RecipeModel { String? get image => throw _privateConstructorUsedError; int? get cooking_time => throw _privateConstructorUsedError; + /// Serializes this RecipeModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of RecipeModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $RecipeModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -64,6 +68,8 @@ class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of RecipeModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -146,6 +152,8 @@ class __$$RecipeModelImplCopyWithImpl<$Res> _$RecipeModelImpl _value, $Res Function(_$RecipeModelImpl) _then) : super(_value, _then); + /// Create a copy of RecipeModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -279,7 +287,7 @@ class _$RecipeModelImpl implements _RecipeModel { other.cooking_time == cooking_time)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -293,7 +301,9 @@ class _$RecipeModelImpl implements _RecipeModel { image, cooking_time); - @JsonKey(ignore: true) + /// Create a copy of RecipeModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => @@ -340,8 +350,11 @@ abstract class _RecipeModel implements RecipeModel { String? get image; @override int? get cooking_time; + + /// Create a copy of RecipeModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/recipe_tag_model.freezed.dart b/lib/features/recipes/models/recipe_tag_model.freezed.dart index 25970a55..d9993da3 100644 --- a/lib/features/recipes/models/recipe_tag_model.freezed.dart +++ b/lib/features/recipes/models/recipe_tag_model.freezed.dart @@ -27,8 +27,12 @@ mixin _$RecipeTagModel { @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; + /// Serializes this RecipeTagModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of RecipeTagModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $RecipeTagModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -58,6 +62,8 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of RecipeTagModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -81,6 +87,8 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> ) as $Val); } + /// Create a copy of RecipeTagModel + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $LinksCopyWith<$Res> get links { @@ -89,6 +97,8 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> }); } + /// Create a copy of RecipeTagModel + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $MetaCopyWith<$Res> get meta { @@ -125,6 +135,8 @@ class __$$RecipeTagModelImplCopyWithImpl<$Res> _$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) : super(_value, _then); + /// Create a copy of RecipeTagModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -192,12 +204,14 @@ class _$RecipeTagModelImpl implements _RecipeTagModel { (identical(other.meta, meta) || other.meta == meta)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_data), links, meta); - @JsonKey(ignore: true) + /// Create a copy of RecipeTagModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => @@ -230,8 +244,11 @@ abstract class _RecipeTagModel implements RecipeTagModel { @override @JsonKey(name: "meta") Meta get meta; + + /// Create a copy of RecipeTagModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => throw _privateConstructorUsedError; } @@ -253,8 +270,12 @@ mixin _$RecipeTag { @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; + /// Serializes this RecipeTag to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of RecipeTag + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $RecipeTagCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -282,6 +303,8 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of RecipeTag + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -340,6 +363,8 @@ class __$$RecipeTagImplCopyWithImpl<$Res> _$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) : super(_value, _then); + /// Create a copy of RecipeTag + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -423,12 +448,14 @@ class _$RecipeTagImpl implements _RecipeTag { other.updatedAt == updatedAt)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); - @JsonKey(ignore: true) + /// Create a copy of RecipeTag + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => @@ -469,8 +496,11 @@ abstract class _RecipeTag implements RecipeTag { @override @JsonKey(name: "updated_at") DateTime get updatedAt; + + /// Create a copy of RecipeTag + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/step.freezed.dart b/lib/features/recipes/models/step.freezed.dart index c2014f4f..040dd5aa 100644 --- a/lib/features/recipes/models/step.freezed.dart +++ b/lib/features/recipes/models/step.freezed.dart @@ -23,8 +23,12 @@ mixin _$Step { String? get image => throw _privateConstructorUsedError; String? get description => throw _privateConstructorUsedError; + /// Serializes this Step to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Step + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $StepCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -46,6 +50,8 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Step + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -82,6 +88,8 @@ class __$$StepImplCopyWithImpl<$Res> __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) : super(_value, _then); + /// Create a copy of Step + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -129,11 +137,13 @@ class _$StepImpl implements _Step { other.description == description)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, image, description); - @JsonKey(ignore: true) + /// Create a copy of Step + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$StepImplCopyWith<_$StepImpl> get copyWith => @@ -157,8 +167,11 @@ abstract class _Step implements Step { String? get image; @override String? get description; + + /// Create a copy of Step + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$StepImplCopyWith<_$StepImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart index 9acea107..e15a1a52 100644 --- a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart +++ b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart @@ -147,6 +147,9 @@ class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -163,6 +166,9 @@ class __$$RecipeCreateStateImplCopyWithImpl<$Res> __$$RecipeCreateStateImplCopyWithImpl(_$RecipeCreateStateImpl _value, $Res Function(_$RecipeCreateStateImpl) _then) : super(_value, _then); + + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -343,6 +349,9 @@ class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res> _$RecipeCreateStateLoadingImpl _value, $Res Function(_$RecipeCreateStateLoadingImpl) _then) : super(_value, _then); + + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -551,6 +560,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> $Res Function(_$RecipeCreateStateLoadedImpl) _then) : super(_value, _then); + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -659,6 +670,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> )); } + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $RecipeModelCopyWith<$Res>? get recipe { @@ -671,6 +684,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> }); } + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get selectedType { @@ -679,6 +694,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> }); } + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get selectedCookingTime { @@ -688,6 +705,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> }); } + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get selectedStatus { @@ -887,7 +906,9 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { selectedStatus ]); - @JsonKey(ignore: true) + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> @@ -1136,7 +1157,10 @@ abstract class RecipeCreateStateLoaded implements RecipeCreateState { SelectionPopupModel get selectedType; SelectionPopupModel get selectedCookingTime; SelectionPopupModel get selectedStatus; - @JsonKey(ignore: true) + + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1160,6 +1184,8 @@ class __$$RecipeCreateStateErrorImplCopyWithImpl<$Res> $Res Function(_$RecipeCreateStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1199,7 +1225,9 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> @@ -1349,7 +1377,10 @@ abstract class RecipeCreateStateError implements RecipeCreateState { _$RecipeCreateStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// Create a copy of RecipeCreateState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/presentation/pages/about_recipes_screen.dart b/lib/features/recipes/presentation/pages/about_recipes_screen.dart index b8e8fc9f..c778b585 100644 --- a/lib/features/recipes/presentation/pages/about_recipes_screen.dart +++ b/lib/features/recipes/presentation/pages/about_recipes_screen.dart @@ -7,7 +7,6 @@ import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/commen import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart'; import 'package:eatvio_app/locator_service.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; @@ -345,7 +344,7 @@ class _AboutRecipesScreenState extends State { if (state is CommentsStateLoading) Padding( padding: const EdgeInsets.all(32), - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), if (state is CommentsStateLoaded) CommentsWidget( diff --git a/lib/features/recipes/presentation/pages/recipe_create_screen.dart b/lib/features/recipes/presentation/pages/recipe_create_screen.dart index f40bfc1e..4dd349de 100644 --- a/lib/features/recipes/presentation/pages/recipe_create_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_create_screen.dart @@ -10,7 +10,6 @@ import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_stat import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; import 'package:image_picker/image_picker.dart'; @@ -26,7 +25,7 @@ class RecipeCreateScreen extends StatelessWidget { } else if (state is RecipeCreateStateLoading) { return Scaffold( body: Center( - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), ); } else if (state is RecipeCreateStateError) { diff --git a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart index 62aa362e..d08a86a7 100644 --- a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart @@ -8,7 +8,6 @@ import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_stat import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; import 'package:image_picker/image_picker.dart'; @@ -30,7 +29,7 @@ class RecipeEditScreen extends StatelessWidget { } else if (state is RecipeCreateStateLoading) { return Scaffold( body: Center( - child: CupertinoActivityIndicator(), + child: CircularProgressIndicator(), ), ); } else if (state is RecipeCreateStateError) { diff --git a/lib/features/registration/models/location_model.freezed.dart b/lib/features/registration/models/location_model.freezed.dart index f640ca2e..95f81d60 100644 --- a/lib/features/registration/models/location_model.freezed.dart +++ b/lib/features/registration/models/location_model.freezed.dart @@ -24,8 +24,12 @@ mixin _$LocationModel { @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; + /// Serializes this LocationModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of LocationModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $LocationModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -51,6 +55,8 @@ class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of LocationModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -91,6 +97,8 @@ class __$$LocationModelImplCopyWithImpl<$Res> _$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) : super(_value, _then); + /// Create a copy of LocationModel + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -149,12 +157,14 @@ class _$LocationModelImpl implements _LocationModel { other.responseBody == responseBody)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_locations), responseBody); - @JsonKey(ignore: true) + /// Create a copy of LocationModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => @@ -182,8 +192,11 @@ abstract class _LocationModel implements LocationModel { @override @JsonKey(name: 'response_body') String get responseBody; + + /// Create a copy of LocationModel + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => throw _privateConstructorUsedError; } 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..ae0a9706 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart @@ -18,7 +18,9 @@ final _privateConstructorUsedError = UnsupportedError( mixin _$RegistrationState { UserRegistrationSheet get sheet => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of RegistrationState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $RegistrationStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -44,6 +46,8 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of RegistrationState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -57,6 +61,8 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> ) as $Val); } + /// Create a copy of RegistrationState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $UserRegistrationSheetCopyWith<$Res> get sheet { @@ -88,6 +94,8 @@ class __$$RegistrationStateImplCopyWithImpl<$Res> $Res Function(_$RegistrationStateImpl) _then) : super(_value, _then); + /// Create a copy of RegistrationState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -126,7 +134,9 @@ class _$RegistrationStateImpl implements _RegistrationState { @override int get hashCode => Object.hash(runtimeType, sheet); - @JsonKey(ignore: true) + /// Create a copy of RegistrationState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => @@ -140,8 +150,11 @@ abstract class _RegistrationState implements RegistrationState { @override UserRegistrationSheet get sheet; + + /// Create a copy of RegistrationState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/presentation/pages/city_of_living_screen.dart b/lib/features/registration/presentation/pages/city_of_living_screen.dart index b4c8cbeb..edaf94fe 100644 --- a/lib/features/registration/presentation/pages/city_of_living_screen.dart +++ b/lib/features/registration/presentation/pages/city_of_living_screen.dart @@ -2,7 +2,6 @@ import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:location/location.dart'; @@ -152,7 +151,7 @@ class _CityOfLivingScreenState extends State { Icons.near_me_rounded, color: appTheme.blueA400, ) - : CupertinoActivityIndicator(), + : CircularProgressIndicator(), ), ), ], diff --git a/lib/main.dart b/lib/main.dart index 355eb3ce..61ea707d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,7 +4,6 @@ import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/new_ import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_cubit.dart'; -import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; @@ -15,23 +14,15 @@ import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/old/profile/my_profile_screen/bloc/my_profile_bloc.dart'; import 'package:eatvio_app/old/profile/my_profile_screen/models/my_profile_model.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:intl/date_symbol_data_local.dart'; import 'package:keyboard_dismisser/keyboard_dismisser.dart'; import 'core/app_export.dart'; var globalMessengerKey = GlobalKey(); - -void main() async { +Future main() async { WidgetsFlutterBinding.ensureInitialized(); await di.init(); - SystemChrome.setPreferredOrientations([ - DeviceOrientation.landscapeLeft, - DeviceOrientation.landscapeRight, - DeviceOrientation.portraitUp, - ]); - initializeDateFormatting().then((_) => runApp(MyApp())); + runApp(MyApp()); } class MyApp extends StatelessWidget { @@ -48,17 +39,13 @@ class MyApp extends StatelessWidget { BlocProvider(create: (context) => sl()..loadDiets()), BlocProvider(create: (context) => MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel()))..add(MyProfileInitialEvent())), BlocProvider(create: (context) => sl()..add(LoadDiary())), - BlocProvider(create: (context) => sl()..getChatRooms()), BlocProvider(create: (context) => sl()..loadCalendarList()), BlocProvider(create: (context) => sl()..loadRecipeCreate()), ], child: KeyboardDismisser( - gestures: [ - GestureType.onTap, - GestureType.onPanUpdateDownDirection, - ], child: MaterialApp.router( theme: theme, + themeMode: ThemeMode.light, routerConfig: AppRouter.appRouter, debugShowCheckedModeBanner: false, localizationsDelegates: [ From a7f8c39030031359a049757578f0dc93a3b6841a Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 11 Sep 2024 12:48:23 +0300 Subject: [PATCH 11/31] feat(plans): add plans, refactor descriptions in recipes, diets, blogPost --- lib/app_router.dart | 9 + .../presentation/pages/blog_post_screen.dart | 26 +- .../presentation/pages/about_diet_screen.dart | 22 +- .../feed/presentation/pages/feed_screen.dart | 67 +- .../presentation/widgets/diets_widget.dart | 16 +- .../presentation/widgets/plan_widget.dart | 173 +++ .../presentation/widgets/recipes_widget.dart | 16 +- .../plans/models/plan_pagination_model.dart | 65 + .../models/plan_pagination_model.freezed.dart | 1251 +++++++++++++++++ .../plans/models/plan_pagination_model.g.dart | 95 ++ .../bloc/plans_cubit/plans_cubit.dart | 19 + .../bloc/plans_cubit/plans_state.dart | 19 + .../bloc/plans_cubit/plans_state.freezed.dart | 646 +++++++++ .../presentation/pages/about_plan_screen.dart | 20 + .../plans/repositories/plans_repository.dart | 16 + .../plans/services/plans_service.dart | 13 + .../plans/services/plans_service.g.dart | 86 ++ .../pages/about_recipes_screen.dart | 22 +- lib/locator_service.dart | 6 + lib/main.dart | 3 + pubspec.yaml | 4 +- 21 files changed, 2529 insertions(+), 65 deletions(-) create mode 100644 lib/features/feed/presentation/widgets/plan_widget.dart create mode 100644 lib/features/plans/models/plan_pagination_model.dart create mode 100644 lib/features/plans/models/plan_pagination_model.freezed.dart create mode 100644 lib/features/plans/models/plan_pagination_model.g.dart create mode 100644 lib/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart create mode 100644 lib/features/plans/presentation/bloc/plans_cubit/plans_state.dart create mode 100644 lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart create mode 100644 lib/features/plans/presentation/pages/about_plan_screen.dart create mode 100644 lib/features/plans/repositories/plans_repository.dart create mode 100644 lib/features/plans/services/plans_service.dart create mode 100644 lib/features/plans/services/plans_service.g.dart diff --git a/lib/app_router.dart b/lib/app_router.dart index 6e4bac50..2851b3c6 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -15,6 +15,8 @@ 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/menu/presentation/pages/menu_screen.dart'; import 'package:eatvio_app/features/notifications/presentation/pages/notifications_screen.dart'; +import 'package:eatvio_app/features/plans/models/plan_pagination_model.dart'; +import 'package:eatvio_app/features/plans/presentation/pages/about_plan_screen.dart'; import 'package:eatvio_app/features/profile/presentation/pages/profile_screen.dart'; import 'package:eatvio_app/features/recipes/presentation/pages/about_recipes_screen.dart'; import 'package:eatvio_app/features/recipes/presentation/pages/recipe_create_screen.dart'; @@ -103,6 +105,13 @@ class AppRouter { ), ], ), + GoRoute( + path: '/about-plan-screen', + name: 'aboutPlanScreen', + builder: (context, state) => AboutPlanScreen( + planModel: state.extra as PlanModel, + ), + ), GoRoute( path: '/about-recipes-screen', name: 'aboutRecipesScreen', 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 3114518a..1fcacce8 100644 --- a/lib/features/blog_post/presentation/pages/blog_post_screen.dart +++ b/lib/features/blog_post/presentation/pages/blog_post_screen.dart @@ -1,5 +1,4 @@ import 'dart:io'; - import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; @@ -9,6 +8,7 @@ import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; import 'package:share_plus/share_plus.dart'; @@ -228,22 +228,18 @@ class _BlogPostScreenState extends State { ), ), ), - if (widget.blogPost.description.isNotEmpty) SizedBox(height: 12), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Align( - alignment: Alignment.centerLeft, - child: Text( - widget.blogPost.description, - style: TextStyle( - color: Colors.black, - fontSize: 14, - fontWeight: FontWeight.w400, - height: 1, - ), + if (widget.blogPost.description.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Html( + data: widget.blogPost.description, + style: { + "*": Style( + color: Colors.black87, + ), + }, ), ), - ), SizedBox(height: 8), CachedNetworkImage( imageUrl: baseUrl + '/storage/' + (widget.blogPost.image), diff --git a/lib/features/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart index 9262b194..e78dab2c 100644 --- a/lib/features/diets/presentation/pages/about_diet_screen.dart +++ b/lib/features/diets/presentation/pages/about_diet_screen.dart @@ -7,6 +7,7 @@ import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/commen import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; class AboutDietScreen extends StatefulWidget { @@ -261,19 +262,18 @@ class _AboutDietScreenState extends State { ], ), ), - SizedBox(height: 12), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Text( - widget.diet.details, - style: TextStyle( - color: Colors.black, - fontSize: 14, - fontWeight: FontWeight.w400, - height: 1.2, + if (widget.diet.details.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Html( + data: widget.diet.details, + style: { + "*": Style( + color: Colors.black87, + ), + }, ), ), - ), SizedBox(height: 12), CachedNetworkImage( imageUrl: baseUrl + '/storage/' + widget.diet.image, diff --git a/lib/features/feed/presentation/pages/feed_screen.dart b/lib/features/feed/presentation/pages/feed_screen.dart index e5f1afa6..957ea8a5 100644 --- a/lib/features/feed/presentation/pages/feed_screen.dart +++ b/lib/features/feed/presentation/pages/feed_screen.dart @@ -7,8 +7,11 @@ import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/blog_post_widget.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/diets_widget.dart'; +import 'package:eatvio_app/features/feed/presentation/widgets/plan_widget.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/recipes_widget.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/tags_modal_widget.dart'; +import 'package:eatvio_app/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart'; +import 'package:eatvio_app/features/plans/presentation/bloc/plans_cubit/plans_state.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -30,12 +33,14 @@ class _FeedScreenState extends State { final blogPostsScrollController = ScrollController(); final recipesScrollController = ScrollController(); final dietsScrollController = ScrollController(); + final plansScrollController = ScrollController(); @override void initState() { blogPostsScrollController.addListener(_onScrollBlogPosts); - recipesScrollController.addListener(_onScrollBlogRecipes); - dietsScrollController.addListener(_onScrollBlogDiets); + recipesScrollController.addListener(_onScrollRecipes); + dietsScrollController.addListener(_onScrollDiets); + plansScrollController.addListener(_onScrollPlans); super.initState(); } @@ -45,23 +50,18 @@ class _FeedScreenState extends State { } } - _onScrollBlogRecipes() { - if (blogPostsScrollController.offset >= blogPostsScrollController.position.maxScrollExtent && !blogPostsScrollController.position.outOfRange) { - context.read().loadNextPage(); - } - } + _onScrollRecipes() {} - _onScrollBlogDiets() { - if (blogPostsScrollController.offset >= blogPostsScrollController.position.maxScrollExtent && !blogPostsScrollController.position.outOfRange) { - context.read().loadNextPage(); - } - } + _onScrollDiets() {} + + _onScrollPlans() {} @override void dispose() { blogPostsScrollController.dispose(); recipesScrollController.dispose(); dietsScrollController.dispose(); + plansScrollController.dispose(); super.dispose(); } @@ -143,6 +143,8 @@ class _FeedScreenState extends State { return _buildAllRecipes(); else if (_selectedChipIndex == 2) return _buildDiets(); + else if (_selectedChipIndex == 3) + return _buildPlans(); else return Center(child: Text(chipsLabelList[_selectedChipIndex])); }, @@ -277,6 +279,47 @@ class _FeedScreenState extends State { ); } + _buildPlans() { + return RefreshIndicator( + onRefresh: () => context.read().getPlans(), + child: BlocBuilder( + builder: (BuildContext context, PlansState state) { + if (state is PlansStateLoaded) { + return ListView.separated( + padding: EdgeInsets.symmetric(vertical: 8), + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, index) { + return PlanWidget(planModel: state.plansModel.data[index]); + }, + separatorBuilder: (context, index) { + return SizedBox(height: 8); + }, + itemCount: state.plansModel.data.length, + ); + } else if (state is PlansStateError) { + return Scaffold( + backgroundColor: Colors.grey.shade200, + body: Padding( + padding: const EdgeInsets.all(16), + child: Center( + child: Text(state.errorMessage), + ), + ), + ); + } else { + return Scaffold( + backgroundColor: Colors.grey.shade200, + body: Center( + child: CircularProgressIndicator(), + ), + ); + } + }, + ), + ); + } + _chipGroup() { return PreferredSize( preferredSize: Size(MediaQuery.of(context).size.width, 32), diff --git a/lib/features/feed/presentation/widgets/diets_widget.dart b/lib/features/feed/presentation/widgets/diets_widget.dart index 7bc9054e..c327c2a4 100644 --- a/lib/features/feed/presentation/widgets/diets_widget.dart +++ b/lib/features/feed/presentation/widgets/diets_widget.dart @@ -2,6 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; class DietsWidget extends StatefulWidget { @@ -123,14 +124,15 @@ class _DietsWidgetState extends State { ), ), ), - SizedBox(height: 8), Padding( - padding: const EdgeInsets.symmetric(horizontal: 12), - child: Text( - widget.diet.details, - style: TextStyle( - color: Colors.black87, - ), + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Html( + data: widget.diet.details, + style: { + "*": Style( + color: Colors.black87, + ), + }, ), ), SizedBox(height: 12), diff --git a/lib/features/feed/presentation/widgets/plan_widget.dart b/lib/features/feed/presentation/widgets/plan_widget.dart new file mode 100644 index 00000000..fc4bb8cb --- /dev/null +++ b/lib/features/feed/presentation/widgets/plan_widget.dart @@ -0,0 +1,173 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:eatvio_app/core/constants/constants.dart'; +import 'package:eatvio_app/features/plans/models/plan_pagination_model.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:go_router/go_router.dart'; + +class PlanWidget extends StatelessWidget { + final PlanModel planModel; + + const PlanWidget({ + super.key, + required this.planModel, + }); + + @override + Widget build(BuildContext context) { + return InkWell( + borderRadius: BorderRadius.circular(12), + onTap: () => GoRouter.of(context).pushNamed( + 'aboutPlanScreen', + extra: planModel, + ), + child: Ink( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + ClipRRect( + borderRadius: BorderRadius.vertical(top: Radius.circular(12)), + child: CachedNetworkImage( + imageUrl: baseUrl + '/storage/' + planModel.image, + fit: BoxFit.fitWidth, + width: MediaQuery.of(context).size.width, + ), + ), + Positioned( + left: 8, + bottom: 8, + child: Wrap( + runSpacing: 8, + children: [ + _iconButton(Icons.timelapse_rounded, '${planModel.duration} дней'), + SizedBox(width: 8), + ], + ), + ), + Positioned( + left: 8, + top: 8, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.8), + borderRadius: BorderRadius.circular(16), + ), + child: Row( + children: [ + Icon( + Icons.favorite_rounded, + size: 16, + color: Colors.black, + ), + SizedBox(width: 4), + Text( + '0', + style: TextStyle( + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.w400, + ), + ), + ], + ), + ), + ), + Positioned( + right: 8, + top: 8, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.8), + borderRadius: BorderRadius.circular(16), + ), + child: Row( + children: [ + Icon( + Icons.visibility_rounded, + size: 16, + color: Colors.black, + ), + SizedBox(width: 4), + Text( + '0', + style: TextStyle( + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.w400, + ), + ), + ], + ), + ), + ), + ], + ), + SizedBox(height: 12), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 12), + child: Text( + planModel.name, + style: TextStyle( + fontWeight: FontWeight.w600, + color: Colors.black87, + ), + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Html( + data: planModel.details, + style: { + "*": Style( + color: Colors.black87, + ), + }, + ), + ), + SizedBox(height: 12), + ], + ), + ), + ); + } + + _iconButton(IconData icon, [String? text]) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.8), + borderRadius: BorderRadius.circular(16), + ), + height: 32, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + icon, + size: 16, + color: Colors.black, + ), + if (text != null) SizedBox(width: 8), + if (text != null) + Text( + text, + style: TextStyle( + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ); + } +} diff --git a/lib/features/feed/presentation/widgets/recipes_widget.dart b/lib/features/feed/presentation/widgets/recipes_widget.dart index 54fb1b2d..151831f8 100644 --- a/lib/features/feed/presentation/widgets/recipes_widget.dart +++ b/lib/features/feed/presentation/widgets/recipes_widget.dart @@ -2,6 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/feed/models/recipes_model.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; class RecipesWidget extends StatefulWidget { @@ -123,14 +124,15 @@ class _RecipesWidgetState extends State { ), ), ), - SizedBox(height: 8), Padding( - padding: const EdgeInsets.symmetric(horizontal: 12), - child: Text( - widget.recipes.description, - style: TextStyle( - color: Colors.black87, - ), + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Html( + data: widget.recipes.description, + style: { + "*": Style( + color: Colors.black87, + ), + }, ), ), SizedBox(height: 12), diff --git a/lib/features/plans/models/plan_pagination_model.dart b/lib/features/plans/models/plan_pagination_model.dart new file mode 100644 index 00000000..767d959a --- /dev/null +++ b/lib/features/plans/models/plan_pagination_model.dart @@ -0,0 +1,65 @@ +import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'plan_pagination_model.freezed.dart'; + +part 'plan_pagination_model.g.dart'; + +@freezed +class PlanPaginationModel with _$PlanPaginationModel { + const factory PlanPaginationModel({ + @JsonKey(name: "data") required List data, + @JsonKey(name: "links") required Links links, + @JsonKey(name: "meta") required Meta meta, + }) = _PlanPaginationModel; + + factory PlanPaginationModel.fromJson(Map json) => _$PlanPaginationModelFromJson(json); +} + +@freezed +class PlanModel with _$PlanModel { + const factory PlanModel({ + @JsonKey(name: "id") required int id, + @JsonKey(name: "name") required String name, + @JsonKey(name: "image") required String image, + @JsonKey(name: "duration") required int duration, + @JsonKey(name: "state") required String state, + @JsonKey(name: "type") required PlanType type, + @JsonKey(name: "details") required String details, + @JsonKey(name: "packets_count") required int packetsCount, + @JsonKey(name: "packet1_options") dynamic packet1Options, + @JsonKey(name: "packet2_options") dynamic packet2Options, + @JsonKey(name: "packet3_options") dynamic packet3Options, + @JsonKey(name: "author") required Author author, + @JsonKey(name: "total_likes") required int totalLikes, + @JsonKey(name: "total_views") required int totalViews, + @JsonKey(name: "total_comments") required int totalComments, + }) = _PlanModel; + + factory PlanModel.fromJson(Map json) => _$PlanModelFromJson(json); +} + +@freezed +class PacketOptions with _$PacketOptions { + const factory PacketOptions({ + @JsonKey(name: "items") required List items, + @JsonKey(name: "price") required dynamic price, + @JsonKey(name: "short") required String short, + @JsonKey(name: "description") required String description, + }) = _PacketOptions; + + factory PacketOptions.fromJson(Map json) => _$PacketOptionsFromJson(json); +} + +@freezed +class PlanType with _$PlanType { + const factory PlanType({ + @JsonKey(name: "fit") required bool fit, + @JsonKey(name: "slim") required bool slim, + @JsonKey(name: "behavior") required bool behavior, + @JsonKey(name: "wellness") required bool wellness, + }) = _PlanType; + + factory PlanType.fromJson(Map json) => _$PlanTypeFromJson(json); +} diff --git a/lib/features/plans/models/plan_pagination_model.freezed.dart b/lib/features/plans/models/plan_pagination_model.freezed.dart new file mode 100644 index 00000000..caa2ef10 --- /dev/null +++ b/lib/features/plans/models/plan_pagination_model.freezed.dart @@ -0,0 +1,1251 @@ +// 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 'plan_pagination_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'); + +PlanPaginationModel _$PlanPaginationModelFromJson(Map json) { + return _PlanPaginationModel.fromJson(json); +} + +/// @nodoc +mixin _$PlanPaginationModel { + @JsonKey(name: "data") + List get data => throw _privateConstructorUsedError; + @JsonKey(name: "links") + Links get links => throw _privateConstructorUsedError; + @JsonKey(name: "meta") + Meta get meta => throw _privateConstructorUsedError; + + /// Serializes this PlanPaginationModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of PlanPaginationModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $PlanPaginationModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $PlanPaginationModelCopyWith<$Res> { + factory $PlanPaginationModelCopyWith( + PlanPaginationModel value, $Res Function(PlanPaginationModel) then) = + _$PlanPaginationModelCopyWithImpl<$Res, PlanPaginationModel>; + @useResult + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); + + $LinksCopyWith<$Res> get links; + $MetaCopyWith<$Res> get meta; +} + +/// @nodoc +class _$PlanPaginationModelCopyWithImpl<$Res, $Val extends PlanPaginationModel> + implements $PlanPaginationModelCopyWith<$Res> { + _$PlanPaginationModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of PlanPaginationModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? data = null, + Object? links = null, + Object? meta = null, + }) { + return _then(_value.copyWith( + data: null == data + ? _value.data + : data // ignore: cast_nullable_to_non_nullable + as List, + links: null == links + ? _value.links + : links // ignore: cast_nullable_to_non_nullable + as Links, + meta: null == meta + ? _value.meta + : meta // ignore: cast_nullable_to_non_nullable + as Meta, + ) as $Val); + } + + /// Create a copy of PlanPaginationModel + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $LinksCopyWith<$Res> get links { + return $LinksCopyWith<$Res>(_value.links, (value) { + return _then(_value.copyWith(links: value) as $Val); + }); + } + + /// Create a copy of PlanPaginationModel + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $MetaCopyWith<$Res> get meta { + return $MetaCopyWith<$Res>(_value.meta, (value) { + return _then(_value.copyWith(meta: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$PlanPaginationModelImplCopyWith<$Res> + implements $PlanPaginationModelCopyWith<$Res> { + factory _$$PlanPaginationModelImplCopyWith(_$PlanPaginationModelImpl value, + $Res Function(_$PlanPaginationModelImpl) then) = + __$$PlanPaginationModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); + + @override + $LinksCopyWith<$Res> get links; + @override + $MetaCopyWith<$Res> get meta; +} + +/// @nodoc +class __$$PlanPaginationModelImplCopyWithImpl<$Res> + extends _$PlanPaginationModelCopyWithImpl<$Res, _$PlanPaginationModelImpl> + implements _$$PlanPaginationModelImplCopyWith<$Res> { + __$$PlanPaginationModelImplCopyWithImpl(_$PlanPaginationModelImpl _value, + $Res Function(_$PlanPaginationModelImpl) _then) + : super(_value, _then); + + /// Create a copy of PlanPaginationModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? data = null, + Object? links = null, + Object? meta = null, + }) { + return _then(_$PlanPaginationModelImpl( + data: null == data + ? _value._data + : data // ignore: cast_nullable_to_non_nullable + as List, + links: null == links + ? _value.links + : links // ignore: cast_nullable_to_non_nullable + as Links, + meta: null == meta + ? _value.meta + : meta // ignore: cast_nullable_to_non_nullable + as Meta, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$PlanPaginationModelImpl implements _PlanPaginationModel { + const _$PlanPaginationModelImpl( + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) + : _data = data; + + factory _$PlanPaginationModelImpl.fromJson(Map json) => + _$$PlanPaginationModelImplFromJson(json); + + final List _data; + @override + @JsonKey(name: "data") + List get data { + if (_data is EqualUnmodifiableListView) return _data; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_data); + } + + @override + @JsonKey(name: "links") + final Links links; + @override + @JsonKey(name: "meta") + final Meta meta; + + @override + String toString() { + return 'PlanPaginationModel(data: $data, links: $links, meta: $meta)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$PlanPaginationModelImpl && + const DeepCollectionEquality().equals(other._data, _data) && + (identical(other.links, links) || other.links == links) && + (identical(other.meta, meta) || other.meta == meta)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + + /// Create a copy of PlanPaginationModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => + __$$PlanPaginationModelImplCopyWithImpl<_$PlanPaginationModelImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$PlanPaginationModelImplToJson( + this, + ); + } +} + +abstract class _PlanPaginationModel implements PlanPaginationModel { + const factory _PlanPaginationModel( + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required final Links links, + @JsonKey(name: "meta") required final Meta meta}) = + _$PlanPaginationModelImpl; + + factory _PlanPaginationModel.fromJson(Map json) = + _$PlanPaginationModelImpl.fromJson; + + @override + @JsonKey(name: "data") + List get data; + @override + @JsonKey(name: "links") + Links get links; + @override + @JsonKey(name: "meta") + Meta get meta; + + /// Create a copy of PlanPaginationModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => + throw _privateConstructorUsedError; +} + +PlanModel _$PlanModelFromJson(Map json) { + return _PlanModel.fromJson(json); +} + +/// @nodoc +mixin _$PlanModel { + @JsonKey(name: "id") + int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") + String get name => throw _privateConstructorUsedError; + @JsonKey(name: "image") + String get image => throw _privateConstructorUsedError; + @JsonKey(name: "duration") + int get duration => throw _privateConstructorUsedError; + @JsonKey(name: "state") + String get state => throw _privateConstructorUsedError; + @JsonKey(name: "type") + PlanType get type => throw _privateConstructorUsedError; + @JsonKey(name: "details") + String get details => throw _privateConstructorUsedError; + @JsonKey(name: "packets_count") + int get packetsCount => throw _privateConstructorUsedError; + @JsonKey(name: "packet1_options") + dynamic get packet1Options => throw _privateConstructorUsedError; + @JsonKey(name: "packet2_options") + dynamic get packet2Options => throw _privateConstructorUsedError; + @JsonKey(name: "packet3_options") + dynamic get packet3Options => throw _privateConstructorUsedError; + @JsonKey(name: "author") + Author get author => throw _privateConstructorUsedError; + @JsonKey(name: "total_likes") + int get totalLikes => throw _privateConstructorUsedError; + @JsonKey(name: "total_views") + int get totalViews => throw _privateConstructorUsedError; + @JsonKey(name: "total_comments") + int get totalComments => throw _privateConstructorUsedError; + + /// Serializes this PlanModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of PlanModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $PlanModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $PlanModelCopyWith<$Res> { + factory $PlanModelCopyWith(PlanModel value, $Res Function(PlanModel) then) = + _$PlanModelCopyWithImpl<$Res, PlanModel>; + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "name") String name, + @JsonKey(name: "image") String image, + @JsonKey(name: "duration") int duration, + @JsonKey(name: "state") String state, + @JsonKey(name: "type") PlanType type, + @JsonKey(name: "details") String details, + @JsonKey(name: "packets_count") int packetsCount, + @JsonKey(name: "packet1_options") dynamic packet1Options, + @JsonKey(name: "packet2_options") dynamic packet2Options, + @JsonKey(name: "packet3_options") dynamic packet3Options, + @JsonKey(name: "author") Author author, + @JsonKey(name: "total_likes") int totalLikes, + @JsonKey(name: "total_views") int totalViews, + @JsonKey(name: "total_comments") int totalComments}); + + $PlanTypeCopyWith<$Res> get type; + $AuthorCopyWith<$Res> get author; +} + +/// @nodoc +class _$PlanModelCopyWithImpl<$Res, $Val extends PlanModel> + implements $PlanModelCopyWith<$Res> { + _$PlanModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of PlanModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? image = null, + Object? duration = null, + Object? state = null, + Object? type = null, + Object? details = null, + Object? packetsCount = null, + Object? packet1Options = freezed, + Object? packet2Options = freezed, + Object? packet3Options = freezed, + Object? author = null, + Object? totalLikes = null, + Object? totalViews = null, + Object? totalComments = 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, + image: null == image + ? _value.image + : image // ignore: cast_nullable_to_non_nullable + as String, + duration: null == duration + ? _value.duration + : duration // ignore: cast_nullable_to_non_nullable + as int, + state: null == state + ? _value.state + : state // ignore: cast_nullable_to_non_nullable + as String, + type: null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as PlanType, + details: null == details + ? _value.details + : details // ignore: cast_nullable_to_non_nullable + as String, + packetsCount: null == packetsCount + ? _value.packetsCount + : packetsCount // ignore: cast_nullable_to_non_nullable + as int, + packet1Options: freezed == packet1Options + ? _value.packet1Options + : packet1Options // ignore: cast_nullable_to_non_nullable + as dynamic, + packet2Options: freezed == packet2Options + ? _value.packet2Options + : packet2Options // ignore: cast_nullable_to_non_nullable + as dynamic, + packet3Options: freezed == packet3Options + ? _value.packet3Options + : packet3Options // ignore: cast_nullable_to_non_nullable + as dynamic, + author: null == author + ? _value.author + : author // ignore: cast_nullable_to_non_nullable + as Author, + totalLikes: null == totalLikes + ? _value.totalLikes + : totalLikes // ignore: cast_nullable_to_non_nullable + as int, + totalViews: null == totalViews + ? _value.totalViews + : totalViews // ignore: cast_nullable_to_non_nullable + as int, + totalComments: null == totalComments + ? _value.totalComments + : totalComments // ignore: cast_nullable_to_non_nullable + as int, + ) as $Val); + } + + /// Create a copy of PlanModel + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $PlanTypeCopyWith<$Res> get type { + return $PlanTypeCopyWith<$Res>(_value.type, (value) { + return _then(_value.copyWith(type: value) as $Val); + }); + } + + /// Create a copy of PlanModel + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $AuthorCopyWith<$Res> get author { + return $AuthorCopyWith<$Res>(_value.author, (value) { + return _then(_value.copyWith(author: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$PlanModelImplCopyWith<$Res> + implements $PlanModelCopyWith<$Res> { + factory _$$PlanModelImplCopyWith( + _$PlanModelImpl value, $Res Function(_$PlanModelImpl) then) = + __$$PlanModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "name") String name, + @JsonKey(name: "image") String image, + @JsonKey(name: "duration") int duration, + @JsonKey(name: "state") String state, + @JsonKey(name: "type") PlanType type, + @JsonKey(name: "details") String details, + @JsonKey(name: "packets_count") int packetsCount, + @JsonKey(name: "packet1_options") dynamic packet1Options, + @JsonKey(name: "packet2_options") dynamic packet2Options, + @JsonKey(name: "packet3_options") dynamic packet3Options, + @JsonKey(name: "author") Author author, + @JsonKey(name: "total_likes") int totalLikes, + @JsonKey(name: "total_views") int totalViews, + @JsonKey(name: "total_comments") int totalComments}); + + @override + $PlanTypeCopyWith<$Res> get type; + @override + $AuthorCopyWith<$Res> get author; +} + +/// @nodoc +class __$$PlanModelImplCopyWithImpl<$Res> + extends _$PlanModelCopyWithImpl<$Res, _$PlanModelImpl> + implements _$$PlanModelImplCopyWith<$Res> { + __$$PlanModelImplCopyWithImpl( + _$PlanModelImpl _value, $Res Function(_$PlanModelImpl) _then) + : super(_value, _then); + + /// Create a copy of PlanModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? image = null, + Object? duration = null, + Object? state = null, + Object? type = null, + Object? details = null, + Object? packetsCount = null, + Object? packet1Options = freezed, + Object? packet2Options = freezed, + Object? packet3Options = freezed, + Object? author = null, + Object? totalLikes = null, + Object? totalViews = null, + Object? totalComments = null, + }) { + return _then(_$PlanModelImpl( + 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, + image: null == image + ? _value.image + : image // ignore: cast_nullable_to_non_nullable + as String, + duration: null == duration + ? _value.duration + : duration // ignore: cast_nullable_to_non_nullable + as int, + state: null == state + ? _value.state + : state // ignore: cast_nullable_to_non_nullable + as String, + type: null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as PlanType, + details: null == details + ? _value.details + : details // ignore: cast_nullable_to_non_nullable + as String, + packetsCount: null == packetsCount + ? _value.packetsCount + : packetsCount // ignore: cast_nullable_to_non_nullable + as int, + packet1Options: freezed == packet1Options + ? _value.packet1Options + : packet1Options // ignore: cast_nullable_to_non_nullable + as dynamic, + packet2Options: freezed == packet2Options + ? _value.packet2Options + : packet2Options // ignore: cast_nullable_to_non_nullable + as dynamic, + packet3Options: freezed == packet3Options + ? _value.packet3Options + : packet3Options // ignore: cast_nullable_to_non_nullable + as dynamic, + author: null == author + ? _value.author + : author // ignore: cast_nullable_to_non_nullable + as Author, + totalLikes: null == totalLikes + ? _value.totalLikes + : totalLikes // ignore: cast_nullable_to_non_nullable + as int, + totalViews: null == totalViews + ? _value.totalViews + : totalViews // ignore: cast_nullable_to_non_nullable + as int, + totalComments: null == totalComments + ? _value.totalComments + : totalComments // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$PlanModelImpl implements _PlanModel { + const _$PlanModelImpl( + {@JsonKey(name: "id") required this.id, + @JsonKey(name: "name") required this.name, + @JsonKey(name: "image") required this.image, + @JsonKey(name: "duration") required this.duration, + @JsonKey(name: "state") required this.state, + @JsonKey(name: "type") required this.type, + @JsonKey(name: "details") required this.details, + @JsonKey(name: "packets_count") required this.packetsCount, + @JsonKey(name: "packet1_options") this.packet1Options, + @JsonKey(name: "packet2_options") this.packet2Options, + @JsonKey(name: "packet3_options") this.packet3Options, + @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}); + + factory _$PlanModelImpl.fromJson(Map json) => + _$$PlanModelImplFromJson(json); + + @override + @JsonKey(name: "id") + final int id; + @override + @JsonKey(name: "name") + final String name; + @override + @JsonKey(name: "image") + final String image; + @override + @JsonKey(name: "duration") + final int duration; + @override + @JsonKey(name: "state") + final String state; + @override + @JsonKey(name: "type") + final PlanType type; + @override + @JsonKey(name: "details") + final String details; + @override + @JsonKey(name: "packets_count") + final int packetsCount; + @override + @JsonKey(name: "packet1_options") + final dynamic packet1Options; + @override + @JsonKey(name: "packet2_options") + final dynamic packet2Options; + @override + @JsonKey(name: "packet3_options") + final dynamic packet3Options; + @override + @JsonKey(name: "author") + final Author author; + @override + @JsonKey(name: "total_likes") + final int totalLikes; + @override + @JsonKey(name: "total_views") + final int totalViews; + @override + @JsonKey(name: "total_comments") + final int totalComments; + + @override + String toString() { + return 'PlanModel(id: $id, name: $name, image: $image, duration: $duration, state: $state, type: $type, details: $details, packetsCount: $packetsCount, packet1Options: $packet1Options, packet2Options: $packet2Options, packet3Options: $packet3Options, author: $author, totalLikes: $totalLikes, totalViews: $totalViews, totalComments: $totalComments)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$PlanModelImpl && + (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.state, state) || other.state == state) && + (identical(other.type, type) || other.type == type) && + (identical(other.details, details) || other.details == details) && + (identical(other.packetsCount, packetsCount) || + other.packetsCount == packetsCount) && + const DeepCollectionEquality() + .equals(other.packet1Options, packet1Options) && + const DeepCollectionEquality() + .equals(other.packet2Options, packet2Options) && + const DeepCollectionEquality() + .equals(other.packet3Options, packet3Options) && + (identical(other.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)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + id, + name, + image, + duration, + state, + type, + details, + packetsCount, + const DeepCollectionEquality().hash(packet1Options), + const DeepCollectionEquality().hash(packet2Options), + const DeepCollectionEquality().hash(packet3Options), + author, + totalLikes, + totalViews, + totalComments); + + /// Create a copy of PlanModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => + __$$PlanModelImplCopyWithImpl<_$PlanModelImpl>(this, _$identity); + + @override + Map toJson() { + return _$$PlanModelImplToJson( + this, + ); + } +} + +abstract class _PlanModel implements PlanModel { + const factory _PlanModel( + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "image") required final String image, + @JsonKey(name: "duration") required final int duration, + @JsonKey(name: "state") required final String state, + @JsonKey(name: "type") required final PlanType type, + @JsonKey(name: "details") required final String details, + @JsonKey(name: "packets_count") required final int packetsCount, + @JsonKey(name: "packet1_options") final dynamic packet1Options, + @JsonKey(name: "packet2_options") final dynamic packet2Options, + @JsonKey(name: "packet3_options") final dynamic packet3Options, + @JsonKey(name: "author") required final Author author, + @JsonKey(name: "total_likes") required final int totalLikes, + @JsonKey(name: "total_views") required final int totalViews, + @JsonKey(name: "total_comments") required final int totalComments}) = + _$PlanModelImpl; + + factory _PlanModel.fromJson(Map json) = + _$PlanModelImpl.fromJson; + + @override + @JsonKey(name: "id") + int get id; + @override + @JsonKey(name: "name") + String get name; + @override + @JsonKey(name: "image") + String get image; + @override + @JsonKey(name: "duration") + int get duration; + @override + @JsonKey(name: "state") + String get state; + @override + @JsonKey(name: "type") + PlanType get type; + @override + @JsonKey(name: "details") + String get details; + @override + @JsonKey(name: "packets_count") + int get packetsCount; + @override + @JsonKey(name: "packet1_options") + dynamic get packet1Options; + @override + @JsonKey(name: "packet2_options") + dynamic get packet2Options; + @override + @JsonKey(name: "packet3_options") + dynamic get packet3Options; + @override + @JsonKey(name: "author") + Author get author; + @override + @JsonKey(name: "total_likes") + int get totalLikes; + @override + @JsonKey(name: "total_views") + int get totalViews; + @override + @JsonKey(name: "total_comments") + int get totalComments; + + /// Create a copy of PlanModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => + throw _privateConstructorUsedError; +} + +PacketOptions _$PacketOptionsFromJson(Map json) { + return _PacketOptions.fromJson(json); +} + +/// @nodoc +mixin _$PacketOptions { + @JsonKey(name: "items") + List get items => throw _privateConstructorUsedError; + @JsonKey(name: "price") + dynamic get price => throw _privateConstructorUsedError; + @JsonKey(name: "short") + String get short => throw _privateConstructorUsedError; + @JsonKey(name: "description") + String get description => throw _privateConstructorUsedError; + + /// Serializes this PacketOptions to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of PacketOptions + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $PacketOptionsCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $PacketOptionsCopyWith<$Res> { + factory $PacketOptionsCopyWith( + PacketOptions value, $Res Function(PacketOptions) then) = + _$PacketOptionsCopyWithImpl<$Res, PacketOptions>; + @useResult + $Res call( + {@JsonKey(name: "items") List items, + @JsonKey(name: "price") dynamic price, + @JsonKey(name: "short") String short, + @JsonKey(name: "description") String description}); +} + +/// @nodoc +class _$PacketOptionsCopyWithImpl<$Res, $Val extends PacketOptions> + implements $PacketOptionsCopyWith<$Res> { + _$PacketOptionsCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of PacketOptions + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? items = null, + Object? price = freezed, + Object? short = null, + Object? description = null, + }) { + return _then(_value.copyWith( + items: null == items + ? _value.items + : items // ignore: cast_nullable_to_non_nullable + as List, + price: freezed == price + ? _value.price + : price // ignore: cast_nullable_to_non_nullable + as dynamic, + short: null == short + ? _value.short + : short // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$PacketOptionsImplCopyWith<$Res> + implements $PacketOptionsCopyWith<$Res> { + factory _$$PacketOptionsImplCopyWith( + _$PacketOptionsImpl value, $Res Function(_$PacketOptionsImpl) then) = + __$$PacketOptionsImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "items") List items, + @JsonKey(name: "price") dynamic price, + @JsonKey(name: "short") String short, + @JsonKey(name: "description") String description}); +} + +/// @nodoc +class __$$PacketOptionsImplCopyWithImpl<$Res> + extends _$PacketOptionsCopyWithImpl<$Res, _$PacketOptionsImpl> + implements _$$PacketOptionsImplCopyWith<$Res> { + __$$PacketOptionsImplCopyWithImpl( + _$PacketOptionsImpl _value, $Res Function(_$PacketOptionsImpl) _then) + : super(_value, _then); + + /// Create a copy of PacketOptions + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? items = null, + Object? price = freezed, + Object? short = null, + Object? description = null, + }) { + return _then(_$PacketOptionsImpl( + items: null == items + ? _value._items + : items // ignore: cast_nullable_to_non_nullable + as List, + price: freezed == price + ? _value.price + : price // ignore: cast_nullable_to_non_nullable + as dynamic, + short: null == short + ? _value.short + : short // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$PacketOptionsImpl implements _PacketOptions { + const _$PacketOptionsImpl( + {@JsonKey(name: "items") required final List items, + @JsonKey(name: "price") required this.price, + @JsonKey(name: "short") required this.short, + @JsonKey(name: "description") required this.description}) + : _items = items; + + factory _$PacketOptionsImpl.fromJson(Map json) => + _$$PacketOptionsImplFromJson(json); + + final List _items; + @override + @JsonKey(name: "items") + List get items { + if (_items is EqualUnmodifiableListView) return _items; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_items); + } + + @override + @JsonKey(name: "price") + final dynamic price; + @override + @JsonKey(name: "short") + final String short; + @override + @JsonKey(name: "description") + final String description; + + @override + String toString() { + return 'PacketOptions(items: $items, price: $price, short: $short, description: $description)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$PacketOptionsImpl && + const DeepCollectionEquality().equals(other._items, _items) && + const DeepCollectionEquality().equals(other.price, price) && + (identical(other.short, short) || other.short == short) && + (identical(other.description, description) || + other.description == description)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(_items), + const DeepCollectionEquality().hash(price), + short, + description); + + /// Create a copy of PacketOptions + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => + __$$PacketOptionsImplCopyWithImpl<_$PacketOptionsImpl>(this, _$identity); + + @override + Map toJson() { + return _$$PacketOptionsImplToJson( + this, + ); + } +} + +abstract class _PacketOptions implements PacketOptions { + const factory _PacketOptions( + {@JsonKey(name: "items") required final List items, + @JsonKey(name: "price") required final dynamic price, + @JsonKey(name: "short") required final String short, + @JsonKey(name: "description") required final String description}) = + _$PacketOptionsImpl; + + factory _PacketOptions.fromJson(Map json) = + _$PacketOptionsImpl.fromJson; + + @override + @JsonKey(name: "items") + List get items; + @override + @JsonKey(name: "price") + dynamic get price; + @override + @JsonKey(name: "short") + String get short; + @override + @JsonKey(name: "description") + String get description; + + /// Create a copy of PacketOptions + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => + throw _privateConstructorUsedError; +} + +PlanType _$PlanTypeFromJson(Map json) { + return _PlanType.fromJson(json); +} + +/// @nodoc +mixin _$PlanType { + @JsonKey(name: "fit") + bool get fit => throw _privateConstructorUsedError; + @JsonKey(name: "slim") + bool get slim => throw _privateConstructorUsedError; + @JsonKey(name: "behavior") + bool get behavior => throw _privateConstructorUsedError; + @JsonKey(name: "wellness") + bool get wellness => throw _privateConstructorUsedError; + + /// Serializes this PlanType to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of PlanType + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $PlanTypeCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $PlanTypeCopyWith<$Res> { + factory $PlanTypeCopyWith(PlanType value, $Res Function(PlanType) then) = + _$PlanTypeCopyWithImpl<$Res, PlanType>; + @useResult + $Res call( + {@JsonKey(name: "fit") bool fit, + @JsonKey(name: "slim") bool slim, + @JsonKey(name: "behavior") bool behavior, + @JsonKey(name: "wellness") bool wellness}); +} + +/// @nodoc +class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType> + implements $PlanTypeCopyWith<$Res> { + _$PlanTypeCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of PlanType + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? fit = null, + Object? slim = null, + Object? behavior = null, + Object? wellness = null, + }) { + return _then(_value.copyWith( + fit: null == fit + ? _value.fit + : fit // ignore: cast_nullable_to_non_nullable + as bool, + slim: null == slim + ? _value.slim + : slim // ignore: cast_nullable_to_non_nullable + as bool, + behavior: null == behavior + ? _value.behavior + : behavior // ignore: cast_nullable_to_non_nullable + as bool, + wellness: null == wellness + ? _value.wellness + : wellness // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$PlanTypeImplCopyWith<$Res> + implements $PlanTypeCopyWith<$Res> { + factory _$$PlanTypeImplCopyWith( + _$PlanTypeImpl value, $Res Function(_$PlanTypeImpl) then) = + __$$PlanTypeImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "fit") bool fit, + @JsonKey(name: "slim") bool slim, + @JsonKey(name: "behavior") bool behavior, + @JsonKey(name: "wellness") bool wellness}); +} + +/// @nodoc +class __$$PlanTypeImplCopyWithImpl<$Res> + extends _$PlanTypeCopyWithImpl<$Res, _$PlanTypeImpl> + implements _$$PlanTypeImplCopyWith<$Res> { + __$$PlanTypeImplCopyWithImpl( + _$PlanTypeImpl _value, $Res Function(_$PlanTypeImpl) _then) + : super(_value, _then); + + /// Create a copy of PlanType + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? fit = null, + Object? slim = null, + Object? behavior = null, + Object? wellness = null, + }) { + return _then(_$PlanTypeImpl( + fit: null == fit + ? _value.fit + : fit // ignore: cast_nullable_to_non_nullable + as bool, + slim: null == slim + ? _value.slim + : slim // ignore: cast_nullable_to_non_nullable + as bool, + behavior: null == behavior + ? _value.behavior + : behavior // ignore: cast_nullable_to_non_nullable + as bool, + wellness: null == wellness + ? _value.wellness + : wellness // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$PlanTypeImpl implements _PlanType { + const _$PlanTypeImpl( + {@JsonKey(name: "fit") required this.fit, + @JsonKey(name: "slim") required this.slim, + @JsonKey(name: "behavior") required this.behavior, + @JsonKey(name: "wellness") required this.wellness}); + + factory _$PlanTypeImpl.fromJson(Map json) => + _$$PlanTypeImplFromJson(json); + + @override + @JsonKey(name: "fit") + final bool fit; + @override + @JsonKey(name: "slim") + final bool slim; + @override + @JsonKey(name: "behavior") + final bool behavior; + @override + @JsonKey(name: "wellness") + final bool wellness; + + @override + String toString() { + return 'PlanType(fit: $fit, slim: $slim, behavior: $behavior, wellness: $wellness)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$PlanTypeImpl && + (identical(other.fit, fit) || other.fit == fit) && + (identical(other.slim, slim) || other.slim == slim) && + (identical(other.behavior, behavior) || + other.behavior == behavior) && + (identical(other.wellness, wellness) || + other.wellness == wellness)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, fit, slim, behavior, wellness); + + /// Create a copy of PlanType + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => + __$$PlanTypeImplCopyWithImpl<_$PlanTypeImpl>(this, _$identity); + + @override + Map toJson() { + return _$$PlanTypeImplToJson( + this, + ); + } +} + +abstract class _PlanType implements PlanType { + const factory _PlanType( + {@JsonKey(name: "fit") required final bool fit, + @JsonKey(name: "slim") required final bool slim, + @JsonKey(name: "behavior") required final bool behavior, + @JsonKey(name: "wellness") required final bool wellness}) = + _$PlanTypeImpl; + + factory _PlanType.fromJson(Map json) = + _$PlanTypeImpl.fromJson; + + @override + @JsonKey(name: "fit") + bool get fit; + @override + @JsonKey(name: "slim") + bool get slim; + @override + @JsonKey(name: "behavior") + bool get behavior; + @override + @JsonKey(name: "wellness") + bool get wellness; + + /// Create a copy of PlanType + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/plans/models/plan_pagination_model.g.dart b/lib/features/plans/models/plan_pagination_model.g.dart new file mode 100644 index 00000000..8f203fa8 --- /dev/null +++ b/lib/features/plans/models/plan_pagination_model.g.dart @@ -0,0 +1,95 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'plan_pagination_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$PlanPaginationModelImpl _$$PlanPaginationModelImplFromJson( + Map json) => + _$PlanPaginationModelImpl( + data: (json['data'] as List) + .map((e) => PlanModel.fromJson(e as Map)) + .toList(), + links: Links.fromJson(json['links'] as Map), + meta: Meta.fromJson(json['meta'] as Map), + ); + +Map _$$PlanPaginationModelImplToJson( + _$PlanPaginationModelImpl instance) => + { + 'data': instance.data, + 'links': instance.links, + 'meta': instance.meta, + }; + +_$PlanModelImpl _$$PlanModelImplFromJson(Map json) => + _$PlanModelImpl( + id: (json['id'] as num).toInt(), + name: json['name'] as String, + image: json['image'] as String, + duration: (json['duration'] as num).toInt(), + state: json['state'] as String, + type: PlanType.fromJson(json['type'] as Map), + details: json['details'] as String, + packetsCount: (json['packets_count'] as num).toInt(), + packet1Options: json['packet1_options'], + packet2Options: json['packet2_options'], + packet3Options: json['packet3_options'], + author: Author.fromJson(json['author'] as Map), + totalLikes: (json['total_likes'] as num).toInt(), + totalViews: (json['total_views'] as num).toInt(), + totalComments: (json['total_comments'] as num).toInt(), + ); + +Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => + { + 'id': instance.id, + 'name': instance.name, + 'image': instance.image, + 'duration': instance.duration, + 'state': instance.state, + 'type': instance.type, + 'details': instance.details, + 'packets_count': instance.packetsCount, + 'packet1_options': instance.packet1Options, + 'packet2_options': instance.packet2Options, + 'packet3_options': instance.packet3Options, + 'author': instance.author, + 'total_likes': instance.totalLikes, + 'total_views': instance.totalViews, + 'total_comments': instance.totalComments, + }; + +_$PacketOptionsImpl _$$PacketOptionsImplFromJson(Map json) => + _$PacketOptionsImpl( + items: (json['items'] as List).map((e) => e as String).toList(), + price: json['price'], + short: json['short'] as String, + description: json['description'] as String, + ); + +Map _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) => + { + 'items': instance.items, + 'price': instance.price, + 'short': instance.short, + 'description': instance.description, + }; + +_$PlanTypeImpl _$$PlanTypeImplFromJson(Map json) => + _$PlanTypeImpl( + fit: json['fit'] as bool, + slim: json['slim'] as bool, + behavior: json['behavior'] as bool, + wellness: json['wellness'] as bool, + ); + +Map _$$PlanTypeImplToJson(_$PlanTypeImpl instance) => + { + 'fit': instance.fit, + 'slim': instance.slim, + 'behavior': instance.behavior, + 'wellness': instance.wellness, + }; diff --git a/lib/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart b/lib/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart new file mode 100644 index 00000000..fb885fe7 --- /dev/null +++ b/lib/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart @@ -0,0 +1,19 @@ +import 'package:eatvio_app/features/plans/presentation/bloc/plans_cubit/plans_state.dart'; +import 'package:eatvio_app/features/plans/repositories/plans_repository.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +class PlansCubit extends Cubit { + final PlansRepository plansRepository; + + PlansCubit({ + required this.plansRepository, + }) : super(PlansState.loading()); + + getPlans() async { + try { + emit(PlansState.loaded(plansModel: await plansRepository.getPlans())); + } catch (e) { + emit(PlansState.error(errorMessage: e.toString())); + } + } +} diff --git a/lib/features/plans/presentation/bloc/plans_cubit/plans_state.dart b/lib/features/plans/presentation/bloc/plans_cubit/plans_state.dart new file mode 100644 index 00000000..ca3193cf --- /dev/null +++ b/lib/features/plans/presentation/bloc/plans_cubit/plans_state.dart @@ -0,0 +1,19 @@ +import 'package:eatvio_app/features/plans/models/plan_pagination_model.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'plans_state.freezed.dart'; + +@freezed +abstract class PlansState with _$PlansState { + const factory PlansState() = _PlansState; + + const factory PlansState.loading() = PlansStateLoading; + + const factory PlansState.loaded({ + required PlanPaginationModel plansModel, + }) = PlansStateLoaded; + + const factory PlansState.error({ + required String errorMessage, + }) = PlansStateError; +} diff --git a/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart b/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart new file mode 100644 index 00000000..1bbe3cac --- /dev/null +++ b/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart @@ -0,0 +1,646 @@ +// 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 'plans_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 _$PlansState { + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(PlanPaginationModel plansModel) loaded, + required TResult Function(String errorMessage) error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(PlanPaginationModel plansModel)? loaded, + TResult? Function(String errorMessage)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(PlanPaginationModel plansModel)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map( + TResult Function(_PlansState value) $default, { + required TResult Function(PlansStateLoading value) loading, + required TResult Function(PlansStateLoaded value) loaded, + required TResult Function(PlansStateError value) error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_PlansState value)? $default, { + TResult? Function(PlansStateLoading value)? loading, + TResult? Function(PlansStateLoaded value)? loaded, + TResult? Function(PlansStateError value)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap( + TResult Function(_PlansState value)? $default, { + TResult Function(PlansStateLoading value)? loading, + TResult Function(PlansStateLoaded value)? loaded, + TResult Function(PlansStateError value)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $PlansStateCopyWith<$Res> { + factory $PlansStateCopyWith( + PlansState value, $Res Function(PlansState) then) = + _$PlansStateCopyWithImpl<$Res, PlansState>; +} + +/// @nodoc +class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState> + implements $PlansStateCopyWith<$Res> { + _$PlansStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of PlansState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc +abstract class _$$PlansStateImplCopyWith<$Res> { + factory _$$PlansStateImplCopyWith( + _$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) = + __$$PlansStateImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$PlansStateImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl> + implements _$$PlansStateImplCopyWith<$Res> { + __$$PlansStateImplCopyWithImpl( + _$PlansStateImpl _value, $Res Function(_$PlansStateImpl) _then) + : super(_value, _then); + + /// Create a copy of PlansState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$PlansStateImpl implements _PlansState { + const _$PlansStateImpl(); + + @override + String toString() { + return 'PlansState()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$PlansStateImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(PlanPaginationModel plansModel) loaded, + required TResult Function(String errorMessage) error, + }) { + return $default(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(PlanPaginationModel plansModel)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return $default?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(PlanPaginationModel plansModel)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if ($default != null) { + return $default(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_PlansState value) $default, { + required TResult Function(PlansStateLoading value) loading, + required TResult Function(PlansStateLoaded value) loaded, + required TResult Function(PlansStateError value) error, + }) { + return $default(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_PlansState value)? $default, { + TResult? Function(PlansStateLoading value)? loading, + TResult? Function(PlansStateLoaded value)? loaded, + TResult? Function(PlansStateError value)? error, + }) { + return $default?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_PlansState value)? $default, { + TResult Function(PlansStateLoading value)? loading, + TResult Function(PlansStateLoaded value)? loaded, + TResult Function(PlansStateError value)? error, + required TResult orElse(), + }) { + if ($default != null) { + return $default(this); + } + return orElse(); + } +} + +abstract class _PlansState implements PlansState { + const factory _PlansState() = _$PlansStateImpl; +} + +/// @nodoc +abstract class _$$PlansStateLoadingImplCopyWith<$Res> { + factory _$$PlansStateLoadingImplCopyWith(_$PlansStateLoadingImpl value, + $Res Function(_$PlansStateLoadingImpl) then) = + __$$PlansStateLoadingImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$PlansStateLoadingImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadingImpl> + implements _$$PlansStateLoadingImplCopyWith<$Res> { + __$$PlansStateLoadingImplCopyWithImpl(_$PlansStateLoadingImpl _value, + $Res Function(_$PlansStateLoadingImpl) _then) + : super(_value, _then); + + /// Create a copy of PlansState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$PlansStateLoadingImpl implements PlansStateLoading { + const _$PlansStateLoadingImpl(); + + @override + String toString() { + return 'PlansState.loading()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$PlansStateLoadingImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(PlanPaginationModel plansModel) loaded, + required TResult Function(String errorMessage) error, + }) { + return loading(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(PlanPaginationModel plansModel)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return loading?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(PlanPaginationModel plansModel)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_PlansState value) $default, { + required TResult Function(PlansStateLoading value) loading, + required TResult Function(PlansStateLoaded value) loaded, + required TResult Function(PlansStateError value) error, + }) { + return loading(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_PlansState value)? $default, { + TResult? Function(PlansStateLoading value)? loading, + TResult? Function(PlansStateLoaded value)? loaded, + TResult? Function(PlansStateError value)? error, + }) { + return loading?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_PlansState value)? $default, { + TResult Function(PlansStateLoading value)? loading, + TResult Function(PlansStateLoaded value)? loaded, + TResult Function(PlansStateError value)? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(this); + } + return orElse(); + } +} + +abstract class PlansStateLoading implements PlansState { + const factory PlansStateLoading() = _$PlansStateLoadingImpl; +} + +/// @nodoc +abstract class _$$PlansStateLoadedImplCopyWith<$Res> { + factory _$$PlansStateLoadedImplCopyWith(_$PlansStateLoadedImpl value, + $Res Function(_$PlansStateLoadedImpl) then) = + __$$PlansStateLoadedImplCopyWithImpl<$Res>; + @useResult + $Res call({PlanPaginationModel plansModel}); + + $PlanPaginationModelCopyWith<$Res> get plansModel; +} + +/// @nodoc +class __$$PlansStateLoadedImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadedImpl> + implements _$$PlansStateLoadedImplCopyWith<$Res> { + __$$PlansStateLoadedImplCopyWithImpl(_$PlansStateLoadedImpl _value, + $Res Function(_$PlansStateLoadedImpl) _then) + : super(_value, _then); + + /// Create a copy of PlansState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? plansModel = null, + }) { + return _then(_$PlansStateLoadedImpl( + plansModel: null == plansModel + ? _value.plansModel + : plansModel // ignore: cast_nullable_to_non_nullable + as PlanPaginationModel, + )); + } + + /// Create a copy of PlansState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $PlanPaginationModelCopyWith<$Res> get plansModel { + return $PlanPaginationModelCopyWith<$Res>(_value.plansModel, (value) { + return _then(_value.copyWith(plansModel: value)); + }); + } +} + +/// @nodoc + +class _$PlansStateLoadedImpl implements PlansStateLoaded { + const _$PlansStateLoadedImpl({required this.plansModel}); + + @override + final PlanPaginationModel plansModel; + + @override + String toString() { + return 'PlansState.loaded(plansModel: $plansModel)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$PlansStateLoadedImpl && + (identical(other.plansModel, plansModel) || + other.plansModel == plansModel)); + } + + @override + int get hashCode => Object.hash(runtimeType, plansModel); + + /// Create a copy of PlansState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => + __$$PlansStateLoadedImplCopyWithImpl<_$PlansStateLoadedImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(PlanPaginationModel plansModel) loaded, + required TResult Function(String errorMessage) error, + }) { + return loaded(plansModel); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(PlanPaginationModel plansModel)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return loaded?.call(plansModel); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(PlanPaginationModel plansModel)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (loaded != null) { + return loaded(plansModel); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_PlansState value) $default, { + required TResult Function(PlansStateLoading value) loading, + required TResult Function(PlansStateLoaded value) loaded, + required TResult Function(PlansStateError value) error, + }) { + return loaded(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_PlansState value)? $default, { + TResult? Function(PlansStateLoading value)? loading, + TResult? Function(PlansStateLoaded value)? loaded, + TResult? Function(PlansStateError value)? error, + }) { + return loaded?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_PlansState value)? $default, { + TResult Function(PlansStateLoading value)? loading, + TResult Function(PlansStateLoaded value)? loaded, + TResult Function(PlansStateError value)? error, + required TResult orElse(), + }) { + if (loaded != null) { + return loaded(this); + } + return orElse(); + } +} + +abstract class PlansStateLoaded implements PlansState { + const factory PlansStateLoaded( + {required final PlanPaginationModel plansModel}) = _$PlansStateLoadedImpl; + + PlanPaginationModel get plansModel; + + /// Create a copy of PlansState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$PlansStateErrorImplCopyWith<$Res> { + factory _$$PlansStateErrorImplCopyWith(_$PlansStateErrorImpl value, + $Res Function(_$PlansStateErrorImpl) then) = + __$$PlansStateErrorImplCopyWithImpl<$Res>; + @useResult + $Res call({String errorMessage}); +} + +/// @nodoc +class __$$PlansStateErrorImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateErrorImpl> + implements _$$PlansStateErrorImplCopyWith<$Res> { + __$$PlansStateErrorImplCopyWithImpl( + _$PlansStateErrorImpl _value, $Res Function(_$PlansStateErrorImpl) _then) + : super(_value, _then); + + /// Create a copy of PlansState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? errorMessage = null, + }) { + return _then(_$PlansStateErrorImpl( + errorMessage: null == errorMessage + ? _value.errorMessage + : errorMessage // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$PlansStateErrorImpl implements PlansStateError { + const _$PlansStateErrorImpl({required this.errorMessage}); + + @override + final String errorMessage; + + @override + String toString() { + return 'PlansState.error(errorMessage: $errorMessage)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$PlansStateErrorImpl && + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); + } + + @override + int get hashCode => Object.hash(runtimeType, errorMessage); + + /// Create a copy of PlansState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => + __$$PlansStateErrorImplCopyWithImpl<_$PlansStateErrorImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(PlanPaginationModel plansModel) loaded, + required TResult Function(String errorMessage) error, + }) { + return error(errorMessage); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(PlanPaginationModel plansModel)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return error?.call(errorMessage); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(PlanPaginationModel plansModel)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(errorMessage); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_PlansState value) $default, { + required TResult Function(PlansStateLoading value) loading, + required TResult Function(PlansStateLoaded value) loaded, + required TResult Function(PlansStateError value) error, + }) { + return error(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_PlansState value)? $default, { + TResult? Function(PlansStateLoading value)? loading, + TResult? Function(PlansStateLoaded value)? loaded, + TResult? Function(PlansStateError value)? error, + }) { + return error?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_PlansState value)? $default, { + TResult Function(PlansStateLoading value)? loading, + TResult Function(PlansStateLoaded value)? loaded, + TResult Function(PlansStateError value)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(this); + } + return orElse(); + } +} + +abstract class PlansStateError implements PlansState { + const factory PlansStateError({required final String errorMessage}) = + _$PlansStateErrorImpl; + + String get errorMessage; + + /// Create a copy of PlansState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/plans/presentation/pages/about_plan_screen.dart b/lib/features/plans/presentation/pages/about_plan_screen.dart new file mode 100644 index 00000000..50f81867 --- /dev/null +++ b/lib/features/plans/presentation/pages/about_plan_screen.dart @@ -0,0 +1,20 @@ +import 'package:eatvio_app/features/plans/models/plan_pagination_model.dart'; +import 'package:flutter/material.dart'; + +class AboutPlanScreen extends StatelessWidget { + final PlanModel planModel; + + const AboutPlanScreen({ + super.key, + required this.planModel, + }); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(planModel.name), + ), + ); + } +} diff --git a/lib/features/plans/repositories/plans_repository.dart b/lib/features/plans/repositories/plans_repository.dart new file mode 100644 index 00000000..ee8e7fb7 --- /dev/null +++ b/lib/features/plans/repositories/plans_repository.dart @@ -0,0 +1,16 @@ +import 'package:eatvio_app/features/plans/models/plan_pagination_model.dart'; +import 'package:eatvio_app/features/plans/services/plans_service.dart'; + +class PlansRepository { + final PlansService plansService; + + const PlansRepository({required this.plansService}); + + Future getPlans() async { + try { + return await plansService.getPlans(); + } catch (e) { + rethrow; + } + } +} diff --git a/lib/features/plans/services/plans_service.dart b/lib/features/plans/services/plans_service.dart new file mode 100644 index 00000000..2b842047 --- /dev/null +++ b/lib/features/plans/services/plans_service.dart @@ -0,0 +1,13 @@ +import 'package:dio/dio.dart'; +import 'package:eatvio_app/features/plans/models/plan_pagination_model.dart'; +import 'package:retrofit/retrofit.dart'; + +part 'plans_service.g.dart'; + +@RestApi() +abstract class PlansService { + factory PlansService(Dio dio, {String baseUrl}) = _PlansService; + + @GET('/api/plans/index') + Future getPlans(); +} diff --git a/lib/features/plans/services/plans_service.g.dart b/lib/features/plans/services/plans_service.g.dart new file mode 100644 index 00000000..bce687f0 --- /dev/null +++ b/lib/features/plans/services/plans_service.g.dart @@ -0,0 +1,86 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'plans_service.dart'; + +// ************************************************************************** +// RetrofitGenerator +// ************************************************************************** + +// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element + +class _PlansService implements PlansService { + _PlansService( + this._dio, { + this.baseUrl, + this.errorLogger, + }); + + final Dio _dio; + + String? baseUrl; + + final ParseErrorLogger? errorLogger; + + @override + Future getPlans() async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/plans/index', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late PlanPaginationModel _value; + try { + _value = PlanPaginationModel.fromJson(_result.data!); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + + RequestOptions _setStreamType(RequestOptions requestOptions) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { + if (T == String) { + requestOptions.responseType = ResponseType.plain; + } else { + requestOptions.responseType = ResponseType.json; + } + } + return requestOptions; + } + + String _combineBaseUrls( + String dioBaseUrl, + String? baseUrl, + ) { + if (baseUrl == null || baseUrl.trim().isEmpty) { + return dioBaseUrl; + } + + final url = Uri.parse(baseUrl); + + if (url.isAbsolute) { + return url.toString(); + } + + return Uri.parse(dioBaseUrl).resolveUri(url).toString(); + } +} diff --git a/lib/features/recipes/presentation/pages/about_recipes_screen.dart b/lib/features/recipes/presentation/pages/about_recipes_screen.dart index c778b585..397147bd 100644 --- a/lib/features/recipes/presentation/pages/about_recipes_screen.dart +++ b/lib/features/recipes/presentation/pages/about_recipes_screen.dart @@ -8,6 +8,7 @@ import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/commen import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; class AboutRecipesScreen extends StatefulWidget { @@ -247,19 +248,18 @@ class _AboutRecipesScreenState extends State { ], ), ), - SizedBox(height: 12), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Text( - widget.recipes.description, - style: TextStyle( - color: Colors.black, - fontSize: 14, - fontWeight: FontWeight.w400, - height: 1.2, + if (widget.recipes.description.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Html( + data: widget.recipes.description, + style: { + "*": Style( + color: Colors.black87, + ), + }, ), ), - ), SizedBox(height: 12), CachedNetworkImage( imageUrl: baseUrl + '/storage/' + widget.recipes.image, diff --git a/lib/locator_service.dart b/lib/locator_service.dart index 30e45db8..beafd9b2 100644 --- a/lib/locator_service.dart +++ b/lib/locator_service.dart @@ -20,6 +20,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/plans/presentation/bloc/plans_cubit/plans_cubit.dart'; +import 'package:eatvio_app/features/plans/repositories/plans_repository.dart'; +import 'package:eatvio_app/features/plans/services/plans_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'; @@ -51,6 +54,7 @@ Future init() async { sl.registerFactory(() => DietsCubit(feedRepository: sl())); sl.registerFactory(() => CommentsCubit(feedRepository: sl())); sl.registerFactory(() => ChatSelectCubit(chatRepository: sl())); + sl.registerFactory(() => PlansCubit(plansRepository: sl())); // Repository sl.registerLazySingleton(() => ChatRepository(chatService: sl())); @@ -60,6 +64,7 @@ Future init() async { sl.registerLazySingleton(() => CalendarRepository(calendarService: sl())); sl.registerLazySingleton(() => ProfileRepository(profileService: sl())); sl.registerLazySingleton(() => RecipeRepository(recipeService: sl())); + sl.registerLazySingleton(() => PlansRepository(plansService: sl())); // Services sl.registerLazySingleton(() => ChatService(sl())); @@ -69,6 +74,7 @@ Future init() async { sl.registerLazySingleton(() => CalendarService(sl())); sl.registerLazySingleton(() => ProfileService(sl())); sl.registerLazySingleton(() => RecipeService(sl())); + sl.registerLazySingleton(() => PlansService(sl())); // External sl.registerLazySingleton( diff --git a/lib/main.dart b/lib/main.dart index 61ea707d..5a24fa1e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,6 +8,7 @@ import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart'; +import 'package:eatvio_app/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart'; import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_cubit.dart'; import 'package:eatvio_app/locator_service.dart' as di; import 'package:eatvio_app/locator_service.dart'; @@ -19,6 +20,7 @@ import 'package:keyboard_dismisser/keyboard_dismisser.dart'; import 'core/app_export.dart'; var globalMessengerKey = GlobalKey(); + Future main() async { WidgetsFlutterBinding.ensureInitialized(); await di.init(); @@ -37,6 +39,7 @@ class MyApp extends StatelessWidget { BlocProvider(create: (context) => sl()..loadFeedBlogPostList()), BlocProvider(create: (context) => sl()..loadRecipesList()), BlocProvider(create: (context) => sl()..loadDiets()), + BlocProvider(create: (context) => sl()..getPlans()), BlocProvider(create: (context) => MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel()))..add(MyProfileInitialEvent())), BlocProvider(create: (context) => sl()..add(LoadDiary())), BlocProvider(create: (context) => sl()..loadCalendarList()), diff --git a/pubspec.yaml b/pubspec.yaml index c746bd94..491588d1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,7 +32,7 @@ dependencies: keyboard_dismisser: ^3.0.0 retrofit: ^4.2.0 get_it: ^7.7.0 - dio: ^5.6.0 + dio: ^5.7.0 dart_pusher_channels: ^1.2.3 photo_view: ^0.15.0 dismissible_page: ^1.0.2 @@ -41,7 +41,7 @@ dependencies: badges: ^3.1.2 google_fonts: ^6.2.1 location: ^6.0.2 - syncfusion_flutter_charts: ^26.2.13 + syncfusion_flutter_charts: ^26.2.14 table_calendar: ^3.1.2 flutter_keyboard_visibility: ^6.0.0 share_plus: ^10.0.0 From 23dd3f4a115b3f36cbf1b90fa2572cee4cbb0c7a Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 11 Sep 2024 13:08:00 +0300 Subject: [PATCH 12/31] fix: fix chat search bar clear button, upgrade packages --- .../widgets/chat_search_bar_widget.dart | 6 +----- pubspec.yaml | 20 +++++++++---------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart b/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart index 4889fdfd..955e697f 100644 --- a/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart @@ -78,7 +78,7 @@ class ChatSearchBarWidget extends StatelessWidget { } searchViewWidget(BuildContext context) => SizedBox( - width: width ?? double.maxFinite, + width: width ?? MediaQuery.of(context).size.width, child: TextFormField( controller: controller, focusNode: focusNode, @@ -123,10 +123,6 @@ class ChatSearchBarWidget extends StatelessWidget { color: Colors.grey.shade600, ), ), - suffixIconConstraints: suffixConstraints ?? - BoxConstraints( - maxHeight: 40.v, - ), isDense: true, contentPadding: EdgeInsets.all(16), fillColor: fillColor ?? appTheme.gray100, diff --git a/pubspec.yaml b/pubspec.yaml index 491588d1..b894118d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,21 +16,21 @@ dependencies: flutter_secure_storage: ^9.2.2 flutter_bloc: ^8.1.6 cached_network_image: ^3.4.1 - flutter_svg: ^2.0.10 + flutter_svg: ^2.0.10+1 equatable: ^2.0.5 freezed_annotation: ^2.4.4 json_annotation: ^4.9.0 validators: ^3.0.0 path_provider: ^2.1.4 - fl_chart: ^0.68.0 + fl_chart: ^0.69.0 flutter_spinkit: ^5.2.1 - carousel_slider_plus: ^7.0.0 - flutter_form_builder: ^9.3.0 + carousel_slider_plus: ^7.0.1 + flutter_form_builder: ^9.4.1 image_picker: ^1.1.2 flutter_typeahead: ^5.2.0 - go_router: ^14.2.6 + go_router: ^14.2.7 keyboard_dismisser: ^3.0.0 - retrofit: ^4.2.0 + retrofit: ^4.4.1 get_it: ^7.7.0 dio: ^5.7.0 dart_pusher_channels: ^1.2.3 @@ -44,10 +44,10 @@ dependencies: syncfusion_flutter_charts: ^26.2.14 table_calendar: ^3.1.2 flutter_keyboard_visibility: ^6.0.0 - share_plus: ^10.0.0 - flutter_html: 3.0.0-beta.2 - file_picker: ^8.1.1 - audioplayers: ^5.2.1 + share_plus: ^10.0.2 + flutter_html: ^3.0.0-beta.2 + file_picker: ^8.1.2 + audioplayers: ^6.1.0 dev_dependencies: build_runner: ^2.4.11 From 220e13d52588a01c29e50d76cc3c5f2b61c8af2f Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 11 Sep 2024 13:25:27 +0300 Subject: [PATCH 13/31] fix: upgrade flutter version --- .gitea/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 0fd6fdd1..3ab485dc 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -3,7 +3,7 @@ name: Eatvio App Android Test on: [ pull_request ] env: - flutter_version: "3.22.0" + flutter_version: "3.24.2" java_version: "17.x" flutter_channel: "stable" From 3aa9e8cba8be9c822161b86683873e708de8e3ff Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 11 Sep 2024 13:56:33 +0300 Subject: [PATCH 14/31] fix: remove sizer --- lib/core/app_export.dart | 1 - lib/core/utils/size_utils.dart | 52 ------ .../presentation/pages/calendar_screen.dart | 12 +- .../pages/diary_recommendations_scree.dart | 2 +- .../presentation/pages/diary_screen.dart | 148 +++++++++--------- .../pages/recipe_create_screen.dart | 16 +- .../pages/recipe_edit_screen.dart | 16 +- .../pages/blood_pressure_screen.dart | 24 ++- .../diet_create_screen.dart | 10 +- .../diet_edit_screen/diet_edit_screen.dart | 10 +- .../diet_select_screen.dart | 10 +- .../diet_show_screen/diet_show_screen.dart | 10 +- .../blog_post_edit_screen.dart | 10 +- .../widgets/comment_widget.dart | 24 +-- .../feed_screen/widgets/feed_search_view.dart | 16 +- .../widgets/glossary_search_widget.dart | 16 +- .../plan_create_screen.dart | 10 +- .../plan_edit_screen/plan_edit_screen.dart | 10 +- .../plan_select_screen.dart | 10 +- .../plan_show_screen/plan_show_screen.dart | 10 +- .../my_profile_screen/my_profile_screen.dart | 76 ++++----- .../my_profile_screen/my_settings_screen.dart | 22 +-- .../recipe_edit_screen.dart | 60 +++---- .../recipe_select_screen.dart | 10 +- .../recipe_show_screen.dart | 44 +++--- .../widgets/comment_widget.dart | 24 +-- .../subscribers_screen.dart | 10 +- lib/theme/app_decoration.dart | 36 ++--- lib/theme/custom_button_style.dart | 2 +- lib/theme/custom_text_style.dart | 22 +-- lib/theme/theme_helper.dart | 6 +- lib/widgets/app_bar/appbar_leading_image.dart | 4 +- .../app_bar/appbar_title_circleimage.dart | 6 +- lib/widgets/app_bar/custom_app_bar.dart | 17 +- lib/widgets/custom_expandable_list.dart | 2 +- lib/widgets/custom_outlined_button.dart | 6 +- lib/widgets/next_step_button.dart | 4 +- lib/widgets/nutrition_chart.dart | 4 +- 38 files changed, 359 insertions(+), 413 deletions(-) delete mode 100644 lib/core/utils/size_utils.dart diff --git a/lib/core/app_export.dart b/lib/core/app_export.dart index 88b3fe01..c9a9c59f 100644 --- a/lib/core/app_export.dart +++ b/lib/core/app_export.dart @@ -3,7 +3,6 @@ export 'package:eatvio_app/core/errors/exceptions.dart'; export 'package:eatvio_app/core/utils/date_time_utils.dart'; export 'package:eatvio_app/core/utils/image_constant.dart'; export 'package:eatvio_app/core/utils/logger.dart'; -export 'package:eatvio_app/core/utils/size_utils.dart'; export 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; export 'package:eatvio_app/localization/app_localization.dart'; export 'package:eatvio_app/theme/app_decoration.dart'; diff --git a/lib/core/utils/size_utils.dart b/lib/core/utils/size_utils.dart deleted file mode 100644 index 04f09c8a..00000000 --- a/lib/core/utils/size_utils.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:flutter/material.dart'; - -// This functions are responsible to make UI responsive across all the mobile devices. - -MediaQueryData mediaQueryData = MediaQueryData.fromView( - WidgetsBinding.instance.platformDispatcher.views.single, -); - -// These are the Viewport values of your Figma Design. -// These are used in the code as a reference to create your UI Responsively. -const num FIGMA_DESIGN_WIDTH = 375; -const num FIGMA_DESIGN_HEIGHT = 812; -const num FIGMA_DESIGN_STATUS_BAR = 0; - -///This extension is used to set padding/margin (for the top and bottom side) & height of the screen or widget according to the Viewport height. -extension ResponsiveExtension on num { - ///This method is used to get device viewport width. - get _width { - return mediaQueryData.size.width; - } - - ///This method is used to get device viewport height. - get _height { - num statusBar = mediaQueryData.viewPadding.top; - num bottomBar = mediaQueryData.viewPadding.bottom; - num screenHeight = mediaQueryData.size.height - statusBar - bottomBar; - return screenHeight; - } - - ///This method is used to set padding/margin (for the left and Right side) & width of the screen or widget according to the Viewport width. - double get h => ((this * _width) / FIGMA_DESIGN_WIDTH); - - ///This method is used to set padding/margin (for the top and bottom side) & height of the screen or widget according to the Viewport height. - double get v => (this * _height) / (FIGMA_DESIGN_HEIGHT - FIGMA_DESIGN_STATUS_BAR); - - ///This method is used to set smallest px in image height and width - double get adaptSize { - var height = v; - var width = h; - return height < width ? height.toDoubleValue() : width.toDoubleValue(); - } - - ///This method is used to set text font size according to Viewport - double get fSize => adaptSize; -} - -extension FormatExtension on double { - /// Return a [double] value with formatted according to provided fractionDigits - double toDoubleValue({int fractionDigits = 2}) { - return double.parse(this.toStringAsFixed(fractionDigits)); - } -} diff --git a/lib/features/calendar/presentation/pages/calendar_screen.dart b/lib/features/calendar/presentation/pages/calendar_screen.dart index ab31b68b..ddcc04ab 100644 --- a/lib/features/calendar/presentation/pages/calendar_screen.dart +++ b/lib/features/calendar/presentation/pages/calendar_screen.dart @@ -61,12 +61,12 @@ class CalendarScreen extends StatelessWidget { Expanded( child: SingleChildScrollView( child: Padding( - padding: EdgeInsets.only(bottom: 5.v), + padding: EdgeInsets.only(bottom: 8), child: Column( children: [ - SizedBox(height: 20.v), + SizedBox(height: 24), _buildCalendarBody(context, state), - SizedBox(height: 20.v), + SizedBox(height: 24), ], ), ), @@ -87,7 +87,7 @@ class CalendarScreen extends StatelessWidget { physics: NeverScrollableScrollPhysics(), separatorBuilder: (context, index) { return SizedBox( - height: 2.v, + height: 4, ); }, itemCount: state.calendarList.length, @@ -118,7 +118,7 @@ class CalendarScreen extends StatelessWidget { formatDate(state.calendarList[index].date), style: theme.textTheme.titleMedium, ), - SizedBox(height: 2.v), + SizedBox(height: 4), if (state.calendarList[index] .is_current_day_included_in_the_chosen_diet_progression) Container( @@ -185,7 +185,7 @@ class CalendarScreen extends StatelessWidget { formatDate(state.calendarList[index].date), style: theme.textTheme.titleMedium, ), - SizedBox(height: 2.v), + SizedBox(height: 4), Row(children: [ Container( padding: EdgeInsets.all( diff --git a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart index 3c299e8c..5b454a04 100644 --- a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart +++ b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart @@ -73,7 +73,7 @@ class DiaryRecommendationsScreen extends StatelessWidget { Expanded( child: SingleChildScrollView( child: Padding( - padding: EdgeInsets.only(bottom: 5.v), + padding: EdgeInsets.only(bottom: 9), child: Column( children: [ Scaffold( diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index a6c0df8d..23c7503d 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -84,19 +84,19 @@ class DiaryScreen extends StatelessWidget { Expanded( child: SingleChildScrollView( child: Padding( - padding: EdgeInsets.only(bottom: 5.v), + padding: EdgeInsets.only(bottom: 8), child: Column( children: [ _buildHeaderRow(context, state), - SizedBox(height: 8.v), + SizedBox(height: 8), _buildWakupRetire(context, state), - SizedBox(height: 8.v), + SizedBox(height: 8), _buildMeal(context, state), - SizedBox(height: 8.v), + SizedBox(height: 8), _buildMood(context, state), - SizedBox(height: 8.v), + SizedBox(height: 8), _buildNutritionChart(context, state), - SizedBox(height: 8.v), + SizedBox(height: 8), // _buildComment(context, state), // SizedBox(height: 8.v), _buildEndDay(context), @@ -118,8 +118,8 @@ class DiaryScreen extends StatelessWidget { _buildNutritionChart(BuildContext context, DiaryStateLoaded state) { return Container( padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, @@ -176,13 +176,13 @@ class DiaryScreen extends StatelessWidget { children: [ Text( '${state.chartData['dailyNutritionIntake']['carbohydrates'].toStringAsFixed(1)} из ${state.chartData['dailyNutritionRecommendation']['carbohydrates'].toStringAsFixed(1)} грамм'), - SizedBox(height: 8.v), + SizedBox(height: 8), Text( '${state.chartData['dailyNutritionIntake']['fats'].toStringAsFixed(1)} из ${state.chartData['dailyNutritionRecommendation']['fats'].toStringAsFixed(1)} грамм'), - SizedBox(height: 8.v), + SizedBox(height: 8), Text( '${state.chartData['dailyNutritionIntake']['proteins'].toStringAsFixed(1)} из ${state.chartData['dailyNutritionRecommendation']['proteins'].toStringAsFixed(1)} грамм'), - SizedBox(height: 8.v), + SizedBox(height: 8), Text( '${state.chartData['dailyNutritionIntake']['energy'].toStringAsFixed(1)} из ${state.chartData['dailyNutritionRecommendation']['energy'].toStringAsFixed(1)} Ккал'), ], @@ -228,8 +228,8 @@ class DiaryScreen extends StatelessWidget { final day = state.diary.id; return Container( padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, @@ -239,7 +239,7 @@ class DiaryScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( - padding: EdgeInsets.only(top: 1.v), + padding: EdgeInsets.only(top: 4), child: Column( children: [ Align( @@ -295,10 +295,10 @@ class DiaryScreen extends StatelessWidget { children: [ if (!isLoading) Container( - margin: EdgeInsets.symmetric(horizontal: 10.h), + margin: EdgeInsets.symmetric(horizontal: 12), padding: EdgeInsets.symmetric( - horizontal: 40.h, - vertical: 80.v, + horizontal: 32, + vertical: 64, ), decoration: AppDecoration.fillGray.copyWith( borderRadius: BorderRadiusStyle.roundedBorder5, @@ -309,8 +309,8 @@ class DiaryScreen extends StatelessWidget { children: [ Padding( padding: EdgeInsets.only( - left: 7.h, - top: 5.v, + left: 8, + top: 8, ), child: Text( "Добавить фото", @@ -327,10 +327,10 @@ class DiaryScreen extends StatelessWidget { ), if (isLoading) Container( - margin: EdgeInsets.symmetric(horizontal: 10.h), + margin: EdgeInsets.symmetric(horizontal: 12), padding: EdgeInsets.symmetric( - horizontal: 40.h, - vertical: 80.v, + horizontal: 32, + vertical: 64, ), decoration: AppDecoration.fillGray.copyWith( borderRadius: BorderRadiusStyle.roundedBorder5, @@ -366,8 +366,8 @@ class DiaryScreen extends StatelessWidget { FocusNode focusNodeName = FocusNode(); return Container( padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, @@ -377,7 +377,7 @@ class DiaryScreen extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Padding( - padding: EdgeInsets.symmetric(horizontal: 10.h), + padding: EdgeInsets.symmetric(horizontal: 12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -388,7 +388,7 @@ class DiaryScreen extends StatelessWidget { Expanded( // Adding Expanded widget child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.h), + padding: EdgeInsets.symmetric(horizontal: 12), child: ConstrainedBox( constraints: BoxConstraints( maxWidth: MediaQuery.of(context).size.width - 260, @@ -408,9 +408,9 @@ class DiaryScreen extends StatelessWidget { ], ), ), - SizedBox(height: 20.v), + SizedBox(height: 24), Padding( - padding: EdgeInsets.symmetric(horizontal: 10.h), + padding: EdgeInsets.symmetric(horizontal: 12), child: BlocSelector( selector: (state) { if (state is DiaryStateLoaded) @@ -422,8 +422,8 @@ class DiaryScreen extends StatelessWidget { return CustomDropDown( items: state.mealList, contentPadding: EdgeInsets.symmetric( - horizontal: 10.h, - vertical: 9.v, + horizontal: 12, + vertical: 12, ), defaultValue: state.mealList[0], onChanged: changeMeal(context, state), @@ -431,9 +431,9 @@ class DiaryScreen extends StatelessWidget { }, ), ), - SizedBox(height: 20.v), + SizedBox(height: 24), Padding( - padding: EdgeInsets.symmetric(horizontal: 10.h), + padding: EdgeInsets.symmetric(horizontal: 12), child: RawAutocomplete( optionsBuilder: buildOptions(_options), fieldViewBuilder: ( @@ -482,25 +482,25 @@ class DiaryScreen extends StatelessWidget { }, ), ), - SizedBox(height: 20.v), + SizedBox(height: 24), if (state.moderationExpanded) Padding( - padding: EdgeInsets.symmetric(horizontal: 10.h), + padding: EdgeInsets.symmetric(horizontal: 12), child: GestureDetector( onTap: () => openCaloriesDialog(context, state), child: Text("Отправить на модерацию"), ), ), - SizedBox(height: 20.v), + SizedBox(height: 24), Padding( - padding: EdgeInsets.symmetric(horizontal: 10.h), + padding: EdgeInsets.symmetric(horizontal: 12), child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ CustomTextFormField( - width: 150.h, + width: 128, hintText: "Кол-во", textInputAction: TextInputAction.done, // focusNode: focusNodeQuantity, @@ -509,7 +509,7 @@ class DiaryScreen extends StatelessWidget { inputFormatters: [digitsOnly], ), Padding( - padding: EdgeInsets.only(left: 30.h), + padding: EdgeInsets.only(left: 32), child: BlocSelector( selector: (state) { if (state is DiaryStateLoaded) { @@ -530,21 +530,21 @@ class DiaryScreen extends StatelessWidget { ), ), ), - SizedBox(height: 24.v), + SizedBox(height: 24), _buildAddProduct(context, state), - SizedBox(height: 24.v), + SizedBox(height: 24), if (!state.diary.state.has_chosen_diet) ...state.portions.map((portion) => _buildProduct(context, portion)).toList(), if (state.diary.state.has_chosen_diet) ...state.portions.map((portion) => _buildProductDiet(context, portion)).toList(), - SizedBox(height: 24.v), + SizedBox(height: 24), _buildCarousel(context, state), - SizedBox(height: 24.v), + SizedBox(height: 24), _buildAddPhoto(context, state), - SizedBox(height: 24.v), + SizedBox(height: 24), Text( "Ваша сытость после приёма пищи", style: CustomTextStyles.bodyMediumBlack900, ), - SizedBox(height: 15.v), + SizedBox(height: 16), BlocBuilder( builder: (context, state) { if (state is DiaryStateLoaded) { @@ -609,25 +609,25 @@ class DiaryScreen extends StatelessWidget { hintText: "Название", controller: state.product_nameController, ), - SizedBox(height: 10.v), + SizedBox(height: 12), CustomTextFormField( hintText: "Энергетическая ценность на 100", keyboardType: TextInputType.number, controller: state.caloriesController, ), - SizedBox(height: 10.v), + SizedBox(height: 12), CustomTextFormField( hintText: "Белки на 100г", keyboardType: TextInputType.number, controller: state.proteinsController, ), - SizedBox(height: 10.v), + SizedBox(height: 12), CustomTextFormField( hintText: "Жиры на 100г", keyboardType: TextInputType.number, controller: state.fatsController, ), - SizedBox(height: 10.v), + SizedBox(height: 12), CustomTextFormField( hintText: "Углеводы на 100г", keyboardType: TextInputType.number, @@ -743,10 +743,10 @@ class DiaryScreen extends StatelessWidget { _buildProduct(BuildContext context, Portion portion) { return Container( - margin: EdgeInsets.symmetric(horizontal: 10.h), + margin: EdgeInsets.symmetric(horizontal: 12), padding: EdgeInsets.symmetric( - horizontal: 8.h, - vertical: 6.v, + horizontal: 8, + vertical: 8, ), decoration: AppDecoration.fillGray.copyWith( borderRadius: BorderRadiusStyle.roundedBorder5, @@ -757,8 +757,8 @@ class DiaryScreen extends StatelessWidget { children: [ Padding( padding: EdgeInsets.only( - left: 7.h, - top: 5.v, + left: 8, + top: 8, ), child: Text( portion.product_name.length > 8 ? portion.product_name.substring(0, 8) : portion.product_name, @@ -767,9 +767,9 @@ class DiaryScreen extends StatelessWidget { ), Padding( padding: EdgeInsets.only( - left: 20.h, - top: 3.v, - bottom: 3.v, + left: 24, + top: 4, + bottom: 4, ), child: Text( portion.quantity.toString() + ' ' + portion.portion.toString().tr, @@ -794,12 +794,12 @@ class DiaryScreen extends StatelessWidget { _buildProductDiet(BuildContext context, Portion portion) { return Container( margin: EdgeInsets.symmetric( - horizontal: 10.h, - vertical: 4.h, + horizontal: 12, + vertical: 4, ), padding: EdgeInsets.symmetric( - horizontal: 8.h, - vertical: 6.v, + horizontal: 8, + vertical: 8, ), decoration: AppDecoration.fillGray.copyWith( borderRadius: BorderRadiusStyle.roundedBorder5, @@ -814,8 +814,8 @@ class DiaryScreen extends StatelessWidget { ), Padding( padding: EdgeInsets.only( - left: 7.h, - top: 5.v, + left: 8, + top: 8, ), child: Text( portion.product_name.length > 18 ? portion.product_name.substring(0, 18) : portion.product_name, @@ -825,9 +825,9 @@ class DiaryScreen extends StatelessWidget { Spacer(), Padding( padding: EdgeInsets.only( - left: 20.h, - top: 3.v, - bottom: 3.v, + left: 24, + top: 4, + bottom: 4, ), child: Text( portion.quantity.toString() + ' ' + portion.portion.toString().tr, @@ -842,7 +842,7 @@ class DiaryScreen extends StatelessWidget { return Stack( children: [ Container( - margin: EdgeInsets.symmetric(horizontal: 10.h, vertical: 10.h), + margin: EdgeInsets.symmetric(horizontal: 12, vertical: 12), decoration: AppDecoration.fillGray.copyWith( borderRadius: BorderRadiusStyle.roundedBorder5, ), @@ -856,7 +856,7 @@ class DiaryScreen extends StatelessWidget { left: 0, right: 0, child: Container( - height: 50.h, // Высота затемненной области + height: 64, // Высота затемненной области decoration: BoxDecoration( gradient: LinearGradient( colors: [ @@ -938,8 +938,8 @@ class DiaryScreen extends StatelessWidget { _buildWakupRetire(BuildContext context, DiaryStateLoaded state) { return Container( padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, @@ -965,7 +965,7 @@ class DiaryScreen extends StatelessWidget { padding: const EdgeInsets.only(left: 16.0), child: Column( children: [ - SizedBox(height: 20.v), + SizedBox(height: 24), GestureDetector( onTap: () => _selectWakeupTime(context, state), child: AbsorbPointer( @@ -976,7 +976,7 @@ class DiaryScreen extends StatelessWidget { ), ), ), - SizedBox(height: 20.v), + SizedBox(height: 24), GestureDetector( onTap: () => _selectRetireTime(context, state), child: AbsorbPointer( @@ -987,7 +987,7 @@ class DiaryScreen extends StatelessWidget { ), ), ), - SizedBox(height: 20.v), + SizedBox(height: 24), ], ), ), @@ -1044,8 +1044,8 @@ class DiaryScreen extends StatelessWidget { _buildMood(BuildContext context, DiaryStateLoaded state) { return Container( padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/features/recipes/presentation/pages/recipe_create_screen.dart b/lib/features/recipes/presentation/pages/recipe_create_screen.dart index 4dd349de..778e2b4b 100644 --- a/lib/features/recipes/presentation/pages/recipe_create_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_create_screen.dart @@ -385,10 +385,10 @@ class RecipeCreateScreen extends StatelessWidget { _buildIngredient(Ingredient ingredient) { return Container( - margin: EdgeInsets.symmetric(horizontal: 10.h), + margin: EdgeInsets.symmetric(horizontal: 12), padding: EdgeInsets.symmetric( - horizontal: 8.h, - vertical: 6.v, + horizontal: 8, + vertical: 8, ), decoration: AppDecoration.fillGray.copyWith( borderRadius: BorderRadiusStyle.roundedBorder5, @@ -399,8 +399,8 @@ class RecipeCreateScreen extends StatelessWidget { children: [ Padding( padding: EdgeInsets.only( - left: 7.h, - top: 5.v, + left: 8, + top: 8, ), child: Text( ingredient.name.length > 8 ? ingredient.name.substring(0, 8) : ingredient.name, @@ -409,9 +409,9 @@ class RecipeCreateScreen extends StatelessWidget { ), Padding( padding: EdgeInsets.only( - left: 20.h, - top: 3.v, - bottom: 3.v, + left: 24, + top: 4, + bottom: 4, ), child: Text( ingredient.portion.toString() + ' ' + ingredient.unit.toString().tr, diff --git a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart index d08a86a7..a0c79776 100644 --- a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart @@ -394,10 +394,10 @@ class RecipeEditScreen extends StatelessWidget { _buildIngredient(Ingredient ingredient) { return Container( - margin: EdgeInsets.symmetric(horizontal: 10.h), + margin: EdgeInsets.symmetric(horizontal: 12), padding: EdgeInsets.symmetric( - horizontal: 8.h, - vertical: 6.v, + horizontal: 8, + vertical: 8, ), decoration: AppDecoration.fillGray.copyWith( borderRadius: BorderRadiusStyle.roundedBorder5, @@ -408,8 +408,8 @@ class RecipeEditScreen extends StatelessWidget { children: [ Padding( padding: EdgeInsets.only( - left: 7.h, - top: 5.v, + left: 8, + top: 8, ), child: Text( ingredient.name.length > 8 ? ingredient.name.substring(0, 8) : ingredient.name, @@ -418,9 +418,9 @@ class RecipeEditScreen extends StatelessWidget { ), Padding( padding: EdgeInsets.only( - left: 20.h, - top: 3.v, - bottom: 3.v, + left: 24, + top: 4, + bottom: 4, ), child: Text( ingredient.portion.toString() + ' ' + ingredient.unit.toString().tr, diff --git a/lib/features/registration/presentation/pages/blood_pressure_screen.dart b/lib/features/registration/presentation/pages/blood_pressure_screen.dart index d22cf321..e773c3eb 100644 --- a/lib/features/registration/presentation/pages/blood_pressure_screen.dart +++ b/lib/features/registration/presentation/pages/blood_pressure_screen.dart @@ -84,9 +84,15 @@ class _BloodPressureScreenState extends State { SizedBox(height: 4), CustomDropDown( icon: Container( - margin: EdgeInsets.fromLTRB(30.h, 11.v, 13.h, 11.v), - decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)), - child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize), + margin: EdgeInsets.all(16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + ), + child: CustomImageView( + imagePath: ImageConstant.imgFavorite, + height: 16, + width: 16, + ), ), hintText: "Не выбрано".tr, items: selectionPopupList, @@ -104,9 +110,15 @@ class _BloodPressureScreenState extends State { SizedBox(height: 4), CustomDropDown( icon: Container( - margin: EdgeInsets.fromLTRB(30.h, 11.v, 13.h, 11.v), - decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)), - child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize), + margin: EdgeInsets.all(16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + ), + child: CustomImageView( + imagePath: ImageConstant.imgFavorite, + height: 16, + width: 16, + ), ), hintText: "Не выбрано".tr, items: selectionPopupList, diff --git a/lib/old/diets/diet_create_screen/diet_create_screen.dart b/lib/old/diets/diet_create_screen/diet_create_screen.dart index c5593dd4..0abc3aba 100644 --- a/lib/old/diets/diet_create_screen/diet_create_screen.dart +++ b/lib/old/diets/diet_create_screen/diet_create_screen.dart @@ -46,14 +46,14 @@ class DietCreateScreen extends StatelessWidget { decoration: AppDecoration.fillGray, child: ListView( children: [ - SizedBox(height: 30.v), + SizedBox(height: 30), Container( margin: EdgeInsets.only( - left: 16.h, - right: 20.h, - bottom: 10.h, + left: 16, + right: 20, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), diff --git a/lib/old/diets/diet_edit_screen/diet_edit_screen.dart b/lib/old/diets/diet_edit_screen/diet_edit_screen.dart index 5109bf12..ea43dd45 100644 --- a/lib/old/diets/diet_edit_screen/diet_edit_screen.dart +++ b/lib/old/diets/diet_edit_screen/diet_edit_screen.dart @@ -47,14 +47,14 @@ class DietEditScreen extends StatelessWidget { decoration: AppDecoration.fillGray, child: ListView( children: [ - SizedBox(height: 30.v), + SizedBox(height: 30), Container( margin: EdgeInsets.only( - left: 16.h, - right: 20.h, - bottom: 10.h, + left: 16, + right: 20, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), diff --git a/lib/old/diets/diet_select_screen/diet_select_screen.dart b/lib/old/diets/diet_select_screen/diet_select_screen.dart index 3f4a8ce8..18ea53cb 100644 --- a/lib/old/diets/diet_select_screen/diet_select_screen.dart +++ b/lib/old/diets/diet_select_screen/diet_select_screen.dart @@ -74,20 +74,20 @@ class DietSelectScreen extends StatelessWidget { ], ), child: CustomAppBar( - height: 54.v, - leadingWidth: 28.h, + height: 54, + leadingWidth: 28, leading: AppbarLeadingImage( imagePath: ImageConstant.imgArrowLeft, - margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), + margin: EdgeInsets.only(left: 16, top: 15, bottom: 15), onTap: () => GoRouter.of(context).pop(), ), title: Padding( - padding: EdgeInsets.only(left: 20.h), + padding: EdgeInsets.only(left: 20), child: Row( children: [ AppbarSubtitle( text: "Диеты", - margin: EdgeInsets.only(left: 80.h, top: 12.v, bottom: 9.v), + margin: EdgeInsets.only(left: 80, top: 12, bottom: 9), ), Spacer(), Padding( diff --git a/lib/old/diets/diet_show_screen/diet_show_screen.dart b/lib/old/diets/diet_show_screen/diet_show_screen.dart index 64a25e98..1220fea9 100644 --- a/lib/old/diets/diet_show_screen/diet_show_screen.dart +++ b/lib/old/diets/diet_show_screen/diet_show_screen.dart @@ -48,14 +48,14 @@ class DietScreen extends StatelessWidget { decoration: AppDecoration.fillGray, child: ListView( children: [ - SizedBox(height: 30.v), + SizedBox(height: 30), Container( margin: EdgeInsets.only( - left: 16.h, - right: 20.h, - bottom: 10.h, + left: 16, + right: 20, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), diff --git a/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart b/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart index a88bf3e3..0770341d 100644 --- a/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart +++ b/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart @@ -50,14 +50,14 @@ class BlogPostEditScreen extends StatelessWidget { decoration: AppDecoration.fillGray, child: ListView( children: [ - SizedBox(height: 30.v), + SizedBox(height: 30), Container( margin: EdgeInsets.only( - left: 16.h, - right: 20.h, - bottom: 10.h, + left: 16, + right: 20, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), diff --git a/lib/old/feed/blog_post_screen/widgets/comment_widget.dart b/lib/old/feed/blog_post_screen/widgets/comment_widget.dart index 421c2c71..5eb3d53a 100644 --- a/lib/old/feed/blog_post_screen/widgets/comment_widget.dart +++ b/lib/old/feed/blog_post_screen/widgets/comment_widget.dart @@ -17,11 +17,11 @@ class CommentWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( margin: EdgeInsets.only( - left: 16.h, - right: 20.h, - bottom: 10.h, + left: 16, + right: 20, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), @@ -54,15 +54,15 @@ class CommentWidget extends StatelessWidget { Expanded( child: Padding( padding: EdgeInsets.only( - left: 12.h, - top: 2.v, - bottom: 11.v, + left: 12, + top: 2, + bottom: 11, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - width: 227.h, + width: 227, child: Row( children: [ Text( @@ -71,7 +71,7 @@ class CommentWidget extends StatelessWidget { ), Spacer(), Padding( - padding: EdgeInsets.only(left: 6.h), + padding: EdgeInsets.only(left: 6), child: Text( commentModelObj.dateText!, style: theme.textTheme.bodyMedium, @@ -80,7 +80,7 @@ class CommentWidget extends StatelessWidget { ], ), ), - SizedBox(height: 6.v), + SizedBox(height: 6), Text( commentModelObj.greetingText!, style: CustomTextStyles.bodyMediumBluegray800, @@ -91,8 +91,8 @@ class CommentWidget extends StatelessWidget { ), CustomImageView( imagePath: ImageConstant.imgSend, - height: 30.v, - width: 30.h, + height: 30, + width: 30, margin: EdgeInsets.only(left: 5), ), ], diff --git a/lib/old/feed/feed_screen/widgets/feed_search_view.dart b/lib/old/feed/feed_screen/widgets/feed_search_view.dart index bbfff40f..1918aeaa 100644 --- a/lib/old/feed/feed_screen/widgets/feed_search_view.dart +++ b/lib/old/feed/feed_screen/widgets/feed_search_view.dart @@ -118,34 +118,34 @@ class CustomSearchView extends StatelessWidget { ), prefixIconConstraints: prefixConstraints ?? BoxConstraints( - maxHeight: 40.v, + maxHeight: 40, ), suffixIconConstraints: suffixConstraints ?? BoxConstraints( - maxHeight: 40.v, + maxHeight: 40, ), isDense: true, contentPadding: contentPadding ?? EdgeInsets.only( - top: 11.v, - right: 11.h, - bottom: 11.v, + top: 11, + right: 11, + bottom: 11, ), fillColor: fillColor ?? Colors.grey[200], filled: filled, border: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(8.h), + borderRadius: BorderRadius.circular(8), borderSide: BorderSide.none, ), enabledBorder: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(8.h), + borderRadius: BorderRadius.circular(8), borderSide: BorderSide.none, ), focusedBorder: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(8.h), + borderRadius: BorderRadius.circular(8), borderSide: BorderSide.none, ), ); diff --git a/lib/old/glossary/glossary_screen/widgets/glossary_search_widget.dart b/lib/old/glossary/glossary_screen/widgets/glossary_search_widget.dart index bbfff40f..1918aeaa 100644 --- a/lib/old/glossary/glossary_screen/widgets/glossary_search_widget.dart +++ b/lib/old/glossary/glossary_screen/widgets/glossary_search_widget.dart @@ -118,34 +118,34 @@ class CustomSearchView extends StatelessWidget { ), prefixIconConstraints: prefixConstraints ?? BoxConstraints( - maxHeight: 40.v, + maxHeight: 40, ), suffixIconConstraints: suffixConstraints ?? BoxConstraints( - maxHeight: 40.v, + maxHeight: 40, ), isDense: true, contentPadding: contentPadding ?? EdgeInsets.only( - top: 11.v, - right: 11.h, - bottom: 11.v, + top: 11, + right: 11, + bottom: 11, ), fillColor: fillColor ?? Colors.grey[200], filled: filled, border: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(8.h), + borderRadius: BorderRadius.circular(8), borderSide: BorderSide.none, ), enabledBorder: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(8.h), + borderRadius: BorderRadius.circular(8), borderSide: BorderSide.none, ), focusedBorder: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(8.h), + borderRadius: BorderRadius.circular(8), borderSide: BorderSide.none, ), ); diff --git a/lib/old/plans/plan_create_screen/plan_create_screen.dart b/lib/old/plans/plan_create_screen/plan_create_screen.dart index c3ea8979..f369e4a0 100644 --- a/lib/old/plans/plan_create_screen/plan_create_screen.dart +++ b/lib/old/plans/plan_create_screen/plan_create_screen.dart @@ -46,14 +46,14 @@ class PlanCreateScreen extends StatelessWidget { decoration: AppDecoration.fillGray, child: ListView( children: [ - SizedBox(height: 30.v), + SizedBox(height: 30), Container( margin: EdgeInsets.only( - left: 16.h, - right: 20.h, - bottom: 10.h, + left: 16, + right: 20, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), diff --git a/lib/old/plans/plan_edit_screen/plan_edit_screen.dart b/lib/old/plans/plan_edit_screen/plan_edit_screen.dart index 905eb614..4936da7d 100644 --- a/lib/old/plans/plan_edit_screen/plan_edit_screen.dart +++ b/lib/old/plans/plan_edit_screen/plan_edit_screen.dart @@ -47,14 +47,14 @@ class PlanEditScreen extends StatelessWidget { decoration: AppDecoration.fillGray, child: ListView( children: [ - SizedBox(height: 30.v), + SizedBox(height: 30), Container( margin: EdgeInsets.only( - left: 16.h, - right: 20.h, - bottom: 10.h, + left: 16, + right: 20, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), diff --git a/lib/old/plans/plan_select_screen/plan_select_screen.dart b/lib/old/plans/plan_select_screen/plan_select_screen.dart index 1508c75e..d5b3d06d 100644 --- a/lib/old/plans/plan_select_screen/plan_select_screen.dart +++ b/lib/old/plans/plan_select_screen/plan_select_screen.dart @@ -74,20 +74,20 @@ class PlanSelectScreen extends StatelessWidget { ], ), child: CustomAppBar( - height: 54.v, - leadingWidth: 28.h, + height: 54, + leadingWidth: 28, leading: AppbarLeadingImage( imagePath: ImageConstant.imgArrowLeft, - margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), + margin: EdgeInsets.only(left: 16, top: 15, bottom: 15), onTap: () => GoRouter.of(context).pop(), ), title: Padding( - padding: EdgeInsets.only(left: 20.h), + padding: EdgeInsets.only(left: 20), child: Row( children: [ AppbarSubtitle( text: "Планы", - margin: EdgeInsets.only(left: 80.h, top: 12.v, bottom: 9.v), + margin: EdgeInsets.only(left: 80, top: 12, bottom: 9), ), Spacer(), Padding( diff --git a/lib/old/plans/plan_show_screen/plan_show_screen.dart b/lib/old/plans/plan_show_screen/plan_show_screen.dart index 24958189..67565f96 100644 --- a/lib/old/plans/plan_show_screen/plan_show_screen.dart +++ b/lib/old/plans/plan_show_screen/plan_show_screen.dart @@ -48,14 +48,14 @@ class PlanScreen extends StatelessWidget { decoration: AppDecoration.fillGray, child: ListView( children: [ - SizedBox(height: 30.v), + SizedBox(height: 30), Container( margin: EdgeInsets.only( - left: 16.h, - right: 20.h, - bottom: 10.h, + left: 16, + right: 20, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), diff --git a/lib/old/profile/my_profile_screen/my_profile_screen.dart b/lib/old/profile/my_profile_screen/my_profile_screen.dart index ddf76455..ca88e2e0 100644 --- a/lib/old/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/old/profile/my_profile_screen/my_profile_screen.dart @@ -73,11 +73,11 @@ class MyProfileScreen extends StatelessWidget { padding: EdgeInsets.all(16), child: Column( children: [ - SizedBox(height: 30.v), + SizedBox(height: 30), Container( padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, @@ -93,11 +93,11 @@ class MyProfileScreen extends StatelessWidget { ), child: _buildInfo(context, state), ), - SizedBox(height: 15.v), + SizedBox(height: 15), Container( padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, @@ -113,12 +113,12 @@ class MyProfileScreen extends StatelessWidget { ), child: _buildCarousel(context, state), ), - SizedBox(height: 15.v), + SizedBox(height: 15), if (!state.plans!.isEmpty) Container( padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, @@ -139,7 +139,7 @@ class MyProfileScreen extends StatelessWidget { state.plans?.map((plan) => plan['state']).toList(), ), ), - SizedBox(height: 5.v), + SizedBox(height: 5), ], ), ), @@ -169,7 +169,7 @@ class MyProfileScreen extends StatelessWidget { ), ), AppbarSubtitle(text: state.user?['name'] ?? ''), - SizedBox(height: 20.v), + SizedBox(height: 20), Text(state.userDetails?['additional_info'] ?? ''), ], ); @@ -207,7 +207,7 @@ class MyProfileScreen extends StatelessWidget { color: appTheme.black900, ), ), - SizedBox(height: 50.v), + SizedBox(height: 50), _buildChart( context, state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], @@ -225,7 +225,7 @@ class MyProfileScreen extends StatelessWidget { color: appTheme.black900, ), ), - SizedBox(height: 50.v), + SizedBox(height: 50), _buildChart( context, _bodyMassIndex( @@ -247,7 +247,7 @@ class MyProfileScreen extends StatelessWidget { color: appTheme.black900, ), ), - SizedBox(height: 30.v), + SizedBox(height: 30), _buildCircumferenceChart(context, state.circumferences, state.chartDates), _buildChartLegend(), ], @@ -646,22 +646,22 @@ class MyProfileScreen extends StatelessWidget { /// Section Widget _buildPlans(BuildContext context, List? plans, List? imagePaths, List? states) { return Padding( - padding: EdgeInsets.only(left: 7.h), + padding: EdgeInsets.only(left: 7), child: Column( children: [ Padding( - padding: EdgeInsets.only(left: 15.h), + padding: EdgeInsets.only(left: 15), child: Text("plans_complete".tr, style: CustomTextStyles.titleMediumBlack.copyWith(color: appTheme.black900)), ), - SizedBox(height: 5.v), + SizedBox(height: 5), Container( decoration: AppDecoration.outlineBlueGray.copyWith(borderRadius: BorderRadiusStyle.roundedBorder5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 105.v, - width: 343.h, + height: 105, + width: 343, child: Stack( alignment: Alignment.bottomCenter, children: [ @@ -687,28 +687,28 @@ class MyProfileScreen extends StatelessWidget { break; } return SizedBox( - height: 40.v, - width: 343.h, + height: 40, + width: 343, child: Stack( alignment: Alignment.bottomRight, children: [ Align( alignment: Alignment.topCenter, child: Container( - margin: EdgeInsets.only(bottom: 11.v), - padding: EdgeInsets.symmetric(horizontal: 6.h, vertical: 4.v), + margin: EdgeInsets.only(bottom: 11), + padding: EdgeInsets.symmetric(horizontal: 6, vertical: 4), decoration: AppDecoration.fillGray.copyWith(borderRadius: BorderRadiusStyle.roundedBorder5), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Padding( - padding: EdgeInsets.only(bottom: 1.v), + padding: EdgeInsets.only(bottom: 1), child: Text(plans![i], style: CustomTextStyles.titleSmallBluegray800Bold), ), Container( - height: 19.v, - width: 100.h, - decoration: BoxDecoration(color: boxColor, borderRadius: BorderRadius.circular(5.h)), + height: 19, + width: 100, + decoration: BoxDecoration(color: boxColor, borderRadius: BorderRadius.circular(5)), ), ], ), @@ -717,19 +717,19 @@ class MyProfileScreen extends StatelessWidget { Align( alignment: Alignment.center, child: Container( - margin: EdgeInsets.only(bottom: 12.h), + margin: EdgeInsets.only(bottom: 12), child: Image.network( baseUrl + '/storage/' + imagePaths?[i], - height: 25.adaptSize, - width: 25.adaptSize, + height: 24, + width: 24, ), ), ), Align( alignment: Alignment.bottomRight, child: Container( - width: 70.h, - margin: EdgeInsets.only(bottom: 14.h, right: 22.h), + width: 70, + margin: EdgeInsets.only(bottom: 14, right: 22), child: Text("$state".tr, maxLines: 3, overflow: TextOverflow.ellipsis, style: theme.textTheme.titleSmall), ), ), @@ -773,10 +773,10 @@ class MyProfileScreen extends StatelessWidget { child: ListView( children: [ Padding( - padding: EdgeInsets.symmetric(vertical: 5.v), + padding: EdgeInsets.symmetric(vertical: 5), child: Text("chest_circumference".tr, style: theme.textTheme.bodyLarge), ), - SizedBox(height: 5.v), + SizedBox(height: 5), CustomTextFormField( controller: state.chestCircumferenceController, keyboardType: TextInputType.number, @@ -785,10 +785,10 @@ class MyProfileScreen extends StatelessWidget { ], ), Padding( - padding: EdgeInsets.symmetric(vertical: 15.v), + padding: EdgeInsets.symmetric(vertical: 15), child: Text("waist_circumference".tr, style: theme.textTheme.bodyLarge), ), - SizedBox(height: 5.v), + SizedBox(height: 5), CustomTextFormField( controller: state.waistCircumferenceController, keyboardType: TextInputType.number, @@ -797,10 +797,10 @@ class MyProfileScreen extends StatelessWidget { ], ), Padding( - padding: EdgeInsets.symmetric(vertical: 15.v), + padding: EdgeInsets.symmetric(vertical: 15), child: Text("hip_circumference".tr, style: theme.textTheme.bodyLarge), ), - SizedBox(height: 5.v), + SizedBox(height: 5), CustomTextFormField( controller: state.hipCircumferenceController, keyboardType: TextInputType.number, diff --git a/lib/old/profile/my_profile_screen/my_settings_screen.dart b/lib/old/profile/my_profile_screen/my_settings_screen.dart index 4cd47b18..f9a28356 100644 --- a/lib/old/profile/my_profile_screen/my_settings_screen.dart +++ b/lib/old/profile/my_profile_screen/my_settings_screen.dart @@ -78,24 +78,24 @@ class MySettingsScreen extends StatelessWidget { ], ), child: CustomAppBar( - height: 54.v, - leadingWidth: 28.h, + height: 54, + leadingWidth: 28, leading: AppbarLeadingImage( imagePath: ImageConstant.imgArrowLeft, - margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), + margin: EdgeInsets.only(left: 16, top: 15, bottom: 15), onTap: () => GoRouter.of(context).pop(), ), title: Padding( - padding: EdgeInsets.only(left: 20.h), - child: Row(children: [AppbarSubtitle(text: state.user?['name'], margin: EdgeInsets.only(left: 80.h, top: 12.v, bottom: 9.v))]), + padding: EdgeInsets.only(left: 20), + child: Row(children: [AppbarSubtitle(text: state.user?['name'], margin: EdgeInsets.only(left: 80, top: 12, bottom: 9))]), ), ), ), SizedBox(height: 20), Container( padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, @@ -119,8 +119,8 @@ class MySettingsScreen extends StatelessWidget { SizedBox(height: 20), Container( padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, @@ -145,8 +145,8 @@ class MySettingsScreen extends StatelessWidget { SizedBox(height: 20), Container( padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart b/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart index 84350e27..c0675b62 100644 --- a/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart +++ b/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart @@ -67,14 +67,14 @@ class RecipeEditScreen extends StatelessWidget { child: ListView( children: [ _buldAppBar(context), - SizedBox(height: 20.v), + SizedBox(height: 20), _buildRecipeInfo(state, context), - SizedBox(height: 20.v), + SizedBox(height: 20), Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: steps, ), - SizedBox(height: 20.v), + SizedBox(height: 20), _buildAdditional(context, state), ], ), @@ -86,7 +86,7 @@ class RecipeEditScreen extends StatelessWidget { _buldAppBar(BuildContext context) { return Container( - margin: EdgeInsets.all(16.h), + margin: EdgeInsets.all(16), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), @@ -100,11 +100,11 @@ class RecipeEditScreen extends StatelessWidget { ], ), child: CustomAppBar( - height: 54.v, - leadingWidth: 28.h, + height: 54, + leadingWidth: 28, leading: AppbarLeadingImage( imagePath: ImageConstant.imgArrowLeft, - margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), + margin: EdgeInsets.only(left: 16, top: 15, bottom: 15), onTap: onTapBack(context), ), title: Align( @@ -120,11 +120,11 @@ class RecipeEditScreen extends StatelessWidget { _buildRecipeInfo(RecipeEditLoadedState state, BuildContext context) { return Container( margin: EdgeInsets.only( - left: 16.h, - right: 16.h, - bottom: 10.h, + left: 16, + right: 16, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), @@ -161,7 +161,7 @@ class RecipeEditScreen extends StatelessWidget { hintText: "Введите название рецепта", fillColor: appTheme.gray50, borderDecoration: OutlineInputBorder( - borderRadius: BorderRadius.circular(5.h), + borderRadius: BorderRadius.circular(5), borderSide: BorderSide( color: appTheme.gray50, width: 1, @@ -176,7 +176,7 @@ class RecipeEditScreen extends StatelessWidget { maxLines: 4, fillColor: appTheme.gray50, borderDecoration: OutlineInputBorder( - borderRadius: BorderRadius.circular(5.h), + borderRadius: BorderRadius.circular(5), borderSide: BorderSide( color: appTheme.gray50, width: 1, @@ -203,8 +203,8 @@ class RecipeEditScreen extends StatelessWidget { if (!isLoading) Container( padding: EdgeInsets.symmetric( - horizontal: 40.h, - vertical: 80.v, + horizontal: 40, + vertical: 80, ), decoration: AppDecoration.fillGray.copyWith( borderRadius: BorderRadiusStyle.roundedBorder5, @@ -215,8 +215,8 @@ class RecipeEditScreen extends StatelessWidget { children: [ Padding( padding: EdgeInsets.only( - left: 7.h, - top: 5.v, + left: 7, + top: 5, ), child: Text( "Добавить фото", @@ -233,9 +233,9 @@ class RecipeEditScreen extends StatelessWidget { ), /*if (isLoading) Container( - margin: EdgeInsets.symmetric(horizontal: 10.h), + margin: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric( - horizontal: 40.h, + horizontal: 40, vertical: 80.v, ), decoration: AppDecoration.fillGray.copyWith( @@ -258,11 +258,11 @@ class RecipeEditScreen extends StatelessWidget { return Container( margin: EdgeInsets.only( - left: 16.h, - right: 16.h, - bottom: 10.h, + left: 16, + right: 16, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), @@ -292,7 +292,7 @@ class RecipeEditScreen extends StatelessWidget { maxLines: 4, fillColor: appTheme.gray50, borderDecoration: OutlineInputBorder( - borderRadius: BorderRadius.circular(5.h), + borderRadius: BorderRadius.circular(5), borderSide: BorderSide( color: appTheme.gray50, width: 1, @@ -361,11 +361,11 @@ class RecipeEditScreen extends StatelessWidget { _buildAdditional(BuildContext context, RecipeEditLoadedState state) { return Container( margin: EdgeInsets.only( - left: 16.h, - right: 16.h, - bottom: 10.h, + left: 16, + right: 16, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), @@ -390,7 +390,7 @@ class RecipeEditScreen extends StatelessWidget { hintText: "YouTube", fillColor: appTheme.gray50, borderDecoration: OutlineInputBorder( - borderRadius: BorderRadius.circular(5.h), + borderRadius: BorderRadius.circular(5), borderSide: BorderSide( color: appTheme.gray50, width: 1, @@ -414,7 +414,7 @@ class RecipeEditScreen extends StatelessWidget { initialValue: initialText, fillColor: appTheme.gray50, borderDecoration: OutlineInputBorder( - borderRadius: BorderRadius.circular(5.h), + borderRadius: BorderRadius.circular(5), borderSide: BorderSide( color: appTheme.gray50, width: 1, diff --git a/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart b/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart index 2f7d2cc1..d1320268 100644 --- a/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart +++ b/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart @@ -72,20 +72,20 @@ class RecipeSelectScreen extends StatelessWidget { ], ), child: CustomAppBar( - height: 54.v, - leadingWidth: 28.h, + height: 54, + leadingWidth: 28, leading: AppbarLeadingImage( imagePath: ImageConstant.imgArrowLeft, - margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), + margin: EdgeInsets.only(left: 16, top: 15, bottom: 15), onTap: () => GoRouter.of(context).pop(), ), title: Padding( - padding: EdgeInsets.only(left: 20.h), + padding: EdgeInsets.only(left: 20), child: Row( children: [ AppbarSubtitle( text: "Рецепты", - margin: EdgeInsets.only(left: 80.h, top: 12.v, bottom: 9.v), + margin: EdgeInsets.only(left: 80, top: 12, bottom: 9), ), Spacer(), Padding( diff --git a/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart b/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart index 75e170ef..0a5b67ad 100644 --- a/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart +++ b/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart @@ -61,18 +61,18 @@ class RecipeScreen extends StatelessWidget { decoration: AppDecoration.fillGray, child: ListView( children: [ - SizedBox(height: 15.v), + SizedBox(height: 15), _buildHeaderRow(context, state), - SizedBox(height: 15.v), + SizedBox(height: 15), _buildRecipeData(context, state), - SizedBox(height: 15.v), + SizedBox(height: 15), Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: steps, ), - SizedBox(height: 15.v), + SizedBox(height: 15), _buildTextField(context, state), - SizedBox(height: 15.v), + SizedBox(height: 15), _buildCommentSection(context, state), ], ), @@ -83,10 +83,10 @@ class RecipeScreen extends StatelessWidget { _buildHeaderRow(BuildContext context, RecipeLoadedState state) { final String name = state.author?['name']; return Container( - margin: EdgeInsets.symmetric(horizontal: 16.h, vertical: 16.h), + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), padding: EdgeInsets.symmetric( - horizontal: 24.h, - vertical: 12.v, + horizontal: 24, + vertical: 12, ), decoration: BoxDecoration( color: Colors.white, @@ -108,7 +108,7 @@ class RecipeScreen extends StatelessWidget { onTap: () => GoRouter.of(context).pop(), ), Padding( - padding: EdgeInsets.only(top: 1.v), + padding: EdgeInsets.only(top: 1), child: Row( children: [ Align( @@ -142,11 +142,11 @@ class RecipeScreen extends StatelessWidget { _buildRecipeData(BuildContext context, RecipeLoadedState state) { return Container( margin: EdgeInsets.only( - left: 16.h, - right: 20.h, - bottom: 10.h, + left: 16, + right: 20, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), @@ -343,11 +343,11 @@ class RecipeScreen extends StatelessWidget { _buildTextField(BuildContext context, RecipeLoadedState state) { return Container( margin: EdgeInsets.only( - left: 16.h, - right: 20.h, - bottom: 10.h, + left: 16, + right: 20, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), @@ -369,7 +369,7 @@ class RecipeScreen extends StatelessWidget { controller: state.commentController, maxLines: 4, ), - SizedBox(height: 15.h), + SizedBox(height: 15), CustomOutlinedButton( text: "Оставить отзыв", margin: EdgeInsets.only(bottom: 5), @@ -425,11 +425,11 @@ class RecipeScreen extends StatelessWidget { Widget _buildStep(BuildContext context, RecipeLoadedState state, int i) { return Container( margin: EdgeInsets.only( - left: 16.h, - right: 16.h, - bottom: 10.h, + left: 16, + right: 16, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), diff --git a/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart b/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart index 421c2c71..5eb3d53a 100644 --- a/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart +++ b/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart @@ -17,11 +17,11 @@ class CommentWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( margin: EdgeInsets.only( - left: 16.h, - right: 20.h, - bottom: 10.h, + left: 16, + right: 20, + bottom: 10, ), - padding: EdgeInsets.all(12.h), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: const BorderRadius.all(Radius.circular(12)), @@ -54,15 +54,15 @@ class CommentWidget extends StatelessWidget { Expanded( child: Padding( padding: EdgeInsets.only( - left: 12.h, - top: 2.v, - bottom: 11.v, + left: 12, + top: 2, + bottom: 11, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - width: 227.h, + width: 227, child: Row( children: [ Text( @@ -71,7 +71,7 @@ class CommentWidget extends StatelessWidget { ), Spacer(), Padding( - padding: EdgeInsets.only(left: 6.h), + padding: EdgeInsets.only(left: 6), child: Text( commentModelObj.dateText!, style: theme.textTheme.bodyMedium, @@ -80,7 +80,7 @@ class CommentWidget extends StatelessWidget { ], ), ), - SizedBox(height: 6.v), + SizedBox(height: 6), Text( commentModelObj.greetingText!, style: CustomTextStyles.bodyMediumBluegray800, @@ -91,8 +91,8 @@ class CommentWidget extends StatelessWidget { ), CustomImageView( imagePath: ImageConstant.imgSend, - height: 30.v, - width: 30.h, + height: 30, + width: 30, margin: EdgeInsets.only(left: 5), ), ], diff --git a/lib/old/users/subscribers_screen/subscribers_screen.dart b/lib/old/users/subscribers_screen/subscribers_screen.dart index 51fde5d3..4d1caf23 100644 --- a/lib/old/users/subscribers_screen/subscribers_screen.dart +++ b/lib/old/users/subscribers_screen/subscribers_screen.dart @@ -66,20 +66,20 @@ class SubscribersScreen extends StatelessWidget { ], ), child: CustomAppBar( - height: 54.v, - leadingWidth: 28.h, + height: 54, + leadingWidth: 28, leading: AppbarLeadingImage( imagePath: ImageConstant.imgArrowLeft, - margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), + margin: EdgeInsets.only(left: 16, top: 15, bottom: 15), onTap: () => GoRouter.of(context).pop(), ), title: Padding( - padding: EdgeInsets.only(left: 20.h), + padding: EdgeInsets.only(left: 20), child: Row( children: [ AppbarSubtitle( text: "Мои подписчики", - margin: EdgeInsets.only(left: 80.h, top: 12.v, bottom: 9.v), + margin: EdgeInsets.only(left: 80, top: 12, bottom: 9), ), Spacer(), Padding( diff --git a/lib/theme/app_decoration.dart b/lib/theme/app_decoration.dart index c84477ef..c9d30536 100644 --- a/lib/theme/app_decoration.dart +++ b/lib/theme/app_decoration.dart @@ -12,7 +12,7 @@ class AppDecoration { color: theme.colorScheme.onPrimary, border: Border.all( color: appTheme.blueA400, - width: 1.h, + width: 1, ), ); @@ -20,7 +20,7 @@ class AppDecoration { color: theme.colorScheme.onPrimary, border: Border.all( color: theme.colorScheme.primary, - width: 1.h, + width: 1, ), ); @@ -55,7 +55,7 @@ class AppDecoration { static BoxDecoration get outlineBlueGray => BoxDecoration( border: Border.all( color: appTheme.blueGray800, - width: 1.h, + width: 1, strokeAlign: strokeAlignOutside, ), ); @@ -64,12 +64,12 @@ class AppDecoration { class BorderRadiusStyle { // Circle borders static BorderRadius get circleBorder8 => BorderRadius.circular( - 8.h, + 8, ); // Rounded borders static BorderRadius get roundedBorder1 => BorderRadius.circular( - 1.h, + 1, ); // Outline decorations @@ -78,8 +78,8 @@ class BorderRadiusStyle { boxShadow: [ BoxShadow( color: appTheme.black900.withOpacity(0.15), - spreadRadius: 2.h, - blurRadius: 2.h, + spreadRadius: 2, + blurRadius: 2, offset: Offset( 0, 2, @@ -91,49 +91,49 @@ class BorderRadiusStyle { static BoxDecoration get outlineBlueGray => BoxDecoration( border: Border.all( color: appTheme.blueGray800, - width: 1.h, + width: 1, strokeAlign: strokeAlignOutside, ), ); // Circle borders static BorderRadius get circleBorder17 => BorderRadius.circular( - 17.h, + 17, ); static BorderRadius get circleBorder20 => BorderRadius.circular( - 20.h, + 20, ); static BorderRadius get circleBorder62 => BorderRadius.circular( - 62.h, + 62, ); // Custom borders static BorderRadius get customBorderBL8 => BorderRadius.only( - bottomLeft: Radius.circular(8.h), + bottomLeft: Radius.circular(8), ); static BorderRadius get customBorderTL5 => BorderRadius.vertical( - top: Radius.circular(5.h), + top: Radius.circular(5), ); static BorderRadius get customBorderTL51 => BorderRadius.only( - topLeft: Radius.circular(5.h), - bottomRight: Radius.circular(5.h), + topLeft: Radius.circular(5), + bottomRight: Radius.circular(5), ); // Rounded borders static BorderRadius get roundedBorder12 => BorderRadius.circular( - 12.h, + 12, ); static BorderRadius get roundedBorder5 => BorderRadius.circular( - 5.h, + 5, ); static BorderRadius get roundedBorder8 => BorderRadius.circular( - 8.h, + 8, ); } diff --git a/lib/theme/custom_button_style.dart b/lib/theme/custom_button_style.dart index bcd021c1..a5eb6f88 100644 --- a/lib/theme/custom_button_style.dart +++ b/lib/theme/custom_button_style.dart @@ -11,7 +11,7 @@ class CustomButtonStyles { width: 0, ), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(15.h), + borderRadius: BorderRadius.circular(15), ), ); diff --git a/lib/theme/custom_text_style.dart b/lib/theme/custom_text_style.dart index 1ed606cd..ee624454 100644 --- a/lib/theme/custom_text_style.dart +++ b/lib/theme/custom_text_style.dart @@ -21,7 +21,7 @@ class CustomTextStyles { static get bodyMediumBlack90013 => theme.textTheme.bodyMedium!.copyWith( color: appTheme.black900, - fontSize: 13.fSize, + fontSize: 13, ); static get bodyMediumBluegray800 => theme.textTheme.bodyMedium!.copyWith( @@ -42,27 +42,27 @@ class CustomTextStyles { static get bodySmallMulishBlack900 => theme.textTheme.bodySmall!.mulish.copyWith( color: appTheme.black900, - fontSize: 12.fSize, + fontSize: 12, ); static get bodySmallMulishBluegray800 => theme.textTheme.bodySmall!.mulish.copyWith( color: appTheme.blueGray800, - fontSize: 12.fSize, + fontSize: 12, ); static get bodySmallMulishBluegray80012 => theme.textTheme.bodySmall!.mulish.copyWith( color: appTheme.blueGray800, - fontSize: 12.fSize, + fontSize: 12, ); static get bodySmallMulishBluegray80012_1 => theme.textTheme.bodySmall!.mulish.copyWith( color: appTheme.blueGray800, - fontSize: 12.fSize, + fontSize: 12, ); static get bodySmallMulishBluegray900 => theme.textTheme.bodySmall!.mulish.copyWith( color: appTheme.blueGray900, - fontSize: 12.fSize, + fontSize: 12, ); static get bodySmallMulishGray600 => theme.textTheme.bodySmall!.mulish.copyWith( @@ -71,12 +71,12 @@ class CustomTextStyles { static get bodySmallMulishPrimary => theme.textTheme.bodySmall!.mulish.copyWith( color: theme.colorScheme.primary, - fontSize: 12.fSize, + fontSize: 12, ); static get bodySmallSegoeUIBlack900 => theme.textTheme.bodySmall!.segoeUI.copyWith( color: appTheme.black900, - fontSize: 12.fSize, + fontSize: 12, ); // Label text style @@ -90,11 +90,11 @@ class CustomTextStyles { // Title text style static get titleMedium16 => theme.textTheme.titleMedium!.copyWith( - fontSize: 16.fSize, + fontSize: 16, ); static get titleMediumBlack => theme.textTheme.titleMedium!.copyWith( - fontSize: 17.fSize, + fontSize: 17, fontWeight: FontWeight.w900, ); @@ -131,7 +131,7 @@ class CustomTextStyles { ); static get titleSmallBold => theme.textTheme.titleSmall!.copyWith( - fontSize: 15.fSize, + fontSize: 15, fontWeight: FontWeight.w700, ); diff --git a/lib/theme/theme_helper.dart b/lib/theme/theme_helper.dart index 20fa5474..fb09451c 100644 --- a/lib/theme/theme_helper.dart +++ b/lib/theme/theme_helper.dart @@ -2,8 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; -import '../../core/app_export.dart'; - /// Helper class for managing themes and colors. class ThemeHelper { // The current app theme @@ -106,10 +104,10 @@ class ThemeHelper { backgroundColor: Colors.transparent, side: BorderSide( color: colorScheme.primary, - width: 1.h, + width: 1, ), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(15.h), + borderRadius: BorderRadius.circular(15), ), visualDensity: const VisualDensity( vertical: -4, diff --git a/lib/widgets/app_bar/appbar_leading_image.dart b/lib/widgets/app_bar/appbar_leading_image.dart index 003d9f03..5a2273a6 100644 --- a/lib/widgets/app_bar/appbar_leading_image.dart +++ b/lib/widgets/app_bar/appbar_leading_image.dart @@ -26,8 +26,8 @@ class AppbarLeadingImage extends StatelessWidget { padding: margin ?? EdgeInsets.zero, child: CustomImageView( imagePath: imagePath, - height: 26.v, - width: 13.h, + height: 26, + width: 13, fit: BoxFit.contain, ), ), diff --git a/lib/widgets/app_bar/appbar_title_circleimage.dart b/lib/widgets/app_bar/appbar_title_circleimage.dart index 02224f3c..bc6eb32d 100644 --- a/lib/widgets/app_bar/appbar_title_circleimage.dart +++ b/lib/widgets/app_bar/appbar_title_circleimage.dart @@ -23,11 +23,11 @@ class AppbarTitleCircleimage extends StatelessWidget { padding: margin ?? EdgeInsets.zero, child: CustomImageView( imagePath: imagePath, - height: 40.adaptSize, - width: 40.adaptSize, + height: 40, + width: 40, fit: BoxFit.contain, radius: BorderRadius.circular( - 20.h, + 20, ), ), ), diff --git a/lib/widgets/app_bar/custom_app_bar.dart b/lib/widgets/app_bar/custom_app_bar.dart index 469e9315..ce58516a 100644 --- a/lib/widgets/app_bar/custom_app_bar.dart +++ b/lib/widgets/app_bar/custom_app_bar.dart @@ -1,4 +1,3 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:flutter/material.dart'; // ignore: must_be_immutable @@ -11,26 +10,19 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { this.title, this.centerTitle, this.actions, - }) : super( - key: key, - ); + }) : super(key: key); final double? height; - final double? leadingWidth; - final Widget? leading; - final Widget? title; - final bool? centerTitle; - final List? actions; @override Widget build(BuildContext context) { return AppBar( - toolbarHeight: height ?? 56.v, + toolbarHeight: height ?? 56, automaticallyImplyLeading: false, backgroundColor: Colors.transparent, leadingWidth: leadingWidth ?? 0, @@ -43,8 +35,5 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { } @override - Size get preferredSize => Size( - mediaQueryData.size.width, - height ?? 56.v, - ); + Size get preferredSize => Size(double.infinity, height ?? 56); } diff --git a/lib/widgets/custom_expandable_list.dart b/lib/widgets/custom_expandable_list.dart index 99709dfb..d6a5c649 100644 --- a/lib/widgets/custom_expandable_list.dart +++ b/lib/widgets/custom_expandable_list.dart @@ -270,7 +270,7 @@ class _ExpandableListState extends State { onPressed: () => sendProfileData(state), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, text: "save".tr.toUpperCase(), - margin: EdgeInsets.only(top: 20.h, bottom: 20.h), + margin: EdgeInsets.only(top: 20, bottom: 20), ), ], ); diff --git a/lib/widgets/custom_outlined_button.dart b/lib/widgets/custom_outlined_button.dart index 4b17491e..723cdbc0 100644 --- a/lib/widgets/custom_outlined_button.dart +++ b/lib/widgets/custom_outlined_button.dart @@ -41,7 +41,7 @@ class CustomOutlinedButton extends BaseButton { return Align( alignment: alignment ?? Alignment.center, child: Container( - height: this.height ?? 30.v, + height: this.height ?? 30, width: this.width ?? double.maxFinite, margin: margin, decoration: decoration, @@ -65,7 +65,7 @@ class CustomOutlinedButton extends BaseButton { ); } else { return Container( - height: this.height ?? 30.v, + height: this.height ?? 30, width: this.width ?? double.maxFinite, margin: margin, decoration: decoration, @@ -91,7 +91,7 @@ class CustomOutlinedButton extends BaseButton { /*_buildAppBarbuildOutlinedButtonWidget() { return Container( - height: this.height ?? 30.v, + height: this.height ?? 30, width: this.width ?? double.maxFinite, margin: margin, decoration: decoration, diff --git a/lib/widgets/next_step_button.dart b/lib/widgets/next_step_button.dart index 455f8f94..3fe62f86 100644 --- a/lib/widgets/next_step_button.dart +++ b/lib/widgets/next_step_button.dart @@ -41,7 +41,7 @@ class NextStepButton extends BaseButton { ? Align( alignment: alignment!, child: Container( - height: this.height ?? 30.v, + height: this.height ?? 30, width: this.width ?? double.maxFinite, margin: margin, decoration: decoration, @@ -64,7 +64,7 @@ class NextStepButton extends BaseButton { ), ) : Container( - height: this.height ?? 30.v, + height: this.height ?? 30, width: this.width ?? double.maxFinite, margin: margin, decoration: decoration, diff --git a/lib/widgets/nutrition_chart.dart b/lib/widgets/nutrition_chart.dart index 455f8f94..3fe62f86 100644 --- a/lib/widgets/nutrition_chart.dart +++ b/lib/widgets/nutrition_chart.dart @@ -41,7 +41,7 @@ class NextStepButton extends BaseButton { ? Align( alignment: alignment!, child: Container( - height: this.height ?? 30.v, + height: this.height ?? 30, width: this.width ?? double.maxFinite, margin: margin, decoration: decoration, @@ -64,7 +64,7 @@ class NextStepButton extends BaseButton { ), ) : Container( - height: this.height ?? 30.v, + height: this.height ?? 30, width: this.width ?? double.maxFinite, margin: margin, decoration: decoration, From 64bddf79b48bf304ed8b24a45ac0d766862d87d5 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 11 Sep 2024 16:22:12 +0300 Subject: [PATCH 15/31] refactor: --- lib/core/app_export.dart | 13 - .../{constants/constants.dart => const.dart} | 0 .../initialization_cubit.dart | 3 +- .../presentation/pages/blog_post_screen.dart | 5 +- .../pages/blog_post_create_screen.dart | 12 +- .../new_messages_cubit.dart | 2 +- .../notifications_cubit.dart | 2 +- .../widgets/bottom_navigation_bar_widget.dart | 29 +- .../presentation/bloc/calendar_cubit.dart | 2 +- .../presentation/pages/calendar_screen.dart | 126 ++++--- .../bloc/chat_room_cubit/chat_room_cubit.dart | 2 +- .../chat_select_cubit/chat_select_cubit.dart | 2 +- .../chat/presentation/pages/chat_screen.dart | 5 +- .../pages/chat_select_screen.dart | 3 +- .../presentation/pages/photo_view_screen.dart | 4 +- .../widgets/chat_bubble_widget.dart | 4 +- .../widgets/chat_entry_widget.dart | 4 +- .../widgets/chat_search_bar_widget.dart | 3 +- .../diary/presentation/bloc/diary_bloc.dart | 6 +- .../pages/diary_recommendations_scree.dart | 2 +- .../presentation/pages/diary_screen.dart | 67 ++-- .../presentation/pages/about_diet_screen.dart | 5 +- .../bloc/comments_cubit/comments_cubit.dart | 2 +- .../bloc/feed_cubit/feed_cubit.dart | 2 +- .../feed/presentation/pages/feed_screen.dart | 309 ++++++++++-------- .../widgets/blog_post_widget.dart | 5 +- .../presentation/widgets/comments_widget.dart | 4 +- .../presentation/widgets/diets_widget.dart | 3 +- .../presentation/widgets/plan_widget.dart | 2 +- .../presentation/widgets/recipes_widget.dart | 3 +- .../menu/presentation/pages/menu_screen.dart | 5 +- .../pages/notifications_screen.dart | 2 +- .../bloc/plans_cubit/plans_cubit.dart | 2 +- .../bloc/profile_cubit/profile_cubit.dart | 2 +- .../presentation/pages/profile_screen.dart | 4 +- .../widgets/circumference_chart_widget.dart | 2 +- .../widgets/weight_chart_widget.dart | 2 +- .../bloc/recipe_create_cubit.dart | 3 +- .../pages/about_recipes_screen.dart | 5 +- .../pages/recipe_create_screen.dart | 68 ++-- .../pages/recipe_edit_screen.dart | 7 +- .../registration_cubit.dart | 3 +- .../pages/additional_information_screen.dart | 2 +- .../presentation/pages/allergies_screen.dart | 3 +- .../pages/blood_pressure_screen.dart | 6 +- .../pages/body_circumferences_screen.dart | 3 +- .../pages/city_of_living_screen.dart | 4 +- .../pages/credentials_screen.dart | 3 +- .../pages/date_of_birth_screen.dart | 5 +- .../pages/favorite_foods_screen.dart | 3 +- .../pages/favorite_sports_screen.dart | 3 +- .../presentation/pages/gender_screen.dart | 2 +- .../presentation/pages/height_screen.dart | 3 +- .../pages/language_select_screen.dart | 4 +- .../pages/medicine_intake_screen.dart | 3 +- .../presentation/pages/name_screen.dart | 3 +- .../pages/registration_screen.dart | 5 +- .../presentation/pages/weight_screen.dart | 3 +- lib/locator_service.dart | 5 +- lib/main.dart | 30 +- lib/old/auth/auth_screen/auth_screen.dart | 8 +- lib/old/auth/auth_screen/bloc/auth_bloc.dart | 4 +- .../diary_edit_screen/diary_edit_screen.dart | 2 +- .../bloc/diet_create_bloc.dart | 4 +- .../diet_create_screen.dart | 3 +- .../diet_edit_screen/bloc/diet_edit_bloc.dart | 4 +- .../diet_edit_screen/diet_edit_screen.dart | 5 +- .../bloc/diet_select_bloc.dart | 4 +- .../diet_select_screen.dart | 6 +- .../diet_show_screen/bloc/diet_show_bloc.dart | 4 +- .../diet_show_screen/diet_show_screen.dart | 6 +- .../bloc/blog_post_create_bloc.dart | 5 +- .../bloc/blog_post_edit_bloc.dart | 4 +- .../blog_post_edit_screen.dart | 5 +- .../models/comment_model.dart | 5 +- .../widgets/comment_widget.dart | 7 +- .../feed_screen/widgets/feed_scroll_item.dart | 2 +- .../feed_screen/widgets/feed_search_view.dart | 2 +- .../bloc/glossary_screen_bloc.dart | 5 +- .../glossary_screen/glossary_screen.dart | 7 +- .../widgets/glossary_scroll_item.dart | 2 +- .../widgets/glossary_search_widget.dart | 2 +- .../bloc/plan_create_bloc.dart | 4 +- .../plan_create_screen.dart | 3 +- .../plan_edit_screen/bloc/plan_edit_bloc.dart | 4 +- .../plan_edit_screen/plan_edit_screen.dart | 5 +- .../bloc/plan_select_bloc.dart | 4 +- .../plan_select_screen.dart | 6 +- .../plan_show_screen/bloc/plan_show_bloc.dart | 4 +- .../plan_show_screen/plan_show_screen.dart | 6 +- .../bloc/my_profile_bloc.dart | 9 +- .../my_profile_screen/my_profile_screen.dart | 8 +- .../my_profile_screen/my_settings_screen.dart | 3 +- .../bloc/recipe_edit_bloc.dart | 5 +- .../recipe_edit_screen.dart | 9 +- .../bloc/recipe_select_bloc.dart | 5 +- .../recipe_select_screen.dart | 6 +- .../bloc/recipe_show_bloc.dart | 6 +- .../recipe_show_screen.dart | 10 +- .../widgets/comment_widget.dart | 15 +- .../bloc/subscribers_bloc.dart | 6 +- .../subscribers_screen.dart | 7 +- lib/theme/app_decoration.dart | 2 +- lib/theme/custom_button_style.dart | 2 +- lib/theme/custom_text_style.dart | 3 +- lib/widgets/app_bar/appbar_leading_image.dart | 18 +- lib/widgets/app_bar/appbar_subtitle.dart | 19 +- .../app_bar/appbar_title_circleimage.dart | 16 +- lib/widgets/app_bar/appbar_title_image.dart | 3 +- lib/widgets/app_bar/exit_button.dart | 18 +- lib/widgets/custom_drop_down.dart | 3 +- lib/widgets/custom_edit_drop_down.dart | 2 +- lib/widgets/custom_expandable_list.dart | 6 +- lib/widgets/custom_hyper_switch.dart | 2 +- lib/widgets/custom_hypo_switch.dart | 2 +- lib/widgets/custom_navigation_menu_item.dart | 3 +- lib/widgets/custom_notification_screen.dart | 2 +- lib/widgets/custom_outlined_button.dart | 2 +- lib/widgets/custom_text_form_field.dart | 2 +- lib/widgets/next_step_button.dart | 2 +- lib/widgets/nutrition_chart.dart | 2 +- pubspec.yaml | 12 +- test/auth_test.dart | 6 +- 123 files changed, 652 insertions(+), 522 deletions(-) delete mode 100644 lib/core/app_export.dart rename lib/core/{constants/constants.dart => const.dart} (100%) diff --git a/lib/core/app_export.dart b/lib/core/app_export.dart deleted file mode 100644 index c9a9c59f..00000000 --- a/lib/core/app_export.dart +++ /dev/null @@ -1,13 +0,0 @@ -export 'package:eatvio_app/core/constants/constants.dart'; -export 'package:eatvio_app/core/errors/exceptions.dart'; -export 'package:eatvio_app/core/utils/date_time_utils.dart'; -export 'package:eatvio_app/core/utils/image_constant.dart'; -export 'package:eatvio_app/core/utils/logger.dart'; -export 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; -export 'package:eatvio_app/localization/app_localization.dart'; -export 'package:eatvio_app/theme/app_decoration.dart'; -export 'package:eatvio_app/theme/custom_text_style.dart'; -export 'package:eatvio_app/theme/theme_helper.dart'; -export 'package:eatvio_app/widgets/custom_image_view.dart'; -export 'package:flutter_bloc/flutter_bloc.dart'; -export '../theme/custom_button_style.dart'; diff --git a/lib/core/constants/constants.dart b/lib/core/const.dart similarity index 100% rename from lib/core/constants/constants.dart rename to lib/core/const.dart diff --git a/lib/core/initialization_cubit/initialization_cubit.dart b/lib/core/initialization_cubit/initialization_cubit.dart index 518abeba..da7588cd 100644 --- a/lib/core/initialization_cubit/initialization_cubit.dart +++ b/lib/core/initialization_cubit/initialization_cubit.dart @@ -1,11 +1,12 @@ import 'package:dart_pusher_channels/dart_pusher_channels.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_state.dart'; import 'package:eatvio_app/core/token_storage.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/chat/repositories/chat_repository.dart'; import 'package:eatvio_app/locator_service.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class InitializationCubit extends Cubit { final ChatRepository chatRepository; 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 1fcacce8..3f6004fd 100644 --- a/lib/features/blog_post/presentation/pages/blog_post_screen.dart +++ b/lib/features/blog_post/presentation/pages/blog_post_screen.dart @@ -1,13 +1,16 @@ import 'dart:io'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/utils/date_time_utils.dart'; import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart'; import 'package:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; import 'package:share_plus/share_plus.dart'; 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 cbd8f03c..baf87e0f 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 @@ -1,11 +1,12 @@ import 'dart:async'; import 'dart:io'; - -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart'; import 'package:eatvio_app/old/feed/blog_post_create_screen/models/blog_post_create_model.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; import 'package:image_picker/image_picker.dart'; @@ -121,9 +122,10 @@ class _BlogPostCreateScreenState extends State { SizedBox(height: 16), if (state.image == null) Text('Ссылка на видео'), if (state.image == null) SizedBox(height: 8), - if (state.image == null) CustomTextFormField( - controller: state.youtubeURL, - ), + if (state.image == null) + CustomTextFormField( + controller: state.youtubeURL, + ), SizedBox(height: 80), ], ), diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_cubit.dart b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_cubit.dart index 8b2a0f5a..6f31b94b 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_cubit.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_cubit.dart @@ -1,5 +1,5 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class NewMessagesCubit extends Cubit { int _messagesCount = 0; diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart index 8a22b6d5..d862efa7 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart @@ -1,5 +1,5 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class NotificationsCubit extends Cubit { int _notificationsCount = 0; diff --git a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart index 6f730432..8bc6bb3d 100644 --- a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart +++ b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart @@ -1,12 +1,16 @@ import 'package:badges/badges.dart' as badges; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/utils/image_constant.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/new_messages_cubit/new_messages_state.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:go_router/go_router.dart'; @@ -188,19 +192,22 @@ class _BottomNavigationBarWidgetState extends State { ), BottomNavigationBarItem( label: '', - icon: BlocBuilder( - builder: (BuildContext context, ProfileAvatarState state) { - if (state is ProfileAvatarStateLoaded) { + icon: BlocProvider( + create: (context) => sl()..getMyProfile(), + child: BlocBuilder( + builder: (BuildContext context, ProfileAvatarState state) { + if (state is ProfileAvatarStateLoaded) { + return CircleAvatar( + backgroundImage: NetworkImage(state.profile.profilePhotoUrl), + radius: 16, + ); + } return CircleAvatar( - backgroundImage: NetworkImage(state.profile.profilePhotoUrl), radius: 16, + backgroundColor: Colors.black12, ); - } - return CircleAvatar( - radius: 16, - backgroundColor: Colors.black12, - ); - }, + }, + ), ), ), ], diff --git a/lib/features/calendar/presentation/bloc/calendar_cubit.dart b/lib/features/calendar/presentation/bloc/calendar_cubit.dart index cfbc5b07..01a16da9 100644 --- a/lib/features/calendar/presentation/bloc/calendar_cubit.dart +++ b/lib/features/calendar/presentation/bloc/calendar_cubit.dart @@ -1,6 +1,6 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_state.dart'; import 'package:eatvio_app/features/calendar/repositories/calendar_repository.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class CalendarCubit extends Cubit { final CalendarRepository calendarRepository; diff --git a/lib/features/calendar/presentation/pages/calendar_screen.dart b/lib/features/calendar/presentation/pages/calendar_screen.dart index ddcc04ab..31342896 100644 --- a/lib/features/calendar/presentation/pages/calendar_screen.dart +++ b/lib/features/calendar/presentation/pages/calendar_screen.dart @@ -1,46 +1,52 @@ -// ignore_for_file: unused_local_variable - 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:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:intl/intl.dart'; import 'package:flutter/material.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; -// ignore: must_be_immutable class CalendarScreen extends StatelessWidget { CalendarScreen({Key? key}) : super(key: key); + Widget build(BuildContext context) { - return BlocBuilder( - builder: (context, state) { - if (state is CalendarStateLoaded) { - return _buildCalendar(context, state); - } else if (state is CalendarStateLoading) { - return Scaffold( - body: Center( - child: CircularProgressIndicator(), - ), - ); - } else if (state is CalendarStateError) { - return Scaffold( - body: Padding( - padding: const EdgeInsets.all(16), - child: Center( - child: Text(state.errorMessage), + return BlocProvider( + create: (context) => sl()..loadCalendarList(), + child: BlocBuilder( + builder: (context, state) { + if (state is CalendarStateLoaded) { + return _buildCalendar(context, state); + } else if (state is CalendarStateLoading) { + return Scaffold( + body: Center( + child: CircularProgressIndicator(), ), - ), - ); - } else - return Scaffold( - body: Padding( - padding: const EdgeInsets.all(16), - child: Center( - child: Text("Неопределенная ошибка"), + ); + } else if (state is CalendarStateError) { + return Scaffold( + body: Padding( + padding: const EdgeInsets.all(16), + child: Center( + child: Text(state.errorMessage), + ), ), - ), - ); - }, + ); + } else + return Scaffold( + body: Padding( + padding: const EdgeInsets.all(16), + child: Center( + child: Text("Неопределенная ошибка"), + ), + ), + ); + }, + ), ); } @@ -101,8 +107,7 @@ class CalendarScreen extends StatelessWidget { padding: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadiusStyle.circleBorder8, - color: state.calendarList[index] - .is_current_day_included_in_the_chosen_diet_progression + color: state.calendarList[index].is_current_day_included_in_the_chosen_diet_progression ? Color.fromRGBO(59, 130, 246, .2) : Color.fromRGBO(126, 136, 151, .1), ), @@ -119,36 +124,28 @@ class CalendarScreen extends StatelessWidget { style: theme.textTheme.titleMedium, ), SizedBox(height: 4), - if (state.calendarList[index] - .is_current_day_included_in_the_chosen_diet_progression) + if (state.calendarList[index].is_current_day_included_in_the_chosen_diet_progression) 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] - .is_current_day_included_in_the_chosen_diet_progression) + if (!state.calendarList[index].is_current_day_included_in_the_chosen_diet_progression) 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, // Предполагается, что текст белый ), ), ], @@ -188,50 +185,39 @@ class CalendarScreen extends StatelessWidget { SizedBox(height: 4), 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, // Предполагается, что текст белый ), ), ]), diff --git a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart index 9140a6bd..413ff885 100644 --- a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart +++ b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart @@ -4,7 +4,7 @@ import 'dart:io'; import 'package:audioplayers/audioplayers.dart'; import 'package:dart_pusher_channels/dart_pusher_channels.dart'; import 'package:easy_debounce/easy_debounce.dart'; -import 'package:eatvio_app/core/constants/constants.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_state.dart'; import 'package:eatvio_app/core/token_storage.dart'; diff --git a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart index fc92f22d..d3edddc8 100644 --- a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart +++ b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart @@ -1,6 +1,6 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.dart'; import 'package:eatvio_app/features/chat/repositories/chat_repository.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class ChatSelectCubit extends Cubit { final ChatRepository chatRepository; diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index 9a1fb838..53220865 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -1,6 +1,9 @@ import 'dart:io'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:intl/intl.dart'; -import 'package:eatvio_app/core/app_export.dart'; + import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_bubble_widget.dart'; diff --git a/lib/features/chat/presentation/pages/chat_select_screen.dart b/lib/features/chat/presentation/pages/chat_select_screen.dart index 245b9f25..6c14e46d 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen.dart @@ -1,11 +1,12 @@ import 'package:easy_debounce/easy_debounce.dart'; -import 'package:eatvio_app/core/app_export.dart'; + import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_entry_widget.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_search_bar_widget.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class ChatSelectScreen extends StatefulWidget { const ChatSelectScreen({Key? key}) : super(key: key); diff --git a/lib/features/chat/presentation/pages/photo_view_screen.dart b/lib/features/chat/presentation/pages/photo_view_screen.dart index a070103d..fab2f064 100644 --- a/lib/features/chat/presentation/pages/photo_view_screen.dart +++ b/lib/features/chat/presentation/pages/photo_view_screen.dart @@ -1,6 +1,8 @@ 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/core/const.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; + import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:photo_view/photo_view.dart'; diff --git a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart index ce24b69a..5c12f9b4 100644 --- a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart @@ -1,6 +1,8 @@ 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/core/const.dart'; +import 'package:eatvio_app/core/utils/date_time_utils.dart'; + import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; diff --git a/lib/features/chat/presentation/widgets/chat_entry_widget.dart b/lib/features/chat/presentation/widgets/chat_entry_widget.dart index b496047d..e8150dc1 100644 --- a/lib/features/chat/presentation/widgets/chat_entry_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_entry_widget.dart @@ -1,5 +1,7 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/utils/date_time_utils.dart'; import 'package:eatvio_app/features/chat/models/chat_room_preview_model.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart b/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart index 955e697f..3480c923 100644 --- a/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart @@ -1,4 +1,5 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; class ChatSearchBarWidget extends StatelessWidget { diff --git a/lib/features/diary/presentation/bloc/diary_bloc.dart b/lib/features/diary/presentation/bloc/diary_bloc.dart index 747f9ee8..74742144 100644 --- a/lib/features/diary/presentation/bloc/diary_bloc.dart +++ b/lib/features/diary/presentation/bloc/diary_bloc.dart @@ -1,5 +1,5 @@ import 'dart:async'; - +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/features/diary/models/diary_model.dart'; import 'package:eatvio_app/features/diary/models/meal.dart'; import 'package:eatvio_app/features/diary/models/product.dart'; @@ -7,11 +7,9 @@ import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; import 'package:eatvio_app/features/diary/repositories/diary_repository.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:image_picker/image_picker.dart'; import 'package:intl/intl.dart'; - -import '/core/app_export.dart'; - part 'diary_event.dart'; /// A bloc that manages the state of a Diary according to the event that is dispatched to it. diff --git a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart index 5b454a04..5211eeed 100644 --- a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart +++ b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart @@ -3,9 +3,9 @@ import 'package:eatvio_app/features/diary/models/portion.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; -import 'package:eatvio_app/core/app_export.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; // ignore: must_be_immutable diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 23c7503d..8e537a20 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -1,6 +1,8 @@ // ignore_for_file: unused_local_variable import 'package:carousel_slider_plus/carousel_slider_plus.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/features/diary/models/diary_model.dart'; import 'package:eatvio_app/features/diary/models/meal.dart'; import 'package:eatvio_app/features/diary/models/photo.dart'; @@ -8,13 +10,19 @@ 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/localization/app_localization.dart'; + +import 'package:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; import 'package:eatvio_app/widgets/custom_edit_drop_down.dart'; import 'package:eatvio_app/widgets/custom_scale_element.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:image_picker/image_picker.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; @@ -31,35 +39,38 @@ class DiaryScreen extends StatelessWidget { if (diaryID != "0") { context.read().add(LoadDiaryById(diaryID)); } - return BlocBuilder( - builder: (context, state) { - if (state is DiaryStateLoaded) { - return _buildDiary(context, state); - } else if (state is DiaryStateLoading) { - return Scaffold( - body: Center( - child: CircularProgressIndicator(), - ), - ); - } else if (state is DiaryStateError) { - return Scaffold( - body: Padding( - padding: const EdgeInsets.all(16), - child: Center( - child: Text(state.errorMessage), + return BlocProvider( + create: (context) => sl()..add(LoadDiary()), + child: BlocBuilder( + builder: (context, state) { + if (state is DiaryStateLoaded) { + return _buildDiary(context, state); + } else if (state is DiaryStateLoading) { + return Scaffold( + body: Center( + child: CircularProgressIndicator(), ), - ), - ); - } else - return Scaffold( - body: Padding( - padding: const EdgeInsets.all(16), - child: Center( - child: Text("Неопределенная ошибка"), + ); + } else if (state is DiaryStateError) { + return Scaffold( + body: Padding( + padding: const EdgeInsets.all(16), + child: Center( + child: Text(state.errorMessage), + ), ), - ), - ); - }, + ); + } else + return Scaffold( + body: Padding( + padding: const EdgeInsets.all(16), + child: Center( + child: Text("Неопределенная ошибка"), + ), + ), + ); + }, + ), ); } diff --git a/lib/features/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart index e78dab2c..d2ee8bd2 100644 --- a/lib/features/diets/presentation/pages/about_diet_screen.dart +++ b/lib/features/diets/presentation/pages/about_diet_screen.dart @@ -1,12 +1,15 @@ import 'dart:io'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; + import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart'; import 'package:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart index 9c7b009d..41a00d05 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart @@ -1,7 +1,7 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart'; import 'package:eatvio_app/features/feed/repositories/feed_repository.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class CommentsCubit extends Cubit { final FeedRepository feedRepository; diff --git a/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart b/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart index 3320c71c..11cbd4e2 100644 --- a/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart +++ b/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart @@ -1,6 +1,6 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_state.dart'; import 'package:eatvio_app/features/feed/repositories/feed_repository.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class FeedCubit extends Cubit { final FeedRepository feedRepository; diff --git a/lib/features/feed/presentation/pages/feed_screen.dart b/lib/features/feed/presentation/pages/feed_screen.dart index 957ea8a5..02691888 100644 --- a/lib/features/feed/presentation/pages/feed_screen.dart +++ b/lib/features/feed/presentation/pages/feed_screen.dart @@ -12,6 +12,7 @@ import 'package:eatvio_app/features/feed/presentation/widgets/recipes_widget.dar import 'package:eatvio_app/features/feed/presentation/widgets/tags_modal_widget.dart'; import 'package:eatvio_app/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart'; import 'package:eatvio_app/features/plans/presentation/bloc/plans_cubit/plans_state.dart'; +import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -27,6 +28,11 @@ class FeedScreen extends StatefulWidget { } class _FeedScreenState extends State { + final FeedCubit feedCubit = sl()..loadFeedBlogPostList(); + final RecipesCubit recipesCubit = sl()..loadRecipesList(); + final DietsCubit dietsCubit = sl()..loadDiets(); + final PlansCubit plansCubit = sl()..loadPlans(); + final searchController = TextEditingController(); final List chipsLabelList = ['Все', 'Рецепты', 'Диеты', 'Планы питания', 'Консультанты']; int _selectedChipIndex = 0; @@ -46,7 +52,7 @@ class _FeedScreenState extends State { _onScrollBlogPosts() { if (blogPostsScrollController.offset >= blogPostsScrollController.position.maxScrollExtent && !blogPostsScrollController.position.outOfRange) { - context.read().loadNextPage(); + feedCubit.loadNextPage(); } } @@ -154,168 +160,183 @@ class _FeedScreenState extends State { } _buildAllBlogPosts() { - return RefreshIndicator( - onRefresh: () => context.read().loadFeedBlogPostList(), - child: BlocBuilder( - builder: (BuildContext context, FeedState state) { - if (state is FeedStateLoaded) { - return ListView.separated( - padding: EdgeInsets.symmetric(vertical: 8), - shrinkWrap: true, - physics: BouncingScrollPhysics(), - itemBuilder: (context, index) { - if (index == state.feedBlogPostList.length) { - return CircularProgressIndicator(); - } - return BlogPostWidget(feedBlogPostModel: state.feedBlogPostList[index]); - }, - separatorBuilder: (context, index) { - return SizedBox(height: 8); - }, - itemCount: state.isLoading ? state.feedBlogPostList.length + 1 : state.feedBlogPostList.length, - ); - } else if (state is FeedStateError) { - return Scaffold( - backgroundColor: Colors.grey.shade200, - body: Padding( - padding: const EdgeInsets.all(16), - child: Center( - child: Text(state.errorMessage), + return BlocProvider( + create: (context) => feedCubit, + child: RefreshIndicator( + onRefresh: () => feedCubit.loadFeedBlogPostList(), + child: BlocBuilder( + builder: (BuildContext context, FeedState state) { + if (state is FeedStateLoaded) { + return ListView.separated( + padding: EdgeInsets.symmetric(vertical: 8), + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, index) { + if (index == state.feedBlogPostList.length) { + return Container( + alignment: Alignment.center, + child: CircularProgressIndicator(), + ); + } + return BlogPostWidget(feedBlogPostModel: state.feedBlogPostList[index]); + }, + separatorBuilder: (context, index) { + return SizedBox(height: 8); + }, + itemCount: state.isLoading ? state.feedBlogPostList.length + 1 : state.feedBlogPostList.length, + ); + } else if (state is FeedStateError) { + return Scaffold( + backgroundColor: Colors.grey.shade200, + body: Padding( + padding: const EdgeInsets.all(16), + child: Center( + child: Text(state.errorMessage), + ), ), - ), - ); - } else { - return Scaffold( - backgroundColor: Colors.grey.shade200, - body: Center( - child: CircularProgressIndicator(), - ), - ); - } - }, + ); + } else { + return Scaffold( + backgroundColor: Colors.grey.shade200, + body: Center( + child: CircularProgressIndicator(), + ), + ); + } + }, + ), ), ); } _buildAllRecipes() { - return RefreshIndicator( - onRefresh: () => context.read().loadRecipesList(), - child: BlocBuilder( - builder: (BuildContext context, RecipesState state) { - if (state is RecipesStateLoaded) { - return ListView.separated( - padding: EdgeInsets.symmetric(vertical: 8), - shrinkWrap: true, - physics: BouncingScrollPhysics(), - itemBuilder: (context, index) { - return RecipesWidget(recipes: state.recipesList[index]); - }, - separatorBuilder: (context, index) { - return SizedBox(height: 8); - }, - itemCount: state.recipesList.length, - ); - } else if (state is RecipesStateError) { - return Scaffold( - backgroundColor: Colors.grey.shade200, - body: Padding( - padding: const EdgeInsets.all(16), - child: Center( - child: Text(state.errorMessage), + return BlocProvider( + create: (context) => recipesCubit, + child: RefreshIndicator( + onRefresh: () => recipesCubit.loadRecipesList(), + child: BlocBuilder( + builder: (BuildContext context, RecipesState state) { + if (state is RecipesStateLoaded) { + return ListView.separated( + padding: EdgeInsets.symmetric(vertical: 8), + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, index) { + return RecipesWidget(recipes: state.recipesList[index]); + }, + separatorBuilder: (context, index) { + return SizedBox(height: 8); + }, + itemCount: state.recipesList.length, + ); + } else if (state is RecipesStateError) { + return Scaffold( + backgroundColor: Colors.grey.shade200, + body: Padding( + padding: const EdgeInsets.all(16), + child: Center( + child: Text(state.errorMessage), + ), ), - ), - ); - } else { - return Scaffold( - backgroundColor: Colors.grey.shade200, - body: Center( - child: CircularProgressIndicator(), - ), - ); - } - }, + ); + } else { + return Scaffold( + backgroundColor: Colors.grey.shade200, + body: Center( + child: CircularProgressIndicator(), + ), + ); + } + }, + ), ), ); } _buildDiets() { - return RefreshIndicator( - onRefresh: () => context.read().loadDiets(), - child: BlocBuilder( - builder: (BuildContext context, DietsState state) { - if (state is DietsStateLoaded) { - return ListView.separated( - padding: EdgeInsets.symmetric(vertical: 8), - shrinkWrap: true, - physics: BouncingScrollPhysics(), - itemBuilder: (context, index) { - return DietsWidget(diet: state.diets.data[index]); - }, - separatorBuilder: (context, index) { - return SizedBox(height: 8); - }, - itemCount: state.diets.data.length, - ); - } else if (state is DietsStateError) { - return Scaffold( - backgroundColor: Colors.grey.shade200, - body: Padding( - padding: const EdgeInsets.all(16), - child: Center( - child: Text(state.errorMessage), + return BlocProvider( + create: (context) => dietsCubit, + child: RefreshIndicator( + onRefresh: () => dietsCubit.loadDiets(), + child: BlocBuilder( + builder: (BuildContext context, DietsState state) { + if (state is DietsStateLoaded) { + return ListView.separated( + padding: EdgeInsets.symmetric(vertical: 8), + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, index) { + return DietsWidget(diet: state.diets.data[index]); + }, + separatorBuilder: (context, index) { + return SizedBox(height: 8); + }, + itemCount: state.diets.data.length, + ); + } else if (state is DietsStateError) { + return Scaffold( + backgroundColor: Colors.grey.shade200, + body: Padding( + padding: const EdgeInsets.all(16), + child: Center( + child: Text(state.errorMessage), + ), ), - ), - ); - } else { - return Scaffold( - backgroundColor: Colors.grey.shade200, - body: Center( - child: CircularProgressIndicator(), - ), - ); - } - }, + ); + } else { + return Scaffold( + backgroundColor: Colors.grey.shade200, + body: Center( + child: CircularProgressIndicator(), + ), + ); + } + }, + ), ), ); } _buildPlans() { - return RefreshIndicator( - onRefresh: () => context.read().getPlans(), - child: BlocBuilder( - builder: (BuildContext context, PlansState state) { - if (state is PlansStateLoaded) { - return ListView.separated( - padding: EdgeInsets.symmetric(vertical: 8), - shrinkWrap: true, - physics: BouncingScrollPhysics(), - itemBuilder: (context, index) { - return PlanWidget(planModel: state.plansModel.data[index]); - }, - separatorBuilder: (context, index) { - return SizedBox(height: 8); - }, - itemCount: state.plansModel.data.length, - ); - } else if (state is PlansStateError) { - return Scaffold( - backgroundColor: Colors.grey.shade200, - body: Padding( - padding: const EdgeInsets.all(16), - child: Center( - child: Text(state.errorMessage), + return BlocProvider( + create: (context) => plansCubit, + child: RefreshIndicator( + onRefresh: () => plansCubit.loadPlans(), + child: BlocBuilder( + builder: (BuildContext context, PlansState state) { + if (state is PlansStateLoaded) { + return ListView.separated( + padding: EdgeInsets.symmetric(vertical: 8), + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, index) { + return PlanWidget(planModel: state.plansModel.data[index]); + }, + separatorBuilder: (context, index) { + return SizedBox(height: 8); + }, + itemCount: state.plansModel.data.length, + ); + } else if (state is PlansStateError) { + return Scaffold( + backgroundColor: Colors.grey.shade200, + body: Padding( + padding: const EdgeInsets.all(16), + child: Center( + child: Text(state.errorMessage), + ), ), - ), - ); - } else { - return Scaffold( - backgroundColor: Colors.grey.shade200, - body: Center( - child: CircularProgressIndicator(), - ), - ); - } - }, + ); + } else { + return Scaffold( + backgroundColor: Colors.grey.shade200, + body: Center( + child: CircularProgressIndicator(), + ), + ); + } + }, + ), ), ); } diff --git a/lib/features/feed/presentation/widgets/blog_post_widget.dart b/lib/features/feed/presentation/widgets/blog_post_widget.dart index 9d097936..b3b6024c 100644 --- a/lib/features/feed/presentation/widgets/blog_post_widget.dart +++ b/lib/features/feed/presentation/widgets/blog_post_widget.dart @@ -1,10 +1,13 @@ 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/core/const.dart'; +import 'package:eatvio_app/core/utils/date_time_utils.dart'; import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart'; import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/features/feed/presentation/widgets/comments_widget.dart b/lib/features/feed/presentation/widgets/comments_widget.dart index b530a7d8..695c5459 100644 --- a/lib/features/feed/presentation/widgets/comments_widget.dart +++ b/lib/features/feed/presentation/widgets/comments_widget.dart @@ -1,7 +1,9 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/utils/date_time_utils.dart'; import 'package:eatvio_app/features/feed/models/comment_model.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; enum CommentSourceType { blogPost, recipe, diet } diff --git a/lib/features/feed/presentation/widgets/diets_widget.dart b/lib/features/feed/presentation/widgets/diets_widget.dart index c327c2a4..82069967 100644 --- a/lib/features/feed/presentation/widgets/diets_widget.dart +++ b/lib/features/feed/presentation/widgets/diets_widget.dart @@ -1,5 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; + import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; diff --git a/lib/features/feed/presentation/widgets/plan_widget.dart b/lib/features/feed/presentation/widgets/plan_widget.dart index fc4bb8cb..0364dbb0 100644 --- a/lib/features/feed/presentation/widgets/plan_widget.dart +++ b/lib/features/feed/presentation/widgets/plan_widget.dart @@ -1,5 +1,5 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/constants/constants.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/features/plans/models/plan_pagination_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; diff --git a/lib/features/feed/presentation/widgets/recipes_widget.dart b/lib/features/feed/presentation/widgets/recipes_widget.dart index 151831f8..a982a6f2 100644 --- a/lib/features/feed/presentation/widgets/recipes_widget.dart +++ b/lib/features/feed/presentation/widgets/recipes_widget.dart @@ -1,5 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; + import 'package:eatvio_app/features/feed/models/recipes_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; diff --git a/lib/features/menu/presentation/pages/menu_screen.dart b/lib/features/menu/presentation/pages/menu_screen.dart index 6f46ac9c..80e06835 100644 --- a/lib/features/menu/presentation/pages/menu_screen.dart +++ b/lib/features/menu/presentation/pages/menu_screen.dart @@ -1,7 +1,10 @@ import 'package:dio/dio.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; + import 'package:eatvio_app/core/token_storage.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/features/notifications/presentation/pages/notifications_screen.dart b/lib/features/notifications/presentation/pages/notifications_screen.dart index 10947cbf..69058bf0 100644 --- a/lib/features/notifications/presentation/pages/notifications_screen.dart +++ b/lib/features/notifications/presentation/pages/notifications_screen.dart @@ -1,7 +1,7 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class NotificationsScreen extends StatelessWidget { const NotificationsScreen({super.key}); diff --git a/lib/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart b/lib/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart index fb885fe7..2190654a 100644 --- a/lib/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart +++ b/lib/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart @@ -9,7 +9,7 @@ class PlansCubit extends Cubit { required this.plansRepository, }) : super(PlansState.loading()); - getPlans() async { + loadPlans() async { try { emit(PlansState.loaded(plansModel: await plansRepository.getPlans())); } catch (e) { diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index 05f33fe7..6cdcff7a 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -1,6 +1,6 @@ -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'; +import 'package:flutter_bloc/flutter_bloc.dart'; class ProfileCubit extends Cubit { final ProfileRepository profileRepository; diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index af8cf4ec..c31a7d2f 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -1,10 +1,12 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/blog_post_widget.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:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:go_router/go_router.dart'; import 'package:share_plus/share_plus.dart'; diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index 4d718b9b..560266d4 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -1,4 +1,4 @@ -// import 'package:eatvio_app/core/app_export.dart'; +// // import 'package:eatvio_app/features/profile/models/profile_model.dart'; // import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; // import 'package:flutter/cupertino.dart'; diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index 7c9dca82..fea255cc 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -1,4 +1,4 @@ -// import 'package:eatvio_app/core/app_export.dart'; +// // import 'package:eatvio_app/features/profile/models/profile_model.dart'; // import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; // import 'package:flutter/cupertino.dart'; diff --git a/lib/features/recipes/presentation/bloc/recipe_create_cubit.dart b/lib/features/recipes/presentation/bloc/recipe_create_cubit.dart index 5507c0ea..727317bc 100644 --- a/lib/features/recipes/presentation/bloc/recipe_create_cubit.dart +++ b/lib/features/recipes/presentation/bloc/recipe_create_cubit.dart @@ -1,10 +1,11 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/features/recipes/models/ingredient.dart'; import 'package:eatvio_app/features/recipes/models/recipe_model.dart'; import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_state.dart'; import 'package:eatvio_app/features/recipes/reporitories/recipe_repository.dart'; import 'package:eatvio_app/features/diary/models/product.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:image_picker/image_picker.dart'; class RecipeCreateCubit extends Cubit { diff --git a/lib/features/recipes/presentation/pages/about_recipes_screen.dart b/lib/features/recipes/presentation/pages/about_recipes_screen.dart index 397147bd..130317e2 100644 --- a/lib/features/recipes/presentation/pages/about_recipes_screen.dart +++ b/lib/features/recipes/presentation/pages/about_recipes_screen.dart @@ -1,13 +1,16 @@ import 'dart:io'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.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:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart'; import 'package:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/features/recipes/presentation/pages/recipe_create_screen.dart b/lib/features/recipes/presentation/pages/recipe_create_screen.dart index 778e2b4b..e4ac3b8b 100644 --- a/lib/features/recipes/presentation/pages/recipe_create_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_create_screen.dart @@ -1,52 +1,60 @@ import 'dart:convert'; import 'dart:io'; -import 'package:eatvio_app/core/app_export.dart'; + import 'package:eatvio_app/features/diary/models/product.dart'; import 'package:eatvio_app/features/recipes/models/ingredient.dart'; import 'package:eatvio_app/features/recipes/models/recipe_model.dart'; import 'package:eatvio_app/features/recipes/models/step.dart' as step; import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_cubit.dart'; import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_state.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:image_picker/image_picker.dart'; -// ignore: must_be_immutable class RecipeCreateScreen extends StatelessWidget { RecipeCreateScreen({Key? key}) : super(key: key); + Widget build(BuildContext context) { - context.read().loadRecipeCreate(); - return BlocBuilder( - builder: (context, state) { - if (state is RecipeCreateStateLoaded) { - return _buildRecipeCreate(context, state); - } else if (state is RecipeCreateStateLoading) { - return Scaffold( - body: Center( - child: CircularProgressIndicator(), - ), - ); - } else if (state is RecipeCreateStateError) { - return Scaffold( - body: Padding( - padding: const EdgeInsets.all(16), - child: Center( - child: Text(state.errorMessage), + return BlocProvider( + create: (context) => sl()..loadRecipeCreate(), + child: BlocBuilder( + builder: (context, state) { + if (state is RecipeCreateStateLoaded) { + return _buildRecipeCreate(context, state); + } else if (state is RecipeCreateStateLoading) { + return Scaffold( + body: Center( + child: CircularProgressIndicator(), ), - ), - ); - } else - return Scaffold( - body: Padding( - padding: const EdgeInsets.all(16), - child: Center( - child: Text("Неопределенная ошибка"), + ); + } else if (state is RecipeCreateStateError) { + return Scaffold( + body: Padding( + padding: const EdgeInsets.all(16), + child: Center( + child: Text(state.errorMessage), + ), ), - ), - ); - }, + ); + } else + return Scaffold( + body: Padding( + padding: const EdgeInsets.all(16), + child: Center( + child: Text("Неопределенная ошибка"), + ), + ), + ); + }, + ), ); } diff --git a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart index a0c79776..28387374 100644 --- a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart @@ -1,14 +1,19 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/features/diary/models/product.dart'; import 'package:eatvio_app/features/recipes/models/ingredient.dart'; import 'package:eatvio_app/features/recipes/models/recipe_model.dart'; import 'package:eatvio_app/features/recipes/models/step.dart' as step; import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_cubit.dart'; import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_state.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:image_picker/image_picker.dart'; // ignore: must_be_immutable diff --git a/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart index cbb2e16d..e016a36c 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart @@ -1,9 +1,10 @@ import 'package:eatvio_app/app_router.dart'; -import 'package:eatvio_app/core/app_export.dart'; + import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_state.dart'; import 'package:eatvio_app/features/registration/repositories/registration_repository.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; class RegistrationCubit extends Cubit { diff --git a/lib/features/registration/presentation/pages/additional_information_screen.dart b/lib/features/registration/presentation/pages/additional_information_screen.dart index 159a599f..e0a4edbf 100644 --- a/lib/features/registration/presentation/pages/additional_information_screen.dart +++ b/lib/features/registration/presentation/pages/additional_information_screen.dart @@ -1,8 +1,8 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class AdditionalInformationScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/allergies_screen.dart b/lib/features/registration/presentation/pages/allergies_screen.dart index 5a4e4bc3..f0d4c61e 100644 --- a/lib/features/registration/presentation/pages/allergies_screen.dart +++ b/lib/features/registration/presentation/pages/allergies_screen.dart @@ -1,8 +1,9 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class AllergiesScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/blood_pressure_screen.dart b/lib/features/registration/presentation/pages/blood_pressure_screen.dart index e773c3eb..7baac4f6 100644 --- a/lib/features/registration/presentation/pages/blood_pressure_screen.dart +++ b/lib/features/registration/presentation/pages/blood_pressure_screen.dart @@ -1,10 +1,14 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; +import 'package:eatvio_app/widgets/custom_image_view.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class BloodPressureScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/body_circumferences_screen.dart b/lib/features/registration/presentation/pages/body_circumferences_screen.dart index a086da35..5078be08 100644 --- a/lib/features/registration/presentation/pages/body_circumferences_screen.dart +++ b/lib/features/registration/presentation/pages/body_circumferences_screen.dart @@ -1,9 +1,10 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class BodyCircumferencesScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/city_of_living_screen.dart b/lib/features/registration/presentation/pages/city_of_living_screen.dart index edaf94fe..b901e3b2 100644 --- a/lib/features/registration/presentation/pages/city_of_living_screen.dart +++ b/lib/features/registration/presentation/pages/city_of_living_screen.dart @@ -1,8 +1,10 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:location/location.dart'; diff --git a/lib/features/registration/presentation/pages/credentials_screen.dart b/lib/features/registration/presentation/pages/credentials_screen.dart index 25b0a2a1..5a2c51ca 100644 --- a/lib/features/registration/presentation/pages/credentials_screen.dart +++ b/lib/features/registration/presentation/pages/credentials_screen.dart @@ -1,8 +1,9 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class CredentialsScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/date_of_birth_screen.dart b/lib/features/registration/presentation/pages/date_of_birth_screen.dart index 8d510c15..c980111b 100644 --- a/lib/features/registration/presentation/pages/date_of_birth_screen.dart +++ b/lib/features/registration/presentation/pages/date_of_birth_screen.dart @@ -1,8 +1,11 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/utils/date_time_utils.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:intl/intl.dart'; class DateOfBirthScreen extends StatefulWidget { diff --git a/lib/features/registration/presentation/pages/favorite_foods_screen.dart b/lib/features/registration/presentation/pages/favorite_foods_screen.dart index bab999ab..570f9d15 100644 --- a/lib/features/registration/presentation/pages/favorite_foods_screen.dart +++ b/lib/features/registration/presentation/pages/favorite_foods_screen.dart @@ -1,8 +1,9 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class FavoriteFoodsScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/favorite_sports_screen.dart b/lib/features/registration/presentation/pages/favorite_sports_screen.dart index 2856ea75..53742fc7 100644 --- a/lib/features/registration/presentation/pages/favorite_sports_screen.dart +++ b/lib/features/registration/presentation/pages/favorite_sports_screen.dart @@ -1,8 +1,9 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class FavoriteSportsScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/gender_screen.dart b/lib/features/registration/presentation/pages/gender_screen.dart index d1bec2f7..66549ac2 100644 --- a/lib/features/registration/presentation/pages/gender_screen.dart +++ b/lib/features/registration/presentation/pages/gender_screen.dart @@ -1,7 +1,7 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class GenderScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/height_screen.dart b/lib/features/registration/presentation/pages/height_screen.dart index 2aea3690..38a721ba 100644 --- a/lib/features/registration/presentation/pages/height_screen.dart +++ b/lib/features/registration/presentation/pages/height_screen.dart @@ -1,9 +1,10 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class HeightScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/language_select_screen.dart b/lib/features/registration/presentation/pages/language_select_screen.dart index 4d95033e..d1e1f885 100644 --- a/lib/features/registration/presentation/pages/language_select_screen.dart +++ b/lib/features/registration/presentation/pages/language_select_screen.dart @@ -1,8 +1,10 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class LanguageSelectScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/medicine_intake_screen.dart b/lib/features/registration/presentation/pages/medicine_intake_screen.dart index fc09d084..878d418d 100644 --- a/lib/features/registration/presentation/pages/medicine_intake_screen.dart +++ b/lib/features/registration/presentation/pages/medicine_intake_screen.dart @@ -1,8 +1,9 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class MedicineIntakeScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/name_screen.dart b/lib/features/registration/presentation/pages/name_screen.dart index ae817ed8..cebd4cd4 100644 --- a/lib/features/registration/presentation/pages/name_screen.dart +++ b/lib/features/registration/presentation/pages/name_screen.dart @@ -1,8 +1,9 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class NameScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/features/registration/presentation/pages/registration_screen.dart b/lib/features/registration/presentation/pages/registration_screen.dart index e95639a8..1b01acda 100644 --- a/lib/features/registration/presentation/pages/registration_screen.dart +++ b/lib/features/registration/presentation/pages/registration_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_state.dart'; import 'package:eatvio_app/features/registration/presentation/pages/additional_information_screen.dart'; @@ -16,9 +16,12 @@ import 'package:eatvio_app/features/registration/presentation/pages/language_sel import 'package:eatvio_app/features/registration/presentation/pages/medicine_intake_screen.dart'; import 'package:eatvio_app/features/registration/presentation/pages/name_screen.dart'; import 'package:eatvio_app/features/registration/presentation/pages/weight_screen.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:validators/validators.dart'; diff --git a/lib/features/registration/presentation/pages/weight_screen.dart b/lib/features/registration/presentation/pages/weight_screen.dart index 300296d6..c67cfee9 100644 --- a/lib/features/registration/presentation/pages/weight_screen.dart +++ b/lib/features/registration/presentation/pages/weight_screen.dart @@ -1,9 +1,10 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class WeightScreen extends StatefulWidget { final UserRegistrationSheet sheet; diff --git a/lib/locator_service.dart b/lib/locator_service.dart index beafd9b2..37c53064 100644 --- a/lib/locator_service.dart +++ b/lib/locator_service.dart @@ -1,5 +1,5 @@ import 'package:dio/dio.dart'; -import 'package:eatvio_app/core/constants/constants.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.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'; @@ -37,11 +37,12 @@ import 'package:get_it/get_it.dart'; final sl = GetIt.instance; Future init() async { - // BLoC / Cubit + // Cubit singletons sl.registerLazySingleton(() => InitializationCubit(chatRepository: sl())); sl.registerLazySingleton(() => NewMessagesCubit()); sl.registerLazySingleton(() => NotificationsCubit()); + // Cubit factories sl.registerFactory(() => RegistrationCubit(registrationRepository: sl())); sl.registerFactory(() => ChatRoomCubit(chatRepository: sl(), initializationCubit: sl())); sl.registerFactory(() => FeedCubit(feedRepository: sl())); diff --git a/lib/main.dart b/lib/main.dart index 5a24fa1e..7191b2b0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,22 +2,14 @@ import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.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/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; -import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_cubit.dart'; -import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; -import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_cubit.dart'; -import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; -import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart'; -import 'package:eatvio_app/features/plans/presentation/bloc/plans_cubit/plans_cubit.dart'; -import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_cubit.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/locator_service.dart' as di; import 'package:eatvio_app/locator_service.dart'; -import 'package:eatvio_app/old/profile/my_profile_screen/bloc/my_profile_bloc.dart'; -import 'package:eatvio_app/old/profile/my_profile_screen/models/my_profile_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:keyboard_dismisser/keyboard_dismisser.dart'; -import 'core/app_export.dart'; var globalMessengerKey = GlobalKey(); @@ -35,20 +27,14 @@ class MyApp extends StatelessWidget { BlocProvider(create: (context) => sl()), BlocProvider(create: (context) => sl()), BlocProvider(create: (context) => sl()), - BlocProvider(create: (context) => sl()..getMyProfile()), - BlocProvider(create: (context) => sl()..loadFeedBlogPostList()), - BlocProvider(create: (context) => sl()..loadRecipesList()), - BlocProvider(create: (context) => sl()..loadDiets()), - BlocProvider(create: (context) => sl()..getPlans()), - BlocProvider(create: (context) => MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel()))..add(MyProfileInitialEvent())), - BlocProvider(create: (context) => sl()..add(LoadDiary())), - BlocProvider(create: (context) => sl()..loadCalendarList()), - BlocProvider(create: (context) => sl()..loadRecipeCreate()), ], child: KeyboardDismisser( child: MaterialApp.router( - theme: theme, - themeMode: ThemeMode.light, + theme: ThemeData.light().copyWith( + colorScheme: ColorScheme.fromSeed(seedColor: appTheme.blueA400), + ), + // darkTheme: ThemeData.dark().copyWith(), + themeMode: ThemeMode.system, routerConfig: AppRouter.appRouter, debugShowCheckedModeBanner: false, localizationsDelegates: [ diff --git a/lib/old/auth/auth_screen/auth_screen.dart b/lib/old/auth/auth_screen/auth_screen.dart index 502eff15..f13d77cd 100644 --- a/lib/old/auth/auth_screen/auth_screen.dart +++ b/lib/old/auth/auth_screen/auth_screen.dart @@ -1,15 +1,17 @@ import 'dart:convert'; - -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:url_launcher/url_launcher.dart'; import 'package:validators/validators.dart'; - import 'bloc/auth_bloc.dart'; import 'models/auth_model.dart'; diff --git a/lib/old/auth/auth_screen/bloc/auth_bloc.dart b/lib/old/auth/auth_screen/bloc/auth_bloc.dart index cc7fb9d4..9d7b76a2 100644 --- a/lib/old/auth/auth_screen/bloc/auth_bloc.dart +++ b/lib/old/auth/auth_screen/bloc/auth_bloc.dart @@ -1,9 +1,7 @@ import 'package:eatvio_app/old/auth/auth_screen/models/auth_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; - -import '/core/app_export.dart'; - +import 'package:flutter_bloc/flutter_bloc.dart'; part 'auth_event.dart'; part 'auth_state.dart'; diff --git a/lib/old/diary/diary_edit_screen/diary_edit_screen.dart b/lib/old/diary/diary_edit_screen/diary_edit_screen.dart index 5237efb6..57e167d7 100644 --- a/lib/old/diary/diary_edit_screen/diary_edit_screen.dart +++ b/lib/old/diary/diary_edit_screen/diary_edit_screen.dart @@ -8,7 +8,7 @@ import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:image_picker/image_picker.dart'; import 'package:flutter_dotenv/flutter_dotenv.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_outlined_button.dart'; diff --git a/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart b/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart index 6f14062d..34900450 100644 --- a/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart +++ b/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart @@ -2,14 +2,16 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/diets/diet_create_screen/models/diet_create_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -import '/core/app_export.dart'; + part 'diet_create_event.dart'; part 'diet_create_state.dart'; diff --git a/lib/old/diets/diet_create_screen/diet_create_screen.dart b/lib/old/diets/diet_create_screen/diet_create_screen.dart index 0abc3aba..bad75b05 100644 --- a/lib/old/diets/diet_create_screen/diet_create_screen.dart +++ b/lib/old/diets/diet_create_screen/diet_create_screen.dart @@ -1,5 +1,6 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'bloc/diet_create_bloc.dart'; import 'models/diet_create_model.dart'; diff --git a/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart b/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart index 4635fc11..cb0c87bf 100644 --- a/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart +++ b/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart @@ -2,14 +2,16 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/diets/diet_edit_screen/models/diet_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -import '/core/app_export.dart'; + part 'diet_edit_event.dart'; part 'diet_edit_state.dart'; diff --git a/lib/old/diets/diet_edit_screen/diet_edit_screen.dart b/lib/old/diets/diet_edit_screen/diet_edit_screen.dart index ea43dd45..e5b5052e 100644 --- a/lib/old/diets/diet_edit_screen/diet_edit_screen.dart +++ b/lib/old/diets/diet_edit_screen/diet_edit_screen.dart @@ -1,6 +1,9 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; + import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'bloc/diet_edit_bloc.dart'; import 'models/diet_edit_model.dart'; diff --git a/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart b/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart index 26622a74..2c49b95f 100644 --- a/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart +++ b/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart @@ -3,15 +3,17 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/diets/diet_select_screen/models/diet_select_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; -import '/core/app_export.dart'; + part 'diet_select_event.dart'; part 'diet_select_state.dart'; diff --git a/lib/old/diets/diet_select_screen/diet_select_screen.dart b/lib/old/diets/diet_select_screen/diet_select_screen.dart index 18ea53cb..dd332673 100644 --- a/lib/old/diets/diet_select_screen/diet_select_screen.dart +++ b/lib/old/diets/diet_select_screen/diet_select_screen.dart @@ -1,9 +1,13 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; + import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'bloc/diet_select_bloc.dart'; diff --git a/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart b/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart index 008e566a..0fd6c0c4 100644 --- a/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart +++ b/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart @@ -2,14 +2,16 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/diets/diet_show_screen/models/diet_show_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -import '/core/app_export.dart'; + part 'diet_show_event.dart'; part 'diet_show_state.dart'; diff --git a/lib/old/diets/diet_show_screen/diet_show_screen.dart b/lib/old/diets/diet_show_screen/diet_show_screen.dart index 1220fea9..84d87ced 100644 --- a/lib/old/diets/diet_show_screen/diet_show_screen.dart +++ b/lib/old/diets/diet_show_screen/diet_show_screen.dart @@ -1,6 +1,10 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; + import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'bloc/diet_show_bloc.dart'; diff --git a/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart b/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart index 5133d85b..b0b4f10f 100644 --- a/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart +++ b/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart @@ -1,17 +1,16 @@ import 'dart:async'; - import 'package:dio/dio.dart'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/old/feed/blog_post_create_screen/models/blog_post_create_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:image_picker/image_picker.dart'; -import '/core/app_export.dart'; - part 'blog_post_create_event.dart'; part 'blog_post_create_state.dart'; diff --git a/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart b/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart index fd369ec2..4869330e 100644 --- a/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart +++ b/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart @@ -2,14 +2,16 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/feed/blog_post_edit_screen/models/blog_post_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -import '/core/app_export.dart'; + part 'blog_post_edit_event.dart'; part 'blog_post_edit_state.dart'; diff --git a/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart b/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart index 0770341d..223c6ce6 100644 --- a/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart +++ b/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart @@ -1,6 +1,9 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; + import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'bloc/blog_post_edit_bloc.dart'; import 'models/blog_post_edit_model.dart'; diff --git a/lib/old/feed/blog_post_screen/models/comment_model.dart b/lib/old/feed/blog_post_screen/models/comment_model.dart index 2b9c7133..f5bb4131 100644 --- a/lib/old/feed/blog_post_screen/models/comment_model.dart +++ b/lib/old/feed/blog_post_screen/models/comment_model.dart @@ -1,7 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; - -/// This class is used in the [userprofile_item_widget] screen. -// ignore_for_file: must_be_immutable +import 'package:eatvio_app/core/utils/image_constant.dart'; class CommentModel { CommentModel({ diff --git a/lib/old/feed/blog_post_screen/widgets/comment_widget.dart b/lib/old/feed/blog_post_screen/widgets/comment_widget.dart index 5eb3d53a..b47f34d6 100644 --- a/lib/old/feed/blog_post_screen/widgets/comment_widget.dart +++ b/lib/old/feed/blog_post_screen/widgets/comment_widget.dart @@ -1,8 +1,13 @@ // ignore_for_file: must_be_immutable import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; + import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:eatvio_app/widgets/custom_image_view.dart'; import 'package:flutter/material.dart'; class CommentWidget extends StatelessWidget { diff --git a/lib/old/feed/feed_screen/widgets/feed_scroll_item.dart b/lib/old/feed/feed_screen/widgets/feed_scroll_item.dart index bc3b1613..da1ca390 100644 --- a/lib/old/feed/feed_screen/widgets/feed_scroll_item.dart +++ b/lib/old/feed/feed_screen/widgets/feed_scroll_item.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:flutter/material.dart'; class ScrollItem extends StatelessWidget { diff --git a/lib/old/feed/feed_screen/widgets/feed_search_view.dart b/lib/old/feed/feed_screen/widgets/feed_search_view.dart index 1918aeaa..579a0a29 100644 --- a/lib/old/feed/feed_screen/widgets/feed_search_view.dart +++ b/lib/old/feed/feed_screen/widgets/feed_search_view.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:flutter/material.dart'; class CustomSearchView extends StatelessWidget { diff --git a/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart b/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart index f642ee1d..61a8efeb 100644 --- a/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart +++ b/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart @@ -2,14 +2,17 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/old/glossary/glossary_screen/models/glossary_screen_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -import '/core/app_export.dart'; + part 'glossary_screen_event.dart'; part 'glossary_screen_state.dart'; diff --git a/lib/old/glossary/glossary_screen/glossary_screen.dart b/lib/old/glossary/glossary_screen/glossary_screen.dart index 0e56aaaa..5a49cc2e 100644 --- a/lib/old/glossary/glossary_screen/glossary_screen.dart +++ b/lib/old/glossary/glossary_screen/glossary_screen.dart @@ -1,10 +1,15 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; + import 'package:eatvio_app/old/glossary/glossary_screen/widgets/glossary_scroll_item.dart'; import 'package:eatvio_app/old/glossary/glossary_screen/widgets/glossary_search_widget.dart'; +import 'package:eatvio_app/theme/custom_button_style.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:eatvio_app/widgets/custom_outlined_button.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'bloc/glossary_screen_bloc.dart'; import 'models/glossary_screen_model.dart'; diff --git a/lib/old/glossary/glossary_screen/widgets/glossary_scroll_item.dart b/lib/old/glossary/glossary_screen/widgets/glossary_scroll_item.dart index bc3b1613..da1ca390 100644 --- a/lib/old/glossary/glossary_screen/widgets/glossary_scroll_item.dart +++ b/lib/old/glossary/glossary_screen/widgets/glossary_scroll_item.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:flutter/material.dart'; class ScrollItem extends StatelessWidget { diff --git a/lib/old/glossary/glossary_screen/widgets/glossary_search_widget.dart b/lib/old/glossary/glossary_screen/widgets/glossary_search_widget.dart index 1918aeaa..579a0a29 100644 --- a/lib/old/glossary/glossary_screen/widgets/glossary_search_widget.dart +++ b/lib/old/glossary/glossary_screen/widgets/glossary_search_widget.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:flutter/material.dart'; class CustomSearchView extends StatelessWidget { diff --git a/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart b/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart index 09eb839b..abd758fa 100644 --- a/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart +++ b/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart @@ -2,14 +2,16 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/plans/plan_create_screen/models/plan_create_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -import '/core/app_export.dart'; + part 'plan_create_event.dart'; part 'plan_create_state.dart'; diff --git a/lib/old/plans/plan_create_screen/plan_create_screen.dart b/lib/old/plans/plan_create_screen/plan_create_screen.dart index f369e4a0..284d94b2 100644 --- a/lib/old/plans/plan_create_screen/plan_create_screen.dart +++ b/lib/old/plans/plan_create_screen/plan_create_screen.dart @@ -1,5 +1,6 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'bloc/plan_create_bloc.dart'; import 'models/plan_create_model.dart'; diff --git a/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart b/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart index 4c8949c3..55f3a9a4 100644 --- a/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart +++ b/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart @@ -2,14 +2,16 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/plans/plan_edit_screen/models/plan_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -import '/core/app_export.dart'; + part 'plan_edit_event.dart'; part 'plan_edit_state.dart'; diff --git a/lib/old/plans/plan_edit_screen/plan_edit_screen.dart b/lib/old/plans/plan_edit_screen/plan_edit_screen.dart index 4936da7d..39d29424 100644 --- a/lib/old/plans/plan_edit_screen/plan_edit_screen.dart +++ b/lib/old/plans/plan_edit_screen/plan_edit_screen.dart @@ -1,6 +1,9 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; + import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'bloc/plan_edit_bloc.dart'; import 'models/plan_edit_model.dart'; diff --git a/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart b/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart index d2ffb5be..6bfd7331 100644 --- a/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart +++ b/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart @@ -3,15 +3,17 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/plans/plan_select_screen/models/plan_select_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; -import '/core/app_export.dart'; + part 'plan_select_event.dart'; part 'plan_select_state.dart'; diff --git a/lib/old/plans/plan_select_screen/plan_select_screen.dart b/lib/old/plans/plan_select_screen/plan_select_screen.dart index d5b3d06d..c75c3c98 100644 --- a/lib/old/plans/plan_select_screen/plan_select_screen.dart +++ b/lib/old/plans/plan_select_screen/plan_select_screen.dart @@ -1,9 +1,13 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; + import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'bloc/plan_select_bloc.dart'; diff --git a/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart b/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart index 48b16f9b..82314d7e 100644 --- a/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart +++ b/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart @@ -2,14 +2,16 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/plans/plan_show_screen/models/plan_show_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -import '/core/app_export.dart'; + part 'plan_show_event.dart'; part 'plan_show_state.dart'; diff --git a/lib/old/plans/plan_show_screen/plan_show_screen.dart b/lib/old/plans/plan_show_screen/plan_show_screen.dart index 67565f96..ab173bc3 100644 --- a/lib/old/plans/plan_show_screen/plan_show_screen.dart +++ b/lib/old/plans/plan_show_screen/plan_show_screen.dart @@ -1,6 +1,10 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; + import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'bloc/plan_show_bloc.dart'; diff --git a/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart b/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart index 6179d623..430730a7 100644 --- a/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart +++ b/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart @@ -1,18 +1,15 @@ -//import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'dart:async'; import 'dart:convert'; - import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/profile/my_profile_screen/models/my_profile_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; - -import '/core/app_export.dart'; - part 'my_profile_event.dart'; part 'my_profile_state.dart'; @@ -31,8 +28,6 @@ class MyProfileBloc extends Bloc { if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } - //final token = - // "9|laravel_sanctum_KFXbccDcWEvTPfJmV99EQv1ne AggmpR2TidVGDPN34fa201a"; final response = await http.get( Uri.parse(baseUrl + '/api/profile/index'), headers: { diff --git a/lib/old/profile/my_profile_screen/my_profile_screen.dart b/lib/old/profile/my_profile_screen/my_profile_screen.dart index ca88e2e0..6bc818e3 100644 --- a/lib/old/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/old/profile/my_profile_screen/my_profile_screen.dart @@ -3,12 +3,18 @@ import 'dart:math'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:carousel_slider_plus/carousel_slider_plus.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; + import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; diff --git a/lib/old/profile/my_profile_screen/my_settings_screen.dart b/lib/old/profile/my_profile_screen/my_settings_screen.dart index f9a28356..4b7a7740 100644 --- a/lib/old/profile/my_profile_screen/my_settings_screen.dart +++ b/lib/old/profile/my_profile_screen/my_settings_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; @@ -8,6 +8,7 @@ import 'package:eatvio_app/widgets/custom_language_drop_down.dart'; import 'package:eatvio_app/widgets/custom_notification_screen.dart'; import 'package:eatvio_app/widgets/custom_section_title.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'bloc/my_profile_bloc.dart'; diff --git a/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart b/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart index 33ee84ff..f07114d5 100644 --- a/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart +++ b/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart @@ -1,16 +1,15 @@ import 'dart:async'; import 'dart:convert'; - import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/recipe/recipe_edit_screen/models/recipe_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -import '/core/app_export.dart'; - part 'recipe_edit_event.dart'; part 'recipe_edit_state.dart'; diff --git a/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart b/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart index c0675b62..607521cc 100644 --- a/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart +++ b/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart @@ -1,11 +1,18 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; +import 'package:eatvio_app/theme/custom_button_style.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; + import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; import 'package:eatvio_app/widgets/custom_outlined_button.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'bloc/recipe_edit_bloc.dart'; diff --git a/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart b/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart index 70bab591..8ce71b7d 100644 --- a/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart +++ b/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart @@ -1,17 +1,16 @@ import 'dart:async'; - import 'package:dio/dio.dart'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/old/recipe/recipe_select_screen/models/recipe_select_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:image_picker/image_picker.dart'; -import '/core/app_export.dart'; - part 'recipe_select_event.dart'; part 'recipe_select_state.dart'; diff --git a/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart b/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart index d1320268..a871aa7f 100644 --- a/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart +++ b/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart @@ -1,9 +1,13 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; + import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'bloc/recipe_select_bloc.dart'; diff --git a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart index bfd81864..763f68bf 100644 --- a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart +++ b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart @@ -1,18 +1,16 @@ import 'dart:async'; import 'dart:convert'; - import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; import 'package:eatvio_app/old/recipe/recipe_show_screen/models/recipe_show_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:intl/intl.dart'; - -import '/core/app_export.dart'; - part 'recipe_show_event.dart'; part 'recipe_show_state.dart'; diff --git a/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart b/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart index 0a5b67ad..688e73c0 100644 --- a/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart +++ b/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart @@ -1,9 +1,17 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; + import 'package:eatvio_app/old/feed/blog_post_screen/widgets/comment_widget.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; +import 'package:eatvio_app/theme/custom_button_style.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; +import 'package:eatvio_app/widgets/custom_image_view.dart'; import 'package:eatvio_app/widgets/custom_outlined_button.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:intl/intl.dart'; diff --git a/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart b/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart index 5eb3d53a..1ff8e7b8 100644 --- a/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart +++ b/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart @@ -1,17 +1,16 @@ -// ignore_for_file: must_be_immutable - import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:eatvio_app/widgets/custom_image_view.dart'; import 'package:flutter/material.dart'; class CommentWidget extends StatelessWidget { - CommentWidget(this.commentModelObj, {Key? key}) - : super( - key: key, - ); + const CommentWidget(this.commentModelObj); - CommentModel commentModelObj; + final CommentModel commentModelObj; @override Widget build(BuildContext context) { diff --git a/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart b/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart index d4adda62..e0087256 100644 --- a/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart +++ b/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart @@ -1,17 +1,15 @@ //import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'dart:async'; import 'dart:convert'; - import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/old/users/subscribers_screen/models/subscribers_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - -import '/core/app_export.dart'; - part 'subscribers_event.dart'; part 'subscribers_state.dart'; diff --git a/lib/old/users/subscribers_screen/subscribers_screen.dart b/lib/old/users/subscribers_screen/subscribers_screen.dart index 4d1caf23..cf1210fd 100644 --- a/lib/old/users/subscribers_screen/subscribers_screen.dart +++ b/lib/old/users/subscribers_screen/subscribers_screen.dart @@ -1,11 +1,16 @@ import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; + import 'package:eatvio_app/old/feed/feed_screen/widgets/feed_search_view.dart'; +import 'package:eatvio_app/theme/custom_button_style.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; import 'package:eatvio_app/widgets/custom_outlined_button.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'bloc/subscribers_bloc.dart'; diff --git a/lib/theme/app_decoration.dart b/lib/theme/app_decoration.dart index c9d30536..bb6c590f 100644 --- a/lib/theme/app_decoration.dart +++ b/lib/theme/app_decoration.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; class AppDecoration { diff --git a/lib/theme/custom_button_style.dart b/lib/theme/custom_button_style.dart index a5eb6f88..57e3ca9e 100644 --- a/lib/theme/custom_button_style.dart +++ b/lib/theme/custom_button_style.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; /// A class that offers pre-defined button styles for customizing button appearance. diff --git a/lib/theme/custom_text_style.dart b/lib/theme/custom_text_style.dart index ee624454..7cf7b69e 100644 --- a/lib/theme/custom_text_style.dart +++ b/lib/theme/custom_text_style.dart @@ -1,7 +1,6 @@ +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; -import '../core/app_export.dart'; - /// A collection of pre-defined text styles for customizing text appearance, /// categorized by different font families and weights. /// Additionally, this class includes extensions on [TextStyle] to easily apply specific font families to text. diff --git a/lib/widgets/app_bar/appbar_leading_image.dart b/lib/widgets/app_bar/appbar_leading_image.dart index 5a2273a6..0f930dcb 100644 --- a/lib/widgets/app_bar/appbar_leading_image.dart +++ b/lib/widgets/app_bar/appbar_leading_image.dart @@ -1,22 +1,16 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/widgets/custom_image_view.dart'; import 'package:flutter/material.dart'; -// ignore: must_be_immutable class AppbarLeadingImage extends StatelessWidget { - AppbarLeadingImage({ - Key? key, + const AppbarLeadingImage({ this.imagePath, this.margin, this.onTap, - }) : super( - key: key, - ); + }); - String? imagePath; - - EdgeInsetsGeometry? margin; - - Function? onTap; + final String? imagePath; + final EdgeInsetsGeometry? margin; + final Function? onTap; @override Widget build(BuildContext context) { diff --git a/lib/widgets/app_bar/appbar_subtitle.dart b/lib/widgets/app_bar/appbar_subtitle.dart index 75784abc..ff1325f7 100644 --- a/lib/widgets/app_bar/appbar_subtitle.dart +++ b/lib/widgets/app_bar/appbar_subtitle.dart @@ -1,22 +1,17 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; -// ignore: must_be_immutable class AppbarSubtitle extends StatelessWidget { - AppbarSubtitle({ - Key? key, + const AppbarSubtitle({ required this.text, this.margin, this.onTap, - }) : super( - key: key, - ); + }); - String text; - - EdgeInsetsGeometry? margin; - - Function? onTap; + final String text; + final EdgeInsetsGeometry? margin; + final Function? onTap; @override Widget build(BuildContext context) { diff --git a/lib/widgets/app_bar/appbar_title_circleimage.dart b/lib/widgets/app_bar/appbar_title_circleimage.dart index bc6eb32d..3bf6925e 100644 --- a/lib/widgets/app_bar/appbar_title_circleimage.dart +++ b/lib/widgets/app_bar/appbar_title_circleimage.dart @@ -1,19 +1,15 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/app_decoration.dart'; +import 'package:eatvio_app/widgets/custom_image_view.dart'; import 'package:flutter/material.dart'; -// ignore: must_be_immutable class AppbarTitleCircleimage extends StatelessWidget { - AppbarTitleCircleimage({ - Key? key, + const AppbarTitleCircleimage({ this.imagePath, this.margin, - }) : super( - key: key, - ); + }); - String? imagePath; - - EdgeInsetsGeometry? margin; + final String? imagePath; + final EdgeInsetsGeometry? margin; @override Widget build(BuildContext context) { diff --git a/lib/widgets/app_bar/appbar_title_image.dart b/lib/widgets/app_bar/appbar_title_image.dart index 429ab4d8..cf7fedcf 100644 --- a/lib/widgets/app_bar/appbar_title_image.dart +++ b/lib/widgets/app_bar/appbar_title_image.dart @@ -1,7 +1,6 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/widgets/custom_image_view.dart'; import 'package:flutter/material.dart'; -// ignore: must_be_immutable class AppbarTitleImage extends StatelessWidget { const AppbarTitleImage({required this.imagePath, super.key}); diff --git a/lib/widgets/app_bar/exit_button.dart b/lib/widgets/app_bar/exit_button.dart index ee0d27dd..04cd6eac 100644 --- a/lib/widgets/app_bar/exit_button.dart +++ b/lib/widgets/app_bar/exit_button.dart @@ -1,22 +1,16 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:flutter/material.dart'; -// ignore: must_be_immutable class ExitButton extends StatelessWidget { - ExitButton({ - Key? key, + const ExitButton({ required this.text, this.margin, this.onTap, - }) : super( - key: key, - ); + }); - String text; - - EdgeInsetsGeometry? margin; - - Function? onTap; + final String text; + final EdgeInsetsGeometry? margin; + final Function? onTap; @override Widget build(BuildContext context) { diff --git a/lib/widgets/custom_drop_down.dart b/lib/widgets/custom_drop_down.dart index 96367d61..9cc045b3 100644 --- a/lib/widgets/custom_drop_down.dart +++ b/lib/widgets/custom_drop_down.dart @@ -1,4 +1,5 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; class CustomDropDown extends StatelessWidget { diff --git a/lib/widgets/custom_edit_drop_down.dart b/lib/widgets/custom_edit_drop_down.dart index 7f56bbd8..bc27e307 100644 --- a/lib/widgets/custom_edit_drop_down.dart +++ b/lib/widgets/custom_edit_drop_down.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:flutter/material.dart'; class CustomDropDown extends StatelessWidget { diff --git a/lib/widgets/custom_expandable_list.dart b/lib/widgets/custom_expandable_list.dart index d6a5c649..e6f3878a 100644 --- a/lib/widgets/custom_expandable_list.dart +++ b/lib/widgets/custom_expandable_list.dart @@ -1,13 +1,15 @@ import 'dart:convert'; - -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/old/profile/my_profile_screen/bloc/my_profile_bloc.dart'; +import 'package:eatvio_app/theme/custom_button_style.dart'; import 'package:eatvio_app/widgets/custom_hyper_switch.dart'; import 'package:eatvio_app/widgets/custom_hypo_switch.dart'; import 'package:eatvio_app/widgets/next_step_button.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:intl/intl.dart'; diff --git a/lib/widgets/custom_hyper_switch.dart b/lib/widgets/custom_hyper_switch.dart index b67f553a..93b1a340 100644 --- a/lib/widgets/custom_hyper_switch.dart +++ b/lib/widgets/custom_hyper_switch.dart @@ -1,5 +1,5 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/old/profile/my_profile_screen/bloc/my_profile_bloc.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; class HyperSwitch extends StatefulWidget { diff --git a/lib/widgets/custom_hypo_switch.dart b/lib/widgets/custom_hypo_switch.dart index 14a926fd..ab5e11ab 100644 --- a/lib/widgets/custom_hypo_switch.dart +++ b/lib/widgets/custom_hypo_switch.dart @@ -1,5 +1,5 @@ -import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/old/profile/my_profile_screen/bloc/my_profile_bloc.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; class HypoSwitch extends StatefulWidget { diff --git a/lib/widgets/custom_navigation_menu_item.dart b/lib/widgets/custom_navigation_menu_item.dart index 3307daaf..44522866 100644 --- a/lib/widgets/custom_navigation_menu_item.dart +++ b/lib/widgets/custom_navigation_menu_item.dart @@ -1,4 +1,5 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:eatvio_app/widgets/custom_image_view.dart'; import 'package:flutter/material.dart'; class MenuItem extends StatelessWidget { diff --git a/lib/widgets/custom_notification_screen.dart b/lib/widgets/custom_notification_screen.dart index 72fd860b..20c2055b 100644 --- a/lib/widgets/custom_notification_screen.dart +++ b/lib/widgets/custom_notification_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; class NotificationSwitch extends StatefulWidget { diff --git a/lib/widgets/custom_outlined_button.dart b/lib/widgets/custom_outlined_button.dart index 723cdbc0..549052f8 100644 --- a/lib/widgets/custom_outlined_button.dart +++ b/lib/widgets/custom_outlined_button.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/widgets/base_button.dart'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/custom_text_form_field.dart b/lib/widgets/custom_text_form_field.dart index a2b6c74f..60260b84 100644 --- a/lib/widgets/custom_text_form_field.dart +++ b/lib/widgets/custom_text_form_field.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; diff --git a/lib/widgets/next_step_button.dart b/lib/widgets/next_step_button.dart index 3fe62f86..05332f15 100644 --- a/lib/widgets/next_step_button.dart +++ b/lib/widgets/next_step_button.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/base_button.dart'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/nutrition_chart.dart b/lib/widgets/nutrition_chart.dart index 3fe62f86..05332f15 100644 --- a/lib/widgets/nutrition_chart.dart +++ b/lib/widgets/nutrition_chart.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/base_button.dart'; import 'package:flutter/material.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index b894118d..3d91e2f8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,14 +17,20 @@ dependencies: flutter_bloc: ^8.1.6 cached_network_image: ^3.4.1 flutter_svg: ^2.0.10+1 + # remove equatable: ^2.0.5 freezed_annotation: ^2.4.4 json_annotation: ^4.9.0 + # remove? validators: ^3.0.0 path_provider: ^2.1.4 + # remove? fl_chart: ^0.69.0 + # remove? flutter_spinkit: ^5.2.1 + # remove? carousel_slider_plus: ^7.0.1 + # remove? flutter_form_builder: ^9.4.1 image_picker: ^1.1.2 flutter_typeahead: ^5.2.0 @@ -50,10 +56,10 @@ dependencies: audioplayers: ^6.1.0 dev_dependencies: - build_runner: ^2.4.11 - freezed: ^2.5.2 + build_runner: ^2.4.12 + freezed: ^2.5.7 json_serializable: ^6.8.0 - retrofit_generator: ^8.2.0 + retrofit_generator: ^9.1.2 flutter_test: sdk: flutter diff --git a/test/auth_test.dart b/test/auth_test.dart index 49a9f19c..bc637b82 100644 --- a/test/auth_test.dart +++ b/test/auth_test.dart @@ -1,5 +1,6 @@ -import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/localization/app_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; @@ -8,8 +9,7 @@ import 'package:eatvio_app/old/auth/auth_screen/models/auth_model.dart'; void main() { group('AuthScreen', () { - testWidgets('renders AuthScreen with initial state', - (WidgetTester tester) async { + testWidgets('renders AuthScreen with initial state', (WidgetTester tester) async { final authBloc = AuthBloc(AuthState(authModelObj: AuthModel())); await tester.pumpWidget( From 09cfacb0224282792750b069ec923421b153f11b Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 11 Sep 2024 16:28:45 +0300 Subject: [PATCH 16/31] refactor: --- flutter_01.log | 97 ------------------------------------------------- logs/errors.log | 0 2 files changed, 97 deletions(-) delete mode 100644 flutter_01.log delete mode 100644 logs/errors.log diff --git a/flutter_01.log b/flutter_01.log deleted file mode 100644 index f7f3c20d..00000000 --- a/flutter_01.log +++ /dev/null @@ -1,97 +0,0 @@ -Flutter crash report. -Please report a bug at https://github.com/flutter/flutter/issues. - -## command - -flutter analyze - -## exception - -PathNotFoundException: PathNotFoundException: Cannot open file, path = '/home/alex/snap/flutter/common/flutter/version' (OS Error: No such file or directory, errno = 2) - -``` -#0 _File.throwIfError (dart:io/file_impl.dart:675:7) -#1 _File.openSync (dart:io/file_impl.dart:490:5) -#2 _File.readAsBytesSync (dart:io/file_impl.dart:574:18) -#3 _File.readAsStringSync (dart:io/file_impl.dart:624:18) -#4 ForwardingFile.readAsStringSync (package:file/src/forwarding/forwarding_file.dart:99:16) -#5 ErrorHandlingFile.readAsStringSync. (package:flutter_tools/src/base/error_handling_io.dart:217:22) -#6 _runSync (package:flutter_tools/src/base/error_handling_io.dart:587:14) -#7 ErrorHandlingFile.readAsStringSync (package:flutter_tools/src/base/error_handling_io.dart:216:12) -#8 _DefaultPub.get (package:flutter_tools/src/dart/pub.dart:302:58) -#9 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1724:17) - -#10 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1394:27) - -#11 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) - -#12 CommandRunner.runCommand (package:args/command_runner.dart:212:13) - -#13 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:372:9) - -#14 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) - -#15 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:308:5) - -#16 run.. (package:flutter_tools/runner.dart:130:9) - -#17 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) - -#18 main (package:flutter_tools/executable.dart:93:3) - -``` - -## flutter doctor - -``` -[!] Flutter (Channel [user-branch], 0.0.0-unknown, on Ubuntu 24.04 LTS 6.8.0-38-generic, locale ru_RU.UTF-8) - ! Flutter version 0.0.0-unknown on channel [user-branch] at /home/alex/snap/flutter/common/flutter - Currently on an unknown channel. Run `flutter channel` to switch to an official channel. - If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install. - Cannot resolve current version, possibly due to local changes. - Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install. - ! Upstream repository unknown source is not a standard remote. - Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error. - • Framework revision (), 1970-01-01 03:00:00.000 - • Engine revision edd8546116 - • Dart version 3.4.3 - • DevTools version 2.34.3 - • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. - -[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) - • Android SDK at /home/alex/Android/Sdk - • Platform android-35, build-tools 35.0.0 - • Java binary at: /snap/android-studio/161/jbr/bin/java - • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105) - • All Android licenses accepted. - -[✓] Chrome - develop for the web - • Chrome at google-chrome - -[✓] Linux toolchain - develop for Linux desktop - • clang version 10.0.0-4ubuntu1 - • cmake version 3.16.3 - • ninja version 1.10.0 - • pkg-config version 0.29.1 - -[✓] Android Studio (version 2024.1) - • Android Studio at /snap/android-studio/161 - • Flutter plugin version 80.0.2 - • Dart plugin can be installed from: - 🔨 https://plugins.jetbrains.com/plugin/6351-dart - • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105) - -[✓] VS Code (version 1.91.1) - • VS Code at /usr/share/code - • Flutter extension version 3.92.0 - -[✓] Connected device (3 available) - • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 15 (API 35) (emulator) - • Linux (desktop) • linux • linux-x64 • Ubuntu 24.04 LTS 6.8.0-38-generic - • Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.126 - -[✓] Network resources - • All expected network resources are available. - -! Doctor found issues in 1 category. -``` diff --git a/logs/errors.log b/logs/errors.log deleted file mode 100644 index e69de29b..00000000 From 69472f422edf780106a25899d2a078bb3e338195 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 11 Sep 2024 16:39:15 +0300 Subject: [PATCH 17/31] refactor: remove unused elements --- lib/app_router.dart | 9 - lib/core/errors/exceptions.dart | 25 - lib/core/errors/failures.dart | 8 - .../initialization_state.freezed.dart | 94 ++-- ...base_models.dart => pagination_model.dart} | 4 +- ...zed.dart => pagination_model.freezed.dart} | 171 +++---- ..._models.g.dart => pagination_model.g.dart} | 15 +- lib/core/utils/logger.dart | 15 - lib/core/utils/progress_dialog_utils.dart | 33 -- .../selection_popup_model.freezed.dart | 52 +- .../new_messages_state.freezed.dart | 90 ++-- .../notifications_state.freezed.dart | 157 ++---- .../profile_avatar_cubit.dart | 2 +- .../profile_avatar_state.freezed.dart | 93 ++-- .../calendar/models/calendar_entry_model.dart | 3 +- .../calendar/models/calendar_model.dart | 1 + .../models/calendar_model.freezed.dart | 89 ++-- .../calendar/models/calendar_model.g.dart | 13 +- .../bloc/calendar_state.freezed.dart | 95 ++-- .../calendar/services/calendar_service.g.dart | 8 +- .../models/chat_message_model.freezed.dart | 71 ++- .../chat/models/chat_message_model.g.dart | 8 +- .../models/chat_messages_model.freezed.dart | 68 +-- .../chat/models/chat_messages_model.g.dart | 12 +- .../chat/models/chat_meta_model.freezed.dart | 52 +- .../chat/models/chat_meta_model.g.dart | 6 +- .../chat/models/chat_room_model.freezed.dart | 76 +-- .../chat/models/chat_room_model.g.dart | 12 +- .../chat_room_preview_model.freezed.dart | 332 +++++------- .../models/chat_room_preview_model.g.dart | 41 +- .../chat_room_settings_model.freezed.dart | 76 ++- .../models/chat_room_settings_model.g.dart | 8 +- .../chat/models/chat_user_model.freezed.dart | 76 ++- .../chat/models/chat_user_model.g.dart | 6 +- .../models/websocket_info_model.freezed.dart | 79 ++- .../chat/models/websocket_info_model.g.dart | 8 +- .../chat_room_state.freezed.dart | 169 ++---- .../chat_select_state.freezed.dart | 100 ++-- .../chat/presentation/pages/chat_screen.dart | 8 +- .../pages/chat_select_screen.dart | 1 - .../presentation/pages/photo_view_screen.dart | 1 - .../widgets/chat_bubble_widget.dart | 1 - .../chat/repositories/chat_repository.dart | 5 +- .../chat/services/chat_service.g.dart | 7 +- .../diary/models/diary_model.freezed.dart | 86 ++-- lib/features/diary/models/diary_model.g.dart | 18 +- lib/features/diary/models/meal.freezed.dart | 72 ++- lib/features/diary/models/meal.g.dart | 11 +- lib/features/diary/models/photo.dart | 1 - lib/features/diary/models/photo.freezed.dart | 57 +-- lib/features/diary/models/photo.g.dart | 3 +- .../diary/models/portion.freezed.dart | 71 +-- lib/features/diary/models/portion.g.dart | 6 +- .../diary/models/product.freezed.dart | 35 +- lib/features/diary/models/product.g.dart | 6 +- lib/features/diary/models/state.freezed.dart | 48 +- lib/features/diary/models/state.g.dart | 3 +- .../diary/presentation/bloc/diary_bloc.dart | 2 + .../diary/presentation/bloc/diary_event.dart | 1 + .../bloc/diary_state.freezed.dart | 220 ++++---- .../pages/diary_recommendations_scree.dart | 1 - .../presentation/pages/diary_screen.dart | 4 +- .../diary/services/diary_service.g.dart | 16 +- .../presentation/pages/about_diet_screen.dart | 2 +- lib/features/feed/models/comment_model.dart | 2 +- .../feed/models/comment_model.freezed.dart | 147 +++--- lib/features/feed/models/comment_model.g.dart | 20 +- .../feed/models/diets_pagination_model.dart | 2 +- .../diets_pagination_model.freezed.dart | 369 ++++++-------- .../feed/models/diets_pagination_model.g.dart | 36 +- .../models/feed_blog_post_model.freezed.dart | 129 +++-- .../feed/models/feed_blog_post_model.g.dart | 8 +- .../models/feed_blog_post_settings_model.dart | 2 +- ...feed_blog_post_settings_model.freezed.dart | 79 +-- .../feed_blog_post_settings_model.g.dart | 12 +- .../feed/models/recipes_model.freezed.dart | 202 ++++---- lib/features/feed/models/recipes_model.g.dart | 23 +- .../recipes_pagination_model.freezed.dart | 56 +- .../models/recipes_pagination_model.g.dart | 12 +- .../comments_state.freezed.dart | 83 +-- .../bloc/diets_cubit/diets_state.freezed.dart | 88 +--- .../bloc/feed_cubit/feed_state.freezed.dart | 155 ++---- .../recipes_cubit/recipes_state.freezed.dart | 206 +++----- .../presentation/widgets/diets_widget.dart | 1 - .../presentation/widgets/recipes_widget.dart | 1 - .../feed/repositories/feed_repository.dart | 6 +- .../feed/services/feed_service.g.dart | 4 +- .../menu/presentation/pages/menu_screen.dart | 1 - .../plans/models/plan_pagination_model.dart | 3 +- .../models/plan_pagination_model.freezed.dart | 328 ++++++------ .../plans/models/plan_pagination_model.g.dart | 30 +- .../bloc/plans_cubit/plans_state.freezed.dart | 89 +--- .../plans/services/plans_service.g.dart | 4 +- .../profile/models/profile_model.dart | 1 - .../profile/models/profile_model.freezed.dart | 247 ++++----- .../profile/models/profile_model.g.dart | 34 +- .../profile_cubit/profile_state.freezed.dart | 179 ++----- .../widgets/circumference_chart_widget.dart | 2 +- .../widgets/weight_chart_widget.dart | 2 +- .../profile/services/profile_service.g.dart | 7 +- lib/features/recipes/models/ingredient.dart | 1 - .../recipes/models/ingredient.freezed.dart | 52 +- lib/features/recipes/models/ingredient.g.dart | 6 +- .../recipes/models/recipe_model.freezed.dart | 83 ++- .../recipes/models/recipe_model.g.dart | 16 +- .../recipes/models/recipe_tag_model.dart | 3 +- .../models/recipe_tag_model.freezed.dart | 135 ++--- .../recipes/models/recipe_tag_model.g.dart | 17 +- lib/features/recipes/models/step.dart | 1 - lib/features/recipes/models/step.freezed.dart | 37 +- lib/features/recipes/models/step.g.dart | 3 +- .../bloc/recipe_create_state.freezed.dart | 211 ++++---- .../pages/recipe_edit_screen.dart | 2 + .../recipes/services/recipe_service.g.dart | 10 +- .../registration/models/location_model.dart | 1 + .../models/location_model.freezed.dart | 69 +-- .../registration/models/location_model.g.dart | 9 +- .../models}/user_registration_model.dart | 1 + .../user_registration_model.freezed.dart | 183 +++---- .../models}/user_registration_model.g.dart | 11 +- .../registration_cubit.dart | 2 +- .../registration_state.dart | 2 +- .../registration_state.freezed.dart | 40 +- .../pages/additional_information_screen.dart | 2 +- .../presentation/pages/allergies_screen.dart | 2 +- .../pages/blood_pressure_screen.dart | 2 +- .../pages/body_circumferences_screen.dart | 2 +- .../pages/city_of_living_screen.dart | 2 +- .../pages/credentials_screen.dart | 2 +- .../pages/date_of_birth_screen.dart | 2 +- .../pages/favorite_foods_screen.dart | 2 +- .../pages/favorite_sports_screen.dart | 2 +- .../presentation/pages/gender_screen.dart | 2 +- .../presentation/pages/height_screen.dart | 2 +- .../pages/language_select_screen.dart | 2 +- .../pages/medicine_intake_screen.dart | 2 +- .../presentation/pages/name_screen.dart | 2 +- .../presentation/pages/weight_screen.dart | 2 +- .../repositories/registration_repository.dart | 2 +- .../services/registration_service.g.dart | 7 +- lib/localization/app_localization.dart | 1 + lib/old/auth/auth_screen/auth_screen.dart | 2 + lib/old/auth/auth_screen/bloc/auth_bloc.dart | 1 + .../bloc/diet_create_bloc.dart | 5 +- .../diet_edit_screen/bloc/diet_edit_bloc.dart | 5 +- .../diet_edit_screen/diet_edit_screen.dart | 1 - .../bloc/diet_select_bloc.dart | 5 +- .../diet_select_screen.dart | 1 - .../diet_show_screen/bloc/diet_show_bloc.dart | 5 +- .../diet_show_screen/diet_show_screen.dart | 1 - .../bloc/glossary_screen_bloc.dart | 5 +- .../glossary_screen/glossary_screen.dart | 1 - .../bloc/plan_create_bloc.dart | 5 +- .../plan_edit_screen/bloc/plan_edit_bloc.dart | 5 +- .../plan_edit_screen/plan_edit_screen.dart | 1 - .../bloc/plan_select_bloc.dart | 5 +- .../plan_select_screen.dart | 1 - .../plan_show_screen/bloc/plan_show_bloc.dart | 5 +- .../plan_show_screen/plan_show_screen.dart | 1 - .../bloc/my_profile_bloc.dart | 2 + .../my_profile_screen/my_profile_screen.dart | 1 - .../bloc/recipe_edit_bloc.dart | 1 + .../recipe_edit_screen.dart | 1 - .../bloc/recipe_select_bloc.dart | 1 + .../recipe_select_screen.dart | 1 - .../bloc/recipe_show_bloc.dart | 197 ------- .../bloc/recipe_show_event.dart | 34 -- .../bloc/recipe_show_state.dart | 91 ---- .../models/recipe_show_model.dart | 19 - .../recipe_show_screen.dart | 480 ------------------ .../widgets/comment_widget.dart | 101 ---- .../bloc/subscribers_bloc.dart | 2 + .../subscribers_screen.dart | 5 - .../app_bar/appbar_title_circleimage.dart | 32 -- lib/widgets/app_bar/exit_button.dart | 34 -- lib/widgets/chart_axis.dart | 145 ------ lib/widgets/chart_bars.dart | 79 --- lib/widgets/custom_autocomplete.dart | 80 --- lib/widgets/custom_expandable_list.dart | 1 + lib/widgets/custom_icon_button.dart | 65 --- lib/widgets/custom_navigation_menu_item.dart | 41 -- lib/widgets/nutrition_chart.dart | 89 ---- 182 files changed, 2443 insertions(+), 5482 deletions(-) delete mode 100644 lib/core/errors/exceptions.dart delete mode 100644 lib/core/errors/failures.dart rename lib/core/models/{base_models.dart => pagination_model.dart} (94%) rename lib/core/models/{base_models.freezed.dart => pagination_model.freezed.dart} (82%) rename lib/core/models/{base_models.g.dart => pagination_model.g.dart} (81%) delete mode 100644 lib/core/utils/logger.dart delete mode 100644 lib/core/utils/progress_dialog_utils.dart rename lib/{data/models/userRegistrationModel => features/registration/models}/user_registration_model.dart (99%) rename lib/{data/models/userRegistrationModel => features/registration/models}/user_registration_model.freezed.dart (88%) rename lib/{data/models/userRegistrationModel => features/registration/models}/user_registration_model.g.dart (90%) delete mode 100644 lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart delete mode 100644 lib/old/recipe/recipe_show_screen/bloc/recipe_show_event.dart delete mode 100644 lib/old/recipe/recipe_show_screen/bloc/recipe_show_state.dart delete mode 100644 lib/old/recipe/recipe_show_screen/models/recipe_show_model.dart delete mode 100644 lib/old/recipe/recipe_show_screen/recipe_show_screen.dart delete mode 100644 lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart delete mode 100644 lib/widgets/app_bar/appbar_title_circleimage.dart delete mode 100644 lib/widgets/app_bar/exit_button.dart delete mode 100644 lib/widgets/chart_axis.dart delete mode 100644 lib/widgets/chart_bars.dart delete mode 100644 lib/widgets/custom_autocomplete.dart delete mode 100644 lib/widgets/custom_icon_button.dart delete mode 100644 lib/widgets/custom_navigation_menu_item.dart delete mode 100644 lib/widgets/nutrition_chart.dart diff --git a/lib/app_router.dart b/lib/app_router.dart index 2851b3c6..e0f60978 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -25,7 +25,6 @@ import 'package:eatvio_app/features/registration/presentation/pages/registration import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'package:eatvio_app/old/diets/diet_create_screen/diet_create_screen.dart'; import 'package:eatvio_app/old/diets/diet_select_screen/diet_select_screen.dart'; -import 'package:eatvio_app/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart'; import 'package:eatvio_app/old/glossary/glossary_screen/glossary_screen.dart'; import 'package:eatvio_app/old/plans/plan_select_screen/plan_select_screen.dart'; import 'package:eatvio_app/old/profile/my_profile_screen/my_settings_screen.dart'; @@ -155,14 +154,6 @@ class AppRouter { name: 'blogPostScreen', builder: (context, state) => BlogPostScreen(blogPost: state.extra as FeedBlogPostModel), ), - GoRoute( - path: '/blog-post-edit-screen', - name: 'blogPostEditScreen', - builder: (context, state) => BlogPostEditScreen.builder( - context, - state.extra, - ), - ), GoRoute( path: '/chat-screen', name: 'chatScreen', diff --git a/lib/core/errors/exceptions.dart b/lib/core/errors/exceptions.dart deleted file mode 100644 index 7cbb3f19..00000000 --- a/lib/core/errors/exceptions.dart +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:eatvio_app/main.dart'; -import 'package:flutter/material.dart'; - -class ServerException implements Exception {} - -class CacheException implements Exception {} - -class NetworkException implements Exception {} - -///can be used for throwing [NoInternetException] -class NoInternetException implements Exception { - late String _message; - - NoInternetException([String message = 'NoInternetException Occurred']) { - if (globalMessengerKey.currentState != null) { - globalMessengerKey.currentState!.showSnackBar(SnackBar(content: Text(message))); - } - this._message = message; - } - - @override - String toString() { - return _message; - } -} diff --git a/lib/core/errors/failures.dart b/lib/core/errors/failures.dart deleted file mode 100644 index a96b786a..00000000 --- a/lib/core/errors/failures.dart +++ /dev/null @@ -1,8 +0,0 @@ -abstract class Failure {} - -// General failures -class ServerFailure extends Failure {} - -class CacheFailure extends Failure {} - -class NetworkFailure extends Failure {} diff --git a/lib/core/initialization_cubit/initialization_state.freezed.dart b/lib/core/initialization_cubit/initialization_state.freezed.dart index b0535c68..d9ece2ef 100644 --- a/lib/core/initialization_cubit/initialization_state.freezed.dart +++ b/lib/core/initialization_cubit/initialization_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$InitializationState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,17 @@ mixin _$InitializationState { /// @nodoc abstract class $InitializationStateCopyWith<$Res> { - factory $InitializationStateCopyWith( - InitializationState value, $Res Function(InitializationState) then) = + factory $InitializationStateCopyWith(InitializationState value, $Res Function(InitializationState) then) = _$InitializationStateCopyWithImpl<$Res, InitializationState>; } /// @nodoc -class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> - implements $InitializationStateCopyWith<$Res> { +class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> implements $InitializationStateCopyWith<$Res> { _$InitializationStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +91,14 @@ class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> /// @nodoc abstract class _$$InitializationStateImplCopyWith<$Res> { - factory _$$InitializationStateImplCopyWith(_$InitializationStateImpl value, - $Res Function(_$InitializationStateImpl) then) = + factory _$$InitializationStateImplCopyWith(_$InitializationStateImpl value, $Res Function(_$InitializationStateImpl) then) = __$$InitializationStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitializationStateImplCopyWithImpl<$Res> - extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateImpl> +class __$$InitializationStateImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateImpl> implements _$$InitializationStateImplCopyWith<$Res> { - __$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value, - $Res Function(_$InitializationStateImpl) _then) - : super(_value, _then); + __$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value, $Res Function(_$InitializationStateImpl) _then) : super(_value, _then); /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @@ -120,9 +116,7 @@ class _$InitializationStateImpl implements _InitializationState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$InitializationStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateImpl); } @override @@ -209,20 +203,14 @@ abstract class _InitializationState implements InitializationState { /// @nodoc abstract class _$$InitializationStateLoadingImplCopyWith<$Res> { - factory _$$InitializationStateLoadingImplCopyWith( - _$InitializationStateLoadingImpl value, - $Res Function(_$InitializationStateLoadingImpl) then) = + factory _$$InitializationStateLoadingImplCopyWith(_$InitializationStateLoadingImpl value, $Res Function(_$InitializationStateLoadingImpl) then) = __$$InitializationStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitializationStateLoadingImplCopyWithImpl<$Res> - extends _$InitializationStateCopyWithImpl<$Res, - _$InitializationStateLoadingImpl> +class __$$InitializationStateLoadingImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateLoadingImpl> implements _$$InitializationStateLoadingImplCopyWith<$Res> { - __$$InitializationStateLoadingImplCopyWithImpl( - _$InitializationStateLoadingImpl _value, - $Res Function(_$InitializationStateLoadingImpl) _then) + __$$InitializationStateLoadingImplCopyWithImpl(_$InitializationStateLoadingImpl _value, $Res Function(_$InitializationStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -241,9 +229,7 @@ class _$InitializationStateLoadingImpl implements InitializationStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$InitializationStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateLoadingImpl); } @override @@ -330,22 +316,17 @@ abstract class InitializationStateLoading implements InitializationState { /// @nodoc abstract class _$$InitializationStateSuccessImplCopyWith<$Res> { - factory _$$InitializationStateSuccessImplCopyWith( - _$InitializationStateSuccessImpl value, - $Res Function(_$InitializationStateSuccessImpl) then) = + factory _$$InitializationStateSuccessImplCopyWith(_$InitializationStateSuccessImpl value, $Res Function(_$InitializationStateSuccessImpl) then) = __$$InitializationStateSuccessImplCopyWithImpl<$Res>; + @useResult $Res call({PusherChannelsClient client}); } /// @nodoc -class __$$InitializationStateSuccessImplCopyWithImpl<$Res> - extends _$InitializationStateCopyWithImpl<$Res, - _$InitializationStateSuccessImpl> +class __$$InitializationStateSuccessImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateSuccessImpl> implements _$$InitializationStateSuccessImplCopyWith<$Res> { - __$$InitializationStateSuccessImplCopyWithImpl( - _$InitializationStateSuccessImpl _value, - $Res Function(_$InitializationStateSuccessImpl) _then) + __$$InitializationStateSuccessImplCopyWithImpl(_$InitializationStateSuccessImpl _value, $Res Function(_$InitializationStateSuccessImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -380,9 +361,7 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$InitializationStateSuccessImpl && - (identical(other.client, client) || other.client == client)); + (other.runtimeType == runtimeType && other is _$InitializationStateSuccessImpl && (identical(other.client, client) || other.client == client)); } @override @@ -393,9 +372,8 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> - get copyWith => __$$InitializationStateSuccessImplCopyWithImpl< - _$InitializationStateSuccessImpl>(this, _$identity); + _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => + __$$InitializationStateSuccessImplCopyWithImpl<_$InitializationStateSuccessImpl>(this, _$identity); @override @optionalTypeArgs @@ -473,37 +451,29 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { } abstract class InitializationStateSuccess implements InitializationState { - const factory InitializationStateSuccess( - {required final PusherChannelsClient client}) = - _$InitializationStateSuccessImpl; + const factory InitializationStateSuccess({required final PusherChannelsClient client}) = _$InitializationStateSuccessImpl; PusherChannelsClient get client; /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> - get copyWith => throw _privateConstructorUsedError; + _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$InitializationStateErrorImplCopyWith<$Res> { - factory _$$InitializationStateErrorImplCopyWith( - _$InitializationStateErrorImpl value, - $Res Function(_$InitializationStateErrorImpl) then) = + factory _$$InitializationStateErrorImplCopyWith(_$InitializationStateErrorImpl value, $Res Function(_$InitializationStateErrorImpl) then) = __$$InitializationStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$InitializationStateErrorImplCopyWithImpl<$Res> - extends _$InitializationStateCopyWithImpl<$Res, - _$InitializationStateErrorImpl> +class __$$InitializationStateErrorImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateErrorImpl> implements _$$InitializationStateErrorImplCopyWith<$Res> { - __$$InitializationStateErrorImplCopyWithImpl( - _$InitializationStateErrorImpl _value, - $Res Function(_$InitializationStateErrorImpl) _then) + __$$InitializationStateErrorImplCopyWithImpl(_$InitializationStateErrorImpl _value, $Res Function(_$InitializationStateErrorImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -540,8 +510,7 @@ class _$InitializationStateErrorImpl implements InitializationStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -552,9 +521,8 @@ class _$InitializationStateErrorImpl implements InitializationStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> - get copyWith => __$$InitializationStateErrorImplCopyWithImpl< - _$InitializationStateErrorImpl>(this, _$identity); + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => + __$$InitializationStateErrorImplCopyWithImpl<_$InitializationStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -632,14 +600,12 @@ class _$InitializationStateErrorImpl implements InitializationStateError { } abstract class InitializationStateError implements InitializationState { - const factory InitializationStateError({required final String errorMessage}) = - _$InitializationStateErrorImpl; + const factory InitializationStateError({required final String errorMessage}) = _$InitializationStateErrorImpl; String get errorMessage; /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/models/base_models.dart b/lib/core/models/pagination_model.dart similarity index 94% rename from lib/core/models/base_models.dart rename to lib/core/models/pagination_model.dart index 1f6e04d5..d54863b6 100644 --- a/lib/core/models/base_models.dart +++ b/lib/core/models/pagination_model.dart @@ -1,7 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; -part 'base_models.freezed.dart'; -part 'base_models.g.dart'; +part 'pagination_model.freezed.dart'; +part 'pagination_model.g.dart'; @freezed class Links with _$Links { diff --git a/lib/core/models/base_models.freezed.dart b/lib/core/models/pagination_model.freezed.dart similarity index 82% rename from lib/core/models/base_models.freezed.dart rename to lib/core/models/pagination_model.freezed.dart index 8abf29f4..692c6ef3 100644 --- a/lib/core/models/base_models.freezed.dart +++ b/lib/core/models/pagination_model.freezed.dart @@ -3,7 +3,7 @@ // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark -part of 'base_models.dart'; +part of 'pagination_model.dart'; // ************************************************************************** // FreezedGenerator @@ -22,10 +22,13 @@ Links _$LinksFromJson(Map json) { mixin _$Links { @JsonKey(name: "first") String get first => throw _privateConstructorUsedError; + @JsonKey(name: "last") String get last => throw _privateConstructorUsedError; + @JsonKey(name: "prev") dynamic get prev => throw _privateConstructorUsedError; + @JsonKey(name: "next") dynamic get next => throw _privateConstructorUsedError; @@ -40,23 +43,20 @@ mixin _$Links { /// @nodoc abstract class $LinksCopyWith<$Res> { - factory $LinksCopyWith(Links value, $Res Function(Links) then) = - _$LinksCopyWithImpl<$Res, Links>; + factory $LinksCopyWith(Links value, $Res Function(Links) then) = _$LinksCopyWithImpl<$Res, Links>; + @useResult $Res call( - {@JsonKey(name: "first") String first, - @JsonKey(name: "last") String last, - @JsonKey(name: "prev") dynamic prev, - @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); } /// @nodoc -class _$LinksCopyWithImpl<$Res, $Val extends Links> - implements $LinksCopyWith<$Res> { +class _$LinksCopyWithImpl<$Res, $Val extends Links> implements $LinksCopyWith<$Res> { _$LinksCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -93,25 +93,17 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links> /// @nodoc abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$Res> { - factory _$$LinksImplCopyWith( - _$LinksImpl value, $Res Function(_$LinksImpl) then) = - __$$LinksImplCopyWithImpl<$Res>; + factory _$$LinksImplCopyWith(_$LinksImpl value, $Res Function(_$LinksImpl) then) = __$$LinksImplCopyWithImpl<$Res>; + @override @useResult $Res call( - {@JsonKey(name: "first") String first, - @JsonKey(name: "last") String last, - @JsonKey(name: "prev") dynamic prev, - @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); } /// @nodoc -class __$$LinksImplCopyWithImpl<$Res> - extends _$LinksCopyWithImpl<$Res, _$LinksImpl> - implements _$$LinksImplCopyWith<$Res> { - __$$LinksImplCopyWithImpl( - _$LinksImpl _value, $Res Function(_$LinksImpl) _then) - : super(_value, _then); +class __$$LinksImplCopyWithImpl<$Res> extends _$LinksCopyWithImpl<$Res, _$LinksImpl> implements _$$LinksImplCopyWith<$Res> { + __$$LinksImplCopyWithImpl(_$LinksImpl _value, $Res Function(_$LinksImpl) _then) : super(_value, _then); /// Create a copy of Links /// with the given fields replaced by the non-null parameter values. @@ -153,8 +145,7 @@ class _$LinksImpl implements _Links { @JsonKey(name: "prev") required this.prev, @JsonKey(name: "next") required this.next}); - factory _$LinksImpl.fromJson(Map json) => - _$$LinksImplFromJson(json); + factory _$LinksImpl.fromJson(Map json) => _$$LinksImplFromJson(json); @override @JsonKey(name: "first") @@ -187,20 +178,14 @@ class _$LinksImpl implements _Links { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - first, - last, - const DeepCollectionEquality().hash(prev), - const DeepCollectionEquality().hash(next)); + int get hashCode => Object.hash(runtimeType, first, last, const DeepCollectionEquality().hash(prev), const DeepCollectionEquality().hash(next)); /// Create a copy of Links /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => - __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); @override Map toJson() { @@ -222,12 +207,15 @@ abstract class _Links implements Links { @override @JsonKey(name: "first") String get first; + @override @JsonKey(name: "last") String get last; + @override @JsonKey(name: "prev") dynamic get prev; + @override @JsonKey(name: "next") dynamic get next; @@ -236,8 +224,7 @@ abstract class _Links implements Links { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => throw _privateConstructorUsedError; } Meta _$MetaFromJson(Map json) { @@ -248,18 +235,25 @@ Meta _$MetaFromJson(Map json) { mixin _$Meta { @JsonKey(name: "current_page") int get currentPage => throw _privateConstructorUsedError; + @JsonKey(name: "from") dynamic get from => throw _privateConstructorUsedError; + @JsonKey(name: "last_page") int get lastPage => throw _privateConstructorUsedError; + @JsonKey(name: "links") List get links => throw _privateConstructorUsedError; + @JsonKey(name: "path") String? get path => throw _privateConstructorUsedError; + @JsonKey(name: "per_page") int get perPage => throw _privateConstructorUsedError; + @JsonKey(name: "to") dynamic get to => throw _privateConstructorUsedError; + @JsonKey(name: "total") int get total => throw _privateConstructorUsedError; @@ -274,8 +268,8 @@ mixin _$Meta { /// @nodoc abstract class $MetaCopyWith<$Res> { - factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = - _$MetaCopyWithImpl<$Res, Meta>; + factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = _$MetaCopyWithImpl<$Res, Meta>; + @useResult $Res call( {@JsonKey(name: "current_page") int currentPage, @@ -289,12 +283,12 @@ abstract class $MetaCopyWith<$Res> { } /// @nodoc -class _$MetaCopyWithImpl<$Res, $Val extends Meta> - implements $MetaCopyWith<$Res> { +class _$MetaCopyWithImpl<$Res, $Val extends Meta> implements $MetaCopyWith<$Res> { _$MetaCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -351,9 +345,8 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> /// @nodoc abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { - factory _$$MetaImplCopyWith( - _$MetaImpl value, $Res Function(_$MetaImpl) then) = - __$$MetaImplCopyWithImpl<$Res>; + factory _$$MetaImplCopyWith(_$MetaImpl value, $Res Function(_$MetaImpl) then) = __$$MetaImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -368,11 +361,8 @@ abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { } /// @nodoc -class __$$MetaImplCopyWithImpl<$Res> - extends _$MetaCopyWithImpl<$Res, _$MetaImpl> - implements _$$MetaImplCopyWith<$Res> { - __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) - : super(_value, _then); +class __$$MetaImplCopyWithImpl<$Res> extends _$MetaCopyWithImpl<$Res, _$MetaImpl> implements _$$MetaImplCopyWith<$Res> { + __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) : super(_value, _then); /// Create a copy of Meta /// with the given fields replaced by the non-null parameter values. @@ -439,8 +429,7 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "total") required this.total}) : _links = links; - factory _$MetaImpl.fromJson(Map json) => - _$$MetaImplFromJson(json); + factory _$MetaImpl.fromJson(Map json) => _$$MetaImplFromJson(json); @override @JsonKey(name: "current_page") @@ -452,6 +441,7 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "last_page") final int lastPage; final List _links; + @override @JsonKey(name: "links") List get links { @@ -483,11 +473,9 @@ class _$MetaImpl implements _Meta { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MetaImpl && - (identical(other.currentPage, currentPage) || - other.currentPage == currentPage) && + (identical(other.currentPage, currentPage) || other.currentPage == currentPage) && const DeepCollectionEquality().equals(other.from, from) && - (identical(other.lastPage, lastPage) || - other.lastPage == lastPage) && + (identical(other.lastPage, lastPage) || other.lastPage == lastPage) && const DeepCollectionEquality().equals(other._links, _links) && (identical(other.path, path) || other.path == path) && (identical(other.perPage, perPage) || other.perPage == perPage) && @@ -497,24 +485,15 @@ class _$MetaImpl implements _Meta { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - currentPage, - const DeepCollectionEquality().hash(from), - lastPage, - const DeepCollectionEquality().hash(_links), - path, - perPage, - const DeepCollectionEquality().hash(to), - total); + int get hashCode => Object.hash(runtimeType, currentPage, const DeepCollectionEquality().hash(from), lastPage, const DeepCollectionEquality().hash(_links), + path, perPage, const DeepCollectionEquality().hash(to), total); /// Create a copy of Meta /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => - __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); @override Map toJson() { @@ -540,24 +519,31 @@ abstract class _Meta implements Meta { @override @JsonKey(name: "current_page") int get currentPage; + @override @JsonKey(name: "from") dynamic get from; + @override @JsonKey(name: "last_page") int get lastPage; + @override @JsonKey(name: "links") List get links; + @override @JsonKey(name: "path") String? get path; + @override @JsonKey(name: "per_page") int get perPage; + @override @JsonKey(name: "to") dynamic get to; + @override @JsonKey(name: "total") int get total; @@ -566,8 +552,7 @@ abstract class _Meta implements Meta { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => - throw _privateConstructorUsedError; + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => throw _privateConstructorUsedError; } Link _$LinkFromJson(Map json) { @@ -578,8 +563,10 @@ Link _$LinkFromJson(Map json) { mixin _$Link { @JsonKey(name: "url") String? get url => throw _privateConstructorUsedError; + @JsonKey(name: "label") String? get label => throw _privateConstructorUsedError; + @JsonKey(name: "active") bool? get active => throw _privateConstructorUsedError; @@ -594,22 +581,19 @@ mixin _$Link { /// @nodoc abstract class $LinkCopyWith<$Res> { - factory $LinkCopyWith(Link value, $Res Function(Link) then) = - _$LinkCopyWithImpl<$Res, Link>; + factory $LinkCopyWith(Link value, $Res Function(Link) then) = _$LinkCopyWithImpl<$Res, Link>; + @useResult - $Res call( - {@JsonKey(name: "url") String? url, - @JsonKey(name: "label") String? label, - @JsonKey(name: "active") bool? active}); + $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String? label, @JsonKey(name: "active") bool? active}); } /// @nodoc -class _$LinkCopyWithImpl<$Res, $Val extends Link> - implements $LinkCopyWith<$Res> { +class _$LinkCopyWithImpl<$Res, $Val extends Link> implements $LinkCopyWith<$Res> { _$LinkCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -641,23 +625,16 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link> /// @nodoc abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> { - factory _$$LinkImplCopyWith( - _$LinkImpl value, $Res Function(_$LinkImpl) then) = - __$$LinkImplCopyWithImpl<$Res>; + factory _$$LinkImplCopyWith(_$LinkImpl value, $Res Function(_$LinkImpl) then) = __$$LinkImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "url") String? url, - @JsonKey(name: "label") String? label, - @JsonKey(name: "active") bool? active}); + $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String? label, @JsonKey(name: "active") bool? active}); } /// @nodoc -class __$$LinkImplCopyWithImpl<$Res> - extends _$LinkCopyWithImpl<$Res, _$LinkImpl> - implements _$$LinkImplCopyWith<$Res> { - __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) - : super(_value, _then); +class __$$LinkImplCopyWithImpl<$Res> extends _$LinkCopyWithImpl<$Res, _$LinkImpl> implements _$$LinkImplCopyWith<$Res> { + __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) : super(_value, _then); /// Create a copy of Link /// with the given fields replaced by the non-null parameter values. @@ -688,13 +665,9 @@ class __$$LinkImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$LinkImpl implements _Link { - const _$LinkImpl( - {@JsonKey(name: "url") this.url, - @JsonKey(name: "label") this.label, - @JsonKey(name: "active") this.active}); + const _$LinkImpl({@JsonKey(name: "url") this.url, @JsonKey(name: "label") this.label, @JsonKey(name: "active") this.active}); - factory _$LinkImpl.fromJson(Map json) => - _$$LinkImplFromJson(json); + factory _$LinkImpl.fromJson(Map json) => _$$LinkImplFromJson(json); @override @JsonKey(name: "url") @@ -730,8 +703,7 @@ class _$LinkImpl implements _Link { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => - __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); @override Map toJson() { @@ -742,19 +714,19 @@ class _$LinkImpl implements _Link { } abstract class _Link implements Link { - const factory _Link( - {@JsonKey(name: "url") final String? url, - @JsonKey(name: "label") final String? label, - @JsonKey(name: "active") final bool? active}) = _$LinkImpl; + const factory _Link({@JsonKey(name: "url") final String? url, @JsonKey(name: "label") final String? label, @JsonKey(name: "active") final bool? active}) = + _$LinkImpl; factory _Link.fromJson(Map json) = _$LinkImpl.fromJson; @override @JsonKey(name: "url") String? get url; + @override @JsonKey(name: "label") String? get label; + @override @JsonKey(name: "active") bool? get active; @@ -763,6 +735,5 @@ abstract class _Link implements Link { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/models/base_models.g.dart b/lib/core/models/pagination_model.g.dart similarity index 81% rename from lib/core/models/base_models.g.dart rename to lib/core/models/pagination_model.g.dart index ada8e71f..d0baeab8 100644 --- a/lib/core/models/base_models.g.dart +++ b/lib/core/models/pagination_model.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'base_models.dart'; +part of 'pagination_model.dart'; // ************************************************************************** // JsonSerializableGenerator @@ -13,8 +13,7 @@ _$LinksImpl _$$LinksImplFromJson(Map json) => _$LinksImpl( next: json['next'], ); -Map _$$LinksImplToJson(_$LinksImpl instance) => - { +Map _$$LinksImplToJson(_$LinksImpl instance) => { 'first': instance.first, 'last': instance.last, 'prev': instance.prev, @@ -25,17 +24,14 @@ _$MetaImpl _$$MetaImplFromJson(Map json) => _$MetaImpl( currentPage: (json['current_page'] as num).toInt(), from: json['from'], lastPage: (json['last_page'] as num).toInt(), - links: (json['links'] as List) - .map((e) => Link.fromJson(e as Map)) - .toList(), + links: (json['links'] as List).map((e) => Link.fromJson(e as Map)).toList(), path: json['path'] as String?, perPage: (json['per_page'] as num).toInt(), to: json['to'], total: (json['total'] as num).toInt(), ); -Map _$$MetaImplToJson(_$MetaImpl instance) => - { +Map _$$MetaImplToJson(_$MetaImpl instance) => { 'current_page': instance.currentPage, 'from': instance.from, 'last_page': instance.lastPage, @@ -52,8 +48,7 @@ _$LinkImpl _$$LinkImplFromJson(Map json) => _$LinkImpl( active: json['active'] as bool?, ); -Map _$$LinkImplToJson(_$LinkImpl instance) => - { +Map _$$LinkImplToJson(_$LinkImpl instance) => { 'url': instance.url, 'label': instance.label, 'active': instance.active, diff --git a/lib/core/utils/logger.dart b/lib/core/utils/logger.dart deleted file mode 100644 index dab50c2a..00000000 --- a/lib/core/utils/logger.dart +++ /dev/null @@ -1,15 +0,0 @@ -class Logger { - static LogMode _logMode = LogMode.debug; - - static void init(LogMode mode) { - Logger._logMode = mode; - } - - static void log(dynamic data, {StackTrace? stackTrace}) { - if (_logMode == LogMode.debug) { - print("Error: $data$stackTrace"); - } - } -} - -enum LogMode { debug, live } diff --git a/lib/core/utils/progress_dialog_utils.dart b/lib/core/utils/progress_dialog_utils.dart deleted file mode 100644 index ced3347c..00000000 --- a/lib/core/utils/progress_dialog_utils.dart +++ /dev/null @@ -1,33 +0,0 @@ -import 'package:eatvio_app/app_router.dart'; -import 'package:flutter/material.dart'; - -class ProgressDialogUtils { - static bool isProgressVisible = false; - - ///common method for showing progress dialog - static void showProgressDialog({BuildContext? context, isCancellable = false}) async { - if (!isProgressVisible && AppRouter.navigatorKey.currentState?.overlay?.context != null) { - showDialog( - barrierDismissible: isCancellable, - context: AppRouter.navigatorKey.currentState!.overlay!.context, - builder: (BuildContext context) { - return Center( - child: CircularProgressIndicator.adaptive( - strokeWidth: 4, - valueColor: AlwaysStoppedAnimation( - Colors.white, - ), - ), - ); - }, - ); - isProgressVisible = true; - } - } - - ///common method for hiding progress dialog - static void hideProgressDialog() { - if (isProgressVisible) Navigator.pop(AppRouter.navigatorKey.currentState!.overlay!.context); - isProgressVisible = false; - } -} diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart index 97ab368c..46367fd1 100644 --- a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart +++ b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart @@ -17,33 +17,35 @@ final _privateConstructorUsedError = UnsupportedError( /// @nodoc mixin _$SelectionPopupModel { int? get id => throw _privateConstructorUsedError; + String get title => throw _privateConstructorUsedError; + dynamic get value => throw _privateConstructorUsedError; + bool get isSelected => throw _privateConstructorUsedError; /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $SelectionPopupModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $SelectionPopupModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $SelectionPopupModelCopyWith<$Res> { - factory $SelectionPopupModelCopyWith( - SelectionPopupModel value, $Res Function(SelectionPopupModel) then) = + factory $SelectionPopupModelCopyWith(SelectionPopupModel value, $Res Function(SelectionPopupModel) then) = _$SelectionPopupModelCopyWithImpl<$Res, SelectionPopupModel>; + @useResult $Res call({int? id, String title, dynamic value, bool isSelected}); } /// @nodoc -class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> - implements $SelectionPopupModelCopyWith<$Res> { +class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> implements $SelectionPopupModelCopyWith<$Res> { _$SelectionPopupModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -79,23 +81,19 @@ class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> } /// @nodoc -abstract class _$$SelectionPopupModelImplCopyWith<$Res> - implements $SelectionPopupModelCopyWith<$Res> { - factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value, - $Res Function(_$SelectionPopupModelImpl) then) = +abstract class _$$SelectionPopupModelImplCopyWith<$Res> implements $SelectionPopupModelCopyWith<$Res> { + factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value, $Res Function(_$SelectionPopupModelImpl) then) = __$$SelectionPopupModelImplCopyWithImpl<$Res>; + @override @useResult $Res call({int? id, String title, dynamic value, bool isSelected}); } /// @nodoc -class __$$SelectionPopupModelImplCopyWithImpl<$Res> - extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl> +class __$$SelectionPopupModelImplCopyWithImpl<$Res> extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl> implements _$$SelectionPopupModelImplCopyWith<$Res> { - __$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value, - $Res Function(_$SelectionPopupModelImpl) _then) - : super(_value, _then); + __$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value, $Res Function(_$SelectionPopupModelImpl) _then) : super(_value, _then); /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @@ -131,8 +129,7 @@ class __$$SelectionPopupModelImplCopyWithImpl<$Res> /// @nodoc class _$SelectionPopupModelImpl implements _SelectionPopupModel { - const _$SelectionPopupModelImpl( - {this.id, required this.title, this.value, this.isSelected = false}); + const _$SelectionPopupModelImpl({this.id, required this.title, this.value, this.isSelected = false}); @override final int? id; @@ -157,13 +154,11 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && const DeepCollectionEquality().equals(other.value, value) && - (identical(other.isSelected, isSelected) || - other.isSelected == isSelected)); + (identical(other.isSelected, isSelected) || other.isSelected == isSelected)); } @override - int get hashCode => Object.hash(runtimeType, id, title, - const DeepCollectionEquality().hash(value), isSelected); + int get hashCode => Object.hash(runtimeType, id, title, const DeepCollectionEquality().hash(value), isSelected); /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @@ -171,23 +166,21 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { @override @pragma('vm:prefer-inline') _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => - __$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>( - this, _$identity); + __$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>(this, _$identity); } abstract class _SelectionPopupModel implements SelectionPopupModel { - const factory _SelectionPopupModel( - {final int? id, - required final String title, - final dynamic value, - final bool isSelected}) = _$SelectionPopupModelImpl; + const factory _SelectionPopupModel({final int? id, required final String title, final dynamic value, final bool isSelected}) = _$SelectionPopupModelImpl; @override int? get id; + @override String get title; + @override dynamic get value; + @override bool get isSelected; @@ -195,6 +188,5 @@ abstract class _SelectionPopupModel implements SelectionPopupModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart index 7c5d7ffd..433a7e15 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$NewMessagesState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ mixin _$NewMessagesState { /// @nodoc abstract class $NewMessagesStateCopyWith<$Res> { - factory $NewMessagesStateCopyWith( - NewMessagesState value, $Res Function(NewMessagesState) then) = - _$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>; + factory $NewMessagesStateCopyWith(NewMessagesState value, $Res Function(NewMessagesState) then) = _$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>; } /// @nodoc -class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> - implements $NewMessagesStateCopyWith<$Res> { +class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> implements $NewMessagesStateCopyWith<$Res> { _$NewMessagesStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +90,14 @@ class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> /// @nodoc abstract class _$$NewMessagesStateImplCopyWith<$Res> { - factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value, - $Res Function(_$NewMessagesStateImpl) then) = + factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value, $Res Function(_$NewMessagesStateImpl) then) = __$$NewMessagesStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NewMessagesStateImplCopyWithImpl<$Res> - extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl> +class __$$NewMessagesStateImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl> implements _$$NewMessagesStateImplCopyWith<$Res> { - __$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value, - $Res Function(_$NewMessagesStateImpl) _then) - : super(_value, _then); + __$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value, $Res Function(_$NewMessagesStateImpl) _then) : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -120,8 +115,7 @@ class _$NewMessagesStateImpl implements _NewMessagesState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$NewMessagesStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateImpl); } @override @@ -208,19 +202,14 @@ abstract class _NewMessagesState implements NewMessagesState { /// @nodoc abstract class _$$NewMessagesStateEmptyImplCopyWith<$Res> { - factory _$$NewMessagesStateEmptyImplCopyWith( - _$NewMessagesStateEmptyImpl value, - $Res Function(_$NewMessagesStateEmptyImpl) then) = + factory _$$NewMessagesStateEmptyImplCopyWith(_$NewMessagesStateEmptyImpl value, $Res Function(_$NewMessagesStateEmptyImpl) then) = __$$NewMessagesStateEmptyImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res> - extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl> +class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl> implements _$$NewMessagesStateEmptyImplCopyWith<$Res> { - __$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value, - $Res Function(_$NewMessagesStateEmptyImpl) _then) - : super(_value, _then); + __$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value, $Res Function(_$NewMessagesStateEmptyImpl) _then) : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -238,9 +227,7 @@ class _$NewMessagesStateEmptyImpl implements NewMessagesStateEmpty { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$NewMessagesStateEmptyImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateEmptyImpl); } @override @@ -327,22 +314,17 @@ abstract class NewMessagesStateEmpty implements NewMessagesState { /// @nodoc abstract class _$$NewMessagesStateLoadedImplCopyWith<$Res> { - factory _$$NewMessagesStateLoadedImplCopyWith( - _$NewMessagesStateLoadedImpl value, - $Res Function(_$NewMessagesStateLoadedImpl) then) = + factory _$$NewMessagesStateLoadedImplCopyWith(_$NewMessagesStateLoadedImpl value, $Res Function(_$NewMessagesStateLoadedImpl) then) = __$$NewMessagesStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({int messagesCount}); } /// @nodoc -class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res> - extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl> +class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl> implements _$$NewMessagesStateLoadedImplCopyWith<$Res> { - __$$NewMessagesStateLoadedImplCopyWithImpl( - _$NewMessagesStateLoadedImpl _value, - $Res Function(_$NewMessagesStateLoadedImpl) _then) - : super(_value, _then); + __$$NewMessagesStateLoadedImplCopyWithImpl(_$NewMessagesStateLoadedImpl _value, $Res Function(_$NewMessagesStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -378,8 +360,7 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateLoadedImpl && - (identical(other.messagesCount, messagesCount) || - other.messagesCount == messagesCount)); + (identical(other.messagesCount, messagesCount) || other.messagesCount == messagesCount)); } @override @@ -390,9 +371,8 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> - get copyWith => __$$NewMessagesStateLoadedImplCopyWithImpl< - _$NewMessagesStateLoadedImpl>(this, _$identity); + _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => + __$$NewMessagesStateLoadedImplCopyWithImpl<_$NewMessagesStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -470,35 +450,29 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { } abstract class NewMessagesStateLoaded implements NewMessagesState { - const factory NewMessagesStateLoaded({required final int messagesCount}) = - _$NewMessagesStateLoadedImpl; + const factory NewMessagesStateLoaded({required final int messagesCount}) = _$NewMessagesStateLoadedImpl; int get messagesCount; /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> - get copyWith => throw _privateConstructorUsedError; + _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$NewMessagesStateErrorImplCopyWith<$Res> { - factory _$$NewMessagesStateErrorImplCopyWith( - _$NewMessagesStateErrorImpl value, - $Res Function(_$NewMessagesStateErrorImpl) then) = + factory _$$NewMessagesStateErrorImplCopyWith(_$NewMessagesStateErrorImpl value, $Res Function(_$NewMessagesStateErrorImpl) then) = __$$NewMessagesStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$NewMessagesStateErrorImplCopyWithImpl<$Res> - extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl> +class __$$NewMessagesStateErrorImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl> implements _$$NewMessagesStateErrorImplCopyWith<$Res> { - __$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value, - $Res Function(_$NewMessagesStateErrorImpl) _then) - : super(_value, _then); + __$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value, $Res Function(_$NewMessagesStateErrorImpl) _then) : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -534,8 +508,7 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -546,9 +519,8 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> - get copyWith => __$$NewMessagesStateErrorImplCopyWithImpl< - _$NewMessagesStateErrorImpl>(this, _$identity); + _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => + __$$NewMessagesStateErrorImplCopyWithImpl<_$NewMessagesStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -626,14 +598,12 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { } abstract class NewMessagesStateError implements NewMessagesState { - const factory NewMessagesStateError({required final String errorMessage}) = - _$NewMessagesStateErrorImpl; + const factory NewMessagesStateError({required final String errorMessage}) = _$NewMessagesStateErrorImpl; String get errorMessage; /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart index d634b318..6fa44e3d 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart @@ -20,18 +20,16 @@ mixin _$NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function( - List notifications, int notificationsCount) - loaded, + required TResult Function(List notifications, int notificationsCount) loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? - loaded, + TResult? Function(List notifications, int notificationsCount)? loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -39,8 +37,7 @@ mixin _$NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? - loaded, + TResult Function(List notifications, int notificationsCount)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -74,18 +71,17 @@ mixin _$NotificationsState { /// @nodoc abstract class $NotificationsStateCopyWith<$Res> { - factory $NotificationsStateCopyWith( - NotificationsState value, $Res Function(NotificationsState) then) = + factory $NotificationsStateCopyWith(NotificationsState value, $Res Function(NotificationsState) then) = _$NotificationsStateCopyWithImpl<$Res, NotificationsState>; } /// @nodoc -class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> - implements $NotificationsStateCopyWith<$Res> { +class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> implements $NotificationsStateCopyWith<$Res> { _$NotificationsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -95,18 +91,14 @@ class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> /// @nodoc abstract class _$$NotificationsStateImplCopyWith<$Res> { - factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value, - $Res Function(_$NotificationsStateImpl) then) = + factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value, $Res Function(_$NotificationsStateImpl) then) = __$$NotificationsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NotificationsStateImplCopyWithImpl<$Res> - extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl> +class __$$NotificationsStateImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl> implements _$$NotificationsStateImplCopyWith<$Res> { - __$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value, - $Res Function(_$NotificationsStateImpl) _then) - : super(_value, _then); + __$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value, $Res Function(_$NotificationsStateImpl) _then) : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -124,8 +116,7 @@ class _$NotificationsStateImpl implements _NotificationsState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$NotificationsStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateImpl); } @override @@ -136,9 +127,7 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function( - List notifications, int notificationsCount) - loaded, + required TResult Function(List notifications, int notificationsCount) loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -149,8 +138,7 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? - loaded, + TResult? Function(List notifications, int notificationsCount)? loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -161,8 +149,7 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? - loaded, + TResult Function(List notifications, int notificationsCount)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -216,21 +203,14 @@ abstract class _NotificationsState implements NotificationsState { /// @nodoc abstract class _$$NotificationsStateEmptyImplCopyWith<$Res> { - factory _$$NotificationsStateEmptyImplCopyWith( - _$NotificationsStateEmptyImpl value, - $Res Function(_$NotificationsStateEmptyImpl) then) = + factory _$$NotificationsStateEmptyImplCopyWith(_$NotificationsStateEmptyImpl value, $Res Function(_$NotificationsStateEmptyImpl) then) = __$$NotificationsStateEmptyImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NotificationsStateEmptyImplCopyWithImpl<$Res> - extends _$NotificationsStateCopyWithImpl<$Res, - _$NotificationsStateEmptyImpl> +class __$$NotificationsStateEmptyImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateEmptyImpl> implements _$$NotificationsStateEmptyImplCopyWith<$Res> { - __$$NotificationsStateEmptyImplCopyWithImpl( - _$NotificationsStateEmptyImpl _value, - $Res Function(_$NotificationsStateEmptyImpl) _then) - : super(_value, _then); + __$$NotificationsStateEmptyImplCopyWithImpl(_$NotificationsStateEmptyImpl _value, $Res Function(_$NotificationsStateEmptyImpl) _then) : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -248,9 +228,7 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$NotificationsStateEmptyImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateEmptyImpl); } @override @@ -261,9 +239,7 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function( - List notifications, int notificationsCount) - loaded, + required TResult Function(List notifications, int notificationsCount) loaded, required TResult Function(String errorMessage) error, }) { return empty(); @@ -274,8 +250,7 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? - loaded, + TResult? Function(List notifications, int notificationsCount)? loaded, TResult? Function(String errorMessage)? error, }) { return empty?.call(); @@ -286,8 +261,7 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? - loaded, + TResult Function(List notifications, int notificationsCount)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -341,22 +315,17 @@ abstract class NotificationsStateEmpty implements NotificationsState { /// @nodoc abstract class _$$NotificationsStateLoadedImplCopyWith<$Res> { - factory _$$NotificationsStateLoadedImplCopyWith( - _$NotificationsStateLoadedImpl value, - $Res Function(_$NotificationsStateLoadedImpl) then) = + factory _$$NotificationsStateLoadedImplCopyWith(_$NotificationsStateLoadedImpl value, $Res Function(_$NotificationsStateLoadedImpl) then) = __$$NotificationsStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({List notifications, int notificationsCount}); } /// @nodoc -class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> - extends _$NotificationsStateCopyWithImpl<$Res, - _$NotificationsStateLoadedImpl> +class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateLoadedImpl> implements _$$NotificationsStateLoadedImplCopyWith<$Res> { - __$$NotificationsStateLoadedImplCopyWithImpl( - _$NotificationsStateLoadedImpl _value, - $Res Function(_$NotificationsStateLoadedImpl) _then) + __$$NotificationsStateLoadedImplCopyWithImpl(_$NotificationsStateLoadedImpl _value, $Res Function(_$NotificationsStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of NotificationsState @@ -383,12 +352,10 @@ class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { - const _$NotificationsStateLoadedImpl( - {required final List notifications, - required this.notificationsCount}) - : _notifications = notifications; + const _$NotificationsStateLoadedImpl({required final List notifications, required this.notificationsCount}) : _notifications = notifications; final List _notifications; + @override List get notifications { if (_notifications is EqualUnmodifiableListView) return _notifications; @@ -409,33 +376,27 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateLoadedImpl && - const DeepCollectionEquality() - .equals(other._notifications, _notifications) && - (identical(other.notificationsCount, notificationsCount) || - other.notificationsCount == notificationsCount)); + const DeepCollectionEquality().equals(other._notifications, _notifications) && + (identical(other.notificationsCount, notificationsCount) || other.notificationsCount == notificationsCount)); } @override - int get hashCode => Object.hash(runtimeType, - const DeepCollectionEquality().hash(_notifications), notificationsCount); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_notifications), notificationsCount); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> - get copyWith => __$$NotificationsStateLoadedImplCopyWithImpl< - _$NotificationsStateLoadedImpl>(this, _$identity); + _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => + __$$NotificationsStateLoadedImplCopyWithImpl<_$NotificationsStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function( - List notifications, int notificationsCount) - loaded, + required TResult Function(List notifications, int notificationsCount) loaded, required TResult Function(String errorMessage) error, }) { return loaded(notifications, notificationsCount); @@ -446,8 +407,7 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? - loaded, + TResult? Function(List notifications, int notificationsCount)? loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(notifications, notificationsCount); @@ -458,8 +418,7 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? - loaded, + TResult Function(List notifications, int notificationsCount)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -508,39 +467,31 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { } abstract class NotificationsStateLoaded implements NotificationsState { - const factory NotificationsStateLoaded( - {required final List notifications, - required final int notificationsCount}) = _$NotificationsStateLoadedImpl; + const factory NotificationsStateLoaded({required final List notifications, required final int notificationsCount}) = _$NotificationsStateLoadedImpl; List get notifications; + int get notificationsCount; /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> - get copyWith => throw _privateConstructorUsedError; + _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$NotificationsStateErrorImplCopyWith<$Res> { - factory _$$NotificationsStateErrorImplCopyWith( - _$NotificationsStateErrorImpl value, - $Res Function(_$NotificationsStateErrorImpl) then) = + factory _$$NotificationsStateErrorImplCopyWith(_$NotificationsStateErrorImpl value, $Res Function(_$NotificationsStateErrorImpl) then) = __$$NotificationsStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$NotificationsStateErrorImplCopyWithImpl<$Res> - extends _$NotificationsStateCopyWithImpl<$Res, - _$NotificationsStateErrorImpl> +class __$$NotificationsStateErrorImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateErrorImpl> implements _$$NotificationsStateErrorImplCopyWith<$Res> { - __$$NotificationsStateErrorImplCopyWithImpl( - _$NotificationsStateErrorImpl _value, - $Res Function(_$NotificationsStateErrorImpl) _then) - : super(_value, _then); + __$$NotificationsStateErrorImplCopyWithImpl(_$NotificationsStateErrorImpl _value, $Res Function(_$NotificationsStateErrorImpl) _then) : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -576,8 +527,7 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -588,18 +538,15 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> - get copyWith => __$$NotificationsStateErrorImplCopyWithImpl< - _$NotificationsStateErrorImpl>(this, _$identity); + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => + __$$NotificationsStateErrorImplCopyWithImpl<_$NotificationsStateErrorImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function( - List notifications, int notificationsCount) - loaded, + required TResult Function(List notifications, int notificationsCount) loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -610,8 +557,7 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? - loaded, + TResult? Function(List notifications, int notificationsCount)? loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -622,8 +568,7 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? - loaded, + TResult Function(List notifications, int notificationsCount)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -672,14 +617,12 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { } abstract class NotificationsStateError implements NotificationsState { - const factory NotificationsStateError({required final String errorMessage}) = - _$NotificationsStateErrorImpl; + const factory NotificationsStateError({required final String errorMessage}) = _$NotificationsStateErrorImpl; String get errorMessage; /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart index e2bfd48b..c6d83825 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart @@ -19,4 +19,4 @@ class ProfileAvatarCubit extends Cubit { print(e); } } -} \ No newline at end of file +} diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart index b629d579..b4ba4c19 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$ProfileAvatarState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,17 @@ mixin _$ProfileAvatarState { /// @nodoc abstract class $ProfileAvatarStateCopyWith<$Res> { - factory $ProfileAvatarStateCopyWith( - ProfileAvatarState value, $Res Function(ProfileAvatarState) then) = + factory $ProfileAvatarStateCopyWith(ProfileAvatarState value, $Res Function(ProfileAvatarState) then) = _$ProfileAvatarStateCopyWithImpl<$Res, ProfileAvatarState>; } /// @nodoc -class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> - implements $ProfileAvatarStateCopyWith<$Res> { +class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> implements $ProfileAvatarStateCopyWith<$Res> { _$ProfileAvatarStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +91,14 @@ class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> /// @nodoc abstract class _$$ProfileAvatarStateImplCopyWith<$Res> { - factory _$$ProfileAvatarStateImplCopyWith(_$ProfileAvatarStateImpl value, - $Res Function(_$ProfileAvatarStateImpl) then) = + factory _$$ProfileAvatarStateImplCopyWith(_$ProfileAvatarStateImpl value, $Res Function(_$ProfileAvatarStateImpl) then) = __$$ProfileAvatarStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileAvatarStateImplCopyWithImpl<$Res> - extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateImpl> +class __$$ProfileAvatarStateImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateImpl> implements _$$ProfileAvatarStateImplCopyWith<$Res> { - __$$ProfileAvatarStateImplCopyWithImpl(_$ProfileAvatarStateImpl _value, - $Res Function(_$ProfileAvatarStateImpl) _then) - : super(_value, _then); + __$$ProfileAvatarStateImplCopyWithImpl(_$ProfileAvatarStateImpl _value, $Res Function(_$ProfileAvatarStateImpl) _then) : super(_value, _then); /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @@ -120,8 +116,7 @@ class _$ProfileAvatarStateImpl implements _ProfileAvatarState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ProfileAvatarStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileAvatarStateImpl); } @override @@ -208,20 +203,14 @@ abstract class _ProfileAvatarState implements ProfileAvatarState { /// @nodoc abstract class _$$ProfileAvatarStateLoadingImplCopyWith<$Res> { - factory _$$ProfileAvatarStateLoadingImplCopyWith( - _$ProfileAvatarStateLoadingImpl value, - $Res Function(_$ProfileAvatarStateLoadingImpl) then) = + factory _$$ProfileAvatarStateLoadingImplCopyWith(_$ProfileAvatarStateLoadingImpl value, $Res Function(_$ProfileAvatarStateLoadingImpl) then) = __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res> - extends _$ProfileAvatarStateCopyWithImpl<$Res, - _$ProfileAvatarStateLoadingImpl> +class __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateLoadingImpl> implements _$$ProfileAvatarStateLoadingImplCopyWith<$Res> { - __$$ProfileAvatarStateLoadingImplCopyWithImpl( - _$ProfileAvatarStateLoadingImpl _value, - $Res Function(_$ProfileAvatarStateLoadingImpl) _then) + __$$ProfileAvatarStateLoadingImplCopyWithImpl(_$ProfileAvatarStateLoadingImpl _value, $Res Function(_$ProfileAvatarStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of ProfileAvatarState @@ -240,9 +229,7 @@ class _$ProfileAvatarStateLoadingImpl implements ProfileAvatarStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ProfileAvatarStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileAvatarStateLoadingImpl); } @override @@ -329,10 +316,9 @@ abstract class ProfileAvatarStateLoading implements ProfileAvatarState { /// @nodoc abstract class _$$ProfileAvatarStateLoadedImplCopyWith<$Res> { - factory _$$ProfileAvatarStateLoadedImplCopyWith( - _$ProfileAvatarStateLoadedImpl value, - $Res Function(_$ProfileAvatarStateLoadedImpl) then) = + factory _$$ProfileAvatarStateLoadedImplCopyWith(_$ProfileAvatarStateLoadedImpl value, $Res Function(_$ProfileAvatarStateLoadedImpl) then) = __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({ProfileModel profile}); @@ -340,13 +326,9 @@ abstract class _$$ProfileAvatarStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res> - extends _$ProfileAvatarStateCopyWithImpl<$Res, - _$ProfileAvatarStateLoadedImpl> +class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateLoadedImpl> implements _$$ProfileAvatarStateLoadedImplCopyWith<$Res> { - __$$ProfileAvatarStateLoadedImplCopyWithImpl( - _$ProfileAvatarStateLoadedImpl _value, - $Res Function(_$ProfileAvatarStateLoadedImpl) _then) + __$$ProfileAvatarStateLoadedImplCopyWithImpl(_$ProfileAvatarStateLoadedImpl _value, $Res Function(_$ProfileAvatarStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of ProfileAvatarState @@ -391,9 +373,7 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ProfileAvatarStateLoadedImpl && - (identical(other.profile, profile) || other.profile == profile)); + (other.runtimeType == runtimeType && other is _$ProfileAvatarStateLoadedImpl && (identical(other.profile, profile) || other.profile == profile)); } @override @@ -404,9 +384,8 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> - get copyWith => __$$ProfileAvatarStateLoadedImplCopyWithImpl< - _$ProfileAvatarStateLoadedImpl>(this, _$identity); + _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> get copyWith => + __$$ProfileAvatarStateLoadedImplCopyWithImpl<_$ProfileAvatarStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -484,37 +463,29 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded { } abstract class ProfileAvatarStateLoaded implements ProfileAvatarState { - const factory ProfileAvatarStateLoaded( - {required final ProfileModel profile}) = _$ProfileAvatarStateLoadedImpl; + const factory ProfileAvatarStateLoaded({required final ProfileModel profile}) = _$ProfileAvatarStateLoadedImpl; ProfileModel get profile; /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ProfileAvatarStateErrorImplCopyWith<$Res> { - factory _$$ProfileAvatarStateErrorImplCopyWith( - _$ProfileAvatarStateErrorImpl value, - $Res Function(_$ProfileAvatarStateErrorImpl) then) = + factory _$$ProfileAvatarStateErrorImplCopyWith(_$ProfileAvatarStateErrorImpl value, $Res Function(_$ProfileAvatarStateErrorImpl) then) = __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res> - extends _$ProfileAvatarStateCopyWithImpl<$Res, - _$ProfileAvatarStateErrorImpl> +class __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateErrorImpl> implements _$$ProfileAvatarStateErrorImplCopyWith<$Res> { - __$$ProfileAvatarStateErrorImplCopyWithImpl( - _$ProfileAvatarStateErrorImpl _value, - $Res Function(_$ProfileAvatarStateErrorImpl) _then) - : super(_value, _then); + __$$ProfileAvatarStateErrorImplCopyWithImpl(_$ProfileAvatarStateErrorImpl _value, $Res Function(_$ProfileAvatarStateErrorImpl) _then) : super(_value, _then); /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @@ -550,8 +521,7 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileAvatarStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -562,9 +532,8 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> - get copyWith => __$$ProfileAvatarStateErrorImplCopyWithImpl< - _$ProfileAvatarStateErrorImpl>(this, _$identity); + _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> get copyWith => + __$$ProfileAvatarStateErrorImplCopyWithImpl<_$ProfileAvatarStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -642,14 +611,12 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError { } abstract class ProfileAvatarStateError implements ProfileAvatarState { - const factory ProfileAvatarStateError({required final String errorMessage}) = - _$ProfileAvatarStateErrorImpl; + const factory ProfileAvatarStateError({required final String errorMessage}) = _$ProfileAvatarStateErrorImpl; String get errorMessage; /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/models/calendar_entry_model.dart b/lib/features/calendar/models/calendar_entry_model.dart index 0973f979..32a6d1bd 100644 --- a/lib/features/calendar/models/calendar_entry_model.dart +++ b/lib/features/calendar/models/calendar_entry_model.dart @@ -16,7 +16,6 @@ class CalendarEntryModel { date = date; status = status; id = id; - is_current_day_included_in_the_chosen_diet_progression = - is_current_day_included_in_the_chosen_diet_progression; + is_current_day_included_in_the_chosen_diet_progression = is_current_day_included_in_the_chosen_diet_progression; } } diff --git a/lib/features/calendar/models/calendar_model.dart b/lib/features/calendar/models/calendar_model.dart index 4d74a87a..29e822e2 100644 --- a/lib/features/calendar/models/calendar_model.dart +++ b/lib/features/calendar/models/calendar_model.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'calendar_model.freezed.dart'; + part 'calendar_model.g.dart'; @freezed diff --git a/lib/features/calendar/models/calendar_model.freezed.dart b/lib/features/calendar/models/calendar_model.freezed.dart index d10fc8f2..f7a1d191 100644 --- a/lib/features/calendar/models/calendar_model.freezed.dart +++ b/lib/features/calendar/models/calendar_model.freezed.dart @@ -21,8 +21,9 @@ CalendarModel _$CalendarModelFromJson(Map json) { /// @nodoc mixin _$CalendarModel { String get date => throw _privateConstructorUsedError; - bool get is_current_day_included_in_the_chosen_diet_progression => - throw _privateConstructorUsedError; + + bool get is_current_day_included_in_the_chosen_diet_progression => throw _privateConstructorUsedError; + Object? get diary => throw _privateConstructorUsedError; /// Serializes this CalendarModel to a JSON map. @@ -31,29 +32,24 @@ mixin _$CalendarModel { /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $CalendarModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $CalendarModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $CalendarModelCopyWith<$Res> { - factory $CalendarModelCopyWith( - CalendarModel value, $Res Function(CalendarModel) then) = - _$CalendarModelCopyWithImpl<$Res, CalendarModel>; + factory $CalendarModelCopyWith(CalendarModel value, $Res Function(CalendarModel) then) = _$CalendarModelCopyWithImpl<$Res, CalendarModel>; + @useResult - $Res call( - {String date, - bool is_current_day_included_in_the_chosen_diet_progression, - Object? diary}); + $Res call({String date, bool is_current_day_included_in_the_chosen_diet_progression, Object? diary}); } /// @nodoc -class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> - implements $CalendarModelCopyWith<$Res> { +class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> implements $CalendarModelCopyWith<$Res> { _$CalendarModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -71,8 +67,7 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> ? _value.date : date // ignore: cast_nullable_to_non_nullable as String, - is_current_day_included_in_the_chosen_diet_progression: null == - is_current_day_included_in_the_chosen_diet_progression + is_current_day_included_in_the_chosen_diet_progression: null == is_current_day_included_in_the_chosen_diet_progression ? _value.is_current_day_included_in_the_chosen_diet_progression : is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable as bool, @@ -82,26 +77,17 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> } /// @nodoc -abstract class _$$CalendarModelImplCopyWith<$Res> - implements $CalendarModelCopyWith<$Res> { - factory _$$CalendarModelImplCopyWith( - _$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) = - __$$CalendarModelImplCopyWithImpl<$Res>; +abstract class _$$CalendarModelImplCopyWith<$Res> implements $CalendarModelCopyWith<$Res> { + factory _$$CalendarModelImplCopyWith(_$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) = __$$CalendarModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {String date, - bool is_current_day_included_in_the_chosen_diet_progression, - Object? diary}); + $Res call({String date, bool is_current_day_included_in_the_chosen_diet_progression, Object? diary}); } /// @nodoc -class __$$CalendarModelImplCopyWithImpl<$Res> - extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl> - implements _$$CalendarModelImplCopyWith<$Res> { - __$$CalendarModelImplCopyWithImpl( - _$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then) - : super(_value, _then); +class __$$CalendarModelImplCopyWithImpl<$Res> extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl> implements _$$CalendarModelImplCopyWith<$Res> { + __$$CalendarModelImplCopyWithImpl(_$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then) : super(_value, _then); /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @@ -117,8 +103,7 @@ class __$$CalendarModelImplCopyWithImpl<$Res> ? _value.date : date // ignore: cast_nullable_to_non_nullable as String, - is_current_day_included_in_the_chosen_diet_progression: null == - is_current_day_included_in_the_chosen_diet_progression + is_current_day_included_in_the_chosen_diet_progression: null == is_current_day_included_in_the_chosen_diet_progression ? _value.is_current_day_included_in_the_chosen_diet_progression : is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable as bool, @@ -130,13 +115,9 @@ class __$$CalendarModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$CalendarModelImpl implements _CalendarModel { - const _$CalendarModelImpl( - {required this.date, - required this.is_current_day_included_in_the_chosen_diet_progression, - this.diary}); + const _$CalendarModelImpl({required this.date, required this.is_current_day_included_in_the_chosen_diet_progression, this.diary}); - factory _$CalendarModelImpl.fromJson(Map json) => - _$$CalendarModelImplFromJson(json); + factory _$CalendarModelImpl.fromJson(Map json) => _$$CalendarModelImplFromJson(json); @override final String date; @@ -156,30 +137,21 @@ class _$CalendarModelImpl implements _CalendarModel { (other.runtimeType == runtimeType && other is _$CalendarModelImpl && (identical(other.date, date) || other.date == date) && - (identical( - other - .is_current_day_included_in_the_chosen_diet_progression, - is_current_day_included_in_the_chosen_diet_progression) || - other.is_current_day_included_in_the_chosen_diet_progression == - is_current_day_included_in_the_chosen_diet_progression) && + (identical(other.is_current_day_included_in_the_chosen_diet_progression, is_current_day_included_in_the_chosen_diet_progression) || + other.is_current_day_included_in_the_chosen_diet_progression == is_current_day_included_in_the_chosen_diet_progression) && const DeepCollectionEquality().equals(other.diary, diary)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - date, - is_current_day_included_in_the_chosen_diet_progression, - const DeepCollectionEquality().hash(diary)); + int get hashCode => Object.hash(runtimeType, date, is_current_day_included_in_the_chosen_diet_progression, const DeepCollectionEquality().hash(diary)); /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => - __$$CalendarModelImplCopyWithImpl<_$CalendarModelImpl>(this, _$identity); + _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => __$$CalendarModelImplCopyWithImpl<_$CalendarModelImpl>(this, _$identity); @override Map toJson() { @@ -190,19 +162,17 @@ class _$CalendarModelImpl implements _CalendarModel { } abstract class _CalendarModel implements CalendarModel { - const factory _CalendarModel( - {required final String date, - required final bool - is_current_day_included_in_the_chosen_diet_progression, - final Object? diary}) = _$CalendarModelImpl; + const factory _CalendarModel({required final String date, required final bool is_current_day_included_in_the_chosen_diet_progression, final Object? diary}) = + _$CalendarModelImpl; - factory _CalendarModel.fromJson(Map json) = - _$CalendarModelImpl.fromJson; + factory _CalendarModel.fromJson(Map json) = _$CalendarModelImpl.fromJson; @override String get date; + @override bool get is_current_day_included_in_the_chosen_diet_progression; + @override Object? get diary; @@ -210,6 +180,5 @@ abstract class _CalendarModel implements CalendarModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/models/calendar_model.g.dart b/lib/features/calendar/models/calendar_model.g.dart index 65fd0063..4134c22e 100644 --- a/lib/features/calendar/models/calendar_model.g.dart +++ b/lib/features/calendar/models/calendar_model.g.dart @@ -6,19 +6,14 @@ part of 'calendar_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CalendarModelImpl _$$CalendarModelImplFromJson(Map json) => - _$CalendarModelImpl( +_$CalendarModelImpl _$$CalendarModelImplFromJson(Map json) => _$CalendarModelImpl( date: json['date'] as String, - is_current_day_included_in_the_chosen_diet_progression: - json['is_current_day_included_in_the_chosen_diet_progression'] - as bool, + is_current_day_included_in_the_chosen_diet_progression: json['is_current_day_included_in_the_chosen_diet_progression'] as bool, diary: json['diary'], ); -Map _$$CalendarModelImplToJson(_$CalendarModelImpl instance) => - { +Map _$$CalendarModelImplToJson(_$CalendarModelImpl instance) => { 'date': instance.date, - 'is_current_day_included_in_the_chosen_diet_progression': - instance.is_current_day_included_in_the_chosen_diet_progression, + 'is_current_day_included_in_the_chosen_diet_progression': instance.is_current_day_included_in_the_chosen_diet_progression, 'diary': instance.diary, }; diff --git a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart index 0e7bdbcd..76a12423 100644 --- a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart +++ b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$CalendarState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ mixin _$CalendarState { /// @nodoc abstract class $CalendarStateCopyWith<$Res> { - factory $CalendarStateCopyWith( - CalendarState value, $Res Function(CalendarState) then) = - _$CalendarStateCopyWithImpl<$Res, CalendarState>; + factory $CalendarStateCopyWith(CalendarState value, $Res Function(CalendarState) then) = _$CalendarStateCopyWithImpl<$Res, CalendarState>; } /// @nodoc -class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> - implements $CalendarStateCopyWith<$Res> { +class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> implements $CalendarStateCopyWith<$Res> { _$CalendarStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +90,12 @@ class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> /// @nodoc abstract class _$$CalendarStateImplCopyWith<$Res> { - factory _$$CalendarStateImplCopyWith( - _$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) = - __$$CalendarStateImplCopyWithImpl<$Res>; + factory _$$CalendarStateImplCopyWith(_$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) = __$$CalendarStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CalendarStateImplCopyWithImpl<$Res> - extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl> - implements _$$CalendarStateImplCopyWith<$Res> { - __$$CalendarStateImplCopyWithImpl( - _$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then) - : super(_value, _then); +class __$$CalendarStateImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl> implements _$$CalendarStateImplCopyWith<$Res> { + __$$CalendarStateImplCopyWithImpl(_$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then) : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -120,8 +113,7 @@ class _$CalendarStateImpl implements _CalendarState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$CalendarStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateImpl); } @override @@ -208,18 +200,14 @@ abstract class _CalendarState implements CalendarState { /// @nodoc abstract class _$$CalendarStateLoadingImplCopyWith<$Res> { - factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value, - $Res Function(_$CalendarStateLoadingImpl) then) = + factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value, $Res Function(_$CalendarStateLoadingImpl) then) = __$$CalendarStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CalendarStateLoadingImplCopyWithImpl<$Res> - extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl> +class __$$CalendarStateLoadingImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl> implements _$$CalendarStateLoadingImplCopyWith<$Res> { - __$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value, - $Res Function(_$CalendarStateLoadingImpl) _then) - : super(_value, _then); + __$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value, $Res Function(_$CalendarStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -237,9 +225,7 @@ class _$CalendarStateLoadingImpl implements CalendarStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CalendarStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateLoadingImpl); } @override @@ -326,20 +312,17 @@ abstract class CalendarStateLoading implements CalendarState { /// @nodoc abstract class _$$CalendarStateLoadedImplCopyWith<$Res> { - factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value, - $Res Function(_$CalendarStateLoadedImpl) then) = + factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value, $Res Function(_$CalendarStateLoadedImpl) then) = __$$CalendarStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({List calendarList}); } /// @nodoc -class __$$CalendarStateLoadedImplCopyWithImpl<$Res> - extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl> +class __$$CalendarStateLoadedImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl> implements _$$CalendarStateLoadedImplCopyWith<$Res> { - __$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value, - $Res Function(_$CalendarStateLoadedImpl) _then) - : super(_value, _then); + __$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value, $Res Function(_$CalendarStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -360,11 +343,10 @@ class __$$CalendarStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$CalendarStateLoadedImpl implements CalendarStateLoaded { - const _$CalendarStateLoadedImpl( - {required final List calendarList}) - : _calendarList = calendarList; + const _$CalendarStateLoadedImpl({required final List calendarList}) : _calendarList = calendarList; final List _calendarList; + @override List get calendarList { if (_calendarList is EqualUnmodifiableListView) return _calendarList; @@ -380,15 +362,11 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CalendarStateLoadedImpl && - const DeepCollectionEquality() - .equals(other._calendarList, _calendarList)); + (other.runtimeType == runtimeType && other is _$CalendarStateLoadedImpl && const DeepCollectionEquality().equals(other._calendarList, _calendarList)); } @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_calendarList)); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_calendarList)); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -396,8 +374,7 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { @override @pragma('vm:prefer-inline') _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => - __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>( - this, _$identity); + __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -475,35 +452,29 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { } abstract class CalendarStateLoaded implements CalendarState { - const factory CalendarStateLoaded( - {required final List calendarList}) = - _$CalendarStateLoadedImpl; + const factory CalendarStateLoaded({required final List calendarList}) = _$CalendarStateLoadedImpl; List get calendarList; /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$CalendarStateErrorImplCopyWith<$Res> { - factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value, - $Res Function(_$CalendarStateErrorImpl) then) = + factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value, $Res Function(_$CalendarStateErrorImpl) then) = __$$CalendarStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$CalendarStateErrorImplCopyWithImpl<$Res> - extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl> +class __$$CalendarStateErrorImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl> implements _$$CalendarStateErrorImplCopyWith<$Res> { - __$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value, - $Res Function(_$CalendarStateErrorImpl) _then) - : super(_value, _then); + __$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value, $Res Function(_$CalendarStateErrorImpl) _then) : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -539,8 +510,7 @@ class _$CalendarStateErrorImpl implements CalendarStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -552,8 +522,7 @@ class _$CalendarStateErrorImpl implements CalendarStateError { @override @pragma('vm:prefer-inline') _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => - __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>( - this, _$identity); + __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -631,14 +600,12 @@ class _$CalendarStateErrorImpl implements CalendarStateError { } abstract class CalendarStateError implements CalendarState { - const factory CalendarStateError({required final String errorMessage}) = - _$CalendarStateErrorImpl; + const factory CalendarStateError({required final String errorMessage}) = _$CalendarStateErrorImpl; String get errorMessage; /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/services/calendar_service.g.dart b/lib/features/calendar/services/calendar_service.g.dart index 903145dc..223e1a2e 100644 --- a/lib/features/calendar/services/calendar_service.g.dart +++ b/lib/features/calendar/services/calendar_service.g.dart @@ -46,9 +46,7 @@ class _CalendarService implements CalendarService { final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data! - .map((dynamic i) => CalendarModel.fromJson(i as Map)) - .toList(); + _value = _result.data!.map((dynamic i) => CalendarModel.fromJson(i as Map)).toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -57,9 +55,7 @@ class _CalendarService implements CalendarService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/chat/models/chat_message_model.freezed.dart b/lib/features/chat/models/chat_message_model.freezed.dart index 8f921425..558753ef 100644 --- a/lib/features/chat/models/chat_message_model.freezed.dart +++ b/lib/features/chat/models/chat_message_model.freezed.dart @@ -21,11 +21,15 @@ ChatMessageModel _$ChatMessageModelFromJson(Map json) { /// @nodoc mixin _$ChatMessageModel { int get id => throw _privateConstructorUsedError; + String get data => throw _privateConstructorUsedError; + @JsonKey(name: 'media_data') List? get mediaData => throw _privateConstructorUsedError; + @JsonKey(name: 'author_id') int get authorId => throw _privateConstructorUsedError; + @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; @@ -35,15 +39,13 @@ mixin _$ChatMessageModel { /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMessageModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatMessageModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMessageModelCopyWith<$Res> { - factory $ChatMessageModelCopyWith( - ChatMessageModel value, $Res Function(ChatMessageModel) then) = - _$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>; + factory $ChatMessageModelCopyWith(ChatMessageModel value, $Res Function(ChatMessageModel) then) = _$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>; + @useResult $Res call( {int id, @@ -54,12 +56,12 @@ abstract class $ChatMessageModelCopyWith<$Res> { } /// @nodoc -class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> - implements $ChatMessageModelCopyWith<$Res> { +class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> implements $ChatMessageModelCopyWith<$Res> { _$ChatMessageModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -100,11 +102,10 @@ class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> } /// @nodoc -abstract class _$$ChatMessageModelImplCopyWith<$Res> - implements $ChatMessageModelCopyWith<$Res> { - factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value, - $Res Function(_$ChatMessageModelImpl) then) = +abstract class _$$ChatMessageModelImplCopyWith<$Res> implements $ChatMessageModelCopyWith<$Res> { + factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value, $Res Function(_$ChatMessageModelImpl) then) = __$$ChatMessageModelImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -116,12 +117,9 @@ abstract class _$$ChatMessageModelImplCopyWith<$Res> } /// @nodoc -class __$$ChatMessageModelImplCopyWithImpl<$Res> - extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl> +class __$$ChatMessageModelImplCopyWithImpl<$Res> extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl> implements _$$ChatMessageModelImplCopyWith<$Res> { - __$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value, - $Res Function(_$ChatMessageModelImpl) _then) - : super(_value, _then); + __$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value, $Res Function(_$ChatMessageModelImpl) _then) : super(_value, _then); /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @@ -170,14 +168,14 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { @JsonKey(name: 'updated_at') required this.updatedAt}) : _mediaData = mediaData; - factory _$ChatMessageModelImpl.fromJson(Map json) => - _$$ChatMessageModelImplFromJson(json); + factory _$ChatMessageModelImpl.fromJson(Map json) => _$$ChatMessageModelImplFromJson(json); @override final int id; @override final String data; final List? _mediaData; + @override @JsonKey(name: 'media_data') List? get mediaData { @@ -207,27 +205,21 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { other is _$ChatMessageModelImpl && (identical(other.id, id) || other.id == id) && (identical(other.data, data) || other.data == data) && - const DeepCollectionEquality() - .equals(other._mediaData, _mediaData) && - (identical(other.authorId, authorId) || - other.authorId == authorId) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); + const DeepCollectionEquality().equals(other._mediaData, _mediaData) && + (identical(other.authorId, authorId) || other.authorId == authorId) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, data, - const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); + int get hashCode => Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => - __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>( - this, _$identity); + _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>(this, _$identity); @override Map toJson() { @@ -239,26 +231,28 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { abstract class _ChatMessageModel implements ChatMessageModel { const factory _ChatMessageModel( - {required final int id, - required final String data, - @JsonKey(name: 'media_data') required final List? mediaData, - @JsonKey(name: 'author_id') required final int authorId, - @JsonKey(name: 'updated_at') required final String updatedAt}) = - _$ChatMessageModelImpl; + {required final int id, + required final String data, + @JsonKey(name: 'media_data') required final List? mediaData, + @JsonKey(name: 'author_id') required final int authorId, + @JsonKey(name: 'updated_at') required final String updatedAt}) = _$ChatMessageModelImpl; - factory _ChatMessageModel.fromJson(Map json) = - _$ChatMessageModelImpl.fromJson; + factory _ChatMessageModel.fromJson(Map json) = _$ChatMessageModelImpl.fromJson; @override int get id; + @override String get data; + @override @JsonKey(name: 'media_data') List? get mediaData; + @override @JsonKey(name: 'author_id') int get authorId; + @override @JsonKey(name: 'updated_at') String get updatedAt; @@ -267,6 +261,5 @@ abstract class _ChatMessageModel implements ChatMessageModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_message_model.g.dart b/lib/features/chat/models/chat_message_model.g.dart index 3a8d1827..70531099 100644 --- a/lib/features/chat/models/chat_message_model.g.dart +++ b/lib/features/chat/models/chat_message_model.g.dart @@ -6,9 +6,7 @@ part of 'chat_message_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson( - Map json) => - _$ChatMessageModelImpl( +_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson(Map json) => _$ChatMessageModelImpl( id: (json['id'] as num).toInt(), data: json['data'] as String, mediaData: json['media_data'] as List?, @@ -16,9 +14,7 @@ _$ChatMessageModelImpl _$$ChatMessageModelImplFromJson( updatedAt: json['updated_at'] as String, ); -Map _$$ChatMessageModelImplToJson( - _$ChatMessageModelImpl instance) => - { +Map _$$ChatMessageModelImplToJson(_$ChatMessageModelImpl instance) => { 'id': instance.id, 'data': instance.data, 'media_data': instance.mediaData, diff --git a/lib/features/chat/models/chat_messages_model.freezed.dart b/lib/features/chat/models/chat_messages_model.freezed.dart index 852b33e4..d4dad1cb 100644 --- a/lib/features/chat/models/chat_messages_model.freezed.dart +++ b/lib/features/chat/models/chat_messages_model.freezed.dart @@ -22,6 +22,7 @@ ChatMessagesModel _$ChatMessagesModelFromJson(Map json) { mixin _$ChatMessagesModel { @JsonKey(name: 'data') List get messagesList => throw _privateConstructorUsedError; + ChatMetaModel get meta => throw _privateConstructorUsedError; /// Serializes this ChatMessagesModel to a JSON map. @@ -30,30 +31,26 @@ mixin _$ChatMessagesModel { /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMessagesModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatMessagesModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMessagesModelCopyWith<$Res> { - factory $ChatMessagesModelCopyWith( - ChatMessagesModel value, $Res Function(ChatMessagesModel) then) = - _$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>; + factory $ChatMessagesModelCopyWith(ChatMessagesModel value, $Res Function(ChatMessagesModel) then) = _$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>; + @useResult - $Res call( - {@JsonKey(name: 'data') List messagesList, - ChatMetaModel meta}); + $Res call({@JsonKey(name: 'data') List messagesList, ChatMetaModel meta}); $ChatMetaModelCopyWith<$Res> get meta; } /// @nodoc -class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> - implements $ChatMessagesModelCopyWith<$Res> { +class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> implements $ChatMessagesModelCopyWith<$Res> { _$ChatMessagesModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -89,28 +86,22 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> } /// @nodoc -abstract class _$$ChatMessagesModelImplCopyWith<$Res> - implements $ChatMessagesModelCopyWith<$Res> { - factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value, - $Res Function(_$ChatMessagesModelImpl) then) = +abstract class _$$ChatMessagesModelImplCopyWith<$Res> implements $ChatMessagesModelCopyWith<$Res> { + factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value, $Res Function(_$ChatMessagesModelImpl) then) = __$$ChatMessagesModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: 'data') List messagesList, - ChatMetaModel meta}); + $Res call({@JsonKey(name: 'data') List messagesList, ChatMetaModel meta}); @override $ChatMetaModelCopyWith<$Res> get meta; } /// @nodoc -class __$$ChatMessagesModelImplCopyWithImpl<$Res> - extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl> +class __$$ChatMessagesModelImplCopyWithImpl<$Res> extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl> implements _$$ChatMessagesModelImplCopyWith<$Res> { - __$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value, - $Res Function(_$ChatMessagesModelImpl) _then) - : super(_value, _then); + __$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value, $Res Function(_$ChatMessagesModelImpl) _then) : super(_value, _then); /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @@ -136,16 +127,12 @@ class __$$ChatMessagesModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$ChatMessagesModelImpl implements _ChatMessagesModel { - const _$ChatMessagesModelImpl( - {@JsonKey(name: 'data') - required final List messagesList, - required this.meta}) - : _messagesList = messagesList; + const _$ChatMessagesModelImpl({@JsonKey(name: 'data') required final List messagesList, required this.meta}) : _messagesList = messagesList; - factory _$ChatMessagesModelImpl.fromJson(Map json) => - _$$ChatMessagesModelImplFromJson(json); + factory _$ChatMessagesModelImpl.fromJson(Map json) => _$$ChatMessagesModelImplFromJson(json); final List _messagesList; + @override @JsonKey(name: 'data') List get messagesList { @@ -167,24 +154,20 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatMessagesModelImpl && - const DeepCollectionEquality() - .equals(other._messagesList, _messagesList) && + const DeepCollectionEquality().equals(other._messagesList, _messagesList) && (identical(other.meta, meta) || other.meta == meta)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => - __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>( - this, _$identity); + _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>(this, _$identity); @override Map toJson() { @@ -195,17 +178,15 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { } abstract class _ChatMessagesModel implements ChatMessagesModel { - const factory _ChatMessagesModel( - {@JsonKey(name: 'data') - required final List messagesList, - required final ChatMetaModel meta}) = _$ChatMessagesModelImpl; + const factory _ChatMessagesModel({@JsonKey(name: 'data') required final List messagesList, required final ChatMetaModel meta}) = + _$ChatMessagesModelImpl; - factory _ChatMessagesModel.fromJson(Map json) = - _$ChatMessagesModelImpl.fromJson; + factory _ChatMessagesModel.fromJson(Map json) = _$ChatMessagesModelImpl.fromJson; @override @JsonKey(name: 'data') List get messagesList; + @override ChatMetaModel get meta; @@ -213,6 +194,5 @@ abstract class _ChatMessagesModel implements ChatMessagesModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_messages_model.g.dart b/lib/features/chat/models/chat_messages_model.g.dart index 6216cd83..1a7fe48b 100644 --- a/lib/features/chat/models/chat_messages_model.g.dart +++ b/lib/features/chat/models/chat_messages_model.g.dart @@ -6,18 +6,12 @@ part of 'chat_messages_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson( - Map json) => - _$ChatMessagesModelImpl( - messagesList: (json['data'] as List) - .map((e) => ChatMessageModel.fromJson(e as Map)) - .toList(), +_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson(Map json) => _$ChatMessagesModelImpl( + messagesList: (json['data'] as List).map((e) => ChatMessageModel.fromJson(e as Map)).toList(), meta: ChatMetaModel.fromJson(json['meta'] as Map), ); -Map _$$ChatMessagesModelImplToJson( - _$ChatMessagesModelImpl instance) => - { +Map _$$ChatMessagesModelImplToJson(_$ChatMessagesModelImpl instance) => { 'data': instance.messagesList, 'meta': instance.meta, }; diff --git a/lib/features/chat/models/chat_meta_model.freezed.dart b/lib/features/chat/models/chat_meta_model.freezed.dart index e8e4e96b..b4354b59 100644 --- a/lib/features/chat/models/chat_meta_model.freezed.dart +++ b/lib/features/chat/models/chat_meta_model.freezed.dart @@ -29,26 +29,24 @@ mixin _$ChatMetaModel { /// Create a copy of ChatMetaModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMetaModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatMetaModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMetaModelCopyWith<$Res> { - factory $ChatMetaModelCopyWith( - ChatMetaModel value, $Res Function(ChatMetaModel) then) = - _$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>; + factory $ChatMetaModelCopyWith(ChatMetaModel value, $Res Function(ChatMetaModel) then) = _$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>; + @useResult $Res call({@JsonKey(name: "last_page") int lastPage}); } /// @nodoc -class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> - implements $ChatMetaModelCopyWith<$Res> { +class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> implements $ChatMetaModelCopyWith<$Res> { _$ChatMetaModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -69,23 +67,17 @@ class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> } /// @nodoc -abstract class _$$ChatMetaModelImplCopyWith<$Res> - implements $ChatMetaModelCopyWith<$Res> { - factory _$$ChatMetaModelImplCopyWith( - _$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) = - __$$ChatMetaModelImplCopyWithImpl<$Res>; +abstract class _$$ChatMetaModelImplCopyWith<$Res> implements $ChatMetaModelCopyWith<$Res> { + factory _$$ChatMetaModelImplCopyWith(_$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) = __$$ChatMetaModelImplCopyWithImpl<$Res>; + @override @useResult $Res call({@JsonKey(name: "last_page") int lastPage}); } /// @nodoc -class __$$ChatMetaModelImplCopyWithImpl<$Res> - extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl> - implements _$$ChatMetaModelImplCopyWith<$Res> { - __$$ChatMetaModelImplCopyWithImpl( - _$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then) - : super(_value, _then); +class __$$ChatMetaModelImplCopyWithImpl<$Res> extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl> implements _$$ChatMetaModelImplCopyWith<$Res> { + __$$ChatMetaModelImplCopyWithImpl(_$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then) : super(_value, _then); /// Create a copy of ChatMetaModel /// with the given fields replaced by the non-null parameter values. @@ -106,11 +98,9 @@ class __$$ChatMetaModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$ChatMetaModelImpl implements _ChatMetaModel { - const _$ChatMetaModelImpl( - {@JsonKey(name: "last_page") required this.lastPage}); + const _$ChatMetaModelImpl({@JsonKey(name: "last_page") required this.lastPage}); - factory _$ChatMetaModelImpl.fromJson(Map json) => - _$$ChatMetaModelImplFromJson(json); + factory _$ChatMetaModelImpl.fromJson(Map json) => _$$ChatMetaModelImplFromJson(json); @override @JsonKey(name: "last_page") @@ -124,10 +114,7 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChatMetaModelImpl && - (identical(other.lastPage, lastPage) || - other.lastPage == lastPage)); + (other.runtimeType == runtimeType && other is _$ChatMetaModelImpl && (identical(other.lastPage, lastPage) || other.lastPage == lastPage)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -139,8 +126,7 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => - __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); + _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); @override Map toJson() { @@ -151,12 +137,9 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { } abstract class _ChatMetaModel implements ChatMetaModel { - const factory _ChatMetaModel( - {@JsonKey(name: "last_page") required final int lastPage}) = - _$ChatMetaModelImpl; + const factory _ChatMetaModel({@JsonKey(name: "last_page") required final int lastPage}) = _$ChatMetaModelImpl; - factory _ChatMetaModel.fromJson(Map json) = - _$ChatMetaModelImpl.fromJson; + factory _ChatMetaModel.fromJson(Map json) = _$ChatMetaModelImpl.fromJson; @override @JsonKey(name: "last_page") @@ -166,6 +149,5 @@ abstract class _ChatMetaModel implements ChatMetaModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_meta_model.g.dart b/lib/features/chat/models/chat_meta_model.g.dart index 7126e2dd..bbd16d10 100644 --- a/lib/features/chat/models/chat_meta_model.g.dart +++ b/lib/features/chat/models/chat_meta_model.g.dart @@ -6,12 +6,10 @@ part of 'chat_meta_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map json) => - _$ChatMetaModelImpl( +_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map json) => _$ChatMetaModelImpl( lastPage: (json['last_page'] as num).toInt(), ); -Map _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) => - { +Map _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) => { 'last_page': instance.lastPage, }; diff --git a/lib/features/chat/models/chat_room_model.freezed.dart b/lib/features/chat/models/chat_room_model.freezed.dart index 6afb3a94..cef12fbe 100644 --- a/lib/features/chat/models/chat_room_model.freezed.dart +++ b/lib/features/chat/models/chat_room_model.freezed.dart @@ -21,9 +21,10 @@ ChatRoomModel _$ChatRoomModelFromJson(Map json) { /// @nodoc mixin _$ChatRoomModel { String get id => throw _privateConstructorUsedError; + @JsonKey(name: 'chat_room_setting') - ChatRoomSettingsModel get chatRoomSettings => - throw _privateConstructorUsedError; + ChatRoomSettingsModel get chatRoomSettings => throw _privateConstructorUsedError; + Map get users => throw _privateConstructorUsedError; /// Serializes this ChatRoomModel to a JSON map. @@ -32,32 +33,26 @@ mixin _$ChatRoomModel { /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatRoomModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomModelCopyWith<$Res> { - factory $ChatRoomModelCopyWith( - ChatRoomModel value, $Res Function(ChatRoomModel) then) = - _$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>; + factory $ChatRoomModelCopyWith(ChatRoomModel value, $Res Function(ChatRoomModel) then) = _$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>; + @useResult - $Res call( - {String id, - @JsonKey(name: 'chat_room_setting') - ChatRoomSettingsModel chatRoomSettings, - Map users}); + $Res call({String id, @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings, Map users}); $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings; } /// @nodoc -class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> - implements $ChatRoomModelCopyWith<$Res> { +class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> implements $ChatRoomModelCopyWith<$Res> { _$ChatRoomModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,38 +86,27 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> @override @pragma('vm:prefer-inline') $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings { - return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings, - (value) { + return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings, (value) { return _then(_value.copyWith(chatRoomSettings: value) as $Val); }); } } /// @nodoc -abstract class _$$ChatRoomModelImplCopyWith<$Res> - implements $ChatRoomModelCopyWith<$Res> { - factory _$$ChatRoomModelImplCopyWith( - _$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) = - __$$ChatRoomModelImplCopyWithImpl<$Res>; +abstract class _$$ChatRoomModelImplCopyWith<$Res> implements $ChatRoomModelCopyWith<$Res> { + factory _$$ChatRoomModelImplCopyWith(_$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) = __$$ChatRoomModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {String id, - @JsonKey(name: 'chat_room_setting') - ChatRoomSettingsModel chatRoomSettings, - Map users}); + $Res call({String id, @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings, Map users}); @override $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings; } /// @nodoc -class __$$ChatRoomModelImplCopyWithImpl<$Res> - extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl> - implements _$$ChatRoomModelImplCopyWith<$Res> { - __$$ChatRoomModelImplCopyWithImpl( - _$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then) - : super(_value, _then); +class __$$ChatRoomModelImplCopyWithImpl<$Res> extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl> implements _$$ChatRoomModelImplCopyWith<$Res> { + __$$ChatRoomModelImplCopyWithImpl(_$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @@ -154,13 +138,10 @@ class __$$ChatRoomModelImplCopyWithImpl<$Res> @JsonSerializable() class _$ChatRoomModelImpl implements _ChatRoomModel { const _$ChatRoomModelImpl( - {required this.id, - @JsonKey(name: 'chat_room_setting') required this.chatRoomSettings, - required final Map users}) + {required this.id, @JsonKey(name: 'chat_room_setting') required this.chatRoomSettings, required final Map users}) : _users = users; - factory _$ChatRoomModelImpl.fromJson(Map json) => - _$$ChatRoomModelImplFromJson(json); + factory _$ChatRoomModelImpl.fromJson(Map json) => _$$ChatRoomModelImplFromJson(json); @override final String id; @@ -168,6 +149,7 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { @JsonKey(name: 'chat_room_setting') final ChatRoomSettingsModel chatRoomSettings; final Map _users; + @override Map get users { if (_users is EqualUnmodifiableMapView) return _users; @@ -186,23 +168,20 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { (other.runtimeType == runtimeType && other is _$ChatRoomModelImpl && (identical(other.id, id) || other.id == id) && - (identical(other.chatRoomSettings, chatRoomSettings) || - other.chatRoomSettings == chatRoomSettings) && + (identical(other.chatRoomSettings, chatRoomSettings) || other.chatRoomSettings == chatRoomSettings) && const DeepCollectionEquality().equals(other._users, _users)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, - const DeepCollectionEquality().hash(_users)); + int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, const DeepCollectionEquality().hash(_users)); /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => - __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); + _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); @override Map toJson() { @@ -215,18 +194,18 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { abstract class _ChatRoomModel implements ChatRoomModel { const factory _ChatRoomModel( {required final String id, - @JsonKey(name: 'chat_room_setting') - required final ChatRoomSettingsModel chatRoomSettings, + @JsonKey(name: 'chat_room_setting') required final ChatRoomSettingsModel chatRoomSettings, required final Map users}) = _$ChatRoomModelImpl; - factory _ChatRoomModel.fromJson(Map json) = - _$ChatRoomModelImpl.fromJson; + factory _ChatRoomModel.fromJson(Map json) = _$ChatRoomModelImpl.fromJson; @override String get id; + @override @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel get chatRoomSettings; + @override Map get users; @@ -234,6 +213,5 @@ abstract class _ChatRoomModel implements ChatRoomModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_model.g.dart b/lib/features/chat/models/chat_room_model.g.dart index 68d3195c..6230d4f4 100644 --- a/lib/features/chat/models/chat_room_model.g.dart +++ b/lib/features/chat/models/chat_room_model.g.dart @@ -6,19 +6,15 @@ part of 'chat_room_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map json) => - _$ChatRoomModelImpl( +_$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map json) => _$ChatRoomModelImpl( id: json['id'] as String, - chatRoomSettings: ChatRoomSettingsModel.fromJson( - json['chat_room_setting'] as Map), + chatRoomSettings: ChatRoomSettingsModel.fromJson(json['chat_room_setting'] as Map), users: (json['users'] as Map).map( - (k, e) => - MapEntry(k, ChatUserModel.fromJson(e as Map)), + (k, e) => MapEntry(k, ChatUserModel.fromJson(e as Map)), ), ); -Map _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) => - { +Map _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) => { 'id': instance.id, 'chat_room_setting': instance.chatRoomSettings, 'users': instance.users, diff --git a/lib/features/chat/models/chat_room_preview_model.freezed.dart b/lib/features/chat/models/chat_room_preview_model.freezed.dart index 4b006cf0..468bfb92 100644 --- a/lib/features/chat/models/chat_room_preview_model.freezed.dart +++ b/lib/features/chat/models/chat_room_preview_model.freezed.dart @@ -29,27 +29,25 @@ mixin _$ChatRoomPreviewModel { /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomPreviewModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatRoomPreviewModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomPreviewModelCopyWith<$Res> { - factory $ChatRoomPreviewModelCopyWith(ChatRoomPreviewModel value, - $Res Function(ChatRoomPreviewModel) then) = + factory $ChatRoomPreviewModelCopyWith(ChatRoomPreviewModel value, $Res Function(ChatRoomPreviewModel) then) = _$ChatRoomPreviewModelCopyWithImpl<$Res, ChatRoomPreviewModel>; + @useResult $Res call({@JsonKey(name: "chatRooms") List chatRooms}); } /// @nodoc -class _$ChatRoomPreviewModelCopyWithImpl<$Res, - $Val extends ChatRoomPreviewModel> - implements $ChatRoomPreviewModelCopyWith<$Res> { +class _$ChatRoomPreviewModelCopyWithImpl<$Res, $Val extends ChatRoomPreviewModel> implements $ChatRoomPreviewModelCopyWith<$Res> { _$ChatRoomPreviewModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -70,23 +68,19 @@ class _$ChatRoomPreviewModelCopyWithImpl<$Res, } /// @nodoc -abstract class _$$ChatRoomPreviewModelImplCopyWith<$Res> - implements $ChatRoomPreviewModelCopyWith<$Res> { - factory _$$ChatRoomPreviewModelImplCopyWith(_$ChatRoomPreviewModelImpl value, - $Res Function(_$ChatRoomPreviewModelImpl) then) = +abstract class _$$ChatRoomPreviewModelImplCopyWith<$Res> implements $ChatRoomPreviewModelCopyWith<$Res> { + factory _$$ChatRoomPreviewModelImplCopyWith(_$ChatRoomPreviewModelImpl value, $Res Function(_$ChatRoomPreviewModelImpl) then) = __$$ChatRoomPreviewModelImplCopyWithImpl<$Res>; + @override @useResult $Res call({@JsonKey(name: "chatRooms") List chatRooms}); } /// @nodoc -class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> - extends _$ChatRoomPreviewModelCopyWithImpl<$Res, _$ChatRoomPreviewModelImpl> +class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> extends _$ChatRoomPreviewModelCopyWithImpl<$Res, _$ChatRoomPreviewModelImpl> implements _$$ChatRoomPreviewModelImplCopyWith<$Res> { - __$$ChatRoomPreviewModelImplCopyWithImpl(_$ChatRoomPreviewModelImpl _value, - $Res Function(_$ChatRoomPreviewModelImpl) _then) - : super(_value, _then); + __$$ChatRoomPreviewModelImplCopyWithImpl(_$ChatRoomPreviewModelImpl _value, $Res Function(_$ChatRoomPreviewModelImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @@ -107,14 +101,12 @@ class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { - const _$ChatRoomPreviewModelImpl( - {@JsonKey(name: "chatRooms") required final List chatRooms}) - : _chatRooms = chatRooms; + const _$ChatRoomPreviewModelImpl({@JsonKey(name: "chatRooms") required final List chatRooms}) : _chatRooms = chatRooms; - factory _$ChatRoomPreviewModelImpl.fromJson(Map json) => - _$$ChatRoomPreviewModelImplFromJson(json); + factory _$ChatRoomPreviewModelImpl.fromJson(Map json) => _$$ChatRoomPreviewModelImplFromJson(json); final List _chatRooms; + @override @JsonKey(name: "chatRooms") List get chatRooms { @@ -131,26 +123,20 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChatRoomPreviewModelImpl && - const DeepCollectionEquality() - .equals(other._chatRooms, _chatRooms)); + (other.runtimeType == runtimeType && other is _$ChatRoomPreviewModelImpl && const DeepCollectionEquality().equals(other._chatRooms, _chatRooms)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> - get copyWith => - __$$ChatRoomPreviewModelImplCopyWithImpl<_$ChatRoomPreviewModelImpl>( - this, _$identity); + _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => + __$$ChatRoomPreviewModelImplCopyWithImpl<_$ChatRoomPreviewModelImpl>(this, _$identity); @override Map toJson() { @@ -161,12 +147,9 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { } abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel { - const factory _ChatRoomPreviewModel( - {@JsonKey(name: "chatRooms") - required final List chatRooms}) = _$ChatRoomPreviewModelImpl; + const factory _ChatRoomPreviewModel({@JsonKey(name: "chatRooms") required final List chatRooms}) = _$ChatRoomPreviewModelImpl; - factory _ChatRoomPreviewModel.fromJson(Map json) = - _$ChatRoomPreviewModelImpl.fromJson; + factory _ChatRoomPreviewModel.fromJson(Map json) = _$ChatRoomPreviewModelImpl.fromJson; @override @JsonKey(name: "chatRooms") @@ -176,8 +159,7 @@ abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => throw _privateConstructorUsedError; } ChatRoom _$ChatRoomFromJson(Map json) { @@ -188,10 +170,13 @@ ChatRoom _$ChatRoomFromJson(Map json) { mixin _$ChatRoom { @JsonKey(name: "id") String get id => throw _privateConstructorUsedError; + @JsonKey(name: "room_name") String get roomName => throw _privateConstructorUsedError; + @JsonKey(name: "last_message") dynamic get lastMessage => throw _privateConstructorUsedError; + @JsonKey(name: "users") Users get users => throw _privateConstructorUsedError; @@ -201,14 +186,13 @@ mixin _$ChatRoom { /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatRoomCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomCopyWith<$Res> { - factory $ChatRoomCopyWith(ChatRoom value, $Res Function(ChatRoom) then) = - _$ChatRoomCopyWithImpl<$Res, ChatRoom>; + factory $ChatRoomCopyWith(ChatRoom value, $Res Function(ChatRoom) then) = _$ChatRoomCopyWithImpl<$Res, ChatRoom>; + @useResult $Res call( {@JsonKey(name: "id") String id, @@ -220,12 +204,12 @@ abstract class $ChatRoomCopyWith<$Res> { } /// @nodoc -class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> - implements $ChatRoomCopyWith<$Res> { +class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> implements $ChatRoomCopyWith<$Res> { _$ChatRoomCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -271,11 +255,9 @@ class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> } /// @nodoc -abstract class _$$ChatRoomImplCopyWith<$Res> - implements $ChatRoomCopyWith<$Res> { - factory _$$ChatRoomImplCopyWith( - _$ChatRoomImpl value, $Res Function(_$ChatRoomImpl) then) = - __$$ChatRoomImplCopyWithImpl<$Res>; +abstract class _$$ChatRoomImplCopyWith<$Res> implements $ChatRoomCopyWith<$Res> { + factory _$$ChatRoomImplCopyWith(_$ChatRoomImpl value, $Res Function(_$ChatRoomImpl) then) = __$$ChatRoomImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -289,12 +271,8 @@ abstract class _$$ChatRoomImplCopyWith<$Res> } /// @nodoc -class __$$ChatRoomImplCopyWithImpl<$Res> - extends _$ChatRoomCopyWithImpl<$Res, _$ChatRoomImpl> - implements _$$ChatRoomImplCopyWith<$Res> { - __$$ChatRoomImplCopyWithImpl( - _$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then) - : super(_value, _then); +class __$$ChatRoomImplCopyWithImpl<$Res> extends _$ChatRoomCopyWithImpl<$Res, _$ChatRoomImpl> implements _$$ChatRoomImplCopyWith<$Res> { + __$$ChatRoomImplCopyWithImpl(_$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then) : super(_value, _then); /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @@ -336,8 +314,7 @@ class _$ChatRoomImpl implements _ChatRoom { @JsonKey(name: "last_message") required this.lastMessage, @JsonKey(name: "users") required this.users}); - factory _$ChatRoomImpl.fromJson(Map json) => - _$$ChatRoomImplFromJson(json); + factory _$ChatRoomImpl.fromJson(Map json) => _$$ChatRoomImplFromJson(json); @override @JsonKey(name: "id") @@ -363,25 +340,21 @@ class _$ChatRoomImpl implements _ChatRoom { (other.runtimeType == runtimeType && other is _$ChatRoomImpl && (identical(other.id, id) || other.id == id) && - (identical(other.roomName, roomName) || - other.roomName == roomName) && - const DeepCollectionEquality() - .equals(other.lastMessage, lastMessage) && + (identical(other.roomName, roomName) || other.roomName == roomName) && + const DeepCollectionEquality().equals(other.lastMessage, lastMessage) && (identical(other.users, users) || other.users == users)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, roomName, - const DeepCollectionEquality().hash(lastMessage), users); + int get hashCode => Object.hash(runtimeType, id, roomName, const DeepCollectionEquality().hash(lastMessage), users); /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => - __$$ChatRoomImplCopyWithImpl<_$ChatRoomImpl>(this, _$identity); + _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => __$$ChatRoomImplCopyWithImpl<_$ChatRoomImpl>(this, _$identity); @override Map toJson() { @@ -398,18 +371,20 @@ abstract class _ChatRoom implements ChatRoom { @JsonKey(name: "last_message") required final dynamic lastMessage, @JsonKey(name: "users") required final Users users}) = _$ChatRoomImpl; - factory _ChatRoom.fromJson(Map json) = - _$ChatRoomImpl.fromJson; + factory _ChatRoom.fromJson(Map json) = _$ChatRoomImpl.fromJson; @override @JsonKey(name: "id") String get id; + @override @JsonKey(name: "room_name") String get roomName; + @override @JsonKey(name: "last_message") dynamic get lastMessage; + @override @JsonKey(name: "users") Users get users; @@ -418,8 +393,7 @@ abstract class _ChatRoom implements ChatRoom { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => throw _privateConstructorUsedError; } LastMessageClass _$LastMessageClassFromJson(Map json) { @@ -430,16 +404,22 @@ LastMessageClass _$LastMessageClassFromJson(Map json) { mixin _$LastMessageClass { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "data") String get data => throw _privateConstructorUsedError; + @JsonKey(name: "media_data") List get mediaData => throw _privateConstructorUsedError; + @JsonKey(name: "author_id") int get authorId => throw _privateConstructorUsedError; + @JsonKey(name: "is_author_message_auth_user") bool get isAuthorMessageAuthUser => throw _privateConstructorUsedError; + @JsonKey(name: "read_by_to_user") bool get readByToUser => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; @@ -449,34 +429,31 @@ mixin _$LastMessageClass { /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $LastMessageClassCopyWith get copyWith => - throw _privateConstructorUsedError; + $LastMessageClassCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $LastMessageClassCopyWith<$Res> { - factory $LastMessageClassCopyWith( - LastMessageClass value, $Res Function(LastMessageClass) then) = - _$LastMessageClassCopyWithImpl<$Res, LastMessageClass>; + factory $LastMessageClassCopyWith(LastMessageClass value, $Res Function(LastMessageClass) then) = _$LastMessageClassCopyWithImpl<$Res, LastMessageClass>; + @useResult $Res call( {@JsonKey(name: "id") int id, @JsonKey(name: "data") String data, @JsonKey(name: "media_data") List mediaData, @JsonKey(name: "author_id") int authorId, - @JsonKey(name: "is_author_message_auth_user") - bool isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") bool isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") bool readByToUser, @JsonKey(name: "updated_at") DateTime updatedAt}); } /// @nodoc -class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> - implements $LastMessageClassCopyWith<$Res> { +class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> implements $LastMessageClassCopyWith<$Res> { _$LastMessageClassCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -527,11 +504,10 @@ class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> } /// @nodoc -abstract class _$$LastMessageClassImplCopyWith<$Res> - implements $LastMessageClassCopyWith<$Res> { - factory _$$LastMessageClassImplCopyWith(_$LastMessageClassImpl value, - $Res Function(_$LastMessageClassImpl) then) = +abstract class _$$LastMessageClassImplCopyWith<$Res> implements $LastMessageClassCopyWith<$Res> { + factory _$$LastMessageClassImplCopyWith(_$LastMessageClassImpl value, $Res Function(_$LastMessageClassImpl) then) = __$$LastMessageClassImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -539,19 +515,15 @@ abstract class _$$LastMessageClassImplCopyWith<$Res> @JsonKey(name: "data") String data, @JsonKey(name: "media_data") List mediaData, @JsonKey(name: "author_id") int authorId, - @JsonKey(name: "is_author_message_auth_user") - bool isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") bool isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") bool readByToUser, @JsonKey(name: "updated_at") DateTime updatedAt}); } /// @nodoc -class __$$LastMessageClassImplCopyWithImpl<$Res> - extends _$LastMessageClassCopyWithImpl<$Res, _$LastMessageClassImpl> +class __$$LastMessageClassImplCopyWithImpl<$Res> extends _$LastMessageClassCopyWithImpl<$Res, _$LastMessageClassImpl> implements _$$LastMessageClassImplCopyWith<$Res> { - __$$LastMessageClassImplCopyWithImpl(_$LastMessageClassImpl _value, - $Res Function(_$LastMessageClassImpl) _then) - : super(_value, _then); + __$$LastMessageClassImplCopyWithImpl(_$LastMessageClassImpl _value, $Res Function(_$LastMessageClassImpl) _then) : super(_value, _then); /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @@ -607,14 +579,12 @@ class _$LastMessageClassImpl implements _LastMessageClass { @JsonKey(name: "data") required this.data, @JsonKey(name: "media_data") required final List mediaData, @JsonKey(name: "author_id") required this.authorId, - @JsonKey(name: "is_author_message_auth_user") - required this.isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") required this.isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") required this.readByToUser, @JsonKey(name: "updated_at") required this.updatedAt}) : _mediaData = mediaData; - factory _$LastMessageClassImpl.fromJson(Map json) => - _$$LastMessageClassImplFromJson(json); + factory _$LastMessageClassImpl.fromJson(Map json) => _$$LastMessageClassImplFromJson(json); @override @JsonKey(name: "id") @@ -623,6 +593,7 @@ class _$LastMessageClassImpl implements _LastMessageClass { @JsonKey(name: "data") final String data; final List _mediaData; + @override @JsonKey(name: "media_data") List get mediaData { @@ -656,39 +627,24 @@ class _$LastMessageClassImpl implements _LastMessageClass { other is _$LastMessageClassImpl && (identical(other.id, id) || other.id == id) && (identical(other.data, data) || other.data == data) && - const DeepCollectionEquality() - .equals(other._mediaData, _mediaData) && - (identical(other.authorId, authorId) || - other.authorId == authorId) && - (identical( - other.isAuthorMessageAuthUser, isAuthorMessageAuthUser) || - other.isAuthorMessageAuthUser == isAuthorMessageAuthUser) && - (identical(other.readByToUser, readByToUser) || - other.readByToUser == readByToUser) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); + const DeepCollectionEquality().equals(other._mediaData, _mediaData) && + (identical(other.authorId, authorId) || other.authorId == authorId) && + (identical(other.isAuthorMessageAuthUser, isAuthorMessageAuthUser) || other.isAuthorMessageAuthUser == isAuthorMessageAuthUser) && + (identical(other.readByToUser, readByToUser) || other.readByToUser == readByToUser) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - id, - data, - const DeepCollectionEquality().hash(_mediaData), - authorId, - isAuthorMessageAuthUser, - readByToUser, - updatedAt); + int get hashCode => + Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, isAuthorMessageAuthUser, readByToUser, updatedAt); /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => - __$$LastMessageClassImplCopyWithImpl<_$LastMessageClassImpl>( - this, _$identity); + _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => __$$LastMessageClassImplCopyWithImpl<_$LastMessageClassImpl>(this, _$identity); @override Map toJson() { @@ -700,37 +656,40 @@ class _$LastMessageClassImpl implements _LastMessageClass { abstract class _LastMessageClass implements LastMessageClass { const factory _LastMessageClass( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "data") required final String data, - @JsonKey(name: "media_data") required final List mediaData, - @JsonKey(name: "author_id") required final int authorId, - @JsonKey(name: "is_author_message_auth_user") - required final bool isAuthorMessageAuthUser, - @JsonKey(name: "read_by_to_user") required final bool readByToUser, - @JsonKey(name: "updated_at") required final DateTime updatedAt}) = - _$LastMessageClassImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "data") required final String data, + @JsonKey(name: "media_data") required final List mediaData, + @JsonKey(name: "author_id") required final int authorId, + @JsonKey(name: "is_author_message_auth_user") required final bool isAuthorMessageAuthUser, + @JsonKey(name: "read_by_to_user") required final bool readByToUser, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$LastMessageClassImpl; - factory _LastMessageClass.fromJson(Map json) = - _$LastMessageClassImpl.fromJson; + factory _LastMessageClass.fromJson(Map json) = _$LastMessageClassImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "data") String get data; + @override @JsonKey(name: "media_data") List get mediaData; + @override @JsonKey(name: "author_id") int get authorId; + @override @JsonKey(name: "is_author_message_auth_user") bool get isAuthorMessageAuthUser; + @override @JsonKey(name: "read_by_to_user") bool get readByToUser; + @override @JsonKey(name: "updated_at") DateTime get updatedAt; @@ -739,8 +698,7 @@ abstract class _LastMessageClass implements LastMessageClass { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => throw _privateConstructorUsedError; } Users _$UsersFromJson(Map json) { @@ -751,6 +709,7 @@ Users _$UsersFromJson(Map json) { mixin _$Users { @JsonKey(name: "from_chat_user") ChatUser get fromChatUser => throw _privateConstructorUsedError; + @JsonKey(name: "to_chat_user") ChatUser get toChatUser => throw _privateConstructorUsedError; @@ -765,24 +724,23 @@ mixin _$Users { /// @nodoc abstract class $UsersCopyWith<$Res> { - factory $UsersCopyWith(Users value, $Res Function(Users) then) = - _$UsersCopyWithImpl<$Res, Users>; + factory $UsersCopyWith(Users value, $Res Function(Users) then) = _$UsersCopyWithImpl<$Res, Users>; + @useResult - $Res call( - {@JsonKey(name: "from_chat_user") ChatUser fromChatUser, - @JsonKey(name: "to_chat_user") ChatUser toChatUser}); + $Res call({@JsonKey(name: "from_chat_user") ChatUser fromChatUser, @JsonKey(name: "to_chat_user") ChatUser toChatUser}); $ChatUserCopyWith<$Res> get fromChatUser; + $ChatUserCopyWith<$Res> get toChatUser; } /// @nodoc -class _$UsersCopyWithImpl<$Res, $Val extends Users> - implements $UsersCopyWith<$Res> { +class _$UsersCopyWithImpl<$Res, $Val extends Users> implements $UsersCopyWith<$Res> { _$UsersCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -829,28 +787,22 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users> /// @nodoc abstract class _$$UsersImplCopyWith<$Res> implements $UsersCopyWith<$Res> { - factory _$$UsersImplCopyWith( - _$UsersImpl value, $Res Function(_$UsersImpl) then) = - __$$UsersImplCopyWithImpl<$Res>; + factory _$$UsersImplCopyWith(_$UsersImpl value, $Res Function(_$UsersImpl) then) = __$$UsersImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "from_chat_user") ChatUser fromChatUser, - @JsonKey(name: "to_chat_user") ChatUser toChatUser}); + $Res call({@JsonKey(name: "from_chat_user") ChatUser fromChatUser, @JsonKey(name: "to_chat_user") ChatUser toChatUser}); @override $ChatUserCopyWith<$Res> get fromChatUser; + @override $ChatUserCopyWith<$Res> get toChatUser; } /// @nodoc -class __$$UsersImplCopyWithImpl<$Res> - extends _$UsersCopyWithImpl<$Res, _$UsersImpl> - implements _$$UsersImplCopyWith<$Res> { - __$$UsersImplCopyWithImpl( - _$UsersImpl _value, $Res Function(_$UsersImpl) _then) - : super(_value, _then); +class __$$UsersImplCopyWithImpl<$Res> extends _$UsersCopyWithImpl<$Res, _$UsersImpl> implements _$$UsersImplCopyWith<$Res> { + __$$UsersImplCopyWithImpl(_$UsersImpl _value, $Res Function(_$UsersImpl) _then) : super(_value, _then); /// Create a copy of Users /// with the given fields replaced by the non-null parameter values. @@ -876,12 +828,9 @@ class __$$UsersImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$UsersImpl implements _Users { - const _$UsersImpl( - {@JsonKey(name: "from_chat_user") required this.fromChatUser, - @JsonKey(name: "to_chat_user") required this.toChatUser}); + const _$UsersImpl({@JsonKey(name: "from_chat_user") required this.fromChatUser, @JsonKey(name: "to_chat_user") required this.toChatUser}); - factory _$UsersImpl.fromJson(Map json) => - _$$UsersImplFromJson(json); + factory _$UsersImpl.fromJson(Map json) => _$$UsersImplFromJson(json); @override @JsonKey(name: "from_chat_user") @@ -900,10 +849,8 @@ class _$UsersImpl implements _Users { return identical(this, other) || (other.runtimeType == runtimeType && other is _$UsersImpl && - (identical(other.fromChatUser, fromChatUser) || - other.fromChatUser == fromChatUser) && - (identical(other.toChatUser, toChatUser) || - other.toChatUser == toChatUser)); + (identical(other.fromChatUser, fromChatUser) || other.fromChatUser == fromChatUser) && + (identical(other.toChatUser, toChatUser) || other.toChatUser == toChatUser)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -915,8 +862,7 @@ class _$UsersImpl implements _Users { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UsersImplCopyWith<_$UsersImpl> get copyWith => - __$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity); + _$$UsersImplCopyWith<_$UsersImpl> get copyWith => __$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity); @override Map toJson() { @@ -928,15 +874,14 @@ class _$UsersImpl implements _Users { abstract class _Users implements Users { const factory _Users( - {@JsonKey(name: "from_chat_user") required final ChatUser fromChatUser, - @JsonKey(name: "to_chat_user") - required final ChatUser toChatUser}) = _$UsersImpl; + {@JsonKey(name: "from_chat_user") required final ChatUser fromChatUser, @JsonKey(name: "to_chat_user") required final ChatUser toChatUser}) = _$UsersImpl; factory _Users.fromJson(Map json) = _$UsersImpl.fromJson; @override @JsonKey(name: "from_chat_user") ChatUser get fromChatUser; + @override @JsonKey(name: "to_chat_user") ChatUser get toChatUser; @@ -945,8 +890,7 @@ abstract class _Users implements Users { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$UsersImplCopyWith<_$UsersImpl> get copyWith => - throw _privateConstructorUsedError; + _$$UsersImplCopyWith<_$UsersImpl> get copyWith => throw _privateConstructorUsedError; } ChatUser _$ChatUserFromJson(Map json) { @@ -957,10 +901,13 @@ ChatUser _$ChatUserFromJson(Map json) { mixin _$ChatUser { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; + @JsonKey(name: "profile_photo_path") String? get profilePhotoPath => throw _privateConstructorUsedError; + @JsonKey(name: "profile_photo_url") String get profilePhotoUrl => throw _privateConstructorUsedError; @@ -970,14 +917,13 @@ mixin _$ChatUser { /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatUserCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatUserCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatUserCopyWith<$Res> { - factory $ChatUserCopyWith(ChatUser value, $Res Function(ChatUser) then) = - _$ChatUserCopyWithImpl<$Res, ChatUser>; + factory $ChatUserCopyWith(ChatUser value, $Res Function(ChatUser) then) = _$ChatUserCopyWithImpl<$Res, ChatUser>; + @useResult $Res call( {@JsonKey(name: "id") int id, @@ -987,12 +933,12 @@ abstract class $ChatUserCopyWith<$Res> { } /// @nodoc -class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> - implements $ChatUserCopyWith<$Res> { +class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> implements $ChatUserCopyWith<$Res> { _$ChatUserCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -1028,11 +974,9 @@ class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> } /// @nodoc -abstract class _$$ChatUserImplCopyWith<$Res> - implements $ChatUserCopyWith<$Res> { - factory _$$ChatUserImplCopyWith( - _$ChatUserImpl value, $Res Function(_$ChatUserImpl) then) = - __$$ChatUserImplCopyWithImpl<$Res>; +abstract class _$$ChatUserImplCopyWith<$Res> implements $ChatUserCopyWith<$Res> { + factory _$$ChatUserImplCopyWith(_$ChatUserImpl value, $Res Function(_$ChatUserImpl) then) = __$$ChatUserImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -1043,12 +987,8 @@ abstract class _$$ChatUserImplCopyWith<$Res> } /// @nodoc -class __$$ChatUserImplCopyWithImpl<$Res> - extends _$ChatUserCopyWithImpl<$Res, _$ChatUserImpl> - implements _$$ChatUserImplCopyWith<$Res> { - __$$ChatUserImplCopyWithImpl( - _$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then) - : super(_value, _then); +class __$$ChatUserImplCopyWithImpl<$Res> extends _$ChatUserCopyWithImpl<$Res, _$ChatUserImpl> implements _$$ChatUserImplCopyWith<$Res> { + __$$ChatUserImplCopyWithImpl(_$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then) : super(_value, _then); /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @@ -1090,8 +1030,7 @@ class _$ChatUserImpl implements _ChatUser { @JsonKey(name: "profile_photo_path") required this.profilePhotoPath, @JsonKey(name: "profile_photo_url") required this.profilePhotoUrl}); - factory _$ChatUserImpl.fromJson(Map json) => - _$$ChatUserImplFromJson(json); + factory _$ChatUserImpl.fromJson(Map json) => _$$ChatUserImplFromJson(json); @override @JsonKey(name: "id") @@ -1118,24 +1057,20 @@ class _$ChatUserImpl implements _ChatUser { other is _$ChatUserImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.profilePhotoPath, profilePhotoPath) || - other.profilePhotoPath == profilePhotoPath) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || - other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoPath, profilePhotoPath) || other.profilePhotoPath == profilePhotoPath) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); + int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => - __$$ChatUserImplCopyWithImpl<_$ChatUserImpl>(this, _$identity); + _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => __$$ChatUserImplCopyWithImpl<_$ChatUserImpl>(this, _$identity); @override Map toJson() { @@ -1149,23 +1084,23 @@ abstract class _ChatUser implements ChatUser { const factory _ChatUser( {@JsonKey(name: "id") required final int id, @JsonKey(name: "name") required final String name, - @JsonKey(name: "profile_photo_path") - required final String? profilePhotoPath, - @JsonKey(name: "profile_photo_url") - required final String profilePhotoUrl}) = _$ChatUserImpl; + @JsonKey(name: "profile_photo_path") required final String? profilePhotoPath, + @JsonKey(name: "profile_photo_url") required final String profilePhotoUrl}) = _$ChatUserImpl; - factory _ChatUser.fromJson(Map json) = - _$ChatUserImpl.fromJson; + factory _ChatUser.fromJson(Map json) = _$ChatUserImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "name") String get name; + @override @JsonKey(name: "profile_photo_path") String? get profilePhotoPath; + @override @JsonKey(name: "profile_photo_url") String get profilePhotoUrl; @@ -1174,6 +1109,5 @@ abstract class _ChatUser implements ChatUser { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_preview_model.g.dart b/lib/features/chat/models/chat_room_preview_model.g.dart index 5ae3f709..ef589a94 100644 --- a/lib/features/chat/models/chat_room_preview_model.g.dart +++ b/lib/features/chat/models/chat_room_preview_model.g.dart @@ -6,39 +6,29 @@ part of 'chat_room_preview_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson( - Map json) => - _$ChatRoomPreviewModelImpl( - chatRooms: (json['chatRooms'] as List) - .map((e) => ChatRoom.fromJson(e as Map)) - .toList(), +_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson(Map json) => _$ChatRoomPreviewModelImpl( + chatRooms: (json['chatRooms'] as List).map((e) => ChatRoom.fromJson(e as Map)).toList(), ); -Map _$$ChatRoomPreviewModelImplToJson( - _$ChatRoomPreviewModelImpl instance) => - { +Map _$$ChatRoomPreviewModelImplToJson(_$ChatRoomPreviewModelImpl instance) => { 'chatRooms': instance.chatRooms, }; -_$ChatRoomImpl _$$ChatRoomImplFromJson(Map json) => - _$ChatRoomImpl( +_$ChatRoomImpl _$$ChatRoomImplFromJson(Map json) => _$ChatRoomImpl( id: json['id'] as String, roomName: json['room_name'] as String, lastMessage: json['last_message'], users: Users.fromJson(json['users'] as Map), ); -Map _$$ChatRoomImplToJson(_$ChatRoomImpl instance) => - { +Map _$$ChatRoomImplToJson(_$ChatRoomImpl instance) => { 'id': instance.id, 'room_name': instance.roomName, 'last_message': instance.lastMessage, 'users': instance.users, }; -_$LastMessageClassImpl _$$LastMessageClassImplFromJson( - Map json) => - _$LastMessageClassImpl( +_$LastMessageClassImpl _$$LastMessageClassImplFromJson(Map json) => _$LastMessageClassImpl( id: (json['id'] as num).toInt(), data: json['data'] as String, mediaData: json['media_data'] as List, @@ -48,9 +38,7 @@ _$LastMessageClassImpl _$$LastMessageClassImplFromJson( updatedAt: DateTime.parse(json['updated_at'] as String), ); -Map _$$LastMessageClassImplToJson( - _$LastMessageClassImpl instance) => - { +Map _$$LastMessageClassImplToJson(_$LastMessageClassImpl instance) => { 'id': instance.id, 'data': instance.data, 'media_data': instance.mediaData, @@ -61,28 +49,23 @@ Map _$$LastMessageClassImplToJson( }; _$UsersImpl _$$UsersImplFromJson(Map json) => _$UsersImpl( - fromChatUser: - ChatUser.fromJson(json['from_chat_user'] as Map), - toChatUser: - ChatUser.fromJson(json['to_chat_user'] as Map), + fromChatUser: ChatUser.fromJson(json['from_chat_user'] as Map), + toChatUser: ChatUser.fromJson(json['to_chat_user'] as Map), ); -Map _$$UsersImplToJson(_$UsersImpl instance) => - { +Map _$$UsersImplToJson(_$UsersImpl instance) => { 'from_chat_user': instance.fromChatUser, 'to_chat_user': instance.toChatUser, }; -_$ChatUserImpl _$$ChatUserImplFromJson(Map json) => - _$ChatUserImpl( +_$ChatUserImpl _$$ChatUserImplFromJson(Map json) => _$ChatUserImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, profilePhotoPath: json['profile_photo_path'] as String?, profilePhotoUrl: json['profile_photo_url'] as String, ); -Map _$$ChatUserImplToJson(_$ChatUserImpl instance) => - { +Map _$$ChatUserImplToJson(_$ChatUserImpl instance) => { 'id': instance.id, 'name': instance.name, 'profile_photo_path': instance.profilePhotoPath, diff --git a/lib/features/chat/models/chat_room_settings_model.freezed.dart b/lib/features/chat/models/chat_room_settings_model.freezed.dart index 9d12eefa..76419b76 100644 --- a/lib/features/chat/models/chat_room_settings_model.freezed.dart +++ b/lib/features/chat/models/chat_room_settings_model.freezed.dart @@ -14,19 +14,22 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson( - Map json) { +ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson(Map json) { return _ChatRoomSettingsModel.fromJson(json); } /// @nodoc mixin _$ChatRoomSettingsModel { int get id => throw _privateConstructorUsedError; + @JsonKey(name: 'room_name') String get roomName => throw _privateConstructorUsedError; + String get state => throw _privateConstructorUsedError; + @JsonKey(name: 'access_level') String get accessLevel => throw _privateConstructorUsedError; + @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; @@ -36,15 +39,14 @@ mixin _$ChatRoomSettingsModel { /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomSettingsModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatRoomSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomSettingsModelCopyWith<$Res> { - factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value, - $Res Function(ChatRoomSettingsModel) then) = + factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value, $Res Function(ChatRoomSettingsModel) then) = _$ChatRoomSettingsModelCopyWithImpl<$Res, ChatRoomSettingsModel>; + @useResult $Res call( {int id, @@ -55,13 +57,12 @@ abstract class $ChatRoomSettingsModelCopyWith<$Res> { } /// @nodoc -class _$ChatRoomSettingsModelCopyWithImpl<$Res, - $Val extends ChatRoomSettingsModel> - implements $ChatRoomSettingsModelCopyWith<$Res> { +class _$ChatRoomSettingsModelCopyWithImpl<$Res, $Val extends ChatRoomSettingsModel> implements $ChatRoomSettingsModelCopyWith<$Res> { _$ChatRoomSettingsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -102,12 +103,10 @@ class _$ChatRoomSettingsModelCopyWithImpl<$Res, } /// @nodoc -abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> - implements $ChatRoomSettingsModelCopyWith<$Res> { - factory _$$ChatRoomSettingsModelImplCopyWith( - _$ChatRoomSettingsModelImpl value, - $Res Function(_$ChatRoomSettingsModelImpl) then) = +abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> implements $ChatRoomSettingsModelCopyWith<$Res> { + factory _$$ChatRoomSettingsModelImplCopyWith(_$ChatRoomSettingsModelImpl value, $Res Function(_$ChatRoomSettingsModelImpl) then) = __$$ChatRoomSettingsModelImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -119,13 +118,9 @@ abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> } /// @nodoc -class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res> - extends _$ChatRoomSettingsModelCopyWithImpl<$Res, - _$ChatRoomSettingsModelImpl> +class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res> extends _$ChatRoomSettingsModelCopyWithImpl<$Res, _$ChatRoomSettingsModelImpl> implements _$$ChatRoomSettingsModelImplCopyWith<$Res> { - __$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value, - $Res Function(_$ChatRoomSettingsModelImpl) _then) - : super(_value, _then); + __$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value, $Res Function(_$ChatRoomSettingsModelImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @@ -173,8 +168,7 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { @JsonKey(name: 'access_level') required this.accessLevel, @JsonKey(name: 'updated_at') required this.updatedAt}); - factory _$ChatRoomSettingsModelImpl.fromJson(Map json) => - _$$ChatRoomSettingsModelImplFromJson(json); + factory _$ChatRoomSettingsModelImpl.fromJson(Map json) => _$$ChatRoomSettingsModelImplFromJson(json); @override final int id; @@ -201,28 +195,23 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { (other.runtimeType == runtimeType && other is _$ChatRoomSettingsModelImpl && (identical(other.id, id) || other.id == id) && - (identical(other.roomName, roomName) || - other.roomName == roomName) && + (identical(other.roomName, roomName) || other.roomName == roomName) && (identical(other.state, state) || other.state == state) && - (identical(other.accessLevel, accessLevel) || - other.accessLevel == accessLevel) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); + (identical(other.accessLevel, accessLevel) || other.accessLevel == accessLevel) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); + int get hashCode => Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> - get copyWith => __$$ChatRoomSettingsModelImplCopyWithImpl< - _$ChatRoomSettingsModelImpl>(this, _$identity); + _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => + __$$ChatRoomSettingsModelImplCopyWithImpl<_$ChatRoomSettingsModelImpl>(this, _$identity); @override Map toJson() { @@ -234,26 +223,28 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel { const factory _ChatRoomSettingsModel( - {required final int id, - @JsonKey(name: 'room_name') required final String roomName, - required final String state, - @JsonKey(name: 'access_level') required final String accessLevel, - @JsonKey(name: 'updated_at') required final String updatedAt}) = - _$ChatRoomSettingsModelImpl; + {required final int id, + @JsonKey(name: 'room_name') required final String roomName, + required final String state, + @JsonKey(name: 'access_level') required final String accessLevel, + @JsonKey(name: 'updated_at') required final String updatedAt}) = _$ChatRoomSettingsModelImpl; - factory _ChatRoomSettingsModel.fromJson(Map json) = - _$ChatRoomSettingsModelImpl.fromJson; + factory _ChatRoomSettingsModel.fromJson(Map json) = _$ChatRoomSettingsModelImpl.fromJson; @override int get id; + @override @JsonKey(name: 'room_name') String get roomName; + @override String get state; + @override @JsonKey(name: 'access_level') String get accessLevel; + @override @JsonKey(name: 'updated_at') String get updatedAt; @@ -262,6 +253,5 @@ abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_settings_model.g.dart b/lib/features/chat/models/chat_room_settings_model.g.dart index 7b824334..1a2ef327 100644 --- a/lib/features/chat/models/chat_room_settings_model.g.dart +++ b/lib/features/chat/models/chat_room_settings_model.g.dart @@ -6,9 +6,7 @@ part of 'chat_room_settings_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson( - Map json) => - _$ChatRoomSettingsModelImpl( +_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson(Map json) => _$ChatRoomSettingsModelImpl( id: (json['id'] as num).toInt(), roomName: json['room_name'] as String, state: json['state'] as String, @@ -16,9 +14,7 @@ _$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson( updatedAt: json['updated_at'] as String, ); -Map _$$ChatRoomSettingsModelImplToJson( - _$ChatRoomSettingsModelImpl instance) => - { +Map _$$ChatRoomSettingsModelImplToJson(_$ChatRoomSettingsModelImpl instance) => { 'id': instance.id, 'room_name': instance.roomName, 'state': instance.state, diff --git a/lib/features/chat/models/chat_user_model.freezed.dart b/lib/features/chat/models/chat_user_model.freezed.dart index 94718168..166e3870 100644 --- a/lib/features/chat/models/chat_user_model.freezed.dart +++ b/lib/features/chat/models/chat_user_model.freezed.dart @@ -21,9 +21,12 @@ ChatUserModel _$ChatUserModelFromJson(Map json) { /// @nodoc mixin _$ChatUserModel { int get id => throw _privateConstructorUsedError; + String get name => throw _privateConstructorUsedError; + @JsonKey(name: 'profile_photo_path') String? get profilePhotoPath => throw _privateConstructorUsedError; + @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl => throw _privateConstructorUsedError; @@ -33,30 +36,24 @@ mixin _$ChatUserModel { /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatUserModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatUserModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatUserModelCopyWith<$Res> { - factory $ChatUserModelCopyWith( - ChatUserModel value, $Res Function(ChatUserModel) then) = - _$ChatUserModelCopyWithImpl<$Res, ChatUserModel>; + factory $ChatUserModelCopyWith(ChatUserModel value, $Res Function(ChatUserModel) then) = _$ChatUserModelCopyWithImpl<$Res, ChatUserModel>; + @useResult - $Res call( - {int id, - String name, - @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, - @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); + $Res call({int id, String name, @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); } /// @nodoc -class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> - implements $ChatUserModelCopyWith<$Res> { +class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> implements $ChatUserModelCopyWith<$Res> { _$ChatUserModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -92,27 +89,17 @@ class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> } /// @nodoc -abstract class _$$ChatUserModelImplCopyWith<$Res> - implements $ChatUserModelCopyWith<$Res> { - factory _$$ChatUserModelImplCopyWith( - _$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) = - __$$ChatUserModelImplCopyWithImpl<$Res>; +abstract class _$$ChatUserModelImplCopyWith<$Res> implements $ChatUserModelCopyWith<$Res> { + factory _$$ChatUserModelImplCopyWith(_$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) = __$$ChatUserModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {int id, - String name, - @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, - @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); + $Res call({int id, String name, @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); } /// @nodoc -class __$$ChatUserModelImplCopyWithImpl<$Res> - extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl> - implements _$$ChatUserModelImplCopyWith<$Res> { - __$$ChatUserModelImplCopyWithImpl( - _$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then) - : super(_value, _then); +class __$$ChatUserModelImplCopyWithImpl<$Res> extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl> implements _$$ChatUserModelImplCopyWith<$Res> { + __$$ChatUserModelImplCopyWithImpl(_$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then) : super(_value, _then); /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @@ -154,8 +141,7 @@ class _$ChatUserModelImpl implements _ChatUserModel { @JsonKey(name: 'profile_photo_path') this.profilePhotoPath, @JsonKey(name: 'profile_photo_url') this.profilePhotoUrl}); - factory _$ChatUserModelImpl.fromJson(Map json) => - _$$ChatUserModelImplFromJson(json); + factory _$ChatUserModelImpl.fromJson(Map json) => _$$ChatUserModelImplFromJson(json); @override final int id; @@ -180,24 +166,20 @@ class _$ChatUserModelImpl implements _ChatUserModel { other is _$ChatUserModelImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.profilePhotoPath, profilePhotoPath) || - other.profilePhotoPath == profilePhotoPath) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || - other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoPath, profilePhotoPath) || other.profilePhotoPath == profilePhotoPath) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); + int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => - __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); + _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); @override Map toJson() { @@ -209,22 +191,23 @@ class _$ChatUserModelImpl implements _ChatUserModel { abstract class _ChatUserModel implements ChatUserModel { const factory _ChatUserModel( - {required final int id, - required final String name, - @JsonKey(name: 'profile_photo_path') final String? profilePhotoPath, - @JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) = - _$ChatUserModelImpl; + {required final int id, + required final String name, + @JsonKey(name: 'profile_photo_path') final String? profilePhotoPath, + @JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) = _$ChatUserModelImpl; - factory _ChatUserModel.fromJson(Map json) = - _$ChatUserModelImpl.fromJson; + factory _ChatUserModel.fromJson(Map json) = _$ChatUserModelImpl.fromJson; @override int get id; + @override String get name; + @override @JsonKey(name: 'profile_photo_path') String? get profilePhotoPath; + @override @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl; @@ -233,6 +216,5 @@ abstract class _ChatUserModel implements ChatUserModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_user_model.g.dart b/lib/features/chat/models/chat_user_model.g.dart index 78e0f981..06fa92a0 100644 --- a/lib/features/chat/models/chat_user_model.g.dart +++ b/lib/features/chat/models/chat_user_model.g.dart @@ -6,16 +6,14 @@ part of 'chat_user_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatUserModelImpl _$$ChatUserModelImplFromJson(Map json) => - _$ChatUserModelImpl( +_$ChatUserModelImpl _$$ChatUserModelImplFromJson(Map json) => _$ChatUserModelImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, profilePhotoPath: json['profile_photo_path'] as String?, profilePhotoUrl: json['profile_photo_url'] as String?, ); -Map _$$ChatUserModelImplToJson(_$ChatUserModelImpl instance) => - { +Map _$$ChatUserModelImplToJson(_$ChatUserModelImpl instance) => { 'id': instance.id, 'name': instance.name, 'profile_photo_path': instance.profilePhotoPath, diff --git a/lib/features/chat/models/websocket_info_model.freezed.dart b/lib/features/chat/models/websocket_info_model.freezed.dart index 9cddabee..dd7a6bb0 100644 --- a/lib/features/chat/models/websocket_info_model.freezed.dart +++ b/lib/features/chat/models/websocket_info_model.freezed.dart @@ -21,9 +21,13 @@ WebsocketInfoModel _$WebsocketInfoModelFromJson(Map json) { /// @nodoc mixin _$WebsocketInfoModel { String get key => throw _privateConstructorUsedError; + String get host => throw _privateConstructorUsedError; + String get port => throw _privateConstructorUsedError; + String get cluster => throw _privateConstructorUsedError; + @JsonKey(name: 'user_id') int get userId => throw _privateConstructorUsedError; @@ -33,31 +37,25 @@ mixin _$WebsocketInfoModel { /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $WebsocketInfoModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $WebsocketInfoModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $WebsocketInfoModelCopyWith<$Res> { - factory $WebsocketInfoModelCopyWith( - WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) = + factory $WebsocketInfoModelCopyWith(WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) = _$WebsocketInfoModelCopyWithImpl<$Res, WebsocketInfoModel>; + @useResult - $Res call( - {String key, - String host, - String port, - String cluster, - @JsonKey(name: 'user_id') int userId}); + $Res call({String key, String host, String port, String cluster, @JsonKey(name: 'user_id') int userId}); } /// @nodoc -class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> - implements $WebsocketInfoModelCopyWith<$Res> { +class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> implements $WebsocketInfoModelCopyWith<$Res> { _$WebsocketInfoModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -98,28 +96,19 @@ class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> } /// @nodoc -abstract class _$$WebsocketInfoModelImplCopyWith<$Res> - implements $WebsocketInfoModelCopyWith<$Res> { - factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value, - $Res Function(_$WebsocketInfoModelImpl) then) = +abstract class _$$WebsocketInfoModelImplCopyWith<$Res> implements $WebsocketInfoModelCopyWith<$Res> { + factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value, $Res Function(_$WebsocketInfoModelImpl) then) = __$$WebsocketInfoModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {String key, - String host, - String port, - String cluster, - @JsonKey(name: 'user_id') int userId}); + $Res call({String key, String host, String port, String cluster, @JsonKey(name: 'user_id') int userId}); } /// @nodoc -class __$$WebsocketInfoModelImplCopyWithImpl<$Res> - extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl> +class __$$WebsocketInfoModelImplCopyWithImpl<$Res> extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl> implements _$$WebsocketInfoModelImplCopyWith<$Res> { - __$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value, - $Res Function(_$WebsocketInfoModelImpl) _then) - : super(_value, _then); + __$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value, $Res Function(_$WebsocketInfoModelImpl) _then) : super(_value, _then); /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @@ -161,14 +150,9 @@ class __$$WebsocketInfoModelImplCopyWithImpl<$Res> @JsonSerializable() class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { const _$WebsocketInfoModelImpl( - {required this.key, - required this.host, - required this.port, - required this.cluster, - @JsonKey(name: 'user_id') required this.userId}); + {required this.key, required this.host, required this.port, required this.cluster, @JsonKey(name: 'user_id') required this.userId}); - factory _$WebsocketInfoModelImpl.fromJson(Map json) => - _$$WebsocketInfoModelImplFromJson(json); + factory _$WebsocketInfoModelImpl.fromJson(Map json) => _$$WebsocketInfoModelImplFromJson(json); @override final String key; @@ -201,8 +185,7 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, key, host, port, cluster, userId); + int get hashCode => Object.hash(runtimeType, key, host, port, cluster, userId); /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @@ -210,8 +193,7 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @override @pragma('vm:prefer-inline') _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => - __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>( - this, _$identity); + __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>(this, _$identity); @override Map toJson() { @@ -223,24 +205,26 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { abstract class _WebsocketInfoModel implements WebsocketInfoModel { const factory _WebsocketInfoModel( - {required final String key, - required final String host, - required final String port, - required final String cluster, - @JsonKey(name: 'user_id') required final int userId}) = - _$WebsocketInfoModelImpl; + {required final String key, + required final String host, + required final String port, + required final String cluster, + @JsonKey(name: 'user_id') required final int userId}) = _$WebsocketInfoModelImpl; - factory _WebsocketInfoModel.fromJson(Map json) = - _$WebsocketInfoModelImpl.fromJson; + factory _WebsocketInfoModel.fromJson(Map json) = _$WebsocketInfoModelImpl.fromJson; @override String get key; + @override String get host; + @override String get port; + @override String get cluster; + @override @JsonKey(name: 'user_id') int get userId; @@ -249,6 +233,5 @@ abstract class _WebsocketInfoModel implements WebsocketInfoModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/websocket_info_model.g.dart b/lib/features/chat/models/websocket_info_model.g.dart index b2bb1248..91c386f8 100644 --- a/lib/features/chat/models/websocket_info_model.g.dart +++ b/lib/features/chat/models/websocket_info_model.g.dart @@ -6,9 +6,7 @@ part of 'websocket_info_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson( - Map json) => - _$WebsocketInfoModelImpl( +_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson(Map json) => _$WebsocketInfoModelImpl( key: json['key'] as String, host: json['host'] as String, port: json['port'] as String, @@ -16,9 +14,7 @@ _$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson( userId: (json['user_id'] as num).toInt(), ); -Map _$$WebsocketInfoModelImplToJson( - _$WebsocketInfoModelImpl instance) => - { +Map _$$WebsocketInfoModelImplToJson(_$WebsocketInfoModelImpl instance) => { 'key': instance.key, 'host': instance.host, 'port': instance.port, diff --git a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart index 4695b4ad..9a27a0ba 100644 --- a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart @@ -20,19 +20,16 @@ mixin _$ChatRoomState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading) - loaded, + required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -40,9 +37,7 @@ mixin _$ChatRoomState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -76,18 +71,16 @@ mixin _$ChatRoomState { /// @nodoc abstract class $ChatRoomStateCopyWith<$Res> { - factory $ChatRoomStateCopyWith( - ChatRoomState value, $Res Function(ChatRoomState) then) = - _$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>; + factory $ChatRoomStateCopyWith(ChatRoomState value, $Res Function(ChatRoomState) then) = _$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>; } /// @nodoc -class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> - implements $ChatRoomStateCopyWith<$Res> { +class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> implements $ChatRoomStateCopyWith<$Res> { _$ChatRoomStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -97,18 +90,12 @@ class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> /// @nodoc abstract class _$$ChatRoomStateImplCopyWith<$Res> { - factory _$$ChatRoomStateImplCopyWith( - _$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) = - __$$ChatRoomStateImplCopyWithImpl<$Res>; + factory _$$ChatRoomStateImplCopyWith(_$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) = __$$ChatRoomStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatRoomStateImplCopyWithImpl<$Res> - extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl> - implements _$$ChatRoomStateImplCopyWith<$Res> { - __$$ChatRoomStateImplCopyWithImpl( - _$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then) - : super(_value, _then); +class __$$ChatRoomStateImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl> implements _$$ChatRoomStateImplCopyWith<$Res> { + __$$ChatRoomStateImplCopyWithImpl(_$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -126,8 +113,7 @@ class _$ChatRoomStateImpl implements _ChatRoomState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatRoomStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateImpl); } @override @@ -138,9 +124,7 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading) - loaded, + required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -151,9 +135,7 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -164,9 +146,7 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -220,18 +200,14 @@ abstract class _ChatRoomState implements ChatRoomState { /// @nodoc abstract class _$$ChatRoomStateLoadingImplCopyWith<$Res> { - factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value, - $Res Function(_$ChatRoomStateLoadingImpl) then) = + factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value, $Res Function(_$ChatRoomStateLoadingImpl) then) = __$$ChatRoomStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res> - extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl> +class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl> implements _$$ChatRoomStateLoadingImplCopyWith<$Res> { - __$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value, - $Res Function(_$ChatRoomStateLoadingImpl) _then) - : super(_value, _then); + __$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value, $Res Function(_$ChatRoomStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -249,9 +225,7 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChatRoomStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateLoadingImpl); } @override @@ -262,9 +236,7 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading) - loaded, + required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -275,9 +247,7 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -288,9 +258,7 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -344,26 +312,19 @@ abstract class ChatRoomStateLoading implements ChatRoomState { /// @nodoc abstract class _$$ChatRoomStateLoadedImplCopyWith<$Res> { - factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value, - $Res Function(_$ChatRoomStateLoadedImpl) then) = + factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value, $Res Function(_$ChatRoomStateLoadedImpl) then) = __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>; + @useResult - $Res call( - {ChatRoomModel chatRoom, - List chatMessages, - bool isTyping, - bool isLoading}); + $Res call({ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading}); $ChatRoomModelCopyWith<$Res> get chatRoom; } /// @nodoc -class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> - extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl> +class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl> implements _$$ChatRoomStateLoadedImplCopyWith<$Res> { - __$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value, - $Res Function(_$ChatRoomStateLoadedImpl) _then) - : super(_value, _then); + __$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value, $Res Function(_$ChatRoomStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -409,16 +370,13 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { - const _$ChatRoomStateLoadedImpl( - {required this.chatRoom, - required final List chatMessages, - required this.isTyping, - required this.isLoading}) + const _$ChatRoomStateLoadedImpl({required this.chatRoom, required final List chatMessages, required this.isTyping, required this.isLoading}) : _chatMessages = chatMessages; @override final ChatRoomModel chatRoom; final List _chatMessages; + @override List get chatMessages { if (_chatMessages is EqualUnmodifiableListView) return _chatMessages; @@ -441,19 +399,14 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateLoadedImpl && - (identical(other.chatRoom, chatRoom) || - other.chatRoom == chatRoom) && - const DeepCollectionEquality() - .equals(other._chatMessages, _chatMessages) && - (identical(other.isTyping, isTyping) || - other.isTyping == isTyping) && - (identical(other.isLoading, isLoading) || - other.isLoading == isLoading)); + (identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom) && + const DeepCollectionEquality().equals(other._chatMessages, _chatMessages) && + (identical(other.isTyping, isTyping) || other.isTyping == isTyping) && + (identical(other.isLoading, isLoading) || other.isLoading == isLoading)); } @override - int get hashCode => Object.hash(runtimeType, chatRoom, - const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); + int get hashCode => Object.hash(runtimeType, chatRoom, const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -461,17 +414,14 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { @override @pragma('vm:prefer-inline') _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => - __$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>( - this, _$identity); + __$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading) - loaded, + required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return loaded(chatRoom, chatMessages, isTyping, isLoading); @@ -482,9 +432,7 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(chatRoom, chatMessages, isTyping, isLoading); @@ -495,9 +443,7 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -553,33 +499,32 @@ abstract class ChatRoomStateLoaded implements ChatRoomState { required final bool isLoading}) = _$ChatRoomStateLoadedImpl; ChatRoomModel get chatRoom; + List get chatMessages; + bool get isTyping; + bool get isLoading; /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ChatRoomStateErrorImplCopyWith<$Res> { - factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value, - $Res Function(_$ChatRoomStateErrorImpl) then) = + factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value, $Res Function(_$ChatRoomStateErrorImpl) then) = __$$ChatRoomStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ChatRoomStateErrorImplCopyWithImpl<$Res> - extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl> +class __$$ChatRoomStateErrorImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl> implements _$$ChatRoomStateErrorImplCopyWith<$Res> { - __$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value, - $Res Function(_$ChatRoomStateErrorImpl) _then) - : super(_value, _then); + __$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value, $Res Function(_$ChatRoomStateErrorImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -615,8 +560,7 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -628,17 +572,14 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { @override @pragma('vm:prefer-inline') _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => - __$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>( - this, _$identity); + __$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading) - loaded, + required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -649,9 +590,7 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -662,9 +601,7 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -713,14 +650,12 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { } abstract class ChatRoomStateError implements ChatRoomState { - const factory ChatRoomStateError({required final String errorMessage}) = - _$ChatRoomStateErrorImpl; + const factory ChatRoomStateError({required final String errorMessage}) = _$ChatRoomStateErrorImpl; String get errorMessage; /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart index 99fa9054..1b216a02 100644 --- a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$ChatSelectState { required TResult Function(List chatRooms) loaded, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ mixin _$ChatSelectState { /// @nodoc abstract class $ChatSelectStateCopyWith<$Res> { - factory $ChatSelectStateCopyWith( - ChatSelectState value, $Res Function(ChatSelectState) then) = - _$ChatSelectStateCopyWithImpl<$Res, ChatSelectState>; + factory $ChatSelectStateCopyWith(ChatSelectState value, $Res Function(ChatSelectState) then) = _$ChatSelectStateCopyWithImpl<$Res, ChatSelectState>; } /// @nodoc -class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> - implements $ChatSelectStateCopyWith<$Res> { +class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> implements $ChatSelectStateCopyWith<$Res> { _$ChatSelectStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +90,13 @@ class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> /// @nodoc abstract class _$$ChatSelectStateImplCopyWith<$Res> { - factory _$$ChatSelectStateImplCopyWith(_$ChatSelectStateImpl value, - $Res Function(_$ChatSelectStateImpl) then) = - __$$ChatSelectStateImplCopyWithImpl<$Res>; + factory _$$ChatSelectStateImplCopyWith(_$ChatSelectStateImpl value, $Res Function(_$ChatSelectStateImpl) then) = __$$ChatSelectStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatSelectStateImplCopyWithImpl<$Res> - extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateImpl> +class __$$ChatSelectStateImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateImpl> implements _$$ChatSelectStateImplCopyWith<$Res> { - __$$ChatSelectStateImplCopyWithImpl( - _$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then) - : super(_value, _then); + __$$ChatSelectStateImplCopyWithImpl(_$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then) : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -120,8 +114,7 @@ class _$ChatSelectStateImpl implements _ChatSelectState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatSelectStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateImpl); } @override @@ -208,20 +201,14 @@ abstract class _ChatSelectState implements ChatSelectState { /// @nodoc abstract class _$$ChatSelectStateLoadingImplCopyWith<$Res> { - factory _$$ChatSelectStateLoadingImplCopyWith( - _$ChatSelectStateLoadingImpl value, - $Res Function(_$ChatSelectStateLoadingImpl) then) = + factory _$$ChatSelectStateLoadingImplCopyWith(_$ChatSelectStateLoadingImpl value, $Res Function(_$ChatSelectStateLoadingImpl) then) = __$$ChatSelectStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res> - extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadingImpl> +class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadingImpl> implements _$$ChatSelectStateLoadingImplCopyWith<$Res> { - __$$ChatSelectStateLoadingImplCopyWithImpl( - _$ChatSelectStateLoadingImpl _value, - $Res Function(_$ChatSelectStateLoadingImpl) _then) - : super(_value, _then); + __$$ChatSelectStateLoadingImplCopyWithImpl(_$ChatSelectStateLoadingImpl _value, $Res Function(_$ChatSelectStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -239,9 +226,7 @@ class _$ChatSelectStateLoadingImpl implements ChatSelectStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChatSelectStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateLoadingImpl); } @override @@ -328,20 +313,17 @@ abstract class ChatSelectStateLoading implements ChatSelectState { /// @nodoc abstract class _$$ChatSelectStateErrorImplCopyWith<$Res> { - factory _$$ChatSelectStateErrorImplCopyWith(_$ChatSelectStateErrorImpl value, - $Res Function(_$ChatSelectStateErrorImpl) then) = + factory _$$ChatSelectStateErrorImplCopyWith(_$ChatSelectStateErrorImpl value, $Res Function(_$ChatSelectStateErrorImpl) then) = __$$ChatSelectStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ChatSelectStateErrorImplCopyWithImpl<$Res> - extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateErrorImpl> +class __$$ChatSelectStateErrorImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateErrorImpl> implements _$$ChatSelectStateErrorImplCopyWith<$Res> { - __$$ChatSelectStateErrorImplCopyWithImpl(_$ChatSelectStateErrorImpl _value, - $Res Function(_$ChatSelectStateErrorImpl) _then) - : super(_value, _then); + __$$ChatSelectStateErrorImplCopyWithImpl(_$ChatSelectStateErrorImpl _value, $Res Function(_$ChatSelectStateErrorImpl) _then) : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -377,8 +359,7 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -389,10 +370,8 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> - get copyWith => - __$$ChatSelectStateErrorImplCopyWithImpl<_$ChatSelectStateErrorImpl>( - this, _$identity); + _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => + __$$ChatSelectStateErrorImplCopyWithImpl<_$ChatSelectStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -470,35 +449,29 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { } abstract class ChatSelectStateError implements ChatSelectState { - const factory ChatSelectStateError({required final String errorMessage}) = - _$ChatSelectStateErrorImpl; + const factory ChatSelectStateError({required final String errorMessage}) = _$ChatSelectStateErrorImpl; String get errorMessage; /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ChatSelectStateLoadedImplCopyWith<$Res> { - factory _$$ChatSelectStateLoadedImplCopyWith( - _$ChatSelectStateLoadedImpl value, - $Res Function(_$ChatSelectStateLoadedImpl) then) = + factory _$$ChatSelectStateLoadedImplCopyWith(_$ChatSelectStateLoadedImpl value, $Res Function(_$ChatSelectStateLoadedImpl) then) = __$$ChatSelectStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({List chatRooms}); } /// @nodoc -class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> - extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadedImpl> +class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadedImpl> implements _$$ChatSelectStateLoadedImplCopyWith<$Res> { - __$$ChatSelectStateLoadedImplCopyWithImpl(_$ChatSelectStateLoadedImpl _value, - $Res Function(_$ChatSelectStateLoadedImpl) _then) - : super(_value, _then); + __$$ChatSelectStateLoadedImplCopyWithImpl(_$ChatSelectStateLoadedImpl _value, $Res Function(_$ChatSelectStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -519,10 +492,10 @@ class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { - const _$ChatSelectStateLoadedImpl({required final List chatRooms}) - : _chatRooms = chatRooms; + const _$ChatSelectStateLoadedImpl({required final List chatRooms}) : _chatRooms = chatRooms; final List _chatRooms; + @override List get chatRooms { if (_chatRooms is EqualUnmodifiableListView) return _chatRooms; @@ -538,24 +511,19 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChatSelectStateLoadedImpl && - const DeepCollectionEquality() - .equals(other._chatRooms, _chatRooms)); + (other.runtimeType == runtimeType && other is _$ChatSelectStateLoadedImpl && const DeepCollectionEquality().equals(other._chatRooms, _chatRooms)); } @override - int get hashCode => - Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> - get copyWith => __$$ChatSelectStateLoadedImplCopyWithImpl< - _$ChatSelectStateLoadedImpl>(this, _$identity); + _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> get copyWith => + __$$ChatSelectStateLoadedImplCopyWithImpl<_$ChatSelectStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -633,14 +601,12 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { } abstract class ChatSelectStateLoaded implements ChatSelectState { - const factory ChatSelectStateLoaded( - {required final List chatRooms}) = _$ChatSelectStateLoadedImpl; + const factory ChatSelectStateLoaded({required final List chatRooms}) = _$ChatSelectStateLoadedImpl; List get chatRooms; /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index 53220865..58c1b70c 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -1,15 +1,15 @@ import 'dart:io'; -import 'package:eatvio_app/theme/custom_text_style.dart'; -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:intl/intl.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_bubble_widget.dart'; import 'package:eatvio_app/locator_service.dart'; +import 'package:eatvio_app/theme/custom_text_style.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:intl/intl.dart'; class ChatScreen extends StatefulWidget { final String chatId; diff --git a/lib/features/chat/presentation/pages/chat_select_screen.dart b/lib/features/chat/presentation/pages/chat_select_screen.dart index 6c14e46d..b683eb39 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen.dart @@ -1,5 +1,4 @@ import 'package:easy_debounce/easy_debounce.dart'; - import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_entry_widget.dart'; diff --git a/lib/features/chat/presentation/pages/photo_view_screen.dart b/lib/features/chat/presentation/pages/photo_view_screen.dart index fab2f064..4bc71ee9 100644 --- a/lib/features/chat/presentation/pages/photo_view_screen.dart +++ b/lib/features/chat/presentation/pages/photo_view_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:dismissible_page/dismissible_page.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; - import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:photo_view/photo_view.dart'; diff --git a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart index 5c12f9b4..79e3269a 100644 --- a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:dismissible_page/dismissible_page.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/utils/date_time_utils.dart'; - import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; diff --git a/lib/features/chat/repositories/chat_repository.dart b/lib/features/chat/repositories/chat_repository.dart index 0f0be7de..f83fa563 100644 --- a/lib/features/chat/repositories/chat_repository.dart +++ b/lib/features/chat/repositories/chat_repository.dart @@ -1,11 +1,12 @@ import 'dart:io'; + import 'package:dio/dio.dart'; -import 'package:eatvio_app/features/chat/models/chat_room_preview_model.dart'; -import 'package:http_parser/http_parser.dart'; import 'package:eatvio_app/features/chat/models/chat_messages_model.dart'; import 'package:eatvio_app/features/chat/models/chat_room_model.dart'; +import 'package:eatvio_app/features/chat/models/chat_room_preview_model.dart'; import 'package:eatvio_app/features/chat/models/websocket_info_model.dart'; import 'package:eatvio_app/features/chat/services/chat_service.dart'; +import 'package:http_parser/http_parser.dart'; class ChatRepository { final ChatService chatService; diff --git a/lib/features/chat/services/chat_service.g.dart b/lib/features/chat/services/chat_service.g.dart index 4e84a7b3..fa32d6fd 100644 --- a/lib/features/chat/services/chat_service.g.dart +++ b/lib/features/chat/services/chat_service.g.dart @@ -80,8 +80,7 @@ class _ChatService implements ChatService { final _result = await _dio.fetch>(_options); late Map _value; try { - _value = _result.data!.map((k, dynamic v) => - MapEntry(k, ChatRoomModel.fromJson(v as Map))); + _value = _result.data!.map((k, dynamic v) => MapEntry(k, ChatRoomModel.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -199,9 +198,7 @@ class _ChatService implements ChatService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/diary/models/diary_model.freezed.dart b/lib/features/diary/models/diary_model.freezed.dart index ceabd5db..1b3bca12 100644 --- a/lib/features/diary/models/diary_model.freezed.dart +++ b/lib/features/diary/models/diary_model.freezed.dart @@ -21,12 +21,19 @@ DiaryModel _$DiaryModelFromJson(Map json) { /// @nodoc mixin _$DiaryModel { int get id => throw _privateConstructorUsedError; + DateTime get date => throw _privateConstructorUsedError; + int get closed => throw _privateConstructorUsedError; + List get meals => throw _privateConstructorUsedError; + State get state => throw _privateConstructorUsedError; + String? get comment => throw _privateConstructorUsedError; + DateTime? get wakeup => throw _privateConstructorUsedError; + DateTime? get retire => throw _privateConstructorUsedError; /// Serializes this DiaryModel to a JSON map. @@ -35,36 +42,26 @@ mixin _$DiaryModel { /// Create a copy of DiaryModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DiaryModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $DiaryModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DiaryModelCopyWith<$Res> { - factory $DiaryModelCopyWith( - DiaryModel value, $Res Function(DiaryModel) then) = - _$DiaryModelCopyWithImpl<$Res, DiaryModel>; + factory $DiaryModelCopyWith(DiaryModel value, $Res Function(DiaryModel) then) = _$DiaryModelCopyWithImpl<$Res, DiaryModel>; + @useResult - $Res call( - {int id, - DateTime date, - int closed, - List meals, - State state, - String? comment, - DateTime? wakeup, - DateTime? retire}); + $Res call({int id, DateTime date, int closed, List meals, State state, String? comment, DateTime? wakeup, DateTime? retire}); $StateCopyWith<$Res> get state; } /// @nodoc -class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> - implements $DiaryModelCopyWith<$Res> { +class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> implements $DiaryModelCopyWith<$Res> { _$DiaryModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -130,34 +127,20 @@ class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> } /// @nodoc -abstract class _$$DiaryModelImplCopyWith<$Res> - implements $DiaryModelCopyWith<$Res> { - factory _$$DiaryModelImplCopyWith( - _$DiaryModelImpl value, $Res Function(_$DiaryModelImpl) then) = - __$$DiaryModelImplCopyWithImpl<$Res>; +abstract class _$$DiaryModelImplCopyWith<$Res> implements $DiaryModelCopyWith<$Res> { + factory _$$DiaryModelImplCopyWith(_$DiaryModelImpl value, $Res Function(_$DiaryModelImpl) then) = __$$DiaryModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {int id, - DateTime date, - int closed, - List meals, - State state, - String? comment, - DateTime? wakeup, - DateTime? retire}); + $Res call({int id, DateTime date, int closed, List meals, State state, String? comment, DateTime? wakeup, DateTime? retire}); @override $StateCopyWith<$Res> get state; } /// @nodoc -class __$$DiaryModelImplCopyWithImpl<$Res> - extends _$DiaryModelCopyWithImpl<$Res, _$DiaryModelImpl> - implements _$$DiaryModelImplCopyWith<$Res> { - __$$DiaryModelImplCopyWithImpl( - _$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then) - : super(_value, _then); +class __$$DiaryModelImplCopyWithImpl<$Res> extends _$DiaryModelCopyWithImpl<$Res, _$DiaryModelImpl> implements _$$DiaryModelImplCopyWith<$Res> { + __$$DiaryModelImplCopyWithImpl(_$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then) : super(_value, _then); /// Create a copy of DiaryModel /// with the given fields replaced by the non-null parameter values. @@ -224,8 +207,7 @@ class _$DiaryModelImpl implements _DiaryModel { this.retire}) : _meals = meals; - factory _$DiaryModelImpl.fromJson(Map json) => - _$$DiaryModelImplFromJson(json); + factory _$DiaryModelImpl.fromJson(Map json) => _$$DiaryModelImplFromJson(json); @override final int id; @@ -234,6 +216,7 @@ class _$DiaryModelImpl implements _DiaryModel { @override final int closed; final List _meals; + @override List get meals { if (_meals is EqualUnmodifiableListView) return _meals; @@ -272,24 +255,14 @@ class _$DiaryModelImpl implements _DiaryModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - id, - date, - closed, - const DeepCollectionEquality().hash(_meals), - state, - comment, - wakeup, - retire); + int get hashCode => Object.hash(runtimeType, id, date, closed, const DeepCollectionEquality().hash(_meals), state, comment, wakeup, retire); /// Create a copy of DiaryModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => - __$$DiaryModelImplCopyWithImpl<_$DiaryModelImpl>(this, _$identity); + _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => __$$DiaryModelImplCopyWithImpl<_$DiaryModelImpl>(this, _$identity); @override Map toJson() { @@ -310,23 +283,29 @@ abstract class _DiaryModel implements DiaryModel { final DateTime? wakeup, final DateTime? retire}) = _$DiaryModelImpl; - factory _DiaryModel.fromJson(Map json) = - _$DiaryModelImpl.fromJson; + factory _DiaryModel.fromJson(Map json) = _$DiaryModelImpl.fromJson; @override int get id; + @override DateTime get date; + @override int get closed; + @override List get meals; + @override State get state; + @override String? get comment; + @override DateTime? get wakeup; + @override DateTime? get retire; @@ -334,6 +313,5 @@ abstract class _DiaryModel implements DiaryModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/diary_model.g.dart b/lib/features/diary/models/diary_model.g.dart index 29f98caa..e549b464 100644 --- a/lib/features/diary/models/diary_model.g.dart +++ b/lib/features/diary/models/diary_model.g.dart @@ -6,26 +6,18 @@ part of 'diary_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$DiaryModelImpl _$$DiaryModelImplFromJson(Map json) => - _$DiaryModelImpl( +_$DiaryModelImpl _$$DiaryModelImplFromJson(Map json) => _$DiaryModelImpl( id: (json['id'] as num).toInt(), date: DateTime.parse(json['date'] as String), closed: (json['closed'] as num).toInt(), - meals: (json['meals'] as List) - .map((e) => Meal.fromJson(e as Map)) - .toList(), + meals: (json['meals'] as List).map((e) => Meal.fromJson(e as Map)).toList(), state: State.fromJson(json['state'] as Map), comment: json['comment'] as String?, - wakeup: json['wakeup'] == null - ? null - : DateTime.parse(json['wakeup'] as String), - retire: json['retire'] == null - ? null - : DateTime.parse(json['retire'] as String), + wakeup: json['wakeup'] == null ? null : DateTime.parse(json['wakeup'] as String), + retire: json['retire'] == null ? null : DateTime.parse(json['retire'] as String), ); -Map _$$DiaryModelImplToJson(_$DiaryModelImpl instance) => - { +Map _$$DiaryModelImplToJson(_$DiaryModelImpl instance) => { 'id': instance.id, 'date': instance.date.toIso8601String(), 'closed': instance.closed, diff --git a/lib/features/diary/models/meal.freezed.dart b/lib/features/diary/models/meal.freezed.dart index 2bd6c478..16a7bd5a 100644 --- a/lib/features/diary/models/meal.freezed.dart +++ b/lib/features/diary/models/meal.freezed.dart @@ -21,11 +21,17 @@ Meal _$MealFromJson(Map json) { /// @nodoc mixin _$Meal { int get id => throw _privateConstructorUsedError; + String get time => throw _privateConstructorUsedError; + int get type => throw _privateConstructorUsedError; + int get satiety => throw _privateConstructorUsedError; + int get mood => throw _privateConstructorUsedError; + List get portions => throw _privateConstructorUsedError; + List get photos => throw _privateConstructorUsedError; /// Serializes this Meal to a JSON map. @@ -39,26 +45,19 @@ mixin _$Meal { /// @nodoc abstract class $MealCopyWith<$Res> { - factory $MealCopyWith(Meal value, $Res Function(Meal) then) = - _$MealCopyWithImpl<$Res, Meal>; + factory $MealCopyWith(Meal value, $Res Function(Meal) then) = _$MealCopyWithImpl<$Res, Meal>; + @useResult - $Res call( - {int id, - String time, - int type, - int satiety, - int mood, - List portions, - List photos}); + $Res call({int id, String time, int type, int satiety, int mood, List portions, List photos}); } /// @nodoc -class _$MealCopyWithImpl<$Res, $Val extends Meal> - implements $MealCopyWith<$Res> { +class _$MealCopyWithImpl<$Res, $Val extends Meal> implements $MealCopyWith<$Res> { _$MealCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -110,27 +109,16 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal> /// @nodoc abstract class _$$MealImplCopyWith<$Res> implements $MealCopyWith<$Res> { - factory _$$MealImplCopyWith( - _$MealImpl value, $Res Function(_$MealImpl) then) = - __$$MealImplCopyWithImpl<$Res>; + factory _$$MealImplCopyWith(_$MealImpl value, $Res Function(_$MealImpl) then) = __$$MealImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {int id, - String time, - int type, - int satiety, - int mood, - List portions, - List photos}); + $Res call({int id, String time, int type, int satiety, int mood, List portions, List photos}); } /// @nodoc -class __$$MealImplCopyWithImpl<$Res> - extends _$MealCopyWithImpl<$Res, _$MealImpl> - implements _$$MealImplCopyWith<$Res> { - __$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then) - : super(_value, _then); +class __$$MealImplCopyWithImpl<$Res> extends _$MealCopyWithImpl<$Res, _$MealImpl> implements _$$MealImplCopyWith<$Res> { + __$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then) : super(_value, _then); /// Create a copy of Meal /// with the given fields replaced by the non-null parameter values. @@ -192,8 +180,7 @@ class _$MealImpl implements _Meal { : _portions = portions, _photos = photos; - factory _$MealImpl.fromJson(Map json) => - _$$MealImplFromJson(json); + factory _$MealImpl.fromJson(Map json) => _$$MealImplFromJson(json); @override final int id; @@ -206,6 +193,7 @@ class _$MealImpl implements _Meal { @override final int mood; final List _portions; + @override List get portions { if (_portions is EqualUnmodifiableListView) return _portions; @@ -214,6 +202,7 @@ class _$MealImpl implements _Meal { } final List _photos; + @override List get photos { if (_photos is EqualUnmodifiableListView) return _photos; @@ -242,23 +231,15 @@ class _$MealImpl implements _Meal { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - id, - time, - type, - satiety, - mood, - const DeepCollectionEquality().hash(_portions), - const DeepCollectionEquality().hash(_photos)); + int get hashCode => + Object.hash(runtimeType, id, time, type, satiety, mood, const DeepCollectionEquality().hash(_portions), const DeepCollectionEquality().hash(_photos)); /// Create a copy of Meal /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$MealImplCopyWith<_$MealImpl> get copyWith => - __$$MealImplCopyWithImpl<_$MealImpl>(this, _$identity); + _$$MealImplCopyWith<_$MealImpl> get copyWith => __$$MealImplCopyWithImpl<_$MealImpl>(this, _$identity); @override Map toJson() { @@ -282,16 +263,22 @@ abstract class _Meal implements Meal { @override int get id; + @override String get time; + @override int get type; + @override int get satiety; + @override int get mood; + @override List get portions; + @override List get photos; @@ -299,6 +286,5 @@ abstract class _Meal implements Meal { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$MealImplCopyWith<_$MealImpl> get copyWith => - throw _privateConstructorUsedError; + _$$MealImplCopyWith<_$MealImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/meal.g.dart b/lib/features/diary/models/meal.g.dart index 5536ed92..e1662cac 100644 --- a/lib/features/diary/models/meal.g.dart +++ b/lib/features/diary/models/meal.g.dart @@ -12,16 +12,11 @@ _$MealImpl _$$MealImplFromJson(Map json) => _$MealImpl( type: (json['type'] as num).toInt(), satiety: (json['satiety'] as num).toInt(), mood: (json['mood'] as num).toInt(), - portions: (json['portions'] as List) - .map((e) => Portion.fromJson(e as Map)) - .toList(), - photos: (json['photos'] as List) - .map((e) => Photo.fromJson(e as Map)) - .toList(), + portions: (json['portions'] as List).map((e) => Portion.fromJson(e as Map)).toList(), + photos: (json['photos'] as List).map((e) => Photo.fromJson(e as Map)).toList(), ); -Map _$$MealImplToJson(_$MealImpl instance) => - { +Map _$$MealImplToJson(_$MealImpl instance) => { 'id': instance.id, 'time': instance.time, 'type': instance.type, diff --git a/lib/features/diary/models/photo.dart b/lib/features/diary/models/photo.dart index d3e4f695..e3a485d8 100644 --- a/lib/features/diary/models/photo.dart +++ b/lib/features/diary/models/photo.dart @@ -1,7 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'photo.freezed.dart'; - part 'photo.g.dart'; @freezed diff --git a/lib/features/diary/models/photo.freezed.dart b/lib/features/diary/models/photo.freezed.dart index 8f5e0152..ff812349 100644 --- a/lib/features/diary/models/photo.freezed.dart +++ b/lib/features/diary/models/photo.freezed.dart @@ -21,8 +21,10 @@ Photo _$PhotoFromJson(Map json) { /// @nodoc mixin _$Photo { int get id => throw _privateConstructorUsedError; + @JsonKey(name: 'original_name') String get originalName => throw _privateConstructorUsedError; + String get path => throw _privateConstructorUsedError; /// Serializes this Photo to a JSON map. @@ -36,22 +38,19 @@ mixin _$Photo { /// @nodoc abstract class $PhotoCopyWith<$Res> { - factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) = - _$PhotoCopyWithImpl<$Res, Photo>; + factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) = _$PhotoCopyWithImpl<$Res, Photo>; + @useResult - $Res call( - {int id, - @JsonKey(name: 'original_name') String originalName, - String path}); + $Res call({int id, @JsonKey(name: 'original_name') String originalName, String path}); } /// @nodoc -class _$PhotoCopyWithImpl<$Res, $Val extends Photo> - implements $PhotoCopyWith<$Res> { +class _$PhotoCopyWithImpl<$Res, $Val extends Photo> implements $PhotoCopyWith<$Res> { _$PhotoCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -83,24 +82,16 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo> /// @nodoc abstract class _$$PhotoImplCopyWith<$Res> implements $PhotoCopyWith<$Res> { - factory _$$PhotoImplCopyWith( - _$PhotoImpl value, $Res Function(_$PhotoImpl) then) = - __$$PhotoImplCopyWithImpl<$Res>; + factory _$$PhotoImplCopyWith(_$PhotoImpl value, $Res Function(_$PhotoImpl) then) = __$$PhotoImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {int id, - @JsonKey(name: 'original_name') String originalName, - String path}); + $Res call({int id, @JsonKey(name: 'original_name') String originalName, String path}); } /// @nodoc -class __$$PhotoImplCopyWithImpl<$Res> - extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl> - implements _$$PhotoImplCopyWith<$Res> { - __$$PhotoImplCopyWithImpl( - _$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) - : super(_value, _then); +class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl> implements _$$PhotoImplCopyWith<$Res> { + __$$PhotoImplCopyWithImpl(_$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) : super(_value, _then); /// Create a copy of Photo /// with the given fields replaced by the non-null parameter values. @@ -131,13 +122,9 @@ class __$$PhotoImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$PhotoImpl implements _Photo { - const _$PhotoImpl( - {required this.id, - @JsonKey(name: 'original_name') required this.originalName, - required this.path}); + const _$PhotoImpl({required this.id, @JsonKey(name: 'original_name') required this.originalName, required this.path}); - factory _$PhotoImpl.fromJson(Map json) => - _$$PhotoImplFromJson(json); + factory _$PhotoImpl.fromJson(Map json) => _$$PhotoImplFromJson(json); @override final int id; @@ -158,8 +145,7 @@ class _$PhotoImpl implements _Photo { (other.runtimeType == runtimeType && other is _$PhotoImpl && (identical(other.id, id) || other.id == id) && - (identical(other.originalName, originalName) || - other.originalName == originalName) && + (identical(other.originalName, originalName) || other.originalName == originalName) && (identical(other.path, path) || other.path == path)); } @@ -172,8 +158,7 @@ class _$PhotoImpl implements _Photo { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => - __$$PhotoImplCopyWithImpl<_$PhotoImpl>(this, _$identity); + _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => __$$PhotoImplCopyWithImpl<_$PhotoImpl>(this, _$identity); @override Map toJson() { @@ -184,18 +169,17 @@ class _$PhotoImpl implements _Photo { } abstract class _Photo implements Photo { - const factory _Photo( - {required final int id, - @JsonKey(name: 'original_name') required final String originalName, - required final String path}) = _$PhotoImpl; + const factory _Photo({required final int id, @JsonKey(name: 'original_name') required final String originalName, required final String path}) = _$PhotoImpl; factory _Photo.fromJson(Map json) = _$PhotoImpl.fromJson; @override int get id; + @override @JsonKey(name: 'original_name') String get originalName; + @override String get path; @@ -203,6 +187,5 @@ abstract class _Photo implements Photo { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/photo.g.dart b/lib/features/diary/models/photo.g.dart index cacf65ac..1efd15ed 100644 --- a/lib/features/diary/models/photo.g.dart +++ b/lib/features/diary/models/photo.g.dart @@ -12,8 +12,7 @@ _$PhotoImpl _$$PhotoImplFromJson(Map json) => _$PhotoImpl( path: json['path'] as String, ); -Map _$$PhotoImplToJson(_$PhotoImpl instance) => - { +Map _$$PhotoImplToJson(_$PhotoImpl instance) => { 'id': instance.id, 'original_name': instance.originalName, 'path': instance.path, diff --git a/lib/features/diary/models/portion.freezed.dart b/lib/features/diary/models/portion.freezed.dart index 4bef02d4..4aeb9936 100644 --- a/lib/features/diary/models/portion.freezed.dart +++ b/lib/features/diary/models/portion.freezed.dart @@ -21,9 +21,13 @@ Portion _$PortionFromJson(Map json) { /// @nodoc mixin _$Portion { int get id => throw _privateConstructorUsedError; + String get product_name => throw _privateConstructorUsedError; + int get quantity => throw _privateConstructorUsedError; + String get portion => throw _privateConstructorUsedError; + bool get from_diet => throw _privateConstructorUsedError; /// Serializes this Portion to a JSON map. @@ -37,24 +41,19 @@ mixin _$Portion { /// @nodoc abstract class $PortionCopyWith<$Res> { - factory $PortionCopyWith(Portion value, $Res Function(Portion) then) = - _$PortionCopyWithImpl<$Res, Portion>; + factory $PortionCopyWith(Portion value, $Res Function(Portion) then) = _$PortionCopyWithImpl<$Res, Portion>; + @useResult - $Res call( - {int id, - String product_name, - int quantity, - String portion, - bool from_diet}); + $Res call({int id, String product_name, int quantity, String portion, bool from_diet}); } /// @nodoc -class _$PortionCopyWithImpl<$Res, $Val extends Portion> - implements $PortionCopyWith<$Res> { +class _$PortionCopyWithImpl<$Res, $Val extends Portion> implements $PortionCopyWith<$Res> { _$PortionCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -96,26 +95,16 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion> /// @nodoc abstract class _$$PortionImplCopyWith<$Res> implements $PortionCopyWith<$Res> { - factory _$$PortionImplCopyWith( - _$PortionImpl value, $Res Function(_$PortionImpl) then) = - __$$PortionImplCopyWithImpl<$Res>; + factory _$$PortionImplCopyWith(_$PortionImpl value, $Res Function(_$PortionImpl) then) = __$$PortionImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {int id, - String product_name, - int quantity, - String portion, - bool from_diet}); + $Res call({int id, String product_name, int quantity, String portion, bool from_diet}); } /// @nodoc -class __$$PortionImplCopyWithImpl<$Res> - extends _$PortionCopyWithImpl<$Res, _$PortionImpl> - implements _$$PortionImplCopyWith<$Res> { - __$$PortionImplCopyWithImpl( - _$PortionImpl _value, $Res Function(_$PortionImpl) _then) - : super(_value, _then); +class __$$PortionImplCopyWithImpl<$Res> extends _$PortionCopyWithImpl<$Res, _$PortionImpl> implements _$$PortionImplCopyWith<$Res> { + __$$PortionImplCopyWithImpl(_$PortionImpl _value, $Res Function(_$PortionImpl) _then) : super(_value, _then); /// Create a copy of Portion /// with the given fields replaced by the non-null parameter values. @@ -156,15 +145,9 @@ class __$$PortionImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$PortionImpl implements _Portion { - const _$PortionImpl( - {required this.id, - required this.product_name, - required this.quantity, - required this.portion, - required this.from_diet}); + const _$PortionImpl({required this.id, required this.product_name, required this.quantity, required this.portion, required this.from_diet}); - factory _$PortionImpl.fromJson(Map json) => - _$$PortionImplFromJson(json); + factory _$PortionImpl.fromJson(Map json) => _$$PortionImplFromJson(json); @override final int id; @@ -188,27 +171,22 @@ class _$PortionImpl implements _Portion { (other.runtimeType == runtimeType && other is _$PortionImpl && (identical(other.id, id) || other.id == id) && - (identical(other.product_name, product_name) || - other.product_name == product_name) && - (identical(other.quantity, quantity) || - other.quantity == quantity) && + (identical(other.product_name, product_name) || other.product_name == product_name) && + (identical(other.quantity, quantity) || other.quantity == quantity) && (identical(other.portion, portion) || other.portion == portion) && - (identical(other.from_diet, from_diet) || - other.from_diet == from_diet)); + (identical(other.from_diet, from_diet) || other.from_diet == from_diet)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, product_name, quantity, portion, from_diet); + int get hashCode => Object.hash(runtimeType, id, product_name, quantity, portion, from_diet); /// Create a copy of Portion /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PortionImplCopyWith<_$PortionImpl> get copyWith => - __$$PortionImplCopyWithImpl<_$PortionImpl>(this, _$identity); + _$$PortionImplCopyWith<_$PortionImpl> get copyWith => __$$PortionImplCopyWithImpl<_$PortionImpl>(this, _$identity); @override Map toJson() { @@ -230,12 +208,16 @@ abstract class _Portion implements Portion { @override int get id; + @override String get product_name; + @override int get quantity; + @override String get portion; + @override bool get from_diet; @@ -243,6 +225,5 @@ abstract class _Portion implements Portion { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PortionImplCopyWith<_$PortionImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PortionImplCopyWith<_$PortionImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/portion.g.dart b/lib/features/diary/models/portion.g.dart index f3503e5c..2a464133 100644 --- a/lib/features/diary/models/portion.g.dart +++ b/lib/features/diary/models/portion.g.dart @@ -6,8 +6,7 @@ part of 'portion.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PortionImpl _$$PortionImplFromJson(Map json) => - _$PortionImpl( +_$PortionImpl _$$PortionImplFromJson(Map json) => _$PortionImpl( id: (json['id'] as num).toInt(), product_name: json['product_name'] as String, quantity: (json['quantity'] as num).toInt(), @@ -15,8 +14,7 @@ _$PortionImpl _$$PortionImplFromJson(Map json) => from_diet: json['from_diet'] as bool, ); -Map _$$PortionImplToJson(_$PortionImpl instance) => - { +Map _$$PortionImplToJson(_$PortionImpl instance) => { 'id': instance.id, 'product_name': instance.product_name, 'quantity': instance.quantity, diff --git a/lib/features/diary/models/product.freezed.dart b/lib/features/diary/models/product.freezed.dart index 610656fb..4911e89e 100644 --- a/lib/features/diary/models/product.freezed.dart +++ b/lib/features/diary/models/product.freezed.dart @@ -21,6 +21,7 @@ Product _$ProductFromJson(Map json) { /// @nodoc mixin _$Product { int get id => throw _privateConstructorUsedError; + String get name => throw _privateConstructorUsedError; /// Serializes this Product to a JSON map. @@ -34,19 +35,19 @@ mixin _$Product { /// @nodoc abstract class $ProductCopyWith<$Res> { - factory $ProductCopyWith(Product value, $Res Function(Product) then) = - _$ProductCopyWithImpl<$Res, Product>; + factory $ProductCopyWith(Product value, $Res Function(Product) then) = _$ProductCopyWithImpl<$Res, Product>; + @useResult $Res call({int id, String name}); } /// @nodoc -class _$ProductCopyWithImpl<$Res, $Val extends Product> - implements $ProductCopyWith<$Res> { +class _$ProductCopyWithImpl<$Res, $Val extends Product> implements $ProductCopyWith<$Res> { _$ProductCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -73,21 +74,16 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product> /// @nodoc abstract class _$$ProductImplCopyWith<$Res> implements $ProductCopyWith<$Res> { - factory _$$ProductImplCopyWith( - _$ProductImpl value, $Res Function(_$ProductImpl) then) = - __$$ProductImplCopyWithImpl<$Res>; + factory _$$ProductImplCopyWith(_$ProductImpl value, $Res Function(_$ProductImpl) then) = __$$ProductImplCopyWithImpl<$Res>; + @override @useResult $Res call({int id, String name}); } /// @nodoc -class __$$ProductImplCopyWithImpl<$Res> - extends _$ProductCopyWithImpl<$Res, _$ProductImpl> - implements _$$ProductImplCopyWith<$Res> { - __$$ProductImplCopyWithImpl( - _$ProductImpl _value, $Res Function(_$ProductImpl) _then) - : super(_value, _then); +class __$$ProductImplCopyWithImpl<$Res> extends _$ProductCopyWithImpl<$Res, _$ProductImpl> implements _$$ProductImplCopyWith<$Res> { + __$$ProductImplCopyWithImpl(_$ProductImpl _value, $Res Function(_$ProductImpl) _then) : super(_value, _then); /// Create a copy of Product /// with the given fields replaced by the non-null parameter values. @@ -115,8 +111,7 @@ class __$$ProductImplCopyWithImpl<$Res> class _$ProductImpl implements _Product { const _$ProductImpl({required this.id, required this.name}); - factory _$ProductImpl.fromJson(Map json) => - _$$ProductImplFromJson(json); + factory _$ProductImpl.fromJson(Map json) => _$$ProductImplFromJson(json); @override final int id; @@ -146,8 +141,7 @@ class _$ProductImpl implements _Product { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProductImplCopyWith<_$ProductImpl> get copyWith => - __$$ProductImplCopyWithImpl<_$ProductImpl>(this, _$identity); + _$$ProductImplCopyWith<_$ProductImpl> get copyWith => __$$ProductImplCopyWithImpl<_$ProductImpl>(this, _$identity); @override Map toJson() { @@ -158,13 +152,13 @@ class _$ProductImpl implements _Product { } abstract class _Product implements Product { - const factory _Product({required final int id, required final String name}) = - _$ProductImpl; + const factory _Product({required final int id, required final String name}) = _$ProductImpl; factory _Product.fromJson(Map json) = _$ProductImpl.fromJson; @override int get id; + @override String get name; @@ -172,6 +166,5 @@ abstract class _Product implements Product { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProductImplCopyWith<_$ProductImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ProductImplCopyWith<_$ProductImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/product.g.dart b/lib/features/diary/models/product.g.dart index 74331101..d7e1ddd9 100644 --- a/lib/features/diary/models/product.g.dart +++ b/lib/features/diary/models/product.g.dart @@ -6,14 +6,12 @@ part of 'product.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ProductImpl _$$ProductImplFromJson(Map json) => - _$ProductImpl( +_$ProductImpl _$$ProductImplFromJson(Map json) => _$ProductImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, ); -Map _$$ProductImplToJson(_$ProductImpl instance) => - { +Map _$$ProductImplToJson(_$ProductImpl instance) => { 'id': instance.id, 'name': instance.name, }; diff --git a/lib/features/diary/models/state.freezed.dart b/lib/features/diary/models/state.freezed.dart index 6b9c50fb..e20b37b4 100644 --- a/lib/features/diary/models/state.freezed.dart +++ b/lib/features/diary/models/state.freezed.dart @@ -21,6 +21,7 @@ State _$StateFromJson(Map json) { /// @nodoc mixin _$State { bool get has_chosen_diet => throw _privateConstructorUsedError; + bool get has_chosen_plan => throw _privateConstructorUsedError; /// Serializes this State to a JSON map. @@ -34,19 +35,19 @@ mixin _$State { /// @nodoc abstract class $StateCopyWith<$Res> { - factory $StateCopyWith(State value, $Res Function(State) then) = - _$StateCopyWithImpl<$Res, State>; + factory $StateCopyWith(State value, $Res Function(State) then) = _$StateCopyWithImpl<$Res, State>; + @useResult $Res call({bool has_chosen_diet, bool has_chosen_plan}); } /// @nodoc -class _$StateCopyWithImpl<$Res, $Val extends State> - implements $StateCopyWith<$Res> { +class _$StateCopyWithImpl<$Res, $Val extends State> implements $StateCopyWith<$Res> { _$StateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -73,21 +74,16 @@ class _$StateCopyWithImpl<$Res, $Val extends State> /// @nodoc abstract class _$$StateImplCopyWith<$Res> implements $StateCopyWith<$Res> { - factory _$$StateImplCopyWith( - _$StateImpl value, $Res Function(_$StateImpl) then) = - __$$StateImplCopyWithImpl<$Res>; + factory _$$StateImplCopyWith(_$StateImpl value, $Res Function(_$StateImpl) then) = __$$StateImplCopyWithImpl<$Res>; + @override @useResult $Res call({bool has_chosen_diet, bool has_chosen_plan}); } /// @nodoc -class __$$StateImplCopyWithImpl<$Res> - extends _$StateCopyWithImpl<$Res, _$StateImpl> - implements _$$StateImplCopyWith<$Res> { - __$$StateImplCopyWithImpl( - _$StateImpl _value, $Res Function(_$StateImpl) _then) - : super(_value, _then); +class __$$StateImplCopyWithImpl<$Res> extends _$StateCopyWithImpl<$Res, _$StateImpl> implements _$$StateImplCopyWith<$Res> { + __$$StateImplCopyWithImpl(_$StateImpl _value, $Res Function(_$StateImpl) _then) : super(_value, _then); /// Create a copy of State /// with the given fields replaced by the non-null parameter values. @@ -113,11 +109,9 @@ class __$$StateImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$StateImpl implements _State { - const _$StateImpl( - {required this.has_chosen_diet, required this.has_chosen_plan}); + const _$StateImpl({required this.has_chosen_diet, required this.has_chosen_plan}); - factory _$StateImpl.fromJson(Map json) => - _$$StateImplFromJson(json); + factory _$StateImpl.fromJson(Map json) => _$$StateImplFromJson(json); @override final bool has_chosen_diet; @@ -134,24 +128,20 @@ class _$StateImpl implements _State { return identical(this, other) || (other.runtimeType == runtimeType && other is _$StateImpl && - (identical(other.has_chosen_diet, has_chosen_diet) || - other.has_chosen_diet == has_chosen_diet) && - (identical(other.has_chosen_plan, has_chosen_plan) || - other.has_chosen_plan == has_chosen_plan)); + (identical(other.has_chosen_diet, has_chosen_diet) || other.has_chosen_diet == has_chosen_diet) && + (identical(other.has_chosen_plan, has_chosen_plan) || other.has_chosen_plan == has_chosen_plan)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, has_chosen_diet, has_chosen_plan); + int get hashCode => Object.hash(runtimeType, has_chosen_diet, has_chosen_plan); /// Create a copy of State /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$StateImplCopyWith<_$StateImpl> get copyWith => - __$$StateImplCopyWithImpl<_$StateImpl>(this, _$identity); + _$$StateImplCopyWith<_$StateImpl> get copyWith => __$$StateImplCopyWithImpl<_$StateImpl>(this, _$identity); @override Map toJson() { @@ -162,14 +152,13 @@ class _$StateImpl implements _State { } abstract class _State implements State { - const factory _State( - {required final bool has_chosen_diet, - required final bool has_chosen_plan}) = _$StateImpl; + const factory _State({required final bool has_chosen_diet, required final bool has_chosen_plan}) = _$StateImpl; factory _State.fromJson(Map json) = _$StateImpl.fromJson; @override bool get has_chosen_diet; + @override bool get has_chosen_plan; @@ -177,6 +166,5 @@ abstract class _State implements State { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$StateImplCopyWith<_$StateImpl> get copyWith => - throw _privateConstructorUsedError; + _$$StateImplCopyWith<_$StateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/state.g.dart b/lib/features/diary/models/state.g.dart index 1b0da8f4..574604e3 100644 --- a/lib/features/diary/models/state.g.dart +++ b/lib/features/diary/models/state.g.dart @@ -11,8 +11,7 @@ _$StateImpl _$$StateImplFromJson(Map json) => _$StateImpl( has_chosen_plan: json['has_chosen_plan'] as bool, ); -Map _$$StateImplToJson(_$StateImpl instance) => - { +Map _$$StateImplToJson(_$StateImpl instance) => { 'has_chosen_diet': instance.has_chosen_diet, 'has_chosen_plan': instance.has_chosen_plan, }; diff --git a/lib/features/diary/presentation/bloc/diary_bloc.dart b/lib/features/diary/presentation/bloc/diary_bloc.dart index 74742144..cee99a34 100644 --- a/lib/features/diary/presentation/bloc/diary_bloc.dart +++ b/lib/features/diary/presentation/bloc/diary_bloc.dart @@ -1,4 +1,5 @@ import 'dart:async'; + import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/features/diary/models/diary_model.dart'; import 'package:eatvio_app/features/diary/models/meal.dart'; @@ -10,6 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:image_picker/image_picker.dart'; import 'package:intl/intl.dart'; + part 'diary_event.dart'; /// A bloc that manages the state of a Diary according to the event that is dispatched to it. diff --git a/lib/features/diary/presentation/bloc/diary_event.dart b/lib/features/diary/presentation/bloc/diary_event.dart index cfc1bedf..33c168d7 100644 --- a/lib/features/diary/presentation/bloc/diary_event.dart +++ b/lib/features/diary/presentation/bloc/diary_event.dart @@ -182,6 +182,7 @@ class RefreshEvent extends DiaryEvent { class ConfirmPortion extends DiaryEvent { ConfirmPortion(this.id); + int id; @override diff --git a/lib/features/diary/presentation/bloc/diary_state.freezed.dart b/lib/features/diary/presentation/bloc/diary_state.freezed.dart index 98d7019f..881f2e9d 100644 --- a/lib/features/diary/presentation/bloc/diary_state.freezed.dart +++ b/lib/features/diary/presentation/bloc/diary_state.freezed.dart @@ -54,6 +54,7 @@ mixin _$DiaryState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -160,18 +161,16 @@ mixin _$DiaryState { /// @nodoc abstract class $DiaryStateCopyWith<$Res> { - factory $DiaryStateCopyWith( - DiaryState value, $Res Function(DiaryState) then) = - _$DiaryStateCopyWithImpl<$Res, DiaryState>; + factory $DiaryStateCopyWith(DiaryState value, $Res Function(DiaryState) then) = _$DiaryStateCopyWithImpl<$Res, DiaryState>; } /// @nodoc -class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState> - implements $DiaryStateCopyWith<$Res> { +class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState> implements $DiaryStateCopyWith<$Res> { _$DiaryStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -181,18 +180,12 @@ class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState> /// @nodoc abstract class _$$DiaryStateImplCopyWith<$Res> { - factory _$$DiaryStateImplCopyWith( - _$DiaryStateImpl value, $Res Function(_$DiaryStateImpl) then) = - __$$DiaryStateImplCopyWithImpl<$Res>; + factory _$$DiaryStateImplCopyWith(_$DiaryStateImpl value, $Res Function(_$DiaryStateImpl) then) = __$$DiaryStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$DiaryStateImplCopyWithImpl<$Res> - extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateImpl> - implements _$$DiaryStateImplCopyWith<$Res> { - __$$DiaryStateImplCopyWithImpl( - _$DiaryStateImpl _value, $Res Function(_$DiaryStateImpl) _then) - : super(_value, _then); +class __$$DiaryStateImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateImpl> implements _$$DiaryStateImplCopyWith<$Res> { + __$$DiaryStateImplCopyWithImpl(_$DiaryStateImpl _value, $Res Function(_$DiaryStateImpl) _then) : super(_value, _then); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -210,8 +203,7 @@ class _$DiaryStateImpl implements _DiaryState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$DiaryStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$DiaryStateImpl); } @override @@ -388,20 +380,17 @@ abstract class _DiaryState implements DiaryState { /// @nodoc abstract class _$$DiaryStateLoadingImplCopyWith<$Res> { - factory _$$DiaryStateLoadingImplCopyWith(_$DiaryStateLoadingImpl value, - $Res Function(_$DiaryStateLoadingImpl) then) = + factory _$$DiaryStateLoadingImplCopyWith(_$DiaryStateLoadingImpl value, $Res Function(_$DiaryStateLoadingImpl) then) = __$$DiaryStateLoadingImplCopyWithImpl<$Res>; + @useResult $Res call({int? id}); } /// @nodoc -class __$$DiaryStateLoadingImplCopyWithImpl<$Res> - extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadingImpl> +class __$$DiaryStateLoadingImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadingImpl> implements _$$DiaryStateLoadingImplCopyWith<$Res> { - __$$DiaryStateLoadingImplCopyWithImpl(_$DiaryStateLoadingImpl _value, - $Res Function(_$DiaryStateLoadingImpl) _then) - : super(_value, _then); + __$$DiaryStateLoadingImplCopyWithImpl(_$DiaryStateLoadingImpl _value, $Res Function(_$DiaryStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -434,10 +423,7 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$DiaryStateLoadingImpl && - (identical(other.id, id) || other.id == id)); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$DiaryStateLoadingImpl && (identical(other.id, id) || other.id == id)); } @override @@ -448,9 +434,7 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => - __$$DiaryStateLoadingImplCopyWithImpl<_$DiaryStateLoadingImpl>( - this, _$identity); + _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => __$$DiaryStateLoadingImplCopyWithImpl<_$DiaryStateLoadingImpl>(this, _$identity); @override @optionalTypeArgs @@ -625,15 +609,14 @@ abstract class DiaryStateLoading implements DiaryState { /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$DiaryStateLoadedImplCopyWith<$Res> { - factory _$$DiaryStateLoadedImplCopyWith(_$DiaryStateLoadedImpl value, - $Res Function(_$DiaryStateLoadedImpl) then) = + factory _$$DiaryStateLoadedImplCopyWith(_$DiaryStateLoadedImpl value, $Res Function(_$DiaryStateLoadedImpl) then) = __$$DiaryStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call( {DiaryModel diary, @@ -667,17 +650,16 @@ abstract class _$$DiaryStateLoadedImplCopyWith<$Res> { List? chartDataCounted}); $DiaryModelCopyWith<$Res> get diary; + $MealCopyWith<$Res> get currentMeal; + $SelectionPopupModelCopyWith<$Res> get portionController; } /// @nodoc -class __$$DiaryStateLoadedImplCopyWithImpl<$Res> - extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadedImpl> +class __$$DiaryStateLoadedImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadedImpl> implements _$$DiaryStateLoadedImplCopyWith<$Res> { - __$$DiaryStateLoadedImplCopyWithImpl(_$DiaryStateLoadedImpl _value, - $Res Function(_$DiaryStateLoadedImpl) _then) - : super(_value, _then); + __$$DiaryStateLoadedImplCopyWithImpl(_$DiaryStateLoadedImpl _value, $Res Function(_$DiaryStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -859,8 +841,7 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get portionController { - return $SelectionPopupModelCopyWith<$Res>(_value.portionController, - (value) { + return $SelectionPopupModelCopyWith<$Res>(_value.portionController, (value) { return _then(_value.copyWith(portionController: value)); }); } @@ -913,24 +894,25 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { @override final String? diaryDate; final List _recommendedChartValues; + @override List get recommendedChartValues { - if (_recommendedChartValues is EqualUnmodifiableListView) - return _recommendedChartValues; + if (_recommendedChartValues is EqualUnmodifiableListView) return _recommendedChartValues; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_recommendedChartValues); } final List _consumedChartValues; + @override List get consumedChartValues { - if (_consumedChartValues is EqualUnmodifiableListView) - return _consumedChartValues; + if (_consumedChartValues is EqualUnmodifiableListView) return _consumedChartValues; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_consumedChartValues); } final List _portions; + @override List get portions { if (_portions is EqualUnmodifiableListView) return _portions; @@ -939,6 +921,7 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } final List _mealList; + @override List get mealList { if (_mealList is EqualUnmodifiableListView) return _mealList; @@ -947,6 +930,7 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } final List _portionList; + @override List get portionList { if (_portionList is EqualUnmodifiableListView) return _portionList; @@ -955,15 +939,16 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } final List _autocompleteList; + @override List get autocompleteList { - if (_autocompleteList is EqualUnmodifiableListView) - return _autocompleteList; + if (_autocompleteList is EqualUnmodifiableListView) return _autocompleteList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_autocompleteList); } final Map _chartData; + @override Map get chartData { if (_chartData is EqualUnmodifiableMapView) return _chartData; @@ -1010,12 +995,12 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { @override final bool isAdded; final List? _chartDataCounted; + @override List? get chartDataCounted { final value = _chartDataCounted; if (value == null) return null; - if (_chartDataCounted is EqualUnmodifiableListView) - return _chartDataCounted; + if (_chartDataCounted is EqualUnmodifiableListView) return _chartDataCounted; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(value); } @@ -1031,60 +1016,34 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { (other.runtimeType == runtimeType && other is _$DiaryStateLoadedImpl && (identical(other.diary, diary) || other.diary == diary) && - (identical(other.diaryDate, diaryDate) || - other.diaryDate == diaryDate) && - const DeepCollectionEquality().equals( - other._recommendedChartValues, _recommendedChartValues) && - const DeepCollectionEquality() - .equals(other._consumedChartValues, _consumedChartValues) && + (identical(other.diaryDate, diaryDate) || other.diaryDate == diaryDate) && + const DeepCollectionEquality().equals(other._recommendedChartValues, _recommendedChartValues) && + const DeepCollectionEquality().equals(other._consumedChartValues, _consumedChartValues) && const DeepCollectionEquality().equals(other._portions, _portions) && const DeepCollectionEquality().equals(other._mealList, _mealList) && - const DeepCollectionEquality() - .equals(other._portionList, _portionList) && - const DeepCollectionEquality() - .equals(other._autocompleteList, _autocompleteList) && - const DeepCollectionEquality() - .equals(other._chartData, _chartData) && - (identical(other.currentMeal, currentMeal) || - other.currentMeal == currentMeal) && - (identical(other.portionController, portionController) || - other.portionController == portionController) && - (identical(other.wakeupController, wakeupController) || - other.wakeupController == wakeupController) && - (identical(other.retireController, retireController) || - other.retireController == retireController) && - (identical(other.mealTimeController, mealTimeController) || - other.mealTimeController == mealTimeController) && - (identical(other.commentController, commentController) || - other.commentController == commentController) && - (identical(other.product_nameController, product_nameController) || - other.product_nameController == product_nameController) && - (identical(other.productQuantityController, - productQuantityController) || - other.productQuantityController == productQuantityController) && - (identical(other.caloriesController, caloriesController) || - other.caloriesController == caloriesController) && - (identical(other.fatsController, fatsController) || - other.fatsController == fatsController) && - (identical(other.proteinsController, proteinsController) || - other.proteinsController == proteinsController) && - (identical(other.carbsController, carbsController) || - other.carbsController == carbsController) && - (identical(other.selectedMood, selectedMood) || - other.selectedMood == selectedMood) && - (identical(other.selectedSatiety, selectedSatiety) || - other.selectedSatiety == selectedSatiety) && - (identical(other.wakeupExpanded, wakeupExpanded) || - other.wakeupExpanded == wakeupExpanded) && - (identical(other.moderationExpanded, moderationExpanded) || - other.moderationExpanded == moderationExpanded) && - (identical(other.moodExpanded, moodExpanded) || - other.moodExpanded == moodExpanded) && - (identical(other.isLoading, isLoading) || - other.isLoading == isLoading) && + const DeepCollectionEquality().equals(other._portionList, _portionList) && + const DeepCollectionEquality().equals(other._autocompleteList, _autocompleteList) && + const DeepCollectionEquality().equals(other._chartData, _chartData) && + (identical(other.currentMeal, currentMeal) || other.currentMeal == currentMeal) && + (identical(other.portionController, portionController) || other.portionController == portionController) && + (identical(other.wakeupController, wakeupController) || other.wakeupController == wakeupController) && + (identical(other.retireController, retireController) || other.retireController == retireController) && + (identical(other.mealTimeController, mealTimeController) || other.mealTimeController == mealTimeController) && + (identical(other.commentController, commentController) || other.commentController == commentController) && + (identical(other.product_nameController, product_nameController) || other.product_nameController == product_nameController) && + (identical(other.productQuantityController, productQuantityController) || other.productQuantityController == productQuantityController) && + (identical(other.caloriesController, caloriesController) || other.caloriesController == caloriesController) && + (identical(other.fatsController, fatsController) || other.fatsController == fatsController) && + (identical(other.proteinsController, proteinsController) || other.proteinsController == proteinsController) && + (identical(other.carbsController, carbsController) || other.carbsController == carbsController) && + (identical(other.selectedMood, selectedMood) || other.selectedMood == selectedMood) && + (identical(other.selectedSatiety, selectedSatiety) || other.selectedSatiety == selectedSatiety) && + (identical(other.wakeupExpanded, wakeupExpanded) || other.wakeupExpanded == wakeupExpanded) && + (identical(other.moderationExpanded, moderationExpanded) || other.moderationExpanded == moderationExpanded) && + (identical(other.moodExpanded, moodExpanded) || other.moodExpanded == moodExpanded) && + (identical(other.isLoading, isLoading) || other.isLoading == isLoading) && (identical(other.isAdded, isAdded) || other.isAdded == isAdded) && - const DeepCollectionEquality() - .equals(other._chartDataCounted, _chartDataCounted)); + const DeepCollectionEquality().equals(other._chartDataCounted, _chartDataCounted)); } @override @@ -1126,9 +1085,7 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => - __$$DiaryStateLoadedImplCopyWithImpl<_$DiaryStateLoadedImpl>( - this, _$identity); + _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => __$$DiaryStateLoadedImplCopyWithImpl<_$DiaryStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -1415,58 +1372,80 @@ abstract class DiaryStateLoaded implements DiaryState { final List? chartDataCounted}) = _$DiaryStateLoadedImpl; DiaryModel get diary; + String? get diaryDate; + List get recommendedChartValues; + List get consumedChartValues; + List get portions; + List get mealList; + List get portionList; + List get autocompleteList; + Map get chartData; + Meal get currentMeal; + SelectionPopupModel get portionController; + TimeOfDay get wakeupController; + TimeOfDay get retireController; + TimeOfDay? get mealTimeController; + TextEditingController get commentController; + TextEditingController get product_nameController; + TextEditingController get productQuantityController; + TextEditingController get caloriesController; + TextEditingController get fatsController; + TextEditingController get proteinsController; + TextEditingController get carbsController; + int get selectedMood; + int get selectedSatiety; + bool get wakeupExpanded; + bool get moderationExpanded; + bool get moodExpanded; + bool get isLoading; + bool get isAdded; + List? get chartDataCounted; /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$DiaryStateErrorImplCopyWith<$Res> { - factory _$$DiaryStateErrorImplCopyWith(_$DiaryStateErrorImpl value, - $Res Function(_$DiaryStateErrorImpl) then) = - __$$DiaryStateErrorImplCopyWithImpl<$Res>; + factory _$$DiaryStateErrorImplCopyWith(_$DiaryStateErrorImpl value, $Res Function(_$DiaryStateErrorImpl) then) = __$$DiaryStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$DiaryStateErrorImplCopyWithImpl<$Res> - extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateErrorImpl> - implements _$$DiaryStateErrorImplCopyWith<$Res> { - __$$DiaryStateErrorImplCopyWithImpl( - _$DiaryStateErrorImpl _value, $Res Function(_$DiaryStateErrorImpl) _then) - : super(_value, _then); +class __$$DiaryStateErrorImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateErrorImpl> implements _$$DiaryStateErrorImplCopyWith<$Res> { + __$$DiaryStateErrorImplCopyWithImpl(_$DiaryStateErrorImpl _value, $Res Function(_$DiaryStateErrorImpl) _then) : super(_value, _then); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -1502,8 +1481,7 @@ class _$DiaryStateErrorImpl implements DiaryStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DiaryStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -1514,9 +1492,7 @@ class _$DiaryStateErrorImpl implements DiaryStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => - __$$DiaryStateErrorImplCopyWithImpl<_$DiaryStateErrorImpl>( - this, _$identity); + _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => __$$DiaryStateErrorImplCopyWithImpl<_$DiaryStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -1684,14 +1660,12 @@ class _$DiaryStateErrorImpl implements DiaryStateError { } abstract class DiaryStateError implements DiaryState { - const factory DiaryStateError({required final String errorMessage}) = - _$DiaryStateErrorImpl; + const factory DiaryStateError({required final String errorMessage}) = _$DiaryStateErrorImpl; String get errorMessage; /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart index 5211eeed..e76b33ab 100644 --- a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart +++ b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart @@ -3,7 +3,6 @@ import 'package:eatvio_app/features/diary/models/portion.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 8e537a20..e2287ddd 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -11,15 +11,13 @@ import 'package:eatvio_app/features/diary/models/product.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; import 'package:eatvio_app/localization/app_localization.dart'; - import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; import 'package:eatvio_app/widgets/custom_edit_drop_down.dart'; +import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; import 'package:eatvio_app/widgets/custom_scale_element.dart'; - import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/features/diary/services/diary_service.g.dart b/lib/features/diary/services/diary_service.g.dart index 8c1039c0..31336bae 100644 --- a/lib/features/diary/services/diary_service.g.dart +++ b/lib/features/diary/services/diary_service.g.dart @@ -79,8 +79,7 @@ class _DiaryService implements DiaryService { final _result = await _dio.fetch>(_options); late Map _value; try { - _value = _result.data!.map((k, dynamic v) => - MapEntry(k, DiaryModel.fromJson(v as Map))); + _value = _result.data!.map((k, dynamic v) => MapEntry(k, DiaryModel.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -140,11 +139,7 @@ class _DiaryService implements DiaryService { final _result = await _dio.fetch>(_options); late Map> _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry( - k, - (v as List) - .map((i) => Product.fromJson(i as Map)) - .toList())); + _value = _result.data!.map((k, dynamic v) => MapEntry(k, (v as List).map((i) => Product.fromJson(i as Map)).toList())); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -333,8 +328,7 @@ class _DiaryService implements DiaryService { final _result = await _dio.fetch>(_options); late Map _value; try { - _value = _result.data!.map((k, dynamic v) => - MapEntry(k, Portion.fromJson(v as Map))); + _value = _result.data!.map((k, dynamic v) => MapEntry(k, Portion.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -511,9 +505,7 @@ class _DiaryService implements DiaryService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart index d2ee8bd2..1847689d 100644 --- a/lib/features/diets/presentation/pages/about_diet_screen.dart +++ b/lib/features/diets/presentation/pages/about_diet_screen.dart @@ -1,7 +1,7 @@ import 'dart:io'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; - import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart'; diff --git a/lib/features/feed/models/comment_model.dart b/lib/features/feed/models/comment_model.dart index edcc722a..1fbcb145 100644 --- a/lib/features/feed/models/comment_model.dart +++ b/lib/features/feed/models/comment_model.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:eatvio_app/core/models/pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'comment_model.freezed.dart'; diff --git a/lib/features/feed/models/comment_model.freezed.dart b/lib/features/feed/models/comment_model.freezed.dart index 4e520131..b32da824 100644 --- a/lib/features/feed/models/comment_model.freezed.dart +++ b/lib/features/feed/models/comment_model.freezed.dart @@ -22,8 +22,10 @@ CommentModel _$CommentModelFromJson(Map json) { mixin _$CommentModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; + @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; + @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -33,32 +35,28 @@ mixin _$CommentModel { /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $CommentModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $CommentModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $CommentModelCopyWith<$Res> { - factory $CommentModelCopyWith( - CommentModel value, $Res Function(CommentModel) then) = - _$CommentModelCopyWithImpl<$Res, CommentModel>; + factory $CommentModelCopyWith(CommentModel value, $Res Function(CommentModel) then) = _$CommentModelCopyWithImpl<$Res, CommentModel>; + @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; + $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> - implements $CommentModelCopyWith<$Res> { +class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> implements $CommentModelCopyWith<$Res> { _$CommentModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -109,31 +107,23 @@ class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> } /// @nodoc -abstract class _$$CommentModelImplCopyWith<$Res> - implements $CommentModelCopyWith<$Res> { - factory _$$CommentModelImplCopyWith( - _$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) = - __$$CommentModelImplCopyWithImpl<$Res>; +abstract class _$$CommentModelImplCopyWith<$Res> implements $CommentModelCopyWith<$Res> { + factory _$$CommentModelImplCopyWith(_$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) = __$$CommentModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; + @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$CommentModelImplCopyWithImpl<$Res> - extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl> - implements _$$CommentModelImplCopyWith<$Res> { - __$$CommentModelImplCopyWithImpl( - _$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) - : super(_value, _then); +class __$$CommentModelImplCopyWithImpl<$Res> extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl> implements _$$CommentModelImplCopyWith<$Res> { + __$$CommentModelImplCopyWithImpl(_$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) : super(_value, _then); /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @@ -165,15 +155,13 @@ class __$$CommentModelImplCopyWithImpl<$Res> @JsonSerializable() class _$CommentModelImpl implements _CommentModel { const _$CommentModelImpl( - {@JsonKey(name: "data") required final List data, - @JsonKey(name: "links") required this.links, - @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$CommentModelImpl.fromJson(Map json) => - _$$CommentModelImplFromJson(json); + factory _$CommentModelImpl.fromJson(Map json) => _$$CommentModelImplFromJson(json); final List _data; + @override @JsonKey(name: "data") List get data { @@ -206,16 +194,14 @@ class _$CommentModelImpl implements _CommentModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => - __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity); + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity); @override Map toJson() { @@ -231,15 +217,16 @@ abstract class _CommentModel implements CommentModel { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$CommentModelImpl; - factory _CommentModel.fromJson(Map json) = - _$CommentModelImpl.fromJson; + factory _CommentModel.fromJson(Map json) = _$CommentModelImpl.fromJson; @override @JsonKey(name: "data") List get data; + @override @JsonKey(name: "links") Links get links; + @override @JsonKey(name: "meta") Meta get meta; @@ -248,8 +235,7 @@ abstract class _CommentModel implements CommentModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => throw _privateConstructorUsedError; } Comment _$CommentFromJson(Map json) { @@ -260,14 +246,19 @@ Comment _$CommentFromJson(Map json) { mixin _$Comment { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "author_name") String get authorName => throw _privateConstructorUsedError; + @JsonKey(name: "author_profile_icon") String get authorProfileIcon => throw _privateConstructorUsedError; + @JsonKey(name: "body") String get body => throw _privateConstructorUsedError; + @JsonKey(name: "children_comments") List get childrenComments => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; @@ -282,8 +273,8 @@ mixin _$Comment { /// @nodoc abstract class $CommentCopyWith<$Res> { - factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = - _$CommentCopyWithImpl<$Res, Comment>; + factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = _$CommentCopyWithImpl<$Res, Comment>; + @useResult $Res call( {@JsonKey(name: "id") int id, @@ -295,12 +286,12 @@ abstract class $CommentCopyWith<$Res> { } /// @nodoc -class _$CommentCopyWithImpl<$Res, $Val extends Comment> - implements $CommentCopyWith<$Res> { +class _$CommentCopyWithImpl<$Res, $Val extends Comment> implements $CommentCopyWith<$Res> { _$CommentCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -347,9 +338,8 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> /// @nodoc abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { - factory _$$CommentImplCopyWith( - _$CommentImpl value, $Res Function(_$CommentImpl) then) = - __$$CommentImplCopyWithImpl<$Res>; + factory _$$CommentImplCopyWith(_$CommentImpl value, $Res Function(_$CommentImpl) then) = __$$CommentImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -362,12 +352,8 @@ abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { } /// @nodoc -class __$$CommentImplCopyWithImpl<$Res> - extends _$CommentCopyWithImpl<$Res, _$CommentImpl> - implements _$$CommentImplCopyWith<$Res> { - __$$CommentImplCopyWithImpl( - _$CommentImpl _value, $Res Function(_$CommentImpl) _then) - : super(_value, _then); +class __$$CommentImplCopyWithImpl<$Res> extends _$CommentCopyWithImpl<$Res, _$CommentImpl> implements _$$CommentImplCopyWith<$Res> { + __$$CommentImplCopyWithImpl(_$CommentImpl _value, $Res Function(_$CommentImpl) _then) : super(_value, _then); /// Create a copy of Comment /// with the given fields replaced by the non-null parameter values. @@ -418,13 +404,11 @@ class _$CommentImpl implements _Comment { @JsonKey(name: "author_name") required this.authorName, @JsonKey(name: "author_profile_icon") required this.authorProfileIcon, @JsonKey(name: "body") required this.body, - @JsonKey(name: "children_comments") - required final List childrenComments, + @JsonKey(name: "children_comments") required final List childrenComments, @JsonKey(name: "created_at") required this.createdAt}) : _childrenComments = childrenComments; - factory _$CommentImpl.fromJson(Map json) => - _$$CommentImplFromJson(json); + factory _$CommentImpl.fromJson(Map json) => _$$CommentImplFromJson(json); @override @JsonKey(name: "id") @@ -439,11 +423,11 @@ class _$CommentImpl implements _Comment { @JsonKey(name: "body") final String body; final List _childrenComments; + @override @JsonKey(name: "children_comments") List get childrenComments { - if (_childrenComments is EqualUnmodifiableListView) - return _childrenComments; + if (_childrenComments is EqualUnmodifiableListView) return _childrenComments; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_childrenComments); } @@ -463,35 +447,23 @@ class _$CommentImpl implements _Comment { (other.runtimeType == runtimeType && other is _$CommentImpl && (identical(other.id, id) || other.id == id) && - (identical(other.authorName, authorName) || - other.authorName == authorName) && - (identical(other.authorProfileIcon, authorProfileIcon) || - other.authorProfileIcon == authorProfileIcon) && + (identical(other.authorName, authorName) || other.authorName == authorName) && + (identical(other.authorProfileIcon, authorProfileIcon) || other.authorProfileIcon == authorProfileIcon) && (identical(other.body, body) || other.body == body) && - const DeepCollectionEquality() - .equals(other._childrenComments, _childrenComments) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt)); + const DeepCollectionEquality().equals(other._childrenComments, _childrenComments) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - id, - authorName, - authorProfileIcon, - body, - const DeepCollectionEquality().hash(_childrenComments), - createdAt); + int get hashCode => Object.hash(runtimeType, id, authorName, authorProfileIcon, body, const DeepCollectionEquality().hash(_childrenComments), createdAt); /// Create a copy of Comment /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => - __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); @override Map toJson() { @@ -503,33 +475,35 @@ class _$CommentImpl implements _Comment { abstract class _Comment implements Comment { const factory _Comment( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "author_name") required final String authorName, - @JsonKey(name: "author_profile_icon") - required final String authorProfileIcon, - @JsonKey(name: "body") required final String body, - @JsonKey(name: "children_comments") - required final List childrenComments, - @JsonKey(name: "created_at") required final DateTime createdAt}) = - _$CommentImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "author_name") required final String authorName, + @JsonKey(name: "author_profile_icon") required final String authorProfileIcon, + @JsonKey(name: "body") required final String body, + @JsonKey(name: "children_comments") required final List childrenComments, + @JsonKey(name: "created_at") required final DateTime createdAt}) = _$CommentImpl; factory _Comment.fromJson(Map json) = _$CommentImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "author_name") String get authorName; + @override @JsonKey(name: "author_profile_icon") String get authorProfileIcon; + @override @JsonKey(name: "body") String get body; + @override @JsonKey(name: "children_comments") List get childrenComments; + @override @JsonKey(name: "created_at") DateTime get createdAt; @@ -538,6 +512,5 @@ abstract class _Comment implements Comment { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/comment_model.g.dart b/lib/features/feed/models/comment_model.g.dart index 1410cfcc..503322f9 100644 --- a/lib/features/feed/models/comment_model.g.dart +++ b/lib/features/feed/models/comment_model.g.dart @@ -6,36 +6,28 @@ part of 'comment_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CommentModelImpl _$$CommentModelImplFromJson(Map json) => - _$CommentModelImpl( - data: (json['data'] as List) - .map((e) => Comment.fromJson(e as Map)) - .toList(), +_$CommentModelImpl _$$CommentModelImplFromJson(Map json) => _$CommentModelImpl( + data: (json['data'] as List).map((e) => Comment.fromJson(e as Map)).toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$CommentModelImplToJson(_$CommentModelImpl instance) => - { +Map _$$CommentModelImplToJson(_$CommentModelImpl instance) => { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$CommentImpl _$$CommentImplFromJson(Map json) => - _$CommentImpl( +_$CommentImpl _$$CommentImplFromJson(Map json) => _$CommentImpl( id: (json['id'] as num).toInt(), authorName: json['author_name'] as String, authorProfileIcon: json['author_profile_icon'] as String, body: json['body'] as String, - childrenComments: (json['children_comments'] as List) - .map((e) => Comment.fromJson(e as Map)) - .toList(), + childrenComments: (json['children_comments'] as List).map((e) => Comment.fromJson(e as Map)).toList(), createdAt: DateTime.parse(json['created_at'] as String), ); -Map _$$CommentImplToJson(_$CommentImpl instance) => - { +Map _$$CommentImplToJson(_$CommentImpl instance) => { 'id': instance.id, 'author_name': instance.authorName, 'author_profile_icon': instance.authorProfileIcon, diff --git a/lib/features/feed/models/diets_pagination_model.dart b/lib/features/feed/models/diets_pagination_model.dart index f56c606c..a83be43f 100644 --- a/lib/features/feed/models/diets_pagination_model.dart +++ b/lib/features/feed/models/diets_pagination_model.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:eatvio_app/core/models/pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'diets_pagination_model.freezed.dart'; diff --git a/lib/features/feed/models/diets_pagination_model.freezed.dart b/lib/features/feed/models/diets_pagination_model.freezed.dart index 15b651f3..9e81d064 100644 --- a/lib/features/feed/models/diets_pagination_model.freezed.dart +++ b/lib/features/feed/models/diets_pagination_model.freezed.dart @@ -22,8 +22,10 @@ DietsPagination _$DietsPaginationFromJson(Map json) { mixin _$DietsPagination { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; + @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; + @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -33,32 +35,28 @@ mixin _$DietsPagination { /// Create a copy of DietsPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DietsPaginationCopyWith get copyWith => - throw _privateConstructorUsedError; + $DietsPaginationCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DietsPaginationCopyWith<$Res> { - factory $DietsPaginationCopyWith( - DietsPagination value, $Res Function(DietsPagination) then) = - _$DietsPaginationCopyWithImpl<$Res, DietsPagination>; + factory $DietsPaginationCopyWith(DietsPagination value, $Res Function(DietsPagination) then) = _$DietsPaginationCopyWithImpl<$Res, DietsPagination>; + @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; + $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> - implements $DietsPaginationCopyWith<$Res> { +class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> implements $DietsPaginationCopyWith<$Res> { _$DietsPaginationCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -109,31 +107,24 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> } /// @nodoc -abstract class _$$DietsPaginationImplCopyWith<$Res> - implements $DietsPaginationCopyWith<$Res> { - factory _$$DietsPaginationImplCopyWith(_$DietsPaginationImpl value, - $Res Function(_$DietsPaginationImpl) then) = - __$$DietsPaginationImplCopyWithImpl<$Res>; +abstract class _$$DietsPaginationImplCopyWith<$Res> implements $DietsPaginationCopyWith<$Res> { + factory _$$DietsPaginationImplCopyWith(_$DietsPaginationImpl value, $Res Function(_$DietsPaginationImpl) then) = __$$DietsPaginationImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; + @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$DietsPaginationImplCopyWithImpl<$Res> - extends _$DietsPaginationCopyWithImpl<$Res, _$DietsPaginationImpl> +class __$$DietsPaginationImplCopyWithImpl<$Res> extends _$DietsPaginationCopyWithImpl<$Res, _$DietsPaginationImpl> implements _$$DietsPaginationImplCopyWith<$Res> { - __$$DietsPaginationImplCopyWithImpl( - _$DietsPaginationImpl _value, $Res Function(_$DietsPaginationImpl) _then) - : super(_value, _then); + __$$DietsPaginationImplCopyWithImpl(_$DietsPaginationImpl _value, $Res Function(_$DietsPaginationImpl) _then) : super(_value, _then); /// Create a copy of DietsPagination /// with the given fields replaced by the non-null parameter values. @@ -165,15 +156,13 @@ class __$$DietsPaginationImplCopyWithImpl<$Res> @JsonSerializable() class _$DietsPaginationImpl implements _DietsPagination { const _$DietsPaginationImpl( - {@JsonKey(name: "data") required final List data, - @JsonKey(name: "links") required this.links, - @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$DietsPaginationImpl.fromJson(Map json) => - _$$DietsPaginationImplFromJson(json); + factory _$DietsPaginationImpl.fromJson(Map json) => _$$DietsPaginationImplFromJson(json); final List _data; + @override @JsonKey(name: "data") List get data { @@ -206,17 +195,14 @@ class _$DietsPaginationImpl implements _DietsPagination { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of DietsPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => - __$$DietsPaginationImplCopyWithImpl<_$DietsPaginationImpl>( - this, _$identity); + _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => __$$DietsPaginationImplCopyWithImpl<_$DietsPaginationImpl>(this, _$identity); @override Map toJson() { @@ -232,15 +218,16 @@ abstract class _DietsPagination implements DietsPagination { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$DietsPaginationImpl; - factory _DietsPagination.fromJson(Map json) = - _$DietsPaginationImpl.fromJson; + factory _DietsPagination.fromJson(Map json) = _$DietsPaginationImpl.fromJson; @override @JsonKey(name: "data") List get data; + @override @JsonKey(name: "links") Links get links; + @override @JsonKey(name: "meta") Meta get meta; @@ -249,8 +236,7 @@ abstract class _DietsPagination implements DietsPagination { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => throw _privateConstructorUsedError; } Diet _$DietFromJson(Map json) { @@ -261,27 +247,37 @@ Diet _$DietFromJson(Map json) { mixin _$Diet { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; + @JsonKey(name: "image") String get image => throw _privateConstructorUsedError; + @JsonKey(name: "duration") int get duration => throw _privateConstructorUsedError; + @JsonKey(name: "state") String get state => throw _privateConstructorUsedError; + @JsonKey(name: "type") DietType get type => throw _privateConstructorUsedError; + @JsonKey(name: "details") String get details => throw _privateConstructorUsedError; + @JsonKey(name: "daily_schedule") - List>> get dailySchedule => - throw _privateConstructorUsedError; + List>> get dailySchedule => throw _privateConstructorUsedError; + @JsonKey(name: "author") Author get author => throw _privateConstructorUsedError; + @JsonKey(name: "total_likes") int get totalLikes => throw _privateConstructorUsedError; + @JsonKey(name: "total_views") int get totalViews => throw _privateConstructorUsedError; + @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; @@ -296,8 +292,8 @@ mixin _$Diet { /// @nodoc abstract class $DietCopyWith<$Res> { - factory $DietCopyWith(Diet value, $Res Function(Diet) then) = - _$DietCopyWithImpl<$Res, Diet>; + factory $DietCopyWith(Diet value, $Res Function(Diet) then) = _$DietCopyWithImpl<$Res, Diet>; + @useResult $Res call( {@JsonKey(name: "id") int id, @@ -307,24 +303,24 @@ abstract class $DietCopyWith<$Res> { @JsonKey(name: "state") String state, @JsonKey(name: "type") DietType type, @JsonKey(name: "details") String details, - @JsonKey(name: "daily_schedule") - List>> dailySchedule, + @JsonKey(name: "daily_schedule") List>> dailySchedule, @JsonKey(name: "author") Author author, @JsonKey(name: "total_likes") int totalLikes, @JsonKey(name: "total_views") int totalViews, @JsonKey(name: "total_comments") int totalComments}); $DietTypeCopyWith<$Res> get type; + $AuthorCopyWith<$Res> get author; } /// @nodoc -class _$DietCopyWithImpl<$Res, $Val extends Diet> - implements $DietCopyWith<$Res> { +class _$DietCopyWithImpl<$Res, $Val extends Diet> implements $DietCopyWith<$Res> { _$DietCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -421,9 +417,8 @@ class _$DietCopyWithImpl<$Res, $Val extends Diet> /// @nodoc abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> { - factory _$$DietImplCopyWith( - _$DietImpl value, $Res Function(_$DietImpl) then) = - __$$DietImplCopyWithImpl<$Res>; + factory _$$DietImplCopyWith(_$DietImpl value, $Res Function(_$DietImpl) then) = __$$DietImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -434,8 +429,7 @@ abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> { @JsonKey(name: "state") String state, @JsonKey(name: "type") DietType type, @JsonKey(name: "details") String details, - @JsonKey(name: "daily_schedule") - List>> dailySchedule, + @JsonKey(name: "daily_schedule") List>> dailySchedule, @JsonKey(name: "author") Author author, @JsonKey(name: "total_likes") int totalLikes, @JsonKey(name: "total_views") int totalViews, @@ -443,16 +437,14 @@ abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> { @override $DietTypeCopyWith<$Res> get type; + @override $AuthorCopyWith<$Res> get author; } /// @nodoc -class __$$DietImplCopyWithImpl<$Res> - extends _$DietCopyWithImpl<$Res, _$DietImpl> - implements _$$DietImplCopyWith<$Res> { - __$$DietImplCopyWithImpl(_$DietImpl _value, $Res Function(_$DietImpl) _then) - : super(_value, _then); +class __$$DietImplCopyWithImpl<$Res> extends _$DietCopyWithImpl<$Res, _$DietImpl> implements _$$DietImplCopyWith<$Res> { + __$$DietImplCopyWithImpl(_$DietImpl _value, $Res Function(_$DietImpl) _then) : super(_value, _then); /// Create a copy of Diet /// with the given fields replaced by the non-null parameter values. @@ -536,16 +528,14 @@ class _$DietImpl implements _Diet { @JsonKey(name: "state") required this.state, @JsonKey(name: "type") required this.type, @JsonKey(name: "details") required this.details, - @JsonKey(name: "daily_schedule") - required final List>> dailySchedule, + @JsonKey(name: "daily_schedule") required final List>> dailySchedule, @JsonKey(name: "author") required this.author, @JsonKey(name: "total_likes") required this.totalLikes, @JsonKey(name: "total_views") required this.totalViews, @JsonKey(name: "total_comments") required this.totalComments}) : _dailySchedule = dailySchedule; - factory _$DietImpl.fromJson(Map json) => - _$$DietImplFromJson(json); + factory _$DietImpl.fromJson(Map json) => _$$DietImplFromJson(json); @override @JsonKey(name: "id") @@ -569,6 +559,7 @@ class _$DietImpl implements _Diet { @JsonKey(name: "details") final String details; final List>> _dailySchedule; + @override @JsonKey(name: "daily_schedule") List>> get dailySchedule { @@ -603,46 +594,28 @@ class _$DietImpl implements _Diet { (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.image, image) || other.image == image) && - (identical(other.duration, duration) || - other.duration == duration) && + (identical(other.duration, duration) || other.duration == duration) && (identical(other.state, state) || other.state == state) && (identical(other.type, type) || other.type == type) && (identical(other.details, details) || other.details == details) && - const DeepCollectionEquality() - .equals(other._dailySchedule, _dailySchedule) && + const DeepCollectionEquality().equals(other._dailySchedule, _dailySchedule) && (identical(other.author, author) || other.author == author) && - (identical(other.totalLikes, totalLikes) || - other.totalLikes == totalLikes) && - (identical(other.totalViews, totalViews) || - other.totalViews == totalViews) && - (identical(other.totalComments, totalComments) || - other.totalComments == totalComments)); + (identical(other.totalLikes, totalLikes) || other.totalLikes == totalLikes) && + (identical(other.totalViews, totalViews) || other.totalViews == totalViews) && + (identical(other.totalComments, totalComments) || other.totalComments == totalComments)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - id, - name, - image, - duration, - state, - type, - details, - const DeepCollectionEquality().hash(_dailySchedule), - author, - totalLikes, - totalViews, - totalComments); + int get hashCode => Object.hash(runtimeType, id, name, image, duration, state, type, details, const DeepCollectionEquality().hash(_dailySchedule), author, + totalLikes, totalViews, totalComments); /// Create a copy of Diet /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietImplCopyWith<_$DietImpl> get copyWith => - __$$DietImplCopyWithImpl<_$DietImpl>(this, _$identity); + _$$DietImplCopyWith<_$DietImpl> get copyWith => __$$DietImplCopyWithImpl<_$DietImpl>(this, _$identity); @override Map toJson() { @@ -654,56 +627,65 @@ class _$DietImpl implements _Diet { abstract class _Diet implements Diet { const factory _Diet( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "image") required final String image, - @JsonKey(name: "duration") required final int duration, - @JsonKey(name: "state") required final String state, - @JsonKey(name: "type") required final DietType type, - @JsonKey(name: "details") required final String details, - @JsonKey(name: "daily_schedule") - required final List>> dailySchedule, - @JsonKey(name: "author") required final Author author, - @JsonKey(name: "total_likes") required final int totalLikes, - @JsonKey(name: "total_views") required final int totalViews, - @JsonKey(name: "total_comments") required final int totalComments}) = - _$DietImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "image") required final String image, + @JsonKey(name: "duration") required final int duration, + @JsonKey(name: "state") required final String state, + @JsonKey(name: "type") required final DietType type, + @JsonKey(name: "details") required final String details, + @JsonKey(name: "daily_schedule") required final List>> dailySchedule, + @JsonKey(name: "author") required final Author author, + @JsonKey(name: "total_likes") required final int totalLikes, + @JsonKey(name: "total_views") required final int totalViews, + @JsonKey(name: "total_comments") required final int totalComments}) = _$DietImpl; factory _Diet.fromJson(Map json) = _$DietImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "name") String get name; + @override @JsonKey(name: "image") String get image; + @override @JsonKey(name: "duration") int get duration; + @override @JsonKey(name: "state") String get state; + @override @JsonKey(name: "type") DietType get type; + @override @JsonKey(name: "details") String get details; + @override @JsonKey(name: "daily_schedule") List>> get dailySchedule; + @override @JsonKey(name: "author") Author get author; + @override @JsonKey(name: "total_likes") int get totalLikes; + @override @JsonKey(name: "total_views") int get totalViews; + @override @JsonKey(name: "total_comments") int get totalComments; @@ -712,8 +694,7 @@ abstract class _Diet implements Diet { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietImplCopyWith<_$DietImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DietImplCopyWith<_$DietImpl> get copyWith => throw _privateConstructorUsedError; } Author _$AuthorFromJson(Map json) { @@ -724,10 +705,13 @@ Author _$AuthorFromJson(Map json) { mixin _$Author { @JsonKey(name: "author_slug") String get authorSlug => throw _privateConstructorUsedError; + @JsonKey(name: "author_name") String get authorName => throw _privateConstructorUsedError; + @JsonKey(name: "author_profile_icon") String get authorProfileIcon => throw _privateConstructorUsedError; + @JsonKey(name: "author_is_me") bool get authorIsMe => throw _privateConstructorUsedError; @@ -742,8 +726,8 @@ mixin _$Author { /// @nodoc abstract class $AuthorCopyWith<$Res> { - factory $AuthorCopyWith(Author value, $Res Function(Author) then) = - _$AuthorCopyWithImpl<$Res, Author>; + factory $AuthorCopyWith(Author value, $Res Function(Author) then) = _$AuthorCopyWithImpl<$Res, Author>; + @useResult $Res call( {@JsonKey(name: "author_slug") String authorSlug, @@ -753,12 +737,12 @@ abstract class $AuthorCopyWith<$Res> { } /// @nodoc -class _$AuthorCopyWithImpl<$Res, $Val extends Author> - implements $AuthorCopyWith<$Res> { +class _$AuthorCopyWithImpl<$Res, $Val extends Author> implements $AuthorCopyWith<$Res> { _$AuthorCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -795,9 +779,8 @@ class _$AuthorCopyWithImpl<$Res, $Val extends Author> /// @nodoc abstract class _$$AuthorImplCopyWith<$Res> implements $AuthorCopyWith<$Res> { - factory _$$AuthorImplCopyWith( - _$AuthorImpl value, $Res Function(_$AuthorImpl) then) = - __$$AuthorImplCopyWithImpl<$Res>; + factory _$$AuthorImplCopyWith(_$AuthorImpl value, $Res Function(_$AuthorImpl) then) = __$$AuthorImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -808,12 +791,8 @@ abstract class _$$AuthorImplCopyWith<$Res> implements $AuthorCopyWith<$Res> { } /// @nodoc -class __$$AuthorImplCopyWithImpl<$Res> - extends _$AuthorCopyWithImpl<$Res, _$AuthorImpl> - implements _$$AuthorImplCopyWith<$Res> { - __$$AuthorImplCopyWithImpl( - _$AuthorImpl _value, $Res Function(_$AuthorImpl) _then) - : super(_value, _then); +class __$$AuthorImplCopyWithImpl<$Res> extends _$AuthorCopyWithImpl<$Res, _$AuthorImpl> implements _$$AuthorImplCopyWith<$Res> { + __$$AuthorImplCopyWithImpl(_$AuthorImpl _value, $Res Function(_$AuthorImpl) _then) : super(_value, _then); /// Create a copy of Author /// with the given fields replaced by the non-null parameter values. @@ -855,8 +834,7 @@ class _$AuthorImpl implements _Author { @JsonKey(name: "author_profile_icon") required this.authorProfileIcon, @JsonKey(name: "author_is_me") required this.authorIsMe}); - factory _$AuthorImpl.fromJson(Map json) => - _$$AuthorImplFromJson(json); + factory _$AuthorImpl.fromJson(Map json) => _$$AuthorImplFromJson(json); @override @JsonKey(name: "author_slug") @@ -881,28 +859,22 @@ class _$AuthorImpl implements _Author { return identical(this, other) || (other.runtimeType == runtimeType && other is _$AuthorImpl && - (identical(other.authorSlug, authorSlug) || - other.authorSlug == authorSlug) && - (identical(other.authorName, authorName) || - other.authorName == authorName) && - (identical(other.authorProfileIcon, authorProfileIcon) || - other.authorProfileIcon == authorProfileIcon) && - (identical(other.authorIsMe, authorIsMe) || - other.authorIsMe == authorIsMe)); + (identical(other.authorSlug, authorSlug) || other.authorSlug == authorSlug) && + (identical(other.authorName, authorName) || other.authorName == authorName) && + (identical(other.authorProfileIcon, authorProfileIcon) || other.authorProfileIcon == authorProfileIcon) && + (identical(other.authorIsMe, authorIsMe) || other.authorIsMe == authorIsMe)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, authorSlug, authorName, authorProfileIcon, authorIsMe); + int get hashCode => Object.hash(runtimeType, authorSlug, authorName, authorProfileIcon, authorIsMe); /// Create a copy of Author /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => - __$$AuthorImplCopyWithImpl<_$AuthorImpl>(this, _$identity); + _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => __$$AuthorImplCopyWithImpl<_$AuthorImpl>(this, _$identity); @override Map toJson() { @@ -914,24 +886,25 @@ class _$AuthorImpl implements _Author { abstract class _Author implements Author { const factory _Author( - {@JsonKey(name: "author_slug") required final String authorSlug, - @JsonKey(name: "author_name") required final String authorName, - @JsonKey(name: "author_profile_icon") - required final String authorProfileIcon, - @JsonKey(name: "author_is_me") required final bool authorIsMe}) = - _$AuthorImpl; + {@JsonKey(name: "author_slug") required final String authorSlug, + @JsonKey(name: "author_name") required final String authorName, + @JsonKey(name: "author_profile_icon") required final String authorProfileIcon, + @JsonKey(name: "author_is_me") required final bool authorIsMe}) = _$AuthorImpl; factory _Author.fromJson(Map json) = _$AuthorImpl.fromJson; @override @JsonKey(name: "author_slug") String get authorSlug; + @override @JsonKey(name: "author_name") String get authorName; + @override @JsonKey(name: "author_profile_icon") String get authorProfileIcon; + @override @JsonKey(name: "author_is_me") bool get authorIsMe; @@ -940,8 +913,7 @@ abstract class _Author implements Author { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => throw _privateConstructorUsedError; } DailySchedule _$DailyScheduleFromJson(Map json) { @@ -952,10 +924,13 @@ DailySchedule _$DailyScheduleFromJson(Map json) { mixin _$DailySchedule { @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; + @JsonKey(name: "uniq") String get uniq => throw _privateConstructorUsedError; + @JsonKey(name: "portion") Portion get portion => throw _privateConstructorUsedError; + @JsonKey(name: "quantity") int get quantity => throw _privateConstructorUsedError; @@ -965,15 +940,13 @@ mixin _$DailySchedule { /// Create a copy of DailySchedule /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DailyScheduleCopyWith get copyWith => - throw _privateConstructorUsedError; + $DailyScheduleCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DailyScheduleCopyWith<$Res> { - factory $DailyScheduleCopyWith( - DailySchedule value, $Res Function(DailySchedule) then) = - _$DailyScheduleCopyWithImpl<$Res, DailySchedule>; + factory $DailyScheduleCopyWith(DailySchedule value, $Res Function(DailySchedule) then) = _$DailyScheduleCopyWithImpl<$Res, DailySchedule>; + @useResult $Res call( {@JsonKey(name: "name") String name, @@ -983,12 +956,12 @@ abstract class $DailyScheduleCopyWith<$Res> { } /// @nodoc -class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> - implements $DailyScheduleCopyWith<$Res> { +class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> implements $DailyScheduleCopyWith<$Res> { _$DailyScheduleCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -1024,11 +997,9 @@ class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> } /// @nodoc -abstract class _$$DailyScheduleImplCopyWith<$Res> - implements $DailyScheduleCopyWith<$Res> { - factory _$$DailyScheduleImplCopyWith( - _$DailyScheduleImpl value, $Res Function(_$DailyScheduleImpl) then) = - __$$DailyScheduleImplCopyWithImpl<$Res>; +abstract class _$$DailyScheduleImplCopyWith<$Res> implements $DailyScheduleCopyWith<$Res> { + factory _$$DailyScheduleImplCopyWith(_$DailyScheduleImpl value, $Res Function(_$DailyScheduleImpl) then) = __$$DailyScheduleImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -1039,12 +1010,8 @@ abstract class _$$DailyScheduleImplCopyWith<$Res> } /// @nodoc -class __$$DailyScheduleImplCopyWithImpl<$Res> - extends _$DailyScheduleCopyWithImpl<$Res, _$DailyScheduleImpl> - implements _$$DailyScheduleImplCopyWith<$Res> { - __$$DailyScheduleImplCopyWithImpl( - _$DailyScheduleImpl _value, $Res Function(_$DailyScheduleImpl) _then) - : super(_value, _then); +class __$$DailyScheduleImplCopyWithImpl<$Res> extends _$DailyScheduleCopyWithImpl<$Res, _$DailyScheduleImpl> implements _$$DailyScheduleImplCopyWith<$Res> { + __$$DailyScheduleImplCopyWithImpl(_$DailyScheduleImpl _value, $Res Function(_$DailyScheduleImpl) _then) : super(_value, _then); /// Create a copy of DailySchedule /// with the given fields replaced by the non-null parameter values. @@ -1086,8 +1053,7 @@ class _$DailyScheduleImpl implements _DailySchedule { @JsonKey(name: "portion") required this.portion, @JsonKey(name: "quantity") required this.quantity}); - factory _$DailyScheduleImpl.fromJson(Map json) => - _$$DailyScheduleImplFromJson(json); + factory _$DailyScheduleImpl.fromJson(Map json) => _$$DailyScheduleImplFromJson(json); @override @JsonKey(name: "name") @@ -1115,8 +1081,7 @@ class _$DailyScheduleImpl implements _DailySchedule { (identical(other.name, name) || other.name == name) && (identical(other.uniq, uniq) || other.uniq == uniq) && (identical(other.portion, portion) || other.portion == portion) && - (identical(other.quantity, quantity) || - other.quantity == quantity)); + (identical(other.quantity, quantity) || other.quantity == quantity)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -1128,8 +1093,7 @@ class _$DailyScheduleImpl implements _DailySchedule { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => - __$$DailyScheduleImplCopyWithImpl<_$DailyScheduleImpl>(this, _$identity); + _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => __$$DailyScheduleImplCopyWithImpl<_$DailyScheduleImpl>(this, _$identity); @override Map toJson() { @@ -1141,24 +1105,25 @@ class _$DailyScheduleImpl implements _DailySchedule { abstract class _DailySchedule implements DailySchedule { const factory _DailySchedule( - {@JsonKey(name: "name") required final String name, - @JsonKey(name: "uniq") required final String uniq, - @JsonKey(name: "portion") required final Portion portion, - @JsonKey(name: "quantity") required final int quantity}) = - _$DailyScheduleImpl; + {@JsonKey(name: "name") required final String name, + @JsonKey(name: "uniq") required final String uniq, + @JsonKey(name: "portion") required final Portion portion, + @JsonKey(name: "quantity") required final int quantity}) = _$DailyScheduleImpl; - factory _DailySchedule.fromJson(Map json) = - _$DailyScheduleImpl.fromJson; + factory _DailySchedule.fromJson(Map json) = _$DailyScheduleImpl.fromJson; @override @JsonKey(name: "name") String get name; + @override @JsonKey(name: "uniq") String get uniq; + @override @JsonKey(name: "portion") Portion get portion; + @override @JsonKey(name: "quantity") int get quantity; @@ -1167,8 +1132,7 @@ abstract class _DailySchedule implements DailySchedule { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => throw _privateConstructorUsedError; } DietType _$DietTypeFromJson(Map json) { @@ -1179,10 +1143,13 @@ DietType _$DietTypeFromJson(Map json) { mixin _$DietType { @JsonKey(name: "alko") bool? get alko => throw _privateConstructorUsedError; + @JsonKey(name: "veg") bool? get veg => throw _privateConstructorUsedError; + @JsonKey(name: "corb") bool? get corb => throw _privateConstructorUsedError; + @JsonKey(name: "meat") bool? get meat => throw _privateConstructorUsedError; @@ -1192,29 +1159,24 @@ mixin _$DietType { /// Create a copy of DietType /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DietTypeCopyWith get copyWith => - throw _privateConstructorUsedError; + $DietTypeCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DietTypeCopyWith<$Res> { - factory $DietTypeCopyWith(DietType value, $Res Function(DietType) then) = - _$DietTypeCopyWithImpl<$Res, DietType>; + factory $DietTypeCopyWith(DietType value, $Res Function(DietType) then) = _$DietTypeCopyWithImpl<$Res, DietType>; + @useResult - $Res call( - {@JsonKey(name: "alko") bool? alko, - @JsonKey(name: "veg") bool? veg, - @JsonKey(name: "corb") bool? corb, - @JsonKey(name: "meat") bool? meat}); + $Res call({@JsonKey(name: "alko") bool? alko, @JsonKey(name: "veg") bool? veg, @JsonKey(name: "corb") bool? corb, @JsonKey(name: "meat") bool? meat}); } /// @nodoc -class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> - implements $DietTypeCopyWith<$Res> { +class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> implements $DietTypeCopyWith<$Res> { _$DietTypeCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -1250,27 +1212,17 @@ class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> } /// @nodoc -abstract class _$$DietTypeImplCopyWith<$Res> - implements $DietTypeCopyWith<$Res> { - factory _$$DietTypeImplCopyWith( - _$DietTypeImpl value, $Res Function(_$DietTypeImpl) then) = - __$$DietTypeImplCopyWithImpl<$Res>; +abstract class _$$DietTypeImplCopyWith<$Res> implements $DietTypeCopyWith<$Res> { + factory _$$DietTypeImplCopyWith(_$DietTypeImpl value, $Res Function(_$DietTypeImpl) then) = __$$DietTypeImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "alko") bool? alko, - @JsonKey(name: "veg") bool? veg, - @JsonKey(name: "corb") bool? corb, - @JsonKey(name: "meat") bool? meat}); + $Res call({@JsonKey(name: "alko") bool? alko, @JsonKey(name: "veg") bool? veg, @JsonKey(name: "corb") bool? corb, @JsonKey(name: "meat") bool? meat}); } /// @nodoc -class __$$DietTypeImplCopyWithImpl<$Res> - extends _$DietTypeCopyWithImpl<$Res, _$DietTypeImpl> - implements _$$DietTypeImplCopyWith<$Res> { - __$$DietTypeImplCopyWithImpl( - _$DietTypeImpl _value, $Res Function(_$DietTypeImpl) _then) - : super(_value, _then); +class __$$DietTypeImplCopyWithImpl<$Res> extends _$DietTypeCopyWithImpl<$Res, _$DietTypeImpl> implements _$$DietTypeImplCopyWith<$Res> { + __$$DietTypeImplCopyWithImpl(_$DietTypeImpl _value, $Res Function(_$DietTypeImpl) _then) : super(_value, _then); /// Create a copy of DietType /// with the given fields replaced by the non-null parameter values. @@ -1306,14 +1258,9 @@ class __$$DietTypeImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$DietTypeImpl implements _DietType { - const _$DietTypeImpl( - {@JsonKey(name: "alko") this.alko, - @JsonKey(name: "veg") this.veg, - @JsonKey(name: "corb") this.corb, - @JsonKey(name: "meat") this.meat}); + const _$DietTypeImpl({@JsonKey(name: "alko") this.alko, @JsonKey(name: "veg") this.veg, @JsonKey(name: "corb") this.corb, @JsonKey(name: "meat") this.meat}); - factory _$DietTypeImpl.fromJson(Map json) => - _$$DietTypeImplFromJson(json); + factory _$DietTypeImpl.fromJson(Map json) => _$$DietTypeImplFromJson(json); @override @JsonKey(name: "alko") @@ -1353,8 +1300,7 @@ class _$DietTypeImpl implements _DietType { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => - __$$DietTypeImplCopyWithImpl<_$DietTypeImpl>(this, _$identity); + _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => __$$DietTypeImplCopyWithImpl<_$DietTypeImpl>(this, _$identity); @override Map toJson() { @@ -1371,18 +1317,20 @@ abstract class _DietType implements DietType { @JsonKey(name: "corb") final bool? corb, @JsonKey(name: "meat") final bool? meat}) = _$DietTypeImpl; - factory _DietType.fromJson(Map json) = - _$DietTypeImpl.fromJson; + factory _DietType.fromJson(Map json) = _$DietTypeImpl.fromJson; @override @JsonKey(name: "alko") bool? get alko; + @override @JsonKey(name: "veg") bool? get veg; + @override @JsonKey(name: "corb") bool? get corb; + @override @JsonKey(name: "meat") bool? get meat; @@ -1391,6 +1339,5 @@ abstract class _DietType implements DietType { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/diets_pagination_model.g.dart b/lib/features/feed/models/diets_pagination_model.g.dart index 7fcab8cd..fd3e231c 100644 --- a/lib/features/feed/models/diets_pagination_model.g.dart +++ b/lib/features/feed/models/diets_pagination_model.g.dart @@ -6,19 +6,13 @@ part of 'diets_pagination_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$DietsPaginationImpl _$$DietsPaginationImplFromJson( - Map json) => - _$DietsPaginationImpl( - data: (json['data'] as List) - .map((e) => Diet.fromJson(e as Map)) - .toList(), +_$DietsPaginationImpl _$$DietsPaginationImplFromJson(Map json) => _$DietsPaginationImpl( + data: (json['data'] as List).map((e) => Diet.fromJson(e as Map)).toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$DietsPaginationImplToJson( - _$DietsPaginationImpl instance) => - { +Map _$$DietsPaginationImplToJson(_$DietsPaginationImpl instance) => { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, @@ -33,11 +27,7 @@ _$DietImpl _$$DietImplFromJson(Map json) => _$DietImpl( type: DietType.fromJson(json['type'] as Map), details: json['details'] as String, dailySchedule: (json['daily_schedule'] as List) - .map((e) => (e as List) - .map((e) => (e as List) - .map((e) => DailySchedule.fromJson(e as Map)) - .toList()) - .toList()) + .map((e) => (e as List).map((e) => (e as List).map((e) => DailySchedule.fromJson(e as Map)).toList()).toList()) .toList(), author: Author.fromJson(json['author'] as Map), totalLikes: (json['total_likes'] as num).toInt(), @@ -45,8 +35,7 @@ _$DietImpl _$$DietImplFromJson(Map json) => _$DietImpl( totalComments: (json['total_comments'] as num).toInt(), ); -Map _$$DietImplToJson(_$DietImpl instance) => - { +Map _$$DietImplToJson(_$DietImpl instance) => { 'id': instance.id, 'name': instance.name, 'image': instance.image, @@ -68,24 +57,21 @@ _$AuthorImpl _$$AuthorImplFromJson(Map json) => _$AuthorImpl( authorIsMe: json['author_is_me'] as bool, ); -Map _$$AuthorImplToJson(_$AuthorImpl instance) => - { +Map _$$AuthorImplToJson(_$AuthorImpl instance) => { 'author_slug': instance.authorSlug, 'author_name': instance.authorName, 'author_profile_icon': instance.authorProfileIcon, 'author_is_me': instance.authorIsMe, }; -_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map json) => - _$DailyScheduleImpl( +_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map json) => _$DailyScheduleImpl( name: json['name'] as String, uniq: json['uniq'] as String, portion: $enumDecode(_$PortionEnumMap, json['portion']), quantity: (json['quantity'] as num).toInt(), ); -Map _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) => - { +Map _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) => { 'name': instance.name, 'uniq': instance.uniq, 'portion': _$PortionEnumMap[instance.portion]!, @@ -98,16 +84,14 @@ const _$PortionEnumMap = { Portion.PCS: 'pcs', }; -_$DietTypeImpl _$$DietTypeImplFromJson(Map json) => - _$DietTypeImpl( +_$DietTypeImpl _$$DietTypeImplFromJson(Map json) => _$DietTypeImpl( alko: json['alko'] as bool?, veg: json['veg'] as bool?, corb: json['corb'] as bool?, meat: json['meat'] as bool?, ); -Map _$$DietTypeImplToJson(_$DietTypeImpl instance) => - { +Map _$$DietTypeImplToJson(_$DietTypeImpl instance) => { 'alko': instance.alko, 'veg': instance.veg, 'corb': instance.corb, diff --git a/lib/features/feed/models/feed_blog_post_model.freezed.dart b/lib/features/feed/models/feed_blog_post_model.freezed.dart index 89087373..ce6612b7 100644 --- a/lib/features/feed/models/feed_blog_post_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_model.freezed.dart @@ -21,23 +21,35 @@ FeedBlogPostModel _$FeedBlogPostModelFromJson(Map json) { /// @nodoc mixin _$FeedBlogPostModel { int get id => throw _privateConstructorUsedError; + String get state => throw _privateConstructorUsedError; + String get image => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; + Author get author => throw _privateConstructorUsedError; + @JsonKey(name: "youtube_url") String get youtubeUrl => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; + String get title => throw _privateConstructorUsedError; + @JsonKey(name: "total_likes") int get totalLikes => throw _privateConstructorUsedError; + @JsonKey(name: "total_views") int get totalViews => throw _privateConstructorUsedError; + @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; + @JsonKey(name: "was_liked_by_me") bool get wasLikedByMe => throw _privateConstructorUsedError; @@ -47,15 +59,13 @@ mixin _$FeedBlogPostModel { /// Create a copy of FeedBlogPostModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $FeedBlogPostModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $FeedBlogPostModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $FeedBlogPostModelCopyWith<$Res> { - factory $FeedBlogPostModelCopyWith( - FeedBlogPostModel value, $Res Function(FeedBlogPostModel) then) = - _$FeedBlogPostModelCopyWithImpl<$Res, FeedBlogPostModel>; + factory $FeedBlogPostModelCopyWith(FeedBlogPostModel value, $Res Function(FeedBlogPostModel) then) = _$FeedBlogPostModelCopyWithImpl<$Res, FeedBlogPostModel>; + @useResult $Res call( {int id, @@ -76,12 +86,12 @@ abstract class $FeedBlogPostModelCopyWith<$Res> { } /// @nodoc -class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> - implements $FeedBlogPostModelCopyWith<$Res> { +class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> implements $FeedBlogPostModelCopyWith<$Res> { _$FeedBlogPostModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -172,11 +182,10 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> } /// @nodoc -abstract class _$$FeedBlogPostModelImplCopyWith<$Res> - implements $FeedBlogPostModelCopyWith<$Res> { - factory _$$FeedBlogPostModelImplCopyWith(_$FeedBlogPostModelImpl value, - $Res Function(_$FeedBlogPostModelImpl) then) = +abstract class _$$FeedBlogPostModelImplCopyWith<$Res> implements $FeedBlogPostModelCopyWith<$Res> { + factory _$$FeedBlogPostModelImplCopyWith(_$FeedBlogPostModelImpl value, $Res Function(_$FeedBlogPostModelImpl) then) = __$$FeedBlogPostModelImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -199,12 +208,9 @@ abstract class _$$FeedBlogPostModelImplCopyWith<$Res> } /// @nodoc -class __$$FeedBlogPostModelImplCopyWithImpl<$Res> - extends _$FeedBlogPostModelCopyWithImpl<$Res, _$FeedBlogPostModelImpl> +class __$$FeedBlogPostModelImplCopyWithImpl<$Res> extends _$FeedBlogPostModelCopyWithImpl<$Res, _$FeedBlogPostModelImpl> implements _$$FeedBlogPostModelImplCopyWith<$Res> { - __$$FeedBlogPostModelImplCopyWithImpl(_$FeedBlogPostModelImpl _value, - $Res Function(_$FeedBlogPostModelImpl) _then) - : super(_value, _then); + __$$FeedBlogPostModelImplCopyWithImpl(_$FeedBlogPostModelImpl _value, $Res Function(_$FeedBlogPostModelImpl) _then) : super(_value, _then); /// Create a copy of FeedBlogPostModel /// with the given fields replaced by the non-null parameter values. @@ -300,8 +306,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { @JsonKey(name: "total_comments") required this.totalComments, @JsonKey(name: "was_liked_by_me") required this.wasLikedByMe}); - factory _$FeedBlogPostModelImpl.fromJson(Map json) => - _$$FeedBlogPostModelImplFromJson(json); + factory _$FeedBlogPostModelImpl.fromJson(Map json) => _$$FeedBlogPostModelImplFromJson(json); @override final int id; @@ -350,52 +355,29 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { (identical(other.id, id) || other.id == id) && (identical(other.state, state) || other.state == state) && (identical(other.image, image) || other.image == image) && - (identical(other.description, description) || - other.description == description) && + (identical(other.description, description) || other.description == description) && (identical(other.author, author) || other.author == author) && - (identical(other.youtubeUrl, youtubeUrl) || - other.youtubeUrl == youtubeUrl) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt) && + (identical(other.youtubeUrl, youtubeUrl) || other.youtubeUrl == youtubeUrl) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && (identical(other.title, title) || other.title == title) && - (identical(other.totalLikes, totalLikes) || - other.totalLikes == totalLikes) && - (identical(other.totalViews, totalViews) || - other.totalViews == totalViews) && - (identical(other.totalComments, totalComments) || - other.totalComments == totalComments) && - (identical(other.wasLikedByMe, wasLikedByMe) || - other.wasLikedByMe == wasLikedByMe)); + (identical(other.totalLikes, totalLikes) || other.totalLikes == totalLikes) && + (identical(other.totalViews, totalViews) || other.totalViews == totalViews) && + (identical(other.totalComments, totalComments) || other.totalComments == totalComments) && + (identical(other.wasLikedByMe, wasLikedByMe) || other.wasLikedByMe == wasLikedByMe)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - id, - state, - image, - description, - author, - youtubeUrl, - createdAt, - updatedAt, - title, - totalLikes, - totalViews, - totalComments, - wasLikedByMe); + runtimeType, id, state, image, description, author, youtubeUrl, createdAt, updatedAt, title, totalLikes, totalViews, totalComments, wasLikedByMe); /// Create a copy of FeedBlogPostModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => - __$$FeedBlogPostModelImplCopyWithImpl<_$FeedBlogPostModelImpl>( - this, _$identity); + _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => __$$FeedBlogPostModelImplCopyWithImpl<_$FeedBlogPostModelImpl>(this, _$identity); @override Map toJson() { @@ -407,54 +389,64 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { abstract class _FeedBlogPostModel implements FeedBlogPostModel { const factory _FeedBlogPostModel( - {required final int id, - required final String state, - required final String image, - required final String description, - required final Author author, - @JsonKey(name: "youtube_url") required final String youtubeUrl, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") required final DateTime updatedAt, - required final String title, - @JsonKey(name: "total_likes") required final int totalLikes, - @JsonKey(name: "total_views") required final int totalViews, - @JsonKey(name: "total_comments") required final int totalComments, - @JsonKey(name: "was_liked_by_me") required final bool wasLikedByMe}) = - _$FeedBlogPostModelImpl; + {required final int id, + required final String state, + required final String image, + required final String description, + required final Author author, + @JsonKey(name: "youtube_url") required final String youtubeUrl, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt, + required final String title, + @JsonKey(name: "total_likes") required final int totalLikes, + @JsonKey(name: "total_views") required final int totalViews, + @JsonKey(name: "total_comments") required final int totalComments, + @JsonKey(name: "was_liked_by_me") required final bool wasLikedByMe}) = _$FeedBlogPostModelImpl; - factory _FeedBlogPostModel.fromJson(Map json) = - _$FeedBlogPostModelImpl.fromJson; + factory _FeedBlogPostModel.fromJson(Map json) = _$FeedBlogPostModelImpl.fromJson; @override int get id; + @override String get state; + @override String get image; + @override String get description; + @override Author get author; + @override @JsonKey(name: "youtube_url") String get youtubeUrl; + @override @JsonKey(name: "created_at") DateTime get createdAt; + @override @JsonKey(name: "updated_at") DateTime get updatedAt; + @override String get title; + @override @JsonKey(name: "total_likes") int get totalLikes; + @override @JsonKey(name: "total_views") int get totalViews; + @override @JsonKey(name: "total_comments") int get totalComments; + @override @JsonKey(name: "was_liked_by_me") bool get wasLikedByMe; @@ -463,6 +455,5 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/feed_blog_post_model.g.dart b/lib/features/feed/models/feed_blog_post_model.g.dart index fadf4302..29ecd6f7 100644 --- a/lib/features/feed/models/feed_blog_post_model.g.dart +++ b/lib/features/feed/models/feed_blog_post_model.g.dart @@ -6,9 +6,7 @@ part of 'feed_blog_post_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson( - Map json) => - _$FeedBlogPostModelImpl( +_$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(Map json) => _$FeedBlogPostModelImpl( id: (json['id'] as num).toInt(), state: json['state'] as String, image: json['image'] as String, @@ -24,9 +22,7 @@ _$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson( wasLikedByMe: json['was_liked_by_me'] as bool, ); -Map _$$FeedBlogPostModelImplToJson( - _$FeedBlogPostModelImpl instance) => - { +Map _$$FeedBlogPostModelImplToJson(_$FeedBlogPostModelImpl instance) => { 'id': instance.id, 'state': instance.state, 'image': instance.image, diff --git a/lib/features/feed/models/feed_blog_post_settings_model.dart b/lib/features/feed/models/feed_blog_post_settings_model.dart index 2dcd22a1..2998cddd 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:eatvio_app/core/models/pagination_model.dart'; import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; diff --git a/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart b/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart index 9bddceae..1121d5e1 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart @@ -14,16 +14,15 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -FeedBlogPostSettingsModel _$FeedBlogPostSettingsModelFromJson( - Map json) { +FeedBlogPostSettingsModel _$FeedBlogPostSettingsModelFromJson(Map json) { return _FeedBlogPostSettingsModel.fromJson(json); } /// @nodoc mixin _$FeedBlogPostSettingsModel { @JsonKey(name: 'data') - List get feedBlogPostList => - throw _privateConstructorUsedError; + List get feedBlogPostList => throw _privateConstructorUsedError; + Meta get meta => throw _privateConstructorUsedError; /// Serializes this FeedBlogPostSettingsModel to a JSON map. @@ -32,31 +31,27 @@ mixin _$FeedBlogPostSettingsModel { /// Create a copy of FeedBlogPostSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $FeedBlogPostSettingsModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $FeedBlogPostSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $FeedBlogPostSettingsModelCopyWith<$Res> { - factory $FeedBlogPostSettingsModelCopyWith(FeedBlogPostSettingsModel value, - $Res Function(FeedBlogPostSettingsModel) then) = + factory $FeedBlogPostSettingsModelCopyWith(FeedBlogPostSettingsModel value, $Res Function(FeedBlogPostSettingsModel) then) = _$FeedBlogPostSettingsModelCopyWithImpl<$Res, FeedBlogPostSettingsModel>; + @useResult - $Res call( - {@JsonKey(name: 'data') List feedBlogPostList, - Meta meta}); + $Res call({@JsonKey(name: 'data') List feedBlogPostList, Meta meta}); $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, - $Val extends FeedBlogPostSettingsModel> - implements $FeedBlogPostSettingsModelCopyWith<$Res> { +class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, $Val extends FeedBlogPostSettingsModel> implements $FeedBlogPostSettingsModelCopyWith<$Res> { _$FeedBlogPostSettingsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -92,30 +87,22 @@ class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, } /// @nodoc -abstract class _$$FeedBlogPostSettingsModelImplCopyWith<$Res> - implements $FeedBlogPostSettingsModelCopyWith<$Res> { - factory _$$FeedBlogPostSettingsModelImplCopyWith( - _$FeedBlogPostSettingsModelImpl value, - $Res Function(_$FeedBlogPostSettingsModelImpl) then) = +abstract class _$$FeedBlogPostSettingsModelImplCopyWith<$Res> implements $FeedBlogPostSettingsModelCopyWith<$Res> { + factory _$$FeedBlogPostSettingsModelImplCopyWith(_$FeedBlogPostSettingsModelImpl value, $Res Function(_$FeedBlogPostSettingsModelImpl) then) = __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: 'data') List feedBlogPostList, - Meta meta}); + $Res call({@JsonKey(name: 'data') List feedBlogPostList, Meta meta}); @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> - extends _$FeedBlogPostSettingsModelCopyWithImpl<$Res, - _$FeedBlogPostSettingsModelImpl> +class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> extends _$FeedBlogPostSettingsModelCopyWithImpl<$Res, _$FeedBlogPostSettingsModelImpl> implements _$$FeedBlogPostSettingsModelImplCopyWith<$Res> { - __$$FeedBlogPostSettingsModelImplCopyWithImpl( - _$FeedBlogPostSettingsModelImpl _value, - $Res Function(_$FeedBlogPostSettingsModelImpl) _then) + __$$FeedBlogPostSettingsModelImplCopyWithImpl(_$FeedBlogPostSettingsModelImpl _value, $Res Function(_$FeedBlogPostSettingsModelImpl) _then) : super(_value, _then); /// Create a copy of FeedBlogPostSettingsModel @@ -142,21 +129,17 @@ class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { - const _$FeedBlogPostSettingsModelImpl( - {@JsonKey(name: 'data') - required final List feedBlogPostList, - required this.meta}) + const _$FeedBlogPostSettingsModelImpl({@JsonKey(name: 'data') required final List feedBlogPostList, required this.meta}) : _feedBlogPostList = feedBlogPostList; - factory _$FeedBlogPostSettingsModelImpl.fromJson(Map json) => - _$$FeedBlogPostSettingsModelImplFromJson(json); + factory _$FeedBlogPostSettingsModelImpl.fromJson(Map json) => _$$FeedBlogPostSettingsModelImplFromJson(json); final List _feedBlogPostList; + @override @JsonKey(name: 'data') List get feedBlogPostList { - if (_feedBlogPostList is EqualUnmodifiableListView) - return _feedBlogPostList; + if (_feedBlogPostList is EqualUnmodifiableListView) return _feedBlogPostList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_feedBlogPostList); } @@ -174,24 +157,21 @@ class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedBlogPostSettingsModelImpl && - const DeepCollectionEquality() - .equals(other._feedBlogPostList, _feedBlogPostList) && + const DeepCollectionEquality().equals(other._feedBlogPostList, _feedBlogPostList) && (identical(other.meta, meta) || other.meta == meta)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, - const DeepCollectionEquality().hash(_feedBlogPostList), meta); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList), meta); /// Create a copy of FeedBlogPostSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> - get copyWith => __$$FeedBlogPostSettingsModelImplCopyWithImpl< - _$FeedBlogPostSettingsModelImpl>(this, _$identity); + _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> get copyWith => + __$$FeedBlogPostSettingsModelImplCopyWithImpl<_$FeedBlogPostSettingsModelImpl>(this, _$identity); @override Map toJson() { @@ -202,17 +182,15 @@ class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { } abstract class _FeedBlogPostSettingsModel implements FeedBlogPostSettingsModel { - const factory _FeedBlogPostSettingsModel( - {@JsonKey(name: 'data') - required final List feedBlogPostList, - required final Meta meta}) = _$FeedBlogPostSettingsModelImpl; + const factory _FeedBlogPostSettingsModel({@JsonKey(name: 'data') required final List feedBlogPostList, required final Meta meta}) = + _$FeedBlogPostSettingsModelImpl; - factory _FeedBlogPostSettingsModel.fromJson(Map json) = - _$FeedBlogPostSettingsModelImpl.fromJson; + factory _FeedBlogPostSettingsModel.fromJson(Map json) = _$FeedBlogPostSettingsModelImpl.fromJson; @override @JsonKey(name: 'data') List get feedBlogPostList; + @override Meta get meta; @@ -220,6 +198,5 @@ abstract class _FeedBlogPostSettingsModel implements FeedBlogPostSettingsModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> - get copyWith => throw _privateConstructorUsedError; + _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/feed_blog_post_settings_model.g.dart b/lib/features/feed/models/feed_blog_post_settings_model.g.dart index e300b594..9566ca99 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.g.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.g.dart @@ -6,18 +6,12 @@ part of 'feed_blog_post_settings_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$FeedBlogPostSettingsModelImpl _$$FeedBlogPostSettingsModelImplFromJson( - Map json) => - _$FeedBlogPostSettingsModelImpl( - feedBlogPostList: (json['data'] as List) - .map((e) => FeedBlogPostModel.fromJson(e as Map)) - .toList(), +_$FeedBlogPostSettingsModelImpl _$$FeedBlogPostSettingsModelImplFromJson(Map json) => _$FeedBlogPostSettingsModelImpl( + feedBlogPostList: (json['data'] as List).map((e) => FeedBlogPostModel.fromJson(e as Map)).toList(), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$FeedBlogPostSettingsModelImplToJson( - _$FeedBlogPostSettingsModelImpl instance) => - { +Map _$$FeedBlogPostSettingsModelImplToJson(_$FeedBlogPostSettingsModelImpl instance) => { 'data': instance.feedBlogPostList, 'meta': instance.meta, }; diff --git a/lib/features/feed/models/recipes_model.freezed.dart b/lib/features/feed/models/recipes_model.freezed.dart index 9dd4f54e..6b59786a 100644 --- a/lib/features/feed/models/recipes_model.freezed.dart +++ b/lib/features/feed/models/recipes_model.freezed.dart @@ -21,28 +21,44 @@ Recipes _$RecipesFromJson(Map json) { /// @nodoc mixin _$Recipes { int get id => throw _privateConstructorUsedError; + String get image => throw _privateConstructorUsedError; + String get state => throw _privateConstructorUsedError; + @JsonKey(name: 'cooking_time') int get cookingTime => throw _privateConstructorUsedError; + List get ingredients => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; + List get steps => throw _privateConstructorUsedError; + @JsonKey(name: 'video_url') String get videoUrl => throw _privateConstructorUsedError; + @JsonKey(name: 'created_at') DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: 'updated_at') DateTime get updatedAt => throw _privateConstructorUsedError; + String get title => throw _privateConstructorUsedError; + String get type => throw _privateConstructorUsedError; + String get slug => throw _privateConstructorUsedError; + @JsonKey(name: 'total_comments') int get commentsCount => throw _privateConstructorUsedError; + @JsonKey(name: 'total_likes') int get likesCount => throw _privateConstructorUsedError; + @JsonKey(name: 'total_views') int get viewsCount => throw _privateConstructorUsedError; + Author get author => throw _privateConstructorUsedError; /// Serializes this Recipes to a JSON map. @@ -56,8 +72,8 @@ mixin _$Recipes { /// @nodoc abstract class $RecipesCopyWith<$Res> { - factory $RecipesCopyWith(Recipes value, $Res Function(Recipes) then) = - _$RecipesCopyWithImpl<$Res, Recipes>; + factory $RecipesCopyWith(Recipes value, $Res Function(Recipes) then) = _$RecipesCopyWithImpl<$Res, Recipes>; + @useResult $Res call( {int id, @@ -82,12 +98,12 @@ abstract class $RecipesCopyWith<$Res> { } /// @nodoc -class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> - implements $RecipesCopyWith<$Res> { +class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> implements $RecipesCopyWith<$Res> { _$RecipesCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -199,9 +215,8 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> /// @nodoc abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> { - factory _$$RecipesImplCopyWith( - _$RecipesImpl value, $Res Function(_$RecipesImpl) then) = - __$$RecipesImplCopyWithImpl<$Res>; + factory _$$RecipesImplCopyWith(_$RecipesImpl value, $Res Function(_$RecipesImpl) then) = __$$RecipesImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -228,12 +243,8 @@ abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> { } /// @nodoc -class __$$RecipesImplCopyWithImpl<$Res> - extends _$RecipesCopyWithImpl<$Res, _$RecipesImpl> - implements _$$RecipesImplCopyWith<$Res> { - __$$RecipesImplCopyWithImpl( - _$RecipesImpl _value, $Res Function(_$RecipesImpl) _then) - : super(_value, _then); +class __$$RecipesImplCopyWithImpl<$Res> extends _$RecipesCopyWithImpl<$Res, _$RecipesImpl> implements _$$RecipesImplCopyWith<$Res> { + __$$RecipesImplCopyWithImpl(_$RecipesImpl _value, $Res Function(_$RecipesImpl) _then) : super(_value, _then); /// Create a copy of Recipes /// with the given fields replaced by the non-null parameter values. @@ -355,8 +366,7 @@ class _$RecipesImpl implements _Recipes { : _ingredients = ingredients, _steps = steps; - factory _$RecipesImpl.fromJson(Map json) => - _$$RecipesImplFromJson(json); + factory _$RecipesImpl.fromJson(Map json) => _$$RecipesImplFromJson(json); @override final int id; @@ -368,6 +378,7 @@ class _$RecipesImpl implements _Recipes { @JsonKey(name: 'cooking_time') final int cookingTime; final List _ingredients; + @override List get ingredients { if (_ingredients is EqualUnmodifiableListView) return _ingredients; @@ -378,6 +389,7 @@ class _$RecipesImpl implements _Recipes { @override final String description; final List _steps; + @override List get steps { if (_steps is EqualUnmodifiableListView) return _steps; @@ -425,60 +437,33 @@ class _$RecipesImpl implements _Recipes { (identical(other.id, id) || other.id == id) && (identical(other.image, image) || other.image == image) && (identical(other.state, state) || other.state == state) && - (identical(other.cookingTime, cookingTime) || - other.cookingTime == cookingTime) && - const DeepCollectionEquality() - .equals(other._ingredients, _ingredients) && - (identical(other.description, description) || - other.description == description) && + (identical(other.cookingTime, cookingTime) || other.cookingTime == cookingTime) && + const DeepCollectionEquality().equals(other._ingredients, _ingredients) && + (identical(other.description, description) || other.description == description) && const DeepCollectionEquality().equals(other._steps, _steps) && - (identical(other.videoUrl, videoUrl) || - other.videoUrl == videoUrl) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt) && + (identical(other.videoUrl, videoUrl) || other.videoUrl == videoUrl) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && (identical(other.title, title) || other.title == title) && (identical(other.type, type) || other.type == type) && (identical(other.slug, slug) || other.slug == slug) && - (identical(other.commentsCount, commentsCount) || - other.commentsCount == commentsCount) && - (identical(other.likesCount, likesCount) || - other.likesCount == likesCount) && - (identical(other.viewsCount, viewsCount) || - other.viewsCount == viewsCount) && + (identical(other.commentsCount, commentsCount) || other.commentsCount == commentsCount) && + (identical(other.likesCount, likesCount) || other.likesCount == likesCount) && + (identical(other.viewsCount, viewsCount) || other.viewsCount == viewsCount) && (identical(other.author, author) || other.author == author)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - id, - image, - state, - cookingTime, - const DeepCollectionEquality().hash(_ingredients), - description, - const DeepCollectionEquality().hash(_steps), - videoUrl, - createdAt, - updatedAt, - title, - type, - slug, - commentsCount, - likesCount, - viewsCount, - author); + int get hashCode => Object.hash(runtimeType, id, image, state, cookingTime, const DeepCollectionEquality().hash(_ingredients), description, + const DeepCollectionEquality().hash(_steps), videoUrl, createdAt, updatedAt, title, type, slug, commentsCount, likesCount, viewsCount, author); /// Create a copy of Recipes /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => - __$$RecipesImplCopyWithImpl<_$RecipesImpl>(this, _$identity); + _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => __$$RecipesImplCopyWithImpl<_$RecipesImpl>(this, _$identity); @override Map toJson() { @@ -512,43 +497,59 @@ abstract class _Recipes implements Recipes { @override int get id; + @override String get image; + @override String get state; + @override @JsonKey(name: 'cooking_time') int get cookingTime; + @override List get ingredients; + @override String get description; + @override List get steps; + @override @JsonKey(name: 'video_url') String get videoUrl; + @override @JsonKey(name: 'created_at') DateTime get createdAt; + @override @JsonKey(name: 'updated_at') DateTime get updatedAt; + @override String get title; + @override String get type; + @override String get slug; + @override @JsonKey(name: 'total_comments') int get commentsCount; + @override @JsonKey(name: 'total_likes') int get likesCount; + @override @JsonKey(name: 'total_views') int get viewsCount; + @override Author get author; @@ -556,8 +557,7 @@ abstract class _Recipes implements Recipes { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => throw _privateConstructorUsedError; } Ingredient _$IngredientFromJson(Map json) { @@ -567,7 +567,9 @@ Ingredient _$IngredientFromJson(Map json) { /// @nodoc mixin _$Ingredient { String get name => throw _privateConstructorUsedError; + String? get unit => throw _privateConstructorUsedError; + String get portion => throw _privateConstructorUsedError; /// Serializes this Ingredient to a JSON map. @@ -576,26 +578,24 @@ mixin _$Ingredient { /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $IngredientCopyWith get copyWith => - throw _privateConstructorUsedError; + $IngredientCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $IngredientCopyWith<$Res> { - factory $IngredientCopyWith( - Ingredient value, $Res Function(Ingredient) then) = - _$IngredientCopyWithImpl<$Res, Ingredient>; + factory $IngredientCopyWith(Ingredient value, $Res Function(Ingredient) then) = _$IngredientCopyWithImpl<$Res, Ingredient>; + @useResult $Res call({String name, String? unit, String portion}); } /// @nodoc -class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> - implements $IngredientCopyWith<$Res> { +class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $IngredientCopyWith<$Res> { _$IngredientCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -626,23 +626,17 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> } /// @nodoc -abstract class _$$IngredientImplCopyWith<$Res> - implements $IngredientCopyWith<$Res> { - factory _$$IngredientImplCopyWith( - _$IngredientImpl value, $Res Function(_$IngredientImpl) then) = - __$$IngredientImplCopyWithImpl<$Res>; +abstract class _$$IngredientImplCopyWith<$Res> implements $IngredientCopyWith<$Res> { + factory _$$IngredientImplCopyWith(_$IngredientImpl value, $Res Function(_$IngredientImpl) then) = __$$IngredientImplCopyWithImpl<$Res>; + @override @useResult $Res call({String name, String? unit, String portion}); } /// @nodoc -class __$$IngredientImplCopyWithImpl<$Res> - extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> - implements _$$IngredientImplCopyWith<$Res> { - __$$IngredientImplCopyWithImpl( - _$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) - : super(_value, _then); +class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> implements _$$IngredientImplCopyWith<$Res> { + __$$IngredientImplCopyWithImpl(_$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) : super(_value, _then); /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @@ -673,11 +667,9 @@ class __$$IngredientImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$IngredientImpl implements _Ingredient { - const _$IngredientImpl( - {required this.name, this.unit, required this.portion}); + const _$IngredientImpl({required this.name, this.unit, required this.portion}); - factory _$IngredientImpl.fromJson(Map json) => - _$$IngredientImplFromJson(json); + factory _$IngredientImpl.fromJson(Map json) => _$$IngredientImplFromJson(json); @override final String name; @@ -710,8 +702,7 @@ class _$IngredientImpl implements _Ingredient { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => - __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); @override Map toJson() { @@ -722,18 +713,16 @@ class _$IngredientImpl implements _Ingredient { } abstract class _Ingredient implements Ingredient { - const factory _Ingredient( - {required final String name, - final String? unit, - required final String portion}) = _$IngredientImpl; + const factory _Ingredient({required final String name, final String? unit, required final String portion}) = _$IngredientImpl; - factory _Ingredient.fromJson(Map json) = - _$IngredientImpl.fromJson; + factory _Ingredient.fromJson(Map json) = _$IngredientImpl.fromJson; @override String get name; + @override String? get unit; + @override String get portion; @@ -741,8 +730,7 @@ abstract class _Ingredient implements Ingredient { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => - throw _privateConstructorUsedError; + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError; } Step _$StepFromJson(Map json) { @@ -752,6 +740,7 @@ Step _$StepFromJson(Map json) { /// @nodoc mixin _$Step { String get image => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; /// Serializes this Step to a JSON map. @@ -765,19 +754,19 @@ mixin _$Step { /// @nodoc abstract class $StepCopyWith<$Res> { - factory $StepCopyWith(Step value, $Res Function(Step) then) = - _$StepCopyWithImpl<$Res, Step>; + factory $StepCopyWith(Step value, $Res Function(Step) then) = _$StepCopyWithImpl<$Res, Step>; + @useResult $Res call({String image, String description}); } /// @nodoc -class _$StepCopyWithImpl<$Res, $Val extends Step> - implements $StepCopyWith<$Res> { +class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res> { _$StepCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -804,20 +793,16 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> /// @nodoc abstract class _$$StepImplCopyWith<$Res> implements $StepCopyWith<$Res> { - factory _$$StepImplCopyWith( - _$StepImpl value, $Res Function(_$StepImpl) then) = - __$$StepImplCopyWithImpl<$Res>; + factory _$$StepImplCopyWith(_$StepImpl value, $Res Function(_$StepImpl) then) = __$$StepImplCopyWithImpl<$Res>; + @override @useResult $Res call({String image, String description}); } /// @nodoc -class __$$StepImplCopyWithImpl<$Res> - extends _$StepCopyWithImpl<$Res, _$StepImpl> - implements _$$StepImplCopyWith<$Res> { - __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) - : super(_value, _then); +class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl> implements _$$StepImplCopyWith<$Res> { + __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) : super(_value, _then); /// Create a copy of Step /// with the given fields replaced by the non-null parameter values. @@ -845,8 +830,7 @@ class __$$StepImplCopyWithImpl<$Res> class _$StepImpl implements _Step { const _$StepImpl({required this.image, required this.description}); - factory _$StepImpl.fromJson(Map json) => - _$$StepImplFromJson(json); + factory _$StepImpl.fromJson(Map json) => _$$StepImplFromJson(json); @override final String image; @@ -864,8 +848,7 @@ class _$StepImpl implements _Step { (other.runtimeType == runtimeType && other is _$StepImpl && (identical(other.image, image) || other.image == image) && - (identical(other.description, description) || - other.description == description)); + (identical(other.description, description) || other.description == description)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -877,8 +860,7 @@ class _$StepImpl implements _Step { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$StepImplCopyWith<_$StepImpl> get copyWith => - __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); + _$$StepImplCopyWith<_$StepImpl> get copyWith => __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); @override Map toJson() { @@ -889,14 +871,13 @@ class _$StepImpl implements _Step { } abstract class _Step implements Step { - const factory _Step( - {required final String image, - required final String description}) = _$StepImpl; + const factory _Step({required final String image, required final String description}) = _$StepImpl; factory _Step.fromJson(Map json) = _$StepImpl.fromJson; @override String get image; + @override String get description; @@ -904,6 +885,5 @@ abstract class _Step implements Step { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$StepImplCopyWith<_$StepImpl> get copyWith => - throw _privateConstructorUsedError; + _$$StepImplCopyWith<_$StepImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/recipes_model.g.dart b/lib/features/feed/models/recipes_model.g.dart index 7f8c0142..0f9e0a0d 100644 --- a/lib/features/feed/models/recipes_model.g.dart +++ b/lib/features/feed/models/recipes_model.g.dart @@ -6,19 +6,14 @@ part of 'recipes_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipesImpl _$$RecipesImplFromJson(Map json) => - _$RecipesImpl( +_$RecipesImpl _$$RecipesImplFromJson(Map json) => _$RecipesImpl( id: (json['id'] as num).toInt(), image: json['image'] as String, state: json['state'] as String, cookingTime: (json['cooking_time'] as num).toInt(), - ingredients: (json['ingredients'] as List) - .map((e) => Ingredient.fromJson(e as Map)) - .toList(), + ingredients: (json['ingredients'] as List).map((e) => Ingredient.fromJson(e as Map)).toList(), description: json['description'] as String, - steps: (json['steps'] as List) - .map((e) => Step.fromJson(e as Map)) - .toList(), + steps: (json['steps'] as List).map((e) => Step.fromJson(e as Map)).toList(), videoUrl: json['video_url'] as String, createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), @@ -31,8 +26,7 @@ _$RecipesImpl _$$RecipesImplFromJson(Map json) => author: Author.fromJson(json['author'] as Map), ); -Map _$$RecipesImplToJson(_$RecipesImpl instance) => - { +Map _$$RecipesImplToJson(_$RecipesImpl instance) => { 'id': instance.id, 'image': instance.image, 'state': instance.state, @@ -52,15 +46,13 @@ Map _$$RecipesImplToJson(_$RecipesImpl instance) => 'author': instance.author, }; -_$IngredientImpl _$$IngredientImplFromJson(Map json) => - _$IngredientImpl( +_$IngredientImpl _$$IngredientImplFromJson(Map json) => _$IngredientImpl( name: json['name'] as String, unit: json['unit'] as String?, portion: json['portion'] as String, ); -Map _$$IngredientImplToJson(_$IngredientImpl instance) => - { +Map _$$IngredientImplToJson(_$IngredientImpl instance) => { 'name': instance.name, 'unit': instance.unit, 'portion': instance.portion, @@ -71,8 +63,7 @@ _$StepImpl _$$StepImplFromJson(Map json) => _$StepImpl( description: json['description'] as String, ); -Map _$$StepImplToJson(_$StepImpl instance) => - { +Map _$$StepImplToJson(_$StepImpl instance) => { 'image': instance.image, 'description': instance.description, }; diff --git a/lib/features/feed/models/recipes_pagination_model.freezed.dart b/lib/features/feed/models/recipes_pagination_model.freezed.dart index ca8e9f92..8d95450d 100644 --- a/lib/features/feed/models/recipes_pagination_model.freezed.dart +++ b/lib/features/feed/models/recipes_pagination_model.freezed.dart @@ -29,26 +29,24 @@ mixin _$RecipesPagination { /// Create a copy of RecipesPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipesPaginationCopyWith get copyWith => - throw _privateConstructorUsedError; + $RecipesPaginationCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipesPaginationCopyWith<$Res> { - factory $RecipesPaginationCopyWith( - RecipesPagination value, $Res Function(RecipesPagination) then) = - _$RecipesPaginationCopyWithImpl<$Res, RecipesPagination>; + factory $RecipesPaginationCopyWith(RecipesPagination value, $Res Function(RecipesPagination) then) = _$RecipesPaginationCopyWithImpl<$Res, RecipesPagination>; + @useResult $Res call({@JsonKey(name: 'data') List recipesList}); } /// @nodoc -class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> - implements $RecipesPaginationCopyWith<$Res> { +class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> implements $RecipesPaginationCopyWith<$Res> { _$RecipesPaginationCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -69,23 +67,19 @@ class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> } /// @nodoc -abstract class _$$RecipesPaginationImplCopyWith<$Res> - implements $RecipesPaginationCopyWith<$Res> { - factory _$$RecipesPaginationImplCopyWith(_$RecipesPaginationImpl value, - $Res Function(_$RecipesPaginationImpl) then) = +abstract class _$$RecipesPaginationImplCopyWith<$Res> implements $RecipesPaginationCopyWith<$Res> { + factory _$$RecipesPaginationImplCopyWith(_$RecipesPaginationImpl value, $Res Function(_$RecipesPaginationImpl) then) = __$$RecipesPaginationImplCopyWithImpl<$Res>; + @override @useResult $Res call({@JsonKey(name: 'data') List recipesList}); } /// @nodoc -class __$$RecipesPaginationImplCopyWithImpl<$Res> - extends _$RecipesPaginationCopyWithImpl<$Res, _$RecipesPaginationImpl> +class __$$RecipesPaginationImplCopyWithImpl<$Res> extends _$RecipesPaginationCopyWithImpl<$Res, _$RecipesPaginationImpl> implements _$$RecipesPaginationImplCopyWith<$Res> { - __$$RecipesPaginationImplCopyWithImpl(_$RecipesPaginationImpl _value, - $Res Function(_$RecipesPaginationImpl) _then) - : super(_value, _then); + __$$RecipesPaginationImplCopyWithImpl(_$RecipesPaginationImpl _value, $Res Function(_$RecipesPaginationImpl) _then) : super(_value, _then); /// Create a copy of RecipesPagination /// with the given fields replaced by the non-null parameter values. @@ -106,14 +100,12 @@ class __$$RecipesPaginationImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$RecipesPaginationImpl implements _RecipesPagination { - const _$RecipesPaginationImpl( - {@JsonKey(name: 'data') required final List recipesList}) - : _recipesList = recipesList; + const _$RecipesPaginationImpl({@JsonKey(name: 'data') required final List recipesList}) : _recipesList = recipesList; - factory _$RecipesPaginationImpl.fromJson(Map json) => - _$$RecipesPaginationImplFromJson(json); + factory _$RecipesPaginationImpl.fromJson(Map json) => _$$RecipesPaginationImplFromJson(json); final List _recipesList; + @override @JsonKey(name: 'data') List get recipesList { @@ -130,25 +122,19 @@ class _$RecipesPaginationImpl implements _RecipesPagination { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$RecipesPaginationImpl && - const DeepCollectionEquality() - .equals(other._recipesList, _recipesList)); + (other.runtimeType == runtimeType && other is _$RecipesPaginationImpl && const DeepCollectionEquality().equals(other._recipesList, _recipesList)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_recipesList)); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_recipesList)); /// Create a copy of RecipesPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => - __$$RecipesPaginationImplCopyWithImpl<_$RecipesPaginationImpl>( - this, _$identity); + _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => __$$RecipesPaginationImplCopyWithImpl<_$RecipesPaginationImpl>(this, _$identity); @override Map toJson() { @@ -159,12 +145,9 @@ class _$RecipesPaginationImpl implements _RecipesPagination { } abstract class _RecipesPagination implements RecipesPagination { - const factory _RecipesPagination( - {@JsonKey(name: 'data') required final List recipesList}) = - _$RecipesPaginationImpl; + const factory _RecipesPagination({@JsonKey(name: 'data') required final List recipesList}) = _$RecipesPaginationImpl; - factory _RecipesPagination.fromJson(Map json) = - _$RecipesPaginationImpl.fromJson; + factory _RecipesPagination.fromJson(Map json) = _$RecipesPaginationImpl.fromJson; @override @JsonKey(name: 'data') @@ -174,6 +157,5 @@ abstract class _RecipesPagination implements RecipesPagination { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/recipes_pagination_model.g.dart b/lib/features/feed/models/recipes_pagination_model.g.dart index 109f39d5..e14428fb 100644 --- a/lib/features/feed/models/recipes_pagination_model.g.dart +++ b/lib/features/feed/models/recipes_pagination_model.g.dart @@ -6,16 +6,10 @@ part of 'recipes_pagination_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipesPaginationImpl _$$RecipesPaginationImplFromJson( - Map json) => - _$RecipesPaginationImpl( - recipesList: (json['data'] as List) - .map((e) => Recipes.fromJson(e as Map)) - .toList(), +_$RecipesPaginationImpl _$$RecipesPaginationImplFromJson(Map json) => _$RecipesPaginationImpl( + recipesList: (json['data'] as List).map((e) => Recipes.fromJson(e as Map)).toList(), ); -Map _$$RecipesPaginationImplToJson( - _$RecipesPaginationImpl instance) => - { +Map _$$RecipesPaginationImplToJson(_$RecipesPaginationImpl instance) => { 'data': instance.recipesList, }; diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart index c3b582ce..caa93548 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$CommentsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ mixin _$CommentsState { /// @nodoc abstract class $CommentsStateCopyWith<$Res> { - factory $CommentsStateCopyWith( - CommentsState value, $Res Function(CommentsState) then) = - _$CommentsStateCopyWithImpl<$Res, CommentsState>; + factory $CommentsStateCopyWith(CommentsState value, $Res Function(CommentsState) then) = _$CommentsStateCopyWithImpl<$Res, CommentsState>; } /// @nodoc -class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> - implements $CommentsStateCopyWith<$Res> { +class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> implements $CommentsStateCopyWith<$Res> { _$CommentsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +90,12 @@ class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> /// @nodoc abstract class _$$CommentsStateImplCopyWith<$Res> { - factory _$$CommentsStateImplCopyWith( - _$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) = - __$$CommentsStateImplCopyWithImpl<$Res>; + factory _$$CommentsStateImplCopyWith(_$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) = __$$CommentsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CommentsStateImplCopyWithImpl<$Res> - extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl> - implements _$$CommentsStateImplCopyWith<$Res> { - __$$CommentsStateImplCopyWithImpl( - _$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) - : super(_value, _then); +class __$$CommentsStateImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl> implements _$$CommentsStateImplCopyWith<$Res> { + __$$CommentsStateImplCopyWithImpl(_$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -120,8 +113,7 @@ class _$CommentsStateImpl implements _CommentsState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$CommentsStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateImpl); } @override @@ -208,18 +200,14 @@ abstract class _CommentsState implements CommentsState { /// @nodoc abstract class _$$CommentsStateLoadingImplCopyWith<$Res> { - factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value, - $Res Function(_$CommentsStateLoadingImpl) then) = + factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value, $Res Function(_$CommentsStateLoadingImpl) then) = __$$CommentsStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CommentsStateLoadingImplCopyWithImpl<$Res> - extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl> +class __$$CommentsStateLoadingImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl> implements _$$CommentsStateLoadingImplCopyWith<$Res> { - __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, - $Res Function(_$CommentsStateLoadingImpl) _then) - : super(_value, _then); + __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, $Res Function(_$CommentsStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -237,9 +225,7 @@ class _$CommentsStateLoadingImpl implements CommentsStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CommentsStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateLoadingImpl); } @override @@ -326,9 +312,9 @@ abstract class CommentsStateLoading implements CommentsState { /// @nodoc abstract class _$$CommentsStateLoadedImplCopyWith<$Res> { - factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value, - $Res Function(_$CommentsStateLoadedImpl) then) = + factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value, $Res Function(_$CommentsStateLoadedImpl) then) = __$$CommentsStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({CommentModel comment, int? replyId}); @@ -336,12 +322,9 @@ abstract class _$$CommentsStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$CommentsStateLoadedImplCopyWithImpl<$Res> - extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl> +class __$$CommentsStateLoadedImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl> implements _$$CommentsStateLoadedImplCopyWith<$Res> { - __$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value, - $Res Function(_$CommentsStateLoadedImpl) _then) - : super(_value, _then); + __$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value, $Res Function(_$CommentsStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -407,8 +390,7 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { @override @pragma('vm:prefer-inline') _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => - __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>( - this, _$identity); + __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -486,36 +468,31 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { } abstract class CommentsStateLoaded implements CommentsState { - const factory CommentsStateLoaded( - {required final CommentModel comment, - final int? replyId}) = _$CommentsStateLoadedImpl; + const factory CommentsStateLoaded({required final CommentModel comment, final int? replyId}) = _$CommentsStateLoadedImpl; CommentModel get comment; + int? get replyId; /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$CommentsStateErrorImplCopyWith<$Res> { - factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value, - $Res Function(_$CommentsStateErrorImpl) then) = + factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value, $Res Function(_$CommentsStateErrorImpl) then) = __$$CommentsStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$CommentsStateErrorImplCopyWithImpl<$Res> - extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl> +class __$$CommentsStateErrorImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl> implements _$$CommentsStateErrorImplCopyWith<$Res> { - __$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value, - $Res Function(_$CommentsStateErrorImpl) _then) - : super(_value, _then); + __$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value, $Res Function(_$CommentsStateErrorImpl) _then) : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -551,8 +528,7 @@ class _$CommentsStateErrorImpl implements CommentsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -564,8 +540,7 @@ class _$CommentsStateErrorImpl implements CommentsStateError { @override @pragma('vm:prefer-inline') _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => - __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>( - this, _$identity); + __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -643,14 +618,12 @@ class _$CommentsStateErrorImpl implements CommentsStateError { } abstract class CommentsStateError implements CommentsState { - const factory CommentsStateError({required final String errorMessage}) = - _$CommentsStateErrorImpl; + const factory CommentsStateError({required final String errorMessage}) = _$CommentsStateErrorImpl; String get errorMessage; /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart b/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart index dd30f73d..e1797ea0 100644 --- a/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$DietsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ mixin _$DietsState { /// @nodoc abstract class $DietsStateCopyWith<$Res> { - factory $DietsStateCopyWith( - DietsState value, $Res Function(DietsState) then) = - _$DietsStateCopyWithImpl<$Res, DietsState>; + factory $DietsStateCopyWith(DietsState value, $Res Function(DietsState) then) = _$DietsStateCopyWithImpl<$Res, DietsState>; } /// @nodoc -class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> - implements $DietsStateCopyWith<$Res> { +class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> implements $DietsStateCopyWith<$Res> { _$DietsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +90,12 @@ class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> /// @nodoc abstract class _$$DietsStateImplCopyWith<$Res> { - factory _$$DietsStateImplCopyWith( - _$DietsStateImpl value, $Res Function(_$DietsStateImpl) then) = - __$$DietsStateImplCopyWithImpl<$Res>; + factory _$$DietsStateImplCopyWith(_$DietsStateImpl value, $Res Function(_$DietsStateImpl) then) = __$$DietsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$DietsStateImplCopyWithImpl<$Res> - extends _$DietsStateCopyWithImpl<$Res, _$DietsStateImpl> - implements _$$DietsStateImplCopyWith<$Res> { - __$$DietsStateImplCopyWithImpl( - _$DietsStateImpl _value, $Res Function(_$DietsStateImpl) _then) - : super(_value, _then); +class __$$DietsStateImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateImpl> implements _$$DietsStateImplCopyWith<$Res> { + __$$DietsStateImplCopyWithImpl(_$DietsStateImpl _value, $Res Function(_$DietsStateImpl) _then) : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -120,8 +113,7 @@ class _$DietsStateImpl implements _DietsState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$DietsStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateImpl); } @override @@ -208,18 +200,14 @@ abstract class _DietsState implements DietsState { /// @nodoc abstract class _$$DietsStateLoadingImplCopyWith<$Res> { - factory _$$DietsStateLoadingImplCopyWith(_$DietsStateLoadingImpl value, - $Res Function(_$DietsStateLoadingImpl) then) = + factory _$$DietsStateLoadingImplCopyWith(_$DietsStateLoadingImpl value, $Res Function(_$DietsStateLoadingImpl) then) = __$$DietsStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$DietsStateLoadingImplCopyWithImpl<$Res> - extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadingImpl> +class __$$DietsStateLoadingImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadingImpl> implements _$$DietsStateLoadingImplCopyWith<$Res> { - __$$DietsStateLoadingImplCopyWithImpl(_$DietsStateLoadingImpl _value, - $Res Function(_$DietsStateLoadingImpl) _then) - : super(_value, _then); + __$$DietsStateLoadingImplCopyWithImpl(_$DietsStateLoadingImpl _value, $Res Function(_$DietsStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -237,8 +225,7 @@ class _$DietsStateLoadingImpl implements DietsStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$DietsStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateLoadingImpl); } @override @@ -325,9 +312,9 @@ abstract class DietsStateLoading implements DietsState { /// @nodoc abstract class _$$DietsStateLoadedImplCopyWith<$Res> { - factory _$$DietsStateLoadedImplCopyWith(_$DietsStateLoadedImpl value, - $Res Function(_$DietsStateLoadedImpl) then) = + factory _$$DietsStateLoadedImplCopyWith(_$DietsStateLoadedImpl value, $Res Function(_$DietsStateLoadedImpl) then) = __$$DietsStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({DietsPagination diets}); @@ -335,12 +322,9 @@ abstract class _$$DietsStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$DietsStateLoadedImplCopyWithImpl<$Res> - extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadedImpl> +class __$$DietsStateLoadedImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadedImpl> implements _$$DietsStateLoadedImplCopyWith<$Res> { - __$$DietsStateLoadedImplCopyWithImpl(_$DietsStateLoadedImpl _value, - $Res Function(_$DietsStateLoadedImpl) _then) - : super(_value, _then); + __$$DietsStateLoadedImplCopyWithImpl(_$DietsStateLoadedImpl _value, $Res Function(_$DietsStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -384,9 +368,7 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$DietsStateLoadedImpl && - (identical(other.diets, diets) || other.diets == diets)); + (other.runtimeType == runtimeType && other is _$DietsStateLoadedImpl && (identical(other.diets, diets) || other.diets == diets)); } @override @@ -397,9 +379,7 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => - __$$DietsStateLoadedImplCopyWithImpl<_$DietsStateLoadedImpl>( - this, _$identity); + _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => __$$DietsStateLoadedImplCopyWithImpl<_$DietsStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -477,34 +457,27 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { } abstract class DietsStateLoaded implements DietsState { - const factory DietsStateLoaded({required final DietsPagination diets}) = - _$DietsStateLoadedImpl; + const factory DietsStateLoaded({required final DietsPagination diets}) = _$DietsStateLoadedImpl; DietsPagination get diets; /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$DietsStateErrorImplCopyWith<$Res> { - factory _$$DietsStateErrorImplCopyWith(_$DietsStateErrorImpl value, - $Res Function(_$DietsStateErrorImpl) then) = - __$$DietsStateErrorImplCopyWithImpl<$Res>; + factory _$$DietsStateErrorImplCopyWith(_$DietsStateErrorImpl value, $Res Function(_$DietsStateErrorImpl) then) = __$$DietsStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$DietsStateErrorImplCopyWithImpl<$Res> - extends _$DietsStateCopyWithImpl<$Res, _$DietsStateErrorImpl> - implements _$$DietsStateErrorImplCopyWith<$Res> { - __$$DietsStateErrorImplCopyWithImpl( - _$DietsStateErrorImpl _value, $Res Function(_$DietsStateErrorImpl) _then) - : super(_value, _then); +class __$$DietsStateErrorImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateErrorImpl> implements _$$DietsStateErrorImplCopyWith<$Res> { + __$$DietsStateErrorImplCopyWithImpl(_$DietsStateErrorImpl _value, $Res Function(_$DietsStateErrorImpl) _then) : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -540,8 +513,7 @@ class _$DietsStateErrorImpl implements DietsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -552,9 +524,7 @@ class _$DietsStateErrorImpl implements DietsStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => - __$$DietsStateErrorImplCopyWithImpl<_$DietsStateErrorImpl>( - this, _$identity); + _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => __$$DietsStateErrorImplCopyWithImpl<_$DietsStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -632,14 +602,12 @@ class _$DietsStateErrorImpl implements DietsStateError { } abstract class DietsStateError implements DietsState { - const factory DietsStateError({required final String errorMessage}) = - _$DietsStateErrorImpl; + const factory DietsStateError({required final String errorMessage}) = _$DietsStateErrorImpl; String get errorMessage; /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart b/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart index 70cb30d4..377ed8d7 100644 --- a/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart @@ -20,18 +20,16 @@ mixin _$FeedState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - List feedBlogPostList, bool isLoading) - loaded, + required TResult Function(List feedBlogPostList, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? - loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -39,8 +37,7 @@ mixin _$FeedState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? - loaded, + TResult Function(List feedBlogPostList, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -74,17 +71,16 @@ mixin _$FeedState { /// @nodoc abstract class $FeedStateCopyWith<$Res> { - factory $FeedStateCopyWith(FeedState value, $Res Function(FeedState) then) = - _$FeedStateCopyWithImpl<$Res, FeedState>; + factory $FeedStateCopyWith(FeedState value, $Res Function(FeedState) then) = _$FeedStateCopyWithImpl<$Res, FeedState>; } /// @nodoc -class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> - implements $FeedStateCopyWith<$Res> { +class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> implements $FeedStateCopyWith<$Res> { _$FeedStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -94,18 +90,12 @@ class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> /// @nodoc abstract class _$$FeedStateImplCopyWith<$Res> { - factory _$$FeedStateImplCopyWith( - _$FeedStateImpl value, $Res Function(_$FeedStateImpl) then) = - __$$FeedStateImplCopyWithImpl<$Res>; + factory _$$FeedStateImplCopyWith(_$FeedStateImpl value, $Res Function(_$FeedStateImpl) then) = __$$FeedStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$FeedStateImplCopyWithImpl<$Res> - extends _$FeedStateCopyWithImpl<$Res, _$FeedStateImpl> - implements _$$FeedStateImplCopyWith<$Res> { - __$$FeedStateImplCopyWithImpl( - _$FeedStateImpl _value, $Res Function(_$FeedStateImpl) _then) - : super(_value, _then); +class __$$FeedStateImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateImpl> implements _$$FeedStateImplCopyWith<$Res> { + __$$FeedStateImplCopyWithImpl(_$FeedStateImpl _value, $Res Function(_$FeedStateImpl) _then) : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -123,8 +113,7 @@ class _$FeedStateImpl implements _FeedState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$FeedStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateImpl); } @override @@ -135,9 +124,7 @@ class _$FeedStateImpl implements _FeedState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - List feedBlogPostList, bool isLoading) - loaded, + required TResult Function(List feedBlogPostList, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -148,8 +135,7 @@ class _$FeedStateImpl implements _FeedState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? - loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -160,8 +146,7 @@ class _$FeedStateImpl implements _FeedState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? - loaded, + TResult Function(List feedBlogPostList, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -215,18 +200,14 @@ abstract class _FeedState implements FeedState { /// @nodoc abstract class _$$FeedStateLoadingImplCopyWith<$Res> { - factory _$$FeedStateLoadingImplCopyWith(_$FeedStateLoadingImpl value, - $Res Function(_$FeedStateLoadingImpl) then) = + factory _$$FeedStateLoadingImplCopyWith(_$FeedStateLoadingImpl value, $Res Function(_$FeedStateLoadingImpl) then) = __$$FeedStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$FeedStateLoadingImplCopyWithImpl<$Res> - extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadingImpl> +class __$$FeedStateLoadingImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadingImpl> implements _$$FeedStateLoadingImplCopyWith<$Res> { - __$$FeedStateLoadingImplCopyWithImpl(_$FeedStateLoadingImpl _value, - $Res Function(_$FeedStateLoadingImpl) _then) - : super(_value, _then); + __$$FeedStateLoadingImplCopyWithImpl(_$FeedStateLoadingImpl _value, $Res Function(_$FeedStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -244,8 +225,7 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$FeedStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateLoadingImpl); } @override @@ -256,9 +236,7 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - List feedBlogPostList, bool isLoading) - loaded, + required TResult Function(List feedBlogPostList, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -269,8 +247,7 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? - loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -281,8 +258,7 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? - loaded, + TResult Function(List feedBlogPostList, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -336,20 +312,15 @@ abstract class FeedStateLoading implements FeedState { /// @nodoc abstract class _$$FeedStateLoadedImplCopyWith<$Res> { - factory _$$FeedStateLoadedImplCopyWith(_$FeedStateLoadedImpl value, - $Res Function(_$FeedStateLoadedImpl) then) = - __$$FeedStateLoadedImplCopyWithImpl<$Res>; + factory _$$FeedStateLoadedImplCopyWith(_$FeedStateLoadedImpl value, $Res Function(_$FeedStateLoadedImpl) then) = __$$FeedStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({List feedBlogPostList, bool isLoading}); } /// @nodoc -class __$$FeedStateLoadedImplCopyWithImpl<$Res> - extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadedImpl> - implements _$$FeedStateLoadedImplCopyWith<$Res> { - __$$FeedStateLoadedImplCopyWithImpl( - _$FeedStateLoadedImpl _value, $Res Function(_$FeedStateLoadedImpl) _then) - : super(_value, _then); +class __$$FeedStateLoadedImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadedImpl> implements _$$FeedStateLoadedImplCopyWith<$Res> { + __$$FeedStateLoadedImplCopyWithImpl(_$FeedStateLoadedImpl _value, $Res Function(_$FeedStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -375,16 +346,13 @@ class __$$FeedStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$FeedStateLoadedImpl implements FeedStateLoaded { - const _$FeedStateLoadedImpl( - {required final List feedBlogPostList, - required this.isLoading}) - : _feedBlogPostList = feedBlogPostList; + const _$FeedStateLoadedImpl({required final List feedBlogPostList, required this.isLoading}) : _feedBlogPostList = feedBlogPostList; final List _feedBlogPostList; + @override List get feedBlogPostList { - if (_feedBlogPostList is EqualUnmodifiableListView) - return _feedBlogPostList; + if (_feedBlogPostList is EqualUnmodifiableListView) return _feedBlogPostList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_feedBlogPostList); } @@ -402,33 +370,26 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateLoadedImpl && - const DeepCollectionEquality() - .equals(other._feedBlogPostList, _feedBlogPostList) && - (identical(other.isLoading, isLoading) || - other.isLoading == isLoading)); + const DeepCollectionEquality().equals(other._feedBlogPostList, _feedBlogPostList) && + (identical(other.isLoading, isLoading) || other.isLoading == isLoading)); } @override - int get hashCode => Object.hash(runtimeType, - const DeepCollectionEquality().hash(_feedBlogPostList), isLoading); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList), isLoading); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => - __$$FeedStateLoadedImplCopyWithImpl<_$FeedStateLoadedImpl>( - this, _$identity); + _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => __$$FeedStateLoadedImplCopyWithImpl<_$FeedStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - List feedBlogPostList, bool isLoading) - loaded, + required TResult Function(List feedBlogPostList, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return loaded(feedBlogPostList, isLoading); @@ -439,8 +400,7 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? - loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(feedBlogPostList, isLoading); @@ -451,8 +411,7 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? - loaded, + TResult Function(List feedBlogPostList, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -501,36 +460,29 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { } abstract class FeedStateLoaded implements FeedState { - const factory FeedStateLoaded( - {required final List feedBlogPostList, - required final bool isLoading}) = _$FeedStateLoadedImpl; + const factory FeedStateLoaded({required final List feedBlogPostList, required final bool isLoading}) = _$FeedStateLoadedImpl; List get feedBlogPostList; + bool get isLoading; /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$FeedStateErrorImplCopyWith<$Res> { - factory _$$FeedStateErrorImplCopyWith(_$FeedStateErrorImpl value, - $Res Function(_$FeedStateErrorImpl) then) = - __$$FeedStateErrorImplCopyWithImpl<$Res>; + factory _$$FeedStateErrorImplCopyWith(_$FeedStateErrorImpl value, $Res Function(_$FeedStateErrorImpl) then) = __$$FeedStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$FeedStateErrorImplCopyWithImpl<$Res> - extends _$FeedStateCopyWithImpl<$Res, _$FeedStateErrorImpl> - implements _$$FeedStateErrorImplCopyWith<$Res> { - __$$FeedStateErrorImplCopyWithImpl( - _$FeedStateErrorImpl _value, $Res Function(_$FeedStateErrorImpl) _then) - : super(_value, _then); +class __$$FeedStateErrorImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateErrorImpl> implements _$$FeedStateErrorImplCopyWith<$Res> { + __$$FeedStateErrorImplCopyWithImpl(_$FeedStateErrorImpl _value, $Res Function(_$FeedStateErrorImpl) _then) : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -566,8 +518,7 @@ class _$FeedStateErrorImpl implements FeedStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -578,18 +529,14 @@ class _$FeedStateErrorImpl implements FeedStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => - __$$FeedStateErrorImplCopyWithImpl<_$FeedStateErrorImpl>( - this, _$identity); + _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => __$$FeedStateErrorImplCopyWithImpl<_$FeedStateErrorImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - List feedBlogPostList, bool isLoading) - loaded, + required TResult Function(List feedBlogPostList, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -600,8 +547,7 @@ class _$FeedStateErrorImpl implements FeedStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? - loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -612,8 +558,7 @@ class _$FeedStateErrorImpl implements FeedStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? - loaded, + TResult Function(List feedBlogPostList, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -662,14 +607,12 @@ class _$FeedStateErrorImpl implements FeedStateError { } abstract class FeedStateError implements FeedState { - const factory FeedStateError({required final String errorMessage}) = - _$FeedStateErrorImpl; + const factory FeedStateError({required final String errorMessage}) = _$FeedStateErrorImpl; String get errorMessage; /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart index 34100adb..3b29fac8 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart @@ -20,23 +20,16 @@ mixin _$RecipesState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - List recipesList, - List recipesTags, - Set selectedTags, - int selectedTagsCounter, - bool isLoading) - loaded, + required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter, bool isLoading)? - loaded, + TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -44,9 +37,7 @@ mixin _$RecipesState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter, bool isLoading)? - loaded, + TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -80,18 +71,16 @@ mixin _$RecipesState { /// @nodoc abstract class $RecipesStateCopyWith<$Res> { - factory $RecipesStateCopyWith( - RecipesState value, $Res Function(RecipesState) then) = - _$RecipesStateCopyWithImpl<$Res, RecipesState>; + factory $RecipesStateCopyWith(RecipesState value, $Res Function(RecipesState) then) = _$RecipesStateCopyWithImpl<$Res, RecipesState>; } /// @nodoc -class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> - implements $RecipesStateCopyWith<$Res> { +class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> implements $RecipesStateCopyWith<$Res> { _$RecipesStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -101,18 +90,12 @@ class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> /// @nodoc abstract class _$$RecipesStateImplCopyWith<$Res> { - factory _$$RecipesStateImplCopyWith( - _$RecipesStateImpl value, $Res Function(_$RecipesStateImpl) then) = - __$$RecipesStateImplCopyWithImpl<$Res>; + factory _$$RecipesStateImplCopyWith(_$RecipesStateImpl value, $Res Function(_$RecipesStateImpl) then) = __$$RecipesStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipesStateImplCopyWithImpl<$Res> - extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateImpl> - implements _$$RecipesStateImplCopyWith<$Res> { - __$$RecipesStateImplCopyWithImpl( - _$RecipesStateImpl _value, $Res Function(_$RecipesStateImpl) _then) - : super(_value, _then); +class __$$RecipesStateImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateImpl> implements _$$RecipesStateImplCopyWith<$Res> { + __$$RecipesStateImplCopyWithImpl(_$RecipesStateImpl _value, $Res Function(_$RecipesStateImpl) _then) : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -130,8 +113,7 @@ class _$RecipesStateImpl implements _RecipesState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$RecipesStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateImpl); } @override @@ -142,13 +124,7 @@ class _$RecipesStateImpl implements _RecipesState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - List recipesList, - List recipesTags, - Set selectedTags, - int selectedTagsCounter, - bool isLoading) - loaded, + required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -159,9 +135,7 @@ class _$RecipesStateImpl implements _RecipesState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter, bool isLoading)? - loaded, + TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -172,9 +146,7 @@ class _$RecipesStateImpl implements _RecipesState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter, bool isLoading)? - loaded, + TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -228,18 +200,14 @@ abstract class _RecipesState implements RecipesState { /// @nodoc abstract class _$$RecipesStateLoadingImplCopyWith<$Res> { - factory _$$RecipesStateLoadingImplCopyWith(_$RecipesStateLoadingImpl value, - $Res Function(_$RecipesStateLoadingImpl) then) = + factory _$$RecipesStateLoadingImplCopyWith(_$RecipesStateLoadingImpl value, $Res Function(_$RecipesStateLoadingImpl) then) = __$$RecipesStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipesStateLoadingImplCopyWithImpl<$Res> - extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadingImpl> +class __$$RecipesStateLoadingImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadingImpl> implements _$$RecipesStateLoadingImplCopyWith<$Res> { - __$$RecipesStateLoadingImplCopyWithImpl(_$RecipesStateLoadingImpl _value, - $Res Function(_$RecipesStateLoadingImpl) _then) - : super(_value, _then); + __$$RecipesStateLoadingImplCopyWithImpl(_$RecipesStateLoadingImpl _value, $Res Function(_$RecipesStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -257,9 +225,7 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$RecipesStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateLoadingImpl); } @override @@ -270,13 +236,7 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - List recipesList, - List recipesTags, - Set selectedTags, - int selectedTagsCounter, - bool isLoading) - loaded, + required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -287,9 +247,7 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter, bool isLoading)? - loaded, + TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -300,9 +258,7 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter, bool isLoading)? - loaded, + TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -356,25 +312,17 @@ abstract class RecipesStateLoading implements RecipesState { /// @nodoc abstract class _$$RecipesStateLoadedImplCopyWith<$Res> { - factory _$$RecipesStateLoadedImplCopyWith(_$RecipesStateLoadedImpl value, - $Res Function(_$RecipesStateLoadedImpl) then) = + factory _$$RecipesStateLoadedImplCopyWith(_$RecipesStateLoadedImpl value, $Res Function(_$RecipesStateLoadedImpl) then) = __$$RecipesStateLoadedImplCopyWithImpl<$Res>; + @useResult - $Res call( - {List recipesList, - List recipesTags, - Set selectedTags, - int selectedTagsCounter, - bool isLoading}); + $Res call({List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading}); } /// @nodoc -class __$$RecipesStateLoadedImplCopyWithImpl<$Res> - extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadedImpl> +class __$$RecipesStateLoadedImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadedImpl> implements _$$RecipesStateLoadedImplCopyWith<$Res> { - __$$RecipesStateLoadedImplCopyWithImpl(_$RecipesStateLoadedImpl _value, - $Res Function(_$RecipesStateLoadedImpl) _then) - : super(_value, _then); + __$$RecipesStateLoadedImplCopyWithImpl(_$RecipesStateLoadedImpl _value, $Res Function(_$RecipesStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -426,6 +374,7 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { _selectedTags = selectedTags; final List _recipesList; + @override List get recipesList { if (_recipesList is EqualUnmodifiableListView) return _recipesList; @@ -434,6 +383,7 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { } final List _recipesTags; + @override List get recipesTags { if (_recipesTags is EqualUnmodifiableListView) return _recipesTags; @@ -442,6 +392,7 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { } final Set _selectedTags; + @override Set get selectedTags { if (_selectedTags is EqualUnmodifiableSetView) return _selectedTags; @@ -464,26 +415,16 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateLoadedImpl && - const DeepCollectionEquality() - .equals(other._recipesList, _recipesList) && - const DeepCollectionEquality() - .equals(other._recipesTags, _recipesTags) && - const DeepCollectionEquality() - .equals(other._selectedTags, _selectedTags) && - (identical(other.selectedTagsCounter, selectedTagsCounter) || - other.selectedTagsCounter == selectedTagsCounter) && - (identical(other.isLoading, isLoading) || - other.isLoading == isLoading)); + const DeepCollectionEquality().equals(other._recipesList, _recipesList) && + const DeepCollectionEquality().equals(other._recipesTags, _recipesTags) && + const DeepCollectionEquality().equals(other._selectedTags, _selectedTags) && + (identical(other.selectedTagsCounter, selectedTagsCounter) || other.selectedTagsCounter == selectedTagsCounter) && + (identical(other.isLoading, isLoading) || other.isLoading == isLoading)); } @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_recipesList), - const DeepCollectionEquality().hash(_recipesTags), - const DeepCollectionEquality().hash(_selectedTags), - selectedTagsCounter, - isLoading); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_recipesList), const DeepCollectionEquality().hash(_recipesTags), + const DeepCollectionEquality().hash(_selectedTags), selectedTagsCounter, isLoading); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -491,25 +432,17 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { @override @pragma('vm:prefer-inline') _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => - __$$RecipesStateLoadedImplCopyWithImpl<_$RecipesStateLoadedImpl>( - this, _$identity); + __$$RecipesStateLoadedImplCopyWithImpl<_$RecipesStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - List recipesList, - List recipesTags, - Set selectedTags, - int selectedTagsCounter, - bool isLoading) - loaded, + required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { - return loaded( - recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); + return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); } @override @@ -517,13 +450,10 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter, bool isLoading)? - loaded, + TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { - return loaded?.call( - recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); + return loaded?.call(recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); } @override @@ -531,15 +461,12 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter, bool isLoading)? - loaded, + TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { if (loaded != null) { - return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter, - isLoading); + return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); } return orElse(); } @@ -591,34 +518,34 @@ abstract class RecipesStateLoaded implements RecipesState { required final bool isLoading}) = _$RecipesStateLoadedImpl; List get recipesList; + List get recipesTags; + Set get selectedTags; + int get selectedTagsCounter; + bool get isLoading; /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$RecipesStateErrorImplCopyWith<$Res> { - factory _$$RecipesStateErrorImplCopyWith(_$RecipesStateErrorImpl value, - $Res Function(_$RecipesStateErrorImpl) then) = + factory _$$RecipesStateErrorImplCopyWith(_$RecipesStateErrorImpl value, $Res Function(_$RecipesStateErrorImpl) then) = __$$RecipesStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$RecipesStateErrorImplCopyWithImpl<$Res> - extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateErrorImpl> +class __$$RecipesStateErrorImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateErrorImpl> implements _$$RecipesStateErrorImplCopyWith<$Res> { - __$$RecipesStateErrorImplCopyWithImpl(_$RecipesStateErrorImpl _value, - $Res Function(_$RecipesStateErrorImpl) _then) - : super(_value, _then); + __$$RecipesStateErrorImplCopyWithImpl(_$RecipesStateErrorImpl _value, $Res Function(_$RecipesStateErrorImpl) _then) : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -654,8 +581,7 @@ class _$RecipesStateErrorImpl implements RecipesStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -666,22 +592,14 @@ class _$RecipesStateErrorImpl implements RecipesStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => - __$$RecipesStateErrorImplCopyWithImpl<_$RecipesStateErrorImpl>( - this, _$identity); + _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => __$$RecipesStateErrorImplCopyWithImpl<_$RecipesStateErrorImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - List recipesList, - List recipesTags, - Set selectedTags, - int selectedTagsCounter, - bool isLoading) - loaded, + required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -692,9 +610,7 @@ class _$RecipesStateErrorImpl implements RecipesStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter, bool isLoading)? - loaded, + TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -705,9 +621,7 @@ class _$RecipesStateErrorImpl implements RecipesStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, - Set selectedTags, int selectedTagsCounter, bool isLoading)? - loaded, + TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -756,14 +670,12 @@ class _$RecipesStateErrorImpl implements RecipesStateError { } abstract class RecipesStateError implements RecipesState { - const factory RecipesStateError({required final String errorMessage}) = - _$RecipesStateErrorImpl; + const factory RecipesStateError({required final String errorMessage}) = _$RecipesStateErrorImpl; String get errorMessage; /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/widgets/diets_widget.dart b/lib/features/feed/presentation/widgets/diets_widget.dart index 82069967..038e1c73 100644 --- a/lib/features/feed/presentation/widgets/diets_widget.dart +++ b/lib/features/feed/presentation/widgets/diets_widget.dart @@ -1,6 +1,5 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; - import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; diff --git a/lib/features/feed/presentation/widgets/recipes_widget.dart b/lib/features/feed/presentation/widgets/recipes_widget.dart index a982a6f2..16291797 100644 --- a/lib/features/feed/presentation/widgets/recipes_widget.dart +++ b/lib/features/feed/presentation/widgets/recipes_widget.dart @@ -1,6 +1,5 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; - import 'package:eatvio_app/features/feed/models/recipes_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; diff --git a/lib/features/feed/repositories/feed_repository.dart b/lib/features/feed/repositories/feed_repository.dart index e90f2680..7d6397d2 100644 --- a/lib/features/feed/repositories/feed_repository.dart +++ b/lib/features/feed/repositories/feed_repository.dart @@ -17,11 +17,7 @@ class FeedRepository { } } - Future> getRecipes({ - String? query, - List? tags, - int page = 1 - }) async { + Future> getRecipes({String? query, List? tags, int page = 1}) async { try { return (await feedService.getRecipes( query: query, diff --git a/lib/features/feed/services/feed_service.g.dart b/lib/features/feed/services/feed_service.g.dart index 3f513034..fe36ea64 100644 --- a/lib/features/feed/services/feed_service.g.dart +++ b/lib/features/feed/services/feed_service.g.dart @@ -398,9 +398,7 @@ class _FeedService implements FeedService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/menu/presentation/pages/menu_screen.dart b/lib/features/menu/presentation/pages/menu_screen.dart index 80e06835..9d55b7b9 100644 --- a/lib/features/menu/presentation/pages/menu_screen.dart +++ b/lib/features/menu/presentation/pages/menu_screen.dart @@ -1,6 +1,5 @@ import 'package:dio/dio.dart'; import 'package:eatvio_app/core/const.dart'; - import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/locator_service.dart'; diff --git a/lib/features/plans/models/plan_pagination_model.dart b/lib/features/plans/models/plan_pagination_model.dart index 767d959a..e9fef491 100644 --- a/lib/features/plans/models/plan_pagination_model.dart +++ b/lib/features/plans/models/plan_pagination_model.dart @@ -1,9 +1,8 @@ -import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:eatvio_app/core/models/pagination_model.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'plan_pagination_model.freezed.dart'; - part 'plan_pagination_model.g.dart'; @freezed diff --git a/lib/features/plans/models/plan_pagination_model.freezed.dart b/lib/features/plans/models/plan_pagination_model.freezed.dart index caa2ef10..59ad65ae 100644 --- a/lib/features/plans/models/plan_pagination_model.freezed.dart +++ b/lib/features/plans/models/plan_pagination_model.freezed.dart @@ -22,8 +22,10 @@ PlanPaginationModel _$PlanPaginationModelFromJson(Map json) { mixin _$PlanPaginationModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; + @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; + @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -33,32 +35,29 @@ mixin _$PlanPaginationModel { /// Create a copy of PlanPaginationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PlanPaginationModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $PlanPaginationModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PlanPaginationModelCopyWith<$Res> { - factory $PlanPaginationModelCopyWith( - PlanPaginationModel value, $Res Function(PlanPaginationModel) then) = + factory $PlanPaginationModelCopyWith(PlanPaginationModel value, $Res Function(PlanPaginationModel) then) = _$PlanPaginationModelCopyWithImpl<$Res, PlanPaginationModel>; + @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; + $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$PlanPaginationModelCopyWithImpl<$Res, $Val extends PlanPaginationModel> - implements $PlanPaginationModelCopyWith<$Res> { +class _$PlanPaginationModelCopyWithImpl<$Res, $Val extends PlanPaginationModel> implements $PlanPaginationModelCopyWith<$Res> { _$PlanPaginationModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -109,31 +108,25 @@ class _$PlanPaginationModelCopyWithImpl<$Res, $Val extends PlanPaginationModel> } /// @nodoc -abstract class _$$PlanPaginationModelImplCopyWith<$Res> - implements $PlanPaginationModelCopyWith<$Res> { - factory _$$PlanPaginationModelImplCopyWith(_$PlanPaginationModelImpl value, - $Res Function(_$PlanPaginationModelImpl) then) = +abstract class _$$PlanPaginationModelImplCopyWith<$Res> implements $PlanPaginationModelCopyWith<$Res> { + factory _$$PlanPaginationModelImplCopyWith(_$PlanPaginationModelImpl value, $Res Function(_$PlanPaginationModelImpl) then) = __$$PlanPaginationModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; + @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$PlanPaginationModelImplCopyWithImpl<$Res> - extends _$PlanPaginationModelCopyWithImpl<$Res, _$PlanPaginationModelImpl> +class __$$PlanPaginationModelImplCopyWithImpl<$Res> extends _$PlanPaginationModelCopyWithImpl<$Res, _$PlanPaginationModelImpl> implements _$$PlanPaginationModelImplCopyWith<$Res> { - __$$PlanPaginationModelImplCopyWithImpl(_$PlanPaginationModelImpl _value, - $Res Function(_$PlanPaginationModelImpl) _then) - : super(_value, _then); + __$$PlanPaginationModelImplCopyWithImpl(_$PlanPaginationModelImpl _value, $Res Function(_$PlanPaginationModelImpl) _then) : super(_value, _then); /// Create a copy of PlanPaginationModel /// with the given fields replaced by the non-null parameter values. @@ -165,15 +158,13 @@ class __$$PlanPaginationModelImplCopyWithImpl<$Res> @JsonSerializable() class _$PlanPaginationModelImpl implements _PlanPaginationModel { const _$PlanPaginationModelImpl( - {@JsonKey(name: "data") required final List data, - @JsonKey(name: "links") required this.links, - @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$PlanPaginationModelImpl.fromJson(Map json) => - _$$PlanPaginationModelImplFromJson(json); + factory _$PlanPaginationModelImpl.fromJson(Map json) => _$$PlanPaginationModelImplFromJson(json); final List _data; + @override @JsonKey(name: "data") List get data { @@ -206,8 +197,7 @@ class _$PlanPaginationModelImpl implements _PlanPaginationModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of PlanPaginationModel /// with the given fields replaced by the non-null parameter values. @@ -215,8 +205,7 @@ class _$PlanPaginationModelImpl implements _PlanPaginationModel { @override @pragma('vm:prefer-inline') _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => - __$$PlanPaginationModelImplCopyWithImpl<_$PlanPaginationModelImpl>( - this, _$identity); + __$$PlanPaginationModelImplCopyWithImpl<_$PlanPaginationModelImpl>(this, _$identity); @override Map toJson() { @@ -228,20 +217,20 @@ class _$PlanPaginationModelImpl implements _PlanPaginationModel { abstract class _PlanPaginationModel implements PlanPaginationModel { const factory _PlanPaginationModel( - {@JsonKey(name: "data") required final List data, - @JsonKey(name: "links") required final Links links, - @JsonKey(name: "meta") required final Meta meta}) = - _$PlanPaginationModelImpl; + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required final Links links, + @JsonKey(name: "meta") required final Meta meta}) = _$PlanPaginationModelImpl; - factory _PlanPaginationModel.fromJson(Map json) = - _$PlanPaginationModelImpl.fromJson; + factory _PlanPaginationModel.fromJson(Map json) = _$PlanPaginationModelImpl.fromJson; @override @JsonKey(name: "data") List get data; + @override @JsonKey(name: "links") Links get links; + @override @JsonKey(name: "meta") Meta get meta; @@ -250,8 +239,7 @@ abstract class _PlanPaginationModel implements PlanPaginationModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => throw _privateConstructorUsedError; } PlanModel _$PlanModelFromJson(Map json) { @@ -262,32 +250,46 @@ PlanModel _$PlanModelFromJson(Map json) { mixin _$PlanModel { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; + @JsonKey(name: "image") String get image => throw _privateConstructorUsedError; + @JsonKey(name: "duration") int get duration => throw _privateConstructorUsedError; + @JsonKey(name: "state") String get state => throw _privateConstructorUsedError; + @JsonKey(name: "type") PlanType get type => throw _privateConstructorUsedError; + @JsonKey(name: "details") String get details => throw _privateConstructorUsedError; + @JsonKey(name: "packets_count") int get packetsCount => throw _privateConstructorUsedError; + @JsonKey(name: "packet1_options") dynamic get packet1Options => throw _privateConstructorUsedError; + @JsonKey(name: "packet2_options") dynamic get packet2Options => throw _privateConstructorUsedError; + @JsonKey(name: "packet3_options") dynamic get packet3Options => throw _privateConstructorUsedError; + @JsonKey(name: "author") Author get author => throw _privateConstructorUsedError; + @JsonKey(name: "total_likes") int get totalLikes => throw _privateConstructorUsedError; + @JsonKey(name: "total_views") int get totalViews => throw _privateConstructorUsedError; + @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; @@ -297,14 +299,13 @@ mixin _$PlanModel { /// Create a copy of PlanModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PlanModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $PlanModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PlanModelCopyWith<$Res> { - factory $PlanModelCopyWith(PlanModel value, $Res Function(PlanModel) then) = - _$PlanModelCopyWithImpl<$Res, PlanModel>; + factory $PlanModelCopyWith(PlanModel value, $Res Function(PlanModel) then) = _$PlanModelCopyWithImpl<$Res, PlanModel>; + @useResult $Res call( {@JsonKey(name: "id") int id, @@ -324,16 +325,17 @@ abstract class $PlanModelCopyWith<$Res> { @JsonKey(name: "total_comments") int totalComments}); $PlanTypeCopyWith<$Res> get type; + $AuthorCopyWith<$Res> get author; } /// @nodoc -class _$PlanModelCopyWithImpl<$Res, $Val extends PlanModel> - implements $PlanModelCopyWith<$Res> { +class _$PlanModelCopyWithImpl<$Res, $Val extends PlanModel> implements $PlanModelCopyWith<$Res> { _$PlanModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -444,11 +446,9 @@ class _$PlanModelCopyWithImpl<$Res, $Val extends PlanModel> } /// @nodoc -abstract class _$$PlanModelImplCopyWith<$Res> - implements $PlanModelCopyWith<$Res> { - factory _$$PlanModelImplCopyWith( - _$PlanModelImpl value, $Res Function(_$PlanModelImpl) then) = - __$$PlanModelImplCopyWithImpl<$Res>; +abstract class _$$PlanModelImplCopyWith<$Res> implements $PlanModelCopyWith<$Res> { + factory _$$PlanModelImplCopyWith(_$PlanModelImpl value, $Res Function(_$PlanModelImpl) then) = __$$PlanModelImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -470,17 +470,14 @@ abstract class _$$PlanModelImplCopyWith<$Res> @override $PlanTypeCopyWith<$Res> get type; + @override $AuthorCopyWith<$Res> get author; } /// @nodoc -class __$$PlanModelImplCopyWithImpl<$Res> - extends _$PlanModelCopyWithImpl<$Res, _$PlanModelImpl> - implements _$$PlanModelImplCopyWith<$Res> { - __$$PlanModelImplCopyWithImpl( - _$PlanModelImpl _value, $Res Function(_$PlanModelImpl) _then) - : super(_value, _then); +class __$$PlanModelImplCopyWithImpl<$Res> extends _$PlanModelCopyWithImpl<$Res, _$PlanModelImpl> implements _$$PlanModelImplCopyWith<$Res> { + __$$PlanModelImplCopyWithImpl(_$PlanModelImpl _value, $Res Function(_$PlanModelImpl) _then) : super(_value, _then); /// Create a copy of PlanModel /// with the given fields replaced by the non-null parameter values. @@ -588,8 +585,7 @@ class _$PlanModelImpl implements _PlanModel { @JsonKey(name: "total_views") required this.totalViews, @JsonKey(name: "total_comments") required this.totalComments}); - factory _$PlanModelImpl.fromJson(Map json) => - _$$PlanModelImplFromJson(json); + factory _$PlanModelImpl.fromJson(Map json) => _$$PlanModelImplFromJson(json); @override @JsonKey(name: "id") @@ -650,26 +646,18 @@ class _$PlanModelImpl implements _PlanModel { (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.image, image) || other.image == image) && - (identical(other.duration, duration) || - other.duration == duration) && + (identical(other.duration, duration) || other.duration == duration) && (identical(other.state, state) || other.state == state) && (identical(other.type, type) || other.type == type) && (identical(other.details, details) || other.details == details) && - (identical(other.packetsCount, packetsCount) || - other.packetsCount == packetsCount) && - const DeepCollectionEquality() - .equals(other.packet1Options, packet1Options) && - const DeepCollectionEquality() - .equals(other.packet2Options, packet2Options) && - const DeepCollectionEquality() - .equals(other.packet3Options, packet3Options) && + (identical(other.packetsCount, packetsCount) || other.packetsCount == packetsCount) && + const DeepCollectionEquality().equals(other.packet1Options, packet1Options) && + const DeepCollectionEquality().equals(other.packet2Options, packet2Options) && + const DeepCollectionEquality().equals(other.packet3Options, packet3Options) && (identical(other.author, author) || other.author == author) && - (identical(other.totalLikes, totalLikes) || - other.totalLikes == totalLikes) && - (identical(other.totalViews, totalViews) || - other.totalViews == totalViews) && - (identical(other.totalComments, totalComments) || - other.totalComments == totalComments)); + (identical(other.totalLikes, totalLikes) || other.totalLikes == totalLikes) && + (identical(other.totalViews, totalViews) || other.totalViews == totalViews) && + (identical(other.totalComments, totalComments) || other.totalComments == totalComments)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -697,8 +685,7 @@ class _$PlanModelImpl implements _PlanModel { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => - __$$PlanModelImplCopyWithImpl<_$PlanModelImpl>(this, _$identity); + _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => __$$PlanModelImplCopyWithImpl<_$PlanModelImpl>(this, _$identity); @override Map toJson() { @@ -710,68 +697,80 @@ class _$PlanModelImpl implements _PlanModel { abstract class _PlanModel implements PlanModel { const factory _PlanModel( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "image") required final String image, - @JsonKey(name: "duration") required final int duration, - @JsonKey(name: "state") required final String state, - @JsonKey(name: "type") required final PlanType type, - @JsonKey(name: "details") required final String details, - @JsonKey(name: "packets_count") required final int packetsCount, - @JsonKey(name: "packet1_options") final dynamic packet1Options, - @JsonKey(name: "packet2_options") final dynamic packet2Options, - @JsonKey(name: "packet3_options") final dynamic packet3Options, - @JsonKey(name: "author") required final Author author, - @JsonKey(name: "total_likes") required final int totalLikes, - @JsonKey(name: "total_views") required final int totalViews, - @JsonKey(name: "total_comments") required final int totalComments}) = - _$PlanModelImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "image") required final String image, + @JsonKey(name: "duration") required final int duration, + @JsonKey(name: "state") required final String state, + @JsonKey(name: "type") required final PlanType type, + @JsonKey(name: "details") required final String details, + @JsonKey(name: "packets_count") required final int packetsCount, + @JsonKey(name: "packet1_options") final dynamic packet1Options, + @JsonKey(name: "packet2_options") final dynamic packet2Options, + @JsonKey(name: "packet3_options") final dynamic packet3Options, + @JsonKey(name: "author") required final Author author, + @JsonKey(name: "total_likes") required final int totalLikes, + @JsonKey(name: "total_views") required final int totalViews, + @JsonKey(name: "total_comments") required final int totalComments}) = _$PlanModelImpl; - factory _PlanModel.fromJson(Map json) = - _$PlanModelImpl.fromJson; + factory _PlanModel.fromJson(Map json) = _$PlanModelImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "name") String get name; + @override @JsonKey(name: "image") String get image; + @override @JsonKey(name: "duration") int get duration; + @override @JsonKey(name: "state") String get state; + @override @JsonKey(name: "type") PlanType get type; + @override @JsonKey(name: "details") String get details; + @override @JsonKey(name: "packets_count") int get packetsCount; + @override @JsonKey(name: "packet1_options") dynamic get packet1Options; + @override @JsonKey(name: "packet2_options") dynamic get packet2Options; + @override @JsonKey(name: "packet3_options") dynamic get packet3Options; + @override @JsonKey(name: "author") Author get author; + @override @JsonKey(name: "total_likes") int get totalLikes; + @override @JsonKey(name: "total_views") int get totalViews; + @override @JsonKey(name: "total_comments") int get totalComments; @@ -780,8 +779,7 @@ abstract class _PlanModel implements PlanModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => throw _privateConstructorUsedError; } PacketOptions _$PacketOptionsFromJson(Map json) { @@ -792,10 +790,13 @@ PacketOptions _$PacketOptionsFromJson(Map json) { mixin _$PacketOptions { @JsonKey(name: "items") List get items => throw _privateConstructorUsedError; + @JsonKey(name: "price") dynamic get price => throw _privateConstructorUsedError; + @JsonKey(name: "short") String get short => throw _privateConstructorUsedError; + @JsonKey(name: "description") String get description => throw _privateConstructorUsedError; @@ -805,15 +806,13 @@ mixin _$PacketOptions { /// Create a copy of PacketOptions /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PacketOptionsCopyWith get copyWith => - throw _privateConstructorUsedError; + $PacketOptionsCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PacketOptionsCopyWith<$Res> { - factory $PacketOptionsCopyWith( - PacketOptions value, $Res Function(PacketOptions) then) = - _$PacketOptionsCopyWithImpl<$Res, PacketOptions>; + factory $PacketOptionsCopyWith(PacketOptions value, $Res Function(PacketOptions) then) = _$PacketOptionsCopyWithImpl<$Res, PacketOptions>; + @useResult $Res call( {@JsonKey(name: "items") List items, @@ -823,12 +822,12 @@ abstract class $PacketOptionsCopyWith<$Res> { } /// @nodoc -class _$PacketOptionsCopyWithImpl<$Res, $Val extends PacketOptions> - implements $PacketOptionsCopyWith<$Res> { +class _$PacketOptionsCopyWithImpl<$Res, $Val extends PacketOptions> implements $PacketOptionsCopyWith<$Res> { _$PacketOptionsCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -864,11 +863,9 @@ class _$PacketOptionsCopyWithImpl<$Res, $Val extends PacketOptions> } /// @nodoc -abstract class _$$PacketOptionsImplCopyWith<$Res> - implements $PacketOptionsCopyWith<$Res> { - factory _$$PacketOptionsImplCopyWith( - _$PacketOptionsImpl value, $Res Function(_$PacketOptionsImpl) then) = - __$$PacketOptionsImplCopyWithImpl<$Res>; +abstract class _$$PacketOptionsImplCopyWith<$Res> implements $PacketOptionsCopyWith<$Res> { + factory _$$PacketOptionsImplCopyWith(_$PacketOptionsImpl value, $Res Function(_$PacketOptionsImpl) then) = __$$PacketOptionsImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -879,12 +876,8 @@ abstract class _$$PacketOptionsImplCopyWith<$Res> } /// @nodoc -class __$$PacketOptionsImplCopyWithImpl<$Res> - extends _$PacketOptionsCopyWithImpl<$Res, _$PacketOptionsImpl> - implements _$$PacketOptionsImplCopyWith<$Res> { - __$$PacketOptionsImplCopyWithImpl( - _$PacketOptionsImpl _value, $Res Function(_$PacketOptionsImpl) _then) - : super(_value, _then); +class __$$PacketOptionsImplCopyWithImpl<$Res> extends _$PacketOptionsCopyWithImpl<$Res, _$PacketOptionsImpl> implements _$$PacketOptionsImplCopyWith<$Res> { + __$$PacketOptionsImplCopyWithImpl(_$PacketOptionsImpl _value, $Res Function(_$PacketOptionsImpl) _then) : super(_value, _then); /// Create a copy of PacketOptions /// with the given fields replaced by the non-null parameter values. @@ -927,10 +920,10 @@ class _$PacketOptionsImpl implements _PacketOptions { @JsonKey(name: "description") required this.description}) : _items = items; - factory _$PacketOptionsImpl.fromJson(Map json) => - _$$PacketOptionsImplFromJson(json); + factory _$PacketOptionsImpl.fromJson(Map json) => _$$PacketOptionsImplFromJson(json); final List _items; + @override @JsonKey(name: "items") List get items { @@ -962,26 +955,19 @@ class _$PacketOptionsImpl implements _PacketOptions { const DeepCollectionEquality().equals(other._items, _items) && const DeepCollectionEquality().equals(other.price, price) && (identical(other.short, short) || other.short == short) && - (identical(other.description, description) || - other.description == description)); + (identical(other.description, description) || other.description == description)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_items), - const DeepCollectionEquality().hash(price), - short, - description); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_items), const DeepCollectionEquality().hash(price), short, description); /// Create a copy of PacketOptions /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => - __$$PacketOptionsImplCopyWithImpl<_$PacketOptionsImpl>(this, _$identity); + _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => __$$PacketOptionsImplCopyWithImpl<_$PacketOptionsImpl>(this, _$identity); @override Map toJson() { @@ -993,24 +979,25 @@ class _$PacketOptionsImpl implements _PacketOptions { abstract class _PacketOptions implements PacketOptions { const factory _PacketOptions( - {@JsonKey(name: "items") required final List items, - @JsonKey(name: "price") required final dynamic price, - @JsonKey(name: "short") required final String short, - @JsonKey(name: "description") required final String description}) = - _$PacketOptionsImpl; + {@JsonKey(name: "items") required final List items, + @JsonKey(name: "price") required final dynamic price, + @JsonKey(name: "short") required final String short, + @JsonKey(name: "description") required final String description}) = _$PacketOptionsImpl; - factory _PacketOptions.fromJson(Map json) = - _$PacketOptionsImpl.fromJson; + factory _PacketOptions.fromJson(Map json) = _$PacketOptionsImpl.fromJson; @override @JsonKey(name: "items") List get items; + @override @JsonKey(name: "price") dynamic get price; + @override @JsonKey(name: "short") String get short; + @override @JsonKey(name: "description") String get description; @@ -1019,8 +1006,7 @@ abstract class _PacketOptions implements PacketOptions { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => throw _privateConstructorUsedError; } PlanType _$PlanTypeFromJson(Map json) { @@ -1031,10 +1017,13 @@ PlanType _$PlanTypeFromJson(Map json) { mixin _$PlanType { @JsonKey(name: "fit") bool get fit => throw _privateConstructorUsedError; + @JsonKey(name: "slim") bool get slim => throw _privateConstructorUsedError; + @JsonKey(name: "behavior") bool get behavior => throw _privateConstructorUsedError; + @JsonKey(name: "wellness") bool get wellness => throw _privateConstructorUsedError; @@ -1044,29 +1033,25 @@ mixin _$PlanType { /// Create a copy of PlanType /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PlanTypeCopyWith get copyWith => - throw _privateConstructorUsedError; + $PlanTypeCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PlanTypeCopyWith<$Res> { - factory $PlanTypeCopyWith(PlanType value, $Res Function(PlanType) then) = - _$PlanTypeCopyWithImpl<$Res, PlanType>; + factory $PlanTypeCopyWith(PlanType value, $Res Function(PlanType) then) = _$PlanTypeCopyWithImpl<$Res, PlanType>; + @useResult $Res call( - {@JsonKey(name: "fit") bool fit, - @JsonKey(name: "slim") bool slim, - @JsonKey(name: "behavior") bool behavior, - @JsonKey(name: "wellness") bool wellness}); + {@JsonKey(name: "fit") bool fit, @JsonKey(name: "slim") bool slim, @JsonKey(name: "behavior") bool behavior, @JsonKey(name: "wellness") bool wellness}); } /// @nodoc -class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType> - implements $PlanTypeCopyWith<$Res> { +class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType> implements $PlanTypeCopyWith<$Res> { _$PlanTypeCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -1102,27 +1087,18 @@ class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType> } /// @nodoc -abstract class _$$PlanTypeImplCopyWith<$Res> - implements $PlanTypeCopyWith<$Res> { - factory _$$PlanTypeImplCopyWith( - _$PlanTypeImpl value, $Res Function(_$PlanTypeImpl) then) = - __$$PlanTypeImplCopyWithImpl<$Res>; +abstract class _$$PlanTypeImplCopyWith<$Res> implements $PlanTypeCopyWith<$Res> { + factory _$$PlanTypeImplCopyWith(_$PlanTypeImpl value, $Res Function(_$PlanTypeImpl) then) = __$$PlanTypeImplCopyWithImpl<$Res>; + @override @useResult $Res call( - {@JsonKey(name: "fit") bool fit, - @JsonKey(name: "slim") bool slim, - @JsonKey(name: "behavior") bool behavior, - @JsonKey(name: "wellness") bool wellness}); + {@JsonKey(name: "fit") bool fit, @JsonKey(name: "slim") bool slim, @JsonKey(name: "behavior") bool behavior, @JsonKey(name: "wellness") bool wellness}); } /// @nodoc -class __$$PlanTypeImplCopyWithImpl<$Res> - extends _$PlanTypeCopyWithImpl<$Res, _$PlanTypeImpl> - implements _$$PlanTypeImplCopyWith<$Res> { - __$$PlanTypeImplCopyWithImpl( - _$PlanTypeImpl _value, $Res Function(_$PlanTypeImpl) _then) - : super(_value, _then); +class __$$PlanTypeImplCopyWithImpl<$Res> extends _$PlanTypeCopyWithImpl<$Res, _$PlanTypeImpl> implements _$$PlanTypeImplCopyWith<$Res> { + __$$PlanTypeImplCopyWithImpl(_$PlanTypeImpl _value, $Res Function(_$PlanTypeImpl) _then) : super(_value, _then); /// Create a copy of PlanType /// with the given fields replaced by the non-null parameter values. @@ -1164,8 +1140,7 @@ class _$PlanTypeImpl implements _PlanType { @JsonKey(name: "behavior") required this.behavior, @JsonKey(name: "wellness") required this.wellness}); - factory _$PlanTypeImpl.fromJson(Map json) => - _$$PlanTypeImplFromJson(json); + factory _$PlanTypeImpl.fromJson(Map json) => _$$PlanTypeImplFromJson(json); @override @JsonKey(name: "fit") @@ -1192,10 +1167,8 @@ class _$PlanTypeImpl implements _PlanType { other is _$PlanTypeImpl && (identical(other.fit, fit) || other.fit == fit) && (identical(other.slim, slim) || other.slim == slim) && - (identical(other.behavior, behavior) || - other.behavior == behavior) && - (identical(other.wellness, wellness) || - other.wellness == wellness)); + (identical(other.behavior, behavior) || other.behavior == behavior) && + (identical(other.wellness, wellness) || other.wellness == wellness)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -1207,8 +1180,7 @@ class _$PlanTypeImpl implements _PlanType { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => - __$$PlanTypeImplCopyWithImpl<_$PlanTypeImpl>(this, _$identity); + _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => __$$PlanTypeImplCopyWithImpl<_$PlanTypeImpl>(this, _$identity); @override Map toJson() { @@ -1220,24 +1192,25 @@ class _$PlanTypeImpl implements _PlanType { abstract class _PlanType implements PlanType { const factory _PlanType( - {@JsonKey(name: "fit") required final bool fit, - @JsonKey(name: "slim") required final bool slim, - @JsonKey(name: "behavior") required final bool behavior, - @JsonKey(name: "wellness") required final bool wellness}) = - _$PlanTypeImpl; + {@JsonKey(name: "fit") required final bool fit, + @JsonKey(name: "slim") required final bool slim, + @JsonKey(name: "behavior") required final bool behavior, + @JsonKey(name: "wellness") required final bool wellness}) = _$PlanTypeImpl; - factory _PlanType.fromJson(Map json) = - _$PlanTypeImpl.fromJson; + factory _PlanType.fromJson(Map json) = _$PlanTypeImpl.fromJson; @override @JsonKey(name: "fit") bool get fit; + @override @JsonKey(name: "slim") bool get slim; + @override @JsonKey(name: "behavior") bool get behavior; + @override @JsonKey(name: "wellness") bool get wellness; @@ -1246,6 +1219,5 @@ abstract class _PlanType implements PlanType { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/plans/models/plan_pagination_model.g.dart b/lib/features/plans/models/plan_pagination_model.g.dart index 8f203fa8..595e52b4 100644 --- a/lib/features/plans/models/plan_pagination_model.g.dart +++ b/lib/features/plans/models/plan_pagination_model.g.dart @@ -6,26 +6,19 @@ part of 'plan_pagination_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PlanPaginationModelImpl _$$PlanPaginationModelImplFromJson( - Map json) => - _$PlanPaginationModelImpl( - data: (json['data'] as List) - .map((e) => PlanModel.fromJson(e as Map)) - .toList(), +_$PlanPaginationModelImpl _$$PlanPaginationModelImplFromJson(Map json) => _$PlanPaginationModelImpl( + data: (json['data'] as List).map((e) => PlanModel.fromJson(e as Map)).toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$PlanPaginationModelImplToJson( - _$PlanPaginationModelImpl instance) => - { +Map _$$PlanPaginationModelImplToJson(_$PlanPaginationModelImpl instance) => { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$PlanModelImpl _$$PlanModelImplFromJson(Map json) => - _$PlanModelImpl( +_$PlanModelImpl _$$PlanModelImplFromJson(Map json) => _$PlanModelImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, image: json['image'] as String, @@ -43,8 +36,7 @@ _$PlanModelImpl _$$PlanModelImplFromJson(Map json) => totalComments: (json['total_comments'] as num).toInt(), ); -Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => - { +Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => { 'id': instance.id, 'name': instance.name, 'image': instance.image, @@ -62,32 +54,28 @@ Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => 'total_comments': instance.totalComments, }; -_$PacketOptionsImpl _$$PacketOptionsImplFromJson(Map json) => - _$PacketOptionsImpl( +_$PacketOptionsImpl _$$PacketOptionsImplFromJson(Map json) => _$PacketOptionsImpl( items: (json['items'] as List).map((e) => e as String).toList(), price: json['price'], short: json['short'] as String, description: json['description'] as String, ); -Map _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) => - { +Map _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) => { 'items': instance.items, 'price': instance.price, 'short': instance.short, 'description': instance.description, }; -_$PlanTypeImpl _$$PlanTypeImplFromJson(Map json) => - _$PlanTypeImpl( +_$PlanTypeImpl _$$PlanTypeImplFromJson(Map json) => _$PlanTypeImpl( fit: json['fit'] as bool, slim: json['slim'] as bool, behavior: json['behavior'] as bool, wellness: json['wellness'] as bool, ); -Map _$$PlanTypeImplToJson(_$PlanTypeImpl instance) => - { +Map _$$PlanTypeImplToJson(_$PlanTypeImpl instance) => { 'fit': instance.fit, 'slim': instance.slim, 'behavior': instance.behavior, diff --git a/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart b/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart index 1bbe3cac..e16e4e4d 100644 --- a/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart +++ b/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$PlansState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ mixin _$PlansState { /// @nodoc abstract class $PlansStateCopyWith<$Res> { - factory $PlansStateCopyWith( - PlansState value, $Res Function(PlansState) then) = - _$PlansStateCopyWithImpl<$Res, PlansState>; + factory $PlansStateCopyWith(PlansState value, $Res Function(PlansState) then) = _$PlansStateCopyWithImpl<$Res, PlansState>; } /// @nodoc -class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState> - implements $PlansStateCopyWith<$Res> { +class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState> implements $PlansStateCopyWith<$Res> { _$PlansStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +90,12 @@ class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState> /// @nodoc abstract class _$$PlansStateImplCopyWith<$Res> { - factory _$$PlansStateImplCopyWith( - _$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) = - __$$PlansStateImplCopyWithImpl<$Res>; + factory _$$PlansStateImplCopyWith(_$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) = __$$PlansStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$PlansStateImplCopyWithImpl<$Res> - extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl> - implements _$$PlansStateImplCopyWith<$Res> { - __$$PlansStateImplCopyWithImpl( - _$PlansStateImpl _value, $Res Function(_$PlansStateImpl) _then) - : super(_value, _then); +class __$$PlansStateImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl> implements _$$PlansStateImplCopyWith<$Res> { + __$$PlansStateImplCopyWithImpl(_$PlansStateImpl _value, $Res Function(_$PlansStateImpl) _then) : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -120,8 +113,7 @@ class _$PlansStateImpl implements _PlansState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$PlansStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$PlansStateImpl); } @override @@ -208,18 +200,14 @@ abstract class _PlansState implements PlansState { /// @nodoc abstract class _$$PlansStateLoadingImplCopyWith<$Res> { - factory _$$PlansStateLoadingImplCopyWith(_$PlansStateLoadingImpl value, - $Res Function(_$PlansStateLoadingImpl) then) = + factory _$$PlansStateLoadingImplCopyWith(_$PlansStateLoadingImpl value, $Res Function(_$PlansStateLoadingImpl) then) = __$$PlansStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$PlansStateLoadingImplCopyWithImpl<$Res> - extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadingImpl> +class __$$PlansStateLoadingImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadingImpl> implements _$$PlansStateLoadingImplCopyWith<$Res> { - __$$PlansStateLoadingImplCopyWithImpl(_$PlansStateLoadingImpl _value, - $Res Function(_$PlansStateLoadingImpl) _then) - : super(_value, _then); + __$$PlansStateLoadingImplCopyWithImpl(_$PlansStateLoadingImpl _value, $Res Function(_$PlansStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -237,8 +225,7 @@ class _$PlansStateLoadingImpl implements PlansStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$PlansStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$PlansStateLoadingImpl); } @override @@ -325,9 +312,9 @@ abstract class PlansStateLoading implements PlansState { /// @nodoc abstract class _$$PlansStateLoadedImplCopyWith<$Res> { - factory _$$PlansStateLoadedImplCopyWith(_$PlansStateLoadedImpl value, - $Res Function(_$PlansStateLoadedImpl) then) = + factory _$$PlansStateLoadedImplCopyWith(_$PlansStateLoadedImpl value, $Res Function(_$PlansStateLoadedImpl) then) = __$$PlansStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({PlanPaginationModel plansModel}); @@ -335,12 +322,9 @@ abstract class _$$PlansStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$PlansStateLoadedImplCopyWithImpl<$Res> - extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadedImpl> +class __$$PlansStateLoadedImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadedImpl> implements _$$PlansStateLoadedImplCopyWith<$Res> { - __$$PlansStateLoadedImplCopyWithImpl(_$PlansStateLoadedImpl _value, - $Res Function(_$PlansStateLoadedImpl) _then) - : super(_value, _then); + __$$PlansStateLoadedImplCopyWithImpl(_$PlansStateLoadedImpl _value, $Res Function(_$PlansStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -384,10 +368,7 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PlansStateLoadedImpl && - (identical(other.plansModel, plansModel) || - other.plansModel == plansModel)); + (other.runtimeType == runtimeType && other is _$PlansStateLoadedImpl && (identical(other.plansModel, plansModel) || other.plansModel == plansModel)); } @override @@ -398,9 +379,7 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => - __$$PlansStateLoadedImplCopyWithImpl<_$PlansStateLoadedImpl>( - this, _$identity); + _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => __$$PlansStateLoadedImplCopyWithImpl<_$PlansStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -478,34 +457,27 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded { } abstract class PlansStateLoaded implements PlansState { - const factory PlansStateLoaded( - {required final PlanPaginationModel plansModel}) = _$PlansStateLoadedImpl; + const factory PlansStateLoaded({required final PlanPaginationModel plansModel}) = _$PlansStateLoadedImpl; PlanPaginationModel get plansModel; /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$PlansStateErrorImplCopyWith<$Res> { - factory _$$PlansStateErrorImplCopyWith(_$PlansStateErrorImpl value, - $Res Function(_$PlansStateErrorImpl) then) = - __$$PlansStateErrorImplCopyWithImpl<$Res>; + factory _$$PlansStateErrorImplCopyWith(_$PlansStateErrorImpl value, $Res Function(_$PlansStateErrorImpl) then) = __$$PlansStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$PlansStateErrorImplCopyWithImpl<$Res> - extends _$PlansStateCopyWithImpl<$Res, _$PlansStateErrorImpl> - implements _$$PlansStateErrorImplCopyWith<$Res> { - __$$PlansStateErrorImplCopyWithImpl( - _$PlansStateErrorImpl _value, $Res Function(_$PlansStateErrorImpl) _then) - : super(_value, _then); +class __$$PlansStateErrorImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateErrorImpl> implements _$$PlansStateErrorImplCopyWith<$Res> { + __$$PlansStateErrorImplCopyWithImpl(_$PlansStateErrorImpl _value, $Res Function(_$PlansStateErrorImpl) _then) : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -541,8 +513,7 @@ class _$PlansStateErrorImpl implements PlansStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$PlansStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -553,9 +524,7 @@ class _$PlansStateErrorImpl implements PlansStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => - __$$PlansStateErrorImplCopyWithImpl<_$PlansStateErrorImpl>( - this, _$identity); + _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => __$$PlansStateErrorImplCopyWithImpl<_$PlansStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -633,14 +602,12 @@ class _$PlansStateErrorImpl implements PlansStateError { } abstract class PlansStateError implements PlansState { - const factory PlansStateError({required final String errorMessage}) = - _$PlansStateErrorImpl; + const factory PlansStateError({required final String errorMessage}) = _$PlansStateErrorImpl; String get errorMessage; /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/plans/services/plans_service.g.dart b/lib/features/plans/services/plans_service.g.dart index bce687f0..2f655a5d 100644 --- a/lib/features/plans/services/plans_service.g.dart +++ b/lib/features/plans/services/plans_service.g.dart @@ -55,9 +55,7 @@ class _PlansService implements PlansService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/profile/models/profile_model.dart b/lib/features/profile/models/profile_model.dart index d209e6d7..2ef4d073 100644 --- a/lib/features/profile/models/profile_model.dart +++ b/lib/features/profile/models/profile_model.dart @@ -1,7 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'profile_model.freezed.dart'; - part 'profile_model.g.dart'; @freezed diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index 94b860a3..3732e837 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -22,20 +22,28 @@ ProfileModel _$ProfileModelFromJson(Map json) { mixin _$ProfileModel { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; + @JsonKey(name: "email") String get email => throw _privateConstructorUsedError; + @JsonKey(name: "email_verified_at") DateTime? get emailVerifiedAt => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") DateTime? get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") DateTime? get updatedAt => throw _privateConstructorUsedError; + @JsonKey(name: "is_public_profile") bool get isPublicProfile => throw _privateConstructorUsedError; + @JsonKey(name: "slug") String get slug => throw _privateConstructorUsedError; + @JsonKey(name: "profile_photo_url") String get profilePhotoUrl => throw _privateConstructorUsedError; @@ -45,15 +53,13 @@ mixin _$ProfileModel { /// Create a copy of ProfileModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ProfileModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ProfileModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ProfileModelCopyWith<$Res> { - factory $ProfileModelCopyWith( - ProfileModel value, $Res Function(ProfileModel) then) = - _$ProfileModelCopyWithImpl<$Res, ProfileModel>; + factory $ProfileModelCopyWith(ProfileModel value, $Res Function(ProfileModel) then) = _$ProfileModelCopyWithImpl<$Res, ProfileModel>; + @useResult $Res call( {@JsonKey(name: "id") int id, @@ -68,12 +74,12 @@ abstract class $ProfileModelCopyWith<$Res> { } /// @nodoc -class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> - implements $ProfileModelCopyWith<$Res> { +class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> implements $ProfileModelCopyWith<$Res> { _$ProfileModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -134,11 +140,9 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> } /// @nodoc -abstract class _$$ProfileModelImplCopyWith<$Res> - implements $ProfileModelCopyWith<$Res> { - factory _$$ProfileModelImplCopyWith( - _$ProfileModelImpl value, $Res Function(_$ProfileModelImpl) then) = - __$$ProfileModelImplCopyWithImpl<$Res>; +abstract class _$$ProfileModelImplCopyWith<$Res> implements $ProfileModelCopyWith<$Res> { + factory _$$ProfileModelImplCopyWith(_$ProfileModelImpl value, $Res Function(_$ProfileModelImpl) then) = __$$ProfileModelImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -154,12 +158,8 @@ abstract class _$$ProfileModelImplCopyWith<$Res> } /// @nodoc -class __$$ProfileModelImplCopyWithImpl<$Res> - extends _$ProfileModelCopyWithImpl<$Res, _$ProfileModelImpl> - implements _$$ProfileModelImplCopyWith<$Res> { - __$$ProfileModelImplCopyWithImpl( - _$ProfileModelImpl _value, $Res Function(_$ProfileModelImpl) _then) - : super(_value, _then); +class __$$ProfileModelImplCopyWithImpl<$Res> extends _$ProfileModelCopyWithImpl<$Res, _$ProfileModelImpl> implements _$$ProfileModelImplCopyWith<$Res> { + __$$ProfileModelImplCopyWithImpl(_$ProfileModelImpl _value, $Res Function(_$ProfileModelImpl) _then) : super(_value, _then); /// Create a copy of ProfileModel /// with the given fields replaced by the non-null parameter values. @@ -231,8 +231,7 @@ class _$ProfileModelImpl implements _ProfileModel { @JsonKey(name: "slug") required this.slug, @JsonKey(name: "profile_photo_url") required this.profilePhotoUrl}); - factory _$ProfileModelImpl.fromJson(Map json) => - _$$ProfileModelImplFromJson(json); + factory _$ProfileModelImpl.fromJson(Map json) => _$$ProfileModelImplFromJson(json); @override @JsonKey(name: "id") @@ -275,31 +274,24 @@ class _$ProfileModelImpl implements _ProfileModel { (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.email, email) || other.email == email) && - (identical(other.emailVerifiedAt, emailVerifiedAt) || - other.emailVerifiedAt == emailVerifiedAt) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt) && - (identical(other.isPublicProfile, isPublicProfile) || - other.isPublicProfile == isPublicProfile) && + (identical(other.emailVerifiedAt, emailVerifiedAt) || other.emailVerifiedAt == emailVerifiedAt) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && + (identical(other.isPublicProfile, isPublicProfile) || other.isPublicProfile == isPublicProfile) && (identical(other.slug, slug) || other.slug == slug) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || - other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, email, emailVerifiedAt, - createdAt, updatedAt, isPublicProfile, slug, profilePhotoUrl); + int get hashCode => Object.hash(runtimeType, id, name, email, emailVerifiedAt, createdAt, updatedAt, isPublicProfile, slug, profilePhotoUrl); /// Create a copy of ProfileModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => - __$$ProfileModelImplCopyWithImpl<_$ProfileModelImpl>(this, _$identity); + _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => __$$ProfileModelImplCopyWithImpl<_$ProfileModelImpl>(this, _$identity); @override Map toJson() { @@ -319,36 +311,42 @@ abstract class _ProfileModel implements ProfileModel { @JsonKey(name: "updated_at") final DateTime? updatedAt, @JsonKey(name: "is_public_profile") required final bool isPublicProfile, @JsonKey(name: "slug") required final String slug, - @JsonKey(name: "profile_photo_url") - required final String profilePhotoUrl}) = _$ProfileModelImpl; + @JsonKey(name: "profile_photo_url") required final String profilePhotoUrl}) = _$ProfileModelImpl; - factory _ProfileModel.fromJson(Map json) = - _$ProfileModelImpl.fromJson; + factory _ProfileModel.fromJson(Map json) = _$ProfileModelImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "name") String get name; + @override @JsonKey(name: "email") String get email; + @override @JsonKey(name: "email_verified_at") DateTime? get emailVerifiedAt; + @override @JsonKey(name: "created_at") DateTime? get createdAt; + @override @JsonKey(name: "updated_at") DateTime? get updatedAt; + @override @JsonKey(name: "is_public_profile") bool get isPublicProfile; + @override @JsonKey(name: "slug") String get slug; + @override @JsonKey(name: "profile_photo_url") String get profilePhotoUrl; @@ -357,8 +355,7 @@ abstract class _ProfileModel implements ProfileModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => throw _privateConstructorUsedError; } ProfileDetailsModel _$ProfileDetailsModelFromJson(Map json) { @@ -369,56 +366,82 @@ ProfileDetailsModel _$ProfileDetailsModelFromJson(Map json) { mixin _$ProfileDetailsModel { @JsonKey(name: "first_name") String get firstName => throw _privateConstructorUsedError; + @JsonKey(name: "last_name") String get lastName => throw _privateConstructorUsedError; + @JsonKey(name: "birthdate") String get birthdate => throw _privateConstructorUsedError; + @JsonKey(name: "gender") String get gender => throw _privateConstructorUsedError; + @JsonKey(name: "country") String get country => throw _privateConstructorUsedError; + @JsonKey(name: "city") String get city => throw _privateConstructorUsedError; + @JsonKey(name: "lang") String get lang => throw _privateConstructorUsedError; + @JsonKey(name: "weight") double get weight => throw _privateConstructorUsedError; + @JsonKey(name: "height") int get height => throw _privateConstructorUsedError; + @JsonKey(name: "chest_circumference") int get chestCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "waist_circumference") int get waistCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "hip_circumference") int get hipCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "blood_pressure_up") int get bloodPressureUp => throw _privateConstructorUsedError; + @JsonKey(name: "blood_pressure_down") int get bloodPressureDown => throw _privateConstructorUsedError; + @JsonKey(name: "has_hypo") bool get hasHypo => throw _privateConstructorUsedError; + @JsonKey(name: "has_hyper") bool get hasHyper => throw _privateConstructorUsedError; + @JsonKey(name: "about_alergy") String get aboutAlergy => throw _privateConstructorUsedError; + @JsonKey(name: "about_taking_pils") String get aboutTakingPils => throw _privateConstructorUsedError; + @JsonKey(name: "about_sport_hobbies") String get aboutSportHobbies => throw _privateConstructorUsedError; + @JsonKey(name: "favorite_foods") String get favoriteFoods => throw _privateConstructorUsedError; + @JsonKey(name: "unfavorite_foods") String get unfavoriteFoods => throw _privateConstructorUsedError; + @JsonKey(name: "additional_info") String get additionalInfo => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") DateTime? get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") DateTime? get updatedAt => throw _privateConstructorUsedError; + @JsonKey(name: "is_mood_fillable") bool get isMoodFillable => throw _privateConstructorUsedError; + @JsonKey(name: "is_bedtime_fillable") bool get isBedtimeFillable => throw _privateConstructorUsedError; + @JsonKey(name: "activity_coefficient") double get activityCoefficient => throw _privateConstructorUsedError; @@ -428,15 +451,14 @@ mixin _$ProfileDetailsModel { /// Create a copy of ProfileDetailsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ProfileDetailsModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ProfileDetailsModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ProfileDetailsModelCopyWith<$Res> { - factory $ProfileDetailsModelCopyWith( - ProfileDetailsModel value, $Res Function(ProfileDetailsModel) then) = + factory $ProfileDetailsModelCopyWith(ProfileDetailsModel value, $Res Function(ProfileDetailsModel) then) = _$ProfileDetailsModelCopyWithImpl<$Res, ProfileDetailsModel>; + @useResult $Res call( {@JsonKey(name: "first_name") String firstName, @@ -469,12 +491,12 @@ abstract class $ProfileDetailsModelCopyWith<$Res> { } /// @nodoc -class _$ProfileDetailsModelCopyWithImpl<$Res, $Val extends ProfileDetailsModel> - implements $ProfileDetailsModelCopyWith<$Res> { +class _$ProfileDetailsModelCopyWithImpl<$Res, $Val extends ProfileDetailsModel> implements $ProfileDetailsModelCopyWith<$Res> { _$ProfileDetailsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -625,11 +647,10 @@ class _$ProfileDetailsModelCopyWithImpl<$Res, $Val extends ProfileDetailsModel> } /// @nodoc -abstract class _$$ProfileDetailsModelImplCopyWith<$Res> - implements $ProfileDetailsModelCopyWith<$Res> { - factory _$$ProfileDetailsModelImplCopyWith(_$ProfileDetailsModelImpl value, - $Res Function(_$ProfileDetailsModelImpl) then) = +abstract class _$$ProfileDetailsModelImplCopyWith<$Res> implements $ProfileDetailsModelCopyWith<$Res> { + factory _$$ProfileDetailsModelImplCopyWith(_$ProfileDetailsModelImpl value, $Res Function(_$ProfileDetailsModelImpl) then) = __$$ProfileDetailsModelImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -663,12 +684,9 @@ abstract class _$$ProfileDetailsModelImplCopyWith<$Res> } /// @nodoc -class __$$ProfileDetailsModelImplCopyWithImpl<$Res> - extends _$ProfileDetailsModelCopyWithImpl<$Res, _$ProfileDetailsModelImpl> +class __$$ProfileDetailsModelImplCopyWithImpl<$Res> extends _$ProfileDetailsModelCopyWithImpl<$Res, _$ProfileDetailsModelImpl> implements _$$ProfileDetailsModelImplCopyWith<$Res> { - __$$ProfileDetailsModelImplCopyWithImpl(_$ProfileDetailsModelImpl _value, - $Res Function(_$ProfileDetailsModelImpl) _then) - : super(_value, _then); + __$$ProfileDetailsModelImplCopyWithImpl(_$ProfileDetailsModelImpl _value, $Res Function(_$ProfileDetailsModelImpl) _then) : super(_value, _then); /// Create a copy of ProfileDetailsModel /// with the given fields replaced by the non-null parameter values. @@ -846,11 +864,9 @@ class _$ProfileDetailsModelImpl implements _ProfileDetailsModel { @JsonKey(name: "updated_at") this.updatedAt, @JsonKey(name: "is_mood_fillable") required this.isMoodFillable, @JsonKey(name: "is_bedtime_fillable") required this.isBedtimeFillable, - @JsonKey(name: "activity_coefficient") - required this.activityCoefficient}); + @JsonKey(name: "activity_coefficient") required this.activityCoefficient}); - factory _$ProfileDetailsModelImpl.fromJson(Map json) => - _$$ProfileDetailsModelImplFromJson(json); + factory _$ProfileDetailsModelImpl.fromJson(Map json) => _$$ProfileDetailsModelImplFromJson(json); @override @JsonKey(name: "first_name") @@ -944,53 +960,33 @@ class _$ProfileDetailsModelImpl implements _ProfileDetailsModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileDetailsModelImpl && - (identical(other.firstName, firstName) || - other.firstName == firstName) && - (identical(other.lastName, lastName) || - other.lastName == lastName) && - (identical(other.birthdate, birthdate) || - other.birthdate == birthdate) && + (identical(other.firstName, firstName) || other.firstName == firstName) && + (identical(other.lastName, lastName) || other.lastName == lastName) && + (identical(other.birthdate, birthdate) || other.birthdate == birthdate) && (identical(other.gender, gender) || other.gender == gender) && (identical(other.country, country) || other.country == country) && (identical(other.city, city) || other.city == city) && (identical(other.lang, lang) || other.lang == lang) && (identical(other.weight, weight) || other.weight == weight) && (identical(other.height, height) || other.height == height) && - (identical(other.chestCircumference, chestCircumference) || - other.chestCircumference == chestCircumference) && - (identical(other.waistCircumference, waistCircumference) || - other.waistCircumference == waistCircumference) && - (identical(other.hipCircumference, hipCircumference) || - other.hipCircumference == hipCircumference) && - (identical(other.bloodPressureUp, bloodPressureUp) || - other.bloodPressureUp == bloodPressureUp) && - (identical(other.bloodPressureDown, bloodPressureDown) || - other.bloodPressureDown == bloodPressureDown) && + (identical(other.chestCircumference, chestCircumference) || other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || other.hipCircumference == hipCircumference) && + (identical(other.bloodPressureUp, bloodPressureUp) || other.bloodPressureUp == bloodPressureUp) && + (identical(other.bloodPressureDown, bloodPressureDown) || other.bloodPressureDown == bloodPressureDown) && (identical(other.hasHypo, hasHypo) || other.hasHypo == hasHypo) && - (identical(other.hasHyper, hasHyper) || - other.hasHyper == hasHyper) && - (identical(other.aboutAlergy, aboutAlergy) || - other.aboutAlergy == aboutAlergy) && - (identical(other.aboutTakingPils, aboutTakingPils) || - other.aboutTakingPils == aboutTakingPils) && - (identical(other.aboutSportHobbies, aboutSportHobbies) || - other.aboutSportHobbies == aboutSportHobbies) && - (identical(other.favoriteFoods, favoriteFoods) || - other.favoriteFoods == favoriteFoods) && - (identical(other.unfavoriteFoods, unfavoriteFoods) || - other.unfavoriteFoods == unfavoriteFoods) && - (identical(other.additionalInfo, additionalInfo) || - other.additionalInfo == additionalInfo) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt) && - (identical(other.isMoodFillable, isMoodFillable) || - other.isMoodFillable == isMoodFillable) && - (identical(other.isBedtimeFillable, isBedtimeFillable) || - other.isBedtimeFillable == isBedtimeFillable) && - (identical(other.activityCoefficient, activityCoefficient) || - other.activityCoefficient == activityCoefficient)); + (identical(other.hasHyper, hasHyper) || other.hasHyper == hasHyper) && + (identical(other.aboutAlergy, aboutAlergy) || other.aboutAlergy == aboutAlergy) && + (identical(other.aboutTakingPils, aboutTakingPils) || other.aboutTakingPils == aboutTakingPils) && + (identical(other.aboutSportHobbies, aboutSportHobbies) || other.aboutSportHobbies == aboutSportHobbies) && + (identical(other.favoriteFoods, favoriteFoods) || other.favoriteFoods == favoriteFoods) && + (identical(other.unfavoriteFoods, unfavoriteFoods) || other.unfavoriteFoods == unfavoriteFoods) && + (identical(other.additionalInfo, additionalInfo) || other.additionalInfo == additionalInfo) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && + (identical(other.isMoodFillable, isMoodFillable) || other.isMoodFillable == isMoodFillable) && + (identical(other.isBedtimeFillable, isBedtimeFillable) || other.isBedtimeFillable == isBedtimeFillable) && + (identical(other.activityCoefficient, activityCoefficient) || other.activityCoefficient == activityCoefficient)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -1032,8 +1028,7 @@ class _$ProfileDetailsModelImpl implements _ProfileDetailsModel { @override @pragma('vm:prefer-inline') _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => - __$$ProfileDetailsModelImplCopyWithImpl<_$ProfileDetailsModelImpl>( - this, _$identity); + __$$ProfileDetailsModelImplCopyWithImpl<_$ProfileDetailsModelImpl>(this, _$identity); @override Map toJson() { @@ -1054,112 +1049,131 @@ abstract class _ProfileDetailsModel implements ProfileDetailsModel { @JsonKey(name: "lang") required final String lang, @JsonKey(name: "weight") required final double weight, @JsonKey(name: "height") required final int height, - @JsonKey(name: "chest_circumference") - required final int chestCircumference, - @JsonKey(name: "waist_circumference") - required final int waistCircumference, + @JsonKey(name: "chest_circumference") required final int chestCircumference, + @JsonKey(name: "waist_circumference") required final int waistCircumference, @JsonKey(name: "hip_circumference") required final int hipCircumference, @JsonKey(name: "blood_pressure_up") required final int bloodPressureUp, - @JsonKey(name: "blood_pressure_down") - required final int bloodPressureDown, + @JsonKey(name: "blood_pressure_down") required final int bloodPressureDown, @JsonKey(name: "has_hypo") required final bool hasHypo, @JsonKey(name: "has_hyper") required final bool hasHyper, @JsonKey(name: "about_alergy") required final String aboutAlergy, @JsonKey(name: "about_taking_pils") required final String aboutTakingPils, - @JsonKey(name: "about_sport_hobbies") - required final String aboutSportHobbies, + @JsonKey(name: "about_sport_hobbies") required final String aboutSportHobbies, @JsonKey(name: "favorite_foods") required final String favoriteFoods, @JsonKey(name: "unfavorite_foods") required final String unfavoriteFoods, @JsonKey(name: "additional_info") required final String additionalInfo, @JsonKey(name: "created_at") final DateTime? createdAt, @JsonKey(name: "updated_at") final DateTime? updatedAt, @JsonKey(name: "is_mood_fillable") required final bool isMoodFillable, - @JsonKey(name: "is_bedtime_fillable") - required final bool isBedtimeFillable, - @JsonKey(name: "activity_coefficient") - required final double activityCoefficient}) = _$ProfileDetailsModelImpl; + @JsonKey(name: "is_bedtime_fillable") required final bool isBedtimeFillable, + @JsonKey(name: "activity_coefficient") required final double activityCoefficient}) = _$ProfileDetailsModelImpl; - factory _ProfileDetailsModel.fromJson(Map json) = - _$ProfileDetailsModelImpl.fromJson; + factory _ProfileDetailsModel.fromJson(Map json) = _$ProfileDetailsModelImpl.fromJson; @override @JsonKey(name: "first_name") String get firstName; + @override @JsonKey(name: "last_name") String get lastName; + @override @JsonKey(name: "birthdate") String get birthdate; + @override @JsonKey(name: "gender") String get gender; + @override @JsonKey(name: "country") String get country; + @override @JsonKey(name: "city") String get city; + @override @JsonKey(name: "lang") String get lang; + @override @JsonKey(name: "weight") double get weight; + @override @JsonKey(name: "height") int get height; + @override @JsonKey(name: "chest_circumference") int get chestCircumference; + @override @JsonKey(name: "waist_circumference") int get waistCircumference; + @override @JsonKey(name: "hip_circumference") int get hipCircumference; + @override @JsonKey(name: "blood_pressure_up") int get bloodPressureUp; + @override @JsonKey(name: "blood_pressure_down") int get bloodPressureDown; + @override @JsonKey(name: "has_hypo") bool get hasHypo; + @override @JsonKey(name: "has_hyper") bool get hasHyper; + @override @JsonKey(name: "about_alergy") String get aboutAlergy; + @override @JsonKey(name: "about_taking_pils") String get aboutTakingPils; + @override @JsonKey(name: "about_sport_hobbies") String get aboutSportHobbies; + @override @JsonKey(name: "favorite_foods") String get favoriteFoods; + @override @JsonKey(name: "unfavorite_foods") String get unfavoriteFoods; + @override @JsonKey(name: "additional_info") String get additionalInfo; + @override @JsonKey(name: "created_at") DateTime? get createdAt; + @override @JsonKey(name: "updated_at") DateTime? get updatedAt; + @override @JsonKey(name: "is_mood_fillable") bool get isMoodFillable; + @override @JsonKey(name: "is_bedtime_fillable") bool get isBedtimeFillable; + @override @JsonKey(name: "activity_coefficient") double get activityCoefficient; @@ -1168,6 +1182,5 @@ abstract class _ProfileDetailsModel implements ProfileDetailsModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/profile/models/profile_model.g.dart b/lib/features/profile/models/profile_model.g.dart index 28e10ccf..56e201fb 100644 --- a/lib/features/profile/models/profile_model.g.dart +++ b/lib/features/profile/models/profile_model.g.dart @@ -6,27 +6,19 @@ part of 'profile_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ProfileModelImpl _$$ProfileModelImplFromJson(Map json) => - _$ProfileModelImpl( +_$ProfileModelImpl _$$ProfileModelImplFromJson(Map json) => _$ProfileModelImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, email: json['email'] as String, - emailVerifiedAt: json['email_verified_at'] == null - ? null - : DateTime.parse(json['email_verified_at'] as String), - createdAt: json['created_at'] == null - ? null - : DateTime.parse(json['created_at'] as String), - updatedAt: json['updated_at'] == null - ? null - : DateTime.parse(json['updated_at'] as String), + emailVerifiedAt: json['email_verified_at'] == null ? null : DateTime.parse(json['email_verified_at'] as String), + createdAt: json['created_at'] == null ? null : DateTime.parse(json['created_at'] as String), + updatedAt: json['updated_at'] == null ? null : DateTime.parse(json['updated_at'] as String), isPublicProfile: json['is_public_profile'] as bool, slug: json['slug'] as String, profilePhotoUrl: json['profile_photo_url'] as String, ); -Map _$$ProfileModelImplToJson(_$ProfileModelImpl instance) => - { +Map _$$ProfileModelImplToJson(_$ProfileModelImpl instance) => { 'id': instance.id, 'name': instance.name, 'email': instance.email, @@ -38,9 +30,7 @@ Map _$$ProfileModelImplToJson(_$ProfileModelImpl instance) => 'profile_photo_url': instance.profilePhotoUrl, }; -_$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson( - Map json) => - _$ProfileDetailsModelImpl( +_$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson(Map json) => _$ProfileDetailsModelImpl( firstName: json['first_name'] as String, lastName: json['last_name'] as String, birthdate: json['birthdate'] as String, @@ -63,20 +53,14 @@ _$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson( favoriteFoods: json['favorite_foods'] as String, unfavoriteFoods: json['unfavorite_foods'] as String, additionalInfo: json['additional_info'] as String, - createdAt: json['created_at'] == null - ? null - : DateTime.parse(json['created_at'] as String), - updatedAt: json['updated_at'] == null - ? null - : DateTime.parse(json['updated_at'] as String), + createdAt: json['created_at'] == null ? null : DateTime.parse(json['created_at'] as String), + updatedAt: json['updated_at'] == null ? null : DateTime.parse(json['updated_at'] as String), isMoodFillable: json['is_mood_fillable'] as bool, isBedtimeFillable: json['is_bedtime_fillable'] as bool, activityCoefficient: (json['activity_coefficient'] as num).toDouble(), ); -Map _$$ProfileDetailsModelImplToJson( - _$ProfileDetailsModelImpl instance) => - { +Map _$$ProfileDetailsModelImplToJson(_$ProfileDetailsModelImpl instance) => { 'first_name': instance.firstName, 'last_name': instance.lastName, 'birthdate': instance.birthdate, diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart index 9e574749..e8e4c2ba 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart @@ -20,21 +20,16 @@ mixin _$ProfileState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - ProfileModel profile, - ProfileDetailsModel profileDetails, - List blogPosts) - loaded, + required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, - List blogPosts)? - loaded, + TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -42,9 +37,7 @@ mixin _$ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, - List blogPosts)? - loaded, + TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -78,18 +71,16 @@ mixin _$ProfileState { /// @nodoc abstract class $ProfileStateCopyWith<$Res> { - factory $ProfileStateCopyWith( - ProfileState value, $Res Function(ProfileState) then) = - _$ProfileStateCopyWithImpl<$Res, ProfileState>; + factory $ProfileStateCopyWith(ProfileState value, $Res Function(ProfileState) then) = _$ProfileStateCopyWithImpl<$Res, ProfileState>; } /// @nodoc -class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> - implements $ProfileStateCopyWith<$Res> { +class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> implements $ProfileStateCopyWith<$Res> { _$ProfileStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -99,18 +90,12 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> /// @nodoc abstract class _$$ProfileStateImplCopyWith<$Res> { - factory _$$ProfileStateImplCopyWith( - _$ProfileStateImpl value, $Res Function(_$ProfileStateImpl) then) = - __$$ProfileStateImplCopyWithImpl<$Res>; + factory _$$ProfileStateImplCopyWith(_$ProfileStateImpl value, $Res Function(_$ProfileStateImpl) then) = __$$ProfileStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileStateImplCopyWithImpl<$Res> - extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateImpl> - implements _$$ProfileStateImplCopyWith<$Res> { - __$$ProfileStateImplCopyWithImpl( - _$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then) - : super(_value, _then); +class __$$ProfileStateImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateImpl> implements _$$ProfileStateImplCopyWith<$Res> { + __$$ProfileStateImplCopyWithImpl(_$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then) : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -128,8 +113,7 @@ class _$ProfileStateImpl implements _ProfileState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ProfileStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileStateImpl); } @override @@ -140,11 +124,7 @@ class _$ProfileStateImpl implements _ProfileState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - ProfileModel profile, - ProfileDetailsModel profileDetails, - List blogPosts) - loaded, + required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -155,9 +135,7 @@ class _$ProfileStateImpl implements _ProfileState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, - List blogPosts)? - loaded, + TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -168,9 +146,7 @@ class _$ProfileStateImpl implements _ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, - List blogPosts)? - loaded, + TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -224,18 +200,14 @@ abstract class _ProfileState implements ProfileState { /// @nodoc abstract class _$$ProfileStateLoadingImplCopyWith<$Res> { - factory _$$ProfileStateLoadingImplCopyWith(_$ProfileStateLoadingImpl value, - $Res Function(_$ProfileStateLoadingImpl) then) = + factory _$$ProfileStateLoadingImplCopyWith(_$ProfileStateLoadingImpl value, $Res Function(_$ProfileStateLoadingImpl) then) = __$$ProfileStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileStateLoadingImplCopyWithImpl<$Res> - extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadingImpl> +class __$$ProfileStateLoadingImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadingImpl> implements _$$ProfileStateLoadingImplCopyWith<$Res> { - __$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value, - $Res Function(_$ProfileStateLoadingImpl) _then) - : super(_value, _then); + __$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value, $Res Function(_$ProfileStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -253,9 +225,7 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ProfileStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileStateLoadingImpl); } @override @@ -266,11 +236,7 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - ProfileModel profile, - ProfileDetailsModel profileDetails, - List blogPosts) - loaded, + required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -281,9 +247,7 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, - List blogPosts)? - loaded, + TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -294,9 +258,7 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, - List blogPosts)? - loaded, + TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -350,26 +312,21 @@ abstract class ProfileStateLoading implements ProfileState { /// @nodoc abstract class _$$ProfileStateLoadedImplCopyWith<$Res> { - factory _$$ProfileStateLoadedImplCopyWith(_$ProfileStateLoadedImpl value, - $Res Function(_$ProfileStateLoadedImpl) then) = + factory _$$ProfileStateLoadedImplCopyWith(_$ProfileStateLoadedImpl value, $Res Function(_$ProfileStateLoadedImpl) then) = __$$ProfileStateLoadedImplCopyWithImpl<$Res>; + @useResult - $Res call( - {ProfileModel profile, - ProfileDetailsModel profileDetails, - List blogPosts}); + $Res call({ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts}); $ProfileModelCopyWith<$Res> get profile; + $ProfileDetailsModelCopyWith<$Res> get profileDetails; } /// @nodoc -class __$$ProfileStateLoadedImplCopyWithImpl<$Res> - extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadedImpl> +class __$$ProfileStateLoadedImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadedImpl> implements _$$ProfileStateLoadedImplCopyWith<$Res> { - __$$ProfileStateLoadedImplCopyWithImpl(_$ProfileStateLoadedImpl _value, - $Res Function(_$ProfileStateLoadedImpl) _then) - : super(_value, _then); + __$$ProfileStateLoadedImplCopyWithImpl(_$ProfileStateLoadedImpl _value, $Res Function(_$ProfileStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -420,10 +377,7 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$ProfileStateLoadedImpl implements ProfileStateLoaded { - const _$ProfileStateLoadedImpl( - {required this.profile, - required this.profileDetails, - required final List blogPosts}) + const _$ProfileStateLoadedImpl({required this.profile, required this.profileDetails, required final List blogPosts}) : _blogPosts = blogPosts; @override @@ -431,6 +385,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { @override final ProfileDetailsModel profileDetails; final List _blogPosts; + @override List get blogPosts { if (_blogPosts is EqualUnmodifiableListView) return _blogPosts; @@ -449,15 +404,12 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { (other.runtimeType == runtimeType && other is _$ProfileStateLoadedImpl && (identical(other.profile, profile) || other.profile == profile) && - (identical(other.profileDetails, profileDetails) || - other.profileDetails == profileDetails) && - const DeepCollectionEquality() - .equals(other._blogPosts, _blogPosts)); + (identical(other.profileDetails, profileDetails) || other.profileDetails == profileDetails) && + const DeepCollectionEquality().equals(other._blogPosts, _blogPosts)); } @override - int get hashCode => Object.hash(runtimeType, profile, profileDetails, - const DeepCollectionEquality().hash(_blogPosts)); + int get hashCode => Object.hash(runtimeType, profile, profileDetails, const DeepCollectionEquality().hash(_blogPosts)); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -465,19 +417,14 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { @override @pragma('vm:prefer-inline') _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => - __$$ProfileStateLoadedImplCopyWithImpl<_$ProfileStateLoadedImpl>( - this, _$identity); + __$$ProfileStateLoadedImplCopyWithImpl<_$ProfileStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - ProfileModel profile, - ProfileDetailsModel profileDetails, - List blogPosts) - loaded, + required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, required TResult Function(String errorMessage) error, }) { return loaded(profile, profileDetails, blogPosts); @@ -488,9 +435,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, - List blogPosts)? - loaded, + TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(profile, profileDetails, blogPosts); @@ -501,9 +446,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, - List blogPosts)? - loaded, + TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -553,38 +496,35 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { abstract class ProfileStateLoaded implements ProfileState { const factory ProfileStateLoaded( - {required final ProfileModel profile, - required final ProfileDetailsModel profileDetails, - required final List blogPosts}) = - _$ProfileStateLoadedImpl; + {required final ProfileModel profile, + required final ProfileDetailsModel profileDetails, + required final List blogPosts}) = _$ProfileStateLoadedImpl; ProfileModel get profile; + ProfileDetailsModel get profileDetails; + List get blogPosts; /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ProfileStateErrorImplCopyWith<$Res> { - factory _$$ProfileStateErrorImplCopyWith(_$ProfileStateErrorImpl value, - $Res Function(_$ProfileStateErrorImpl) then) = + factory _$$ProfileStateErrorImplCopyWith(_$ProfileStateErrorImpl value, $Res Function(_$ProfileStateErrorImpl) then) = __$$ProfileStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ProfileStateErrorImplCopyWithImpl<$Res> - extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateErrorImpl> +class __$$ProfileStateErrorImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateErrorImpl> implements _$$ProfileStateErrorImplCopyWith<$Res> { - __$$ProfileStateErrorImplCopyWithImpl(_$ProfileStateErrorImpl _value, - $Res Function(_$ProfileStateErrorImpl) _then) - : super(_value, _then); + __$$ProfileStateErrorImplCopyWithImpl(_$ProfileStateErrorImpl _value, $Res Function(_$ProfileStateErrorImpl) _then) : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -620,8 +560,7 @@ class _$ProfileStateErrorImpl implements ProfileStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -632,20 +571,14 @@ class _$ProfileStateErrorImpl implements ProfileStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => - __$$ProfileStateErrorImplCopyWithImpl<_$ProfileStateErrorImpl>( - this, _$identity); + _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => __$$ProfileStateErrorImplCopyWithImpl<_$ProfileStateErrorImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function( - ProfileModel profile, - ProfileDetailsModel profileDetails, - List blogPosts) - loaded, + required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -656,9 +589,7 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, - List blogPosts)? - loaded, + TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -669,9 +600,7 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, - List blogPosts)? - loaded, + TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -720,14 +649,12 @@ class _$ProfileStateErrorImpl implements ProfileStateError { } abstract class ProfileStateError implements ProfileState { - const factory ProfileStateError({required final String errorMessage}) = - _$ProfileStateErrorImpl; + const factory ProfileStateError({required final String errorMessage}) = _$ProfileStateErrorImpl; String get errorMessage; /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index 560266d4..a27450ce 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -1,4 +1,4 @@ -// +// // import 'package:eatvio_app/features/profile/models/profile_model.dart'; // import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; // import 'package:flutter/cupertino.dart'; diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index fea255cc..ab457ebe 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -1,4 +1,4 @@ -// +// // import 'package:eatvio_app/features/profile/models/profile_model.dart'; // import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; // import 'package:flutter/cupertino.dart'; diff --git a/lib/features/profile/services/profile_service.g.dart b/lib/features/profile/services/profile_service.g.dart index a7f855ff..47070f20 100644 --- a/lib/features/profile/services/profile_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -191,8 +191,7 @@ class _ProfileService implements ProfileService { } @override - Future getBlogPostByAuthorSlug( - {required String slug}) async { + Future getBlogPostByAuthorSlug({required String slug}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -225,9 +224,7 @@ class _ProfileService implements ProfileService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/recipes/models/ingredient.dart b/lib/features/recipes/models/ingredient.dart index d7a130e4..5524e744 100644 --- a/lib/features/recipes/models/ingredient.dart +++ b/lib/features/recipes/models/ingredient.dart @@ -1,7 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'ingredient.freezed.dart'; - part 'ingredient.g.dart'; @freezed diff --git a/lib/features/recipes/models/ingredient.freezed.dart b/lib/features/recipes/models/ingredient.freezed.dart index 2bf96fb3..24468f59 100644 --- a/lib/features/recipes/models/ingredient.freezed.dart +++ b/lib/features/recipes/models/ingredient.freezed.dart @@ -21,7 +21,9 @@ Ingredient _$IngredientFromJson(Map json) { /// @nodoc mixin _$Ingredient { String get name => throw _privateConstructorUsedError; + String get unit => throw _privateConstructorUsedError; + String get portion => throw _privateConstructorUsedError; /// Serializes this Ingredient to a JSON map. @@ -30,26 +32,24 @@ mixin _$Ingredient { /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $IngredientCopyWith get copyWith => - throw _privateConstructorUsedError; + $IngredientCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $IngredientCopyWith<$Res> { - factory $IngredientCopyWith( - Ingredient value, $Res Function(Ingredient) then) = - _$IngredientCopyWithImpl<$Res, Ingredient>; + factory $IngredientCopyWith(Ingredient value, $Res Function(Ingredient) then) = _$IngredientCopyWithImpl<$Res, Ingredient>; + @useResult $Res call({String name, String unit, String portion}); } /// @nodoc -class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> - implements $IngredientCopyWith<$Res> { +class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $IngredientCopyWith<$Res> { _$IngredientCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -80,23 +80,17 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> } /// @nodoc -abstract class _$$IngredientImplCopyWith<$Res> - implements $IngredientCopyWith<$Res> { - factory _$$IngredientImplCopyWith( - _$IngredientImpl value, $Res Function(_$IngredientImpl) then) = - __$$IngredientImplCopyWithImpl<$Res>; +abstract class _$$IngredientImplCopyWith<$Res> implements $IngredientCopyWith<$Res> { + factory _$$IngredientImplCopyWith(_$IngredientImpl value, $Res Function(_$IngredientImpl) then) = __$$IngredientImplCopyWithImpl<$Res>; + @override @useResult $Res call({String name, String unit, String portion}); } /// @nodoc -class __$$IngredientImplCopyWithImpl<$Res> - extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> - implements _$$IngredientImplCopyWith<$Res> { - __$$IngredientImplCopyWithImpl( - _$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) - : super(_value, _then); +class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> implements _$$IngredientImplCopyWith<$Res> { + __$$IngredientImplCopyWithImpl(_$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) : super(_value, _then); /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @@ -127,11 +121,9 @@ class __$$IngredientImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$IngredientImpl implements _Ingredient { - const _$IngredientImpl( - {required this.name, required this.unit, required this.portion}); + const _$IngredientImpl({required this.name, required this.unit, required this.portion}); - factory _$IngredientImpl.fromJson(Map json) => - _$$IngredientImplFromJson(json); + factory _$IngredientImpl.fromJson(Map json) => _$$IngredientImplFromJson(json); @override final String name; @@ -164,8 +156,7 @@ class _$IngredientImpl implements _Ingredient { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => - __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); @override Map toJson() { @@ -176,18 +167,16 @@ class _$IngredientImpl implements _Ingredient { } abstract class _Ingredient implements Ingredient { - const factory _Ingredient( - {required final String name, - required final String unit, - required final String portion}) = _$IngredientImpl; + const factory _Ingredient({required final String name, required final String unit, required final String portion}) = _$IngredientImpl; - factory _Ingredient.fromJson(Map json) = - _$IngredientImpl.fromJson; + factory _Ingredient.fromJson(Map json) = _$IngredientImpl.fromJson; @override String get name; + @override String get unit; + @override String get portion; @@ -195,6 +184,5 @@ abstract class _Ingredient implements Ingredient { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => - throw _privateConstructorUsedError; + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/ingredient.g.dart b/lib/features/recipes/models/ingredient.g.dart index b3f1844d..3d2f63b5 100644 --- a/lib/features/recipes/models/ingredient.g.dart +++ b/lib/features/recipes/models/ingredient.g.dart @@ -6,15 +6,13 @@ part of 'ingredient.dart'; // JsonSerializableGenerator // ************************************************************************** -_$IngredientImpl _$$IngredientImplFromJson(Map json) => - _$IngredientImpl( +_$IngredientImpl _$$IngredientImplFromJson(Map json) => _$IngredientImpl( name: json['name'] as String, unit: json['unit'] as String, portion: json['portion'] as String, ); -Map _$$IngredientImplToJson(_$IngredientImpl instance) => - { +Map _$$IngredientImplToJson(_$IngredientImpl instance) => { 'name': instance.name, 'unit': instance.unit, 'portion': instance.portion, diff --git a/lib/features/recipes/models/recipe_model.freezed.dart b/lib/features/recipes/models/recipe_model.freezed.dart index 691ac1f3..de1cbd2e 100644 --- a/lib/features/recipes/models/recipe_model.freezed.dart +++ b/lib/features/recipes/models/recipe_model.freezed.dart @@ -21,13 +21,21 @@ RecipeModel _$RecipeModelFromJson(Map json) { /// @nodoc mixin _$RecipeModel { List? get ingredients => throw _privateConstructorUsedError; + List? get steps => throw _privateConstructorUsedError; + String? get type => throw _privateConstructorUsedError; + String? get state => throw _privateConstructorUsedError; + String? get title => throw _privateConstructorUsedError; + String? get description => throw _privateConstructorUsedError; + String? get video_url => throw _privateConstructorUsedError; + String? get image => throw _privateConstructorUsedError; + int? get cooking_time => throw _privateConstructorUsedError; /// Serializes this RecipeModel to a JSON map. @@ -36,15 +44,13 @@ mixin _$RecipeModel { /// Create a copy of RecipeModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $RecipeModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeModelCopyWith<$Res> { - factory $RecipeModelCopyWith( - RecipeModel value, $Res Function(RecipeModel) then) = - _$RecipeModelCopyWithImpl<$Res, RecipeModel>; + factory $RecipeModelCopyWith(RecipeModel value, $Res Function(RecipeModel) then) = _$RecipeModelCopyWithImpl<$Res, RecipeModel>; + @useResult $Res call( {List? ingredients, @@ -59,12 +65,12 @@ abstract class $RecipeModelCopyWith<$Res> { } /// @nodoc -class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> - implements $RecipeModelCopyWith<$Res> { +class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> implements $RecipeModelCopyWith<$Res> { _$RecipeModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -125,11 +131,9 @@ class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> } /// @nodoc -abstract class _$$RecipeModelImplCopyWith<$Res> - implements $RecipeModelCopyWith<$Res> { - factory _$$RecipeModelImplCopyWith( - _$RecipeModelImpl value, $Res Function(_$RecipeModelImpl) then) = - __$$RecipeModelImplCopyWithImpl<$Res>; +abstract class _$$RecipeModelImplCopyWith<$Res> implements $RecipeModelCopyWith<$Res> { + factory _$$RecipeModelImplCopyWith(_$RecipeModelImpl value, $Res Function(_$RecipeModelImpl) then) = __$$RecipeModelImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -145,12 +149,8 @@ abstract class _$$RecipeModelImplCopyWith<$Res> } /// @nodoc -class __$$RecipeModelImplCopyWithImpl<$Res> - extends _$RecipeModelCopyWithImpl<$Res, _$RecipeModelImpl> - implements _$$RecipeModelImplCopyWith<$Res> { - __$$RecipeModelImplCopyWithImpl( - _$RecipeModelImpl _value, $Res Function(_$RecipeModelImpl) _then) - : super(_value, _then); +class __$$RecipeModelImplCopyWithImpl<$Res> extends _$RecipeModelCopyWithImpl<$Res, _$RecipeModelImpl> implements _$$RecipeModelImplCopyWith<$Res> { + __$$RecipeModelImplCopyWithImpl(_$RecipeModelImpl _value, $Res Function(_$RecipeModelImpl) _then) : super(_value, _then); /// Create a copy of RecipeModel /// with the given fields replaced by the non-null parameter values. @@ -224,10 +224,10 @@ class _$RecipeModelImpl implements _RecipeModel { : _ingredients = ingredients, _steps = steps; - factory _$RecipeModelImpl.fromJson(Map json) => - _$$RecipeModelImplFromJson(json); + factory _$RecipeModelImpl.fromJson(Map json) => _$$RecipeModelImplFromJson(json); final List? _ingredients; + @override List? get ingredients { final value = _ingredients; @@ -238,6 +238,7 @@ class _$RecipeModelImpl implements _RecipeModel { } final List? _steps; + @override List? get steps { final value = _steps; @@ -272,42 +273,28 @@ class _$RecipeModelImpl implements _RecipeModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeModelImpl && - const DeepCollectionEquality() - .equals(other._ingredients, _ingredients) && + const DeepCollectionEquality().equals(other._ingredients, _ingredients) && const DeepCollectionEquality().equals(other._steps, _steps) && (identical(other.type, type) || other.type == type) && (identical(other.state, state) || other.state == state) && (identical(other.title, title) || other.title == title) && - (identical(other.description, description) || - other.description == description) && - (identical(other.video_url, video_url) || - other.video_url == video_url) && + (identical(other.description, description) || other.description == description) && + (identical(other.video_url, video_url) || other.video_url == video_url) && (identical(other.image, image) || other.image == image) && - (identical(other.cooking_time, cooking_time) || - other.cooking_time == cooking_time)); + (identical(other.cooking_time, cooking_time) || other.cooking_time == cooking_time)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_ingredients), - const DeepCollectionEquality().hash(_steps), - type, - state, - title, - description, - video_url, - image, - cooking_time); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_ingredients), const DeepCollectionEquality().hash(_steps), type, state, + title, description, video_url, image, cooking_time); /// Create a copy of RecipeModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => - __$$RecipeModelImplCopyWithImpl<_$RecipeModelImpl>(this, _$identity); + _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => __$$RecipeModelImplCopyWithImpl<_$RecipeModelImpl>(this, _$identity); @override Map toJson() { @@ -329,25 +316,32 @@ abstract class _RecipeModel implements RecipeModel { final String? image, final int? cooking_time}) = _$RecipeModelImpl; - factory _RecipeModel.fromJson(Map json) = - _$RecipeModelImpl.fromJson; + factory _RecipeModel.fromJson(Map json) = _$RecipeModelImpl.fromJson; @override List? get ingredients; + @override List? get steps; + @override String? get type; + @override String? get state; + @override String? get title; + @override String? get description; + @override String? get video_url; + @override String? get image; + @override int? get cooking_time; @@ -355,6 +349,5 @@ abstract class _RecipeModel implements RecipeModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/recipe_model.g.dart b/lib/features/recipes/models/recipe_model.g.dart index d5ab9c96..ac7c7c2d 100644 --- a/lib/features/recipes/models/recipe_model.g.dart +++ b/lib/features/recipes/models/recipe_model.g.dart @@ -6,16 +6,9 @@ part of 'recipe_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipeModelImpl _$$RecipeModelImplFromJson(Map json) => - _$RecipeModelImpl( - ingredients: (json['ingredients'] as List?) - ?.map((e) => - e == null ? null : Ingredient.fromJson(e as Map)) - .toList(), - steps: (json['steps'] as List?) - ?.map((e) => - e == null ? null : Step.fromJson(e as Map)) - .toList(), +_$RecipeModelImpl _$$RecipeModelImplFromJson(Map json) => _$RecipeModelImpl( + ingredients: (json['ingredients'] as List?)?.map((e) => e == null ? null : Ingredient.fromJson(e as Map)).toList(), + steps: (json['steps'] as List?)?.map((e) => e == null ? null : Step.fromJson(e as Map)).toList(), type: json['type'] as String?, state: json['state'] as String?, title: json['title'] as String?, @@ -25,8 +18,7 @@ _$RecipeModelImpl _$$RecipeModelImplFromJson(Map json) => cooking_time: (json['cooking_time'] as num?)?.toInt(), ); -Map _$$RecipeModelImplToJson(_$RecipeModelImpl instance) => - { +Map _$$RecipeModelImplToJson(_$RecipeModelImpl instance) => { 'ingredients': instance.ingredients, 'steps': instance.steps, 'type': instance.type, diff --git a/lib/features/recipes/models/recipe_tag_model.dart b/lib/features/recipes/models/recipe_tag_model.dart index 004f4f29..11850791 100644 --- a/lib/features/recipes/models/recipe_tag_model.dart +++ b/lib/features/recipes/models/recipe_tag_model.dart @@ -1,7 +1,8 @@ -import 'package:eatvio_app/core/models/base_models.dart'; +import 'package:eatvio_app/core/models/pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'recipe_tag_model.freezed.dart'; + part 'recipe_tag_model.g.dart'; @freezed diff --git a/lib/features/recipes/models/recipe_tag_model.freezed.dart b/lib/features/recipes/models/recipe_tag_model.freezed.dart index d9993da3..cfeff53c 100644 --- a/lib/features/recipes/models/recipe_tag_model.freezed.dart +++ b/lib/features/recipes/models/recipe_tag_model.freezed.dart @@ -22,8 +22,10 @@ RecipeTagModel _$RecipeTagModelFromJson(Map json) { mixin _$RecipeTagModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; + @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; + @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -33,32 +35,28 @@ mixin _$RecipeTagModel { /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeTagModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $RecipeTagModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeTagModelCopyWith<$Res> { - factory $RecipeTagModelCopyWith( - RecipeTagModel value, $Res Function(RecipeTagModel) then) = - _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>; + factory $RecipeTagModelCopyWith(RecipeTagModel value, $Res Function(RecipeTagModel) then) = _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>; + @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; + $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> - implements $RecipeTagModelCopyWith<$Res> { +class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> implements $RecipeTagModelCopyWith<$Res> { _$RecipeTagModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -109,31 +107,23 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> } /// @nodoc -abstract class _$$RecipeTagModelImplCopyWith<$Res> - implements $RecipeTagModelCopyWith<$Res> { - factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value, - $Res Function(_$RecipeTagModelImpl) then) = - __$$RecipeTagModelImplCopyWithImpl<$Res>; +abstract class _$$RecipeTagModelImplCopyWith<$Res> implements $RecipeTagModelCopyWith<$Res> { + factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value, $Res Function(_$RecipeTagModelImpl) then) = __$$RecipeTagModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; + @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$RecipeTagModelImplCopyWithImpl<$Res> - extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl> - implements _$$RecipeTagModelImplCopyWith<$Res> { - __$$RecipeTagModelImplCopyWithImpl( - _$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) - : super(_value, _then); +class __$$RecipeTagModelImplCopyWithImpl<$Res> extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl> implements _$$RecipeTagModelImplCopyWith<$Res> { + __$$RecipeTagModelImplCopyWithImpl(_$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) : super(_value, _then); /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @@ -165,15 +155,13 @@ class __$$RecipeTagModelImplCopyWithImpl<$Res> @JsonSerializable() class _$RecipeTagModelImpl implements _RecipeTagModel { const _$RecipeTagModelImpl( - {@JsonKey(name: "data") required final List data, - @JsonKey(name: "links") required this.links, - @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$RecipeTagModelImpl.fromJson(Map json) => - _$$RecipeTagModelImplFromJson(json); + factory _$RecipeTagModelImpl.fromJson(Map json) => _$$RecipeTagModelImplFromJson(json); final List _data; + @override @JsonKey(name: "data") List get data { @@ -206,17 +194,14 @@ class _$RecipeTagModelImpl implements _RecipeTagModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => - __$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>( - this, _$identity); + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => __$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>(this, _$identity); @override Map toJson() { @@ -232,15 +217,16 @@ abstract class _RecipeTagModel implements RecipeTagModel { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$RecipeTagModelImpl; - factory _RecipeTagModel.fromJson(Map json) = - _$RecipeTagModelImpl.fromJson; + factory _RecipeTagModel.fromJson(Map json) = _$RecipeTagModelImpl.fromJson; @override @JsonKey(name: "data") List get data; + @override @JsonKey(name: "links") Links get links; + @override @JsonKey(name: "meta") Meta get meta; @@ -249,8 +235,7 @@ abstract class _RecipeTagModel implements RecipeTagModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => throw _privateConstructorUsedError; } RecipeTag _$RecipeTagFromJson(Map json) { @@ -261,12 +246,16 @@ RecipeTag _$RecipeTagFromJson(Map json) { mixin _$RecipeTag { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; + @JsonKey(name: "recipes_count") int get recipesCount => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; @@ -276,14 +265,13 @@ mixin _$RecipeTag { /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeTagCopyWith get copyWith => - throw _privateConstructorUsedError; + $RecipeTagCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeTagCopyWith<$Res> { - factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) = - _$RecipeTagCopyWithImpl<$Res, RecipeTag>; + factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) = _$RecipeTagCopyWithImpl<$Res, RecipeTag>; + @useResult $Res call( {@JsonKey(name: "id") int id, @@ -294,12 +282,12 @@ abstract class $RecipeTagCopyWith<$Res> { } /// @nodoc -class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> - implements $RecipeTagCopyWith<$Res> { +class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> implements $RecipeTagCopyWith<$Res> { _$RecipeTagCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -340,11 +328,9 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> } /// @nodoc -abstract class _$$RecipeTagImplCopyWith<$Res> - implements $RecipeTagCopyWith<$Res> { - factory _$$RecipeTagImplCopyWith( - _$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) = - __$$RecipeTagImplCopyWithImpl<$Res>; +abstract class _$$RecipeTagImplCopyWith<$Res> implements $RecipeTagCopyWith<$Res> { + factory _$$RecipeTagImplCopyWith(_$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) = __$$RecipeTagImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -356,12 +342,8 @@ abstract class _$$RecipeTagImplCopyWith<$Res> } /// @nodoc -class __$$RecipeTagImplCopyWithImpl<$Res> - extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl> - implements _$$RecipeTagImplCopyWith<$Res> { - __$$RecipeTagImplCopyWithImpl( - _$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) - : super(_value, _then); +class __$$RecipeTagImplCopyWithImpl<$Res> extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl> implements _$$RecipeTagImplCopyWith<$Res> { + __$$RecipeTagImplCopyWithImpl(_$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) : super(_value, _then); /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @@ -409,8 +391,7 @@ class _$RecipeTagImpl implements _RecipeTag { @JsonKey(name: "created_at") required this.createdAt, @JsonKey(name: "updated_at") required this.updatedAt}); - factory _$RecipeTagImpl.fromJson(Map json) => - _$$RecipeTagImplFromJson(json); + factory _$RecipeTagImpl.fromJson(Map json) => _$$RecipeTagImplFromJson(json); @override @JsonKey(name: "id") @@ -440,26 +421,21 @@ class _$RecipeTagImpl implements _RecipeTag { other is _$RecipeTagImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.recipesCount, recipesCount) || - other.recipesCount == recipesCount) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); + (identical(other.recipesCount, recipesCount) || other.recipesCount == recipesCount) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); + int get hashCode => Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => - __$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity); + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => __$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity); @override Map toJson() { @@ -471,28 +447,30 @@ class _$RecipeTagImpl implements _RecipeTag { abstract class _RecipeTag implements RecipeTag { const factory _RecipeTag( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "recipes_count") required final int recipesCount, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") required final DateTime updatedAt}) = - _$RecipeTagImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "recipes_count") required final int recipesCount, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$RecipeTagImpl; - factory _RecipeTag.fromJson(Map json) = - _$RecipeTagImpl.fromJson; + factory _RecipeTag.fromJson(Map json) = _$RecipeTagImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "name") String get name; + @override @JsonKey(name: "recipes_count") int get recipesCount; + @override @JsonKey(name: "created_at") DateTime get createdAt; + @override @JsonKey(name: "updated_at") DateTime get updatedAt; @@ -501,6 +479,5 @@ abstract class _RecipeTag implements RecipeTag { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/recipe_tag_model.g.dart b/lib/features/recipes/models/recipe_tag_model.g.dart index cd387547..9a6ea20f 100644 --- a/lib/features/recipes/models/recipe_tag_model.g.dart +++ b/lib/features/recipes/models/recipe_tag_model.g.dart @@ -6,25 +6,19 @@ part of 'recipe_tag_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map json) => - _$RecipeTagModelImpl( - data: (json['data'] as List) - .map((e) => RecipeTag.fromJson(e as Map)) - .toList(), +_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map json) => _$RecipeTagModelImpl( + data: (json['data'] as List).map((e) => RecipeTag.fromJson(e as Map)).toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$RecipeTagModelImplToJson( - _$RecipeTagModelImpl instance) => - { +Map _$$RecipeTagModelImplToJson(_$RecipeTagModelImpl instance) => { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => - _$RecipeTagImpl( +_$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => _$RecipeTagImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, recipesCount: (json['recipes_count'] as num).toInt(), @@ -32,8 +26,7 @@ _$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => updatedAt: DateTime.parse(json['updated_at'] as String), ); -Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => - { +Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => { 'id': instance.id, 'name': instance.name, 'recipes_count': instance.recipesCount, diff --git a/lib/features/recipes/models/step.dart b/lib/features/recipes/models/step.dart index 9c22eb76..410e397e 100644 --- a/lib/features/recipes/models/step.dart +++ b/lib/features/recipes/models/step.dart @@ -1,7 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'step.freezed.dart'; - part 'step.g.dart'; @freezed diff --git a/lib/features/recipes/models/step.freezed.dart b/lib/features/recipes/models/step.freezed.dart index 040dd5aa..a0877daa 100644 --- a/lib/features/recipes/models/step.freezed.dart +++ b/lib/features/recipes/models/step.freezed.dart @@ -21,6 +21,7 @@ Step _$StepFromJson(Map json) { /// @nodoc mixin _$Step { String? get image => throw _privateConstructorUsedError; + String? get description => throw _privateConstructorUsedError; /// Serializes this Step to a JSON map. @@ -34,19 +35,19 @@ mixin _$Step { /// @nodoc abstract class $StepCopyWith<$Res> { - factory $StepCopyWith(Step value, $Res Function(Step) then) = - _$StepCopyWithImpl<$Res, Step>; + factory $StepCopyWith(Step value, $Res Function(Step) then) = _$StepCopyWithImpl<$Res, Step>; + @useResult $Res call({String? image, String? description}); } /// @nodoc -class _$StepCopyWithImpl<$Res, $Val extends Step> - implements $StepCopyWith<$Res> { +class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res> { _$StepCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -73,20 +74,16 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> /// @nodoc abstract class _$$StepImplCopyWith<$Res> implements $StepCopyWith<$Res> { - factory _$$StepImplCopyWith( - _$StepImpl value, $Res Function(_$StepImpl) then) = - __$$StepImplCopyWithImpl<$Res>; + factory _$$StepImplCopyWith(_$StepImpl value, $Res Function(_$StepImpl) then) = __$$StepImplCopyWithImpl<$Res>; + @override @useResult $Res call({String? image, String? description}); } /// @nodoc -class __$$StepImplCopyWithImpl<$Res> - extends _$StepCopyWithImpl<$Res, _$StepImpl> - implements _$$StepImplCopyWith<$Res> { - __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) - : super(_value, _then); +class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl> implements _$$StepImplCopyWith<$Res> { + __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) : super(_value, _then); /// Create a copy of Step /// with the given fields replaced by the non-null parameter values. @@ -114,8 +111,7 @@ class __$$StepImplCopyWithImpl<$Res> class _$StepImpl implements _Step { const _$StepImpl({this.image, this.description}); - factory _$StepImpl.fromJson(Map json) => - _$$StepImplFromJson(json); + factory _$StepImpl.fromJson(Map json) => _$$StepImplFromJson(json); @override final String? image; @@ -133,8 +129,7 @@ class _$StepImpl implements _Step { (other.runtimeType == runtimeType && other is _$StepImpl && (identical(other.image, image) || other.image == image) && - (identical(other.description, description) || - other.description == description)); + (identical(other.description, description) || other.description == description)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -146,8 +141,7 @@ class _$StepImpl implements _Step { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$StepImplCopyWith<_$StepImpl> get copyWith => - __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); + _$$StepImplCopyWith<_$StepImpl> get copyWith => __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); @override Map toJson() { @@ -158,13 +152,13 @@ class _$StepImpl implements _Step { } abstract class _Step implements Step { - const factory _Step({final String? image, final String? description}) = - _$StepImpl; + const factory _Step({final String? image, final String? description}) = _$StepImpl; factory _Step.fromJson(Map json) = _$StepImpl.fromJson; @override String? get image; + @override String? get description; @@ -172,6 +166,5 @@ abstract class _Step implements Step { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$StepImplCopyWith<_$StepImpl> get copyWith => - throw _privateConstructorUsedError; + _$$StepImplCopyWith<_$StepImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/step.g.dart b/lib/features/recipes/models/step.g.dart index 31d97f9f..1ead263e 100644 --- a/lib/features/recipes/models/step.g.dart +++ b/lib/features/recipes/models/step.g.dart @@ -11,8 +11,7 @@ _$StepImpl _$$StepImplFromJson(Map json) => _$StepImpl( description: json['description'] as String?, ); -Map _$$StepImplToJson(_$StepImpl instance) => - { +Map _$$StepImplToJson(_$StepImpl instance) => { 'image': instance.image, 'description': instance.description, }; diff --git a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart index e15a1a52..a0f3d59f 100644 --- a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart +++ b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart @@ -45,6 +45,7 @@ mixin _$RecipeCreateState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -133,18 +134,16 @@ mixin _$RecipeCreateState { /// @nodoc abstract class $RecipeCreateStateCopyWith<$Res> { - factory $RecipeCreateStateCopyWith( - RecipeCreateState value, $Res Function(RecipeCreateState) then) = - _$RecipeCreateStateCopyWithImpl<$Res, RecipeCreateState>; + factory $RecipeCreateStateCopyWith(RecipeCreateState value, $Res Function(RecipeCreateState) then) = _$RecipeCreateStateCopyWithImpl<$Res, RecipeCreateState>; } /// @nodoc -class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> - implements $RecipeCreateStateCopyWith<$Res> { +class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> implements $RecipeCreateStateCopyWith<$Res> { _$RecipeCreateStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -154,18 +153,14 @@ class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> /// @nodoc abstract class _$$RecipeCreateStateImplCopyWith<$Res> { - factory _$$RecipeCreateStateImplCopyWith(_$RecipeCreateStateImpl value, - $Res Function(_$RecipeCreateStateImpl) then) = + factory _$$RecipeCreateStateImplCopyWith(_$RecipeCreateStateImpl value, $Res Function(_$RecipeCreateStateImpl) then) = __$$RecipeCreateStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipeCreateStateImplCopyWithImpl<$Res> - extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateImpl> +class __$$RecipeCreateStateImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateImpl> implements _$$RecipeCreateStateImplCopyWith<$Res> { - __$$RecipeCreateStateImplCopyWithImpl(_$RecipeCreateStateImpl _value, - $Res Function(_$RecipeCreateStateImpl) _then) - : super(_value, _then); + __$$RecipeCreateStateImplCopyWithImpl(_$RecipeCreateStateImpl _value, $Res Function(_$RecipeCreateStateImpl) _then) : super(_value, _then); /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @@ -183,8 +178,7 @@ class _$RecipeCreateStateImpl implements _RecipeCreateState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$RecipeCreateStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeCreateStateImpl); } @override @@ -334,20 +328,14 @@ abstract class _RecipeCreateState implements RecipeCreateState { /// @nodoc abstract class _$$RecipeCreateStateLoadingImplCopyWith<$Res> { - factory _$$RecipeCreateStateLoadingImplCopyWith( - _$RecipeCreateStateLoadingImpl value, - $Res Function(_$RecipeCreateStateLoadingImpl) then) = + factory _$$RecipeCreateStateLoadingImplCopyWith(_$RecipeCreateStateLoadingImpl value, $Res Function(_$RecipeCreateStateLoadingImpl) then) = __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res> - extends _$RecipeCreateStateCopyWithImpl<$Res, - _$RecipeCreateStateLoadingImpl> +class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadingImpl> implements _$$RecipeCreateStateLoadingImplCopyWith<$Res> { - __$$RecipeCreateStateLoadingImplCopyWithImpl( - _$RecipeCreateStateLoadingImpl _value, - $Res Function(_$RecipeCreateStateLoadingImpl) _then) + __$$RecipeCreateStateLoadingImplCopyWithImpl(_$RecipeCreateStateLoadingImpl _value, $Res Function(_$RecipeCreateStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of RecipeCreateState @@ -366,9 +354,7 @@ class _$RecipeCreateStateLoadingImpl implements RecipeCreateStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$RecipeCreateStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeCreateStateLoadingImpl); } @override @@ -518,10 +504,9 @@ abstract class RecipeCreateStateLoading implements RecipeCreateState { /// @nodoc abstract class _$$RecipeCreateStateLoadedImplCopyWith<$Res> { - factory _$$RecipeCreateStateLoadedImplCopyWith( - _$RecipeCreateStateLoadedImpl value, - $Res Function(_$RecipeCreateStateLoadedImpl) then) = + factory _$$RecipeCreateStateLoadedImplCopyWith(_$RecipeCreateStateLoadedImpl value, $Res Function(_$RecipeCreateStateLoadedImpl) then) = __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call( {RecipeModel? recipe, @@ -546,19 +531,18 @@ abstract class _$$RecipeCreateStateLoadedImplCopyWith<$Res> { SelectionPopupModel selectedStatus}); $RecipeModelCopyWith<$Res>? get recipe; + $SelectionPopupModelCopyWith<$Res> get selectedType; + $SelectionPopupModelCopyWith<$Res> get selectedCookingTime; + $SelectionPopupModelCopyWith<$Res> get selectedStatus; } /// @nodoc -class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> - extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadedImpl> +class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadedImpl> implements _$$RecipeCreateStateLoadedImplCopyWith<$Res> { - __$$RecipeCreateStateLoadedImplCopyWithImpl( - _$RecipeCreateStateLoadedImpl _value, - $Res Function(_$RecipeCreateStateLoadedImpl) _then) - : super(_value, _then); + __$$RecipeCreateStateLoadedImplCopyWithImpl(_$RecipeCreateStateLoadedImpl _value, $Res Function(_$RecipeCreateStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @@ -699,8 +683,7 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get selectedCookingTime { - return $SelectionPopupModelCopyWith<$Res>(_value.selectedCookingTime, - (value) { + return $SelectionPopupModelCopyWith<$Res>(_value.selectedCookingTime, (value) { return _then(_value.copyWith(selectedCookingTime: value)); }); } @@ -763,6 +746,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final TextEditingController youtubeLinkController; final List _stepControllers; + @override List get stepControllers { if (_stepControllers is EqualUnmodifiableListView) return _stepControllers; @@ -773,6 +757,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final XFile? recipeImage; final List _stepImages; + @override List get stepImages { if (_stepImages is EqualUnmodifiableListView) return _stepImages; @@ -781,6 +766,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _ingredients; + @override List get ingredients { if (_ingredients is EqualUnmodifiableListView) return _ingredients; @@ -789,10 +775,10 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _autocompleteList; + @override List get autocompleteList { - if (_autocompleteList is EqualUnmodifiableListView) - return _autocompleteList; + if (_autocompleteList is EqualUnmodifiableListView) return _autocompleteList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_autocompleteList); } @@ -802,6 +788,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final bool ingredientAsItems; final List _types; + @override List get types { if (_types is EqualUnmodifiableListView) return _types; @@ -810,6 +797,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _cookingTimes; + @override List get cookingTimes { if (_cookingTimes is EqualUnmodifiableListView) return _cookingTimes; @@ -818,6 +806,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _statuses; + @override List get statuses { if (_statuses is EqualUnmodifiableListView) return _statuses; @@ -844,41 +833,24 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { other is _$RecipeCreateStateLoadedImpl && (identical(other.recipe, recipe) || other.recipe == recipe) && (identical(other.picker, picker) || other.picker == picker) && - (identical(other.titleController, titleController) || - other.titleController == titleController) && - (identical(other.productNameController, productNameController) || - other.productNameController == productNameController) && - (identical(other.ingredientController, ingredientController) || - other.ingredientController == ingredientController) && - (identical(other.stepDescriptionController, - stepDescriptionController) || - other.stepDescriptionController == stepDescriptionController) && - (identical(other.youtubeLinkController, youtubeLinkController) || - other.youtubeLinkController == youtubeLinkController) && - const DeepCollectionEquality() - .equals(other._stepControllers, _stepControllers) && - (identical(other.recipeImage, recipeImage) || - other.recipeImage == recipeImage) && - const DeepCollectionEquality() - .equals(other._stepImages, _stepImages) && - const DeepCollectionEquality() - .equals(other._ingredients, _ingredients) && - const DeepCollectionEquality() - .equals(other._autocompleteList, _autocompleteList) && - (identical(other.numberOfSteps, numberOfSteps) || - other.numberOfSteps == numberOfSteps) && - (identical(other.ingredientAsItems, ingredientAsItems) || - other.ingredientAsItems == ingredientAsItems) && + (identical(other.titleController, titleController) || other.titleController == titleController) && + (identical(other.productNameController, productNameController) || other.productNameController == productNameController) && + (identical(other.ingredientController, ingredientController) || other.ingredientController == ingredientController) && + (identical(other.stepDescriptionController, stepDescriptionController) || other.stepDescriptionController == stepDescriptionController) && + (identical(other.youtubeLinkController, youtubeLinkController) || other.youtubeLinkController == youtubeLinkController) && + const DeepCollectionEquality().equals(other._stepControllers, _stepControllers) && + (identical(other.recipeImage, recipeImage) || other.recipeImage == recipeImage) && + const DeepCollectionEquality().equals(other._stepImages, _stepImages) && + const DeepCollectionEquality().equals(other._ingredients, _ingredients) && + const DeepCollectionEquality().equals(other._autocompleteList, _autocompleteList) && + (identical(other.numberOfSteps, numberOfSteps) || other.numberOfSteps == numberOfSteps) && + (identical(other.ingredientAsItems, ingredientAsItems) || other.ingredientAsItems == ingredientAsItems) && const DeepCollectionEquality().equals(other._types, _types) && - const DeepCollectionEquality() - .equals(other._cookingTimes, _cookingTimes) && + const DeepCollectionEquality().equals(other._cookingTimes, _cookingTimes) && const DeepCollectionEquality().equals(other._statuses, _statuses) && - (identical(other.selectedType, selectedType) || - other.selectedType == selectedType) && - (identical(other.selectedCookingTime, selectedCookingTime) || - other.selectedCookingTime == selectedCookingTime) && - (identical(other.selectedStatus, selectedStatus) || - other.selectedStatus == selectedStatus)); + (identical(other.selectedType, selectedType) || other.selectedType == selectedType) && + (identical(other.selectedCookingTime, selectedCookingTime) || other.selectedCookingTime == selectedCookingTime) && + (identical(other.selectedStatus, selectedStatus) || other.selectedStatus == selectedStatus)); } @override @@ -911,9 +883,8 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> - get copyWith => __$$RecipeCreateStateLoadedImplCopyWithImpl< - _$RecipeCreateStateLoadedImpl>(this, _$identity); + _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> get copyWith => + __$$RecipeCreateStateLoadedImplCopyWithImpl<_$RecipeCreateStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -1115,74 +1086,86 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { abstract class RecipeCreateStateLoaded implements RecipeCreateState { const factory RecipeCreateStateLoaded( - {final RecipeModel? recipe, - required final ImagePicker picker, - required final TextEditingController titleController, - required final TextEditingController productNameController, - required final TextEditingController ingredientController, - required final TextEditingController stepDescriptionController, - required final TextEditingController youtubeLinkController, - required final List stepControllers, - final XFile? recipeImage, - required final List stepImages, - required final List ingredients, - required final List autocompleteList, - required final int numberOfSteps, - required final bool ingredientAsItems, - required final List types, - required final List cookingTimes, - required final List statuses, - required final SelectionPopupModel selectedType, - required final SelectionPopupModel selectedCookingTime, - required final SelectionPopupModel selectedStatus}) = - _$RecipeCreateStateLoadedImpl; + {final RecipeModel? recipe, + required final ImagePicker picker, + required final TextEditingController titleController, + required final TextEditingController productNameController, + required final TextEditingController ingredientController, + required final TextEditingController stepDescriptionController, + required final TextEditingController youtubeLinkController, + required final List stepControllers, + final XFile? recipeImage, + required final List stepImages, + required final List ingredients, + required final List autocompleteList, + required final int numberOfSteps, + required final bool ingredientAsItems, + required final List types, + required final List cookingTimes, + required final List statuses, + required final SelectionPopupModel selectedType, + required final SelectionPopupModel selectedCookingTime, + required final SelectionPopupModel selectedStatus}) = _$RecipeCreateStateLoadedImpl; RecipeModel? get recipe; + ImagePicker get picker; + TextEditingController get titleController; + TextEditingController get productNameController; + TextEditingController get ingredientController; + TextEditingController get stepDescriptionController; + TextEditingController get youtubeLinkController; + List get stepControllers; + XFile? get recipeImage; + List get stepImages; + List get ingredients; + List get autocompleteList; + int get numberOfSteps; + bool get ingredientAsItems; + List get types; + List get cookingTimes; + List get statuses; + SelectionPopupModel get selectedType; + SelectionPopupModel get selectedCookingTime; + SelectionPopupModel get selectedStatus; /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> - get copyWith => throw _privateConstructorUsedError; + _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$RecipeCreateStateErrorImplCopyWith<$Res> { - factory _$$RecipeCreateStateErrorImplCopyWith( - _$RecipeCreateStateErrorImpl value, - $Res Function(_$RecipeCreateStateErrorImpl) then) = + factory _$$RecipeCreateStateErrorImplCopyWith(_$RecipeCreateStateErrorImpl value, $Res Function(_$RecipeCreateStateErrorImpl) then) = __$$RecipeCreateStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$RecipeCreateStateErrorImplCopyWithImpl<$Res> - extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateErrorImpl> +class __$$RecipeCreateStateErrorImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateErrorImpl> implements _$$RecipeCreateStateErrorImplCopyWith<$Res> { - __$$RecipeCreateStateErrorImplCopyWithImpl( - _$RecipeCreateStateErrorImpl _value, - $Res Function(_$RecipeCreateStateErrorImpl) _then) - : super(_value, _then); + __$$RecipeCreateStateErrorImplCopyWithImpl(_$RecipeCreateStateErrorImpl _value, $Res Function(_$RecipeCreateStateErrorImpl) _then) : super(_value, _then); /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @@ -1218,8 +1201,7 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeCreateStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -1230,9 +1212,8 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> - get copyWith => __$$RecipeCreateStateErrorImplCopyWithImpl< - _$RecipeCreateStateErrorImpl>(this, _$identity); + _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> get copyWith => + __$$RecipeCreateStateErrorImplCopyWithImpl<_$RecipeCreateStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -1373,14 +1354,12 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { } abstract class RecipeCreateStateError implements RecipeCreateState { - const factory RecipeCreateStateError({required final String errorMessage}) = - _$RecipeCreateStateErrorImpl; + const factory RecipeCreateStateError({required final String errorMessage}) = _$RecipeCreateStateErrorImpl; String get errorMessage; /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart index 28387374..5bae7dba 100644 --- a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart @@ -19,10 +19,12 @@ import 'package:image_picker/image_picker.dart'; // ignore: must_be_immutable class RecipeEditScreen extends StatelessWidget { final String recipeID; + const RecipeEditScreen({ required this.recipeID, super.key, }); + Widget build(BuildContext context) { if (recipeID != "0") { context.read().loadRecipeById(recipeID); diff --git a/lib/features/recipes/services/recipe_service.g.dart b/lib/features/recipes/services/recipe_service.g.dart index c32c9e8a..65636a26 100644 --- a/lib/features/recipes/services/recipe_service.g.dart +++ b/lib/features/recipes/services/recipe_service.g.dart @@ -79,11 +79,7 @@ class _RecipeService implements RecipeService { final _result = await _dio.fetch>(_options); late Map> _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry( - k, - (v as List) - .map((i) => Product.fromJson(i as Map)) - .toList())); + _value = _result.data!.map((k, dynamic v) => MapEntry(k, (v as List).map((i) => Product.fromJson(i as Map)).toList())); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -254,9 +250,7 @@ class _RecipeService implements RecipeService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/registration/models/location_model.dart b/lib/features/registration/models/location_model.dart index 01dbe06f..c669bdfd 100644 --- a/lib/features/registration/models/location_model.dart +++ b/lib/features/registration/models/location_model.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'location_model.freezed.dart'; + part 'location_model.g.dart'; @freezed diff --git a/lib/features/registration/models/location_model.freezed.dart b/lib/features/registration/models/location_model.freezed.dart index 95f81d60..052bc27b 100644 --- a/lib/features/registration/models/location_model.freezed.dart +++ b/lib/features/registration/models/location_model.freezed.dart @@ -21,6 +21,7 @@ LocationModel _$LocationModelFromJson(Map json) { /// @nodoc mixin _$LocationModel { List get locations => throw _privateConstructorUsedError; + @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; @@ -30,28 +31,24 @@ mixin _$LocationModel { /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $LocationModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $LocationModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $LocationModelCopyWith<$Res> { - factory $LocationModelCopyWith( - LocationModel value, $Res Function(LocationModel) then) = - _$LocationModelCopyWithImpl<$Res, LocationModel>; + factory $LocationModelCopyWith(LocationModel value, $Res Function(LocationModel) then) = _$LocationModelCopyWithImpl<$Res, LocationModel>; + @useResult - $Res call( - {List locations, - @JsonKey(name: 'response_body') String responseBody}); + $Res call({List locations, @JsonKey(name: 'response_body') String responseBody}); } /// @nodoc -class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> - implements $LocationModelCopyWith<$Res> { +class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> implements $LocationModelCopyWith<$Res> { _$LocationModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -77,25 +74,17 @@ class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> } /// @nodoc -abstract class _$$LocationModelImplCopyWith<$Res> - implements $LocationModelCopyWith<$Res> { - factory _$$LocationModelImplCopyWith( - _$LocationModelImpl value, $Res Function(_$LocationModelImpl) then) = - __$$LocationModelImplCopyWithImpl<$Res>; +abstract class _$$LocationModelImplCopyWith<$Res> implements $LocationModelCopyWith<$Res> { + factory _$$LocationModelImplCopyWith(_$LocationModelImpl value, $Res Function(_$LocationModelImpl) then) = __$$LocationModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {List locations, - @JsonKey(name: 'response_body') String responseBody}); + $Res call({List locations, @JsonKey(name: 'response_body') String responseBody}); } /// @nodoc -class __$$LocationModelImplCopyWithImpl<$Res> - extends _$LocationModelCopyWithImpl<$Res, _$LocationModelImpl> - implements _$$LocationModelImplCopyWith<$Res> { - __$$LocationModelImplCopyWithImpl( - _$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) - : super(_value, _then); +class __$$LocationModelImplCopyWithImpl<$Res> extends _$LocationModelCopyWithImpl<$Res, _$LocationModelImpl> implements _$$LocationModelImplCopyWith<$Res> { + __$$LocationModelImplCopyWithImpl(_$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) : super(_value, _then); /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @@ -121,15 +110,12 @@ class __$$LocationModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$LocationModelImpl implements _LocationModel { - const _$LocationModelImpl( - {required final List locations, - @JsonKey(name: 'response_body') required this.responseBody}) - : _locations = locations; + const _$LocationModelImpl({required final List locations, @JsonKey(name: 'response_body') required this.responseBody}) : _locations = locations; - factory _$LocationModelImpl.fromJson(Map json) => - _$$LocationModelImplFromJson(json); + factory _$LocationModelImpl.fromJson(Map json) => _$$LocationModelImplFromJson(json); final List _locations; + @override List get locations { if (_locations is EqualUnmodifiableListView) return _locations; @@ -151,24 +137,20 @@ class _$LocationModelImpl implements _LocationModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$LocationModelImpl && - const DeepCollectionEquality() - .equals(other._locations, _locations) && - (identical(other.responseBody, responseBody) || - other.responseBody == responseBody)); + const DeepCollectionEquality().equals(other._locations, _locations) && + (identical(other.responseBody, responseBody) || other.responseBody == responseBody)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, - const DeepCollectionEquality().hash(_locations), responseBody); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_locations), responseBody); /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => - __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); + _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); @override Map toJson() { @@ -179,16 +161,14 @@ class _$LocationModelImpl implements _LocationModel { } abstract class _LocationModel implements LocationModel { - const factory _LocationModel( - {required final List locations, - @JsonKey(name: 'response_body') required final String responseBody}) = + const factory _LocationModel({required final List locations, @JsonKey(name: 'response_body') required final String responseBody}) = _$LocationModelImpl; - factory _LocationModel.fromJson(Map json) = - _$LocationModelImpl.fromJson; + factory _LocationModel.fromJson(Map json) = _$LocationModelImpl.fromJson; @override List get locations; + @override @JsonKey(name: 'response_body') String get responseBody; @@ -197,6 +177,5 @@ abstract class _LocationModel implements LocationModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/models/location_model.g.dart b/lib/features/registration/models/location_model.g.dart index 449630a4..da69ba9b 100644 --- a/lib/features/registration/models/location_model.g.dart +++ b/lib/features/registration/models/location_model.g.dart @@ -6,15 +6,12 @@ part of 'location_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$LocationModelImpl _$$LocationModelImplFromJson(Map json) => - _$LocationModelImpl( - locations: - (json['locations'] as List).map((e) => e as String).toList(), +_$LocationModelImpl _$$LocationModelImplFromJson(Map json) => _$LocationModelImpl( + locations: (json['locations'] as List).map((e) => e as String).toList(), responseBody: json['response_body'] as String, ); -Map _$$LocationModelImplToJson(_$LocationModelImpl instance) => - { +Map _$$LocationModelImplToJson(_$LocationModelImpl instance) => { 'locations': instance.locations, 'response_body': instance.responseBody, }; diff --git a/lib/data/models/userRegistrationModel/user_registration_model.dart b/lib/features/registration/models/user_registration_model.dart similarity index 99% rename from lib/data/models/userRegistrationModel/user_registration_model.dart rename to lib/features/registration/models/user_registration_model.dart index 419ee5c7..64b9c9e5 100644 --- a/lib/data/models/userRegistrationModel/user_registration_model.dart +++ b/lib/features/registration/models/user_registration_model.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'user_registration_model.freezed.dart'; + part 'user_registration_model.g.dart'; @freezed diff --git a/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart b/lib/features/registration/models/user_registration_model.freezed.dart similarity index 88% rename from lib/data/models/userRegistrationModel/user_registration_model.freezed.dart rename to lib/features/registration/models/user_registration_model.freezed.dart index fd835a26..ed0044cc 100644 --- a/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart +++ b/lib/features/registration/models/user_registration_model.freezed.dart @@ -3,7 +3,7 @@ // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark -part of 'user_registration_model.dart'; +part of '../../../features/registration/models/user_registration_model.dart'; // ************************************************************************** // FreezedGenerator @@ -14,8 +14,7 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -UserRegistrationSheet _$UserRegistrationSheetFromJson( - Map json) { +UserRegistrationSheet _$UserRegistrationSheetFromJson(Map json) { return _UserRegistrationSheet.fromJson(json); } @@ -23,48 +22,74 @@ UserRegistrationSheet _$UserRegistrationSheetFromJson( mixin _$UserRegistrationSheet { @JsonKey(name: 'first_name') String get firstName => throw _privateConstructorUsedError; + @JsonKey(name: 'last_name') String get lastName => throw _privateConstructorUsedError; + String get email => throw _privateConstructorUsedError; + String get password => throw _privateConstructorUsedError; + @JsonKey(name: 'password_confirmation') String get passwordConfirmation => throw _privateConstructorUsedError; + @JsonKey(name: 'terms') String get termsAccepted => throw _privateConstructorUsedError; + String get birthdate => throw _privateConstructorUsedError; + String get gender => throw _privateConstructorUsedError; + String get location => throw _privateConstructorUsedError; + @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; + String get lang => throw _privateConstructorUsedError; + int get weight => throw _privateConstructorUsedError; + int get height => throw _privateConstructorUsedError; + @JsonKey(name: 'chest_circumference') int get chestCircumference => throw _privateConstructorUsedError; + @JsonKey(name: 'waist_circumference') int get waistCircumference => throw _privateConstructorUsedError; + @JsonKey(name: 'hip_circumference') int get hipCircumference => throw _privateConstructorUsedError; + @JsonKey(name: 'blood_pressure_up') int get bloodPressureUp => throw _privateConstructorUsedError; + @JsonKey(name: 'blood_pressure_down') int get bloodPressureDown => throw _privateConstructorUsedError; + @JsonKey(name: 'has_hypo') int get hasHypo => throw _privateConstructorUsedError; + @JsonKey(name: 'has_hyper') int get hasHyper => throw _privateConstructorUsedError; + @JsonKey(name: 'about_alergy') String get aboutAllergy => throw _privateConstructorUsedError; + @JsonKey(name: 'about_taking_pils') String get aboutTakingPils => throw _privateConstructorUsedError; + @JsonKey(name: 'about_sport_hobbies') String get aboutSportHobbies => throw _privateConstructorUsedError; + @JsonKey(name: 'favorite_foods') String get favoriteFoods => throw _privateConstructorUsedError; + @JsonKey(name: 'unfavorite_foods') String get unfavoriteFoods => throw _privateConstructorUsedError; + @JsonKey(name: 'additional_info') String get additionalInfo => throw _privateConstructorUsedError; + @JsonKey(name: 'activity_coefficient') double get activityCoefficient => throw _privateConstructorUsedError; @@ -74,15 +99,14 @@ mixin _$UserRegistrationSheet { /// Create a copy of UserRegistrationSheet /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $UserRegistrationSheetCopyWith get copyWith => - throw _privateConstructorUsedError; + $UserRegistrationSheetCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $UserRegistrationSheetCopyWith<$Res> { - factory $UserRegistrationSheetCopyWith(UserRegistrationSheet value, - $Res Function(UserRegistrationSheet) then) = + factory $UserRegistrationSheetCopyWith(UserRegistrationSheet value, $Res Function(UserRegistrationSheet) then) = _$UserRegistrationSheetCopyWithImpl<$Res, UserRegistrationSheet>; + @useResult $Res call( {@JsonKey(name: 'first_name') String firstName, @@ -115,13 +139,12 @@ abstract class $UserRegistrationSheetCopyWith<$Res> { } /// @nodoc -class _$UserRegistrationSheetCopyWithImpl<$Res, - $Val extends UserRegistrationSheet> - implements $UserRegistrationSheetCopyWith<$Res> { +class _$UserRegistrationSheetCopyWithImpl<$Res, $Val extends UserRegistrationSheet> implements $UserRegistrationSheetCopyWith<$Res> { _$UserRegistrationSheetCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -272,12 +295,10 @@ class _$UserRegistrationSheetCopyWithImpl<$Res, } /// @nodoc -abstract class _$$UserRegistrationSheetImplCopyWith<$Res> - implements $UserRegistrationSheetCopyWith<$Res> { - factory _$$UserRegistrationSheetImplCopyWith( - _$UserRegistrationSheetImpl value, - $Res Function(_$UserRegistrationSheetImpl) then) = +abstract class _$$UserRegistrationSheetImplCopyWith<$Res> implements $UserRegistrationSheetCopyWith<$Res> { + factory _$$UserRegistrationSheetImplCopyWith(_$UserRegistrationSheetImpl value, $Res Function(_$UserRegistrationSheetImpl) then) = __$$UserRegistrationSheetImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -311,13 +332,9 @@ abstract class _$$UserRegistrationSheetImplCopyWith<$Res> } /// @nodoc -class __$$UserRegistrationSheetImplCopyWithImpl<$Res> - extends _$UserRegistrationSheetCopyWithImpl<$Res, - _$UserRegistrationSheetImpl> +class __$$UserRegistrationSheetImplCopyWithImpl<$Res> extends _$UserRegistrationSheetCopyWithImpl<$Res, _$UserRegistrationSheetImpl> implements _$$UserRegistrationSheetImplCopyWith<$Res> { - __$$UserRegistrationSheetImplCopyWithImpl(_$UserRegistrationSheetImpl _value, - $Res Function(_$UserRegistrationSheetImpl) _then) - : super(_value, _then); + __$$UserRegistrationSheetImplCopyWithImpl(_$UserRegistrationSheetImpl _value, $Res Function(_$UserRegistrationSheetImpl) _then) : super(_value, _then); /// Create a copy of UserRegistrationSheet /// with the given fields replaced by the non-null parameter values. @@ -473,8 +490,7 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(name: 'last_name') required this.lastName, required this.email, required this.password, - @JsonKey(name: 'password_confirmation') - required this.passwordConfirmation, + @JsonKey(name: 'password_confirmation') required this.passwordConfirmation, @JsonKey(name: 'terms') this.termsAccepted = 'accepted', required this.birthdate, required this.gender, @@ -498,8 +514,7 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(name: 'additional_info') required this.additionalInfo, @JsonKey(name: 'activity_coefficient') this.activityCoefficient = 1.2}); - factory _$UserRegistrationSheetImpl.fromJson(Map json) => - _$$UserRegistrationSheetImplFromJson(json); + factory _$UserRegistrationSheetImpl.fromJson(Map json) => _$$UserRegistrationSheetImplFromJson(json); @override @JsonKey(name: 'first_name') @@ -585,54 +600,33 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { return identical(this, other) || (other.runtimeType == runtimeType && other is _$UserRegistrationSheetImpl && - (identical(other.firstName, firstName) || - other.firstName == firstName) && - (identical(other.lastName, lastName) || - other.lastName == lastName) && + (identical(other.firstName, firstName) || other.firstName == firstName) && + (identical(other.lastName, lastName) || other.lastName == lastName) && (identical(other.email, email) || other.email == email) && - (identical(other.password, password) || - other.password == password) && - (identical(other.passwordConfirmation, passwordConfirmation) || - other.passwordConfirmation == passwordConfirmation) && - (identical(other.termsAccepted, termsAccepted) || - other.termsAccepted == termsAccepted) && - (identical(other.birthdate, birthdate) || - other.birthdate == birthdate) && + (identical(other.password, password) || other.password == password) && + (identical(other.passwordConfirmation, passwordConfirmation) || other.passwordConfirmation == passwordConfirmation) && + (identical(other.termsAccepted, termsAccepted) || other.termsAccepted == termsAccepted) && + (identical(other.birthdate, birthdate) || other.birthdate == birthdate) && (identical(other.gender, gender) || other.gender == gender) && - (identical(other.location, location) || - other.location == location) && - (identical(other.responseBody, responseBody) || - other.responseBody == responseBody) && + (identical(other.location, location) || other.location == location) && + (identical(other.responseBody, responseBody) || other.responseBody == responseBody) && (identical(other.lang, lang) || other.lang == lang) && (identical(other.weight, weight) || other.weight == weight) && (identical(other.height, height) || other.height == height) && - (identical(other.chestCircumference, chestCircumference) || - other.chestCircumference == chestCircumference) && - (identical(other.waistCircumference, waistCircumference) || - other.waistCircumference == waistCircumference) && - (identical(other.hipCircumference, hipCircumference) || - other.hipCircumference == hipCircumference) && - (identical(other.bloodPressureUp, bloodPressureUp) || - other.bloodPressureUp == bloodPressureUp) && - (identical(other.bloodPressureDown, bloodPressureDown) || - other.bloodPressureDown == bloodPressureDown) && + (identical(other.chestCircumference, chestCircumference) || other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || other.hipCircumference == hipCircumference) && + (identical(other.bloodPressureUp, bloodPressureUp) || other.bloodPressureUp == bloodPressureUp) && + (identical(other.bloodPressureDown, bloodPressureDown) || other.bloodPressureDown == bloodPressureDown) && (identical(other.hasHypo, hasHypo) || other.hasHypo == hasHypo) && - (identical(other.hasHyper, hasHyper) || - other.hasHyper == hasHyper) && - (identical(other.aboutAllergy, aboutAllergy) || - other.aboutAllergy == aboutAllergy) && - (identical(other.aboutTakingPils, aboutTakingPils) || - other.aboutTakingPils == aboutTakingPils) && - (identical(other.aboutSportHobbies, aboutSportHobbies) || - other.aboutSportHobbies == aboutSportHobbies) && - (identical(other.favoriteFoods, favoriteFoods) || - other.favoriteFoods == favoriteFoods) && - (identical(other.unfavoriteFoods, unfavoriteFoods) || - other.unfavoriteFoods == unfavoriteFoods) && - (identical(other.additionalInfo, additionalInfo) || - other.additionalInfo == additionalInfo) && - (identical(other.activityCoefficient, activityCoefficient) || - other.activityCoefficient == activityCoefficient)); + (identical(other.hasHyper, hasHyper) || other.hasHyper == hasHyper) && + (identical(other.aboutAllergy, aboutAllergy) || other.aboutAllergy == aboutAllergy) && + (identical(other.aboutTakingPils, aboutTakingPils) || other.aboutTakingPils == aboutTakingPils) && + (identical(other.aboutSportHobbies, aboutSportHobbies) || other.aboutSportHobbies == aboutSportHobbies) && + (identical(other.favoriteFoods, favoriteFoods) || other.favoriteFoods == favoriteFoods) && + (identical(other.unfavoriteFoods, unfavoriteFoods) || other.unfavoriteFoods == unfavoriteFoods) && + (identical(other.additionalInfo, additionalInfo) || other.additionalInfo == additionalInfo) && + (identical(other.activityCoefficient, activityCoefficient) || other.activityCoefficient == activityCoefficient)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -673,9 +667,8 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> - get copyWith => __$$UserRegistrationSheetImplCopyWithImpl< - _$UserRegistrationSheetImpl>(this, _$identity); + _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => + __$$UserRegistrationSheetImplCopyWithImpl<_$UserRegistrationSheetImpl>(this, _$identity); @override Map toJson() { @@ -691,8 +684,7 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { @JsonKey(name: 'last_name') required final String lastName, required final String email, required final String password, - @JsonKey(name: 'password_confirmation') - required final String passwordConfirmation, + @JsonKey(name: 'password_confirmation') required final String passwordConfirmation, @JsonKey(name: 'terms') final String termsAccepted, required final String birthdate, required final String gender, @@ -701,99 +693,119 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { required final String lang, required final int weight, required final int height, - @JsonKey(name: 'chest_circumference') - required final int chestCircumference, - @JsonKey(name: 'waist_circumference') - required final int waistCircumference, + @JsonKey(name: 'chest_circumference') required final int chestCircumference, + @JsonKey(name: 'waist_circumference') required final int waistCircumference, @JsonKey(name: 'hip_circumference') required final int hipCircumference, @JsonKey(name: 'blood_pressure_up') required final int bloodPressureUp, - @JsonKey(name: 'blood_pressure_down') - required final int bloodPressureDown, + @JsonKey(name: 'blood_pressure_down') required final int bloodPressureDown, @JsonKey(name: 'has_hypo') required final int hasHypo, @JsonKey(name: 'has_hyper') required final int hasHyper, @JsonKey(name: 'about_alergy') required final String aboutAllergy, @JsonKey(name: 'about_taking_pils') required final String aboutTakingPils, - @JsonKey(name: 'about_sport_hobbies') - required final String aboutSportHobbies, + @JsonKey(name: 'about_sport_hobbies') required final String aboutSportHobbies, @JsonKey(name: 'favorite_foods') required final String favoriteFoods, @JsonKey(name: 'unfavorite_foods') required final String unfavoriteFoods, @JsonKey(name: 'additional_info') required final String additionalInfo, - @JsonKey(name: 'activity_coefficient') - final double activityCoefficient}) = _$UserRegistrationSheetImpl; + @JsonKey(name: 'activity_coefficient') final double activityCoefficient}) = _$UserRegistrationSheetImpl; - factory _UserRegistrationSheet.fromJson(Map json) = - _$UserRegistrationSheetImpl.fromJson; + factory _UserRegistrationSheet.fromJson(Map json) = _$UserRegistrationSheetImpl.fromJson; @override @JsonKey(name: 'first_name') String get firstName; + @override @JsonKey(name: 'last_name') String get lastName; + @override String get email; + @override String get password; + @override @JsonKey(name: 'password_confirmation') String get passwordConfirmation; + @override @JsonKey(name: 'terms') String get termsAccepted; + @override String get birthdate; + @override String get gender; + @override String get location; + @override @JsonKey(name: 'response_body') String get responseBody; + @override String get lang; + @override int get weight; + @override int get height; + @override @JsonKey(name: 'chest_circumference') int get chestCircumference; + @override @JsonKey(name: 'waist_circumference') int get waistCircumference; + @override @JsonKey(name: 'hip_circumference') int get hipCircumference; + @override @JsonKey(name: 'blood_pressure_up') int get bloodPressureUp; + @override @JsonKey(name: 'blood_pressure_down') int get bloodPressureDown; + @override @JsonKey(name: 'has_hypo') int get hasHypo; + @override @JsonKey(name: 'has_hyper') int get hasHyper; + @override @JsonKey(name: 'about_alergy') String get aboutAllergy; + @override @JsonKey(name: 'about_taking_pils') String get aboutTakingPils; + @override @JsonKey(name: 'about_sport_hobbies') String get aboutSportHobbies; + @override @JsonKey(name: 'favorite_foods') String get favoriteFoods; + @override @JsonKey(name: 'unfavorite_foods') String get unfavoriteFoods; + @override @JsonKey(name: 'additional_info') String get additionalInfo; + @override @JsonKey(name: 'activity_coefficient') double get activityCoefficient; @@ -802,6 +814,5 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> - get copyWith => throw _privateConstructorUsedError; + _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/data/models/userRegistrationModel/user_registration_model.g.dart b/lib/features/registration/models/user_registration_model.g.dart similarity index 90% rename from lib/data/models/userRegistrationModel/user_registration_model.g.dart rename to lib/features/registration/models/user_registration_model.g.dart index 9500e915..7690dbb1 100644 --- a/lib/data/models/userRegistrationModel/user_registration_model.g.dart +++ b/lib/features/registration/models/user_registration_model.g.dart @@ -6,9 +6,7 @@ part of 'user_registration_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson( - Map json) => - _$UserRegistrationSheetImpl( +_$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson(Map json) => _$UserRegistrationSheetImpl( firstName: json['first_name'] as String, lastName: json['last_name'] as String, email: json['email'] as String, @@ -35,13 +33,10 @@ _$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson( favoriteFoods: json['favorite_foods'] as String, unfavoriteFoods: json['unfavorite_foods'] as String, additionalInfo: json['additional_info'] as String, - activityCoefficient: - (json['activity_coefficient'] as num?)?.toDouble() ?? 1.2, + activityCoefficient: (json['activity_coefficient'] as num?)?.toDouble() ?? 1.2, ); -Map _$$UserRegistrationSheetImplToJson( - _$UserRegistrationSheetImpl instance) => - { +Map _$$UserRegistrationSheetImplToJson(_$UserRegistrationSheetImpl instance) => { 'first_name': instance.firstName, 'last_name': instance.lastName, 'email': instance.email, diff --git a/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart index e016a36c..89406741 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart @@ -1,7 +1,7 @@ import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_state.dart'; import 'package:eatvio_app/features/registration/repositories/registration_repository.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.dart index d1e20906..37fe0a43 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'registration_state.freezed.dart'; diff --git a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart index ae0a9706..eb722a2b 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart @@ -21,15 +21,13 @@ mixin _$RegistrationState { /// Create a copy of RegistrationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RegistrationStateCopyWith get copyWith => - throw _privateConstructorUsedError; + $RegistrationStateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RegistrationStateCopyWith<$Res> { - factory $RegistrationStateCopyWith( - RegistrationState value, $Res Function(RegistrationState) then) = - _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; + factory $RegistrationStateCopyWith(RegistrationState value, $Res Function(RegistrationState) then) = _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; + @useResult $Res call({UserRegistrationSheet sheet}); @@ -37,12 +35,12 @@ abstract class $RegistrationStateCopyWith<$Res> { } /// @nodoc -class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> - implements $RegistrationStateCopyWith<$Res> { +class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> implements $RegistrationStateCopyWith<$Res> { _$RegistrationStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -73,11 +71,10 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> } /// @nodoc -abstract class _$$RegistrationStateImplCopyWith<$Res> - implements $RegistrationStateCopyWith<$Res> { - factory _$$RegistrationStateImplCopyWith(_$RegistrationStateImpl value, - $Res Function(_$RegistrationStateImpl) then) = +abstract class _$$RegistrationStateImplCopyWith<$Res> implements $RegistrationStateCopyWith<$Res> { + factory _$$RegistrationStateImplCopyWith(_$RegistrationStateImpl value, $Res Function(_$RegistrationStateImpl) then) = __$$RegistrationStateImplCopyWithImpl<$Res>; + @override @useResult $Res call({UserRegistrationSheet sheet}); @@ -87,12 +84,9 @@ abstract class _$$RegistrationStateImplCopyWith<$Res> } /// @nodoc -class __$$RegistrationStateImplCopyWithImpl<$Res> - extends _$RegistrationStateCopyWithImpl<$Res, _$RegistrationStateImpl> +class __$$RegistrationStateImplCopyWithImpl<$Res> extends _$RegistrationStateCopyWithImpl<$Res, _$RegistrationStateImpl> implements _$$RegistrationStateImplCopyWith<$Res> { - __$$RegistrationStateImplCopyWithImpl(_$RegistrationStateImpl _value, - $Res Function(_$RegistrationStateImpl) _then) - : super(_value, _then); + __$$RegistrationStateImplCopyWithImpl(_$RegistrationStateImpl _value, $Res Function(_$RegistrationStateImpl) _then) : super(_value, _then); /// Create a copy of RegistrationState /// with the given fields replaced by the non-null parameter values. @@ -126,9 +120,7 @@ class _$RegistrationStateImpl implements _RegistrationState { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$RegistrationStateImpl && - (identical(other.sheet, sheet) || other.sheet == sheet)); + (other.runtimeType == runtimeType && other is _$RegistrationStateImpl && (identical(other.sheet, sheet) || other.sheet == sheet)); } @override @@ -139,14 +131,11 @@ class _$RegistrationStateImpl implements _RegistrationState { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => - __$$RegistrationStateImplCopyWithImpl<_$RegistrationStateImpl>( - this, _$identity); + _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => __$$RegistrationStateImplCopyWithImpl<_$RegistrationStateImpl>(this, _$identity); } abstract class _RegistrationState implements RegistrationState { - const factory _RegistrationState( - {required final UserRegistrationSheet sheet}) = _$RegistrationStateImpl; + const factory _RegistrationState({required final UserRegistrationSheet sheet}) = _$RegistrationStateImpl; @override UserRegistrationSheet get sheet; @@ -155,6 +144,5 @@ abstract class _RegistrationState implements RegistrationState { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/presentation/pages/additional_information_screen.dart b/lib/features/registration/presentation/pages/additional_information_screen.dart index e0a4edbf..01ce3ffa 100644 --- a/lib/features/registration/presentation/pages/additional_information_screen.dart +++ b/lib/features/registration/presentation/pages/additional_information_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; diff --git a/lib/features/registration/presentation/pages/allergies_screen.dart b/lib/features/registration/presentation/pages/allergies_screen.dart index f0d4c61e..d0df3b8d 100644 --- a/lib/features/registration/presentation/pages/allergies_screen.dart +++ b/lib/features/registration/presentation/pages/allergies_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/blood_pressure_screen.dart b/lib/features/registration/presentation/pages/blood_pressure_screen.dart index 7baac4f6..8b735b00 100644 --- a/lib/features/registration/presentation/pages/blood_pressure_screen.dart +++ b/lib/features/registration/presentation/pages/blood_pressure_screen.dart @@ -1,6 +1,6 @@ import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; diff --git a/lib/features/registration/presentation/pages/body_circumferences_screen.dart b/lib/features/registration/presentation/pages/body_circumferences_screen.dart index 5078be08..0e692512 100644 --- a/lib/features/registration/presentation/pages/body_circumferences_screen.dart +++ b/lib/features/registration/presentation/pages/body_circumferences_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/city_of_living_screen.dart b/lib/features/registration/presentation/pages/city_of_living_screen.dart index b901e3b2..46a00fca 100644 --- a/lib/features/registration/presentation/pages/city_of_living_screen.dart +++ b/lib/features/registration/presentation/pages/city_of_living_screen.dart @@ -1,5 +1,5 @@ import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/credentials_screen.dart b/lib/features/registration/presentation/pages/credentials_screen.dart index 5a2c51ca..cc06048d 100644 --- a/lib/features/registration/presentation/pages/credentials_screen.dart +++ b/lib/features/registration/presentation/pages/credentials_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/date_of_birth_screen.dart b/lib/features/registration/presentation/pages/date_of_birth_screen.dart index c980111b..2270e3c6 100644 --- a/lib/features/registration/presentation/pages/date_of_birth_screen.dart +++ b/lib/features/registration/presentation/pages/date_of_birth_screen.dart @@ -1,5 +1,5 @@ import 'package:eatvio_app/core/utils/date_time_utils.dart'; -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; diff --git a/lib/features/registration/presentation/pages/favorite_foods_screen.dart b/lib/features/registration/presentation/pages/favorite_foods_screen.dart index 570f9d15..29fad0db 100644 --- a/lib/features/registration/presentation/pages/favorite_foods_screen.dart +++ b/lib/features/registration/presentation/pages/favorite_foods_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/favorite_sports_screen.dart b/lib/features/registration/presentation/pages/favorite_sports_screen.dart index 53742fc7..3a746e11 100644 --- a/lib/features/registration/presentation/pages/favorite_sports_screen.dart +++ b/lib/features/registration/presentation/pages/favorite_sports_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/gender_screen.dart b/lib/features/registration/presentation/pages/gender_screen.dart index 66549ac2..46d56da3 100644 --- a/lib/features/registration/presentation/pages/gender_screen.dart +++ b/lib/features/registration/presentation/pages/gender_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/features/registration/presentation/pages/height_screen.dart b/lib/features/registration/presentation/pages/height_screen.dart index 38a721ba..2753784a 100644 --- a/lib/features/registration/presentation/pages/height_screen.dart +++ b/lib/features/registration/presentation/pages/height_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/language_select_screen.dart b/lib/features/registration/presentation/pages/language_select_screen.dart index d1e1f885..a9c3dbb5 100644 --- a/lib/features/registration/presentation/pages/language_select_screen.dart +++ b/lib/features/registration/presentation/pages/language_select_screen.dart @@ -1,5 +1,5 @@ import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; diff --git a/lib/features/registration/presentation/pages/medicine_intake_screen.dart b/lib/features/registration/presentation/pages/medicine_intake_screen.dart index 878d418d..86e09604 100644 --- a/lib/features/registration/presentation/pages/medicine_intake_screen.dart +++ b/lib/features/registration/presentation/pages/medicine_intake_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/name_screen.dart b/lib/features/registration/presentation/pages/name_screen.dart index cebd4cd4..e92ce31a 100644 --- a/lib/features/registration/presentation/pages/name_screen.dart +++ b/lib/features/registration/presentation/pages/name_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/presentation/pages/weight_screen.dart b/lib/features/registration/presentation/pages/weight_screen.dart index c67cfee9..622cc772 100644 --- a/lib/features/registration/presentation/pages/weight_screen.dart +++ b/lib/features/registration/presentation/pages/weight_screen.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; diff --git a/lib/features/registration/repositories/registration_repository.dart b/lib/features/registration/repositories/registration_repository.dart index d609ee12..e5a32e94 100644 --- a/lib/features/registration/repositories/registration_repository.dart +++ b/lib/features/registration/repositories/registration_repository.dart @@ -1,4 +1,4 @@ -import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart'; +import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/models/location_model.dart'; import 'package:eatvio_app/features/registration/services/registration_service.dart'; diff --git a/lib/features/registration/services/registration_service.g.dart b/lib/features/registration/services/registration_service.g.dart index 4aaccede..50d9fd82 100644 --- a/lib/features/registration/services/registration_service.g.dart +++ b/lib/features/registration/services/registration_service.g.dart @@ -22,8 +22,7 @@ class _RegistrationService implements RegistrationService { final ParseErrorLogger? errorLogger; @override - Future> register( - {required Map sheet}) async { + Future> register({required Map sheet}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -129,9 +128,7 @@ class _RegistrationService implements RegistrationService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/localization/app_localization.dart b/lib/localization/app_localization.dart index b477c9a4..7390b372 100644 --- a/lib/localization/app_localization.dart +++ b/lib/localization/app_localization.dart @@ -1,5 +1,6 @@ import 'package:eatvio_app/app_router.dart'; import 'package:flutter/cupertino.dart'; + //import 'en_us/en_us_translations.dart'; import 'package:flutter/foundation.dart'; diff --git a/lib/old/auth/auth_screen/auth_screen.dart b/lib/old/auth/auth_screen/auth_screen.dart index f13d77cd..37be6818 100644 --- a/lib/old/auth/auth_screen/auth_screen.dart +++ b/lib/old/auth/auth_screen/auth_screen.dart @@ -1,4 +1,5 @@ import 'dart:convert'; + import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; @@ -12,6 +13,7 @@ import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:url_launcher/url_launcher.dart'; import 'package:validators/validators.dart'; + import 'bloc/auth_bloc.dart'; import 'models/auth_model.dart'; diff --git a/lib/old/auth/auth_screen/bloc/auth_bloc.dart b/lib/old/auth/auth_screen/bloc/auth_bloc.dart index 9d7b76a2..f75da299 100644 --- a/lib/old/auth/auth_screen/bloc/auth_bloc.dart +++ b/lib/old/auth/auth_screen/bloc/auth_bloc.dart @@ -2,6 +2,7 @@ import 'package:eatvio_app/old/auth/auth_screen/models/auth_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; + part 'auth_event.dart'; part 'auth_state.dart'; diff --git a/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart b/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart index 34900450..c1ab8e0f 100644 --- a/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart +++ b/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'diet_create_event.dart'; -part 'diet_create_state.dart'; +part 'diet_create_event.dart';part 'diet_create_state.dart'; /// A bloc that manages the state of a DietCreate according to the event that is dispatched to it. class DietCreateBloc extends Bloc { diff --git a/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart b/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart index cb0c87bf..5069b0ad 100644 --- a/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart +++ b/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'diet_edit_event.dart'; -part 'diet_edit_state.dart'; +part 'diet_edit_event.dart';part 'diet_edit_state.dart'; /// A bloc that manages the state of a DietEdit according to the event that is dispatched to it. class DietEditBloc extends Bloc { diff --git a/lib/old/diets/diet_edit_screen/diet_edit_screen.dart b/lib/old/diets/diet_edit_screen/diet_edit_screen.dart index e5b5052e..14888fcd 100644 --- a/lib/old/diets/diet_edit_screen/diet_edit_screen.dart +++ b/lib/old/diets/diet_edit_screen/diet_edit_screen.dart @@ -1,7 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart b/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart index 2c49b95f..e06469f5 100644 --- a/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart +++ b/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart @@ -13,10 +13,7 @@ import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; - - -part 'diet_select_event.dart'; -part 'diet_select_state.dart'; +part 'diet_select_event.dart';part 'diet_select_state.dart'; /// A bloc that manages the state of a DietSelect according to the event that is dispatched to it. class DietSelectBloc extends Bloc { diff --git a/lib/old/diets/diet_select_screen/diet_select_screen.dart b/lib/old/diets/diet_select_screen/diet_select_screen.dart index dd332673..9f49dd52 100644 --- a/lib/old/diets/diet_select_screen/diet_select_screen.dart +++ b/lib/old/diets/diet_select_screen/diet_select_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; - import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; diff --git a/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart b/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart index 0fd6c0c4..78ed67fd 100644 --- a/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart +++ b/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'diet_show_event.dart'; -part 'diet_show_state.dart'; +part 'diet_show_event.dart';part 'diet_show_state.dart'; /// A bloc that manages the state of a Diet according to the event that is dispatched to it. class DietBloc extends Bloc { diff --git a/lib/old/diets/diet_show_screen/diet_show_screen.dart b/lib/old/diets/diet_show_screen/diet_show_screen.dart index 84d87ced..d7132890 100644 --- a/lib/old/diets/diet_show_screen/diet_show_screen.dart +++ b/lib/old/diets/diet_show_screen/diet_show_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart b/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart index 61a8efeb..58310e30 100644 --- a/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart +++ b/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart @@ -12,10 +12,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'glossary_screen_event.dart'; -part 'glossary_screen_state.dart'; +part 'glossary_screen_event.dart';part 'glossary_screen_state.dart'; /// A bloc that manages the state of a Glossary according to the event that is dispatched to it. class GlossaryBloc extends Bloc { diff --git a/lib/old/glossary/glossary_screen/glossary_screen.dart b/lib/old/glossary/glossary_screen/glossary_screen.dart index 5a49cc2e..25122ff5 100644 --- a/lib/old/glossary/glossary_screen/glossary_screen.dart +++ b/lib/old/glossary/glossary_screen/glossary_screen.dart @@ -1,7 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; - import 'package:eatvio_app/old/glossary/glossary_screen/widgets/glossary_scroll_item.dart'; import 'package:eatvio_app/old/glossary/glossary_screen/widgets/glossary_search_widget.dart'; import 'package:eatvio_app/theme/custom_button_style.dart'; diff --git a/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart b/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart index abd758fa..1b4f5727 100644 --- a/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart +++ b/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'plan_create_event.dart'; -part 'plan_create_state.dart'; +part 'plan_create_event.dart';part 'plan_create_state.dart'; /// A bloc that manages the state of a PlanCreate according to the event that is dispatched to it. class PlanCreateBloc extends Bloc { diff --git a/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart b/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart index 55f3a9a4..d60c7df8 100644 --- a/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart +++ b/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'plan_edit_event.dart'; -part 'plan_edit_state.dart'; +part 'plan_edit_event.dart';part 'plan_edit_state.dart'; /// A bloc that manages the state of a PlanEdit according to the event that is dispatched to it. class PlanEditBloc extends Bloc { diff --git a/lib/old/plans/plan_edit_screen/plan_edit_screen.dart b/lib/old/plans/plan_edit_screen/plan_edit_screen.dart index 39d29424..40e2fd0c 100644 --- a/lib/old/plans/plan_edit_screen/plan_edit_screen.dart +++ b/lib/old/plans/plan_edit_screen/plan_edit_screen.dart @@ -1,7 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart b/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart index 6bfd7331..e471fcc5 100644 --- a/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart +++ b/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart @@ -13,10 +13,7 @@ import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; - - -part 'plan_select_event.dart'; -part 'plan_select_state.dart'; +part 'plan_select_event.dart';part 'plan_select_state.dart'; /// A bloc that manages the state of a PlanSelect according to the event that is dispatched to it. class PlanSelectBloc extends Bloc { diff --git a/lib/old/plans/plan_select_screen/plan_select_screen.dart b/lib/old/plans/plan_select_screen/plan_select_screen.dart index c75c3c98..1e7decc6 100644 --- a/lib/old/plans/plan_select_screen/plan_select_screen.dart +++ b/lib/old/plans/plan_select_screen/plan_select_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; - import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; diff --git a/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart b/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart index 82314d7e..9c7ea9ce 100644 --- a/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart +++ b/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'plan_show_event.dart'; -part 'plan_show_state.dart'; +part 'plan_show_event.dart';part 'plan_show_state.dart'; /// A bloc that manages the state of a Plan according to the event that is dispatched to it. class PlanBloc extends Bloc { diff --git a/lib/old/plans/plan_show_screen/plan_show_screen.dart b/lib/old/plans/plan_show_screen/plan_show_screen.dart index ab173bc3..a2c9649a 100644 --- a/lib/old/plans/plan_show_screen/plan_show_screen.dart +++ b/lib/old/plans/plan_show_screen/plan_show_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; diff --git a/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart b/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart index 430730a7..c51b8872 100644 --- a/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart +++ b/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:convert'; + import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; @@ -10,6 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; + part 'my_profile_event.dart'; part 'my_profile_state.dart'; diff --git a/lib/old/profile/my_profile_screen/my_profile_screen.dart b/lib/old/profile/my_profile_screen/my_profile_screen.dart index 6bc818e3..d425dd68 100644 --- a/lib/old/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/old/profile/my_profile_screen/my_profile_screen.dart @@ -8,7 +8,6 @@ import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; - import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:fl_chart/fl_chart.dart'; diff --git a/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart b/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart index f07114d5..77866907 100644 --- a/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart +++ b/lib/old/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:convert'; + import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; diff --git a/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart b/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart index 607521cc..2677c64f 100644 --- a/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart +++ b/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart @@ -5,7 +5,6 @@ import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_button_style.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; - import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; diff --git a/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart b/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart index 8ce71b7d..43cad165 100644 --- a/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart +++ b/lib/old/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart @@ -1,4 +1,5 @@ import 'dart:async'; + import 'package:dio/dio.dart'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/const.dart'; diff --git a/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart b/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart index a871aa7f..10c2f8ca 100644 --- a/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart +++ b/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; - import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; diff --git a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart deleted file mode 100644 index 763f68bf..00000000 --- a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart +++ /dev/null @@ -1,197 +0,0 @@ -import 'dart:async'; -import 'dart:convert'; -import 'package:eatvio_app/app_router.dart'; -import 'package:eatvio_app/core/const.dart'; -import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; -import 'package:eatvio_app/old/recipe/recipe_show_screen/models/recipe_show_model.dart'; -import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:go_router/go_router.dart'; -import 'package:http/http.dart' as http; -import 'package:intl/intl.dart'; -part 'recipe_show_event.dart'; -part 'recipe_show_state.dart'; - -/// A bloc that manages the state of a Recipe according to the event that is dispatched to it. -class RecipeBloc extends Bloc { - RecipeBloc(RecipeState initialState) : super(initialState) { - on(_onInitialize); - on(_deleteEntry); - on(_createComment); - } - - _onInitialize( - RecipeInitialEvent event, - Emitter emit, - ) async { - try { - if (!await TokenStorage.haveTokenInStorage()) { - AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); - } - final String? recipeID = state.recipeModelObj?.recipeID; - final response = await http.get( - Uri.parse(baseUrl + '/api/recipes/show/$recipeID'), - headers: { - 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', - }, - ); - if (response.statusCode == 200) { - final data = jsonDecode(response.body); - if (data is Map) { - if (state is RecipeLoadedState) { - var currentState = state as RecipeLoadedState; - emit( - currentState.copyWith( - recipeModelObj: currentState.recipeModelObj, - recipe: currentState.recipe, - token: currentState.token, - commentController: currentState.commentController, - comments: currentState.comments, - steps: currentState.steps, - author: currentState.author, - ), - ); - } else { - emit( - RecipeLoadedState( - token: await TokenStorage.getTokenFromStorage(), - recipe: data, - steps: data['steps'], - author: await _fetchAuthor(data['id']), - comments: fillCommentList(await _fetchComments(data['id'])), - tags: await _fetchTags(data['id']), - commentController: TextEditingController(), - ), - ); - } - } else { - // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку - emit(RecipeErrorState('Некоторые необходимые данные отсутствуют.')); - } - } else { - // Статус ответа не равен 200, обрабатываем ошибку - emit(RecipeErrorState('Ошибка сервера: ${response.statusCode}')); - } - } catch (e) { - // Ошибка при декодировании JSON или другая ошибка выполнения - emit(RecipeErrorState('Ошибка при получении данных о чатах: $e')); - } - } - - FutureOr _deleteEntry(DeleteEntry event, Emitter emit) async { - if (!await TokenStorage.haveTokenInStorage()) { - AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); - } - final int id = event.id; - final response = await http.post( - Uri.parse(baseUrl + '/api/recipes/delete/$id'), - headers: { - 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', - }, - ); - if (response.statusCode == 200) { - AppRouter.navigatorKey.currentContext?.goNamed('recipeSelectScreen'); - } else { - // Статус ответа не равен 200, обрабатываем ошибку - emit(RecipeErrorState('Ошибка: ${response.statusCode}')); - } - } - - FutureOr _createComment(CreateComment event, Emitter emit) async { - if (state is RecipeLoadedState) { - var currentState = state as RecipeLoadedState; - // Отправляем данные по HTTP маршруту и ждем ответ - var response = await _sendCommentData(currentState.token, event.body, currentState.recipe?['id']); - if (response.statusCode == 200) { - var updatedComments = fillCommentList(await _fetchComments(currentState.recipe?['id'])); - var updatedState = currentState.copyWith( - comments: updatedComments, - commentController: TextEditingController(), // Clear the comment input field - ); - emit(updatedState); // Emit the updated state to trigger a screen update - } - } - } - - _fetchAuthor(int id) async { - if (!await TokenStorage.haveTokenInStorage()) { - AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); - } - - final response = await http.get( - Uri.parse(baseUrl + '/api/recipes/getAuthor/$id'), - headers: { - 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', - }, - ); - final data = jsonDecode(response.body); - return data; - } - - Future _fetchComments(int id) async { - if (!await TokenStorage.haveTokenInStorage()) { - AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); - } - final response = await http.get( - Uri.parse(baseUrl + '/api/recipes/getComments/$id'), - headers: { - 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', - }, - ); - final data = jsonDecode(response.body); - return data; - } - - _fetchTags(int id) async { - if (!await TokenStorage.haveTokenInStorage()) { - AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); - } - - final response = await http.get( - Uri.parse(baseUrl + '/api/recipes/getTags/$id'), - headers: { - 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', - }, - ); - final data = jsonDecode(response.body); - return data; - } - - List fillCommentList(List comments) { - List list = []; - for (int i = 0; i < comments.length; i++) { - list.add( - CommentModel( - id: comments[i]['id'].toString(), - userImage: comments[i]['profile_photo_path'], - username: comments[i]['name'], - dateText: DateFormat('dd.MM').format(DateTime.parse(comments[i]['updated_at'])), - greetingText: comments[i]['body'], - ), - ); - } - return list; - } - - Future _sendCommentData(String? token, String body, int id) async { - String url = baseUrl + '/api/recipes/createComment/$id'; - final Map credentials = { - 'id': id, - 'body': body, - }; - - var response = await http.post( - Uri.parse(url), - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer $token', - }, - body: json.encode(credentials), - encoding: utf8, - ); - - return response; - } -} diff --git a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_event.dart b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_event.dart deleted file mode 100644 index f2e71b7b..00000000 --- a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_event.dart +++ /dev/null @@ -1,34 +0,0 @@ -// ignore_for_file: must_be_immutable - -part of 'recipe_show_bloc.dart'; - -/// Abstract class for all events that can be dispatched from the -///Recipe widget. -/// -/// Events must be immutable and implement the [Equatable] interface. -@immutable -abstract class RecipeEvent extends Equatable {} - -/// Event that is dispatched when the Recipe widget is first created. -class RecipeInitialEvent extends RecipeEvent { - @override - List get props => []; -} - -class DeleteEntry extends RecipeEvent { - DeleteEntry(this.id); - - final int id; - - @override - List get props => [id]; -} - -class CreateComment extends RecipeEvent { - CreateComment(this.body); - - final String body; - - @override - List get props => [body]; -} diff --git a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_state.dart b/lib/old/recipe/recipe_show_screen/bloc/recipe_show_state.dart deleted file mode 100644 index 0b7b2e83..00000000 --- a/lib/old/recipe/recipe_show_screen/bloc/recipe_show_state.dart +++ /dev/null @@ -1,91 +0,0 @@ -// ignore_for_file: must_be_immutable - -part of 'recipe_show_bloc.dart'; - -/// Represents the state of Recipe in the application. -/// - -class RecipeState extends Equatable { - RecipeState({ - this.recipeModelObj, - }); - - RecipeModel? recipeModelObj; - - @override - List get props => [recipeModelObj]; - - RecipeState copyWith({RecipeModel? recipeModelObj}) { - return RecipeState( - recipeModelObj: recipeModelObj ?? this.recipeModelObj, - ); - } -} - -class RecipeLoadedState extends RecipeState { - RecipeLoadedState({ - this.recipeModelObj, - this.recipe, - this.author, - this.comments, - this.token, - this.commentController, - this.tags, - this.steps, - }); - - RecipeModel? recipeModelObj; - Map? recipe; - Map? author; - List? comments; - TextEditingController? commentController; - List? steps; - List? tags; - String? token; - - @override - List get props => [ - recipeModelObj, - recipe, - author, - comments, - token, - commentController, - steps, - ]; - - RecipeLoadedState copyWith({ - RecipeModel? recipeModelObj, - Map? recipe, - Map? author, - TextEditingController? commentController, - String? token, - List? tags, - List? steps, - List? comments, - }) { - return RecipeLoadedState( - recipeModelObj: recipeModelObj ?? this.recipeModelObj, - recipe: recipe ?? this.recipe, - author: author ?? this.author, - tags: tags ?? this.tags, - token: token ?? this.token, - commentController: commentController ?? this.commentController, - steps: steps ?? this.steps, - comments: comments ?? this.comments, - ); - } -} - -class RecipeErrorState extends RecipeState { - final String errorMessage; - - RecipeErrorState(this.errorMessage); - - @override - List get props => [errorMessage]; -} - -class RecipeInitialState extends RecipeState { - RecipeInitialState({required RecipeModel recipeModelObj}) : super(recipeModelObj: recipeModelObj); -} diff --git a/lib/old/recipe/recipe_show_screen/models/recipe_show_model.dart b/lib/old/recipe/recipe_show_screen/models/recipe_show_model.dart deleted file mode 100644 index 1786388e..00000000 --- a/lib/old/recipe/recipe_show_screen/models/recipe_show_model.dart +++ /dev/null @@ -1,19 +0,0 @@ -// ignore_for_file: must_be_immutable - -import 'package:equatable/equatable.dart'; - -/// This class defines the variables used in the [recipe_screen], -/// and is typically used to hold data that is passed between different parts of the application. - -class RecipeModel extends Equatable { - final String recipeID; - - RecipeModel({required String recipeID}) : recipeID = recipeID; - - RecipeModel copyWith(String recipeID) { - return RecipeModel(recipeID: recipeID); - } - - @override - List get props => [recipeID]; -} diff --git a/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart b/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart deleted file mode 100644 index 688e73c0..00000000 --- a/lib/old/recipe/recipe_show_screen/recipe_show_screen.dart +++ /dev/null @@ -1,480 +0,0 @@ -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/const.dart'; -import 'package:eatvio_app/core/utils/image_constant.dart'; - -import 'package:eatvio_app/old/feed/blog_post_screen/widgets/comment_widget.dart'; -import 'package:eatvio_app/theme/app_decoration.dart'; -import 'package:eatvio_app/theme/custom_button_style.dart'; -import 'package:eatvio_app/theme/custom_text_style.dart'; -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; -import 'package:eatvio_app/widgets/custom_image_view.dart'; -import 'package:eatvio_app/widgets/custom_outlined_button.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:go_router/go_router.dart'; -import 'package:intl/intl.dart'; - -import 'bloc/recipe_show_bloc.dart'; -import 'models/recipe_show_model.dart'; - -class RecipeScreen extends StatelessWidget { - const RecipeScreen({Key? key}) : super(key: key); - - static Widget builder(BuildContext context) { - final recipeID = ModalRoute.of(context)!.settings.arguments; - return BlocProvider( - create: (context) => RecipeBloc(RecipeState(recipeModelObj: RecipeModel(recipeID: recipeID.toString())))..add(RecipeInitialEvent()), - child: RecipeScreen(), - ); - } - - Widget build(BuildContext context) { - return BlocBuilder( - builder: (context, state) { - if (state is RecipeInitialState) { - // Это начальное состояние, данные ещё не загружены. - return Container( - color: Colors.white, - ); - } else if (state is RecipeLoadedState) { - // Данные загружены, можно строить экран. - return _buildRecipe(context, state); - } else if (state is RecipeErrorState) { - // Произошла ошибка при загрузке данных. - return Center(child: Text(state.errorMessage)); - } else { - // Другие состояния, если они есть. - return Container(); // Пустой контейнер для необработанных состояний. - } - }, - ); - } - - _buildRecipe(BuildContext context, RecipeLoadedState state) { - List steps = []; - if (state.steps != null) { - for (int i = 0; i < state.steps!.length; i++) { - steps.add(_buildStep(context, state, i)); - } - } - return Scaffold( - appBar: AppBar( - toolbarHeight: 0, - automaticallyImplyLeading: false, - ), - resizeToAvoidBottomInset: false, - body: Container( - width: double.maxFinite, - decoration: AppDecoration.fillGray, - child: ListView( - children: [ - SizedBox(height: 15), - _buildHeaderRow(context, state), - SizedBox(height: 15), - _buildRecipeData(context, state), - SizedBox(height: 15), - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: steps, - ), - SizedBox(height: 15), - _buildTextField(context, state), - SizedBox(height: 15), - _buildCommentSection(context, state), - ], - ), - ), - ); - } - - _buildHeaderRow(BuildContext context, RecipeLoadedState state) { - final String name = state.author?['name']; - return Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - padding: EdgeInsets.symmetric( - horizontal: 24, - vertical: 12, - ), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - CustomImageView( - imagePath: ImageConstant.imgArrowLeft, - onTap: () => GoRouter.of(context).pop(), - ), - Padding( - padding: EdgeInsets.only(top: 1), - child: Row( - children: [ - Align( - alignment: Alignment.centerRight, - child: Text( - "$name", - style: CustomTextStyles.titleMediumBlack, - ), - ), - CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + (state.author?['profile_photo_path'] ?? ''), - imageBuilder: (context, imageProvider) => CircleAvatar( - backgroundImage: imageProvider, - radius: 25, - ), - placeholder: (context, url) => CircularProgressIndicator(), - errorWidget: (context, url, error) => CircleAvatar( - child: Icon(Icons.person), - backgroundColor: Colors.white, - radius: 25, - ), - ), - ], - ), - ), - ], - ), - ); - } - - _buildRecipeData(BuildContext context, RecipeLoadedState state) { - return Container( - margin: EdgeInsets.only( - left: 16, - right: 20, - bottom: 10, - ), - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - children: [ - Text( - state.recipe?['title'], - style: CustomTextStyles.titleMediumBlack, - ), - Spacer(), - PopupMenuButton( - onSelected: (value) => tapMenu(value, context, state), - itemBuilder: (BuildContext context) => >[ - PopupMenuItem( - value: 'edit', - child: Text('Редактировать'), - ), - PopupMenuItem( - value: 'delete', - child: Text('Удалить'), - ), - ], - ), - ], - ), - SizedBox(height: 8.0), - _buildImage(state), - SizedBox(height: 16.0), - Text( - state.recipe?['description'], - style: CustomTextStyles.bodyMediumBluegray800, - ), - SizedBox(height: 16.0), - Align( - alignment: Alignment.topLeft, - child: Text( - DateFormat('dd.MM.yyyy').format(DateTime.parse(state.recipe?['updated_at'])), - style: theme.textTheme.bodyMedium, - ), - ), - SizedBox(height: 16.0), - _buildTags(state.tags), - SizedBox(height: 16.0), - Row( - children: [ - Padding( - padding: EdgeInsets.only(left: 24), - child: Row( - children: [ - Padding( - padding: EdgeInsets.only(right: 8), - child: Icon(Icons.favorite_outline), - ), - Text( - "Нравится", - style: CustomTextStyles.titleMediumSemiBold, - ), - ], - ), - ), - Spacer(), - Padding( - padding: EdgeInsets.only(right: 24), - child: Row( - children: [ - Padding( - padding: const EdgeInsets.only(right: 8), - child: Icon(Icons.share_outlined), - ), - Text( - "Поделиться", - style: CustomTextStyles.titleMediumSemiBold, - ), - ], - ), - ), - ], - ), - ], - ), - ); - } - - _buildTags(List? tags) { - return Wrap( - spacing: 8.0, - runSpacing: 4.0, - children: tags!.map((tag) { - return Chip( - label: Text(tag['name']), - ); - }).toList(), - ); - } - - _buildImage(RecipeLoadedState state) { - return CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + (state.recipe?['image'] ?? ''), - imageBuilder: (context, imageProvider) => Stack( - children: [ - ClipRRect( - borderRadius: const BorderRadius.all(Radius.circular(8.0)), - child: Image( - image: imageProvider, - ), - ), - Positioned( - bottom: 0, - left: 0, - right: 0, - child: Container( - padding: EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.only(left: 48.0), - child: Row( - children: [ - Icon( - Icons.remove_red_eye, - color: Colors.white, - ), - SizedBox(width: 4.0), - Text( - '24', - style: TextStyle(color: Colors.white), - ), - ], - ), - ), - Row( - children: [ - Icon( - Icons.favorite, - color: Colors.white, - ), - SizedBox(width: 4.0), - Text( - '24', - style: TextStyle(color: Colors.white), - ), - ], - ), - Padding( - padding: const EdgeInsets.only(right: 48.0), - child: Row( - children: [ - Icon( - Icons.comment_outlined, - color: Colors.white, - ), - SizedBox(width: 4.0), - Text( - '${state.comments?.length}', - style: TextStyle(color: Colors.white), - ), - ], - ), - ), - ], - ), - ), - ), - ], - ), - placeholder: (context, url) => CircularProgressIndicator(), - ); - } - - void tapMenu(String value, BuildContext context, RecipeLoadedState state) { - if (value == 'edit') { - GoRouter.of(context).goNamed( - 'recipeEditScreen', - extra: state.recipe?['id'].toString(), - ); - } else if (value == 'delete') { - context.read().add(DeleteEntry(state.recipe?['id'])); - } - } - - _buildTextField(BuildContext context, RecipeLoadedState state) { - return Container( - margin: EdgeInsets.only( - left: 16, - right: 20, - bottom: 10, - ), - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Column( - children: [ - CustomTextFormField( - controller: state.commentController, - maxLines: 4, - ), - SizedBox(height: 15), - CustomOutlinedButton( - text: "Оставить отзыв", - margin: EdgeInsets.only(bottom: 5), - buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - decoration: BoxDecoration( - color: Colors.transparent, - ), - onPressed: () => context.read().add(CreateComment(state.commentController!.text)), - // Установите прозрачный фон - ), - ], - ), - ], - ), - ); - } - - _buildCommentSection(BuildContext context, RecipeLoadedState state) { - if (state.comments != null && state.comments!.isNotEmpty) { - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - for (int i = 0; i < state.comments!.length; i++) - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - CommentWidget(state.comments![i]), - SizedBox(height: 10.0), // Separator - ], - ), - ], - ); - } else { - // Return a message or placeholder widget when there are no comments - return Column( - children: [ - Center( - child: Text('No comments available'), - ), - SizedBox( - height: 20, - ), - ], - ); - } - } - - /// Navigates to the previous screen. - onTapArrowleftone(BuildContext context) { - GoRouter.of(context).pop(); - } - - Widget _buildStep(BuildContext context, RecipeLoadedState state, int i) { - return Container( - margin: EdgeInsets.only( - left: 16, - right: 16, - bottom: 10, - ), - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Align( - alignment: Alignment.centerLeft, - child: Text( - "Шаг ${i + 1}", - style: CustomTextStyles.titleMediumSemiBold, - ), - ), - SizedBox(height: 16.0), - CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + (state.steps?[i]['image']), - width: double.infinity, - // Установите ширину равной ширине родительского элемента - height: 200.0, - // Задайте постоянную высоту элемента - fit: BoxFit.cover, - placeholder: (context, url) => CircularProgressIndicator(), - errorWidget: (context, url, error) => Icon(Icons.error), - ), - SizedBox(height: 16.0), - Text(state.steps?[i]['description']), - ], - ), - ); - } -} diff --git a/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart b/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart deleted file mode 100644 index 1ff8e7b8..00000000 --- a/lib/old/recipe/recipe_show_screen/widgets/comment_widget.dart +++ /dev/null @@ -1,101 +0,0 @@ -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:eatvio_app/core/const.dart'; -import 'package:eatvio_app/core/utils/image_constant.dart'; -import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; -import 'package:eatvio_app/theme/custom_text_style.dart'; -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/custom_image_view.dart'; -import 'package:flutter/material.dart'; - -class CommentWidget extends StatelessWidget { - const CommentWidget(this.commentModelObj); - - final CommentModel commentModelObj; - - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only( - left: 16, - right: 20, - bottom: 10, - ), - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, // Move the main axis alignment to space between - crossAxisAlignment: CrossAxisAlignment.center, // Center the items vertically - children: [ - CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + commentModelObj.userImage!, - imageBuilder: (context, imageProvider) => CircleAvatar( - backgroundImage: imageProvider, - radius: 25, - ), - placeholder: (context, url) => CircularProgressIndicator(), - errorWidget: (context, url, error) => CircleAvatar( - child: Icon(Icons.person), - backgroundColor: Colors.white, - radius: 25, - ), - ), - Expanded( - child: Padding( - padding: EdgeInsets.only( - left: 12, - top: 2, - bottom: 11, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - width: 227, - child: Row( - children: [ - Text( - commentModelObj.username!.length <= 15 ? commentModelObj.username! : commentModelObj.username!.substring(0, 15) + '...', - style: theme.textTheme.titleMedium, - ), - Spacer(), - Padding( - padding: EdgeInsets.only(left: 6), - child: Text( - commentModelObj.dateText!, - style: theme.textTheme.bodyMedium, - ), - ), - ], - ), - ), - SizedBox(height: 6), - Text( - commentModelObj.greetingText!, - style: CustomTextStyles.bodyMediumBluegray800, - ), - ], - ), - ), - ), - CustomImageView( - imagePath: ImageConstant.imgSend, - height: 30, - width: 30, - margin: EdgeInsets.only(left: 5), - ), - ], - ), - ); - } -} diff --git a/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart b/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart index e0087256..a72d6554 100644 --- a/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart +++ b/lib/old/users/subscribers_screen/bloc/subscribers_bloc.dart @@ -1,6 +1,7 @@ //import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'dart:async'; import 'dart:convert'; + import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; @@ -10,6 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; + part 'subscribers_event.dart'; part 'subscribers_state.dart'; diff --git a/lib/old/users/subscribers_screen/subscribers_screen.dart b/lib/old/users/subscribers_screen/subscribers_screen.dart index cf1210fd..55cccb9b 100644 --- a/lib/old/users/subscribers_screen/subscribers_screen.dart +++ b/lib/old/users/subscribers_screen/subscribers_screen.dart @@ -1,8 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; - -import 'package:eatvio_app/old/feed/feed_screen/widgets/feed_search_view.dart'; import 'package:eatvio_app/theme/custom_button_style.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; @@ -126,9 +124,6 @@ class SubscribersScreen extends StatelessWidget { padding: const EdgeInsets.all(12.0), child: Column( children: [ - CustomSearchView( - hintText: "Поиск", - ), SizedBox(height: 10), Row( children: [ diff --git a/lib/widgets/app_bar/appbar_title_circleimage.dart b/lib/widgets/app_bar/appbar_title_circleimage.dart deleted file mode 100644 index 3bf6925e..00000000 --- a/lib/widgets/app_bar/appbar_title_circleimage.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:eatvio_app/theme/app_decoration.dart'; -import 'package:eatvio_app/widgets/custom_image_view.dart'; -import 'package:flutter/material.dart'; - -class AppbarTitleCircleimage extends StatelessWidget { - const AppbarTitleCircleimage({ - this.imagePath, - this.margin, - }); - - final String? imagePath; - final EdgeInsetsGeometry? margin; - - @override - Widget build(BuildContext context) { - return InkWell( - borderRadius: BorderRadiusStyle.circleBorder8, - child: Padding( - padding: margin ?? EdgeInsets.zero, - child: CustomImageView( - imagePath: imagePath, - height: 40, - width: 40, - fit: BoxFit.contain, - radius: BorderRadius.circular( - 20, - ), - ), - ), - ); - } -} diff --git a/lib/widgets/app_bar/exit_button.dart b/lib/widgets/app_bar/exit_button.dart deleted file mode 100644 index 04cd6eac..00000000 --- a/lib/widgets/app_bar/exit_button.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:eatvio_app/theme/custom_text_style.dart'; -import 'package:flutter/material.dart'; - -class ExitButton extends StatelessWidget { - const ExitButton({ - required this.text, - this.margin, - this.onTap, - }); - - final String text; - final EdgeInsetsGeometry? margin; - final Function? onTap; - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: onTapCall, - child: Padding( - padding: margin ?? EdgeInsets.zero, - child: Text( - text, - style: CustomTextStyles.titleSmallRed200.copyWith( - color: Colors.red, - ), - ), - ), - ); - } - - void onTapCall() { - onTap!.call(); - } -} diff --git a/lib/widgets/chart_axis.dart b/lib/widgets/chart_axis.dart deleted file mode 100644 index f137c6d3..00000000 --- a/lib/widgets/chart_axis.dart +++ /dev/null @@ -1,145 +0,0 @@ -/*import 'package:flutter/material.dart'; -import 'package:fl_chart/fl_chart.dart'; - -buildChart( - BuildContext context, List chartPoints, List? dates) { -// Определение осей графика - List spots = []; - for (int i = 0; i < 4; i++) { - spots.add( - FlSpot((i * 10 / 10) + 1, chartPoints[i]), - ); - } - - Widget bottomTitleWidgets( - double value, TitleMeta meta, double chartWidth, List? dates) { - if (value % 1 != 0) { - return Container(); - } - final style = TextStyle( - color: Colors.blue, - fontWeight: FontWeight.bold, - fontSize: min(13, 13 * chartWidth / 300), - ); - int index = value.toInt(); - if (index >= 0 && index < dates!.length) { - // Проверка на допустимый индекс в массиве dates - String formattedDate = - DateFormat('dd.MM').format(DateTime.parse(dates[index])); - return SideTitleWidget( - axisSide: meta.axisSide, - space: 16, - child: Text(formattedDate, style: style), - ); - } else { - return Container(); - } - } - - Widget leftTitleWidgets(double value, TitleMeta meta, double chartWidth) { - final style = TextStyle( - color: Colors.blue, - fontWeight: FontWeight.bold, - fontSize: min(18, 18 * chartWidth / 300), - ); - return SideTitleWidget( - axisSide: meta.axisSide, - space: 16, - child: Text(meta.formattedValue, style: style), - ); - } - - return Padding( - padding: const EdgeInsets.only( - left: 12, - right: 20, - ), - child: AspectRatio( - aspectRatio: 1, - child: LayoutBuilder( - builder: (context, constraints) { - return LineChart( - LineChartData( - lineTouchData: LineTouchData( - touchTooltipData: LineTouchTooltipData( - maxContentWidth: 100, - tooltipBgColor: Colors.black, - getTooltipItems: mapSpots(), - ), - handleBuiltInTouches: true, - getTouchLineStart: (data, index) => 0, - ), - lineBarsData: [ - LineChartBarData( - color: Colors.pink, - spots: spots, - isCurved: true, - isStrokeCapRound: true, - barWidth: 3, - belowBarData: BarAreaData( - show: false, - ), - dotData: const FlDotData(show: false), - ), - ], - minY: chartPoints.reduce( - (value, element) => value < element ? value : element), - maxY: chartPoints.reduce( - (value, element) => value > element ? value : element), - minX: 1, - maxX: 4, - titlesData: FlTitlesData( - leftTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - getTitlesWidget: (value, meta) => - leftTitleWidgets(value, meta, constraints.maxWidth), - reservedSize: 56, - ), - drawBelowEverything: true, - ), - rightTitles: const AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - bottomTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - getTitlesWidget: (value, meta) => bottomTitleWidgets( - value, meta, constraints.maxWidth, dates), - reservedSize: 36, - interval: 1, - ), - drawBelowEverything: true, - ), - topTitles: const AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - ), - gridData: FlGridData( - show: true, - drawHorizontalLine: true, - drawVerticalLine: true, - horizontalInterval: 1.5, - verticalInterval: 5, - checkToShowHorizontalLine: valuteToInt(), - getDrawingHorizontalLine: (_) => FlLine( - color: Colors.blue.withOpacity(1), - dashArray: [8, 2], - strokeWidth: 0.8, - ), - getDrawingVerticalLine: (_) => FlLine( - color: Colors.blue.withOpacity(1), - dashArray: [8, 2], - strokeWidth: 0.8, - ), - checkToShowVerticalLine: valuteToInt(), - ), - borderData: FlBorderData(show: false), - ), - ); - }, - ), - ), - ); -} -*/ diff --git a/lib/widgets/chart_bars.dart b/lib/widgets/chart_bars.dart deleted file mode 100644 index eac9e99c..00000000 --- a/lib/widgets/chart_bars.dart +++ /dev/null @@ -1,79 +0,0 @@ -/*import 'package:flutter/material.dart'; -import 'package:fl_chart/fl_chart.dart'; - -void main() { - runApp(MyApp()); -} - -class MyApp extends StatelessWidget { - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: Text('Nutrition Chart'), - ), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - height: 300, - width: 300, - child: BarChart( - BarChartData( - barTouchData: BarTouchData(enabled: false), - titlesData: FlTitlesData( - show: true, - bottomTitles: SideTitles( - showTitles: true, - getTextStyles: (value) => - const TextStyle(color: Colors.black, fontSize: 14), - margin: 10, - showTitles: (double value) { - switch (value.toInt()) { - case 0: - return 'Calories'; - case 1: - return 'Protein'; - case 2: - return 'Fat'; - case 3: - return 'Carbs'; - default: - return ''; - } - }, - ), - leftTitles: SideTitles(showTitles: false), - ), - borderData: FlBorderData(show: false), - barGroups: [ - BarChartGroupData(x: 0, barRods: [ - BarChartRodData(y: 200, color: Colors.blue), - BarChartRodData(y: 150, color: Colors.blueAccent), - ]), - BarChartGroupData(x: 1, barRods: [ - BarChartRodData(y: 50, color: Colors.red), - BarChartRodData(y: 60, color: Colors.deepOrange), - ]), - BarChartGroupData(x: 2, barRods: [ - BarChartRodData(y: 80, color: Colors.green), - BarChartRodData(y: 70, color: Colors.lightGreen), - ]), - BarChartGroupData(x: 3, barRods: [ - BarChartRodData(y: 100, color: Colors.orange), - BarChartRodData(y: 120, color: Colors.orangeAccent), - ]), - ], - ), - ), - ), - ], - ), - ), - ), - ); - } -} -*/ diff --git a/lib/widgets/custom_autocomplete.dart b/lib/widgets/custom_autocomplete.dart deleted file mode 100644 index 66e042dc..00000000 --- a/lib/widgets/custom_autocomplete.dart +++ /dev/null @@ -1,80 +0,0 @@ -/* -class CustomTextFormField extends StatelessWidget { - // ... - - final AutocompleteOptions autocompleteOptions; - - const CustomTextFormField({ - // ... (остальные параметры) - required this.autocompleteOptions, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return alignment != null - ? Align( - alignment: alignment ?? Alignment.center, - child: autocompleteFieldWidget, - ) - : autocompleteFieldWidget; - } - - Widget get autocompleteFieldWidget => SizedBox( - width: width ?? double.maxFinite, - child: Autocomplete( - optionsBuilder: (TextEditingValue textEditingValue) { - if (textEditingValue.text == '') { - return const Iterable.empty(); - } - return autocompleteOptions.options.where((String option) { - return option - .toLowerCase() - .contains(textEditingValue.text.toLowerCase()); - }); - }, - onSelected: (String value) { - controller?.text = value; - onChanged?.call(value); - }, - fieldViewBuilder: (BuildContext context, - TextEditingController textEditingController, - FocusNode focusNode, - VoidCallback onFieldSubmitted) { - return TextFormField( - controller: textEditingController, - focusNode: focusNode, - autofocus: autofocus!, - style: textStyle ?? theme.textTheme.titleMedium, - obscureText: obscureText!, - textInputAction: textInputAction, - maxLines: maxLines ?? 1, - decoration: decoration, - validator: validator, - keyboardType: keyboardType, - onSaved: onSaved, - onChanged: onChanged, - inputFormatters: inputFormatters, - initialValue: initialValue, - onFieldSubmitted: (_) => onFieldSubmitted(), - ); - }, - optionsViewBuilder: (BuildContext context, - AutocompleteOnSelected onSelected, - Iterable options) { - return Material( - elevation: 4.0, - child: ListView( - children: options.map((String option) { - return ListTile( - title: Text(option), - onTap: () { - onSelected(option); - }, - ); - }).toList(), - ), - ); - }, - ), - ); -}*/ diff --git a/lib/widgets/custom_expandable_list.dart b/lib/widgets/custom_expandable_list.dart index e6f3878a..5f208327 100644 --- a/lib/widgets/custom_expandable_list.dart +++ b/lib/widgets/custom_expandable_list.dart @@ -1,4 +1,5 @@ import 'dart:convert'; + import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/localization/app_localization.dart'; diff --git a/lib/widgets/custom_icon_button.dart b/lib/widgets/custom_icon_button.dart deleted file mode 100644 index d029004a..00000000 --- a/lib/widgets/custom_icon_button.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'package:flutter/material.dart'; - -class CustomIconButton extends StatelessWidget { - CustomIconButton({ - Key? key, - this.alignment, - this.height, - this.width, - this.padding, - this.decoration, - this.child, - this.onTap, - }) : super(key: key); - - final Alignment? alignment; - final double? height; - final double? width; - final EdgeInsetsGeometry? padding; - final BoxDecoration? decoration; - final Widget? child; - final VoidCallback? onTap; - - @override - Widget build(BuildContext context) { - return alignment != null - ? Align( - alignment: alignment ?? Alignment.center, - child: _buildIconButtonWidget(), - ) - : _buildIconButtonWidget(); - } - - _buildIconButtonWidget() { - return SizedBox( - height: height ?? 0, - width: width ?? 0, - child: IconButton( - padding: EdgeInsets.zero, - icon: Container( - height: height ?? 0, - width: width ?? 0, - padding: padding ?? EdgeInsets.zero, - decoration: decoration ?? - BoxDecoration( - color: Colors.black, - borderRadius: const BorderRadius.all(Radius.circular(9)), - border: const Border.fromBorderSide( - BorderSide(color: Colors.blueGrey, width: 1), - ), - ), - child: child, - ), - onPressed: onTap, - ), - ); - } -} - -/// Extension on [CustomIconButton] to facilitate inclusion of all types of border style etc -extension IconButtonStyleHelper on CustomIconButton { - static BoxDecoration get fillBlueA => BoxDecoration( - color: Colors.blue, - borderRadius: const BorderRadius.all(Radius.circular(14)), - ); -} diff --git a/lib/widgets/custom_navigation_menu_item.dart b/lib/widgets/custom_navigation_menu_item.dart deleted file mode 100644 index 44522866..00000000 --- a/lib/widgets/custom_navigation_menu_item.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/custom_image_view.dart'; -import 'package:flutter/material.dart'; - -class MenuItem extends StatelessWidget { - final String icon; - final String text; - final VoidCallback onTap; - - const MenuItem({ - required this.icon, - required this.text, - required this.onTap, - }); - - @override - Widget build(BuildContext context) { - return InkWell( - onTap: onTap, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, // Выравнивание по центру вертикально - children: [ - CustomImageView( - color: appTheme.blueA400, - imagePath: icon, - height: 24.0, - width: 24.0, - ), - SizedBox( - width: 8.0, - ), // Добавляем небольшой отступ между иконкой и текстом - Text(text), - ], - ), - ), - ); - } -} diff --git a/lib/widgets/nutrition_chart.dart b/lib/widgets/nutrition_chart.dart deleted file mode 100644 index 05332f15..00000000 --- a/lib/widgets/nutrition_chart.dart +++ /dev/null @@ -1,89 +0,0 @@ -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/base_button.dart'; -import 'package:flutter/material.dart'; - -class NextStepButton extends BaseButton { - NextStepButton({ - Key? key, - this.decoration, - this.leftIcon, - this.rightIcon, - this.label, - VoidCallback? onPressed, - ButtonStyle? buttonStyle, - TextStyle? buttonTextStyle, - bool? isDisabled, - Alignment? alignment, - double? height, - double? width, - EdgeInsets? margin, - required String text, - }) : super( - text: text, - onPressed: onPressed, - buttonStyle: buttonStyle, - isDisabled: isDisabled, - buttonTextStyle: buttonTextStyle, - height: height, - alignment: alignment, - width: width, - margin: margin, - ); - - final BoxDecoration? decoration; - final Widget? leftIcon; - final Widget? rightIcon; - final Widget? label; - - @override - Widget build(BuildContext context) { - return (alignment != null) - ? Align( - alignment: alignment!, - child: Container( - height: this.height ?? 30, - width: this.width ?? double.maxFinite, - margin: margin, - decoration: decoration, - child: OutlinedButton( - style: buttonStyle, - onPressed: isDisabled ?? false ? null : onPressed ?? () {}, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - leftIcon ?? const SizedBox.shrink(), - Text( - text, - style: buttonTextStyle ?? theme.textTheme.titleSmall, - ), - rightIcon ?? const SizedBox.shrink(), - ], - ), - ), - ), - ) - : Container( - height: this.height ?? 30, - width: this.width ?? double.maxFinite, - margin: margin, - decoration: decoration, - child: OutlinedButton( - style: buttonStyle, - onPressed: isDisabled ?? false ? null : onPressed ?? () {}, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - leftIcon ?? const SizedBox.shrink(), - Text( - text, - style: buttonTextStyle ?? theme.textTheme.titleSmall, - ), - rightIcon ?? const SizedBox.shrink(), - ], - ), - ), - ); - } -} From 6c69bbbf413f9b918552d304da85b3cf525a1485 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 11 Sep 2024 17:39:00 +0300 Subject: [PATCH 18/31] refactor: add intl localization --- .../widgets/bottom_navigation_bar_widget.dart | 7 +- .../presentation/pages/diary_screen.dart | 8 +- .../pages/recipe_create_screen.dart | 3 +- .../pages/recipe_edit_screen.dart | 3 +- .../presentation/pages/allergies_screen.dart | 5 +- .../pages/blood_pressure_screen.dart | 19 +- .../pages/body_circumferences_screen.dart | 15 +- .../pages/credentials_screen.dart | 9 +- .../pages/date_of_birth_screen.dart | 5 +- .../pages/favorite_foods_screen.dart | 11 +- .../pages/favorite_sports_screen.dart | 5 +- .../presentation/pages/height_screen.dart | 5 +- .../pages/language_select_screen.dart | 7 +- .../pages/medicine_intake_screen.dart | 7 +- .../presentation/pages/name_screen.dart | 7 +- .../pages/registration_screen.dart | 41 +- .../presentation/pages/weight_screen.dart | 5 +- lib/generated/intl/messages_all.dart | 63 + lib/generated/intl/messages_en.dart | 174 +++ lib/generated/l10n.dart | 1048 +++++++++++++++++ .../ru_translations.dart => l10n/intl_en.arb} | 70 +- lib/localization/app_localization.dart | 61 - .../en_us/en_us_translations.dart | 63 - lib/main.dart | 16 +- lib/old/auth/auth_screen/auth_screen.dart | 20 +- .../my_profile_screen/my_profile_screen.dart | 34 +- lib/widgets/custom_expandable_list.dart | 45 +- pubspec.yaml | 3 + test/auth_test.dart | 21 +- 29 files changed, 1468 insertions(+), 312 deletions(-) create mode 100644 lib/generated/intl/messages_all.dart create mode 100644 lib/generated/intl/messages_en.dart create mode 100644 lib/generated/l10n.dart rename lib/{localization/ru/ru_translations.dart => l10n/intl_en.arb} (81%) delete mode 100644 lib/localization/app_localization.dart delete mode 100644 lib/localization/en_us/en_us_translations.dart diff --git a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart index 8bc6bb3d..f17bb065 100644 --- a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart +++ b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart @@ -6,7 +6,7 @@ import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/noti import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; @@ -59,6 +59,7 @@ class _BottomNavigationBarWidgetState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return Scaffold( body: widget.child, bottomNavigationBar: SizedBox( @@ -103,7 +104,7 @@ class _BottomNavigationBarWidgetState extends State { ), ), BottomNavigationBarItem( - label: "diary".tr, + label: s.diary, icon: Padding( padding: const EdgeInsets.only(bottom: 2), child: SvgPicture.asset( @@ -127,7 +128,7 @@ class _BottomNavigationBarWidgetState extends State { ), ), BottomNavigationBarItem( - label: "chat".tr, + label: s.chat, icon: BlocBuilder( builder: (BuildContext context, NewMessagesState state) { return badges.Badge( diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index e2287ddd..f6825d9c 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -1,5 +1,3 @@ -// ignore_for_file: unused_local_variable - import 'package:carousel_slider_plus/carousel_slider_plus.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; @@ -10,7 +8,6 @@ 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/localization/app_localization.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; @@ -372,7 +369,6 @@ class DiaryScreen extends StatelessWidget { _buildMeal(BuildContext context, DiaryStateLoaded state) { final digitsOnly = FilteringTextInputFormatter.digitsOnly; List _options = state.autocompleteList.map((Product item) => item.name).toList(); - FocusNode focusNodeName = FocusNode(); return Container( padding: EdgeInsets.symmetric( horizontal: 24, @@ -781,7 +777,7 @@ class DiaryScreen extends StatelessWidget { bottom: 4, ), child: Text( - portion.quantity.toString() + ' ' + portion.portion.toString().tr, + portion.quantity.toString() + ' ' + portion.portion.toString(), ), ), Spacer(), @@ -839,7 +835,7 @@ class DiaryScreen extends StatelessWidget { bottom: 4, ), child: Text( - portion.quantity.toString() + ' ' + portion.portion.toString().tr, + portion.quantity.toString() + ' ' + portion.portion.toString(), ), ), ], diff --git a/lib/features/recipes/presentation/pages/recipe_create_screen.dart b/lib/features/recipes/presentation/pages/recipe_create_screen.dart index e4ac3b8b..947b2784 100644 --- a/lib/features/recipes/presentation/pages/recipe_create_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_create_screen.dart @@ -7,7 +7,6 @@ import 'package:eatvio_app/features/recipes/models/recipe_model.dart'; import 'package:eatvio_app/features/recipes/models/step.dart' as step; import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_cubit.dart'; import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_state.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; @@ -422,7 +421,7 @@ class RecipeCreateScreen extends StatelessWidget { bottom: 4, ), child: Text( - ingredient.portion.toString() + ' ' + ingredient.unit.toString().tr, + ingredient.portion.toString() + ' ' + ingredient.unit.toString(), ), ), Spacer(), diff --git a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart index 5bae7dba..a5abe676 100644 --- a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart @@ -5,7 +5,6 @@ import 'package:eatvio_app/features/recipes/models/recipe_model.dart'; import 'package:eatvio_app/features/recipes/models/step.dart' as step; import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_cubit.dart'; import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_state.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; @@ -430,7 +429,7 @@ class RecipeEditScreen extends StatelessWidget { bottom: 4, ), child: Text( - ingredient.portion.toString() + ' ' + ingredient.unit.toString().tr, + ingredient.portion.toString() + ' ' + ingredient.unit.toString(), ), ), Spacer(), diff --git a/lib/features/registration/presentation/pages/allergies_screen.dart b/lib/features/registration/presentation/pages/allergies_screen.dart index d0df3b8d..430c4438 100644 --- a/lib/features/registration/presentation/pages/allergies_screen.dart +++ b/lib/features/registration/presentation/pages/allergies_screen.dart @@ -1,6 +1,6 @@ import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -27,12 +27,13 @@ class _AllergiesScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("allergies_presence".tr), + Text(s.allergies_presence), SizedBox(height: 4), CustomTextFormField( controller: enterInformationController, diff --git a/lib/features/registration/presentation/pages/blood_pressure_screen.dart b/lib/features/registration/presentation/pages/blood_pressure_screen.dart index 8b735b00..5d390876 100644 --- a/lib/features/registration/presentation/pages/blood_pressure_screen.dart +++ b/lib/features/registration/presentation/pages/blood_pressure_screen.dart @@ -2,7 +2,7 @@ import 'package:eatvio_app/core/utils/image_constant.dart'; import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:eatvio_app/widgets/custom_image_view.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; @@ -53,38 +53,39 @@ class _BloodPressureScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("up_pressure".tr), + Text(s.up_pressure), SizedBox(height: 4), CustomTextFormField( inputFormatters: [digitsOnly], controller: upPressureController, autofocus: true, focusNode: upFocusNode, - hintText: "90".tr, + hintText: "90", onChanged: (newValue) { final registrationCubit = context.read(); registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(bloodPressureUp: int.parse(newValue))); }, ), SizedBox(height: 16), - Text("down_pressure".tr), + Text(s.down_pressure), SizedBox(height: 4), CustomTextFormField( inputFormatters: [digitsOnly], controller: downPressureController, - hintText: "90".tr, + hintText: '90', onChanged: (newValue) { final registrationCubit = context.read(); registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(bloodPressureDown: int.parse(newValue))); }, ), SizedBox(height: 16), - Text("do_you_have_hypotension_tendency".tr), + Text(s.do_you_have_hypotension_tendency), SizedBox(height: 4), CustomDropDown( icon: Container( @@ -98,7 +99,7 @@ class _BloodPressureScreenState extends State { width: 16, ), ), - hintText: "Не выбрано".tr, + hintText: "Не выбрано", items: selectionPopupList, value: selectedPopupHypo, onChanged: (newPopup) { @@ -110,7 +111,7 @@ class _BloodPressureScreenState extends State { }, ), SizedBox(height: 16), - Text("do_you_have_hypertension_tendency".tr), + Text(s.do_you_have_hypertension_tendency), SizedBox(height: 4), CustomDropDown( icon: Container( @@ -124,7 +125,7 @@ class _BloodPressureScreenState extends State { width: 16, ), ), - hintText: "Не выбрано".tr, + hintText: "Не выбрано", items: selectionPopupList, value: selectedPopupHyper, onChanged: (newPopup) { diff --git a/lib/features/registration/presentation/pages/body_circumferences_screen.dart b/lib/features/registration/presentation/pages/body_circumferences_screen.dart index 0e692512..0f6fc0f2 100644 --- a/lib/features/registration/presentation/pages/body_circumferences_screen.dart +++ b/lib/features/registration/presentation/pages/body_circumferences_screen.dart @@ -1,6 +1,6 @@ import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -33,43 +33,44 @@ class _BodyCircumferencesScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("chest_circumference".tr), + Text(s.chest_circumference), SizedBox(height: 4), CustomTextFormField( inputFormatters: [digitsOnly], autofocus: true, focusNode: chestFocus, controller: chestCircumferenceController, - hintText: "90".tr, + hintText: '90', onChanged: (value) { final registrationCubit = context.read(); registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(chestCircumference: int.parse(value))); }, ), SizedBox(height: 16), - Text("waist_circumference".tr), + Text(s.waist_circumference), SizedBox(height: 4), CustomTextFormField( inputFormatters: [digitsOnly], controller: waistCircumferenceController, - hintText: "60".tr, + hintText: "60", onChanged: (value) { final registrationCubit = context.read(); registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(waistCircumference: int.parse(value))); }, ), SizedBox(height: 16), - Text("hip_circumference".tr), + Text(s.hip_circumference), SizedBox(height: 4), CustomTextFormField( inputFormatters: [digitsOnly], controller: hipCircumferenceController, - hintText: "90".tr, + hintText: '90', textInputAction: TextInputAction.done, onChanged: (value) { final registrationCubit = context.read(); diff --git a/lib/features/registration/presentation/pages/credentials_screen.dart b/lib/features/registration/presentation/pages/credentials_screen.dart index cc06048d..325b3d89 100644 --- a/lib/features/registration/presentation/pages/credentials_screen.dart +++ b/lib/features/registration/presentation/pages/credentials_screen.dart @@ -1,6 +1,6 @@ import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -31,13 +31,14 @@ class _CredentialsScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("email".tr), + Text(s.email), SizedBox(height: 4), CustomTextFormField( controller: emailController, @@ -51,7 +52,7 @@ class _CredentialsScreenState extends State { }, ), SizedBox(height: 16), - Text("password".tr), + Text(s.password), SizedBox(height: 4), CustomTextFormField( obscureText: true, @@ -64,7 +65,7 @@ class _CredentialsScreenState extends State { }, ), SizedBox(height: 16), - Text("password_confirmation".tr), + Text(s.password_confirmation), SizedBox(height: 4), CustomTextFormField( obscureText: true, diff --git a/lib/features/registration/presentation/pages/date_of_birth_screen.dart b/lib/features/registration/presentation/pages/date_of_birth_screen.dart index 2270e3c6..cf5c354b 100644 --- a/lib/features/registration/presentation/pages/date_of_birth_screen.dart +++ b/lib/features/registration/presentation/pages/date_of_birth_screen.dart @@ -1,7 +1,7 @@ import 'package:eatvio_app/core/utils/date_time_utils.dart'; import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -34,12 +34,13 @@ class _DateOfBirthScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("date_of_birth".tr), + Text(s.date_of_birth), SizedBox(height: 4), ListTile( onTap: onTapCalendar(context), diff --git a/lib/features/registration/presentation/pages/favorite_foods_screen.dart b/lib/features/registration/presentation/pages/favorite_foods_screen.dart index 29fad0db..2de9c71c 100644 --- a/lib/features/registration/presentation/pages/favorite_foods_screen.dart +++ b/lib/features/registration/presentation/pages/favorite_foods_screen.dart @@ -1,6 +1,6 @@ import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -29,16 +29,17 @@ class _FavoriteFoodsScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("favorite_foods".tr), + Text(s.favorite_foods), SizedBox(height: 4), CustomTextFormField( controller: favoriteFoodsController, - hintText: "enter_information".tr, + hintText: s.enter_information, maxLines: 7, minLines: 2, focusNode: favoriteFocusNode, @@ -49,11 +50,11 @@ class _FavoriteFoodsScreenState extends State { }, ), SizedBox(height: 16), - Text("unfavorite_foods".tr), + Text(s.unfavorite_foods), SizedBox(height: 4), CustomTextFormField( controller: unFavoriteFoodsController, - hintText: "enter_information".tr, + hintText: s.enter_information, textInputAction: TextInputAction.done, maxLines: 7, minLines: 2, diff --git a/lib/features/registration/presentation/pages/favorite_sports_screen.dart b/lib/features/registration/presentation/pages/favorite_sports_screen.dart index 3a746e11..bf54612e 100644 --- a/lib/features/registration/presentation/pages/favorite_sports_screen.dart +++ b/lib/features/registration/presentation/pages/favorite_sports_screen.dart @@ -1,6 +1,6 @@ import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -27,12 +27,13 @@ class _FavoriteSportsScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("your_favorite_sports".tr), + Text(s.your_favorite_sports), SizedBox(height: 4), CustomTextFormField( controller: enterInformationController, diff --git a/lib/features/registration/presentation/pages/height_screen.dart b/lib/features/registration/presentation/pages/height_screen.dart index 2753784a..93ab620b 100644 --- a/lib/features/registration/presentation/pages/height_screen.dart +++ b/lib/features/registration/presentation/pages/height_screen.dart @@ -1,6 +1,6 @@ import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -28,12 +28,13 @@ class _HeightScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("your_height".tr), + Text(s.your_height), SizedBox(height: 4), CustomTextFormField( textInputAction: TextInputAction.done, diff --git a/lib/features/registration/presentation/pages/language_select_screen.dart b/lib/features/registration/presentation/pages/language_select_screen.dart index a9c3dbb5..ed167fc1 100644 --- a/lib/features/registration/presentation/pages/language_select_screen.dart +++ b/lib/features/registration/presentation/pages/language_select_screen.dart @@ -1,7 +1,7 @@ import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -36,18 +36,19 @@ class _LanguageSelectScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, right: 16, left: 16, top: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "preferred_language".tr, + s.preferred_language, ), const SizedBox(height: 4), CustomDropDown( value: value, - hintText: "Не выбрано".tr, + hintText: "Не выбрано", items: dropdownItemList, onChanged: (SelectionPopupModel newValue) => setState(() { value = newValue; diff --git a/lib/features/registration/presentation/pages/medicine_intake_screen.dart b/lib/features/registration/presentation/pages/medicine_intake_screen.dart index 86e09604..2383bd16 100644 --- a/lib/features/registration/presentation/pages/medicine_intake_screen.dart +++ b/lib/features/registration/presentation/pages/medicine_intake_screen.dart @@ -1,6 +1,6 @@ import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -27,16 +27,17 @@ class _MedicineIntakeScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("do_you_take_pills".tr), + Text(s.do_you_take_pills), SizedBox(height: 4), CustomTextFormField( controller: enterInformationController, - hintText: "enter_information".tr, + hintText: s.enter_information, textInputAction: TextInputAction.done, focusNode: infoFocusNode, autofocus: true, diff --git a/lib/features/registration/presentation/pages/name_screen.dart b/lib/features/registration/presentation/pages/name_screen.dart index e92ce31a..efb81f63 100644 --- a/lib/features/registration/presentation/pages/name_screen.dart +++ b/lib/features/registration/presentation/pages/name_screen.dart @@ -1,6 +1,6 @@ import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -29,12 +29,13 @@ class _NameScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("first_name".tr), + Text(s.first_name), SizedBox(height: 4), CustomTextFormField( controller: firstNameController, @@ -47,7 +48,7 @@ class _NameScreenState extends State { }, ), SizedBox(height: 16), - Text("last_name".tr), + Text(s.last_name), SizedBox(height: 4), CustomTextFormField( controller: lastNameController, diff --git a/lib/features/registration/presentation/pages/registration_screen.dart b/lib/features/registration/presentation/pages/registration_screen.dart index 1b01acda..aa3ca881 100644 --- a/lib/features/registration/presentation/pages/registration_screen.dart +++ b/lib/features/registration/presentation/pages/registration_screen.dart @@ -16,7 +16,7 @@ import 'package:eatvio_app/features/registration/presentation/pages/language_sel import 'package:eatvio_app/features/registration/presentation/pages/medicine_intake_screen.dart'; import 'package:eatvio_app/features/registration/presentation/pages/name_screen.dart'; import 'package:eatvio_app/features/registration/presentation/pages/weight_screen.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart'; @@ -180,7 +180,12 @@ class _RegistrationScreenState extends State { Future canGoNext(RegistrationState state) async { switch (step) { case 2: - List errors = validateCredentialsFields(state.sheet.email, state.sheet.password, state.sheet.passwordConfirmation); + List errors = validateCredentialsFields( + state.sheet.email, + state.sheet.password, + state.sheet.passwordConfirmation, + context, + ); if (errors.isEmpty) { return true; } else { @@ -209,6 +214,7 @@ class _RegistrationScreenState extends State { List errors = validateNameFields( state.sheet.firstName.toString(), state.sheet.lastName.toString(), + context, ); if (errors.isEmpty) { return true; @@ -277,6 +283,7 @@ class _RegistrationScreenState extends State { state.sheet.chestCircumference.toString(), state.sheet.waistCircumference.toString(), state.sheet.hipCircumference.toString(), + context, ); if (errors.isEmpty) { return true; @@ -336,43 +343,57 @@ class _RegistrationScreenState extends State { String chestCircumference, String waistCircumference, String hipCircumference, + BuildContext context, ) { + final s = S.of(context); + List errors = []; if (chestCircumference.isEmpty | waistCircumference.isEmpty | hipCircumference.isEmpty) { - errors.add('circumference_empty'.tr); + errors.add(s.circumference_empty); } if (![chestCircumference, waistCircumference, hipCircumference].every((circumference) => int.tryParse(circumference) != null)) { - errors.add('circumference_is_not_a_number'.tr); + errors.add(s.circumference_is_not_a_number); } return errors; } - List validateCredentialsFields(String email, String password, String passwordConfirmation) { + List validateCredentialsFields( + String email, + String password, + String passwordConfirmation, + BuildContext context, + ) { + final s = S.of(context); + List errors = []; if (!isEmail(email)) { - errors.add('email_invalid'.tr); + errors.add(s.email_invalid); } if (email.isEmpty) { - errors.add('email_empty'.tr); + errors.add(s.email_empty); } if (password.length < 6) { - errors.add('password_short'.tr); + errors.add(s.password_short); } if (password != passwordConfirmation) { - errors.add('password_confirmation_mismatch'.tr); + errors.add(s.password_confirmation_mismatch); } return errors; } - List validateNameFields(String firstName, String lastName) { + List validateNameFields( + String firstName, + String lastName, + BuildContext context, + ) { List errors = []; if (firstName.isEmpty) { diff --git a/lib/features/registration/presentation/pages/weight_screen.dart b/lib/features/registration/presentation/pages/weight_screen.dart index 622cc772..4f8e9b9f 100644 --- a/lib/features/registration/presentation/pages/weight_screen.dart +++ b/lib/features/registration/presentation/pages/weight_screen.dart @@ -1,6 +1,6 @@ import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -28,12 +28,13 @@ class _WeightScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("your_weight".tr), + Text(s.your_weight), SizedBox(height: 4), CustomTextFormField( autofocus: true, diff --git a/lib/generated/intl/messages_all.dart b/lib/generated/intl/messages_all.dart new file mode 100644 index 00000000..203415cc --- /dev/null +++ b/lib/generated/intl/messages_all.dart @@ -0,0 +1,63 @@ +// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart +// This is a library that looks up messages for specific locales by +// delegating to the appropriate library. + +// Ignore issues from commonly used lints in this file. +// ignore_for_file:implementation_imports, file_names, unnecessary_new +// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering +// ignore_for_file:argument_type_not_assignable, invalid_assignment +// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases +// ignore_for_file:comment_references + +import 'dart:async'; + +import 'package:flutter/foundation.dart'; +import 'package:intl/intl.dart'; +import 'package:intl/message_lookup_by_library.dart'; +import 'package:intl/src/intl_helpers.dart'; + +import 'messages_en.dart' as messages_en; + +typedef Future LibraryLoader(); +Map _deferredLibraries = { + 'en': () => new SynchronousFuture(null), +}; + +MessageLookupByLibrary? _findExact(String localeName) { + switch (localeName) { + case 'en': + return messages_en.messages; + default: + return null; + } +} + +/// User programs should call this before using [localeName] for messages. +Future initializeMessages(String localeName) { + var availableLocale = Intl.verifiedLocale( + localeName, (locale) => _deferredLibraries[locale] != null, + onFailure: (_) => null); + if (availableLocale == null) { + return new SynchronousFuture(false); + } + var lib = _deferredLibraries[availableLocale]; + lib == null ? new SynchronousFuture(false) : lib(); + initializeInternalMessageLookup(() => new CompositeMessageLookup()); + messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor); + return new SynchronousFuture(true); +} + +bool _messagesExistFor(String locale) { + try { + return _findExact(locale) != null; + } catch (e) { + return false; + } +} + +MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { + var actualLocale = + Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); + if (actualLocale == null) return null; + return _findExact(actualLocale); +} diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart new file mode 100644 index 00000000..2fee5ba3 --- /dev/null +++ b/lib/generated/intl/messages_en.dart @@ -0,0 +1,174 @@ +// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart +// This is a library that provides messages for a en locale. All the +// messages from the main program should be duplicated here with the same +// function name. + +// Ignore issues from commonly used lints in this file. +// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new +// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering +// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases +// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes +// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes + +import 'package:intl/intl.dart'; +import 'package:intl/message_lookup_by_library.dart'; + +final messages = new MessageLookup(); + +typedef String MessageIfAbsent(String messageStr, List args); + +class MessageLookup extends MessageLookupByLibrary { + String get localeName => 'en'; + + final messages = _notInlinedMessages(_notInlinedMessages); + static Map _notInlinedMessages(_) => { + "Moscow": MessageLookupByLibrary.simpleMessage("Москва"), + "Russia": MessageLookupByLibrary.simpleMessage("Россия"), + "active": MessageLookupByLibrary.simpleMessage("Активен"), + "add_measure": MessageLookupByLibrary.simpleMessage("Добавить замер"), + "additional_information": + MessageLookupByLibrary.simpleMessage("Дополнительная информация"), + "admin": MessageLookupByLibrary.simpleMessage("Админ"), + "allergies_presence": + MessageLookupByLibrary.simpleMessage("Наличие аллергии"), + "archived": MessageLookupByLibrary.simpleMessage("В архиве"), + "authentificate": MessageLookupByLibrary.simpleMessage("Войти"), + "average_pressure": MessageLookupByLibrary.simpleMessage( + "Средние показатели давления:"), + "bodymass_chart": MessageLookupByLibrary.simpleMessage("График ИМТ"), + "chat": MessageLookupByLibrary.simpleMessage("Чат"), + "chest": MessageLookupByLibrary.simpleMessage("Грудь"), + "chest_circumference": + MessageLookupByLibrary.simpleMessage("Обхват груди"), + "circumference_empty": MessageLookupByLibrary.simpleMessage( + "Все замеры обязательны к заполнению"), + "circumference_is_not_a_number": MessageLookupByLibrary.simpleMessage( + "Все замеры должны быть числами"), + "circumferences_chart": + MessageLookupByLibrary.simpleMessage("График обхватов"), + "city": MessageLookupByLibrary.simpleMessage("Город"), + "city_of_living": + MessageLookupByLibrary.simpleMessage("Город проживания"), + "continueButton": MessageLookupByLibrary.simpleMessage("Продолжить"), + "country": MessageLookupByLibrary.simpleMessage("Страна"), + "date_of_birth": MessageLookupByLibrary.simpleMessage("Дата рождения"), + "diary": MessageLookupByLibrary.simpleMessage("Дневник"), + "do_you_have_hypertension_tendency": + MessageLookupByLibrary.simpleMessage("Есть ли у вас гипертония?"), + "do_you_have_hypotension_tendency": + MessageLookupByLibrary.simpleMessage("Есть ли у вас гипотония?"), + "do_you_take_pills": MessageLookupByLibrary.simpleMessage( + "Принимаете ли вы лекарства или бады?"), + "down_pressure": + MessageLookupByLibrary.simpleMessage("Нижние показатели давления:"), + "draft": MessageLookupByLibrary.simpleMessage("Черновик"), + "email": MessageLookupByLibrary.simpleMessage("Элетронная почта"), + "email_empty": MessageLookupByLibrary.simpleMessage( + "Необходимо ввести адрес электронной почты"), + "email_invalid": MessageLookupByLibrary.simpleMessage( + "Некорректный адрес электронной почты"), + "enter_additional_information": MessageLookupByLibrary.simpleMessage( + "Введите любую дополнительную информацию на своё усмотрение:"), + "enter_information": + MessageLookupByLibrary.simpleMessage("Введите информацию..."), + "exit": MessageLookupByLibrary.simpleMessage("Выйти"), + "favorite_foods": + MessageLookupByLibrary.simpleMessage("Любимые продукты"), + "favorite_unfavorite_foods": MessageLookupByLibrary.simpleMessage( + "Ваши любимые/нелюбимые продукты питания?"), + "female": MessageLookupByLibrary.simpleMessage("Женский"), + "fill_in_information": + MessageLookupByLibrary.simpleMessage("Заполните информацию:"), + "finish": MessageLookupByLibrary.simpleMessage("Завершить"), + "first_name": MessageLookupByLibrary.simpleMessage("Имя"), + "first_name_empty": MessageLookupByLibrary.simpleMessage( + "Имя обязательно для заполнения"), + "first_name_short": MessageLookupByLibrary.simpleMessage( + "В имени должен быть минимум 1 символ"), + "gr": MessageLookupByLibrary.simpleMessage("гр"), + "grams": MessageLookupByLibrary.simpleMessage("гр"), + "height_measurements": + MessageLookupByLibrary.simpleMessage("Замер роста"), + "hip_circumference": + MessageLookupByLibrary.simpleMessage("Обхват бедер"), + "hips": MessageLookupByLibrary.simpleMessage("Бедра"), + "in_progress": MessageLookupByLibrary.simpleMessage("В процессе"), + "initial_measurements": + MessageLookupByLibrary.simpleMessage("Первичные замеры"), + "language": MessageLookupByLibrary.simpleMessage("Язык:"), + "last_name": MessageLookupByLibrary.simpleMessage("Фамилия"), + "last_name_empty": MessageLookupByLibrary.simpleMessage( + "Фамилия обязательна для заполнения"), + "last_name_short": MessageLookupByLibrary.simpleMessage( + "В фамилии должен быть минимум 6 символов"), + "lbl_english": MessageLookupByLibrary.simpleMessage("English"), + "loading": MessageLookupByLibrary.simpleMessage("Загрузка..."), + "male": MessageLookupByLibrary.simpleMessage("Мужской"), + "msg_network_err": + MessageLookupByLibrary.simpleMessage("Сетевая ошибка!"), + "msg_something_went_wrong": + MessageLookupByLibrary.simpleMessage("Что то пошло не так!"), + "my_blog": MessageLookupByLibrary.simpleMessage("Мой блог"), + "my_settings": MessageLookupByLibrary.simpleMessage("Мои настройки"), + "name_empty": MessageLookupByLibrary.simpleMessage( + "Имя пользователя обязательно для заполнения"), + "name_short": MessageLookupByLibrary.simpleMessage( + "В имени пользователя должно быть минимум 6 символов"), + "no": MessageLookupByLibrary.simpleMessage("Нет"), + "no_account": + MessageLookupByLibrary.simpleMessage("У меня нет аккаунта"), + "password": MessageLookupByLibrary.simpleMessage("Пароль"), + "password_confirmation": + MessageLookupByLibrary.simpleMessage("Подтвердите пароль"), + "password_confirmation_mismatch": + MessageLookupByLibrary.simpleMessage("Пароли не совпадают"), + "password_empty": MessageLookupByLibrary.simpleMessage( + "Пароль обязателен для заполнения"), + "password_short": MessageLookupByLibrary.simpleMessage( + "В пароле должно быть минимум 6 символов"), + "pcs": MessageLookupByLibrary.simpleMessage("шт"), + "place_of_living": + MessageLookupByLibrary.simpleMessage("Место проживания"), + "plans_complete": + MessageLookupByLibrary.simpleMessage("Пройденные планы"), + "preferred_language": + MessageLookupByLibrary.simpleMessage("Предпочитаемый язык общения"), + "pressure_empty": MessageLookupByLibrary.simpleMessage( + "Все показатели давления обязательны к заполнению"), + "pressure_is_not_a_number": MessageLookupByLibrary.simpleMessage( + "Все показатели давления должны быть числами"), + "profile": MessageLookupByLibrary.simpleMessage("Профиль"), + "save": MessageLookupByLibrary.simpleMessage("Сохранить"), + "skip": MessageLookupByLibrary.simpleMessage("Пропустить"), + "tell_your_schedule": MessageLookupByLibrary.simpleMessage( + "Расскажите в свободной форме о том как просыпаетесь, когда едите, когда ложитесь спать:"), + "unfavorite_foods": + MessageLookupByLibrary.simpleMessage("Нелюбимые продукты"), + "up_pressure": MessageLookupByLibrary.simpleMessage( + "Верхние показатели давления:"), + "user_authorization": + MessageLookupByLibrary.simpleMessage("Аутентификация"), + "user_registration": + MessageLookupByLibrary.simpleMessage("Регистрация пользователя"), + "username": MessageLookupByLibrary.simpleMessage("Имя пользователя"), + "waist": MessageLookupByLibrary.simpleMessage("Талия"), + "waist_circumference": + MessageLookupByLibrary.simpleMessage("Обхват талии"), + "weight": MessageLookupByLibrary.simpleMessage("Вес"), + "weight_chart": MessageLookupByLibrary.simpleMessage("График веса"), + "weight_measurements": + MessageLookupByLibrary.simpleMessage("Замер веса"), + "what_is_your_name": + MessageLookupByLibrary.simpleMessage("Как вас зовут?"), + "wrong_credentials": MessageLookupByLibrary.simpleMessage( + "Неверные данные пользователя"), + "your_blood_pressure": + MessageLookupByLibrary.simpleMessage("Ваше артериальное давление?"), + "your_favorite_sports": + MessageLookupByLibrary.simpleMessage("Ваши спортивные увлечения?"), + "your_gender": MessageLookupByLibrary.simpleMessage("Ваш пол?"), + "your_height": MessageLookupByLibrary.simpleMessage("Ваш рост:"), + "your_schedule": MessageLookupByLibrary.simpleMessage("Ваш режим дня?"), + "your_weight": MessageLookupByLibrary.simpleMessage("Ваш вес:") + }; +} diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart new file mode 100644 index 00000000..8440a2b7 --- /dev/null +++ b/lib/generated/l10n.dart @@ -0,0 +1,1048 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'intl/messages_all.dart'; + +// ************************************************************************** +// Generator: Flutter Intl IDE plugin +// Made by Localizely +// ************************************************************************** + +// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars +// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each +// ignore_for_file: avoid_redundant_argument_values, avoid_escaping_inner_quotes + +class S { + S(); + + static S? _current; + + static S get current { + assert(_current != null, + 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); + return _current!; + } + + static const AppLocalizationDelegate delegate = AppLocalizationDelegate(); + + static Future load(Locale locale) { + final name = (locale.countryCode?.isEmpty ?? false) + ? locale.languageCode + : locale.toString(); + final localeName = Intl.canonicalizedLocale(name); + return initializeMessages(localeName).then((_) { + Intl.defaultLocale = localeName; + final instance = S(); + S._current = instance; + + return instance; + }); + } + + static S of(BuildContext context) { + final instance = S.maybeOf(context); + assert(instance != null, + 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); + return instance!; + } + + static S? maybeOf(BuildContext context) { + return Localizations.of(context, S); + } + + /// `Регистрация пользователя` + String get user_registration { + return Intl.message( + 'Регистрация пользователя', + name: 'user_registration', + desc: '', + args: [], + ); + } + + /// `Элетронная почта` + String get email { + return Intl.message( + 'Элетронная почта', + name: 'email', + desc: '', + args: [], + ); + } + + /// `Имя пользователя` + String get username { + return Intl.message( + 'Имя пользователя', + name: 'username', + desc: '', + args: [], + ); + } + + /// `Пароль` + String get password { + return Intl.message( + 'Пароль', + name: 'password', + desc: '', + args: [], + ); + } + + /// `Подтвердите пароль` + String get password_confirmation { + return Intl.message( + 'Подтвердите пароль', + name: 'password_confirmation', + desc: '', + args: [], + ); + } + + /// `Неверные данные пользователя` + String get wrong_credentials { + return Intl.message( + 'Неверные данные пользователя', + name: 'wrong_credentials', + desc: '', + args: [], + ); + } + + /// `Имя` + String get first_name { + return Intl.message( + 'Имя', + name: 'first_name', + desc: '', + args: [], + ); + } + + /// `Фамилия` + String get last_name { + return Intl.message( + 'Фамилия', + name: 'last_name', + desc: '', + args: [], + ); + } + + /// `Как вас зовут?` + String get what_is_your_name { + return Intl.message( + 'Как вас зовут?', + name: 'what_is_your_name', + desc: '', + args: [], + ); + } + + /// `Дата рождения` + String get date_of_birth { + return Intl.message( + 'Дата рождения', + name: 'date_of_birth', + desc: '', + args: [], + ); + } + + /// `Страна` + String get country { + return Intl.message( + 'Страна', + name: 'country', + desc: '', + args: [], + ); + } + + /// `Россия` + String get Russia { + return Intl.message( + 'Россия', + name: 'Russia', + desc: '', + args: [], + ); + } + + /// `Город` + String get city { + return Intl.message( + 'Город', + name: 'city', + desc: '', + args: [], + ); + } + + /// `Москва` + String get Moscow { + return Intl.message( + 'Москва', + name: 'Moscow', + desc: '', + args: [], + ); + } + + /// `Место проживания` + String get place_of_living { + return Intl.message( + 'Место проживания', + name: 'place_of_living', + desc: '', + args: [], + ); + } + + /// `Обхват бедер` + String get hip_circumference { + return Intl.message( + 'Обхват бедер', + name: 'hip_circumference', + desc: '', + args: [], + ); + } + + /// `Обхват груди` + String get chest_circumference { + return Intl.message( + 'Обхват груди', + name: 'chest_circumference', + desc: '', + args: [], + ); + } + + /// `Обхват талии` + String get waist_circumference { + return Intl.message( + 'Обхват талии', + name: 'waist_circumference', + desc: '', + args: [], + ); + } + + /// `Первичные замеры` + String get initial_measurements { + return Intl.message( + 'Первичные замеры', + name: 'initial_measurements', + desc: '', + args: [], + ); + } + + /// `Мужской` + String get male { + return Intl.message( + 'Мужской', + name: 'male', + desc: '', + args: [], + ); + } + + /// `Женский` + String get female { + return Intl.message( + 'Женский', + name: 'female', + desc: '', + args: [], + ); + } + + /// `Замер веса` + String get weight_measurements { + return Intl.message( + 'Замер веса', + name: 'weight_measurements', + desc: '', + args: [], + ); + } + + /// `Ваш вес:` + String get your_weight { + return Intl.message( + 'Ваш вес:', + name: 'your_weight', + desc: '', + args: [], + ); + } + + /// `Замер роста` + String get height_measurements { + return Intl.message( + 'Замер роста', + name: 'height_measurements', + desc: '', + args: [], + ); + } + + /// `Ваш рост:` + String get your_height { + return Intl.message( + 'Ваш рост:', + name: 'your_height', + desc: '', + args: [], + ); + } + + /// `Наличие аллергии` + String get allergies_presence { + return Intl.message( + 'Наличие аллергии', + name: 'allergies_presence', + desc: '', + args: [], + ); + } + + /// `Принимаете ли вы лекарства или бады?` + String get do_you_take_pills { + return Intl.message( + 'Принимаете ли вы лекарства или бады?', + name: 'do_you_take_pills', + desc: '', + args: [], + ); + } + + /// `Ваш пол?` + String get your_gender { + return Intl.message( + 'Ваш пол?', + name: 'your_gender', + desc: '', + args: [], + ); + } + + /// `Нет` + String get no { + return Intl.message( + 'Нет', + name: 'no', + desc: '', + args: [], + ); + } + + /// `Есть ли у вас гипертония?` + String get do_you_have_hypertension_tendency { + return Intl.message( + 'Есть ли у вас гипертония?', + name: 'do_you_have_hypertension_tendency', + desc: '', + args: [], + ); + } + + /// `Ваше артериальное давление?` + String get your_blood_pressure { + return Intl.message( + 'Ваше артериальное давление?', + name: 'your_blood_pressure', + desc: '', + args: [], + ); + } + + /// `Средние показатели давления:` + String get average_pressure { + return Intl.message( + 'Средние показатели давления:', + name: 'average_pressure', + desc: '', + args: [], + ); + } + + /// `Верхние показатели давления:` + String get up_pressure { + return Intl.message( + 'Верхние показатели давления:', + name: 'up_pressure', + desc: '', + args: [], + ); + } + + /// `Нижние показатели давления:` + String get down_pressure { + return Intl.message( + 'Нижние показатели давления:', + name: 'down_pressure', + desc: '', + args: [], + ); + } + + /// `Есть ли у вас гипотония?` + String get do_you_have_hypotension_tendency { + return Intl.message( + 'Есть ли у вас гипотония?', + name: 'do_you_have_hypotension_tendency', + desc: '', + args: [], + ); + } + + /// `Ваши спортивные увлечения?` + String get your_favorite_sports { + return Intl.message( + 'Ваши спортивные увлечения?', + name: 'your_favorite_sports', + desc: '', + args: [], + ); + } + + /// `Любимые продукты` + String get favorite_foods { + return Intl.message( + 'Любимые продукты', + name: 'favorite_foods', + desc: '', + args: [], + ); + } + + /// `Ваши любимые/нелюбимые продукты питания?` + String get favorite_unfavorite_foods { + return Intl.message( + 'Ваши любимые/нелюбимые продукты питания?', + name: 'favorite_unfavorite_foods', + desc: '', + args: [], + ); + } + + /// `Нелюбимые продукты` + String get unfavorite_foods { + return Intl.message( + 'Нелюбимые продукты', + name: 'unfavorite_foods', + desc: '', + args: [], + ); + } + + /// `Ваш режим дня?` + String get your_schedule { + return Intl.message( + 'Ваш режим дня?', + name: 'your_schedule', + desc: '', + args: [], + ); + } + + /// `Расскажите в свободной форме о том как просыпаетесь, когда едите, когда ложитесь спать:` + String get tell_your_schedule { + return Intl.message( + 'Расскажите в свободной форме о том как просыпаетесь, когда едите, когда ложитесь спать:', + name: 'tell_your_schedule', + desc: '', + args: [], + ); + } + + /// `Дополнительная информация` + String get additional_information { + return Intl.message( + 'Дополнительная информация', + name: 'additional_information', + desc: '', + args: [], + ); + } + + /// `Введите любую дополнительную информацию на своё усмотрение:` + String get enter_additional_information { + return Intl.message( + 'Введите любую дополнительную информацию на своё усмотрение:', + name: 'enter_additional_information', + desc: '', + args: [], + ); + } + + /// `English` + String get lbl_english { + return Intl.message( + 'English', + name: 'lbl_english', + desc: '', + args: [], + ); + } + + /// `Завершить` + String get finish { + return Intl.message( + 'Завершить', + name: 'finish', + desc: '', + args: [], + ); + } + + /// `Предпочитаемый язык общения` + String get preferred_language { + return Intl.message( + 'Предпочитаемый язык общения', + name: 'preferred_language', + desc: '', + args: [], + ); + } + + /// `Продолжить` + String get continueButton { + return Intl.message( + 'Продолжить', + name: 'continueButton', + desc: '', + args: [], + ); + } + + /// `Пропустить` + String get skip { + return Intl.message( + 'Пропустить', + name: 'skip', + desc: '', + args: [], + ); + } + + /// `Заполните информацию:` + String get fill_in_information { + return Intl.message( + 'Заполните информацию:', + name: 'fill_in_information', + desc: '', + args: [], + ); + } + + /// `Введите информацию...` + String get enter_information { + return Intl.message( + 'Введите информацию...', + name: 'enter_information', + desc: '', + args: [], + ); + } + + /// `Сетевая ошибка!` + String get msg_network_err { + return Intl.message( + 'Сетевая ошибка!', + name: 'msg_network_err', + desc: '', + args: [], + ); + } + + /// `Что то пошло не так!` + String get msg_something_went_wrong { + return Intl.message( + 'Что то пошло не так!', + name: 'msg_something_went_wrong', + desc: '', + args: [], + ); + } + + /// `Необходимо ввести адрес электронной почты` + String get email_empty { + return Intl.message( + 'Необходимо ввести адрес электронной почты', + name: 'email_empty', + desc: '', + args: [], + ); + } + + /// `Некорректный адрес электронной почты` + String get email_invalid { + return Intl.message( + 'Некорректный адрес электронной почты', + name: 'email_invalid', + desc: '', + args: [], + ); + } + + /// `Пароль обязателен для заполнения` + String get password_empty { + return Intl.message( + 'Пароль обязателен для заполнения', + name: 'password_empty', + desc: '', + args: [], + ); + } + + /// `В пароле должно быть минимум 6 символов` + String get password_short { + return Intl.message( + 'В пароле должно быть минимум 6 символов', + name: 'password_short', + desc: '', + args: [], + ); + } + + /// `Имя пользователя обязательно для заполнения` + String get name_empty { + return Intl.message( + 'Имя пользователя обязательно для заполнения', + name: 'name_empty', + desc: '', + args: [], + ); + } + + /// `В имени пользователя должно быть минимум 6 символов` + String get name_short { + return Intl.message( + 'В имени пользователя должно быть минимум 6 символов', + name: 'name_short', + desc: '', + args: [], + ); + } + + /// `Пароли не совпадают` + String get password_confirmation_mismatch { + return Intl.message( + 'Пароли не совпадают', + name: 'password_confirmation_mismatch', + desc: '', + args: [], + ); + } + + /// `Имя обязательно для заполнения` + String get first_name_empty { + return Intl.message( + 'Имя обязательно для заполнения', + name: 'first_name_empty', + desc: '', + args: [], + ); + } + + /// `В имени должен быть минимум 1 символ` + String get first_name_short { + return Intl.message( + 'В имени должен быть минимум 1 символ', + name: 'first_name_short', + desc: '', + args: [], + ); + } + + /// `Фамилия обязательна для заполнения` + String get last_name_empty { + return Intl.message( + 'Фамилия обязательна для заполнения', + name: 'last_name_empty', + desc: '', + args: [], + ); + } + + /// `В фамилии должен быть минимум 6 символов` + String get last_name_short { + return Intl.message( + 'В фамилии должен быть минимум 6 символов', + name: 'last_name_short', + desc: '', + args: [], + ); + } + + /// `Все замеры обязательны к заполнению` + String get circumference_empty { + return Intl.message( + 'Все замеры обязательны к заполнению', + name: 'circumference_empty', + desc: '', + args: [], + ); + } + + /// `Все замеры должны быть числами` + String get circumference_is_not_a_number { + return Intl.message( + 'Все замеры должны быть числами', + name: 'circumference_is_not_a_number', + desc: '', + args: [], + ); + } + + /// `Все показатели давления обязательны к заполнению` + String get pressure_empty { + return Intl.message( + 'Все показатели давления обязательны к заполнению', + name: 'pressure_empty', + desc: '', + args: [], + ); + } + + /// `Все показатели давления должны быть числами` + String get pressure_is_not_a_number { + return Intl.message( + 'Все показатели давления должны быть числами', + name: 'pressure_is_not_a_number', + desc: '', + args: [], + ); + } + + /// `У меня нет аккаунта` + String get no_account { + return Intl.message( + 'У меня нет аккаунта', + name: 'no_account', + desc: '', + args: [], + ); + } + + /// `Войти` + String get authentificate { + return Intl.message( + 'Войти', + name: 'authentificate', + desc: '', + args: [], + ); + } + + /// `Аутентификация` + String get user_authorization { + return Intl.message( + 'Аутентификация', + name: 'user_authorization', + desc: '', + args: [], + ); + } + + /// `Загрузка...` + String get loading { + return Intl.message( + 'Загрузка...', + name: 'loading', + desc: '', + args: [], + ); + } + + /// `График веса` + String get weight_chart { + return Intl.message( + 'График веса', + name: 'weight_chart', + desc: '', + args: [], + ); + } + + /// `График обхватов` + String get circumferences_chart { + return Intl.message( + 'График обхватов', + name: 'circumferences_chart', + desc: '', + args: [], + ); + } + + /// `Город проживания` + String get city_of_living { + return Intl.message( + 'Город проживания', + name: 'city_of_living', + desc: '', + args: [], + ); + } + + /// `График ИМТ` + String get bodymass_chart { + return Intl.message( + 'График ИМТ', + name: 'bodymass_chart', + desc: '', + args: [], + ); + } + + /// `Грудь` + String get chest { + return Intl.message( + 'Грудь', + name: 'chest', + desc: '', + args: [], + ); + } + + /// `Талия` + String get waist { + return Intl.message( + 'Талия', + name: 'waist', + desc: '', + args: [], + ); + } + + /// `Бедра` + String get hips { + return Intl.message( + 'Бедра', + name: 'hips', + desc: '', + args: [], + ); + } + + /// `Выйти` + String get exit { + return Intl.message( + 'Выйти', + name: 'exit', + desc: '', + args: [], + ); + } + + /// `Активен` + String get active { + return Intl.message( + 'Активен', + name: 'active', + desc: '', + args: [], + ); + } + + /// `В архиве` + String get archived { + return Intl.message( + 'В архиве', + name: 'archived', + desc: '', + args: [], + ); + } + + /// `Черновик` + String get draft { + return Intl.message( + 'Черновик', + name: 'draft', + desc: '', + args: [], + ); + } + + /// `Мой блог` + String get my_blog { + return Intl.message( + 'Мой блог', + name: 'my_blog', + desc: '', + args: [], + ); + } + + /// `Язык:` + String get language { + return Intl.message( + 'Язык:', + name: 'language', + desc: '', + args: [], + ); + } + + /// `В процессе` + String get in_progress { + return Intl.message( + 'В процессе', + name: 'in_progress', + desc: '', + args: [], + ); + } + + /// `Добавить замер` + String get add_measure { + return Intl.message( + 'Добавить замер', + name: 'add_measure', + desc: '', + args: [], + ); + } + + /// `Вес` + String get weight { + return Intl.message( + 'Вес', + name: 'weight', + desc: '', + args: [], + ); + } + + /// `Пройденные планы` + String get plans_complete { + return Intl.message( + 'Пройденные планы', + name: 'plans_complete', + desc: '', + args: [], + ); + } + + /// `Мои настройки` + String get my_settings { + return Intl.message( + 'Мои настройки', + name: 'my_settings', + desc: '', + args: [], + ); + } + + /// `Профиль` + String get profile { + return Intl.message( + 'Профиль', + name: 'profile', + desc: '', + args: [], + ); + } + + /// `Чат` + String get chat { + return Intl.message( + 'Чат', + name: 'chat', + desc: '', + args: [], + ); + } + + /// `Админ` + String get admin { + return Intl.message( + 'Админ', + name: 'admin', + desc: '', + args: [], + ); + } + + /// `Дневник` + String get diary { + return Intl.message( + 'Дневник', + name: 'diary', + desc: '', + args: [], + ); + } + + /// `Сохранить` + String get save { + return Intl.message( + 'Сохранить', + name: 'save', + desc: '', + args: [], + ); + } + + /// `шт` + String get pcs { + return Intl.message( + 'шт', + name: 'pcs', + desc: '', + args: [], + ); + } + + /// `гр` + String get gr { + return Intl.message( + 'гр', + name: 'gr', + desc: '', + args: [], + ); + } + + /// `гр` + String get grams { + return Intl.message( + 'гр', + name: 'grams', + desc: '', + args: [], + ); + } +} + +class AppLocalizationDelegate extends LocalizationsDelegate { + const AppLocalizationDelegate(); + + List get supportedLocales { + return const [ + Locale.fromSubtags(languageCode: 'en'), + ]; + } + + @override + bool isSupported(Locale locale) => _isSupported(locale); + @override + Future load(Locale locale) => S.load(locale); + @override + bool shouldReload(AppLocalizationDelegate old) => false; + + bool _isSupported(Locale locale) { + for (var supportedLocale in supportedLocales) { + if (supportedLocale.languageCode == locale.languageCode) { + return true; + } + } + return false; + } +} diff --git a/lib/localization/ru/ru_translations.dart b/lib/l10n/intl_en.arb similarity index 81% rename from lib/localization/ru/ru_translations.dart rename to lib/l10n/intl_en.arb index aff8f268..024f9a59 100644 --- a/lib/localization/ru/ru_translations.dart +++ b/lib/l10n/intl_en.arb @@ -1,44 +1,32 @@ -final Map ru = { - //credentials Screen +{ "user_registration": "Регистрация пользователя", "email": "Элетронная почта", "username": "Имя пользователя", "password": "Пароль", "password_confirmation": "Подтвердите пароль", - 'wrong_credentials': "Неверные данные пользователя", - - //name Screen + "wrong_credentials": "Неверные данные пользователя", "first_name": "Имя", "last_name": "Фамилия", "what_is_your_name": "Как вас зовут?", - - // date_of_birth Screen "date_of_birth": "Дата рождения", - // city_of_living Screen - "country": "Страна", "Russia": "Россия", "city": "Город", "Moscow": "Москва", + "country": "Страна", + "Russia": "Россия", + "city": "Город", + "Moscow": "Москва", "place_of_living": "Место проживания", - - // body_circumferences Screen - "hip_circumference": "Обхват бедер", "chest_circumference": "Обхват груди", + "hip_circumference": "Обхват бедер", + "chest_circumference": "Обхват груди", "waist_circumference": "Обхват талии", "initial_measurements": "Первичные замеры", - "male": "Мужской", "female": "Женский", - // weight Screen - "weight_measurements": "Замер веса", "your_weight": "Ваш вес:", - "height_measurements": "Замер роста", "your_height": "Ваш рост:", - - // allergies Screen + "weight_measurements": "Замер веса", + "your_weight": "Ваш вес:", + "height_measurements": "Замер роста", + "your_height": "Ваш рост:", "allergies_presence": "Наличие аллергии", - - // medicine_intake Screen "do_you_take_pills": "Принимаете ли вы лекарства или бады?", - - // gender Screen "your_gender": "Ваш пол?", - - // blood_pressure Screen "no": "Нет", "do_you_have_hypertension_tendency": "Есть ли у вас гипертония?", "your_blood_pressure": "Ваше артериальное давление?", @@ -46,39 +34,23 @@ final Map ru = { "up_pressure": "Верхние показатели давления:", "down_pressure": "Нижние показатели давления:", "do_you_have_hypotension_tendency": "Есть ли у вас гипотония?", - - // favorite_sports Screen "your_favorite_sports": "Ваши спортивные увлечения?", - - // favorite_foods Screen "favorite_foods": "Любимые продукты", "favorite_unfavorite_foods": "Ваши любимые/нелюбимые продукты питания?", "unfavorite_foods": "Нелюбимые продукты", - - // schedule Screen "your_schedule": "Ваш режим дня?", "tell_your_schedule": "Расскажите в свободной форме о том как просыпаетесь, когда едите, когда ложитесь спать:", - - // additional_information Screen "additional_information": "Дополнительная информация", "enter_additional_information": "Введите любую дополнительную информацию на своё усмотрение:", - - // language_select Screen "lbl_english": "English", "finish": "Завершить", "preferred_language": "Предпочитаемый язык общения", - - // Common String - "continue": "Продолжить", "skip": "Пропустить", + "continueButton": "Продолжить", + "skip": "Пропустить", "fill_in_information": "Заполните информацию:", "enter_information": "Введите информацию...", - - // Network Error String "msg_network_err": "Сетевая ошибка!", "msg_something_went_wrong": "Что то пошло не так!", - - // Errors - // Credentials "email_empty": "Необходимо ввести адрес электронной почты", "email_invalid": "Некорректный адрес электронной почты", "password_empty": "Пароль обязателен для заполнения", @@ -86,27 +58,17 @@ final Map ru = { "name_empty": "Имя пользователя обязательно для заполнения", "name_short": "В имени пользователя должно быть минимум 6 символов", "password_confirmation_mismatch": "Пароли не совпадают", - - // Name "first_name_empty": "Имя обязательно для заполнения", "first_name_short": "В имени должен быть минимум 1 символ", "last_name_empty": "Фамилия обязательна для заполнения", "last_name_short": "В фамилии должен быть минимум 6 символов", - - // Body Circumference "circumference_empty": "Все замеры обязательны к заполнению", "circumference_is_not_a_number": "Все замеры должны быть числами", - - // Body Circumference "pressure_empty": "Все показатели давления обязательны к заполнению", "pressure_is_not_a_number": "Все показатели давления должны быть числами", - - // Authorization "no_account": "У меня нет аккаунта", "authentificate": "Войти", "user_authorization": "Аутентификация", - - // Личный кабинет Screen "loading": "Загрузка...", "weight_chart": "График веса", "circumferences_chart": "График обхватов", @@ -133,5 +95,5 @@ final Map ru = { "save": "Сохранить", "pcs": "шт", "gr": "гр", - "grams": "гр", -}; + "grams": "гр" +} \ No newline at end of file diff --git a/lib/localization/app_localization.dart b/lib/localization/app_localization.dart deleted file mode 100644 index 7390b372..00000000 --- a/lib/localization/app_localization.dart +++ /dev/null @@ -1,61 +0,0 @@ -import 'package:eatvio_app/app_router.dart'; -import 'package:flutter/cupertino.dart'; - -//import 'en_us/en_us_translations.dart'; -import 'package:flutter/foundation.dart'; - -import 'ru/ru_translations.dart'; - -class AppLocalization { - AppLocalization(this.locale); - - Locale locale; - - static final Map> _localizedValues = { - 'ru': ru, - }; - - /*static final Map> __localizedValues = { - 'en': enUs - };*/ - - static AppLocalization of() { - final context = AppRouter.navigatorKey.currentContext; - if (context != null) { - return Localizations.of(context, AppLocalization)!; - } else { - // Обработка ситуации, когда context равен null - return AppLocalization( - Locale( - 'ru', - '', - ), - ); // Возвращаем дефолтное значение или обработку ошибки - } - } - - static List languages() => _localizedValues.keys.toList(); - - String getString(String text) => _localizedValues[locale.languageCode]![text] ?? text; -} - -class AppLocalizationDelegate extends LocalizationsDelegate { - const AppLocalizationDelegate(); - - @override - bool isSupported(Locale locale) => AppLocalization.languages().contains(locale.languageCode); - - //Returning a SynchronousFuture here because an async "load" operation - //cause an async "load" operation - @override - Future load(Locale locale) { - return SynchronousFuture(AppLocalization(locale)); - } - - @override - bool shouldReload(AppLocalizationDelegate old) => false; -} - -extension LocalizationExtension on String { - String get tr => AppLocalization.of().getString(this); -} diff --git a/lib/localization/en_us/en_us_translations.dart b/lib/localization/en_us/en_us_translations.dart deleted file mode 100644 index c68f1315..00000000 --- a/lib/localization/en_us/en_us_translations.dart +++ /dev/null @@ -1,63 +0,0 @@ -final Map enUs = { - // date_of_birth Screen - "date_of_birth": "Date of Birth", - - // city_of_living Screen - "country": "Country", "Russia": "Russia", "city": "City", "Moscow": "Moscow", - "place_of_living": "Place of Living", - - // body_circumferences Screen - "hip_circumference": "Hip circumference", - "chest_circumference": "Chest circumference", - "waist_circumference": "Waist circumference", - "initial_measurements": "Initial measurements", - - // weight Screen - "weight_measurements": "Weight measurements", "your_weight": "Your weight:", - "height_measurements": "Height measurements", "your_height": "Your height:", - - // allergies Screen - "allergies_presence": "Allergies presence", - - // medicine_intake Screen - "do_you_take_pills": "Do you take pills or supplements?", - - // gender Screen - "your_gender": "Your Gender?", - - // blood_pressure Screen - "no": "No", - "do_you_have_hypertension_tendency": "Do you have a tendency for hypertension?", - "your_blood_pressure": "Your blood pressure?", - "average_pressure": "Average pressure:", - "do_you_have_hypotension_tendency": "Do you have a tendency for hypotension?", - - // favorite_sports Screen - "your_favorite_sports": "Your Favorite Sports?", - - // favorite_foods Screen - "favorite_foods": "Favorite Foods:", - "favorite_unfavorite_foods": "Your most ot reast favorite foods?", - "unfavorite_foods": "Unfavorite Foods:", - - // schedule Screen - "your_schedule": "Your Daily Schedule?", - "tell_your_schedule": "Tell us about your daily routine, when you wake up, eat, and go to sleep:", - - // additional_information Screen - "additional_information": "Additional Information:", - "enter_additional_information": "Enter any additional information you would like to share:", - - // language_select Screen - "lbl_english": "English", - "preferred_language": "Preferred Language", - - // Common String - "continue": "Continue", "skip": "Skip", - "fill_in_information": "Fill in Information:", - "enter_information": "Enter Information...", - -// Network Error String - "msg_network_err": "Network Error!", - "msg_something_went_wrong": "Something went wrong!", -}; diff --git a/lib/main.dart b/lib/main.dart index 7191b2b0..0fe04674 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,7 +2,7 @@ import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.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/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/locator_service.dart' as di; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; @@ -33,21 +33,19 @@ class MyApp extends StatelessWidget { theme: ThemeData.light().copyWith( colorScheme: ColorScheme.fromSeed(seedColor: appTheme.blueA400), ), - // darkTheme: ThemeData.dark().copyWith(), + darkTheme: ThemeData.dark().copyWith( + colorScheme: ColorScheme.fromSeed(seedColor: appTheme.blueA400), + ), themeMode: ThemeMode.system, routerConfig: AppRouter.appRouter, debugShowCheckedModeBanner: false, - localizationsDelegates: [ - AppLocalizationDelegate(), + localizationsDelegates: const [ + S.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], - supportedLocales: [ - Locale( - 'ru', - ), - ], + supportedLocales: S.delegate.supportedLocales, ), ), ); diff --git a/lib/old/auth/auth_screen/auth_screen.dart b/lib/old/auth/auth_screen/auth_screen.dart index 37be6818..fc69d52d 100644 --- a/lib/old/auth/auth_screen/auth_screen.dart +++ b/lib/old/auth/auth_screen/auth_screen.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; @@ -40,6 +40,7 @@ class _AuthScreenState extends State { @override Widget build(BuildContext context) { + final s = S.of(context); return Scaffold( appBar: AppBar( centerTitle: true, @@ -51,7 +52,7 @@ class _AuthScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("email".tr), + Text(s.email), SizedBox(height: 4), BlocSelector( selector: (state) => state.emailController, @@ -66,7 +67,7 @@ class _AuthScreenState extends State { }, ), SizedBox(height: 16), - Text("password".tr), + Text(s.password), SizedBox(height: 4), BlocSelector( selector: (state) => state.passwordController, @@ -154,6 +155,7 @@ class _AuthScreenState extends State { } onTapAuth(AuthState state, BuildContext context) { + final s = S.of(context); return () async { List errors = validateFields(state.emailController!.text, state.passwordController!.text); if (errors.isEmpty) { @@ -178,7 +180,7 @@ class _AuthScreenState extends State { context: context, builder: (context) => AlertDialog( title: Text('Ошибка'), - content: Text('wrong_credentials'.tr), + content: Text(s.wrong_credentials), actions: [ TextButton( onPressed: () => Navigator.pop(context), @@ -213,22 +215,24 @@ class _AuthScreenState extends State { } List validateFields(String email, String password) { + final s = S.of(context); + List errors = []; if (!isEmail(email)) { - errors.add('email_invalid'.tr); + errors.add(s.email_invalid); } if (email.isEmpty) { - errors.add('email_empty'.tr); + errors.add(s.email_empty); } if (password.isEmpty) { - errors.add('password_empty'.tr); + errors.add(s.password_empty); } if (password.length < 6) { - errors.add('password_short'.tr); + errors.add(s.password_short); } return errors; diff --git a/lib/old/profile/my_profile_screen/my_profile_screen.dart b/lib/old/profile/my_profile_screen/my_profile_screen.dart index d425dd68..c732d5af 100644 --- a/lib/old/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/old/profile/my_profile_screen/my_profile_screen.dart @@ -1,10 +1,9 @@ import 'dart:convert'; import 'dart:math'; - import 'package:cached_network_image/cached_network_image.dart'; import 'package:carousel_slider_plus/carousel_slider_plus.dart'; import 'package:eatvio_app/core/const.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; @@ -194,7 +193,8 @@ class MyProfileScreen extends StatelessWidget { }; } - _buildCarousel(BuildContext contex, MyProfileLoadedState state) { + _buildCarousel(BuildContext context, MyProfileLoadedState state) { + final s = S.of(context); return CarouselSlider( options: CarouselOptions(height: 340), items: [1, 2, 3].map((chartType) { @@ -207,7 +207,7 @@ class MyProfileScreen extends StatelessWidget { child: Column( children: [ Text( - "weight_chart".tr, + s.weight_chart, style: CustomTextStyles.titleMediumBlack.copyWith( color: appTheme.black900, ), @@ -225,7 +225,7 @@ class MyProfileScreen extends StatelessWidget { return Column( children: [ Text( - "bodymass_chart".tr, + s.bodymass_chart, style: CustomTextStyles.titleMediumBlack.copyWith( color: appTheme.black900, ), @@ -247,14 +247,14 @@ class MyProfileScreen extends StatelessWidget { child: Column( children: [ Text( - "circumferences_chart".tr, + s.circumferences_chart, style: CustomTextStyles.titleMediumBlack.copyWith( color: appTheme.black900, ), ), SizedBox(height: 30), _buildCircumferenceChart(context, state.circumferences, state.chartDates), - _buildChartLegend(), + _buildChartLegend(context), ], ), ); @@ -267,9 +267,10 @@ class MyProfileScreen extends StatelessWidget { ); } - _buildChartLegend() { + _buildChartLegend(BuildContext context) { + final s = S.of(context); final colors = [Colors.pink, Colors.green, Colors.purple]; - final titles = ["chest".tr, "waist".tr, "hips".tr]; + final titles = [s.chest, s.waist, s.hips]; final style = TextStyle( color: Colors.black, fontWeight: FontWeight.bold, @@ -650,13 +651,14 @@ class MyProfileScreen extends StatelessWidget { /// Section Widget _buildPlans(BuildContext context, List? plans, List? imagePaths, List? states) { + final s = S.of(context); return Padding( padding: EdgeInsets.only(left: 7), child: Column( children: [ Padding( padding: EdgeInsets.only(left: 15), - child: Text("plans_complete".tr, style: CustomTextStyles.titleMediumBlack.copyWith(color: appTheme.black900)), + child: Text(s.plans_complete, style: CustomTextStyles.titleMediumBlack.copyWith(color: appTheme.black900)), ), SizedBox(height: 5), Container( @@ -735,7 +737,7 @@ class MyProfileScreen extends StatelessWidget { child: Container( width: 70, margin: EdgeInsets.only(bottom: 14, right: 22), - child: Text("$state".tr, maxLines: 3, overflow: TextOverflow.ellipsis, style: theme.textTheme.titleSmall), + child: Text("$state", maxLines: 3, overflow: TextOverflow.ellipsis, style: theme.textTheme.titleSmall), ), ), ], @@ -765,6 +767,7 @@ class MyProfileScreen extends StatelessWidget { } _editCircumference(BuildContext context, MyProfileLoadedState state) { + final s = S.of(context); showDialog( context: context, builder: (context) { @@ -779,7 +782,7 @@ class MyProfileScreen extends StatelessWidget { children: [ Padding( padding: EdgeInsets.symmetric(vertical: 5), - child: Text("chest_circumference".tr, style: theme.textTheme.bodyLarge), + child: Text(s.chest_circumference, style: theme.textTheme.bodyLarge), ), SizedBox(height: 5), CustomTextFormField( @@ -791,7 +794,7 @@ class MyProfileScreen extends StatelessWidget { ), Padding( padding: EdgeInsets.symmetric(vertical: 15), - child: Text("waist_circumference".tr, style: theme.textTheme.bodyLarge), + child: Text(s.waist_circumference, style: theme.textTheme.bodyLarge), ), SizedBox(height: 5), CustomTextFormField( @@ -803,7 +806,7 @@ class MyProfileScreen extends StatelessWidget { ), Padding( padding: EdgeInsets.symmetric(vertical: 15), - child: Text("hip_circumference".tr, style: theme.textTheme.bodyLarge), + child: Text(s.hip_circumference, style: theme.textTheme.bodyLarge), ), SizedBox(height: 5), CustomTextFormField( @@ -876,6 +879,7 @@ class MyProfileScreen extends StatelessWidget { } _editWeight(BuildContext context, MyProfileLoadedState state) { + final s = S.of(context); showDialog( context: context, builder: (context) { @@ -887,7 +891,7 @@ class MyProfileScreen extends StatelessWidget { children: [ Padding( padding: EdgeInsets.symmetric(vertical: 5), - child: Text("weight".tr, style: theme.textTheme.bodyLarge), + child: Text(s.weight, style: theme.textTheme.bodyLarge), ), SizedBox(height: 5), CustomTextFormField( diff --git a/lib/widgets/custom_expandable_list.dart b/lib/widgets/custom_expandable_list.dart index 5f208327..872a8fd5 100644 --- a/lib/widgets/custom_expandable_list.dart +++ b/lib/widgets/custom_expandable_list.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/localization/app_localization.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/old/profile/my_profile_screen/bloc/my_profile_bloc.dart'; import 'package:eatvio_app/theme/custom_button_style.dart'; import 'package:eatvio_app/widgets/custom_hyper_switch.dart'; @@ -87,6 +87,7 @@ class _ExpandableListState extends State { } _buildForm(BuildContext context, MyProfileLoadedState state) { + final s = S.of(context); List cities = [ 'Москва', 'Санкт-Петербург', @@ -134,14 +135,14 @@ class _ExpandableListState extends State { children: [ TextField( controller: state.firstNameFormController, - decoration: InputDecoration(labelText: 'first_name'.tr), + decoration: InputDecoration(labelText: s.first_name), ), TextField( controller: state.lastNameFormController, - decoration: InputDecoration(labelText: 'last_name'.tr), + decoration: InputDecoration(labelText: s.last_name), ), TextField( - decoration: InputDecoration(labelText: 'date_of_birth'.tr), + decoration: InputDecoration(labelText: s.date_of_birth), controller: state.dateFormController, onTap: inputTime(context, state), ), @@ -155,7 +156,7 @@ class _ExpandableListState extends State { child: Text(value), ); }).toList(), - decoration: InputDecoration(labelText: 'country'.tr), + decoration: InputDecoration(labelText: s.country), ), DropdownButtonFormField( hint: Text(state.selectedCity ?? "Не выбрано"), @@ -167,78 +168,78 @@ class _ExpandableListState extends State { child: Text(value), ); }).toList(), - decoration: InputDecoration(labelText: 'city_of_living'.tr), + decoration: InputDecoration(labelText: s.city_of_living), ), TextField( controller: state.weightFormController, - decoration: InputDecoration(labelText: 'weight_measurements'.tr), + decoration: InputDecoration(labelText: s.weight_measurements), keyboardType: TextInputType.number, inputFormatters: [digitsOnly], ), TextField( controller: state.heightFormController, - decoration: InputDecoration(labelText: 'height_measurements'.tr), + decoration: InputDecoration(labelText: s.height_measurements), keyboardType: TextInputType.number, inputFormatters: [digitsOnly], ), TextField( controller: state.chestCircumferenceFormController, - decoration: InputDecoration(labelText: 'chest_circumference'.tr), + decoration: InputDecoration(labelText: s.chest_circumference), keyboardType: TextInputType.number, inputFormatters: [digitsOnly], ), TextField( controller: state.waistCircumferenceFormController, - decoration: InputDecoration(labelText: 'waist_circumference'.tr), + decoration: InputDecoration(labelText: s.waist_circumference), keyboardType: TextInputType.number, inputFormatters: [digitsOnly], ), TextField( controller: state.hipCircumferenceFormController, - decoration: InputDecoration(labelText: 'hip_circumference'.tr), + decoration: InputDecoration(labelText: s.hip_circumference), keyboardType: TextInputType.number, inputFormatters: [digitsOnly], ), TextField( controller: state.upPressureFormController, - decoration: InputDecoration(labelText: 'up_pressure'.tr), + decoration: InputDecoration(labelText: s.up_pressure), keyboardType: TextInputType.number, inputFormatters: [digitsOnly], ), TextField( controller: state.downPressureFormController, - decoration: InputDecoration(labelText: 'down_pressure'.tr), + decoration: InputDecoration(labelText: s.down_pressure), keyboardType: TextInputType.number, inputFormatters: [digitsOnly], ), TextField( controller: state.allergiesFormController, - decoration: InputDecoration(labelText: 'allergies_presence'.tr), + decoration: InputDecoration(labelText: s.allergies_presence), maxLines: null, ), TextField( controller: state.pillsFormController, - decoration: InputDecoration(labelText: 'do_you_take_pills'.tr), + decoration: InputDecoration(labelText: s.do_you_take_pills), maxLines: null, ), TextField( controller: state.sportsFormController, - decoration: InputDecoration(labelText: 'your_favorite_sports'.tr), + decoration: InputDecoration(labelText: s.your_favorite_sports), maxLines: null, ), TextField( controller: state.favoriteFormController, - decoration: InputDecoration(labelText: 'favorite_foods'.tr), + decoration: InputDecoration(labelText: s.favorite_foods), maxLines: null, ), TextField( controller: state.unfavoriteFormController, - decoration: InputDecoration(labelText: 'unfavorite_foods'.tr), + decoration: InputDecoration(labelText: s.unfavorite_foods), maxLines: null, ), TextField( controller: state.additionalFormController, - decoration: InputDecoration(labelText: 'additional_information'.tr), + decoration: InputDecoration(labelText: s.additional_information), maxLines: null, ), DropdownButtonFormField( @@ -261,18 +262,18 @@ class _ExpandableListState extends State { ), Row( children: [ - HypoSwitch('do_you_have_hypotension_tendency'.tr, state), + HypoSwitch(s.do_you_have_hypotension_tendency, state), ], ), Row( children: [ - HyperSwitch('do_you_have_hypertension_tendency'.tr, state), + HyperSwitch(s.do_you_have_hypertension_tendency, state), ], ), NextStepButton( onPressed: () => sendProfileData(state), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - text: "save".tr.toUpperCase(), + text: s.save.toUpperCase(), margin: EdgeInsets.only(top: 20, bottom: 20), ), ], diff --git a/pubspec.yaml b/pubspec.yaml index 3d91e2f8..2532b9a1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -54,6 +54,7 @@ dependencies: flutter_html: ^3.0.0-beta.2 file_picker: ^8.1.2 audioplayers: ^6.1.0 + intl: ^0.19.0 dev_dependencies: build_runner: ^2.4.12 @@ -71,3 +72,5 @@ flutter: - assets/images/ - assets/audio/ - assets/icons/ +flutter_intl: + enabled: true diff --git a/test/auth_test.dart b/test/auth_test.dart index bc637b82..bd789695 100644 --- a/test/auth_test.dart +++ b/test/auth_test.dart @@ -1,11 +1,11 @@ -import 'package:eatvio_app/localization/app_localization.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'package:eatvio_app/old/auth/auth_screen/bloc/auth_bloc.dart'; import 'package:eatvio_app/old/auth/auth_screen/models/auth_model.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; void main() { group('AuthScreen', () { @@ -14,18 +14,13 @@ void main() { await tester.pumpWidget( MaterialApp( - localizationsDelegates: [ - AppLocalizationDelegate(), + localizationsDelegates: const [ + S.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], - supportedLocales: [ - Locale( - 'ru', - '', - ), - ], + supportedLocales: S.delegate.supportedLocales, home: BlocProvider( create: (context) => authBloc, child: Builder( From a826cba8663f7d2c71b73ce6dcded5f74df26a80 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Thu, 12 Sep 2024 13:01:20 +0300 Subject: [PATCH 19/31] refactor: remove unused libs --- lib/core/utils/date_time_utils.dart | 1 - lib/main.dart | 33 +- .../my_profile_screen/my_profile_screen.dart | 972 ------------------ lib/theme/app_decoration.dart | 12 - pubspec.yaml | 8 - 5 files changed, 27 insertions(+), 999 deletions(-) delete mode 100644 lib/old/profile/my_profile_screen/my_profile_screen.dart diff --git a/lib/core/utils/date_time_utils.dart b/lib/core/utils/date_time_utils.dart index efa7b572..574799cd 100644 --- a/lib/core/utils/date_time_utils.dart +++ b/lib/core/utils/date_time_utils.dart @@ -4,7 +4,6 @@ import 'package:intl/intl.dart'; const String dateTimeFormatPattern = 'dd/MM/yyyy'; extension DateTimeExtension on DateTime { - /// Return a string representing [date] formatted according to our locale String format([ String pattern = dateTimeFormatPattern, String? locale, diff --git a/lib/main.dart b/lib/main.dart index 0fe04674..bab50f72 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -30,12 +30,33 @@ class MyApp extends StatelessWidget { ], child: KeyboardDismisser( child: MaterialApp.router( - theme: ThemeData.light().copyWith( - colorScheme: ColorScheme.fromSeed(seedColor: appTheme.blueA400), - ), - darkTheme: ThemeData.dark().copyWith( - colorScheme: ColorScheme.fromSeed(seedColor: appTheme.blueA400), - ), + theme: ThemeHelper().themeData(), + // theme: ThemeData.light().copyWith( + // colorScheme: ColorScheme.fromSeed( + // seedColor: appTheme.blueA400, + // brightness: Brightness.light, + // ), + // appBarTheme: AppBarTheme( + // systemOverlayStyle: SystemUiOverlayStyle.light.copyWith( + // statusBarIconBrightness: Brightness.dark, + // systemNavigationBarIconBrightness: Brightness.dark, + // systemNavigationBarColor: ThemeData.light().scaffoldBackgroundColor, + // ), + // ), + // ), + // darkTheme: ThemeData.dark().copyWith( + // colorScheme: ColorScheme.fromSeed( + // seedColor: appTheme.blueA400, + // brightness: Brightness.dark, + // ), + // appBarTheme: AppBarTheme( + // systemOverlayStyle: SystemUiOverlayStyle.dark.copyWith( + // statusBarIconBrightness: Brightness.light, + // systemNavigationBarIconBrightness: Brightness.light, + // systemNavigationBarColor: ThemeData.dark().scaffoldBackgroundColor, + // ), + // ), + // ), themeMode: ThemeMode.system, routerConfig: AppRouter.appRouter, debugShowCheckedModeBanner: false, diff --git a/lib/old/profile/my_profile_screen/my_profile_screen.dart b/lib/old/profile/my_profile_screen/my_profile_screen.dart deleted file mode 100644 index c732d5af..00000000 --- a/lib/old/profile/my_profile_screen/my_profile_screen.dart +++ /dev/null @@ -1,972 +0,0 @@ -import 'dart:convert'; -import 'dart:math'; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:carousel_slider_plus/carousel_slider_plus.dart'; -import 'package:eatvio_app/core/const.dart'; -import 'package:eatvio_app/generated/l10n.dart'; -import 'package:eatvio_app/theme/app_decoration.dart'; -import 'package:eatvio_app/theme/custom_text_style.dart'; -import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; -import 'package:eatvio_app/widgets/custom_text_form_field.dart'; -import 'package:fl_chart/fl_chart.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:go_router/go_router.dart'; -import 'package:http/http.dart' as http; -import 'package:image_picker/image_picker.dart'; -import 'package:intl/intl.dart'; - -import 'bloc/my_profile_bloc.dart'; -import 'models/my_profile_model.dart'; - -class MyProfileScreen extends StatelessWidget { - static Widget builder(BuildContext context) { - return BlocProvider( - create: (context) => MyProfileBloc( - MyProfileState( - myProfileModelObj: MyProfileModel(), - ), - )..add(MyProfileInitialEvent()), - child: MyProfileScreen(), - ); - } - - Widget build(BuildContext context) { - return BlocBuilder( - builder: (context, state) { - if (state is MyProfileInitialState) { - // Это начальное состояние, данные ещё не загружены. - return Scaffold( - body: Center( - child: CircularProgressIndicator(), - ), - ); - } else if (state is MyProfileLoadedState) { - // Данные загружены, можно строить экран. - return _buildMyProfileScreen(context, state); - } else if (state is MyProfileErrorState) { - // Произошла ошибка при загрузке данных. - return Center(child: Text(state.errorMessage)); - } else { - // Другие состояния, если они есть. - return Scaffold( - body: Center( - child: CircularProgressIndicator(), - ), - ); - } - }, - ); - } - - _buildMyProfileScreen(BuildContext context, MyProfileLoadedState state) { - return Scaffold( - appBar: AppBar( - toolbarHeight: 0, - automaticallyImplyLeading: false, - ), - backgroundColor: Colors.grey[200], - resizeToAvoidBottomInset: true, - body: SingleChildScrollView( - child: Container( - width: double.maxFinite, - decoration: BoxDecoration(color: Colors.grey[200]), - child: Padding( - padding: EdgeInsets.all(16), - child: Column( - children: [ - SizedBox(height: 30), - Container( - padding: EdgeInsets.symmetric( - horizontal: 24, - vertical: 12, - ), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: _buildInfo(context, state), - ), - SizedBox(height: 15), - Container( - padding: EdgeInsets.symmetric( - horizontal: 24, - vertical: 12, - ), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: _buildCarousel(context, state), - ), - SizedBox(height: 15), - if (!state.plans!.isEmpty) - Container( - padding: EdgeInsets.symmetric( - horizontal: 24, - vertical: 12, - ), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 2, - blurRadius: 5, - offset: Offset(0, 3), - ), - ], - ), - child: _buildPlans( - context, - state.plans?.map((plan) => plan['name']).toList(), - state.plans?.map((plan) => plan['image']).toList(), - state.plans?.map((plan) => plan['state']).toList(), - ), - ), - SizedBox(height: 5), - ], - ), - ), - ), - ), - ); - } - - /// Section Widget - _buildInfo(BuildContext context, MyProfileLoadedState state) { - return Column( - children: [ - GestureDetector( - onTap: () => addImage(context), - child: CachedNetworkImage( - imageUrl: baseUrl + '/storage/' + (state.user?['profile_photo_path'] ?? ''), - imageBuilder: (context, imageProvider) => CircleAvatar( - backgroundImage: imageProvider, - radius: 60, - ), - placeholder: (context, url) => CircularProgressIndicator(), - errorWidget: (context, url, error) => CircleAvatar( - child: Icon(Icons.person), - backgroundColor: Colors.white, - radius: 60, - ), - ), - ), - AppbarSubtitle(text: state.user?['name'] ?? ''), - SizedBox(height: 20), - Text(state.userDetails?['additional_info'] ?? ''), - ], - ); - } - - addImage(BuildContext context) async { - final picker = ImagePicker(); - XFile? image = await picker.pickImage(source: ImageSource.gallery); - if (image != null) { - context.read().add(UploadAvatar(image)); - } - } - - onTapSettings(BuildContext context) { - return () { - GoRouter.of(context).goNamed('mySettingsScreen'); - }; - } - - _buildCarousel(BuildContext context, MyProfileLoadedState state) { - final s = S.of(context); - return CarouselSlider( - options: CarouselOptions(height: 340), - items: [1, 2, 3].map((chartType) { - return Builder( - builder: (BuildContext context) { - switch (chartType) { - case 1: // График веса - return GestureDetector( - onTap: () => _editWeight(context, state), - child: Column( - children: [ - Text( - s.weight_chart, - style: CustomTextStyles.titleMediumBlack.copyWith( - color: appTheme.black900, - ), - ), - SizedBox(height: 50), - _buildChart( - context, - state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], - state.chartDates, - ), - ], - ), - ); - case 2: // График ИМТ - return Column( - children: [ - Text( - s.bodymass_chart, - style: CustomTextStyles.titleMediumBlack.copyWith( - color: appTheme.black900, - ), - ), - SizedBox(height: 50), - _buildChart( - context, - _bodyMassIndex( - state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], - state.userDetails?['height'].toInt() ?? 160, - ), - state.chartDates, - ), - ], - ); - case 3: //График обхватов - return GestureDetector( - onTap: () => _editCircumference(context, state), - child: Column( - children: [ - Text( - s.circumferences_chart, - style: CustomTextStyles.titleMediumBlack.copyWith( - color: appTheme.black900, - ), - ), - SizedBox(height: 30), - _buildCircumferenceChart(context, state.circumferences, state.chartDates), - _buildChartLegend(context), - ], - ), - ); - default: - return Text('text', style: TextStyle(fontSize: 16.0)); - } - }, - ); - }).toList(), - ); - } - - _buildChartLegend(BuildContext context) { - final s = S.of(context); - final colors = [Colors.pink, Colors.green, Colors.purple]; - final titles = [s.chest, s.waist, s.hips]; - final style = TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ); - return Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - for (var i = 0; i < colors.length; i++) - Container( - child: Row( - children: [ - Container( - width: 16, - height: 16, - color: colors[i], - ), - SizedBox(width: 8), - Text(titles[i], style: style), - ], - ), - ), - ], - ), - ], - ); - } - - _buildChart(BuildContext context, List chartPoints, List? dates) { - List spots = []; - for (int i = 0; i < 4; i++) { - spots.add( - FlSpot((i * 10 / 10) + 1, chartPoints[i]), - ); - } - - Widget bottomTitleWidgets(double value, TitleMeta meta, double chartWidth, List? dates) { - if (value % 1 != 0) { - return Container(); - } - final style = TextStyle( - color: Colors.blue, - fontWeight: FontWeight.bold, - fontSize: min(13, 13 * chartWidth / 300), - ); - int index = value.toInt(); - if (index >= 0 && index < dates!.length) { - // Проверка на допустимый индекс в массиве dates - String formattedDate = DateFormat('dd.MM').format(DateTime.parse(dates[index])); - return SideTitleWidget( - axisSide: meta.axisSide, - space: 16, - child: Text(formattedDate, style: style), - ); - } else { - return Container(); - } - } - - Widget leftTitleWidgets(double value, TitleMeta meta, double chartWidth) { - final style = TextStyle( - color: Colors.blue, - fontWeight: FontWeight.bold, - fontSize: min(18, 18 * chartWidth / 300), - ); - return SideTitleWidget( - axisSide: meta.axisSide, - space: 16, - child: Text(meta.formattedValue, style: style), - ); - } - - return Padding( - padding: const EdgeInsets.only( - left: 12, - right: 20, - ), - child: AspectRatio( - aspectRatio: 1, - child: LayoutBuilder( - builder: (context, constraints) { - return LineChart( - LineChartData( - lineTouchData: LineTouchData( - touchTooltipData: LineTouchTooltipData( - maxContentWidth: 100, - // tooltipBgColor: Colors.black, - getTooltipItems: mapSpots(), - ), - handleBuiltInTouches: true, - getTouchLineStart: (data, index) => 0, - ), - lineBarsData: [ - LineChartBarData( - color: Colors.pink, - spots: spots, - isCurved: true, - isStrokeCapRound: true, - barWidth: 3, - belowBarData: BarAreaData( - show: false, - ), - dotData: const FlDotData(show: false), - ), - ], - minY: chartPoints.reduce((value, element) => value < element ? value : element), - maxY: chartPoints.reduce((value, element) => value > element ? value : element), - minX: 1, - maxX: 4, - titlesData: FlTitlesData( - leftTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - getTitlesWidget: (value, meta) => leftTitleWidgets(value, meta, constraints.maxWidth), - reservedSize: 56, - ), - drawBelowEverything: true, - ), - rightTitles: const AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - bottomTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - getTitlesWidget: (value, meta) => bottomTitleWidgets(value, meta, constraints.maxWidth, dates), - reservedSize: 36, - interval: 1, - ), - drawBelowEverything: true, - ), - topTitles: const AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - ), - gridData: FlGridData( - show: true, - drawHorizontalLine: true, - drawVerticalLine: true, - horizontalInterval: 1.5, - verticalInterval: 5, - checkToShowHorizontalLine: valuteToInt(), - getDrawingHorizontalLine: (_) => FlLine( - color: Colors.blue.withOpacity(1), - dashArray: [8, 2], - strokeWidth: 0.8, - ), - getDrawingVerticalLine: (_) => FlLine( - color: Colors.blue.withOpacity(1), - dashArray: [8, 2], - strokeWidth: 0.8, - ), - checkToShowVerticalLine: valuteToInt(), - ), - borderData: FlBorderData(show: false), - ), - ); - }, - ), - ), - ); - } - - valuteToInt() { - return (value) { - return value.toInt() == 0; - }; - } - - List Function(List) mapSpots() { - return (touchedSpots) { - return touchedSpots.map((LineBarSpot touchedSpot) { - final textStyle = TextStyle( - color: touchedSpot.bar.gradient?.colors[0] ?? touchedSpot.bar.color, - fontWeight: FontWeight.bold, - fontSize: 14, - ); - return LineTooltipItem( - '${touchedSpot.x}, ${touchedSpot.y.toStringAsFixed(2)}', - textStyle, - ); - }).toList(); - }; - } - - _buildCircumferenceChart(BuildContext context, chartPoints, List? dates) { -// Определение осей графика - final chestCircumferences = chartPoints.values.map((e) => e['chest_circumference']).toList(); - List spotsChest = []; - for (int i = 0; i < 4; i++) { - chestCircumferences[i] = chestCircumferences[i] * 10 / 10; - spotsChest.add( - FlSpot((i * 10 / 10) + 1, chestCircumferences[i] * 10 / 10), - ); - } - final waistCircumferences = chartPoints.values.map((e) => e['waist_circumference']).toList(); - List spotsWaist = []; - for (int i = 0; i < 4; i++) { - waistCircumferences[i] = waistCircumferences[i] * 10 / 10; - spotsWaist.add( - FlSpot((i * 10 / 10) + 1, waistCircumferences[i] * 10 / 10), - ); - } - final hipCircumferences = chartPoints.values.map((e) => e['hip_circumference']).toList(); - List spotsHip = []; - for (int i = 0; i < 4; i++) { - hipCircumferences[i] = hipCircumferences[i] * 10 / 10; - spotsHip.add( - FlSpot((i * 10 / 10) + 1, hipCircumferences[i]), - ); - } - - final allCircumferences = [...chestCircumferences, ...hipCircumferences, ...waistCircumferences]; - - Widget bottomTitleWidgets(double value, TitleMeta meta, double chartWidth, List? dates) { - if (value % 1 != 0) { - return Container(); - } - final style = TextStyle( - color: Colors.blue, - fontWeight: FontWeight.bold, - fontSize: min(13, 13 * chartWidth / 300), - ); - int index = value.toInt(); - if (index >= 0 && index < dates!.length) { - // Проверка на допустимый индекс в массиве dates - String formattedDate = DateFormat('dd.MM').format(DateTime.parse(dates[index])); - return SideTitleWidget( - axisSide: meta.axisSide, - space: 16, - child: Text(formattedDate, style: style), - ); - } else { - return Container(); - } - } - - Widget leftTitleWidgets(double value, TitleMeta meta, double chartWidth) { - final style = TextStyle( - color: Colors.blue, - fontWeight: FontWeight.bold, - fontSize: min(18, 18 * chartWidth / 300), - ); - return SideTitleWidget( - axisSide: meta.axisSide, - space: 16, - child: Text(meta.formattedValue, style: style), - ); - } - - return Padding( - padding: const EdgeInsets.only( - left: 12, - right: 20, - ), - child: AspectRatio( - aspectRatio: 1, - child: LayoutBuilder( - builder: (context, constraints) { - return LineChart( - LineChartData( - lineTouchData: LineTouchData( - touchTooltipData: LineTouchTooltipData( - maxContentWidth: 100, - // tooltipBgColor: Colors.black, - getTooltipItems: mapTouchedSpots(), - ), - handleBuiltInTouches: true, - getTouchLineStart: (data, index) => 0, - ), - lineBarsData: [ - LineChartBarData( - color: Colors.pink, - spots: spotsChest, - isCurved: true, - isStrokeCapRound: true, - barWidth: 3, - belowBarData: BarAreaData( - show: false, - ), - dotData: const FlDotData(show: false), - ), - LineChartBarData( - color: Colors.green, - spots: spotsWaist, - isCurved: true, - isStrokeCapRound: true, - barWidth: 3, - belowBarData: BarAreaData( - show: false, - ), - dotData: const FlDotData(show: false), - ), - LineChartBarData( - color: Colors.purple, - spots: spotsHip, - isCurved: true, - isStrokeCapRound: true, - barWidth: 3, - belowBarData: BarAreaData( - show: false, - ), - dotData: const FlDotData(show: false), - ), - ], - minY: allCircumferences.reduce((value, element) => value < element ? value : element), - maxY: allCircumferences.reduce((value, element) => value > element ? value : element), - minX: 1, - maxX: 4, - titlesData: FlTitlesData( - leftTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - getTitlesWidget: (value, meta) => leftTitleWidgets(value, meta, constraints.maxWidth), - reservedSize: 56, - ), - drawBelowEverything: true, - ), - rightTitles: const AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - bottomTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - getTitlesWidget: (value, meta) => bottomTitleWidgets(value, meta, constraints.maxWidth, dates), - reservedSize: 36, - interval: 1, - ), - drawBelowEverything: true, - ), - topTitles: const AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - ), - gridData: FlGridData( - show: true, - drawHorizontalLine: true, - drawVerticalLine: true, - horizontalInterval: 1.5, - verticalInterval: 5, - checkToShowHorizontalLine: valuteToInt(), - getDrawingHorizontalLine: (_) => FlLine( - color: Colors.blue.withOpacity(1), - dashArray: [8, 2], - strokeWidth: 0.8, - ), - getDrawingVerticalLine: (_) => FlLine( - color: Colors.blue.withOpacity(1), - dashArray: [8, 2], - strokeWidth: 0.8, - ), - checkToShowVerticalLine: valuteToInt(), - ), - borderData: FlBorderData(show: false), - ), - ); - }, - ), - ), - ); - } - - List Function(List) mapTouchedSpots() { - return (touchedSpots) { - return touchedSpots.map((LineBarSpot touchedSpot) { - final textStyle = TextStyle( - color: touchedSpot.bar.gradient?.colors[0] ?? touchedSpot.bar.color, - fontWeight: FontWeight.bold, - fontSize: 14, - ); - return LineTooltipItem( - '${touchedSpot.x}, ${touchedSpot.y.toStringAsFixed(2)}', - textStyle, - ); - }).toList(); - }; - } - - /// Section Widget - _buildPlans(BuildContext context, List? plans, List? imagePaths, List? states) { - final s = S.of(context); - return Padding( - padding: EdgeInsets.only(left: 7), - child: Column( - children: [ - Padding( - padding: EdgeInsets.only(left: 15), - child: Text(s.plans_complete, style: CustomTextStyles.titleMediumBlack.copyWith(color: appTheme.black900)), - ), - SizedBox(height: 5), - Container( - decoration: AppDecoration.outlineBlueGray.copyWith(borderRadius: BorderRadiusStyle.roundedBorder5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 105, - width: 343, - child: Stack( - alignment: Alignment.bottomCenter, - children: [ - Align( - alignment: Alignment.topCenter, - child: ListView.builder( - itemCount: plans?.length ?? 0, - itemBuilder: (context, i) { - String state = states?[i]; - var boxColor = appTheme.greenA700; - switch (states?[i]) { - case 'active': - boxColor = appTheme.greenA700; - break; - case 'archived': // График ИМТ - boxColor = appTheme.gray400; - break; - case 'draft': - boxColor = appTheme.deepOrange900; - break; - case 'in_progress': //График обхватов - boxColor = appTheme.lightGreen300; - break; - } - return SizedBox( - height: 40, - width: 343, - child: Stack( - alignment: Alignment.bottomRight, - children: [ - Align( - alignment: Alignment.topCenter, - child: Container( - margin: EdgeInsets.only(bottom: 11), - padding: EdgeInsets.symmetric(horizontal: 6, vertical: 4), - decoration: AppDecoration.fillGray.copyWith(borderRadius: BorderRadiusStyle.roundedBorder5), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.only(bottom: 1), - child: Text(plans![i], style: CustomTextStyles.titleSmallBluegray800Bold), - ), - Container( - height: 19, - width: 100, - decoration: BoxDecoration(color: boxColor, borderRadius: BorderRadius.circular(5)), - ), - ], - ), - ), - ), - Align( - alignment: Alignment.center, - child: Container( - margin: EdgeInsets.only(bottom: 12), - child: Image.network( - baseUrl + '/storage/' + imagePaths?[i], - height: 24, - width: 24, - ), - ), - ), - Align( - alignment: Alignment.bottomRight, - child: Container( - width: 70, - margin: EdgeInsets.only(bottom: 14, right: 22), - child: Text("$state", maxLines: 3, overflow: TextOverflow.ellipsis, style: theme.textTheme.titleSmall), - ), - ), - ], - ), - ); - }, - ), - ), - ], - ), - ), - ], - ), - ), - ], - ), - ); - } - - List _bodyMassIndex(List weightPoints, int height) { - List bmiList = []; - for (double weight in weightPoints) { - double bmi = weight / ((height / 100) * (height / 100)); - bmiList.add(bmi); - } - return bmiList; - } - - _editCircumference(BuildContext context, MyProfileLoadedState state) { - final s = S.of(context); - showDialog( - context: context, - builder: (context) { - //final digitsOnly = FilteringTextInputFormatter.digitsOnly; - return AlertDialog( - title: Center(child: Text("Добавить замер")), - - content: SizedBox( - width: 200, // Ширина диалогового окна - height: 300, // Высота диалогового окна - child: ListView( - children: [ - Padding( - padding: EdgeInsets.symmetric(vertical: 5), - child: Text(s.chest_circumference, style: theme.textTheme.bodyLarge), - ), - SizedBox(height: 5), - CustomTextFormField( - controller: state.chestCircumferenceController, - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly, // Ограничение ввода только цифрами - ], - ), - Padding( - padding: EdgeInsets.symmetric(vertical: 15), - child: Text(s.waist_circumference, style: theme.textTheme.bodyLarge), - ), - SizedBox(height: 5), - CustomTextFormField( - controller: state.waistCircumferenceController, - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly, // Ограничение ввода только цифрами - ], - ), - Padding( - padding: EdgeInsets.symmetric(vertical: 15), - child: Text(s.hip_circumference, style: theme.textTheme.bodyLarge), - ), - SizedBox(height: 5), - CustomTextFormField( - controller: state.hipCircumferenceController, - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly, // Ограничение ввода только цифрами - ], - ), - ], - ), - ), - actions: [ - TextButton( - onPressed: onTapOk(context), - child: Text("Отмена", style: theme.textTheme.bodyLarge), - ), - TextButton( - onPressed: sendEditData(state, context), - child: Text( - "Изменить", - style: CustomTextStyles.titleMediumBlack.copyWith( - color: Colors.blue, - ), - ), - ), - ], - backgroundColor: Colors.white, - titlePadding: EdgeInsets.all(20.0), // Можете настроить отступы по вашему желанию - ); - }, - ); - } - - sendEditData(MyProfileLoadedState state, BuildContext context) { - return () async { - Map data = { - "chest_circumference": state.chestCircumferenceController?.text, - "waist_circumference": state.waistCircumferenceController?.text, - "hip_circumference": state.hipCircumferenceController?.text, - }; - - // Преобразование Map в JSON - String jsonData = json.encode(data); - - // Отправка HTTP-запроса - try { - final token = state.token; - final response = await http.post( - Uri.parse(baseUrl + '/api/profile/addCircumference'), - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer $token', - }, - body: jsonData, - ); - - if (response.statusCode == 201) { - GoRouter.of(context).go('/my-profile-screen'); - } else { - // Ошибка от сервера - print("Ошибка при отправке данных. Код ответа: ${response.statusCode}"); - } - } catch (e) { - // Обработка ошибок при отправке запроса - print("Ошибка при отправке запроса: $e"); - } - Navigator.pop(context); - }; - } - - _editWeight(BuildContext context, MyProfileLoadedState state) { - final s = S.of(context); - showDialog( - context: context, - builder: (context) { - return AlertDialog( - content: SizedBox( - width: 200, // Ширина диалогового окна - height: 100, // Высота диалогового окна - child: ListView( - children: [ - Padding( - padding: EdgeInsets.symmetric(vertical: 5), - child: Text(s.weight, style: theme.textTheme.bodyLarge), - ), - SizedBox(height: 5), - CustomTextFormField( - controller: state.weightController, - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly, - ], - ), - ], - ), - ), - actions: [ - TextButton( - onPressed: () => Navigator.of(context).pop(), - child: Text("Отмена", style: theme.textTheme.bodyLarge), - ), - TextButton( - onPressed: () => saveWeight(state, context), - child: Text( - "Изменить", - style: CustomTextStyles.titleMediumBlack.copyWith( - color: Colors.blue, - ), - ), - ), - ], - backgroundColor: Colors.white, - titlePadding: EdgeInsets.all(20.0), - ); - }, - ); - } - - void saveWeight(MyProfileLoadedState state, BuildContext context) { - addWeight(state, context); - Navigator.of(context).pop(); // Закрыть диалоговое окно после изменения веса - } - - onTapOk(BuildContext context) { - return () { - Navigator.pop(context); - }; - } - - addWeight(MyProfileLoadedState state, BuildContext context) { - return () async { - Map data = { - "weight": state.weightController!.text, - }; - // Преобразование Map в JSON - String jsonData = json.encode(data); - - // Отправка HTTP-запроса - try { - final token = state.token; - final response = await http.post( - Uri.parse(baseUrl + '/api/profile/addWeight'), - headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer $token', - }, - body: jsonData, - ); - - if (response.statusCode == 201) { - GoRouter.of(context).go('/my-profile-screen'); - } else { - // Ошибка от сервера - print("Ошибка при отправке данных. Код ответа: ${response.statusCode}"); - } - } catch (e) { - // Обработка ошибок при отправке запроса - print("Ошибка при отправке запроса: $e"); - } - }; - } -} diff --git a/lib/theme/app_decoration.dart b/lib/theme/app_decoration.dart index bb6c590f..3868338c 100644 --- a/lib/theme/app_decoration.dart +++ b/lib/theme/app_decoration.dart @@ -137,20 +137,8 @@ class BorderRadiusStyle { ); } -// Comment/Uncomment the below code based on your Flutter SDK version. - -// For Flutter SDK Version 3.7.2 or greater. - double get strokeAlignInside => BorderSide.strokeAlignInside; double get strokeAlignCenter => BorderSide.strokeAlignCenter; double get strokeAlignOutside => BorderSide.strokeAlignOutside; - -// For Flutter SDK Version 3.7.1 or less. - -// StrokeAlign get strokeAlignInside => StrokeAlign.inside; -// -// StrokeAlign get strokeAlignCenter => StrokeAlign.center; -// -// StrokeAlign get strokeAlignOutside => StrokeAlign.outside; diff --git a/pubspec.yaml b/pubspec.yaml index 2532b9a1..0dbf3d7a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,20 +17,12 @@ dependencies: flutter_bloc: ^8.1.6 cached_network_image: ^3.4.1 flutter_svg: ^2.0.10+1 - # remove equatable: ^2.0.5 freezed_annotation: ^2.4.4 json_annotation: ^4.9.0 - # remove? validators: ^3.0.0 path_provider: ^2.1.4 - # remove? - fl_chart: ^0.69.0 - # remove? - flutter_spinkit: ^5.2.1 - # remove? carousel_slider_plus: ^7.0.1 - # remove? flutter_form_builder: ^9.4.1 image_picker: ^1.1.2 flutter_typeahead: ^5.2.0 From c800d356632bf9dfef80e0d83c51ea3d4983fd81 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 13 Sep 2024 14:22:57 +0300 Subject: [PATCH 20/31] feat(profile): add profile charts models, requests. Max length of description in posts, recipes, diets = 200 --- .../initialization_state.freezed.dart | 94 ++- lib/core/models/pagination_model.freezed.dart | 169 ++-- lib/core/models/pagination_model.g.dart | 13 +- .../selection_popup_model.freezed.dart | 52 +- .../new_messages_state.freezed.dart | 90 ++- .../notifications_state.freezed.dart | 157 ++-- .../profile_avatar_state.freezed.dart | 93 ++- .../models/calendar_model.freezed.dart | 89 ++- .../calendar/models/calendar_model.g.dart | 13 +- .../bloc/calendar_state.freezed.dart | 95 ++- .../presentation/pages/calendar_screen.dart | 5 +- .../calendar/services/calendar_service.g.dart | 8 +- .../models/chat_message_model.freezed.dart | 71 +- .../chat/models/chat_message_model.g.dart | 8 +- .../models/chat_messages_model.freezed.dart | 68 +- .../chat/models/chat_messages_model.g.dart | 12 +- .../chat/models/chat_meta_model.freezed.dart | 52 +- .../chat/models/chat_meta_model.g.dart | 6 +- .../chat/models/chat_room_model.freezed.dart | 76 +- .../chat/models/chat_room_model.g.dart | 12 +- .../chat_room_preview_model.freezed.dart | 332 ++++---- .../models/chat_room_preview_model.g.dart | 41 +- .../chat_room_settings_model.freezed.dart | 76 +- .../models/chat_room_settings_model.g.dart | 8 +- .../chat/models/chat_user_model.freezed.dart | 76 +- .../chat/models/chat_user_model.g.dart | 6 +- .../models/websocket_info_model.freezed.dart | 79 +- .../chat/models/websocket_info_model.g.dart | 8 +- .../chat_room_state.freezed.dart | 169 ++-- .../chat_select_state.freezed.dart | 100 ++- .../chat/services/chat_service.g.dart | 7 +- .../diary/models/diary_model.freezed.dart | 86 +- lib/features/diary/models/diary_model.g.dart | 18 +- lib/features/diary/models/meal.freezed.dart | 72 +- lib/features/diary/models/meal.g.dart | 11 +- lib/features/diary/models/photo.freezed.dart | 57 +- lib/features/diary/models/photo.g.dart | 3 +- .../diary/models/portion.freezed.dart | 71 +- lib/features/diary/models/portion.g.dart | 6 +- .../diary/models/product.freezed.dart | 35 +- lib/features/diary/models/product.g.dart | 6 +- lib/features/diary/models/state.freezed.dart | 48 +- lib/features/diary/models/state.g.dart | 3 +- .../bloc/diary_state.freezed.dart | 220 +++--- .../diary/services/diary_service.g.dart | 16 +- .../feed/models/comment_model.freezed.dart | 147 ++-- lib/features/feed/models/comment_model.g.dart | 20 +- .../diets_pagination_model.freezed.dart | 369 +++++---- .../feed/models/diets_pagination_model.g.dart | 36 +- .../models/feed_blog_post_model.freezed.dart | 129 +-- .../feed/models/feed_blog_post_model.g.dart | 8 +- ...feed_blog_post_settings_model.freezed.dart | 79 +- .../feed_blog_post_settings_model.g.dart | 12 +- .../feed/models/recipes_model.freezed.dart | 202 ++--- lib/features/feed/models/recipes_model.g.dart | 23 +- .../recipes_pagination_model.freezed.dart | 56 +- .../models/recipes_pagination_model.g.dart | 12 +- .../bloc/comments_cubit/comments_cubit.dart | 6 +- .../comments_state.freezed.dart | 83 +- .../bloc/diets_cubit/diets_state.freezed.dart | 88 ++- .../bloc/feed_cubit/feed_cubit.dart | 17 +- .../bloc/feed_cubit/feed_state.freezed.dart | 155 ++-- .../bloc/recipes_cubit/recipes_cubit.dart | 10 +- .../recipes_cubit/recipes_state.freezed.dart | 206 +++-- .../feed/presentation/pages/feed_screen.dart | 30 +- .../widgets/blog_post_widget.dart | 16 +- .../presentation/widgets/diets_widget.dart | 34 +- .../presentation/widgets/recipes_widget.dart | 34 +- .../widgets/tags_modal_widget.dart | 44 +- .../feed/repositories/feed_repository.dart | 50 +- lib/features/feed/services/feed_service.dart | 4 +- .../feed/services/feed_service.g.dart | 22 +- .../models/plan_pagination_model.freezed.dart | 328 ++++---- .../plans/models/plan_pagination_model.g.dart | 30 +- .../bloc/plans_cubit/plans_state.freezed.dart | 89 ++- .../plans/services/plans_service.g.dart | 4 +- .../profile/models/circumference_model.dart | 19 + .../models/circumference_model.freezed.dart | 319 ++++++++ .../profile/models/circumference_model.g.dart | 31 + .../profile/models/profile_model.freezed.dart | 247 +++--- .../profile/models/profile_model.g.dart | 34 +- lib/features/profile/models/weight_model.dart | 18 + .../profile/models/weight_model.freezed.dart | 289 +++++++ .../profile/models/weight_model.g.dart | 27 + .../bloc/profile_cubit/profile_cubit.dart | 4 + .../bloc/profile_cubit/profile_state.dart | 4 + .../profile_cubit/profile_state.freezed.dart | 288 +++++-- .../presentation/pages/profile_screen.dart | 53 +- .../widgets/circumference_chart_widget.dart | 748 +++++++++--------- .../widgets/imt_chart_widget.dart | 228 +++--- .../widgets/weight_chart_widget.dart | 474 +++++------ .../repositories/profile_repository.dart | 42 + .../profile/services/profile_service.dart | 24 + .../profile/services/profile_service.g.dart | 156 +++- .../recipes/models/ingredient.freezed.dart | 52 +- lib/features/recipes/models/ingredient.g.dart | 6 +- .../recipes/models/recipe_model.freezed.dart | 83 +- .../recipes/models/recipe_model.g.dart | 16 +- .../models/recipe_tag_model.freezed.dart | 135 ++-- .../recipes/models/recipe_tag_model.g.dart | 17 +- lib/features/recipes/models/step.freezed.dart | 37 +- lib/features/recipes/models/step.g.dart | 3 +- .../bloc/recipe_create_state.freezed.dart | 211 ++--- .../recipes/services/recipe_service.g.dart | 10 +- .../models/location_model.freezed.dart | 69 +- .../registration/models/location_model.g.dart | 9 +- .../user_registration_model.freezed.dart | 183 ++--- .../models/user_registration_model.g.dart | 11 +- .../registration_state.freezed.dart | 40 +- .../services/registration_service.g.dart | 7 +- pubspec.yaml | 1 + 111 files changed, 5760 insertions(+), 3215 deletions(-) create mode 100644 lib/features/profile/models/circumference_model.dart create mode 100644 lib/features/profile/models/circumference_model.freezed.dart create mode 100644 lib/features/profile/models/circumference_model.g.dart create mode 100644 lib/features/profile/models/weight_model.dart create mode 100644 lib/features/profile/models/weight_model.freezed.dart create mode 100644 lib/features/profile/models/weight_model.g.dart diff --git a/lib/core/initialization_cubit/initialization_state.freezed.dart b/lib/core/initialization_cubit/initialization_state.freezed.dart index d9ece2ef..b0535c68 100644 --- a/lib/core/initialization_cubit/initialization_state.freezed.dart +++ b/lib/core/initialization_cubit/initialization_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$InitializationState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,17 +70,18 @@ mixin _$InitializationState { /// @nodoc abstract class $InitializationStateCopyWith<$Res> { - factory $InitializationStateCopyWith(InitializationState value, $Res Function(InitializationState) then) = + factory $InitializationStateCopyWith( + InitializationState value, $Res Function(InitializationState) then) = _$InitializationStateCopyWithImpl<$Res, InitializationState>; } /// @nodoc -class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> implements $InitializationStateCopyWith<$Res> { +class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> + implements $InitializationStateCopyWith<$Res> { _$InitializationStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -91,14 +91,18 @@ class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> /// @nodoc abstract class _$$InitializationStateImplCopyWith<$Res> { - factory _$$InitializationStateImplCopyWith(_$InitializationStateImpl value, $Res Function(_$InitializationStateImpl) then) = + factory _$$InitializationStateImplCopyWith(_$InitializationStateImpl value, + $Res Function(_$InitializationStateImpl) then) = __$$InitializationStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitializationStateImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateImpl> +class __$$InitializationStateImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateImpl> implements _$$InitializationStateImplCopyWith<$Res> { - __$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value, $Res Function(_$InitializationStateImpl) _then) : super(_value, _then); + __$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value, + $Res Function(_$InitializationStateImpl) _then) + : super(_value, _then); /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @@ -116,7 +120,9 @@ class _$InitializationStateImpl implements _InitializationState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InitializationStateImpl); } @override @@ -203,14 +209,20 @@ abstract class _InitializationState implements InitializationState { /// @nodoc abstract class _$$InitializationStateLoadingImplCopyWith<$Res> { - factory _$$InitializationStateLoadingImplCopyWith(_$InitializationStateLoadingImpl value, $Res Function(_$InitializationStateLoadingImpl) then) = + factory _$$InitializationStateLoadingImplCopyWith( + _$InitializationStateLoadingImpl value, + $Res Function(_$InitializationStateLoadingImpl) then) = __$$InitializationStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitializationStateLoadingImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateLoadingImpl> +class __$$InitializationStateLoadingImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateLoadingImpl> implements _$$InitializationStateLoadingImplCopyWith<$Res> { - __$$InitializationStateLoadingImplCopyWithImpl(_$InitializationStateLoadingImpl _value, $Res Function(_$InitializationStateLoadingImpl) _then) + __$$InitializationStateLoadingImplCopyWithImpl( + _$InitializationStateLoadingImpl _value, + $Res Function(_$InitializationStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -229,7 +241,9 @@ class _$InitializationStateLoadingImpl implements InitializationStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InitializationStateLoadingImpl); } @override @@ -316,17 +330,22 @@ abstract class InitializationStateLoading implements InitializationState { /// @nodoc abstract class _$$InitializationStateSuccessImplCopyWith<$Res> { - factory _$$InitializationStateSuccessImplCopyWith(_$InitializationStateSuccessImpl value, $Res Function(_$InitializationStateSuccessImpl) then) = + factory _$$InitializationStateSuccessImplCopyWith( + _$InitializationStateSuccessImpl value, + $Res Function(_$InitializationStateSuccessImpl) then) = __$$InitializationStateSuccessImplCopyWithImpl<$Res>; - @useResult $Res call({PusherChannelsClient client}); } /// @nodoc -class __$$InitializationStateSuccessImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateSuccessImpl> +class __$$InitializationStateSuccessImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateSuccessImpl> implements _$$InitializationStateSuccessImplCopyWith<$Res> { - __$$InitializationStateSuccessImplCopyWithImpl(_$InitializationStateSuccessImpl _value, $Res Function(_$InitializationStateSuccessImpl) _then) + __$$InitializationStateSuccessImplCopyWithImpl( + _$InitializationStateSuccessImpl _value, + $Res Function(_$InitializationStateSuccessImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -361,7 +380,9 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$InitializationStateSuccessImpl && (identical(other.client, client) || other.client == client)); + (other.runtimeType == runtimeType && + other is _$InitializationStateSuccessImpl && + (identical(other.client, client) || other.client == client)); } @override @@ -372,8 +393,9 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => - __$$InitializationStateSuccessImplCopyWithImpl<_$InitializationStateSuccessImpl>(this, _$identity); + _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> + get copyWith => __$$InitializationStateSuccessImplCopyWithImpl< + _$InitializationStateSuccessImpl>(this, _$identity); @override @optionalTypeArgs @@ -451,29 +473,37 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { } abstract class InitializationStateSuccess implements InitializationState { - const factory InitializationStateSuccess({required final PusherChannelsClient client}) = _$InitializationStateSuccessImpl; + const factory InitializationStateSuccess( + {required final PusherChannelsClient client}) = + _$InitializationStateSuccessImpl; PusherChannelsClient get client; /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => throw _privateConstructorUsedError; + _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$InitializationStateErrorImplCopyWith<$Res> { - factory _$$InitializationStateErrorImplCopyWith(_$InitializationStateErrorImpl value, $Res Function(_$InitializationStateErrorImpl) then) = + factory _$$InitializationStateErrorImplCopyWith( + _$InitializationStateErrorImpl value, + $Res Function(_$InitializationStateErrorImpl) then) = __$$InitializationStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$InitializationStateErrorImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateErrorImpl> +class __$$InitializationStateErrorImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateErrorImpl> implements _$$InitializationStateErrorImplCopyWith<$Res> { - __$$InitializationStateErrorImplCopyWithImpl(_$InitializationStateErrorImpl _value, $Res Function(_$InitializationStateErrorImpl) _then) + __$$InitializationStateErrorImplCopyWithImpl( + _$InitializationStateErrorImpl _value, + $Res Function(_$InitializationStateErrorImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -510,7 +540,8 @@ class _$InitializationStateErrorImpl implements InitializationStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -521,8 +552,9 @@ class _$InitializationStateErrorImpl implements InitializationStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => - __$$InitializationStateErrorImplCopyWithImpl<_$InitializationStateErrorImpl>(this, _$identity); + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> + get copyWith => __$$InitializationStateErrorImplCopyWithImpl< + _$InitializationStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -600,12 +632,14 @@ class _$InitializationStateErrorImpl implements InitializationStateError { } abstract class InitializationStateError implements InitializationState { - const factory InitializationStateError({required final String errorMessage}) = _$InitializationStateErrorImpl; + const factory InitializationStateError({required final String errorMessage}) = + _$InitializationStateErrorImpl; String get errorMessage; /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/models/pagination_model.freezed.dart b/lib/core/models/pagination_model.freezed.dart index 692c6ef3..35f2c080 100644 --- a/lib/core/models/pagination_model.freezed.dart +++ b/lib/core/models/pagination_model.freezed.dart @@ -22,13 +22,10 @@ Links _$LinksFromJson(Map json) { mixin _$Links { @JsonKey(name: "first") String get first => throw _privateConstructorUsedError; - @JsonKey(name: "last") String get last => throw _privateConstructorUsedError; - @JsonKey(name: "prev") dynamic get prev => throw _privateConstructorUsedError; - @JsonKey(name: "next") dynamic get next => throw _privateConstructorUsedError; @@ -43,20 +40,23 @@ mixin _$Links { /// @nodoc abstract class $LinksCopyWith<$Res> { - factory $LinksCopyWith(Links value, $Res Function(Links) then) = _$LinksCopyWithImpl<$Res, Links>; - + factory $LinksCopyWith(Links value, $Res Function(Links) then) = + _$LinksCopyWithImpl<$Res, Links>; @useResult $Res call( - {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, + @JsonKey(name: "last") String last, + @JsonKey(name: "prev") dynamic prev, + @JsonKey(name: "next") dynamic next}); } /// @nodoc -class _$LinksCopyWithImpl<$Res, $Val extends Links> implements $LinksCopyWith<$Res> { +class _$LinksCopyWithImpl<$Res, $Val extends Links> + implements $LinksCopyWith<$Res> { _$LinksCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -93,17 +93,25 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links> implements $LinksCopyWith<$R /// @nodoc abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$Res> { - factory _$$LinksImplCopyWith(_$LinksImpl value, $Res Function(_$LinksImpl) then) = __$$LinksImplCopyWithImpl<$Res>; - + factory _$$LinksImplCopyWith( + _$LinksImpl value, $Res Function(_$LinksImpl) then) = + __$$LinksImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, + @JsonKey(name: "last") String last, + @JsonKey(name: "prev") dynamic prev, + @JsonKey(name: "next") dynamic next}); } /// @nodoc -class __$$LinksImplCopyWithImpl<$Res> extends _$LinksCopyWithImpl<$Res, _$LinksImpl> implements _$$LinksImplCopyWith<$Res> { - __$$LinksImplCopyWithImpl(_$LinksImpl _value, $Res Function(_$LinksImpl) _then) : super(_value, _then); +class __$$LinksImplCopyWithImpl<$Res> + extends _$LinksCopyWithImpl<$Res, _$LinksImpl> + implements _$$LinksImplCopyWith<$Res> { + __$$LinksImplCopyWithImpl( + _$LinksImpl _value, $Res Function(_$LinksImpl) _then) + : super(_value, _then); /// Create a copy of Links /// with the given fields replaced by the non-null parameter values. @@ -145,7 +153,8 @@ class _$LinksImpl implements _Links { @JsonKey(name: "prev") required this.prev, @JsonKey(name: "next") required this.next}); - factory _$LinksImpl.fromJson(Map json) => _$$LinksImplFromJson(json); + factory _$LinksImpl.fromJson(Map json) => + _$$LinksImplFromJson(json); @override @JsonKey(name: "first") @@ -178,14 +187,20 @@ class _$LinksImpl implements _Links { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, first, last, const DeepCollectionEquality().hash(prev), const DeepCollectionEquality().hash(next)); + int get hashCode => Object.hash( + runtimeType, + first, + last, + const DeepCollectionEquality().hash(prev), + const DeepCollectionEquality().hash(next)); /// Create a copy of Links /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => + __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); @override Map toJson() { @@ -207,15 +222,12 @@ abstract class _Links implements Links { @override @JsonKey(name: "first") String get first; - @override @JsonKey(name: "last") String get last; - @override @JsonKey(name: "prev") dynamic get prev; - @override @JsonKey(name: "next") dynamic get next; @@ -224,7 +236,8 @@ abstract class _Links implements Links { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => throw _privateConstructorUsedError; + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => + throw _privateConstructorUsedError; } Meta _$MetaFromJson(Map json) { @@ -235,25 +248,18 @@ Meta _$MetaFromJson(Map json) { mixin _$Meta { @JsonKey(name: "current_page") int get currentPage => throw _privateConstructorUsedError; - @JsonKey(name: "from") dynamic get from => throw _privateConstructorUsedError; - @JsonKey(name: "last_page") int get lastPage => throw _privateConstructorUsedError; - @JsonKey(name: "links") List get links => throw _privateConstructorUsedError; - @JsonKey(name: "path") String? get path => throw _privateConstructorUsedError; - @JsonKey(name: "per_page") int get perPage => throw _privateConstructorUsedError; - @JsonKey(name: "to") dynamic get to => throw _privateConstructorUsedError; - @JsonKey(name: "total") int get total => throw _privateConstructorUsedError; @@ -268,8 +274,8 @@ mixin _$Meta { /// @nodoc abstract class $MetaCopyWith<$Res> { - factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = _$MetaCopyWithImpl<$Res, Meta>; - + factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = + _$MetaCopyWithImpl<$Res, Meta>; @useResult $Res call( {@JsonKey(name: "current_page") int currentPage, @@ -283,12 +289,12 @@ abstract class $MetaCopyWith<$Res> { } /// @nodoc -class _$MetaCopyWithImpl<$Res, $Val extends Meta> implements $MetaCopyWith<$Res> { +class _$MetaCopyWithImpl<$Res, $Val extends Meta> + implements $MetaCopyWith<$Res> { _$MetaCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -345,8 +351,9 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> implements $MetaCopyWith<$Res> /// @nodoc abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { - factory _$$MetaImplCopyWith(_$MetaImpl value, $Res Function(_$MetaImpl) then) = __$$MetaImplCopyWithImpl<$Res>; - + factory _$$MetaImplCopyWith( + _$MetaImpl value, $Res Function(_$MetaImpl) then) = + __$$MetaImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -361,8 +368,11 @@ abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { } /// @nodoc -class __$$MetaImplCopyWithImpl<$Res> extends _$MetaCopyWithImpl<$Res, _$MetaImpl> implements _$$MetaImplCopyWith<$Res> { - __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) : super(_value, _then); +class __$$MetaImplCopyWithImpl<$Res> + extends _$MetaCopyWithImpl<$Res, _$MetaImpl> + implements _$$MetaImplCopyWith<$Res> { + __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) + : super(_value, _then); /// Create a copy of Meta /// with the given fields replaced by the non-null parameter values. @@ -429,7 +439,8 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "total") required this.total}) : _links = links; - factory _$MetaImpl.fromJson(Map json) => _$$MetaImplFromJson(json); + factory _$MetaImpl.fromJson(Map json) => + _$$MetaImplFromJson(json); @override @JsonKey(name: "current_page") @@ -441,7 +452,6 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "last_page") final int lastPage; final List _links; - @override @JsonKey(name: "links") List get links { @@ -473,9 +483,11 @@ class _$MetaImpl implements _Meta { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MetaImpl && - (identical(other.currentPage, currentPage) || other.currentPage == currentPage) && + (identical(other.currentPage, currentPage) || + other.currentPage == currentPage) && const DeepCollectionEquality().equals(other.from, from) && - (identical(other.lastPage, lastPage) || other.lastPage == lastPage) && + (identical(other.lastPage, lastPage) || + other.lastPage == lastPage) && const DeepCollectionEquality().equals(other._links, _links) && (identical(other.path, path) || other.path == path) && (identical(other.perPage, perPage) || other.perPage == perPage) && @@ -485,15 +497,24 @@ class _$MetaImpl implements _Meta { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, currentPage, const DeepCollectionEquality().hash(from), lastPage, const DeepCollectionEquality().hash(_links), - path, perPage, const DeepCollectionEquality().hash(to), total); + int get hashCode => Object.hash( + runtimeType, + currentPage, + const DeepCollectionEquality().hash(from), + lastPage, + const DeepCollectionEquality().hash(_links), + path, + perPage, + const DeepCollectionEquality().hash(to), + total); /// Create a copy of Meta /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => + __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); @override Map toJson() { @@ -519,31 +540,24 @@ abstract class _Meta implements Meta { @override @JsonKey(name: "current_page") int get currentPage; - @override @JsonKey(name: "from") dynamic get from; - @override @JsonKey(name: "last_page") int get lastPage; - @override @JsonKey(name: "links") List get links; - @override @JsonKey(name: "path") String? get path; - @override @JsonKey(name: "per_page") int get perPage; - @override @JsonKey(name: "to") dynamic get to; - @override @JsonKey(name: "total") int get total; @@ -552,7 +566,8 @@ abstract class _Meta implements Meta { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => throw _privateConstructorUsedError; + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => + throw _privateConstructorUsedError; } Link _$LinkFromJson(Map json) { @@ -563,10 +578,8 @@ Link _$LinkFromJson(Map json) { mixin _$Link { @JsonKey(name: "url") String? get url => throw _privateConstructorUsedError; - @JsonKey(name: "label") String? get label => throw _privateConstructorUsedError; - @JsonKey(name: "active") bool? get active => throw _privateConstructorUsedError; @@ -581,19 +594,22 @@ mixin _$Link { /// @nodoc abstract class $LinkCopyWith<$Res> { - factory $LinkCopyWith(Link value, $Res Function(Link) then) = _$LinkCopyWithImpl<$Res, Link>; - + factory $LinkCopyWith(Link value, $Res Function(Link) then) = + _$LinkCopyWithImpl<$Res, Link>; @useResult - $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String? label, @JsonKey(name: "active") bool? active}); + $Res call( + {@JsonKey(name: "url") String? url, + @JsonKey(name: "label") String? label, + @JsonKey(name: "active") bool? active}); } /// @nodoc -class _$LinkCopyWithImpl<$Res, $Val extends Link> implements $LinkCopyWith<$Res> { +class _$LinkCopyWithImpl<$Res, $Val extends Link> + implements $LinkCopyWith<$Res> { _$LinkCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -625,16 +641,23 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link> implements $LinkCopyWith<$Res> /// @nodoc abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> { - factory _$$LinkImplCopyWith(_$LinkImpl value, $Res Function(_$LinkImpl) then) = __$$LinkImplCopyWithImpl<$Res>; - + factory _$$LinkImplCopyWith( + _$LinkImpl value, $Res Function(_$LinkImpl) then) = + __$$LinkImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String? label, @JsonKey(name: "active") bool? active}); + $Res call( + {@JsonKey(name: "url") String? url, + @JsonKey(name: "label") String? label, + @JsonKey(name: "active") bool? active}); } /// @nodoc -class __$$LinkImplCopyWithImpl<$Res> extends _$LinkCopyWithImpl<$Res, _$LinkImpl> implements _$$LinkImplCopyWith<$Res> { - __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) : super(_value, _then); +class __$$LinkImplCopyWithImpl<$Res> + extends _$LinkCopyWithImpl<$Res, _$LinkImpl> + implements _$$LinkImplCopyWith<$Res> { + __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) + : super(_value, _then); /// Create a copy of Link /// with the given fields replaced by the non-null parameter values. @@ -665,9 +688,13 @@ class __$$LinkImplCopyWithImpl<$Res> extends _$LinkCopyWithImpl<$Res, _$LinkImpl /// @nodoc @JsonSerializable() class _$LinkImpl implements _Link { - const _$LinkImpl({@JsonKey(name: "url") this.url, @JsonKey(name: "label") this.label, @JsonKey(name: "active") this.active}); + const _$LinkImpl( + {@JsonKey(name: "url") this.url, + @JsonKey(name: "label") this.label, + @JsonKey(name: "active") this.active}); - factory _$LinkImpl.fromJson(Map json) => _$$LinkImplFromJson(json); + factory _$LinkImpl.fromJson(Map json) => + _$$LinkImplFromJson(json); @override @JsonKey(name: "url") @@ -703,7 +730,8 @@ class _$LinkImpl implements _Link { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => + __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); @override Map toJson() { @@ -714,19 +742,19 @@ class _$LinkImpl implements _Link { } abstract class _Link implements Link { - const factory _Link({@JsonKey(name: "url") final String? url, @JsonKey(name: "label") final String? label, @JsonKey(name: "active") final bool? active}) = - _$LinkImpl; + const factory _Link( + {@JsonKey(name: "url") final String? url, + @JsonKey(name: "label") final String? label, + @JsonKey(name: "active") final bool? active}) = _$LinkImpl; factory _Link.fromJson(Map json) = _$LinkImpl.fromJson; @override @JsonKey(name: "url") String? get url; - @override @JsonKey(name: "label") String? get label; - @override @JsonKey(name: "active") bool? get active; @@ -735,5 +763,6 @@ abstract class _Link implements Link { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => throw _privateConstructorUsedError; + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/core/models/pagination_model.g.dart b/lib/core/models/pagination_model.g.dart index d0baeab8..610d19b2 100644 --- a/lib/core/models/pagination_model.g.dart +++ b/lib/core/models/pagination_model.g.dart @@ -13,7 +13,8 @@ _$LinksImpl _$$LinksImplFromJson(Map json) => _$LinksImpl( next: json['next'], ); -Map _$$LinksImplToJson(_$LinksImpl instance) => { +Map _$$LinksImplToJson(_$LinksImpl instance) => + { 'first': instance.first, 'last': instance.last, 'prev': instance.prev, @@ -24,14 +25,17 @@ _$MetaImpl _$$MetaImplFromJson(Map json) => _$MetaImpl( currentPage: (json['current_page'] as num).toInt(), from: json['from'], lastPage: (json['last_page'] as num).toInt(), - links: (json['links'] as List).map((e) => Link.fromJson(e as Map)).toList(), + links: (json['links'] as List) + .map((e) => Link.fromJson(e as Map)) + .toList(), path: json['path'] as String?, perPage: (json['per_page'] as num).toInt(), to: json['to'], total: (json['total'] as num).toInt(), ); -Map _$$MetaImplToJson(_$MetaImpl instance) => { +Map _$$MetaImplToJson(_$MetaImpl instance) => + { 'current_page': instance.currentPage, 'from': instance.from, 'last_page': instance.lastPage, @@ -48,7 +52,8 @@ _$LinkImpl _$$LinkImplFromJson(Map json) => _$LinkImpl( active: json['active'] as bool?, ); -Map _$$LinkImplToJson(_$LinkImpl instance) => { +Map _$$LinkImplToJson(_$LinkImpl instance) => + { 'url': instance.url, 'label': instance.label, 'active': instance.active, diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart index 46367fd1..97ab368c 100644 --- a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart +++ b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart @@ -17,35 +17,33 @@ final _privateConstructorUsedError = UnsupportedError( /// @nodoc mixin _$SelectionPopupModel { int? get id => throw _privateConstructorUsedError; - String get title => throw _privateConstructorUsedError; - dynamic get value => throw _privateConstructorUsedError; - bool get isSelected => throw _privateConstructorUsedError; /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $SelectionPopupModelCopyWith get copyWith => throw _privateConstructorUsedError; + $SelectionPopupModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $SelectionPopupModelCopyWith<$Res> { - factory $SelectionPopupModelCopyWith(SelectionPopupModel value, $Res Function(SelectionPopupModel) then) = + factory $SelectionPopupModelCopyWith( + SelectionPopupModel value, $Res Function(SelectionPopupModel) then) = _$SelectionPopupModelCopyWithImpl<$Res, SelectionPopupModel>; - @useResult $Res call({int? id, String title, dynamic value, bool isSelected}); } /// @nodoc -class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> implements $SelectionPopupModelCopyWith<$Res> { +class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> + implements $SelectionPopupModelCopyWith<$Res> { _$SelectionPopupModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -81,19 +79,23 @@ class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> } /// @nodoc -abstract class _$$SelectionPopupModelImplCopyWith<$Res> implements $SelectionPopupModelCopyWith<$Res> { - factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value, $Res Function(_$SelectionPopupModelImpl) then) = +abstract class _$$SelectionPopupModelImplCopyWith<$Res> + implements $SelectionPopupModelCopyWith<$Res> { + factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value, + $Res Function(_$SelectionPopupModelImpl) then) = __$$SelectionPopupModelImplCopyWithImpl<$Res>; - @override @useResult $Res call({int? id, String title, dynamic value, bool isSelected}); } /// @nodoc -class __$$SelectionPopupModelImplCopyWithImpl<$Res> extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl> +class __$$SelectionPopupModelImplCopyWithImpl<$Res> + extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl> implements _$$SelectionPopupModelImplCopyWith<$Res> { - __$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value, $Res Function(_$SelectionPopupModelImpl) _then) : super(_value, _then); + __$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value, + $Res Function(_$SelectionPopupModelImpl) _then) + : super(_value, _then); /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @@ -129,7 +131,8 @@ class __$$SelectionPopupModelImplCopyWithImpl<$Res> extends _$SelectionPopupMode /// @nodoc class _$SelectionPopupModelImpl implements _SelectionPopupModel { - const _$SelectionPopupModelImpl({this.id, required this.title, this.value, this.isSelected = false}); + const _$SelectionPopupModelImpl( + {this.id, required this.title, this.value, this.isSelected = false}); @override final int? id; @@ -154,11 +157,13 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && const DeepCollectionEquality().equals(other.value, value) && - (identical(other.isSelected, isSelected) || other.isSelected == isSelected)); + (identical(other.isSelected, isSelected) || + other.isSelected == isSelected)); } @override - int get hashCode => Object.hash(runtimeType, id, title, const DeepCollectionEquality().hash(value), isSelected); + int get hashCode => Object.hash(runtimeType, id, title, + const DeepCollectionEquality().hash(value), isSelected); /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @@ -166,21 +171,23 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { @override @pragma('vm:prefer-inline') _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => - __$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>(this, _$identity); + __$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>( + this, _$identity); } abstract class _SelectionPopupModel implements SelectionPopupModel { - const factory _SelectionPopupModel({final int? id, required final String title, final dynamic value, final bool isSelected}) = _$SelectionPopupModelImpl; + const factory _SelectionPopupModel( + {final int? id, + required final String title, + final dynamic value, + final bool isSelected}) = _$SelectionPopupModelImpl; @override int? get id; - @override String get title; - @override dynamic get value; - @override bool get isSelected; @@ -188,5 +195,6 @@ abstract class _SelectionPopupModel implements SelectionPopupModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart index 433a7e15..7c5d7ffd 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$NewMessagesState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$NewMessagesState { /// @nodoc abstract class $NewMessagesStateCopyWith<$Res> { - factory $NewMessagesStateCopyWith(NewMessagesState value, $Res Function(NewMessagesState) then) = _$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>; + factory $NewMessagesStateCopyWith( + NewMessagesState value, $Res Function(NewMessagesState) then) = + _$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>; } /// @nodoc -class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> implements $NewMessagesStateCopyWith<$Res> { +class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> + implements $NewMessagesStateCopyWith<$Res> { _$NewMessagesStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,14 +91,18 @@ class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> implem /// @nodoc abstract class _$$NewMessagesStateImplCopyWith<$Res> { - factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value, $Res Function(_$NewMessagesStateImpl) then) = + factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value, + $Res Function(_$NewMessagesStateImpl) then) = __$$NewMessagesStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NewMessagesStateImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl> +class __$$NewMessagesStateImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl> implements _$$NewMessagesStateImplCopyWith<$Res> { - __$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value, $Res Function(_$NewMessagesStateImpl) _then) : super(_value, _then); + __$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value, + $Res Function(_$NewMessagesStateImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -115,7 +120,8 @@ class _$NewMessagesStateImpl implements _NewMessagesState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$NewMessagesStateImpl); } @override @@ -202,14 +208,19 @@ abstract class _NewMessagesState implements NewMessagesState { /// @nodoc abstract class _$$NewMessagesStateEmptyImplCopyWith<$Res> { - factory _$$NewMessagesStateEmptyImplCopyWith(_$NewMessagesStateEmptyImpl value, $Res Function(_$NewMessagesStateEmptyImpl) then) = + factory _$$NewMessagesStateEmptyImplCopyWith( + _$NewMessagesStateEmptyImpl value, + $Res Function(_$NewMessagesStateEmptyImpl) then) = __$$NewMessagesStateEmptyImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl> +class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl> implements _$$NewMessagesStateEmptyImplCopyWith<$Res> { - __$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value, $Res Function(_$NewMessagesStateEmptyImpl) _then) : super(_value, _then); + __$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value, + $Res Function(_$NewMessagesStateEmptyImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -227,7 +238,9 @@ class _$NewMessagesStateEmptyImpl implements NewMessagesStateEmpty { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateEmptyImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NewMessagesStateEmptyImpl); } @override @@ -314,17 +327,22 @@ abstract class NewMessagesStateEmpty implements NewMessagesState { /// @nodoc abstract class _$$NewMessagesStateLoadedImplCopyWith<$Res> { - factory _$$NewMessagesStateLoadedImplCopyWith(_$NewMessagesStateLoadedImpl value, $Res Function(_$NewMessagesStateLoadedImpl) then) = + factory _$$NewMessagesStateLoadedImplCopyWith( + _$NewMessagesStateLoadedImpl value, + $Res Function(_$NewMessagesStateLoadedImpl) then) = __$$NewMessagesStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({int messagesCount}); } /// @nodoc -class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl> +class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl> implements _$$NewMessagesStateLoadedImplCopyWith<$Res> { - __$$NewMessagesStateLoadedImplCopyWithImpl(_$NewMessagesStateLoadedImpl _value, $Res Function(_$NewMessagesStateLoadedImpl) _then) : super(_value, _then); + __$$NewMessagesStateLoadedImplCopyWithImpl( + _$NewMessagesStateLoadedImpl _value, + $Res Function(_$NewMessagesStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -360,7 +378,8 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateLoadedImpl && - (identical(other.messagesCount, messagesCount) || other.messagesCount == messagesCount)); + (identical(other.messagesCount, messagesCount) || + other.messagesCount == messagesCount)); } @override @@ -371,8 +390,9 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => - __$$NewMessagesStateLoadedImplCopyWithImpl<_$NewMessagesStateLoadedImpl>(this, _$identity); + _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> + get copyWith => __$$NewMessagesStateLoadedImplCopyWithImpl< + _$NewMessagesStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -450,29 +470,35 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { } abstract class NewMessagesStateLoaded implements NewMessagesState { - const factory NewMessagesStateLoaded({required final int messagesCount}) = _$NewMessagesStateLoadedImpl; + const factory NewMessagesStateLoaded({required final int messagesCount}) = + _$NewMessagesStateLoadedImpl; int get messagesCount; /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$NewMessagesStateErrorImplCopyWith<$Res> { - factory _$$NewMessagesStateErrorImplCopyWith(_$NewMessagesStateErrorImpl value, $Res Function(_$NewMessagesStateErrorImpl) then) = + factory _$$NewMessagesStateErrorImplCopyWith( + _$NewMessagesStateErrorImpl value, + $Res Function(_$NewMessagesStateErrorImpl) then) = __$$NewMessagesStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$NewMessagesStateErrorImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl> +class __$$NewMessagesStateErrorImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl> implements _$$NewMessagesStateErrorImplCopyWith<$Res> { - __$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value, $Res Function(_$NewMessagesStateErrorImpl) _then) : super(_value, _then); + __$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value, + $Res Function(_$NewMessagesStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -508,7 +534,8 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -519,8 +546,9 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => - __$$NewMessagesStateErrorImplCopyWithImpl<_$NewMessagesStateErrorImpl>(this, _$identity); + _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> + get copyWith => __$$NewMessagesStateErrorImplCopyWithImpl< + _$NewMessagesStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -598,12 +626,14 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { } abstract class NewMessagesStateError implements NewMessagesState { - const factory NewMessagesStateError({required final String errorMessage}) = _$NewMessagesStateErrorImpl; + const factory NewMessagesStateError({required final String errorMessage}) = + _$NewMessagesStateErrorImpl; String get errorMessage; /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart index 6fa44e3d..d634b318 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart @@ -20,16 +20,18 @@ mixin _$NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +39,8 @@ mixin _$NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,17 +74,18 @@ mixin _$NotificationsState { /// @nodoc abstract class $NotificationsStateCopyWith<$Res> { - factory $NotificationsStateCopyWith(NotificationsState value, $Res Function(NotificationsState) then) = + factory $NotificationsStateCopyWith( + NotificationsState value, $Res Function(NotificationsState) then) = _$NotificationsStateCopyWithImpl<$Res, NotificationsState>; } /// @nodoc -class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> implements $NotificationsStateCopyWith<$Res> { +class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> + implements $NotificationsStateCopyWith<$Res> { _$NotificationsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -91,14 +95,18 @@ class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> im /// @nodoc abstract class _$$NotificationsStateImplCopyWith<$Res> { - factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value, $Res Function(_$NotificationsStateImpl) then) = + factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value, + $Res Function(_$NotificationsStateImpl) then) = __$$NotificationsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NotificationsStateImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl> +class __$$NotificationsStateImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl> implements _$$NotificationsStateImplCopyWith<$Res> { - __$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value, $Res Function(_$NotificationsStateImpl) _then) : super(_value, _then); + __$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value, + $Res Function(_$NotificationsStateImpl) _then) + : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -116,7 +124,8 @@ class _$NotificationsStateImpl implements _NotificationsState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$NotificationsStateImpl); } @override @@ -127,7 +136,9 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -138,7 +149,8 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -149,7 +161,8 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -203,14 +216,21 @@ abstract class _NotificationsState implements NotificationsState { /// @nodoc abstract class _$$NotificationsStateEmptyImplCopyWith<$Res> { - factory _$$NotificationsStateEmptyImplCopyWith(_$NotificationsStateEmptyImpl value, $Res Function(_$NotificationsStateEmptyImpl) then) = + factory _$$NotificationsStateEmptyImplCopyWith( + _$NotificationsStateEmptyImpl value, + $Res Function(_$NotificationsStateEmptyImpl) then) = __$$NotificationsStateEmptyImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NotificationsStateEmptyImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateEmptyImpl> +class __$$NotificationsStateEmptyImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, + _$NotificationsStateEmptyImpl> implements _$$NotificationsStateEmptyImplCopyWith<$Res> { - __$$NotificationsStateEmptyImplCopyWithImpl(_$NotificationsStateEmptyImpl _value, $Res Function(_$NotificationsStateEmptyImpl) _then) : super(_value, _then); + __$$NotificationsStateEmptyImplCopyWithImpl( + _$NotificationsStateEmptyImpl _value, + $Res Function(_$NotificationsStateEmptyImpl) _then) + : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -228,7 +248,9 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateEmptyImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NotificationsStateEmptyImpl); } @override @@ -239,7 +261,9 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return empty(); @@ -250,7 +274,8 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return empty?.call(); @@ -261,7 +286,8 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -315,17 +341,22 @@ abstract class NotificationsStateEmpty implements NotificationsState { /// @nodoc abstract class _$$NotificationsStateLoadedImplCopyWith<$Res> { - factory _$$NotificationsStateLoadedImplCopyWith(_$NotificationsStateLoadedImpl value, $Res Function(_$NotificationsStateLoadedImpl) then) = + factory _$$NotificationsStateLoadedImplCopyWith( + _$NotificationsStateLoadedImpl value, + $Res Function(_$NotificationsStateLoadedImpl) then) = __$$NotificationsStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({List notifications, int notificationsCount}); } /// @nodoc -class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateLoadedImpl> +class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, + _$NotificationsStateLoadedImpl> implements _$$NotificationsStateLoadedImplCopyWith<$Res> { - __$$NotificationsStateLoadedImplCopyWithImpl(_$NotificationsStateLoadedImpl _value, $Res Function(_$NotificationsStateLoadedImpl) _then) + __$$NotificationsStateLoadedImplCopyWithImpl( + _$NotificationsStateLoadedImpl _value, + $Res Function(_$NotificationsStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of NotificationsState @@ -352,10 +383,12 @@ class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> extends _$Notifications /// @nodoc class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { - const _$NotificationsStateLoadedImpl({required final List notifications, required this.notificationsCount}) : _notifications = notifications; + const _$NotificationsStateLoadedImpl( + {required final List notifications, + required this.notificationsCount}) + : _notifications = notifications; final List _notifications; - @override List get notifications { if (_notifications is EqualUnmodifiableListView) return _notifications; @@ -376,27 +409,33 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateLoadedImpl && - const DeepCollectionEquality().equals(other._notifications, _notifications) && - (identical(other.notificationsCount, notificationsCount) || other.notificationsCount == notificationsCount)); + const DeepCollectionEquality() + .equals(other._notifications, _notifications) && + (identical(other.notificationsCount, notificationsCount) || + other.notificationsCount == notificationsCount)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_notifications), notificationsCount); + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_notifications), notificationsCount); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => - __$$NotificationsStateLoadedImplCopyWithImpl<_$NotificationsStateLoadedImpl>(this, _$identity); + _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> + get copyWith => __$$NotificationsStateLoadedImplCopyWithImpl< + _$NotificationsStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return loaded(notifications, notificationsCount); @@ -407,7 +446,8 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(notifications, notificationsCount); @@ -418,7 +458,8 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -467,31 +508,39 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { } abstract class NotificationsStateLoaded implements NotificationsState { - const factory NotificationsStateLoaded({required final List notifications, required final int notificationsCount}) = _$NotificationsStateLoadedImpl; + const factory NotificationsStateLoaded( + {required final List notifications, + required final int notificationsCount}) = _$NotificationsStateLoadedImpl; List get notifications; - int get notificationsCount; /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$NotificationsStateErrorImplCopyWith<$Res> { - factory _$$NotificationsStateErrorImplCopyWith(_$NotificationsStateErrorImpl value, $Res Function(_$NotificationsStateErrorImpl) then) = + factory _$$NotificationsStateErrorImplCopyWith( + _$NotificationsStateErrorImpl value, + $Res Function(_$NotificationsStateErrorImpl) then) = __$$NotificationsStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$NotificationsStateErrorImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateErrorImpl> +class __$$NotificationsStateErrorImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, + _$NotificationsStateErrorImpl> implements _$$NotificationsStateErrorImplCopyWith<$Res> { - __$$NotificationsStateErrorImplCopyWithImpl(_$NotificationsStateErrorImpl _value, $Res Function(_$NotificationsStateErrorImpl) _then) : super(_value, _then); + __$$NotificationsStateErrorImplCopyWithImpl( + _$NotificationsStateErrorImpl _value, + $Res Function(_$NotificationsStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -527,7 +576,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -538,15 +588,18 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => - __$$NotificationsStateErrorImplCopyWithImpl<_$NotificationsStateErrorImpl>(this, _$identity); + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> + get copyWith => __$$NotificationsStateErrorImplCopyWithImpl< + _$NotificationsStateErrorImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -557,7 +610,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -568,7 +622,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -617,12 +672,14 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { } abstract class NotificationsStateError implements NotificationsState { - const factory NotificationsStateError({required final String errorMessage}) = _$NotificationsStateErrorImpl; + const factory NotificationsStateError({required final String errorMessage}) = + _$NotificationsStateErrorImpl; String get errorMessage; /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart index b4ba4c19..b629d579 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$ProfileAvatarState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,17 +70,18 @@ mixin _$ProfileAvatarState { /// @nodoc abstract class $ProfileAvatarStateCopyWith<$Res> { - factory $ProfileAvatarStateCopyWith(ProfileAvatarState value, $Res Function(ProfileAvatarState) then) = + factory $ProfileAvatarStateCopyWith( + ProfileAvatarState value, $Res Function(ProfileAvatarState) then) = _$ProfileAvatarStateCopyWithImpl<$Res, ProfileAvatarState>; } /// @nodoc -class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> implements $ProfileAvatarStateCopyWith<$Res> { +class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> + implements $ProfileAvatarStateCopyWith<$Res> { _$ProfileAvatarStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -91,14 +91,18 @@ class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> im /// @nodoc abstract class _$$ProfileAvatarStateImplCopyWith<$Res> { - factory _$$ProfileAvatarStateImplCopyWith(_$ProfileAvatarStateImpl value, $Res Function(_$ProfileAvatarStateImpl) then) = + factory _$$ProfileAvatarStateImplCopyWith(_$ProfileAvatarStateImpl value, + $Res Function(_$ProfileAvatarStateImpl) then) = __$$ProfileAvatarStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileAvatarStateImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateImpl> +class __$$ProfileAvatarStateImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateImpl> implements _$$ProfileAvatarStateImplCopyWith<$Res> { - __$$ProfileAvatarStateImplCopyWithImpl(_$ProfileAvatarStateImpl _value, $Res Function(_$ProfileAvatarStateImpl) _then) : super(_value, _then); + __$$ProfileAvatarStateImplCopyWithImpl(_$ProfileAvatarStateImpl _value, + $Res Function(_$ProfileAvatarStateImpl) _then) + : super(_value, _then); /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @@ -116,7 +120,8 @@ class _$ProfileAvatarStateImpl implements _ProfileAvatarState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileAvatarStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ProfileAvatarStateImpl); } @override @@ -203,14 +208,20 @@ abstract class _ProfileAvatarState implements ProfileAvatarState { /// @nodoc abstract class _$$ProfileAvatarStateLoadingImplCopyWith<$Res> { - factory _$$ProfileAvatarStateLoadingImplCopyWith(_$ProfileAvatarStateLoadingImpl value, $Res Function(_$ProfileAvatarStateLoadingImpl) then) = + factory _$$ProfileAvatarStateLoadingImplCopyWith( + _$ProfileAvatarStateLoadingImpl value, + $Res Function(_$ProfileAvatarStateLoadingImpl) then) = __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateLoadingImpl> +class __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, + _$ProfileAvatarStateLoadingImpl> implements _$$ProfileAvatarStateLoadingImplCopyWith<$Res> { - __$$ProfileAvatarStateLoadingImplCopyWithImpl(_$ProfileAvatarStateLoadingImpl _value, $Res Function(_$ProfileAvatarStateLoadingImpl) _then) + __$$ProfileAvatarStateLoadingImplCopyWithImpl( + _$ProfileAvatarStateLoadingImpl _value, + $Res Function(_$ProfileAvatarStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of ProfileAvatarState @@ -229,7 +240,9 @@ class _$ProfileAvatarStateLoadingImpl implements ProfileAvatarStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileAvatarStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileAvatarStateLoadingImpl); } @override @@ -316,9 +329,10 @@ abstract class ProfileAvatarStateLoading implements ProfileAvatarState { /// @nodoc abstract class _$$ProfileAvatarStateLoadedImplCopyWith<$Res> { - factory _$$ProfileAvatarStateLoadedImplCopyWith(_$ProfileAvatarStateLoadedImpl value, $Res Function(_$ProfileAvatarStateLoadedImpl) then) = + factory _$$ProfileAvatarStateLoadedImplCopyWith( + _$ProfileAvatarStateLoadedImpl value, + $Res Function(_$ProfileAvatarStateLoadedImpl) then) = __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({ProfileModel profile}); @@ -326,9 +340,13 @@ abstract class _$$ProfileAvatarStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateLoadedImpl> +class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, + _$ProfileAvatarStateLoadedImpl> implements _$$ProfileAvatarStateLoadedImplCopyWith<$Res> { - __$$ProfileAvatarStateLoadedImplCopyWithImpl(_$ProfileAvatarStateLoadedImpl _value, $Res Function(_$ProfileAvatarStateLoadedImpl) _then) + __$$ProfileAvatarStateLoadedImplCopyWithImpl( + _$ProfileAvatarStateLoadedImpl _value, + $Res Function(_$ProfileAvatarStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of ProfileAvatarState @@ -373,7 +391,9 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ProfileAvatarStateLoadedImpl && (identical(other.profile, profile) || other.profile == profile)); + (other.runtimeType == runtimeType && + other is _$ProfileAvatarStateLoadedImpl && + (identical(other.profile, profile) || other.profile == profile)); } @override @@ -384,8 +404,9 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> get copyWith => - __$$ProfileAvatarStateLoadedImplCopyWithImpl<_$ProfileAvatarStateLoadedImpl>(this, _$identity); + _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> + get copyWith => __$$ProfileAvatarStateLoadedImplCopyWithImpl< + _$ProfileAvatarStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -463,29 +484,37 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded { } abstract class ProfileAvatarStateLoaded implements ProfileAvatarState { - const factory ProfileAvatarStateLoaded({required final ProfileModel profile}) = _$ProfileAvatarStateLoadedImpl; + const factory ProfileAvatarStateLoaded( + {required final ProfileModel profile}) = _$ProfileAvatarStateLoadedImpl; ProfileModel get profile; /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ProfileAvatarStateErrorImplCopyWith<$Res> { - factory _$$ProfileAvatarStateErrorImplCopyWith(_$ProfileAvatarStateErrorImpl value, $Res Function(_$ProfileAvatarStateErrorImpl) then) = + factory _$$ProfileAvatarStateErrorImplCopyWith( + _$ProfileAvatarStateErrorImpl value, + $Res Function(_$ProfileAvatarStateErrorImpl) then) = __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res> extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateErrorImpl> +class __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, + _$ProfileAvatarStateErrorImpl> implements _$$ProfileAvatarStateErrorImplCopyWith<$Res> { - __$$ProfileAvatarStateErrorImplCopyWithImpl(_$ProfileAvatarStateErrorImpl _value, $Res Function(_$ProfileAvatarStateErrorImpl) _then) : super(_value, _then); + __$$ProfileAvatarStateErrorImplCopyWithImpl( + _$ProfileAvatarStateErrorImpl _value, + $Res Function(_$ProfileAvatarStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @@ -521,7 +550,8 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileAvatarStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -532,8 +562,9 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> get copyWith => - __$$ProfileAvatarStateErrorImplCopyWithImpl<_$ProfileAvatarStateErrorImpl>(this, _$identity); + _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> + get copyWith => __$$ProfileAvatarStateErrorImplCopyWithImpl< + _$ProfileAvatarStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -611,12 +642,14 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError { } abstract class ProfileAvatarStateError implements ProfileAvatarState { - const factory ProfileAvatarStateError({required final String errorMessage}) = _$ProfileAvatarStateErrorImpl; + const factory ProfileAvatarStateError({required final String errorMessage}) = + _$ProfileAvatarStateErrorImpl; String get errorMessage; /// Create a copy of ProfileAvatarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/models/calendar_model.freezed.dart b/lib/features/calendar/models/calendar_model.freezed.dart index f7a1d191..d10fc8f2 100644 --- a/lib/features/calendar/models/calendar_model.freezed.dart +++ b/lib/features/calendar/models/calendar_model.freezed.dart @@ -21,9 +21,8 @@ CalendarModel _$CalendarModelFromJson(Map json) { /// @nodoc mixin _$CalendarModel { String get date => throw _privateConstructorUsedError; - - bool get is_current_day_included_in_the_chosen_diet_progression => throw _privateConstructorUsedError; - + bool get is_current_day_included_in_the_chosen_diet_progression => + throw _privateConstructorUsedError; Object? get diary => throw _privateConstructorUsedError; /// Serializes this CalendarModel to a JSON map. @@ -32,24 +31,29 @@ mixin _$CalendarModel { /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $CalendarModelCopyWith get copyWith => throw _privateConstructorUsedError; + $CalendarModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $CalendarModelCopyWith<$Res> { - factory $CalendarModelCopyWith(CalendarModel value, $Res Function(CalendarModel) then) = _$CalendarModelCopyWithImpl<$Res, CalendarModel>; - + factory $CalendarModelCopyWith( + CalendarModel value, $Res Function(CalendarModel) then) = + _$CalendarModelCopyWithImpl<$Res, CalendarModel>; @useResult - $Res call({String date, bool is_current_day_included_in_the_chosen_diet_progression, Object? diary}); + $Res call( + {String date, + bool is_current_day_included_in_the_chosen_diet_progression, + Object? diary}); } /// @nodoc -class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> implements $CalendarModelCopyWith<$Res> { +class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> + implements $CalendarModelCopyWith<$Res> { _$CalendarModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -67,7 +71,8 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> implements $ ? _value.date : date // ignore: cast_nullable_to_non_nullable as String, - is_current_day_included_in_the_chosen_diet_progression: null == is_current_day_included_in_the_chosen_diet_progression + is_current_day_included_in_the_chosen_diet_progression: null == + is_current_day_included_in_the_chosen_diet_progression ? _value.is_current_day_included_in_the_chosen_diet_progression : is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable as bool, @@ -77,17 +82,26 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> implements $ } /// @nodoc -abstract class _$$CalendarModelImplCopyWith<$Res> implements $CalendarModelCopyWith<$Res> { - factory _$$CalendarModelImplCopyWith(_$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) = __$$CalendarModelImplCopyWithImpl<$Res>; - +abstract class _$$CalendarModelImplCopyWith<$Res> + implements $CalendarModelCopyWith<$Res> { + factory _$$CalendarModelImplCopyWith( + _$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) = + __$$CalendarModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({String date, bool is_current_day_included_in_the_chosen_diet_progression, Object? diary}); + $Res call( + {String date, + bool is_current_day_included_in_the_chosen_diet_progression, + Object? diary}); } /// @nodoc -class __$$CalendarModelImplCopyWithImpl<$Res> extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl> implements _$$CalendarModelImplCopyWith<$Res> { - __$$CalendarModelImplCopyWithImpl(_$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then) : super(_value, _then); +class __$$CalendarModelImplCopyWithImpl<$Res> + extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl> + implements _$$CalendarModelImplCopyWith<$Res> { + __$$CalendarModelImplCopyWithImpl( + _$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then) + : super(_value, _then); /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @@ -103,7 +117,8 @@ class __$$CalendarModelImplCopyWithImpl<$Res> extends _$CalendarModelCopyWithImp ? _value.date : date // ignore: cast_nullable_to_non_nullable as String, - is_current_day_included_in_the_chosen_diet_progression: null == is_current_day_included_in_the_chosen_diet_progression + is_current_day_included_in_the_chosen_diet_progression: null == + is_current_day_included_in_the_chosen_diet_progression ? _value.is_current_day_included_in_the_chosen_diet_progression : is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable as bool, @@ -115,9 +130,13 @@ class __$$CalendarModelImplCopyWithImpl<$Res> extends _$CalendarModelCopyWithImp /// @nodoc @JsonSerializable() class _$CalendarModelImpl implements _CalendarModel { - const _$CalendarModelImpl({required this.date, required this.is_current_day_included_in_the_chosen_diet_progression, this.diary}); + const _$CalendarModelImpl( + {required this.date, + required this.is_current_day_included_in_the_chosen_diet_progression, + this.diary}); - factory _$CalendarModelImpl.fromJson(Map json) => _$$CalendarModelImplFromJson(json); + factory _$CalendarModelImpl.fromJson(Map json) => + _$$CalendarModelImplFromJson(json); @override final String date; @@ -137,21 +156,30 @@ class _$CalendarModelImpl implements _CalendarModel { (other.runtimeType == runtimeType && other is _$CalendarModelImpl && (identical(other.date, date) || other.date == date) && - (identical(other.is_current_day_included_in_the_chosen_diet_progression, is_current_day_included_in_the_chosen_diet_progression) || - other.is_current_day_included_in_the_chosen_diet_progression == is_current_day_included_in_the_chosen_diet_progression) && + (identical( + other + .is_current_day_included_in_the_chosen_diet_progression, + is_current_day_included_in_the_chosen_diet_progression) || + other.is_current_day_included_in_the_chosen_diet_progression == + is_current_day_included_in_the_chosen_diet_progression) && const DeepCollectionEquality().equals(other.diary, diary)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, date, is_current_day_included_in_the_chosen_diet_progression, const DeepCollectionEquality().hash(diary)); + int get hashCode => Object.hash( + runtimeType, + date, + is_current_day_included_in_the_chosen_diet_progression, + const DeepCollectionEquality().hash(diary)); /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => __$$CalendarModelImplCopyWithImpl<_$CalendarModelImpl>(this, _$identity); + _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => + __$$CalendarModelImplCopyWithImpl<_$CalendarModelImpl>(this, _$identity); @override Map toJson() { @@ -162,17 +190,19 @@ class _$CalendarModelImpl implements _CalendarModel { } abstract class _CalendarModel implements CalendarModel { - const factory _CalendarModel({required final String date, required final bool is_current_day_included_in_the_chosen_diet_progression, final Object? diary}) = - _$CalendarModelImpl; + const factory _CalendarModel( + {required final String date, + required final bool + is_current_day_included_in_the_chosen_diet_progression, + final Object? diary}) = _$CalendarModelImpl; - factory _CalendarModel.fromJson(Map json) = _$CalendarModelImpl.fromJson; + factory _CalendarModel.fromJson(Map json) = + _$CalendarModelImpl.fromJson; @override String get date; - @override bool get is_current_day_included_in_the_chosen_diet_progression; - @override Object? get diary; @@ -180,5 +210,6 @@ abstract class _CalendarModel implements CalendarModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/models/calendar_model.g.dart b/lib/features/calendar/models/calendar_model.g.dart index 4134c22e..65fd0063 100644 --- a/lib/features/calendar/models/calendar_model.g.dart +++ b/lib/features/calendar/models/calendar_model.g.dart @@ -6,14 +6,19 @@ part of 'calendar_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CalendarModelImpl _$$CalendarModelImplFromJson(Map json) => _$CalendarModelImpl( +_$CalendarModelImpl _$$CalendarModelImplFromJson(Map json) => + _$CalendarModelImpl( date: json['date'] as String, - is_current_day_included_in_the_chosen_diet_progression: json['is_current_day_included_in_the_chosen_diet_progression'] as bool, + is_current_day_included_in_the_chosen_diet_progression: + json['is_current_day_included_in_the_chosen_diet_progression'] + as bool, diary: json['diary'], ); -Map _$$CalendarModelImplToJson(_$CalendarModelImpl instance) => { +Map _$$CalendarModelImplToJson(_$CalendarModelImpl instance) => + { 'date': instance.date, - 'is_current_day_included_in_the_chosen_diet_progression': instance.is_current_day_included_in_the_chosen_diet_progression, + 'is_current_day_included_in_the_chosen_diet_progression': + instance.is_current_day_included_in_the_chosen_diet_progression, 'diary': instance.diary, }; diff --git a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart index 76a12423..0e7bdbcd 100644 --- a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart +++ b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$CalendarState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$CalendarState { /// @nodoc abstract class $CalendarStateCopyWith<$Res> { - factory $CalendarStateCopyWith(CalendarState value, $Res Function(CalendarState) then) = _$CalendarStateCopyWithImpl<$Res, CalendarState>; + factory $CalendarStateCopyWith( + CalendarState value, $Res Function(CalendarState) then) = + _$CalendarStateCopyWithImpl<$Res, CalendarState>; } /// @nodoc -class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> implements $CalendarStateCopyWith<$Res> { +class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> + implements $CalendarStateCopyWith<$Res> { _$CalendarStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +91,18 @@ class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> implements $ /// @nodoc abstract class _$$CalendarStateImplCopyWith<$Res> { - factory _$$CalendarStateImplCopyWith(_$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) = __$$CalendarStateImplCopyWithImpl<$Res>; + factory _$$CalendarStateImplCopyWith( + _$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) = + __$$CalendarStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CalendarStateImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl> implements _$$CalendarStateImplCopyWith<$Res> { - __$$CalendarStateImplCopyWithImpl(_$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then) : super(_value, _then); +class __$$CalendarStateImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl> + implements _$$CalendarStateImplCopyWith<$Res> { + __$$CalendarStateImplCopyWithImpl( + _$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +120,8 @@ class _$CalendarStateImpl implements _CalendarState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$CalendarStateImpl); } @override @@ -200,14 +208,18 @@ abstract class _CalendarState implements CalendarState { /// @nodoc abstract class _$$CalendarStateLoadingImplCopyWith<$Res> { - factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value, $Res Function(_$CalendarStateLoadingImpl) then) = + factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value, + $Res Function(_$CalendarStateLoadingImpl) then) = __$$CalendarStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CalendarStateLoadingImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl> +class __$$CalendarStateLoadingImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl> implements _$$CalendarStateLoadingImplCopyWith<$Res> { - __$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value, $Res Function(_$CalendarStateLoadingImpl) _then) : super(_value, _then); + __$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value, + $Res Function(_$CalendarStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +237,9 @@ class _$CalendarStateLoadingImpl implements CalendarStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$CalendarStateLoadingImpl); } @override @@ -312,17 +326,20 @@ abstract class CalendarStateLoading implements CalendarState { /// @nodoc abstract class _$$CalendarStateLoadedImplCopyWith<$Res> { - factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value, $Res Function(_$CalendarStateLoadedImpl) then) = + factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value, + $Res Function(_$CalendarStateLoadedImpl) then) = __$$CalendarStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({List calendarList}); } /// @nodoc -class __$$CalendarStateLoadedImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl> +class __$$CalendarStateLoadedImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl> implements _$$CalendarStateLoadedImplCopyWith<$Res> { - __$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value, $Res Function(_$CalendarStateLoadedImpl) _then) : super(_value, _then); + __$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value, + $Res Function(_$CalendarStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -343,10 +360,11 @@ class __$$CalendarStateLoadedImplCopyWithImpl<$Res> extends _$CalendarStateCopyW /// @nodoc class _$CalendarStateLoadedImpl implements CalendarStateLoaded { - const _$CalendarStateLoadedImpl({required final List calendarList}) : _calendarList = calendarList; + const _$CalendarStateLoadedImpl( + {required final List calendarList}) + : _calendarList = calendarList; final List _calendarList; - @override List get calendarList { if (_calendarList is EqualUnmodifiableListView) return _calendarList; @@ -362,11 +380,15 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$CalendarStateLoadedImpl && const DeepCollectionEquality().equals(other._calendarList, _calendarList)); + (other.runtimeType == runtimeType && + other is _$CalendarStateLoadedImpl && + const DeepCollectionEquality() + .equals(other._calendarList, _calendarList)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_calendarList)); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_calendarList)); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -374,7 +396,8 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { @override @pragma('vm:prefer-inline') _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => - __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>(this, _$identity); + __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -452,29 +475,35 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { } abstract class CalendarStateLoaded implements CalendarState { - const factory CalendarStateLoaded({required final List calendarList}) = _$CalendarStateLoadedImpl; + const factory CalendarStateLoaded( + {required final List calendarList}) = + _$CalendarStateLoadedImpl; List get calendarList; /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$CalendarStateErrorImplCopyWith<$Res> { - factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value, $Res Function(_$CalendarStateErrorImpl) then) = + factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value, + $Res Function(_$CalendarStateErrorImpl) then) = __$$CalendarStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$CalendarStateErrorImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl> +class __$$CalendarStateErrorImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl> implements _$$CalendarStateErrorImplCopyWith<$Res> { - __$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value, $Res Function(_$CalendarStateErrorImpl) _then) : super(_value, _then); + __$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value, + $Res Function(_$CalendarStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -510,7 +539,8 @@ class _$CalendarStateErrorImpl implements CalendarStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -522,7 +552,8 @@ class _$CalendarStateErrorImpl implements CalendarStateError { @override @pragma('vm:prefer-inline') _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => - __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>(this, _$identity); + __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -600,12 +631,14 @@ class _$CalendarStateErrorImpl implements CalendarStateError { } abstract class CalendarStateError implements CalendarState { - const factory CalendarStateError({required final String errorMessage}) = _$CalendarStateErrorImpl; + const factory CalendarStateError({required final String errorMessage}) = + _$CalendarStateErrorImpl; String get errorMessage; /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/presentation/pages/calendar_screen.dart b/lib/features/calendar/presentation/pages/calendar_screen.dart index 31342896..7bc7c3fa 100644 --- a/lib/features/calendar/presentation/pages/calendar_screen.dart +++ b/lib/features/calendar/presentation/pages/calendar_screen.dart @@ -1,15 +1,14 @@ import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_cubit.dart'; import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_state.dart'; - import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:go_router/go_router.dart'; import 'package:intl/intl.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_form_builder/flutter_form_builder.dart'; class CalendarScreen extends StatelessWidget { CalendarScreen({Key? key}) : super(key: key); diff --git a/lib/features/calendar/services/calendar_service.g.dart b/lib/features/calendar/services/calendar_service.g.dart index 223e1a2e..903145dc 100644 --- a/lib/features/calendar/services/calendar_service.g.dart +++ b/lib/features/calendar/services/calendar_service.g.dart @@ -46,7 +46,9 @@ class _CalendarService implements CalendarService { final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data!.map((dynamic i) => CalendarModel.fromJson(i as Map)).toList(); + _value = _result.data! + .map((dynamic i) => CalendarModel.fromJson(i as Map)) + .toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -55,7 +57,9 @@ class _CalendarService implements CalendarService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/chat/models/chat_message_model.freezed.dart b/lib/features/chat/models/chat_message_model.freezed.dart index 558753ef..8f921425 100644 --- a/lib/features/chat/models/chat_message_model.freezed.dart +++ b/lib/features/chat/models/chat_message_model.freezed.dart @@ -21,15 +21,11 @@ ChatMessageModel _$ChatMessageModelFromJson(Map json) { /// @nodoc mixin _$ChatMessageModel { int get id => throw _privateConstructorUsedError; - String get data => throw _privateConstructorUsedError; - @JsonKey(name: 'media_data') List? get mediaData => throw _privateConstructorUsedError; - @JsonKey(name: 'author_id') int get authorId => throw _privateConstructorUsedError; - @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; @@ -39,13 +35,15 @@ mixin _$ChatMessageModel { /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMessageModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatMessageModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMessageModelCopyWith<$Res> { - factory $ChatMessageModelCopyWith(ChatMessageModel value, $Res Function(ChatMessageModel) then) = _$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>; - + factory $ChatMessageModelCopyWith( + ChatMessageModel value, $Res Function(ChatMessageModel) then) = + _$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>; @useResult $Res call( {int id, @@ -56,12 +54,12 @@ abstract class $ChatMessageModelCopyWith<$Res> { } /// @nodoc -class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> implements $ChatMessageModelCopyWith<$Res> { +class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> + implements $ChatMessageModelCopyWith<$Res> { _$ChatMessageModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -102,10 +100,11 @@ class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> implem } /// @nodoc -abstract class _$$ChatMessageModelImplCopyWith<$Res> implements $ChatMessageModelCopyWith<$Res> { - factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value, $Res Function(_$ChatMessageModelImpl) then) = +abstract class _$$ChatMessageModelImplCopyWith<$Res> + implements $ChatMessageModelCopyWith<$Res> { + factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value, + $Res Function(_$ChatMessageModelImpl) then) = __$$ChatMessageModelImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -117,9 +116,12 @@ abstract class _$$ChatMessageModelImplCopyWith<$Res> implements $ChatMessageMode } /// @nodoc -class __$$ChatMessageModelImplCopyWithImpl<$Res> extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl> +class __$$ChatMessageModelImplCopyWithImpl<$Res> + extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl> implements _$$ChatMessageModelImplCopyWith<$Res> { - __$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value, $Res Function(_$ChatMessageModelImpl) _then) : super(_value, _then); + __$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value, + $Res Function(_$ChatMessageModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @@ -168,14 +170,14 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { @JsonKey(name: 'updated_at') required this.updatedAt}) : _mediaData = mediaData; - factory _$ChatMessageModelImpl.fromJson(Map json) => _$$ChatMessageModelImplFromJson(json); + factory _$ChatMessageModelImpl.fromJson(Map json) => + _$$ChatMessageModelImplFromJson(json); @override final int id; @override final String data; final List? _mediaData; - @override @JsonKey(name: 'media_data') List? get mediaData { @@ -205,21 +207,27 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { other is _$ChatMessageModelImpl && (identical(other.id, id) || other.id == id) && (identical(other.data, data) || other.data == data) && - const DeepCollectionEquality().equals(other._mediaData, _mediaData) && - (identical(other.authorId, authorId) || other.authorId == authorId) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + const DeepCollectionEquality() + .equals(other._mediaData, _mediaData) && + (identical(other.authorId, authorId) || + other.authorId == authorId) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); + int get hashCode => Object.hash(runtimeType, id, data, + const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>(this, _$identity); + _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => + __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>( + this, _$identity); @override Map toJson() { @@ -231,28 +239,26 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { abstract class _ChatMessageModel implements ChatMessageModel { const factory _ChatMessageModel( - {required final int id, - required final String data, - @JsonKey(name: 'media_data') required final List? mediaData, - @JsonKey(name: 'author_id') required final int authorId, - @JsonKey(name: 'updated_at') required final String updatedAt}) = _$ChatMessageModelImpl; + {required final int id, + required final String data, + @JsonKey(name: 'media_data') required final List? mediaData, + @JsonKey(name: 'author_id') required final int authorId, + @JsonKey(name: 'updated_at') required final String updatedAt}) = + _$ChatMessageModelImpl; - factory _ChatMessageModel.fromJson(Map json) = _$ChatMessageModelImpl.fromJson; + factory _ChatMessageModel.fromJson(Map json) = + _$ChatMessageModelImpl.fromJson; @override int get id; - @override String get data; - @override @JsonKey(name: 'media_data') List? get mediaData; - @override @JsonKey(name: 'author_id') int get authorId; - @override @JsonKey(name: 'updated_at') String get updatedAt; @@ -261,5 +267,6 @@ abstract class _ChatMessageModel implements ChatMessageModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_message_model.g.dart b/lib/features/chat/models/chat_message_model.g.dart index 70531099..3a8d1827 100644 --- a/lib/features/chat/models/chat_message_model.g.dart +++ b/lib/features/chat/models/chat_message_model.g.dart @@ -6,7 +6,9 @@ part of 'chat_message_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson(Map json) => _$ChatMessageModelImpl( +_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson( + Map json) => + _$ChatMessageModelImpl( id: (json['id'] as num).toInt(), data: json['data'] as String, mediaData: json['media_data'] as List?, @@ -14,7 +16,9 @@ _$ChatMessageModelImpl _$$ChatMessageModelImplFromJson(Map json updatedAt: json['updated_at'] as String, ); -Map _$$ChatMessageModelImplToJson(_$ChatMessageModelImpl instance) => { +Map _$$ChatMessageModelImplToJson( + _$ChatMessageModelImpl instance) => + { 'id': instance.id, 'data': instance.data, 'media_data': instance.mediaData, diff --git a/lib/features/chat/models/chat_messages_model.freezed.dart b/lib/features/chat/models/chat_messages_model.freezed.dart index d4dad1cb..852b33e4 100644 --- a/lib/features/chat/models/chat_messages_model.freezed.dart +++ b/lib/features/chat/models/chat_messages_model.freezed.dart @@ -22,7 +22,6 @@ ChatMessagesModel _$ChatMessagesModelFromJson(Map json) { mixin _$ChatMessagesModel { @JsonKey(name: 'data') List get messagesList => throw _privateConstructorUsedError; - ChatMetaModel get meta => throw _privateConstructorUsedError; /// Serializes this ChatMessagesModel to a JSON map. @@ -31,26 +30,30 @@ mixin _$ChatMessagesModel { /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMessagesModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatMessagesModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMessagesModelCopyWith<$Res> { - factory $ChatMessagesModelCopyWith(ChatMessagesModel value, $Res Function(ChatMessagesModel) then) = _$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>; - + factory $ChatMessagesModelCopyWith( + ChatMessagesModel value, $Res Function(ChatMessagesModel) then) = + _$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>; @useResult - $Res call({@JsonKey(name: 'data') List messagesList, ChatMetaModel meta}); + $Res call( + {@JsonKey(name: 'data') List messagesList, + ChatMetaModel meta}); $ChatMetaModelCopyWith<$Res> get meta; } /// @nodoc -class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> implements $ChatMessagesModelCopyWith<$Res> { +class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> + implements $ChatMessagesModelCopyWith<$Res> { _$ChatMessagesModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -86,22 +89,28 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> impl } /// @nodoc -abstract class _$$ChatMessagesModelImplCopyWith<$Res> implements $ChatMessagesModelCopyWith<$Res> { - factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value, $Res Function(_$ChatMessagesModelImpl) then) = +abstract class _$$ChatMessagesModelImplCopyWith<$Res> + implements $ChatMessagesModelCopyWith<$Res> { + factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value, + $Res Function(_$ChatMessagesModelImpl) then) = __$$ChatMessagesModelImplCopyWithImpl<$Res>; - @override @useResult - $Res call({@JsonKey(name: 'data') List messagesList, ChatMetaModel meta}); + $Res call( + {@JsonKey(name: 'data') List messagesList, + ChatMetaModel meta}); @override $ChatMetaModelCopyWith<$Res> get meta; } /// @nodoc -class __$$ChatMessagesModelImplCopyWithImpl<$Res> extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl> +class __$$ChatMessagesModelImplCopyWithImpl<$Res> + extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl> implements _$$ChatMessagesModelImplCopyWith<$Res> { - __$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value, $Res Function(_$ChatMessagesModelImpl) _then) : super(_value, _then); + __$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value, + $Res Function(_$ChatMessagesModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @@ -127,12 +136,16 @@ class __$$ChatMessagesModelImplCopyWithImpl<$Res> extends _$ChatMessagesModelCop /// @nodoc @JsonSerializable() class _$ChatMessagesModelImpl implements _ChatMessagesModel { - const _$ChatMessagesModelImpl({@JsonKey(name: 'data') required final List messagesList, required this.meta}) : _messagesList = messagesList; + const _$ChatMessagesModelImpl( + {@JsonKey(name: 'data') + required final List messagesList, + required this.meta}) + : _messagesList = messagesList; - factory _$ChatMessagesModelImpl.fromJson(Map json) => _$$ChatMessagesModelImplFromJson(json); + factory _$ChatMessagesModelImpl.fromJson(Map json) => + _$$ChatMessagesModelImplFromJson(json); final List _messagesList; - @override @JsonKey(name: 'data') List get messagesList { @@ -154,20 +167,24 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatMessagesModelImpl && - const DeepCollectionEquality().equals(other._messagesList, _messagesList) && + const DeepCollectionEquality() + .equals(other._messagesList, _messagesList) && (identical(other.meta, meta) || other.meta == meta)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>(this, _$identity); + _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => + __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>( + this, _$identity); @override Map toJson() { @@ -178,15 +195,17 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { } abstract class _ChatMessagesModel implements ChatMessagesModel { - const factory _ChatMessagesModel({@JsonKey(name: 'data') required final List messagesList, required final ChatMetaModel meta}) = - _$ChatMessagesModelImpl; + const factory _ChatMessagesModel( + {@JsonKey(name: 'data') + required final List messagesList, + required final ChatMetaModel meta}) = _$ChatMessagesModelImpl; - factory _ChatMessagesModel.fromJson(Map json) = _$ChatMessagesModelImpl.fromJson; + factory _ChatMessagesModel.fromJson(Map json) = + _$ChatMessagesModelImpl.fromJson; @override @JsonKey(name: 'data') List get messagesList; - @override ChatMetaModel get meta; @@ -194,5 +213,6 @@ abstract class _ChatMessagesModel implements ChatMessagesModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_messages_model.g.dart b/lib/features/chat/models/chat_messages_model.g.dart index 1a7fe48b..6216cd83 100644 --- a/lib/features/chat/models/chat_messages_model.g.dart +++ b/lib/features/chat/models/chat_messages_model.g.dart @@ -6,12 +6,18 @@ part of 'chat_messages_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson(Map json) => _$ChatMessagesModelImpl( - messagesList: (json['data'] as List).map((e) => ChatMessageModel.fromJson(e as Map)).toList(), +_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson( + Map json) => + _$ChatMessagesModelImpl( + messagesList: (json['data'] as List) + .map((e) => ChatMessageModel.fromJson(e as Map)) + .toList(), meta: ChatMetaModel.fromJson(json['meta'] as Map), ); -Map _$$ChatMessagesModelImplToJson(_$ChatMessagesModelImpl instance) => { +Map _$$ChatMessagesModelImplToJson( + _$ChatMessagesModelImpl instance) => + { 'data': instance.messagesList, 'meta': instance.meta, }; diff --git a/lib/features/chat/models/chat_meta_model.freezed.dart b/lib/features/chat/models/chat_meta_model.freezed.dart index b4354b59..e8e4e96b 100644 --- a/lib/features/chat/models/chat_meta_model.freezed.dart +++ b/lib/features/chat/models/chat_meta_model.freezed.dart @@ -29,24 +29,26 @@ mixin _$ChatMetaModel { /// Create a copy of ChatMetaModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMetaModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatMetaModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMetaModelCopyWith<$Res> { - factory $ChatMetaModelCopyWith(ChatMetaModel value, $Res Function(ChatMetaModel) then) = _$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>; - + factory $ChatMetaModelCopyWith( + ChatMetaModel value, $Res Function(ChatMetaModel) then) = + _$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>; @useResult $Res call({@JsonKey(name: "last_page") int lastPage}); } /// @nodoc -class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> implements $ChatMetaModelCopyWith<$Res> { +class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> + implements $ChatMetaModelCopyWith<$Res> { _$ChatMetaModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -67,17 +69,23 @@ class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> implements $ } /// @nodoc -abstract class _$$ChatMetaModelImplCopyWith<$Res> implements $ChatMetaModelCopyWith<$Res> { - factory _$$ChatMetaModelImplCopyWith(_$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) = __$$ChatMetaModelImplCopyWithImpl<$Res>; - +abstract class _$$ChatMetaModelImplCopyWith<$Res> + implements $ChatMetaModelCopyWith<$Res> { + factory _$$ChatMetaModelImplCopyWith( + _$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) = + __$$ChatMetaModelImplCopyWithImpl<$Res>; @override @useResult $Res call({@JsonKey(name: "last_page") int lastPage}); } /// @nodoc -class __$$ChatMetaModelImplCopyWithImpl<$Res> extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl> implements _$$ChatMetaModelImplCopyWith<$Res> { - __$$ChatMetaModelImplCopyWithImpl(_$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then) : super(_value, _then); +class __$$ChatMetaModelImplCopyWithImpl<$Res> + extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl> + implements _$$ChatMetaModelImplCopyWith<$Res> { + __$$ChatMetaModelImplCopyWithImpl( + _$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatMetaModel /// with the given fields replaced by the non-null parameter values. @@ -98,9 +106,11 @@ class __$$ChatMetaModelImplCopyWithImpl<$Res> extends _$ChatMetaModelCopyWithImp /// @nodoc @JsonSerializable() class _$ChatMetaModelImpl implements _ChatMetaModel { - const _$ChatMetaModelImpl({@JsonKey(name: "last_page") required this.lastPage}); + const _$ChatMetaModelImpl( + {@JsonKey(name: "last_page") required this.lastPage}); - factory _$ChatMetaModelImpl.fromJson(Map json) => _$$ChatMetaModelImplFromJson(json); + factory _$ChatMetaModelImpl.fromJson(Map json) => + _$$ChatMetaModelImplFromJson(json); @override @JsonKey(name: "last_page") @@ -114,7 +124,10 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatMetaModelImpl && (identical(other.lastPage, lastPage) || other.lastPage == lastPage)); + (other.runtimeType == runtimeType && + other is _$ChatMetaModelImpl && + (identical(other.lastPage, lastPage) || + other.lastPage == lastPage)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -126,7 +139,8 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); + _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => + __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); @override Map toJson() { @@ -137,9 +151,12 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { } abstract class _ChatMetaModel implements ChatMetaModel { - const factory _ChatMetaModel({@JsonKey(name: "last_page") required final int lastPage}) = _$ChatMetaModelImpl; + const factory _ChatMetaModel( + {@JsonKey(name: "last_page") required final int lastPage}) = + _$ChatMetaModelImpl; - factory _ChatMetaModel.fromJson(Map json) = _$ChatMetaModelImpl.fromJson; + factory _ChatMetaModel.fromJson(Map json) = + _$ChatMetaModelImpl.fromJson; @override @JsonKey(name: "last_page") @@ -149,5 +166,6 @@ abstract class _ChatMetaModel implements ChatMetaModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_meta_model.g.dart b/lib/features/chat/models/chat_meta_model.g.dart index bbd16d10..7126e2dd 100644 --- a/lib/features/chat/models/chat_meta_model.g.dart +++ b/lib/features/chat/models/chat_meta_model.g.dart @@ -6,10 +6,12 @@ part of 'chat_meta_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map json) => _$ChatMetaModelImpl( +_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map json) => + _$ChatMetaModelImpl( lastPage: (json['last_page'] as num).toInt(), ); -Map _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) => { +Map _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) => + { 'last_page': instance.lastPage, }; diff --git a/lib/features/chat/models/chat_room_model.freezed.dart b/lib/features/chat/models/chat_room_model.freezed.dart index cef12fbe..6afb3a94 100644 --- a/lib/features/chat/models/chat_room_model.freezed.dart +++ b/lib/features/chat/models/chat_room_model.freezed.dart @@ -21,10 +21,9 @@ ChatRoomModel _$ChatRoomModelFromJson(Map json) { /// @nodoc mixin _$ChatRoomModel { String get id => throw _privateConstructorUsedError; - @JsonKey(name: 'chat_room_setting') - ChatRoomSettingsModel get chatRoomSettings => throw _privateConstructorUsedError; - + ChatRoomSettingsModel get chatRoomSettings => + throw _privateConstructorUsedError; Map get users => throw _privateConstructorUsedError; /// Serializes this ChatRoomModel to a JSON map. @@ -33,26 +32,32 @@ mixin _$ChatRoomModel { /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomModelCopyWith<$Res> { - factory $ChatRoomModelCopyWith(ChatRoomModel value, $Res Function(ChatRoomModel) then) = _$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>; - + factory $ChatRoomModelCopyWith( + ChatRoomModel value, $Res Function(ChatRoomModel) then) = + _$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>; @useResult - $Res call({String id, @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings, Map users}); + $Res call( + {String id, + @JsonKey(name: 'chat_room_setting') + ChatRoomSettingsModel chatRoomSettings, + Map users}); $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings; } /// @nodoc -class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> implements $ChatRoomModelCopyWith<$Res> { +class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> + implements $ChatRoomModelCopyWith<$Res> { _$ChatRoomModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -86,27 +91,38 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> implements $ @override @pragma('vm:prefer-inline') $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings { - return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings, (value) { + return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings, + (value) { return _then(_value.copyWith(chatRoomSettings: value) as $Val); }); } } /// @nodoc -abstract class _$$ChatRoomModelImplCopyWith<$Res> implements $ChatRoomModelCopyWith<$Res> { - factory _$$ChatRoomModelImplCopyWith(_$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) = __$$ChatRoomModelImplCopyWithImpl<$Res>; - +abstract class _$$ChatRoomModelImplCopyWith<$Res> + implements $ChatRoomModelCopyWith<$Res> { + factory _$$ChatRoomModelImplCopyWith( + _$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) = + __$$ChatRoomModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({String id, @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings, Map users}); + $Res call( + {String id, + @JsonKey(name: 'chat_room_setting') + ChatRoomSettingsModel chatRoomSettings, + Map users}); @override $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings; } /// @nodoc -class __$$ChatRoomModelImplCopyWithImpl<$Res> extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl> implements _$$ChatRoomModelImplCopyWith<$Res> { - __$$ChatRoomModelImplCopyWithImpl(_$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then) : super(_value, _then); +class __$$ChatRoomModelImplCopyWithImpl<$Res> + extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl> + implements _$$ChatRoomModelImplCopyWith<$Res> { + __$$ChatRoomModelImplCopyWithImpl( + _$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @@ -138,10 +154,13 @@ class __$$ChatRoomModelImplCopyWithImpl<$Res> extends _$ChatRoomModelCopyWithImp @JsonSerializable() class _$ChatRoomModelImpl implements _ChatRoomModel { const _$ChatRoomModelImpl( - {required this.id, @JsonKey(name: 'chat_room_setting') required this.chatRoomSettings, required final Map users}) + {required this.id, + @JsonKey(name: 'chat_room_setting') required this.chatRoomSettings, + required final Map users}) : _users = users; - factory _$ChatRoomModelImpl.fromJson(Map json) => _$$ChatRoomModelImplFromJson(json); + factory _$ChatRoomModelImpl.fromJson(Map json) => + _$$ChatRoomModelImplFromJson(json); @override final String id; @@ -149,7 +168,6 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { @JsonKey(name: 'chat_room_setting') final ChatRoomSettingsModel chatRoomSettings; final Map _users; - @override Map get users { if (_users is EqualUnmodifiableMapView) return _users; @@ -168,20 +186,23 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { (other.runtimeType == runtimeType && other is _$ChatRoomModelImpl && (identical(other.id, id) || other.id == id) && - (identical(other.chatRoomSettings, chatRoomSettings) || other.chatRoomSettings == chatRoomSettings) && + (identical(other.chatRoomSettings, chatRoomSettings) || + other.chatRoomSettings == chatRoomSettings) && const DeepCollectionEquality().equals(other._users, _users)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, const DeepCollectionEquality().hash(_users)); + int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, + const DeepCollectionEquality().hash(_users)); /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); + _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => + __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); @override Map toJson() { @@ -194,18 +215,18 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { abstract class _ChatRoomModel implements ChatRoomModel { const factory _ChatRoomModel( {required final String id, - @JsonKey(name: 'chat_room_setting') required final ChatRoomSettingsModel chatRoomSettings, + @JsonKey(name: 'chat_room_setting') + required final ChatRoomSettingsModel chatRoomSettings, required final Map users}) = _$ChatRoomModelImpl; - factory _ChatRoomModel.fromJson(Map json) = _$ChatRoomModelImpl.fromJson; + factory _ChatRoomModel.fromJson(Map json) = + _$ChatRoomModelImpl.fromJson; @override String get id; - @override @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel get chatRoomSettings; - @override Map get users; @@ -213,5 +234,6 @@ abstract class _ChatRoomModel implements ChatRoomModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_model.g.dart b/lib/features/chat/models/chat_room_model.g.dart index 6230d4f4..68d3195c 100644 --- a/lib/features/chat/models/chat_room_model.g.dart +++ b/lib/features/chat/models/chat_room_model.g.dart @@ -6,15 +6,19 @@ part of 'chat_room_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map json) => _$ChatRoomModelImpl( +_$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map json) => + _$ChatRoomModelImpl( id: json['id'] as String, - chatRoomSettings: ChatRoomSettingsModel.fromJson(json['chat_room_setting'] as Map), + chatRoomSettings: ChatRoomSettingsModel.fromJson( + json['chat_room_setting'] as Map), users: (json['users'] as Map).map( - (k, e) => MapEntry(k, ChatUserModel.fromJson(e as Map)), + (k, e) => + MapEntry(k, ChatUserModel.fromJson(e as Map)), ), ); -Map _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) => { +Map _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) => + { 'id': instance.id, 'chat_room_setting': instance.chatRoomSettings, 'users': instance.users, diff --git a/lib/features/chat/models/chat_room_preview_model.freezed.dart b/lib/features/chat/models/chat_room_preview_model.freezed.dart index 468bfb92..4b006cf0 100644 --- a/lib/features/chat/models/chat_room_preview_model.freezed.dart +++ b/lib/features/chat/models/chat_room_preview_model.freezed.dart @@ -29,25 +29,27 @@ mixin _$ChatRoomPreviewModel { /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomPreviewModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomPreviewModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomPreviewModelCopyWith<$Res> { - factory $ChatRoomPreviewModelCopyWith(ChatRoomPreviewModel value, $Res Function(ChatRoomPreviewModel) then) = + factory $ChatRoomPreviewModelCopyWith(ChatRoomPreviewModel value, + $Res Function(ChatRoomPreviewModel) then) = _$ChatRoomPreviewModelCopyWithImpl<$Res, ChatRoomPreviewModel>; - @useResult $Res call({@JsonKey(name: "chatRooms") List chatRooms}); } /// @nodoc -class _$ChatRoomPreviewModelCopyWithImpl<$Res, $Val extends ChatRoomPreviewModel> implements $ChatRoomPreviewModelCopyWith<$Res> { +class _$ChatRoomPreviewModelCopyWithImpl<$Res, + $Val extends ChatRoomPreviewModel> + implements $ChatRoomPreviewModelCopyWith<$Res> { _$ChatRoomPreviewModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -68,19 +70,23 @@ class _$ChatRoomPreviewModelCopyWithImpl<$Res, $Val extends ChatRoomPreviewModel } /// @nodoc -abstract class _$$ChatRoomPreviewModelImplCopyWith<$Res> implements $ChatRoomPreviewModelCopyWith<$Res> { - factory _$$ChatRoomPreviewModelImplCopyWith(_$ChatRoomPreviewModelImpl value, $Res Function(_$ChatRoomPreviewModelImpl) then) = +abstract class _$$ChatRoomPreviewModelImplCopyWith<$Res> + implements $ChatRoomPreviewModelCopyWith<$Res> { + factory _$$ChatRoomPreviewModelImplCopyWith(_$ChatRoomPreviewModelImpl value, + $Res Function(_$ChatRoomPreviewModelImpl) then) = __$$ChatRoomPreviewModelImplCopyWithImpl<$Res>; - @override @useResult $Res call({@JsonKey(name: "chatRooms") List chatRooms}); } /// @nodoc -class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> extends _$ChatRoomPreviewModelCopyWithImpl<$Res, _$ChatRoomPreviewModelImpl> +class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> + extends _$ChatRoomPreviewModelCopyWithImpl<$Res, _$ChatRoomPreviewModelImpl> implements _$$ChatRoomPreviewModelImplCopyWith<$Res> { - __$$ChatRoomPreviewModelImplCopyWithImpl(_$ChatRoomPreviewModelImpl _value, $Res Function(_$ChatRoomPreviewModelImpl) _then) : super(_value, _then); + __$$ChatRoomPreviewModelImplCopyWithImpl(_$ChatRoomPreviewModelImpl _value, + $Res Function(_$ChatRoomPreviewModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @@ -101,12 +107,14 @@ class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> extends _$ChatRoomPreviewMo /// @nodoc @JsonSerializable() class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { - const _$ChatRoomPreviewModelImpl({@JsonKey(name: "chatRooms") required final List chatRooms}) : _chatRooms = chatRooms; + const _$ChatRoomPreviewModelImpl( + {@JsonKey(name: "chatRooms") required final List chatRooms}) + : _chatRooms = chatRooms; - factory _$ChatRoomPreviewModelImpl.fromJson(Map json) => _$$ChatRoomPreviewModelImplFromJson(json); + factory _$ChatRoomPreviewModelImpl.fromJson(Map json) => + _$$ChatRoomPreviewModelImplFromJson(json); final List _chatRooms; - @override @JsonKey(name: "chatRooms") List get chatRooms { @@ -123,20 +131,26 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatRoomPreviewModelImpl && const DeepCollectionEquality().equals(other._chatRooms, _chatRooms)); + (other.runtimeType == runtimeType && + other is _$ChatRoomPreviewModelImpl && + const DeepCollectionEquality() + .equals(other._chatRooms, _chatRooms)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => - __$$ChatRoomPreviewModelImplCopyWithImpl<_$ChatRoomPreviewModelImpl>(this, _$identity); + _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> + get copyWith => + __$$ChatRoomPreviewModelImplCopyWithImpl<_$ChatRoomPreviewModelImpl>( + this, _$identity); @override Map toJson() { @@ -147,9 +161,12 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { } abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel { - const factory _ChatRoomPreviewModel({@JsonKey(name: "chatRooms") required final List chatRooms}) = _$ChatRoomPreviewModelImpl; + const factory _ChatRoomPreviewModel( + {@JsonKey(name: "chatRooms") + required final List chatRooms}) = _$ChatRoomPreviewModelImpl; - factory _ChatRoomPreviewModel.fromJson(Map json) = _$ChatRoomPreviewModelImpl.fromJson; + factory _ChatRoomPreviewModel.fromJson(Map json) = + _$ChatRoomPreviewModelImpl.fromJson; @override @JsonKey(name: "chatRooms") @@ -159,7 +176,8 @@ abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> + get copyWith => throw _privateConstructorUsedError; } ChatRoom _$ChatRoomFromJson(Map json) { @@ -170,13 +188,10 @@ ChatRoom _$ChatRoomFromJson(Map json) { mixin _$ChatRoom { @JsonKey(name: "id") String get id => throw _privateConstructorUsedError; - @JsonKey(name: "room_name") String get roomName => throw _privateConstructorUsedError; - @JsonKey(name: "last_message") dynamic get lastMessage => throw _privateConstructorUsedError; - @JsonKey(name: "users") Users get users => throw _privateConstructorUsedError; @@ -186,13 +201,14 @@ mixin _$ChatRoom { /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomCopyWith<$Res> { - factory $ChatRoomCopyWith(ChatRoom value, $Res Function(ChatRoom) then) = _$ChatRoomCopyWithImpl<$Res, ChatRoom>; - + factory $ChatRoomCopyWith(ChatRoom value, $Res Function(ChatRoom) then) = + _$ChatRoomCopyWithImpl<$Res, ChatRoom>; @useResult $Res call( {@JsonKey(name: "id") String id, @@ -204,12 +220,12 @@ abstract class $ChatRoomCopyWith<$Res> { } /// @nodoc -class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> implements $ChatRoomCopyWith<$Res> { +class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> + implements $ChatRoomCopyWith<$Res> { _$ChatRoomCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -255,9 +271,11 @@ class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> implements $ChatRoomCo } /// @nodoc -abstract class _$$ChatRoomImplCopyWith<$Res> implements $ChatRoomCopyWith<$Res> { - factory _$$ChatRoomImplCopyWith(_$ChatRoomImpl value, $Res Function(_$ChatRoomImpl) then) = __$$ChatRoomImplCopyWithImpl<$Res>; - +abstract class _$$ChatRoomImplCopyWith<$Res> + implements $ChatRoomCopyWith<$Res> { + factory _$$ChatRoomImplCopyWith( + _$ChatRoomImpl value, $Res Function(_$ChatRoomImpl) then) = + __$$ChatRoomImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -271,8 +289,12 @@ abstract class _$$ChatRoomImplCopyWith<$Res> implements $ChatRoomCopyWith<$Res> } /// @nodoc -class __$$ChatRoomImplCopyWithImpl<$Res> extends _$ChatRoomCopyWithImpl<$Res, _$ChatRoomImpl> implements _$$ChatRoomImplCopyWith<$Res> { - __$$ChatRoomImplCopyWithImpl(_$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then) : super(_value, _then); +class __$$ChatRoomImplCopyWithImpl<$Res> + extends _$ChatRoomCopyWithImpl<$Res, _$ChatRoomImpl> + implements _$$ChatRoomImplCopyWith<$Res> { + __$$ChatRoomImplCopyWithImpl( + _$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @@ -314,7 +336,8 @@ class _$ChatRoomImpl implements _ChatRoom { @JsonKey(name: "last_message") required this.lastMessage, @JsonKey(name: "users") required this.users}); - factory _$ChatRoomImpl.fromJson(Map json) => _$$ChatRoomImplFromJson(json); + factory _$ChatRoomImpl.fromJson(Map json) => + _$$ChatRoomImplFromJson(json); @override @JsonKey(name: "id") @@ -340,21 +363,25 @@ class _$ChatRoomImpl implements _ChatRoom { (other.runtimeType == runtimeType && other is _$ChatRoomImpl && (identical(other.id, id) || other.id == id) && - (identical(other.roomName, roomName) || other.roomName == roomName) && - const DeepCollectionEquality().equals(other.lastMessage, lastMessage) && + (identical(other.roomName, roomName) || + other.roomName == roomName) && + const DeepCollectionEquality() + .equals(other.lastMessage, lastMessage) && (identical(other.users, users) || other.users == users)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, roomName, const DeepCollectionEquality().hash(lastMessage), users); + int get hashCode => Object.hash(runtimeType, id, roomName, + const DeepCollectionEquality().hash(lastMessage), users); /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => __$$ChatRoomImplCopyWithImpl<_$ChatRoomImpl>(this, _$identity); + _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => + __$$ChatRoomImplCopyWithImpl<_$ChatRoomImpl>(this, _$identity); @override Map toJson() { @@ -371,20 +398,18 @@ abstract class _ChatRoom implements ChatRoom { @JsonKey(name: "last_message") required final dynamic lastMessage, @JsonKey(name: "users") required final Users users}) = _$ChatRoomImpl; - factory _ChatRoom.fromJson(Map json) = _$ChatRoomImpl.fromJson; + factory _ChatRoom.fromJson(Map json) = + _$ChatRoomImpl.fromJson; @override @JsonKey(name: "id") String get id; - @override @JsonKey(name: "room_name") String get roomName; - @override @JsonKey(name: "last_message") dynamic get lastMessage; - @override @JsonKey(name: "users") Users get users; @@ -393,7 +418,8 @@ abstract class _ChatRoom implements ChatRoom { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => + throw _privateConstructorUsedError; } LastMessageClass _$LastMessageClassFromJson(Map json) { @@ -404,22 +430,16 @@ LastMessageClass _$LastMessageClassFromJson(Map json) { mixin _$LastMessageClass { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "data") String get data => throw _privateConstructorUsedError; - @JsonKey(name: "media_data") List get mediaData => throw _privateConstructorUsedError; - @JsonKey(name: "author_id") int get authorId => throw _privateConstructorUsedError; - @JsonKey(name: "is_author_message_auth_user") bool get isAuthorMessageAuthUser => throw _privateConstructorUsedError; - @JsonKey(name: "read_by_to_user") bool get readByToUser => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; @@ -429,31 +449,34 @@ mixin _$LastMessageClass { /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $LastMessageClassCopyWith get copyWith => throw _privateConstructorUsedError; + $LastMessageClassCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $LastMessageClassCopyWith<$Res> { - factory $LastMessageClassCopyWith(LastMessageClass value, $Res Function(LastMessageClass) then) = _$LastMessageClassCopyWithImpl<$Res, LastMessageClass>; - + factory $LastMessageClassCopyWith( + LastMessageClass value, $Res Function(LastMessageClass) then) = + _$LastMessageClassCopyWithImpl<$Res, LastMessageClass>; @useResult $Res call( {@JsonKey(name: "id") int id, @JsonKey(name: "data") String data, @JsonKey(name: "media_data") List mediaData, @JsonKey(name: "author_id") int authorId, - @JsonKey(name: "is_author_message_auth_user") bool isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") + bool isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") bool readByToUser, @JsonKey(name: "updated_at") DateTime updatedAt}); } /// @nodoc -class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> implements $LastMessageClassCopyWith<$Res> { +class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> + implements $LastMessageClassCopyWith<$Res> { _$LastMessageClassCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -504,10 +527,11 @@ class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> implem } /// @nodoc -abstract class _$$LastMessageClassImplCopyWith<$Res> implements $LastMessageClassCopyWith<$Res> { - factory _$$LastMessageClassImplCopyWith(_$LastMessageClassImpl value, $Res Function(_$LastMessageClassImpl) then) = +abstract class _$$LastMessageClassImplCopyWith<$Res> + implements $LastMessageClassCopyWith<$Res> { + factory _$$LastMessageClassImplCopyWith(_$LastMessageClassImpl value, + $Res Function(_$LastMessageClassImpl) then) = __$$LastMessageClassImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -515,15 +539,19 @@ abstract class _$$LastMessageClassImplCopyWith<$Res> implements $LastMessageClas @JsonKey(name: "data") String data, @JsonKey(name: "media_data") List mediaData, @JsonKey(name: "author_id") int authorId, - @JsonKey(name: "is_author_message_auth_user") bool isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") + bool isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") bool readByToUser, @JsonKey(name: "updated_at") DateTime updatedAt}); } /// @nodoc -class __$$LastMessageClassImplCopyWithImpl<$Res> extends _$LastMessageClassCopyWithImpl<$Res, _$LastMessageClassImpl> +class __$$LastMessageClassImplCopyWithImpl<$Res> + extends _$LastMessageClassCopyWithImpl<$Res, _$LastMessageClassImpl> implements _$$LastMessageClassImplCopyWith<$Res> { - __$$LastMessageClassImplCopyWithImpl(_$LastMessageClassImpl _value, $Res Function(_$LastMessageClassImpl) _then) : super(_value, _then); + __$$LastMessageClassImplCopyWithImpl(_$LastMessageClassImpl _value, + $Res Function(_$LastMessageClassImpl) _then) + : super(_value, _then); /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @@ -579,12 +607,14 @@ class _$LastMessageClassImpl implements _LastMessageClass { @JsonKey(name: "data") required this.data, @JsonKey(name: "media_data") required final List mediaData, @JsonKey(name: "author_id") required this.authorId, - @JsonKey(name: "is_author_message_auth_user") required this.isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") + required this.isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") required this.readByToUser, @JsonKey(name: "updated_at") required this.updatedAt}) : _mediaData = mediaData; - factory _$LastMessageClassImpl.fromJson(Map json) => _$$LastMessageClassImplFromJson(json); + factory _$LastMessageClassImpl.fromJson(Map json) => + _$$LastMessageClassImplFromJson(json); @override @JsonKey(name: "id") @@ -593,7 +623,6 @@ class _$LastMessageClassImpl implements _LastMessageClass { @JsonKey(name: "data") final String data; final List _mediaData; - @override @JsonKey(name: "media_data") List get mediaData { @@ -627,24 +656,39 @@ class _$LastMessageClassImpl implements _LastMessageClass { other is _$LastMessageClassImpl && (identical(other.id, id) || other.id == id) && (identical(other.data, data) || other.data == data) && - const DeepCollectionEquality().equals(other._mediaData, _mediaData) && - (identical(other.authorId, authorId) || other.authorId == authorId) && - (identical(other.isAuthorMessageAuthUser, isAuthorMessageAuthUser) || other.isAuthorMessageAuthUser == isAuthorMessageAuthUser) && - (identical(other.readByToUser, readByToUser) || other.readByToUser == readByToUser) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + const DeepCollectionEquality() + .equals(other._mediaData, _mediaData) && + (identical(other.authorId, authorId) || + other.authorId == authorId) && + (identical( + other.isAuthorMessageAuthUser, isAuthorMessageAuthUser) || + other.isAuthorMessageAuthUser == isAuthorMessageAuthUser) && + (identical(other.readByToUser, readByToUser) || + other.readByToUser == readByToUser) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, isAuthorMessageAuthUser, readByToUser, updatedAt); + int get hashCode => Object.hash( + runtimeType, + id, + data, + const DeepCollectionEquality().hash(_mediaData), + authorId, + isAuthorMessageAuthUser, + readByToUser, + updatedAt); /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => __$$LastMessageClassImplCopyWithImpl<_$LastMessageClassImpl>(this, _$identity); + _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => + __$$LastMessageClassImplCopyWithImpl<_$LastMessageClassImpl>( + this, _$identity); @override Map toJson() { @@ -656,40 +700,37 @@ class _$LastMessageClassImpl implements _LastMessageClass { abstract class _LastMessageClass implements LastMessageClass { const factory _LastMessageClass( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "data") required final String data, - @JsonKey(name: "media_data") required final List mediaData, - @JsonKey(name: "author_id") required final int authorId, - @JsonKey(name: "is_author_message_auth_user") required final bool isAuthorMessageAuthUser, - @JsonKey(name: "read_by_to_user") required final bool readByToUser, - @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$LastMessageClassImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "data") required final String data, + @JsonKey(name: "media_data") required final List mediaData, + @JsonKey(name: "author_id") required final int authorId, + @JsonKey(name: "is_author_message_auth_user") + required final bool isAuthorMessageAuthUser, + @JsonKey(name: "read_by_to_user") required final bool readByToUser, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = + _$LastMessageClassImpl; - factory _LastMessageClass.fromJson(Map json) = _$LastMessageClassImpl.fromJson; + factory _LastMessageClass.fromJson(Map json) = + _$LastMessageClassImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "data") String get data; - @override @JsonKey(name: "media_data") List get mediaData; - @override @JsonKey(name: "author_id") int get authorId; - @override @JsonKey(name: "is_author_message_auth_user") bool get isAuthorMessageAuthUser; - @override @JsonKey(name: "read_by_to_user") bool get readByToUser; - @override @JsonKey(name: "updated_at") DateTime get updatedAt; @@ -698,7 +739,8 @@ abstract class _LastMessageClass implements LastMessageClass { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => throw _privateConstructorUsedError; + _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => + throw _privateConstructorUsedError; } Users _$UsersFromJson(Map json) { @@ -709,7 +751,6 @@ Users _$UsersFromJson(Map json) { mixin _$Users { @JsonKey(name: "from_chat_user") ChatUser get fromChatUser => throw _privateConstructorUsedError; - @JsonKey(name: "to_chat_user") ChatUser get toChatUser => throw _privateConstructorUsedError; @@ -724,23 +765,24 @@ mixin _$Users { /// @nodoc abstract class $UsersCopyWith<$Res> { - factory $UsersCopyWith(Users value, $Res Function(Users) then) = _$UsersCopyWithImpl<$Res, Users>; - + factory $UsersCopyWith(Users value, $Res Function(Users) then) = + _$UsersCopyWithImpl<$Res, Users>; @useResult - $Res call({@JsonKey(name: "from_chat_user") ChatUser fromChatUser, @JsonKey(name: "to_chat_user") ChatUser toChatUser}); + $Res call( + {@JsonKey(name: "from_chat_user") ChatUser fromChatUser, + @JsonKey(name: "to_chat_user") ChatUser toChatUser}); $ChatUserCopyWith<$Res> get fromChatUser; - $ChatUserCopyWith<$Res> get toChatUser; } /// @nodoc -class _$UsersCopyWithImpl<$Res, $Val extends Users> implements $UsersCopyWith<$Res> { +class _$UsersCopyWithImpl<$Res, $Val extends Users> + implements $UsersCopyWith<$Res> { _$UsersCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -787,22 +829,28 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users> implements $UsersCopyWith<$R /// @nodoc abstract class _$$UsersImplCopyWith<$Res> implements $UsersCopyWith<$Res> { - factory _$$UsersImplCopyWith(_$UsersImpl value, $Res Function(_$UsersImpl) then) = __$$UsersImplCopyWithImpl<$Res>; - + factory _$$UsersImplCopyWith( + _$UsersImpl value, $Res Function(_$UsersImpl) then) = + __$$UsersImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "from_chat_user") ChatUser fromChatUser, @JsonKey(name: "to_chat_user") ChatUser toChatUser}); + $Res call( + {@JsonKey(name: "from_chat_user") ChatUser fromChatUser, + @JsonKey(name: "to_chat_user") ChatUser toChatUser}); @override $ChatUserCopyWith<$Res> get fromChatUser; - @override $ChatUserCopyWith<$Res> get toChatUser; } /// @nodoc -class __$$UsersImplCopyWithImpl<$Res> extends _$UsersCopyWithImpl<$Res, _$UsersImpl> implements _$$UsersImplCopyWith<$Res> { - __$$UsersImplCopyWithImpl(_$UsersImpl _value, $Res Function(_$UsersImpl) _then) : super(_value, _then); +class __$$UsersImplCopyWithImpl<$Res> + extends _$UsersCopyWithImpl<$Res, _$UsersImpl> + implements _$$UsersImplCopyWith<$Res> { + __$$UsersImplCopyWithImpl( + _$UsersImpl _value, $Res Function(_$UsersImpl) _then) + : super(_value, _then); /// Create a copy of Users /// with the given fields replaced by the non-null parameter values. @@ -828,9 +876,12 @@ class __$$UsersImplCopyWithImpl<$Res> extends _$UsersCopyWithImpl<$Res, _$UsersI /// @nodoc @JsonSerializable() class _$UsersImpl implements _Users { - const _$UsersImpl({@JsonKey(name: "from_chat_user") required this.fromChatUser, @JsonKey(name: "to_chat_user") required this.toChatUser}); + const _$UsersImpl( + {@JsonKey(name: "from_chat_user") required this.fromChatUser, + @JsonKey(name: "to_chat_user") required this.toChatUser}); - factory _$UsersImpl.fromJson(Map json) => _$$UsersImplFromJson(json); + factory _$UsersImpl.fromJson(Map json) => + _$$UsersImplFromJson(json); @override @JsonKey(name: "from_chat_user") @@ -849,8 +900,10 @@ class _$UsersImpl implements _Users { return identical(this, other) || (other.runtimeType == runtimeType && other is _$UsersImpl && - (identical(other.fromChatUser, fromChatUser) || other.fromChatUser == fromChatUser) && - (identical(other.toChatUser, toChatUser) || other.toChatUser == toChatUser)); + (identical(other.fromChatUser, fromChatUser) || + other.fromChatUser == fromChatUser) && + (identical(other.toChatUser, toChatUser) || + other.toChatUser == toChatUser)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -862,7 +915,8 @@ class _$UsersImpl implements _Users { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UsersImplCopyWith<_$UsersImpl> get copyWith => __$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity); + _$$UsersImplCopyWith<_$UsersImpl> get copyWith => + __$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity); @override Map toJson() { @@ -874,14 +928,15 @@ class _$UsersImpl implements _Users { abstract class _Users implements Users { const factory _Users( - {@JsonKey(name: "from_chat_user") required final ChatUser fromChatUser, @JsonKey(name: "to_chat_user") required final ChatUser toChatUser}) = _$UsersImpl; + {@JsonKey(name: "from_chat_user") required final ChatUser fromChatUser, + @JsonKey(name: "to_chat_user") + required final ChatUser toChatUser}) = _$UsersImpl; factory _Users.fromJson(Map json) = _$UsersImpl.fromJson; @override @JsonKey(name: "from_chat_user") ChatUser get fromChatUser; - @override @JsonKey(name: "to_chat_user") ChatUser get toChatUser; @@ -890,7 +945,8 @@ abstract class _Users implements Users { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$UsersImplCopyWith<_$UsersImpl> get copyWith => throw _privateConstructorUsedError; + _$$UsersImplCopyWith<_$UsersImpl> get copyWith => + throw _privateConstructorUsedError; } ChatUser _$ChatUserFromJson(Map json) { @@ -901,13 +957,10 @@ ChatUser _$ChatUserFromJson(Map json) { mixin _$ChatUser { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "profile_photo_path") String? get profilePhotoPath => throw _privateConstructorUsedError; - @JsonKey(name: "profile_photo_url") String get profilePhotoUrl => throw _privateConstructorUsedError; @@ -917,13 +970,14 @@ mixin _$ChatUser { /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatUserCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatUserCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatUserCopyWith<$Res> { - factory $ChatUserCopyWith(ChatUser value, $Res Function(ChatUser) then) = _$ChatUserCopyWithImpl<$Res, ChatUser>; - + factory $ChatUserCopyWith(ChatUser value, $Res Function(ChatUser) then) = + _$ChatUserCopyWithImpl<$Res, ChatUser>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -933,12 +987,12 @@ abstract class $ChatUserCopyWith<$Res> { } /// @nodoc -class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> implements $ChatUserCopyWith<$Res> { +class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> + implements $ChatUserCopyWith<$Res> { _$ChatUserCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -974,9 +1028,11 @@ class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> implements $ChatUserCo } /// @nodoc -abstract class _$$ChatUserImplCopyWith<$Res> implements $ChatUserCopyWith<$Res> { - factory _$$ChatUserImplCopyWith(_$ChatUserImpl value, $Res Function(_$ChatUserImpl) then) = __$$ChatUserImplCopyWithImpl<$Res>; - +abstract class _$$ChatUserImplCopyWith<$Res> + implements $ChatUserCopyWith<$Res> { + factory _$$ChatUserImplCopyWith( + _$ChatUserImpl value, $Res Function(_$ChatUserImpl) then) = + __$$ChatUserImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -987,8 +1043,12 @@ abstract class _$$ChatUserImplCopyWith<$Res> implements $ChatUserCopyWith<$Res> } /// @nodoc -class __$$ChatUserImplCopyWithImpl<$Res> extends _$ChatUserCopyWithImpl<$Res, _$ChatUserImpl> implements _$$ChatUserImplCopyWith<$Res> { - __$$ChatUserImplCopyWithImpl(_$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then) : super(_value, _then); +class __$$ChatUserImplCopyWithImpl<$Res> + extends _$ChatUserCopyWithImpl<$Res, _$ChatUserImpl> + implements _$$ChatUserImplCopyWith<$Res> { + __$$ChatUserImplCopyWithImpl( + _$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then) + : super(_value, _then); /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @@ -1030,7 +1090,8 @@ class _$ChatUserImpl implements _ChatUser { @JsonKey(name: "profile_photo_path") required this.profilePhotoPath, @JsonKey(name: "profile_photo_url") required this.profilePhotoUrl}); - factory _$ChatUserImpl.fromJson(Map json) => _$$ChatUserImplFromJson(json); + factory _$ChatUserImpl.fromJson(Map json) => + _$$ChatUserImplFromJson(json); @override @JsonKey(name: "id") @@ -1057,20 +1118,24 @@ class _$ChatUserImpl implements _ChatUser { other is _$ChatUserImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.profilePhotoPath, profilePhotoPath) || other.profilePhotoPath == profilePhotoPath) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoPath, profilePhotoPath) || + other.profilePhotoPath == profilePhotoPath) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || + other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); + int get hashCode => + Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => __$$ChatUserImplCopyWithImpl<_$ChatUserImpl>(this, _$identity); + _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => + __$$ChatUserImplCopyWithImpl<_$ChatUserImpl>(this, _$identity); @override Map toJson() { @@ -1084,23 +1149,23 @@ abstract class _ChatUser implements ChatUser { const factory _ChatUser( {@JsonKey(name: "id") required final int id, @JsonKey(name: "name") required final String name, - @JsonKey(name: "profile_photo_path") required final String? profilePhotoPath, - @JsonKey(name: "profile_photo_url") required final String profilePhotoUrl}) = _$ChatUserImpl; + @JsonKey(name: "profile_photo_path") + required final String? profilePhotoPath, + @JsonKey(name: "profile_photo_url") + required final String profilePhotoUrl}) = _$ChatUserImpl; - factory _ChatUser.fromJson(Map json) = _$ChatUserImpl.fromJson; + factory _ChatUser.fromJson(Map json) = + _$ChatUserImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "profile_photo_path") String? get profilePhotoPath; - @override @JsonKey(name: "profile_photo_url") String get profilePhotoUrl; @@ -1109,5 +1174,6 @@ abstract class _ChatUser implements ChatUser { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_preview_model.g.dart b/lib/features/chat/models/chat_room_preview_model.g.dart index ef589a94..5ae3f709 100644 --- a/lib/features/chat/models/chat_room_preview_model.g.dart +++ b/lib/features/chat/models/chat_room_preview_model.g.dart @@ -6,29 +6,39 @@ part of 'chat_room_preview_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson(Map json) => _$ChatRoomPreviewModelImpl( - chatRooms: (json['chatRooms'] as List).map((e) => ChatRoom.fromJson(e as Map)).toList(), +_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson( + Map json) => + _$ChatRoomPreviewModelImpl( + chatRooms: (json['chatRooms'] as List) + .map((e) => ChatRoom.fromJson(e as Map)) + .toList(), ); -Map _$$ChatRoomPreviewModelImplToJson(_$ChatRoomPreviewModelImpl instance) => { +Map _$$ChatRoomPreviewModelImplToJson( + _$ChatRoomPreviewModelImpl instance) => + { 'chatRooms': instance.chatRooms, }; -_$ChatRoomImpl _$$ChatRoomImplFromJson(Map json) => _$ChatRoomImpl( +_$ChatRoomImpl _$$ChatRoomImplFromJson(Map json) => + _$ChatRoomImpl( id: json['id'] as String, roomName: json['room_name'] as String, lastMessage: json['last_message'], users: Users.fromJson(json['users'] as Map), ); -Map _$$ChatRoomImplToJson(_$ChatRoomImpl instance) => { +Map _$$ChatRoomImplToJson(_$ChatRoomImpl instance) => + { 'id': instance.id, 'room_name': instance.roomName, 'last_message': instance.lastMessage, 'users': instance.users, }; -_$LastMessageClassImpl _$$LastMessageClassImplFromJson(Map json) => _$LastMessageClassImpl( +_$LastMessageClassImpl _$$LastMessageClassImplFromJson( + Map json) => + _$LastMessageClassImpl( id: (json['id'] as num).toInt(), data: json['data'] as String, mediaData: json['media_data'] as List, @@ -38,7 +48,9 @@ _$LastMessageClassImpl _$$LastMessageClassImplFromJson(Map json updatedAt: DateTime.parse(json['updated_at'] as String), ); -Map _$$LastMessageClassImplToJson(_$LastMessageClassImpl instance) => { +Map _$$LastMessageClassImplToJson( + _$LastMessageClassImpl instance) => + { 'id': instance.id, 'data': instance.data, 'media_data': instance.mediaData, @@ -49,23 +61,28 @@ Map _$$LastMessageClassImplToJson(_$LastMessageClassImpl instan }; _$UsersImpl _$$UsersImplFromJson(Map json) => _$UsersImpl( - fromChatUser: ChatUser.fromJson(json['from_chat_user'] as Map), - toChatUser: ChatUser.fromJson(json['to_chat_user'] as Map), + fromChatUser: + ChatUser.fromJson(json['from_chat_user'] as Map), + toChatUser: + ChatUser.fromJson(json['to_chat_user'] as Map), ); -Map _$$UsersImplToJson(_$UsersImpl instance) => { +Map _$$UsersImplToJson(_$UsersImpl instance) => + { 'from_chat_user': instance.fromChatUser, 'to_chat_user': instance.toChatUser, }; -_$ChatUserImpl _$$ChatUserImplFromJson(Map json) => _$ChatUserImpl( +_$ChatUserImpl _$$ChatUserImplFromJson(Map json) => + _$ChatUserImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, profilePhotoPath: json['profile_photo_path'] as String?, profilePhotoUrl: json['profile_photo_url'] as String, ); -Map _$$ChatUserImplToJson(_$ChatUserImpl instance) => { +Map _$$ChatUserImplToJson(_$ChatUserImpl instance) => + { 'id': instance.id, 'name': instance.name, 'profile_photo_path': instance.profilePhotoPath, diff --git a/lib/features/chat/models/chat_room_settings_model.freezed.dart b/lib/features/chat/models/chat_room_settings_model.freezed.dart index 76419b76..9d12eefa 100644 --- a/lib/features/chat/models/chat_room_settings_model.freezed.dart +++ b/lib/features/chat/models/chat_room_settings_model.freezed.dart @@ -14,22 +14,19 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson(Map json) { +ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson( + Map json) { return _ChatRoomSettingsModel.fromJson(json); } /// @nodoc mixin _$ChatRoomSettingsModel { int get id => throw _privateConstructorUsedError; - @JsonKey(name: 'room_name') String get roomName => throw _privateConstructorUsedError; - String get state => throw _privateConstructorUsedError; - @JsonKey(name: 'access_level') String get accessLevel => throw _privateConstructorUsedError; - @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; @@ -39,14 +36,15 @@ mixin _$ChatRoomSettingsModel { /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomSettingsModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomSettingsModelCopyWith<$Res> { - factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value, $Res Function(ChatRoomSettingsModel) then) = + factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value, + $Res Function(ChatRoomSettingsModel) then) = _$ChatRoomSettingsModelCopyWithImpl<$Res, ChatRoomSettingsModel>; - @useResult $Res call( {int id, @@ -57,12 +55,13 @@ abstract class $ChatRoomSettingsModelCopyWith<$Res> { } /// @nodoc -class _$ChatRoomSettingsModelCopyWithImpl<$Res, $Val extends ChatRoomSettingsModel> implements $ChatRoomSettingsModelCopyWith<$Res> { +class _$ChatRoomSettingsModelCopyWithImpl<$Res, + $Val extends ChatRoomSettingsModel> + implements $ChatRoomSettingsModelCopyWith<$Res> { _$ChatRoomSettingsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -103,10 +102,12 @@ class _$ChatRoomSettingsModelCopyWithImpl<$Res, $Val extends ChatRoomSettingsMod } /// @nodoc -abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> implements $ChatRoomSettingsModelCopyWith<$Res> { - factory _$$ChatRoomSettingsModelImplCopyWith(_$ChatRoomSettingsModelImpl value, $Res Function(_$ChatRoomSettingsModelImpl) then) = +abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> + implements $ChatRoomSettingsModelCopyWith<$Res> { + factory _$$ChatRoomSettingsModelImplCopyWith( + _$ChatRoomSettingsModelImpl value, + $Res Function(_$ChatRoomSettingsModelImpl) then) = __$$ChatRoomSettingsModelImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -118,9 +119,13 @@ abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> implements $ChatRoomSe } /// @nodoc -class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res> extends _$ChatRoomSettingsModelCopyWithImpl<$Res, _$ChatRoomSettingsModelImpl> +class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res> + extends _$ChatRoomSettingsModelCopyWithImpl<$Res, + _$ChatRoomSettingsModelImpl> implements _$$ChatRoomSettingsModelImplCopyWith<$Res> { - __$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value, $Res Function(_$ChatRoomSettingsModelImpl) _then) : super(_value, _then); + __$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value, + $Res Function(_$ChatRoomSettingsModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @@ -168,7 +173,8 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { @JsonKey(name: 'access_level') required this.accessLevel, @JsonKey(name: 'updated_at') required this.updatedAt}); - factory _$ChatRoomSettingsModelImpl.fromJson(Map json) => _$$ChatRoomSettingsModelImplFromJson(json); + factory _$ChatRoomSettingsModelImpl.fromJson(Map json) => + _$$ChatRoomSettingsModelImplFromJson(json); @override final int id; @@ -195,23 +201,28 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { (other.runtimeType == runtimeType && other is _$ChatRoomSettingsModelImpl && (identical(other.id, id) || other.id == id) && - (identical(other.roomName, roomName) || other.roomName == roomName) && + (identical(other.roomName, roomName) || + other.roomName == roomName) && (identical(other.state, state) || other.state == state) && - (identical(other.accessLevel, accessLevel) || other.accessLevel == accessLevel) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + (identical(other.accessLevel, accessLevel) || + other.accessLevel == accessLevel) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); + int get hashCode => + Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => - __$$ChatRoomSettingsModelImplCopyWithImpl<_$ChatRoomSettingsModelImpl>(this, _$identity); + _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> + get copyWith => __$$ChatRoomSettingsModelImplCopyWithImpl< + _$ChatRoomSettingsModelImpl>(this, _$identity); @override Map toJson() { @@ -223,28 +234,26 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel { const factory _ChatRoomSettingsModel( - {required final int id, - @JsonKey(name: 'room_name') required final String roomName, - required final String state, - @JsonKey(name: 'access_level') required final String accessLevel, - @JsonKey(name: 'updated_at') required final String updatedAt}) = _$ChatRoomSettingsModelImpl; + {required final int id, + @JsonKey(name: 'room_name') required final String roomName, + required final String state, + @JsonKey(name: 'access_level') required final String accessLevel, + @JsonKey(name: 'updated_at') required final String updatedAt}) = + _$ChatRoomSettingsModelImpl; - factory _ChatRoomSettingsModel.fromJson(Map json) = _$ChatRoomSettingsModelImpl.fromJson; + factory _ChatRoomSettingsModel.fromJson(Map json) = + _$ChatRoomSettingsModelImpl.fromJson; @override int get id; - @override @JsonKey(name: 'room_name') String get roomName; - @override String get state; - @override @JsonKey(name: 'access_level') String get accessLevel; - @override @JsonKey(name: 'updated_at') String get updatedAt; @@ -253,5 +262,6 @@ abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_settings_model.g.dart b/lib/features/chat/models/chat_room_settings_model.g.dart index 1a2ef327..7b824334 100644 --- a/lib/features/chat/models/chat_room_settings_model.g.dart +++ b/lib/features/chat/models/chat_room_settings_model.g.dart @@ -6,7 +6,9 @@ part of 'chat_room_settings_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson(Map json) => _$ChatRoomSettingsModelImpl( +_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson( + Map json) => + _$ChatRoomSettingsModelImpl( id: (json['id'] as num).toInt(), roomName: json['room_name'] as String, state: json['state'] as String, @@ -14,7 +16,9 @@ _$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson(Map _$$ChatRoomSettingsModelImplToJson(_$ChatRoomSettingsModelImpl instance) => { +Map _$$ChatRoomSettingsModelImplToJson( + _$ChatRoomSettingsModelImpl instance) => + { 'id': instance.id, 'room_name': instance.roomName, 'state': instance.state, diff --git a/lib/features/chat/models/chat_user_model.freezed.dart b/lib/features/chat/models/chat_user_model.freezed.dart index 166e3870..94718168 100644 --- a/lib/features/chat/models/chat_user_model.freezed.dart +++ b/lib/features/chat/models/chat_user_model.freezed.dart @@ -21,12 +21,9 @@ ChatUserModel _$ChatUserModelFromJson(Map json) { /// @nodoc mixin _$ChatUserModel { int get id => throw _privateConstructorUsedError; - String get name => throw _privateConstructorUsedError; - @JsonKey(name: 'profile_photo_path') String? get profilePhotoPath => throw _privateConstructorUsedError; - @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl => throw _privateConstructorUsedError; @@ -36,24 +33,30 @@ mixin _$ChatUserModel { /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatUserModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatUserModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatUserModelCopyWith<$Res> { - factory $ChatUserModelCopyWith(ChatUserModel value, $Res Function(ChatUserModel) then) = _$ChatUserModelCopyWithImpl<$Res, ChatUserModel>; - + factory $ChatUserModelCopyWith( + ChatUserModel value, $Res Function(ChatUserModel) then) = + _$ChatUserModelCopyWithImpl<$Res, ChatUserModel>; @useResult - $Res call({int id, String name, @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); + $Res call( + {int id, + String name, + @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, + @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); } /// @nodoc -class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> implements $ChatUserModelCopyWith<$Res> { +class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> + implements $ChatUserModelCopyWith<$Res> { _$ChatUserModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -89,17 +92,27 @@ class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> implements $ } /// @nodoc -abstract class _$$ChatUserModelImplCopyWith<$Res> implements $ChatUserModelCopyWith<$Res> { - factory _$$ChatUserModelImplCopyWith(_$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) = __$$ChatUserModelImplCopyWithImpl<$Res>; - +abstract class _$$ChatUserModelImplCopyWith<$Res> + implements $ChatUserModelCopyWith<$Res> { + factory _$$ChatUserModelImplCopyWith( + _$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) = + __$$ChatUserModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({int id, String name, @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); + $Res call( + {int id, + String name, + @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, + @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); } /// @nodoc -class __$$ChatUserModelImplCopyWithImpl<$Res> extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl> implements _$$ChatUserModelImplCopyWith<$Res> { - __$$ChatUserModelImplCopyWithImpl(_$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then) : super(_value, _then); +class __$$ChatUserModelImplCopyWithImpl<$Res> + extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl> + implements _$$ChatUserModelImplCopyWith<$Res> { + __$$ChatUserModelImplCopyWithImpl( + _$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @@ -141,7 +154,8 @@ class _$ChatUserModelImpl implements _ChatUserModel { @JsonKey(name: 'profile_photo_path') this.profilePhotoPath, @JsonKey(name: 'profile_photo_url') this.profilePhotoUrl}); - factory _$ChatUserModelImpl.fromJson(Map json) => _$$ChatUserModelImplFromJson(json); + factory _$ChatUserModelImpl.fromJson(Map json) => + _$$ChatUserModelImplFromJson(json); @override final int id; @@ -166,20 +180,24 @@ class _$ChatUserModelImpl implements _ChatUserModel { other is _$ChatUserModelImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.profilePhotoPath, profilePhotoPath) || other.profilePhotoPath == profilePhotoPath) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoPath, profilePhotoPath) || + other.profilePhotoPath == profilePhotoPath) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || + other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); + int get hashCode => + Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); + _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => + __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); @override Map toJson() { @@ -191,23 +209,22 @@ class _$ChatUserModelImpl implements _ChatUserModel { abstract class _ChatUserModel implements ChatUserModel { const factory _ChatUserModel( - {required final int id, - required final String name, - @JsonKey(name: 'profile_photo_path') final String? profilePhotoPath, - @JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) = _$ChatUserModelImpl; + {required final int id, + required final String name, + @JsonKey(name: 'profile_photo_path') final String? profilePhotoPath, + @JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) = + _$ChatUserModelImpl; - factory _ChatUserModel.fromJson(Map json) = _$ChatUserModelImpl.fromJson; + factory _ChatUserModel.fromJson(Map json) = + _$ChatUserModelImpl.fromJson; @override int get id; - @override String get name; - @override @JsonKey(name: 'profile_photo_path') String? get profilePhotoPath; - @override @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl; @@ -216,5 +233,6 @@ abstract class _ChatUserModel implements ChatUserModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_user_model.g.dart b/lib/features/chat/models/chat_user_model.g.dart index 06fa92a0..78e0f981 100644 --- a/lib/features/chat/models/chat_user_model.g.dart +++ b/lib/features/chat/models/chat_user_model.g.dart @@ -6,14 +6,16 @@ part of 'chat_user_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatUserModelImpl _$$ChatUserModelImplFromJson(Map json) => _$ChatUserModelImpl( +_$ChatUserModelImpl _$$ChatUserModelImplFromJson(Map json) => + _$ChatUserModelImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, profilePhotoPath: json['profile_photo_path'] as String?, profilePhotoUrl: json['profile_photo_url'] as String?, ); -Map _$$ChatUserModelImplToJson(_$ChatUserModelImpl instance) => { +Map _$$ChatUserModelImplToJson(_$ChatUserModelImpl instance) => + { 'id': instance.id, 'name': instance.name, 'profile_photo_path': instance.profilePhotoPath, diff --git a/lib/features/chat/models/websocket_info_model.freezed.dart b/lib/features/chat/models/websocket_info_model.freezed.dart index dd7a6bb0..9cddabee 100644 --- a/lib/features/chat/models/websocket_info_model.freezed.dart +++ b/lib/features/chat/models/websocket_info_model.freezed.dart @@ -21,13 +21,9 @@ WebsocketInfoModel _$WebsocketInfoModelFromJson(Map json) { /// @nodoc mixin _$WebsocketInfoModel { String get key => throw _privateConstructorUsedError; - String get host => throw _privateConstructorUsedError; - String get port => throw _privateConstructorUsedError; - String get cluster => throw _privateConstructorUsedError; - @JsonKey(name: 'user_id') int get userId => throw _privateConstructorUsedError; @@ -37,25 +33,31 @@ mixin _$WebsocketInfoModel { /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $WebsocketInfoModelCopyWith get copyWith => throw _privateConstructorUsedError; + $WebsocketInfoModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $WebsocketInfoModelCopyWith<$Res> { - factory $WebsocketInfoModelCopyWith(WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) = + factory $WebsocketInfoModelCopyWith( + WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) = _$WebsocketInfoModelCopyWithImpl<$Res, WebsocketInfoModel>; - @useResult - $Res call({String key, String host, String port, String cluster, @JsonKey(name: 'user_id') int userId}); + $Res call( + {String key, + String host, + String port, + String cluster, + @JsonKey(name: 'user_id') int userId}); } /// @nodoc -class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> implements $WebsocketInfoModelCopyWith<$Res> { +class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> + implements $WebsocketInfoModelCopyWith<$Res> { _$WebsocketInfoModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -96,19 +98,28 @@ class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> im } /// @nodoc -abstract class _$$WebsocketInfoModelImplCopyWith<$Res> implements $WebsocketInfoModelCopyWith<$Res> { - factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value, $Res Function(_$WebsocketInfoModelImpl) then) = +abstract class _$$WebsocketInfoModelImplCopyWith<$Res> + implements $WebsocketInfoModelCopyWith<$Res> { + factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value, + $Res Function(_$WebsocketInfoModelImpl) then) = __$$WebsocketInfoModelImplCopyWithImpl<$Res>; - @override @useResult - $Res call({String key, String host, String port, String cluster, @JsonKey(name: 'user_id') int userId}); + $Res call( + {String key, + String host, + String port, + String cluster, + @JsonKey(name: 'user_id') int userId}); } /// @nodoc -class __$$WebsocketInfoModelImplCopyWithImpl<$Res> extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl> +class __$$WebsocketInfoModelImplCopyWithImpl<$Res> + extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl> implements _$$WebsocketInfoModelImplCopyWith<$Res> { - __$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value, $Res Function(_$WebsocketInfoModelImpl) _then) : super(_value, _then); + __$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value, + $Res Function(_$WebsocketInfoModelImpl) _then) + : super(_value, _then); /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @@ -150,9 +161,14 @@ class __$$WebsocketInfoModelImplCopyWithImpl<$Res> extends _$WebsocketInfoModelC @JsonSerializable() class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { const _$WebsocketInfoModelImpl( - {required this.key, required this.host, required this.port, required this.cluster, @JsonKey(name: 'user_id') required this.userId}); + {required this.key, + required this.host, + required this.port, + required this.cluster, + @JsonKey(name: 'user_id') required this.userId}); - factory _$WebsocketInfoModelImpl.fromJson(Map json) => _$$WebsocketInfoModelImplFromJson(json); + factory _$WebsocketInfoModelImpl.fromJson(Map json) => + _$$WebsocketInfoModelImplFromJson(json); @override final String key; @@ -185,7 +201,8 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, key, host, port, cluster, userId); + int get hashCode => + Object.hash(runtimeType, key, host, port, cluster, userId); /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @@ -193,7 +210,8 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @override @pragma('vm:prefer-inline') _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => - __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>(this, _$identity); + __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>( + this, _$identity); @override Map toJson() { @@ -205,26 +223,24 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { abstract class _WebsocketInfoModel implements WebsocketInfoModel { const factory _WebsocketInfoModel( - {required final String key, - required final String host, - required final String port, - required final String cluster, - @JsonKey(name: 'user_id') required final int userId}) = _$WebsocketInfoModelImpl; + {required final String key, + required final String host, + required final String port, + required final String cluster, + @JsonKey(name: 'user_id') required final int userId}) = + _$WebsocketInfoModelImpl; - factory _WebsocketInfoModel.fromJson(Map json) = _$WebsocketInfoModelImpl.fromJson; + factory _WebsocketInfoModel.fromJson(Map json) = + _$WebsocketInfoModelImpl.fromJson; @override String get key; - @override String get host; - @override String get port; - @override String get cluster; - @override @JsonKey(name: 'user_id') int get userId; @@ -233,5 +249,6 @@ abstract class _WebsocketInfoModel implements WebsocketInfoModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/websocket_info_model.g.dart b/lib/features/chat/models/websocket_info_model.g.dart index 91c386f8..b2bb1248 100644 --- a/lib/features/chat/models/websocket_info_model.g.dart +++ b/lib/features/chat/models/websocket_info_model.g.dart @@ -6,7 +6,9 @@ part of 'websocket_info_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson(Map json) => _$WebsocketInfoModelImpl( +_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson( + Map json) => + _$WebsocketInfoModelImpl( key: json['key'] as String, host: json['host'] as String, port: json['port'] as String, @@ -14,7 +16,9 @@ _$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson(Map userId: (json['user_id'] as num).toInt(), ); -Map _$$WebsocketInfoModelImplToJson(_$WebsocketInfoModelImpl instance) => { +Map _$$WebsocketInfoModelImplToJson( + _$WebsocketInfoModelImpl instance) => + { 'key': instance.key, 'host': instance.host, 'port': instance.port, diff --git a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart index 9a27a0ba..4695b4ad 100644 --- a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart @@ -20,16 +20,19 @@ mixin _$ChatRoomState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +40,9 @@ mixin _$ChatRoomState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,16 +76,18 @@ mixin _$ChatRoomState { /// @nodoc abstract class $ChatRoomStateCopyWith<$Res> { - factory $ChatRoomStateCopyWith(ChatRoomState value, $Res Function(ChatRoomState) then) = _$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>; + factory $ChatRoomStateCopyWith( + ChatRoomState value, $Res Function(ChatRoomState) then) = + _$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>; } /// @nodoc -class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> implements $ChatRoomStateCopyWith<$Res> { +class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> + implements $ChatRoomStateCopyWith<$Res> { _$ChatRoomStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +97,18 @@ class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> implements $ /// @nodoc abstract class _$$ChatRoomStateImplCopyWith<$Res> { - factory _$$ChatRoomStateImplCopyWith(_$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) = __$$ChatRoomStateImplCopyWithImpl<$Res>; + factory _$$ChatRoomStateImplCopyWith( + _$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) = + __$$ChatRoomStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatRoomStateImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl> implements _$$ChatRoomStateImplCopyWith<$Res> { - __$$ChatRoomStateImplCopyWithImpl(_$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then) : super(_value, _then); +class __$$ChatRoomStateImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl> + implements _$$ChatRoomStateImplCopyWith<$Res> { + __$$ChatRoomStateImplCopyWithImpl( + _$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +126,8 @@ class _$ChatRoomStateImpl implements _ChatRoomState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ChatRoomStateImpl); } @override @@ -124,7 +138,9 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -135,7 +151,9 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -146,7 +164,9 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -200,14 +220,18 @@ abstract class _ChatRoomState implements ChatRoomState { /// @nodoc abstract class _$$ChatRoomStateLoadingImplCopyWith<$Res> { - factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value, $Res Function(_$ChatRoomStateLoadingImpl) then) = + factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value, + $Res Function(_$ChatRoomStateLoadingImpl) then) = __$$ChatRoomStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl> +class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl> implements _$$ChatRoomStateLoadingImplCopyWith<$Res> { - __$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value, $Res Function(_$ChatRoomStateLoadingImpl) _then) : super(_value, _then); + __$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value, + $Res Function(_$ChatRoomStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +249,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ChatRoomStateLoadingImpl); } @override @@ -236,7 +262,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -247,7 +275,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -258,7 +288,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -312,19 +344,26 @@ abstract class ChatRoomStateLoading implements ChatRoomState { /// @nodoc abstract class _$$ChatRoomStateLoadedImplCopyWith<$Res> { - factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value, $Res Function(_$ChatRoomStateLoadedImpl) then) = + factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value, + $Res Function(_$ChatRoomStateLoadedImpl) then) = __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>; - @useResult - $Res call({ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading}); + $Res call( + {ChatRoomModel chatRoom, + List chatMessages, + bool isTyping, + bool isLoading}); $ChatRoomModelCopyWith<$Res> get chatRoom; } /// @nodoc -class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl> +class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl> implements _$$ChatRoomStateLoadedImplCopyWith<$Res> { - __$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value, $Res Function(_$ChatRoomStateLoadedImpl) _then) : super(_value, _then); + __$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value, + $Res Function(_$ChatRoomStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -370,13 +409,16 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyW /// @nodoc class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { - const _$ChatRoomStateLoadedImpl({required this.chatRoom, required final List chatMessages, required this.isTyping, required this.isLoading}) + const _$ChatRoomStateLoadedImpl( + {required this.chatRoom, + required final List chatMessages, + required this.isTyping, + required this.isLoading}) : _chatMessages = chatMessages; @override final ChatRoomModel chatRoom; final List _chatMessages; - @override List get chatMessages { if (_chatMessages is EqualUnmodifiableListView) return _chatMessages; @@ -399,14 +441,19 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateLoadedImpl && - (identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom) && - const DeepCollectionEquality().equals(other._chatMessages, _chatMessages) && - (identical(other.isTyping, isTyping) || other.isTyping == isTyping) && - (identical(other.isLoading, isLoading) || other.isLoading == isLoading)); + (identical(other.chatRoom, chatRoom) || + other.chatRoom == chatRoom) && + const DeepCollectionEquality() + .equals(other._chatMessages, _chatMessages) && + (identical(other.isTyping, isTyping) || + other.isTyping == isTyping) && + (identical(other.isLoading, isLoading) || + other.isLoading == isLoading)); } @override - int get hashCode => Object.hash(runtimeType, chatRoom, const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); + int get hashCode => Object.hash(runtimeType, chatRoom, + const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -414,14 +461,17 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { @override @pragma('vm:prefer-inline') _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => - __$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>(this, _$identity); + __$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loaded(chatRoom, chatMessages, isTyping, isLoading); @@ -432,7 +482,9 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(chatRoom, chatMessages, isTyping, isLoading); @@ -443,7 +495,9 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -499,32 +553,33 @@ abstract class ChatRoomStateLoaded implements ChatRoomState { required final bool isLoading}) = _$ChatRoomStateLoadedImpl; ChatRoomModel get chatRoom; - List get chatMessages; - bool get isTyping; - bool get isLoading; /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ChatRoomStateErrorImplCopyWith<$Res> { - factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value, $Res Function(_$ChatRoomStateErrorImpl) then) = + factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value, + $Res Function(_$ChatRoomStateErrorImpl) then) = __$$ChatRoomStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ChatRoomStateErrorImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl> +class __$$ChatRoomStateErrorImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl> implements _$$ChatRoomStateErrorImplCopyWith<$Res> { - __$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value, $Res Function(_$ChatRoomStateErrorImpl) _then) : super(_value, _then); + __$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value, + $Res Function(_$ChatRoomStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -560,7 +615,8 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -572,14 +628,17 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { @override @pragma('vm:prefer-inline') _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => - __$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>(this, _$identity); + __$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -590,7 +649,9 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -601,7 +662,9 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -650,12 +713,14 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { } abstract class ChatRoomStateError implements ChatRoomState { - const factory ChatRoomStateError({required final String errorMessage}) = _$ChatRoomStateErrorImpl; + const factory ChatRoomStateError({required final String errorMessage}) = + _$ChatRoomStateErrorImpl; String get errorMessage; /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart index 1b216a02..99fa9054 100644 --- a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$ChatSelectState { required TResult Function(List chatRooms) loaded, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$ChatSelectState { /// @nodoc abstract class $ChatSelectStateCopyWith<$Res> { - factory $ChatSelectStateCopyWith(ChatSelectState value, $Res Function(ChatSelectState) then) = _$ChatSelectStateCopyWithImpl<$Res, ChatSelectState>; + factory $ChatSelectStateCopyWith( + ChatSelectState value, $Res Function(ChatSelectState) then) = + _$ChatSelectStateCopyWithImpl<$Res, ChatSelectState>; } /// @nodoc -class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> implements $ChatSelectStateCopyWith<$Res> { +class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> + implements $ChatSelectStateCopyWith<$Res> { _$ChatSelectStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,13 +91,18 @@ class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> implemen /// @nodoc abstract class _$$ChatSelectStateImplCopyWith<$Res> { - factory _$$ChatSelectStateImplCopyWith(_$ChatSelectStateImpl value, $Res Function(_$ChatSelectStateImpl) then) = __$$ChatSelectStateImplCopyWithImpl<$Res>; + factory _$$ChatSelectStateImplCopyWith(_$ChatSelectStateImpl value, + $Res Function(_$ChatSelectStateImpl) then) = + __$$ChatSelectStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatSelectStateImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateImpl> +class __$$ChatSelectStateImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateImpl> implements _$$ChatSelectStateImplCopyWith<$Res> { - __$$ChatSelectStateImplCopyWithImpl(_$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then) : super(_value, _then); + __$$ChatSelectStateImplCopyWithImpl( + _$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -114,7 +120,8 @@ class _$ChatSelectStateImpl implements _ChatSelectState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ChatSelectStateImpl); } @override @@ -201,14 +208,20 @@ abstract class _ChatSelectState implements ChatSelectState { /// @nodoc abstract class _$$ChatSelectStateLoadingImplCopyWith<$Res> { - factory _$$ChatSelectStateLoadingImplCopyWith(_$ChatSelectStateLoadingImpl value, $Res Function(_$ChatSelectStateLoadingImpl) then) = + factory _$$ChatSelectStateLoadingImplCopyWith( + _$ChatSelectStateLoadingImpl value, + $Res Function(_$ChatSelectStateLoadingImpl) then) = __$$ChatSelectStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadingImpl> +class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadingImpl> implements _$$ChatSelectStateLoadingImplCopyWith<$Res> { - __$$ChatSelectStateLoadingImplCopyWithImpl(_$ChatSelectStateLoadingImpl _value, $Res Function(_$ChatSelectStateLoadingImpl) _then) : super(_value, _then); + __$$ChatSelectStateLoadingImplCopyWithImpl( + _$ChatSelectStateLoadingImpl _value, + $Res Function(_$ChatSelectStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -226,7 +239,9 @@ class _$ChatSelectStateLoadingImpl implements ChatSelectStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ChatSelectStateLoadingImpl); } @override @@ -313,17 +328,20 @@ abstract class ChatSelectStateLoading implements ChatSelectState { /// @nodoc abstract class _$$ChatSelectStateErrorImplCopyWith<$Res> { - factory _$$ChatSelectStateErrorImplCopyWith(_$ChatSelectStateErrorImpl value, $Res Function(_$ChatSelectStateErrorImpl) then) = + factory _$$ChatSelectStateErrorImplCopyWith(_$ChatSelectStateErrorImpl value, + $Res Function(_$ChatSelectStateErrorImpl) then) = __$$ChatSelectStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ChatSelectStateErrorImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateErrorImpl> +class __$$ChatSelectStateErrorImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateErrorImpl> implements _$$ChatSelectStateErrorImplCopyWith<$Res> { - __$$ChatSelectStateErrorImplCopyWithImpl(_$ChatSelectStateErrorImpl _value, $Res Function(_$ChatSelectStateErrorImpl) _then) : super(_value, _then); + __$$ChatSelectStateErrorImplCopyWithImpl(_$ChatSelectStateErrorImpl _value, + $Res Function(_$ChatSelectStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -359,7 +377,8 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -370,8 +389,10 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => - __$$ChatSelectStateErrorImplCopyWithImpl<_$ChatSelectStateErrorImpl>(this, _$identity); + _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> + get copyWith => + __$$ChatSelectStateErrorImplCopyWithImpl<_$ChatSelectStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -449,29 +470,35 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { } abstract class ChatSelectStateError implements ChatSelectState { - const factory ChatSelectStateError({required final String errorMessage}) = _$ChatSelectStateErrorImpl; + const factory ChatSelectStateError({required final String errorMessage}) = + _$ChatSelectStateErrorImpl; String get errorMessage; /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ChatSelectStateLoadedImplCopyWith<$Res> { - factory _$$ChatSelectStateLoadedImplCopyWith(_$ChatSelectStateLoadedImpl value, $Res Function(_$ChatSelectStateLoadedImpl) then) = + factory _$$ChatSelectStateLoadedImplCopyWith( + _$ChatSelectStateLoadedImpl value, + $Res Function(_$ChatSelectStateLoadedImpl) then) = __$$ChatSelectStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({List chatRooms}); } /// @nodoc -class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadedImpl> +class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadedImpl> implements _$$ChatSelectStateLoadedImplCopyWith<$Res> { - __$$ChatSelectStateLoadedImplCopyWithImpl(_$ChatSelectStateLoadedImpl _value, $Res Function(_$ChatSelectStateLoadedImpl) _then) : super(_value, _then); + __$$ChatSelectStateLoadedImplCopyWithImpl(_$ChatSelectStateLoadedImpl _value, + $Res Function(_$ChatSelectStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -492,10 +519,10 @@ class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> extends _$ChatSelectStateC /// @nodoc class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { - const _$ChatSelectStateLoadedImpl({required final List chatRooms}) : _chatRooms = chatRooms; + const _$ChatSelectStateLoadedImpl({required final List chatRooms}) + : _chatRooms = chatRooms; final List _chatRooms; - @override List get chatRooms { if (_chatRooms is EqualUnmodifiableListView) return _chatRooms; @@ -511,19 +538,24 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatSelectStateLoadedImpl && const DeepCollectionEquality().equals(other._chatRooms, _chatRooms)); + (other.runtimeType == runtimeType && + other is _$ChatSelectStateLoadedImpl && + const DeepCollectionEquality() + .equals(other._chatRooms, _chatRooms)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> get copyWith => - __$$ChatSelectStateLoadedImplCopyWithImpl<_$ChatSelectStateLoadedImpl>(this, _$identity); + _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> + get copyWith => __$$ChatSelectStateLoadedImplCopyWithImpl< + _$ChatSelectStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -601,12 +633,14 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { } abstract class ChatSelectStateLoaded implements ChatSelectState { - const factory ChatSelectStateLoaded({required final List chatRooms}) = _$ChatSelectStateLoadedImpl; + const factory ChatSelectStateLoaded( + {required final List chatRooms}) = _$ChatSelectStateLoadedImpl; List get chatRooms; /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/services/chat_service.g.dart b/lib/features/chat/services/chat_service.g.dart index fa32d6fd..4e84a7b3 100644 --- a/lib/features/chat/services/chat_service.g.dart +++ b/lib/features/chat/services/chat_service.g.dart @@ -80,7 +80,8 @@ class _ChatService implements ChatService { final _result = await _dio.fetch>(_options); late Map _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry(k, ChatRoomModel.fromJson(v as Map))); + _value = _result.data!.map((k, dynamic v) => + MapEntry(k, ChatRoomModel.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -198,7 +199,9 @@ class _ChatService implements ChatService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/diary/models/diary_model.freezed.dart b/lib/features/diary/models/diary_model.freezed.dart index 1b3bca12..ceabd5db 100644 --- a/lib/features/diary/models/diary_model.freezed.dart +++ b/lib/features/diary/models/diary_model.freezed.dart @@ -21,19 +21,12 @@ DiaryModel _$DiaryModelFromJson(Map json) { /// @nodoc mixin _$DiaryModel { int get id => throw _privateConstructorUsedError; - DateTime get date => throw _privateConstructorUsedError; - int get closed => throw _privateConstructorUsedError; - List get meals => throw _privateConstructorUsedError; - State get state => throw _privateConstructorUsedError; - String? get comment => throw _privateConstructorUsedError; - DateTime? get wakeup => throw _privateConstructorUsedError; - DateTime? get retire => throw _privateConstructorUsedError; /// Serializes this DiaryModel to a JSON map. @@ -42,26 +35,36 @@ mixin _$DiaryModel { /// Create a copy of DiaryModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DiaryModelCopyWith get copyWith => throw _privateConstructorUsedError; + $DiaryModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $DiaryModelCopyWith<$Res> { - factory $DiaryModelCopyWith(DiaryModel value, $Res Function(DiaryModel) then) = _$DiaryModelCopyWithImpl<$Res, DiaryModel>; - + factory $DiaryModelCopyWith( + DiaryModel value, $Res Function(DiaryModel) then) = + _$DiaryModelCopyWithImpl<$Res, DiaryModel>; @useResult - $Res call({int id, DateTime date, int closed, List meals, State state, String? comment, DateTime? wakeup, DateTime? retire}); + $Res call( + {int id, + DateTime date, + int closed, + List meals, + State state, + String? comment, + DateTime? wakeup, + DateTime? retire}); $StateCopyWith<$Res> get state; } /// @nodoc -class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> implements $DiaryModelCopyWith<$Res> { +class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> + implements $DiaryModelCopyWith<$Res> { _$DiaryModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -127,20 +130,34 @@ class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel> implements $DiaryM } /// @nodoc -abstract class _$$DiaryModelImplCopyWith<$Res> implements $DiaryModelCopyWith<$Res> { - factory _$$DiaryModelImplCopyWith(_$DiaryModelImpl value, $Res Function(_$DiaryModelImpl) then) = __$$DiaryModelImplCopyWithImpl<$Res>; - +abstract class _$$DiaryModelImplCopyWith<$Res> + implements $DiaryModelCopyWith<$Res> { + factory _$$DiaryModelImplCopyWith( + _$DiaryModelImpl value, $Res Function(_$DiaryModelImpl) then) = + __$$DiaryModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({int id, DateTime date, int closed, List meals, State state, String? comment, DateTime? wakeup, DateTime? retire}); + $Res call( + {int id, + DateTime date, + int closed, + List meals, + State state, + String? comment, + DateTime? wakeup, + DateTime? retire}); @override $StateCopyWith<$Res> get state; } /// @nodoc -class __$$DiaryModelImplCopyWithImpl<$Res> extends _$DiaryModelCopyWithImpl<$Res, _$DiaryModelImpl> implements _$$DiaryModelImplCopyWith<$Res> { - __$$DiaryModelImplCopyWithImpl(_$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then) : super(_value, _then); +class __$$DiaryModelImplCopyWithImpl<$Res> + extends _$DiaryModelCopyWithImpl<$Res, _$DiaryModelImpl> + implements _$$DiaryModelImplCopyWith<$Res> { + __$$DiaryModelImplCopyWithImpl( + _$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then) + : super(_value, _then); /// Create a copy of DiaryModel /// with the given fields replaced by the non-null parameter values. @@ -207,7 +224,8 @@ class _$DiaryModelImpl implements _DiaryModel { this.retire}) : _meals = meals; - factory _$DiaryModelImpl.fromJson(Map json) => _$$DiaryModelImplFromJson(json); + factory _$DiaryModelImpl.fromJson(Map json) => + _$$DiaryModelImplFromJson(json); @override final int id; @@ -216,7 +234,6 @@ class _$DiaryModelImpl implements _DiaryModel { @override final int closed; final List _meals; - @override List get meals { if (_meals is EqualUnmodifiableListView) return _meals; @@ -255,14 +272,24 @@ class _$DiaryModelImpl implements _DiaryModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, date, closed, const DeepCollectionEquality().hash(_meals), state, comment, wakeup, retire); + int get hashCode => Object.hash( + runtimeType, + id, + date, + closed, + const DeepCollectionEquality().hash(_meals), + state, + comment, + wakeup, + retire); /// Create a copy of DiaryModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => __$$DiaryModelImplCopyWithImpl<_$DiaryModelImpl>(this, _$identity); + _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => + __$$DiaryModelImplCopyWithImpl<_$DiaryModelImpl>(this, _$identity); @override Map toJson() { @@ -283,29 +310,23 @@ abstract class _DiaryModel implements DiaryModel { final DateTime? wakeup, final DateTime? retire}) = _$DiaryModelImpl; - factory _DiaryModel.fromJson(Map json) = _$DiaryModelImpl.fromJson; + factory _DiaryModel.fromJson(Map json) = + _$DiaryModelImpl.fromJson; @override int get id; - @override DateTime get date; - @override int get closed; - @override List get meals; - @override State get state; - @override String? get comment; - @override DateTime? get wakeup; - @override DateTime? get retire; @@ -313,5 +334,6 @@ abstract class _DiaryModel implements DiaryModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/diary_model.g.dart b/lib/features/diary/models/diary_model.g.dart index e549b464..29f98caa 100644 --- a/lib/features/diary/models/diary_model.g.dart +++ b/lib/features/diary/models/diary_model.g.dart @@ -6,18 +6,26 @@ part of 'diary_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$DiaryModelImpl _$$DiaryModelImplFromJson(Map json) => _$DiaryModelImpl( +_$DiaryModelImpl _$$DiaryModelImplFromJson(Map json) => + _$DiaryModelImpl( id: (json['id'] as num).toInt(), date: DateTime.parse(json['date'] as String), closed: (json['closed'] as num).toInt(), - meals: (json['meals'] as List).map((e) => Meal.fromJson(e as Map)).toList(), + meals: (json['meals'] as List) + .map((e) => Meal.fromJson(e as Map)) + .toList(), state: State.fromJson(json['state'] as Map), comment: json['comment'] as String?, - wakeup: json['wakeup'] == null ? null : DateTime.parse(json['wakeup'] as String), - retire: json['retire'] == null ? null : DateTime.parse(json['retire'] as String), + wakeup: json['wakeup'] == null + ? null + : DateTime.parse(json['wakeup'] as String), + retire: json['retire'] == null + ? null + : DateTime.parse(json['retire'] as String), ); -Map _$$DiaryModelImplToJson(_$DiaryModelImpl instance) => { +Map _$$DiaryModelImplToJson(_$DiaryModelImpl instance) => + { 'id': instance.id, 'date': instance.date.toIso8601String(), 'closed': instance.closed, diff --git a/lib/features/diary/models/meal.freezed.dart b/lib/features/diary/models/meal.freezed.dart index 16a7bd5a..2bd6c478 100644 --- a/lib/features/diary/models/meal.freezed.dart +++ b/lib/features/diary/models/meal.freezed.dart @@ -21,17 +21,11 @@ Meal _$MealFromJson(Map json) { /// @nodoc mixin _$Meal { int get id => throw _privateConstructorUsedError; - String get time => throw _privateConstructorUsedError; - int get type => throw _privateConstructorUsedError; - int get satiety => throw _privateConstructorUsedError; - int get mood => throw _privateConstructorUsedError; - List get portions => throw _privateConstructorUsedError; - List get photos => throw _privateConstructorUsedError; /// Serializes this Meal to a JSON map. @@ -45,19 +39,26 @@ mixin _$Meal { /// @nodoc abstract class $MealCopyWith<$Res> { - factory $MealCopyWith(Meal value, $Res Function(Meal) then) = _$MealCopyWithImpl<$Res, Meal>; - + factory $MealCopyWith(Meal value, $Res Function(Meal) then) = + _$MealCopyWithImpl<$Res, Meal>; @useResult - $Res call({int id, String time, int type, int satiety, int mood, List portions, List photos}); + $Res call( + {int id, + String time, + int type, + int satiety, + int mood, + List portions, + List photos}); } /// @nodoc -class _$MealCopyWithImpl<$Res, $Val extends Meal> implements $MealCopyWith<$Res> { +class _$MealCopyWithImpl<$Res, $Val extends Meal> + implements $MealCopyWith<$Res> { _$MealCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -109,16 +110,27 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal> implements $MealCopyWith<$Res> /// @nodoc abstract class _$$MealImplCopyWith<$Res> implements $MealCopyWith<$Res> { - factory _$$MealImplCopyWith(_$MealImpl value, $Res Function(_$MealImpl) then) = __$$MealImplCopyWithImpl<$Res>; - + factory _$$MealImplCopyWith( + _$MealImpl value, $Res Function(_$MealImpl) then) = + __$$MealImplCopyWithImpl<$Res>; @override @useResult - $Res call({int id, String time, int type, int satiety, int mood, List portions, List photos}); + $Res call( + {int id, + String time, + int type, + int satiety, + int mood, + List portions, + List photos}); } /// @nodoc -class __$$MealImplCopyWithImpl<$Res> extends _$MealCopyWithImpl<$Res, _$MealImpl> implements _$$MealImplCopyWith<$Res> { - __$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then) : super(_value, _then); +class __$$MealImplCopyWithImpl<$Res> + extends _$MealCopyWithImpl<$Res, _$MealImpl> + implements _$$MealImplCopyWith<$Res> { + __$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then) + : super(_value, _then); /// Create a copy of Meal /// with the given fields replaced by the non-null parameter values. @@ -180,7 +192,8 @@ class _$MealImpl implements _Meal { : _portions = portions, _photos = photos; - factory _$MealImpl.fromJson(Map json) => _$$MealImplFromJson(json); + factory _$MealImpl.fromJson(Map json) => + _$$MealImplFromJson(json); @override final int id; @@ -193,7 +206,6 @@ class _$MealImpl implements _Meal { @override final int mood; final List _portions; - @override List get portions { if (_portions is EqualUnmodifiableListView) return _portions; @@ -202,7 +214,6 @@ class _$MealImpl implements _Meal { } final List _photos; - @override List get photos { if (_photos is EqualUnmodifiableListView) return _photos; @@ -231,15 +242,23 @@ class _$MealImpl implements _Meal { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, time, type, satiety, mood, const DeepCollectionEquality().hash(_portions), const DeepCollectionEquality().hash(_photos)); + int get hashCode => Object.hash( + runtimeType, + id, + time, + type, + satiety, + mood, + const DeepCollectionEquality().hash(_portions), + const DeepCollectionEquality().hash(_photos)); /// Create a copy of Meal /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$MealImplCopyWith<_$MealImpl> get copyWith => __$$MealImplCopyWithImpl<_$MealImpl>(this, _$identity); + _$$MealImplCopyWith<_$MealImpl> get copyWith => + __$$MealImplCopyWithImpl<_$MealImpl>(this, _$identity); @override Map toJson() { @@ -263,22 +282,16 @@ abstract class _Meal implements Meal { @override int get id; - @override String get time; - @override int get type; - @override int get satiety; - @override int get mood; - @override List get portions; - @override List get photos; @@ -286,5 +299,6 @@ abstract class _Meal implements Meal { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$MealImplCopyWith<_$MealImpl> get copyWith => throw _privateConstructorUsedError; + _$$MealImplCopyWith<_$MealImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/meal.g.dart b/lib/features/diary/models/meal.g.dart index e1662cac..5536ed92 100644 --- a/lib/features/diary/models/meal.g.dart +++ b/lib/features/diary/models/meal.g.dart @@ -12,11 +12,16 @@ _$MealImpl _$$MealImplFromJson(Map json) => _$MealImpl( type: (json['type'] as num).toInt(), satiety: (json['satiety'] as num).toInt(), mood: (json['mood'] as num).toInt(), - portions: (json['portions'] as List).map((e) => Portion.fromJson(e as Map)).toList(), - photos: (json['photos'] as List).map((e) => Photo.fromJson(e as Map)).toList(), + portions: (json['portions'] as List) + .map((e) => Portion.fromJson(e as Map)) + .toList(), + photos: (json['photos'] as List) + .map((e) => Photo.fromJson(e as Map)) + .toList(), ); -Map _$$MealImplToJson(_$MealImpl instance) => { +Map _$$MealImplToJson(_$MealImpl instance) => + { 'id': instance.id, 'time': instance.time, 'type': instance.type, diff --git a/lib/features/diary/models/photo.freezed.dart b/lib/features/diary/models/photo.freezed.dart index ff812349..8f5e0152 100644 --- a/lib/features/diary/models/photo.freezed.dart +++ b/lib/features/diary/models/photo.freezed.dart @@ -21,10 +21,8 @@ Photo _$PhotoFromJson(Map json) { /// @nodoc mixin _$Photo { int get id => throw _privateConstructorUsedError; - @JsonKey(name: 'original_name') String get originalName => throw _privateConstructorUsedError; - String get path => throw _privateConstructorUsedError; /// Serializes this Photo to a JSON map. @@ -38,19 +36,22 @@ mixin _$Photo { /// @nodoc abstract class $PhotoCopyWith<$Res> { - factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) = _$PhotoCopyWithImpl<$Res, Photo>; - + factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) = + _$PhotoCopyWithImpl<$Res, Photo>; @useResult - $Res call({int id, @JsonKey(name: 'original_name') String originalName, String path}); + $Res call( + {int id, + @JsonKey(name: 'original_name') String originalName, + String path}); } /// @nodoc -class _$PhotoCopyWithImpl<$Res, $Val extends Photo> implements $PhotoCopyWith<$Res> { +class _$PhotoCopyWithImpl<$Res, $Val extends Photo> + implements $PhotoCopyWith<$Res> { _$PhotoCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -82,16 +83,24 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo> implements $PhotoCopyWith<$R /// @nodoc abstract class _$$PhotoImplCopyWith<$Res> implements $PhotoCopyWith<$Res> { - factory _$$PhotoImplCopyWith(_$PhotoImpl value, $Res Function(_$PhotoImpl) then) = __$$PhotoImplCopyWithImpl<$Res>; - + factory _$$PhotoImplCopyWith( + _$PhotoImpl value, $Res Function(_$PhotoImpl) then) = + __$$PhotoImplCopyWithImpl<$Res>; @override @useResult - $Res call({int id, @JsonKey(name: 'original_name') String originalName, String path}); + $Res call( + {int id, + @JsonKey(name: 'original_name') String originalName, + String path}); } /// @nodoc -class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl> implements _$$PhotoImplCopyWith<$Res> { - __$$PhotoImplCopyWithImpl(_$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) : super(_value, _then); +class __$$PhotoImplCopyWithImpl<$Res> + extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl> + implements _$$PhotoImplCopyWith<$Res> { + __$$PhotoImplCopyWithImpl( + _$PhotoImpl _value, $Res Function(_$PhotoImpl) _then) + : super(_value, _then); /// Create a copy of Photo /// with the given fields replaced by the non-null parameter values. @@ -122,9 +131,13 @@ class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoI /// @nodoc @JsonSerializable() class _$PhotoImpl implements _Photo { - const _$PhotoImpl({required this.id, @JsonKey(name: 'original_name') required this.originalName, required this.path}); + const _$PhotoImpl( + {required this.id, + @JsonKey(name: 'original_name') required this.originalName, + required this.path}); - factory _$PhotoImpl.fromJson(Map json) => _$$PhotoImplFromJson(json); + factory _$PhotoImpl.fromJson(Map json) => + _$$PhotoImplFromJson(json); @override final int id; @@ -145,7 +158,8 @@ class _$PhotoImpl implements _Photo { (other.runtimeType == runtimeType && other is _$PhotoImpl && (identical(other.id, id) || other.id == id) && - (identical(other.originalName, originalName) || other.originalName == originalName) && + (identical(other.originalName, originalName) || + other.originalName == originalName) && (identical(other.path, path) || other.path == path)); } @@ -158,7 +172,8 @@ class _$PhotoImpl implements _Photo { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => __$$PhotoImplCopyWithImpl<_$PhotoImpl>(this, _$identity); + _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => + __$$PhotoImplCopyWithImpl<_$PhotoImpl>(this, _$identity); @override Map toJson() { @@ -169,17 +184,18 @@ class _$PhotoImpl implements _Photo { } abstract class _Photo implements Photo { - const factory _Photo({required final int id, @JsonKey(name: 'original_name') required final String originalName, required final String path}) = _$PhotoImpl; + const factory _Photo( + {required final int id, + @JsonKey(name: 'original_name') required final String originalName, + required final String path}) = _$PhotoImpl; factory _Photo.fromJson(Map json) = _$PhotoImpl.fromJson; @override int get id; - @override @JsonKey(name: 'original_name') String get originalName; - @override String get path; @@ -187,5 +203,6 @@ abstract class _Photo implements Photo { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => throw _privateConstructorUsedError; + _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/photo.g.dart b/lib/features/diary/models/photo.g.dart index 1efd15ed..cacf65ac 100644 --- a/lib/features/diary/models/photo.g.dart +++ b/lib/features/diary/models/photo.g.dart @@ -12,7 +12,8 @@ _$PhotoImpl _$$PhotoImplFromJson(Map json) => _$PhotoImpl( path: json['path'] as String, ); -Map _$$PhotoImplToJson(_$PhotoImpl instance) => { +Map _$$PhotoImplToJson(_$PhotoImpl instance) => + { 'id': instance.id, 'original_name': instance.originalName, 'path': instance.path, diff --git a/lib/features/diary/models/portion.freezed.dart b/lib/features/diary/models/portion.freezed.dart index 4aeb9936..4bef02d4 100644 --- a/lib/features/diary/models/portion.freezed.dart +++ b/lib/features/diary/models/portion.freezed.dart @@ -21,13 +21,9 @@ Portion _$PortionFromJson(Map json) { /// @nodoc mixin _$Portion { int get id => throw _privateConstructorUsedError; - String get product_name => throw _privateConstructorUsedError; - int get quantity => throw _privateConstructorUsedError; - String get portion => throw _privateConstructorUsedError; - bool get from_diet => throw _privateConstructorUsedError; /// Serializes this Portion to a JSON map. @@ -41,19 +37,24 @@ mixin _$Portion { /// @nodoc abstract class $PortionCopyWith<$Res> { - factory $PortionCopyWith(Portion value, $Res Function(Portion) then) = _$PortionCopyWithImpl<$Res, Portion>; - + factory $PortionCopyWith(Portion value, $Res Function(Portion) then) = + _$PortionCopyWithImpl<$Res, Portion>; @useResult - $Res call({int id, String product_name, int quantity, String portion, bool from_diet}); + $Res call( + {int id, + String product_name, + int quantity, + String portion, + bool from_diet}); } /// @nodoc -class _$PortionCopyWithImpl<$Res, $Val extends Portion> implements $PortionCopyWith<$Res> { +class _$PortionCopyWithImpl<$Res, $Val extends Portion> + implements $PortionCopyWith<$Res> { _$PortionCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -95,16 +96,26 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion> implements $PortionCopyW /// @nodoc abstract class _$$PortionImplCopyWith<$Res> implements $PortionCopyWith<$Res> { - factory _$$PortionImplCopyWith(_$PortionImpl value, $Res Function(_$PortionImpl) then) = __$$PortionImplCopyWithImpl<$Res>; - + factory _$$PortionImplCopyWith( + _$PortionImpl value, $Res Function(_$PortionImpl) then) = + __$$PortionImplCopyWithImpl<$Res>; @override @useResult - $Res call({int id, String product_name, int quantity, String portion, bool from_diet}); + $Res call( + {int id, + String product_name, + int quantity, + String portion, + bool from_diet}); } /// @nodoc -class __$$PortionImplCopyWithImpl<$Res> extends _$PortionCopyWithImpl<$Res, _$PortionImpl> implements _$$PortionImplCopyWith<$Res> { - __$$PortionImplCopyWithImpl(_$PortionImpl _value, $Res Function(_$PortionImpl) _then) : super(_value, _then); +class __$$PortionImplCopyWithImpl<$Res> + extends _$PortionCopyWithImpl<$Res, _$PortionImpl> + implements _$$PortionImplCopyWith<$Res> { + __$$PortionImplCopyWithImpl( + _$PortionImpl _value, $Res Function(_$PortionImpl) _then) + : super(_value, _then); /// Create a copy of Portion /// with the given fields replaced by the non-null parameter values. @@ -145,9 +156,15 @@ class __$$PortionImplCopyWithImpl<$Res> extends _$PortionCopyWithImpl<$Res, _$Po /// @nodoc @JsonSerializable() class _$PortionImpl implements _Portion { - const _$PortionImpl({required this.id, required this.product_name, required this.quantity, required this.portion, required this.from_diet}); + const _$PortionImpl( + {required this.id, + required this.product_name, + required this.quantity, + required this.portion, + required this.from_diet}); - factory _$PortionImpl.fromJson(Map json) => _$$PortionImplFromJson(json); + factory _$PortionImpl.fromJson(Map json) => + _$$PortionImplFromJson(json); @override final int id; @@ -171,22 +188,27 @@ class _$PortionImpl implements _Portion { (other.runtimeType == runtimeType && other is _$PortionImpl && (identical(other.id, id) || other.id == id) && - (identical(other.product_name, product_name) || other.product_name == product_name) && - (identical(other.quantity, quantity) || other.quantity == quantity) && + (identical(other.product_name, product_name) || + other.product_name == product_name) && + (identical(other.quantity, quantity) || + other.quantity == quantity) && (identical(other.portion, portion) || other.portion == portion) && - (identical(other.from_diet, from_diet) || other.from_diet == from_diet)); + (identical(other.from_diet, from_diet) || + other.from_diet == from_diet)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, product_name, quantity, portion, from_diet); + int get hashCode => + Object.hash(runtimeType, id, product_name, quantity, portion, from_diet); /// Create a copy of Portion /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PortionImplCopyWith<_$PortionImpl> get copyWith => __$$PortionImplCopyWithImpl<_$PortionImpl>(this, _$identity); + _$$PortionImplCopyWith<_$PortionImpl> get copyWith => + __$$PortionImplCopyWithImpl<_$PortionImpl>(this, _$identity); @override Map toJson() { @@ -208,16 +230,12 @@ abstract class _Portion implements Portion { @override int get id; - @override String get product_name; - @override int get quantity; - @override String get portion; - @override bool get from_diet; @@ -225,5 +243,6 @@ abstract class _Portion implements Portion { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PortionImplCopyWith<_$PortionImpl> get copyWith => throw _privateConstructorUsedError; + _$$PortionImplCopyWith<_$PortionImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/portion.g.dart b/lib/features/diary/models/portion.g.dart index 2a464133..f3503e5c 100644 --- a/lib/features/diary/models/portion.g.dart +++ b/lib/features/diary/models/portion.g.dart @@ -6,7 +6,8 @@ part of 'portion.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PortionImpl _$$PortionImplFromJson(Map json) => _$PortionImpl( +_$PortionImpl _$$PortionImplFromJson(Map json) => + _$PortionImpl( id: (json['id'] as num).toInt(), product_name: json['product_name'] as String, quantity: (json['quantity'] as num).toInt(), @@ -14,7 +15,8 @@ _$PortionImpl _$$PortionImplFromJson(Map json) => _$PortionImpl from_diet: json['from_diet'] as bool, ); -Map _$$PortionImplToJson(_$PortionImpl instance) => { +Map _$$PortionImplToJson(_$PortionImpl instance) => + { 'id': instance.id, 'product_name': instance.product_name, 'quantity': instance.quantity, diff --git a/lib/features/diary/models/product.freezed.dart b/lib/features/diary/models/product.freezed.dart index 4911e89e..610656fb 100644 --- a/lib/features/diary/models/product.freezed.dart +++ b/lib/features/diary/models/product.freezed.dart @@ -21,7 +21,6 @@ Product _$ProductFromJson(Map json) { /// @nodoc mixin _$Product { int get id => throw _privateConstructorUsedError; - String get name => throw _privateConstructorUsedError; /// Serializes this Product to a JSON map. @@ -35,19 +34,19 @@ mixin _$Product { /// @nodoc abstract class $ProductCopyWith<$Res> { - factory $ProductCopyWith(Product value, $Res Function(Product) then) = _$ProductCopyWithImpl<$Res, Product>; - + factory $ProductCopyWith(Product value, $Res Function(Product) then) = + _$ProductCopyWithImpl<$Res, Product>; @useResult $Res call({int id, String name}); } /// @nodoc -class _$ProductCopyWithImpl<$Res, $Val extends Product> implements $ProductCopyWith<$Res> { +class _$ProductCopyWithImpl<$Res, $Val extends Product> + implements $ProductCopyWith<$Res> { _$ProductCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -74,16 +73,21 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product> implements $ProductCopyW /// @nodoc abstract class _$$ProductImplCopyWith<$Res> implements $ProductCopyWith<$Res> { - factory _$$ProductImplCopyWith(_$ProductImpl value, $Res Function(_$ProductImpl) then) = __$$ProductImplCopyWithImpl<$Res>; - + factory _$$ProductImplCopyWith( + _$ProductImpl value, $Res Function(_$ProductImpl) then) = + __$$ProductImplCopyWithImpl<$Res>; @override @useResult $Res call({int id, String name}); } /// @nodoc -class __$$ProductImplCopyWithImpl<$Res> extends _$ProductCopyWithImpl<$Res, _$ProductImpl> implements _$$ProductImplCopyWith<$Res> { - __$$ProductImplCopyWithImpl(_$ProductImpl _value, $Res Function(_$ProductImpl) _then) : super(_value, _then); +class __$$ProductImplCopyWithImpl<$Res> + extends _$ProductCopyWithImpl<$Res, _$ProductImpl> + implements _$$ProductImplCopyWith<$Res> { + __$$ProductImplCopyWithImpl( + _$ProductImpl _value, $Res Function(_$ProductImpl) _then) + : super(_value, _then); /// Create a copy of Product /// with the given fields replaced by the non-null parameter values. @@ -111,7 +115,8 @@ class __$$ProductImplCopyWithImpl<$Res> extends _$ProductCopyWithImpl<$Res, _$Pr class _$ProductImpl implements _Product { const _$ProductImpl({required this.id, required this.name}); - factory _$ProductImpl.fromJson(Map json) => _$$ProductImplFromJson(json); + factory _$ProductImpl.fromJson(Map json) => + _$$ProductImplFromJson(json); @override final int id; @@ -141,7 +146,8 @@ class _$ProductImpl implements _Product { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProductImplCopyWith<_$ProductImpl> get copyWith => __$$ProductImplCopyWithImpl<_$ProductImpl>(this, _$identity); + _$$ProductImplCopyWith<_$ProductImpl> get copyWith => + __$$ProductImplCopyWithImpl<_$ProductImpl>(this, _$identity); @override Map toJson() { @@ -152,13 +158,13 @@ class _$ProductImpl implements _Product { } abstract class _Product implements Product { - const factory _Product({required final int id, required final String name}) = _$ProductImpl; + const factory _Product({required final int id, required final String name}) = + _$ProductImpl; factory _Product.fromJson(Map json) = _$ProductImpl.fromJson; @override int get id; - @override String get name; @@ -166,5 +172,6 @@ abstract class _Product implements Product { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProductImplCopyWith<_$ProductImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProductImplCopyWith<_$ProductImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/product.g.dart b/lib/features/diary/models/product.g.dart index d7e1ddd9..74331101 100644 --- a/lib/features/diary/models/product.g.dart +++ b/lib/features/diary/models/product.g.dart @@ -6,12 +6,14 @@ part of 'product.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ProductImpl _$$ProductImplFromJson(Map json) => _$ProductImpl( +_$ProductImpl _$$ProductImplFromJson(Map json) => + _$ProductImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, ); -Map _$$ProductImplToJson(_$ProductImpl instance) => { +Map _$$ProductImplToJson(_$ProductImpl instance) => + { 'id': instance.id, 'name': instance.name, }; diff --git a/lib/features/diary/models/state.freezed.dart b/lib/features/diary/models/state.freezed.dart index e20b37b4..6b9c50fb 100644 --- a/lib/features/diary/models/state.freezed.dart +++ b/lib/features/diary/models/state.freezed.dart @@ -21,7 +21,6 @@ State _$StateFromJson(Map json) { /// @nodoc mixin _$State { bool get has_chosen_diet => throw _privateConstructorUsedError; - bool get has_chosen_plan => throw _privateConstructorUsedError; /// Serializes this State to a JSON map. @@ -35,19 +34,19 @@ mixin _$State { /// @nodoc abstract class $StateCopyWith<$Res> { - factory $StateCopyWith(State value, $Res Function(State) then) = _$StateCopyWithImpl<$Res, State>; - + factory $StateCopyWith(State value, $Res Function(State) then) = + _$StateCopyWithImpl<$Res, State>; @useResult $Res call({bool has_chosen_diet, bool has_chosen_plan}); } /// @nodoc -class _$StateCopyWithImpl<$Res, $Val extends State> implements $StateCopyWith<$Res> { +class _$StateCopyWithImpl<$Res, $Val extends State> + implements $StateCopyWith<$Res> { _$StateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -74,16 +73,21 @@ class _$StateCopyWithImpl<$Res, $Val extends State> implements $StateCopyWith<$R /// @nodoc abstract class _$$StateImplCopyWith<$Res> implements $StateCopyWith<$Res> { - factory _$$StateImplCopyWith(_$StateImpl value, $Res Function(_$StateImpl) then) = __$$StateImplCopyWithImpl<$Res>; - + factory _$$StateImplCopyWith( + _$StateImpl value, $Res Function(_$StateImpl) then) = + __$$StateImplCopyWithImpl<$Res>; @override @useResult $Res call({bool has_chosen_diet, bool has_chosen_plan}); } /// @nodoc -class __$$StateImplCopyWithImpl<$Res> extends _$StateCopyWithImpl<$Res, _$StateImpl> implements _$$StateImplCopyWith<$Res> { - __$$StateImplCopyWithImpl(_$StateImpl _value, $Res Function(_$StateImpl) _then) : super(_value, _then); +class __$$StateImplCopyWithImpl<$Res> + extends _$StateCopyWithImpl<$Res, _$StateImpl> + implements _$$StateImplCopyWith<$Res> { + __$$StateImplCopyWithImpl( + _$StateImpl _value, $Res Function(_$StateImpl) _then) + : super(_value, _then); /// Create a copy of State /// with the given fields replaced by the non-null parameter values. @@ -109,9 +113,11 @@ class __$$StateImplCopyWithImpl<$Res> extends _$StateCopyWithImpl<$Res, _$StateI /// @nodoc @JsonSerializable() class _$StateImpl implements _State { - const _$StateImpl({required this.has_chosen_diet, required this.has_chosen_plan}); + const _$StateImpl( + {required this.has_chosen_diet, required this.has_chosen_plan}); - factory _$StateImpl.fromJson(Map json) => _$$StateImplFromJson(json); + factory _$StateImpl.fromJson(Map json) => + _$$StateImplFromJson(json); @override final bool has_chosen_diet; @@ -128,20 +134,24 @@ class _$StateImpl implements _State { return identical(this, other) || (other.runtimeType == runtimeType && other is _$StateImpl && - (identical(other.has_chosen_diet, has_chosen_diet) || other.has_chosen_diet == has_chosen_diet) && - (identical(other.has_chosen_plan, has_chosen_plan) || other.has_chosen_plan == has_chosen_plan)); + (identical(other.has_chosen_diet, has_chosen_diet) || + other.has_chosen_diet == has_chosen_diet) && + (identical(other.has_chosen_plan, has_chosen_plan) || + other.has_chosen_plan == has_chosen_plan)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, has_chosen_diet, has_chosen_plan); + int get hashCode => + Object.hash(runtimeType, has_chosen_diet, has_chosen_plan); /// Create a copy of State /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$StateImplCopyWith<_$StateImpl> get copyWith => __$$StateImplCopyWithImpl<_$StateImpl>(this, _$identity); + _$$StateImplCopyWith<_$StateImpl> get copyWith => + __$$StateImplCopyWithImpl<_$StateImpl>(this, _$identity); @override Map toJson() { @@ -152,13 +162,14 @@ class _$StateImpl implements _State { } abstract class _State implements State { - const factory _State({required final bool has_chosen_diet, required final bool has_chosen_plan}) = _$StateImpl; + const factory _State( + {required final bool has_chosen_diet, + required final bool has_chosen_plan}) = _$StateImpl; factory _State.fromJson(Map json) = _$StateImpl.fromJson; @override bool get has_chosen_diet; - @override bool get has_chosen_plan; @@ -166,5 +177,6 @@ abstract class _State implements State { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$StateImplCopyWith<_$StateImpl> get copyWith => throw _privateConstructorUsedError; + _$$StateImplCopyWith<_$StateImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/state.g.dart b/lib/features/diary/models/state.g.dart index 574604e3..1b0da8f4 100644 --- a/lib/features/diary/models/state.g.dart +++ b/lib/features/diary/models/state.g.dart @@ -11,7 +11,8 @@ _$StateImpl _$$StateImplFromJson(Map json) => _$StateImpl( has_chosen_plan: json['has_chosen_plan'] as bool, ); -Map _$$StateImplToJson(_$StateImpl instance) => { +Map _$$StateImplToJson(_$StateImpl instance) => + { 'has_chosen_diet': instance.has_chosen_diet, 'has_chosen_plan': instance.has_chosen_plan, }; diff --git a/lib/features/diary/presentation/bloc/diary_state.freezed.dart b/lib/features/diary/presentation/bloc/diary_state.freezed.dart index 881f2e9d..98d7019f 100644 --- a/lib/features/diary/presentation/bloc/diary_state.freezed.dart +++ b/lib/features/diary/presentation/bloc/diary_state.freezed.dart @@ -54,7 +54,6 @@ mixin _$DiaryState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -161,16 +160,18 @@ mixin _$DiaryState { /// @nodoc abstract class $DiaryStateCopyWith<$Res> { - factory $DiaryStateCopyWith(DiaryState value, $Res Function(DiaryState) then) = _$DiaryStateCopyWithImpl<$Res, DiaryState>; + factory $DiaryStateCopyWith( + DiaryState value, $Res Function(DiaryState) then) = + _$DiaryStateCopyWithImpl<$Res, DiaryState>; } /// @nodoc -class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState> implements $DiaryStateCopyWith<$Res> { +class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState> + implements $DiaryStateCopyWith<$Res> { _$DiaryStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -180,12 +181,18 @@ class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState> implements $DiaryS /// @nodoc abstract class _$$DiaryStateImplCopyWith<$Res> { - factory _$$DiaryStateImplCopyWith(_$DiaryStateImpl value, $Res Function(_$DiaryStateImpl) then) = __$$DiaryStateImplCopyWithImpl<$Res>; + factory _$$DiaryStateImplCopyWith( + _$DiaryStateImpl value, $Res Function(_$DiaryStateImpl) then) = + __$$DiaryStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$DiaryStateImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateImpl> implements _$$DiaryStateImplCopyWith<$Res> { - __$$DiaryStateImplCopyWithImpl(_$DiaryStateImpl _value, $Res Function(_$DiaryStateImpl) _then) : super(_value, _then); +class __$$DiaryStateImplCopyWithImpl<$Res> + extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateImpl> + implements _$$DiaryStateImplCopyWith<$Res> { + __$$DiaryStateImplCopyWithImpl( + _$DiaryStateImpl _value, $Res Function(_$DiaryStateImpl) _then) + : super(_value, _then); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -203,7 +210,8 @@ class _$DiaryStateImpl implements _DiaryState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$DiaryStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$DiaryStateImpl); } @override @@ -380,17 +388,20 @@ abstract class _DiaryState implements DiaryState { /// @nodoc abstract class _$$DiaryStateLoadingImplCopyWith<$Res> { - factory _$$DiaryStateLoadingImplCopyWith(_$DiaryStateLoadingImpl value, $Res Function(_$DiaryStateLoadingImpl) then) = + factory _$$DiaryStateLoadingImplCopyWith(_$DiaryStateLoadingImpl value, + $Res Function(_$DiaryStateLoadingImpl) then) = __$$DiaryStateLoadingImplCopyWithImpl<$Res>; - @useResult $Res call({int? id}); } /// @nodoc -class __$$DiaryStateLoadingImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadingImpl> +class __$$DiaryStateLoadingImplCopyWithImpl<$Res> + extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadingImpl> implements _$$DiaryStateLoadingImplCopyWith<$Res> { - __$$DiaryStateLoadingImplCopyWithImpl(_$DiaryStateLoadingImpl _value, $Res Function(_$DiaryStateLoadingImpl) _then) : super(_value, _then); + __$$DiaryStateLoadingImplCopyWithImpl(_$DiaryStateLoadingImpl _value, + $Res Function(_$DiaryStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -423,7 +434,10 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$DiaryStateLoadingImpl && (identical(other.id, id) || other.id == id)); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$DiaryStateLoadingImpl && + (identical(other.id, id) || other.id == id)); } @override @@ -434,7 +448,9 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => __$$DiaryStateLoadingImplCopyWithImpl<_$DiaryStateLoadingImpl>(this, _$identity); + _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => + __$$DiaryStateLoadingImplCopyWithImpl<_$DiaryStateLoadingImpl>( + this, _$identity); @override @optionalTypeArgs @@ -609,14 +625,15 @@ abstract class DiaryStateLoading implements DiaryState { /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => throw _privateConstructorUsedError; + _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$DiaryStateLoadedImplCopyWith<$Res> { - factory _$$DiaryStateLoadedImplCopyWith(_$DiaryStateLoadedImpl value, $Res Function(_$DiaryStateLoadedImpl) then) = + factory _$$DiaryStateLoadedImplCopyWith(_$DiaryStateLoadedImpl value, + $Res Function(_$DiaryStateLoadedImpl) then) = __$$DiaryStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call( {DiaryModel diary, @@ -650,16 +667,17 @@ abstract class _$$DiaryStateLoadedImplCopyWith<$Res> { List? chartDataCounted}); $DiaryModelCopyWith<$Res> get diary; - $MealCopyWith<$Res> get currentMeal; - $SelectionPopupModelCopyWith<$Res> get portionController; } /// @nodoc -class __$$DiaryStateLoadedImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadedImpl> +class __$$DiaryStateLoadedImplCopyWithImpl<$Res> + extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadedImpl> implements _$$DiaryStateLoadedImplCopyWith<$Res> { - __$$DiaryStateLoadedImplCopyWithImpl(_$DiaryStateLoadedImpl _value, $Res Function(_$DiaryStateLoadedImpl) _then) : super(_value, _then); + __$$DiaryStateLoadedImplCopyWithImpl(_$DiaryStateLoadedImpl _value, + $Res Function(_$DiaryStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -841,7 +859,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImp @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get portionController { - return $SelectionPopupModelCopyWith<$Res>(_value.portionController, (value) { + return $SelectionPopupModelCopyWith<$Res>(_value.portionController, + (value) { return _then(_value.copyWith(portionController: value)); }); } @@ -894,25 +913,24 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { @override final String? diaryDate; final List _recommendedChartValues; - @override List get recommendedChartValues { - if (_recommendedChartValues is EqualUnmodifiableListView) return _recommendedChartValues; + if (_recommendedChartValues is EqualUnmodifiableListView) + return _recommendedChartValues; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_recommendedChartValues); } final List _consumedChartValues; - @override List get consumedChartValues { - if (_consumedChartValues is EqualUnmodifiableListView) return _consumedChartValues; + if (_consumedChartValues is EqualUnmodifiableListView) + return _consumedChartValues; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_consumedChartValues); } final List _portions; - @override List get portions { if (_portions is EqualUnmodifiableListView) return _portions; @@ -921,7 +939,6 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } final List _mealList; - @override List get mealList { if (_mealList is EqualUnmodifiableListView) return _mealList; @@ -930,7 +947,6 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } final List _portionList; - @override List get portionList { if (_portionList is EqualUnmodifiableListView) return _portionList; @@ -939,16 +955,15 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } final List _autocompleteList; - @override List get autocompleteList { - if (_autocompleteList is EqualUnmodifiableListView) return _autocompleteList; + if (_autocompleteList is EqualUnmodifiableListView) + return _autocompleteList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_autocompleteList); } final Map _chartData; - @override Map get chartData { if (_chartData is EqualUnmodifiableMapView) return _chartData; @@ -995,12 +1010,12 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { @override final bool isAdded; final List? _chartDataCounted; - @override List? get chartDataCounted { final value = _chartDataCounted; if (value == null) return null; - if (_chartDataCounted is EqualUnmodifiableListView) return _chartDataCounted; + if (_chartDataCounted is EqualUnmodifiableListView) + return _chartDataCounted; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(value); } @@ -1016,34 +1031,60 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { (other.runtimeType == runtimeType && other is _$DiaryStateLoadedImpl && (identical(other.diary, diary) || other.diary == diary) && - (identical(other.diaryDate, diaryDate) || other.diaryDate == diaryDate) && - const DeepCollectionEquality().equals(other._recommendedChartValues, _recommendedChartValues) && - const DeepCollectionEquality().equals(other._consumedChartValues, _consumedChartValues) && + (identical(other.diaryDate, diaryDate) || + other.diaryDate == diaryDate) && + const DeepCollectionEquality().equals( + other._recommendedChartValues, _recommendedChartValues) && + const DeepCollectionEquality() + .equals(other._consumedChartValues, _consumedChartValues) && const DeepCollectionEquality().equals(other._portions, _portions) && const DeepCollectionEquality().equals(other._mealList, _mealList) && - const DeepCollectionEquality().equals(other._portionList, _portionList) && - const DeepCollectionEquality().equals(other._autocompleteList, _autocompleteList) && - const DeepCollectionEquality().equals(other._chartData, _chartData) && - (identical(other.currentMeal, currentMeal) || other.currentMeal == currentMeal) && - (identical(other.portionController, portionController) || other.portionController == portionController) && - (identical(other.wakeupController, wakeupController) || other.wakeupController == wakeupController) && - (identical(other.retireController, retireController) || other.retireController == retireController) && - (identical(other.mealTimeController, mealTimeController) || other.mealTimeController == mealTimeController) && - (identical(other.commentController, commentController) || other.commentController == commentController) && - (identical(other.product_nameController, product_nameController) || other.product_nameController == product_nameController) && - (identical(other.productQuantityController, productQuantityController) || other.productQuantityController == productQuantityController) && - (identical(other.caloriesController, caloriesController) || other.caloriesController == caloriesController) && - (identical(other.fatsController, fatsController) || other.fatsController == fatsController) && - (identical(other.proteinsController, proteinsController) || other.proteinsController == proteinsController) && - (identical(other.carbsController, carbsController) || other.carbsController == carbsController) && - (identical(other.selectedMood, selectedMood) || other.selectedMood == selectedMood) && - (identical(other.selectedSatiety, selectedSatiety) || other.selectedSatiety == selectedSatiety) && - (identical(other.wakeupExpanded, wakeupExpanded) || other.wakeupExpanded == wakeupExpanded) && - (identical(other.moderationExpanded, moderationExpanded) || other.moderationExpanded == moderationExpanded) && - (identical(other.moodExpanded, moodExpanded) || other.moodExpanded == moodExpanded) && - (identical(other.isLoading, isLoading) || other.isLoading == isLoading) && + const DeepCollectionEquality() + .equals(other._portionList, _portionList) && + const DeepCollectionEquality() + .equals(other._autocompleteList, _autocompleteList) && + const DeepCollectionEquality() + .equals(other._chartData, _chartData) && + (identical(other.currentMeal, currentMeal) || + other.currentMeal == currentMeal) && + (identical(other.portionController, portionController) || + other.portionController == portionController) && + (identical(other.wakeupController, wakeupController) || + other.wakeupController == wakeupController) && + (identical(other.retireController, retireController) || + other.retireController == retireController) && + (identical(other.mealTimeController, mealTimeController) || + other.mealTimeController == mealTimeController) && + (identical(other.commentController, commentController) || + other.commentController == commentController) && + (identical(other.product_nameController, product_nameController) || + other.product_nameController == product_nameController) && + (identical(other.productQuantityController, + productQuantityController) || + other.productQuantityController == productQuantityController) && + (identical(other.caloriesController, caloriesController) || + other.caloriesController == caloriesController) && + (identical(other.fatsController, fatsController) || + other.fatsController == fatsController) && + (identical(other.proteinsController, proteinsController) || + other.proteinsController == proteinsController) && + (identical(other.carbsController, carbsController) || + other.carbsController == carbsController) && + (identical(other.selectedMood, selectedMood) || + other.selectedMood == selectedMood) && + (identical(other.selectedSatiety, selectedSatiety) || + other.selectedSatiety == selectedSatiety) && + (identical(other.wakeupExpanded, wakeupExpanded) || + other.wakeupExpanded == wakeupExpanded) && + (identical(other.moderationExpanded, moderationExpanded) || + other.moderationExpanded == moderationExpanded) && + (identical(other.moodExpanded, moodExpanded) || + other.moodExpanded == moodExpanded) && + (identical(other.isLoading, isLoading) || + other.isLoading == isLoading) && (identical(other.isAdded, isAdded) || other.isAdded == isAdded) && - const DeepCollectionEquality().equals(other._chartDataCounted, _chartDataCounted)); + const DeepCollectionEquality() + .equals(other._chartDataCounted, _chartDataCounted)); } @override @@ -1085,7 +1126,9 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => __$$DiaryStateLoadedImplCopyWithImpl<_$DiaryStateLoadedImpl>(this, _$identity); + _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => + __$$DiaryStateLoadedImplCopyWithImpl<_$DiaryStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -1372,80 +1415,58 @@ abstract class DiaryStateLoaded implements DiaryState { final List? chartDataCounted}) = _$DiaryStateLoadedImpl; DiaryModel get diary; - String? get diaryDate; - List get recommendedChartValues; - List get consumedChartValues; - List get portions; - List get mealList; - List get portionList; - List get autocompleteList; - Map get chartData; - Meal get currentMeal; - SelectionPopupModel get portionController; - TimeOfDay get wakeupController; - TimeOfDay get retireController; - TimeOfDay? get mealTimeController; - TextEditingController get commentController; - TextEditingController get product_nameController; - TextEditingController get productQuantityController; - TextEditingController get caloriesController; - TextEditingController get fatsController; - TextEditingController get proteinsController; - TextEditingController get carbsController; - int get selectedMood; - int get selectedSatiety; - bool get wakeupExpanded; - bool get moderationExpanded; - bool get moodExpanded; - bool get isLoading; - bool get isAdded; - List? get chartDataCounted; /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$DiaryStateErrorImplCopyWith<$Res> { - factory _$$DiaryStateErrorImplCopyWith(_$DiaryStateErrorImpl value, $Res Function(_$DiaryStateErrorImpl) then) = __$$DiaryStateErrorImplCopyWithImpl<$Res>; - + factory _$$DiaryStateErrorImplCopyWith(_$DiaryStateErrorImpl value, + $Res Function(_$DiaryStateErrorImpl) then) = + __$$DiaryStateErrorImplCopyWithImpl<$Res>; @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$DiaryStateErrorImplCopyWithImpl<$Res> extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateErrorImpl> implements _$$DiaryStateErrorImplCopyWith<$Res> { - __$$DiaryStateErrorImplCopyWithImpl(_$DiaryStateErrorImpl _value, $Res Function(_$DiaryStateErrorImpl) _then) : super(_value, _then); +class __$$DiaryStateErrorImplCopyWithImpl<$Res> + extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateErrorImpl> + implements _$$DiaryStateErrorImplCopyWith<$Res> { + __$$DiaryStateErrorImplCopyWithImpl( + _$DiaryStateErrorImpl _value, $Res Function(_$DiaryStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -1481,7 +1502,8 @@ class _$DiaryStateErrorImpl implements DiaryStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DiaryStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -1492,7 +1514,9 @@ class _$DiaryStateErrorImpl implements DiaryStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => __$$DiaryStateErrorImplCopyWithImpl<_$DiaryStateErrorImpl>(this, _$identity); + _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => + __$$DiaryStateErrorImplCopyWithImpl<_$DiaryStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -1660,12 +1684,14 @@ class _$DiaryStateErrorImpl implements DiaryStateError { } abstract class DiaryStateError implements DiaryState { - const factory DiaryStateError({required final String errorMessage}) = _$DiaryStateErrorImpl; + const factory DiaryStateError({required final String errorMessage}) = + _$DiaryStateErrorImpl; String get errorMessage; /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/diary/services/diary_service.g.dart b/lib/features/diary/services/diary_service.g.dart index 31336bae..8c1039c0 100644 --- a/lib/features/diary/services/diary_service.g.dart +++ b/lib/features/diary/services/diary_service.g.dart @@ -79,7 +79,8 @@ class _DiaryService implements DiaryService { final _result = await _dio.fetch>(_options); late Map _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry(k, DiaryModel.fromJson(v as Map))); + _value = _result.data!.map((k, dynamic v) => + MapEntry(k, DiaryModel.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -139,7 +140,11 @@ class _DiaryService implements DiaryService { final _result = await _dio.fetch>(_options); late Map> _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry(k, (v as List).map((i) => Product.fromJson(i as Map)).toList())); + _value = _result.data!.map((k, dynamic v) => MapEntry( + k, + (v as List) + .map((i) => Product.fromJson(i as Map)) + .toList())); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -328,7 +333,8 @@ class _DiaryService implements DiaryService { final _result = await _dio.fetch>(_options); late Map _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry(k, Portion.fromJson(v as Map))); + _value = _result.data!.map((k, dynamic v) => + MapEntry(k, Portion.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -505,7 +511,9 @@ class _DiaryService implements DiaryService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/feed/models/comment_model.freezed.dart b/lib/features/feed/models/comment_model.freezed.dart index b32da824..4e520131 100644 --- a/lib/features/feed/models/comment_model.freezed.dart +++ b/lib/features/feed/models/comment_model.freezed.dart @@ -22,10 +22,8 @@ CommentModel _$CommentModelFromJson(Map json) { mixin _$CommentModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; - @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; - @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -35,28 +33,32 @@ mixin _$CommentModel { /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $CommentModelCopyWith get copyWith => throw _privateConstructorUsedError; + $CommentModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $CommentModelCopyWith<$Res> { - factory $CommentModelCopyWith(CommentModel value, $Res Function(CommentModel) then) = _$CommentModelCopyWithImpl<$Res, CommentModel>; - + factory $CommentModelCopyWith( + CommentModel value, $Res Function(CommentModel) then) = + _$CommentModelCopyWithImpl<$Res, CommentModel>; @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; - $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> implements $CommentModelCopyWith<$Res> { +class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> + implements $CommentModelCopyWith<$Res> { _$CommentModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -107,23 +109,31 @@ class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> implements $Co } /// @nodoc -abstract class _$$CommentModelImplCopyWith<$Res> implements $CommentModelCopyWith<$Res> { - factory _$$CommentModelImplCopyWith(_$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) = __$$CommentModelImplCopyWithImpl<$Res>; - +abstract class _$$CommentModelImplCopyWith<$Res> + implements $CommentModelCopyWith<$Res> { + factory _$$CommentModelImplCopyWith( + _$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) = + __$$CommentModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; - @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$CommentModelImplCopyWithImpl<$Res> extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl> implements _$$CommentModelImplCopyWith<$Res> { - __$$CommentModelImplCopyWithImpl(_$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) : super(_value, _then); +class __$$CommentModelImplCopyWithImpl<$Res> + extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl> + implements _$$CommentModelImplCopyWith<$Res> { + __$$CommentModelImplCopyWithImpl( + _$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) + : super(_value, _then); /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @@ -155,13 +165,15 @@ class __$$CommentModelImplCopyWithImpl<$Res> extends _$CommentModelCopyWithImpl< @JsonSerializable() class _$CommentModelImpl implements _CommentModel { const _$CommentModelImpl( - {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$CommentModelImpl.fromJson(Map json) => _$$CommentModelImplFromJson(json); + factory _$CommentModelImpl.fromJson(Map json) => + _$$CommentModelImplFromJson(json); final List _data; - @override @JsonKey(name: "data") List get data { @@ -194,14 +206,16 @@ class _$CommentModelImpl implements _CommentModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity); + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => + __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity); @override Map toJson() { @@ -217,16 +231,15 @@ abstract class _CommentModel implements CommentModel { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$CommentModelImpl; - factory _CommentModel.fromJson(Map json) = _$CommentModelImpl.fromJson; + factory _CommentModel.fromJson(Map json) = + _$CommentModelImpl.fromJson; @override @JsonKey(name: "data") List get data; - @override @JsonKey(name: "links") Links get links; - @override @JsonKey(name: "meta") Meta get meta; @@ -235,7 +248,8 @@ abstract class _CommentModel implements CommentModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => + throw _privateConstructorUsedError; } Comment _$CommentFromJson(Map json) { @@ -246,19 +260,14 @@ Comment _$CommentFromJson(Map json) { mixin _$Comment { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "author_name") String get authorName => throw _privateConstructorUsedError; - @JsonKey(name: "author_profile_icon") String get authorProfileIcon => throw _privateConstructorUsedError; - @JsonKey(name: "body") String get body => throw _privateConstructorUsedError; - @JsonKey(name: "children_comments") List get childrenComments => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; @@ -273,8 +282,8 @@ mixin _$Comment { /// @nodoc abstract class $CommentCopyWith<$Res> { - factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = _$CommentCopyWithImpl<$Res, Comment>; - + factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = + _$CommentCopyWithImpl<$Res, Comment>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -286,12 +295,12 @@ abstract class $CommentCopyWith<$Res> { } /// @nodoc -class _$CommentCopyWithImpl<$Res, $Val extends Comment> implements $CommentCopyWith<$Res> { +class _$CommentCopyWithImpl<$Res, $Val extends Comment> + implements $CommentCopyWith<$Res> { _$CommentCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -338,8 +347,9 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> implements $CommentCopyW /// @nodoc abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { - factory _$$CommentImplCopyWith(_$CommentImpl value, $Res Function(_$CommentImpl) then) = __$$CommentImplCopyWithImpl<$Res>; - + factory _$$CommentImplCopyWith( + _$CommentImpl value, $Res Function(_$CommentImpl) then) = + __$$CommentImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -352,8 +362,12 @@ abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { } /// @nodoc -class __$$CommentImplCopyWithImpl<$Res> extends _$CommentCopyWithImpl<$Res, _$CommentImpl> implements _$$CommentImplCopyWith<$Res> { - __$$CommentImplCopyWithImpl(_$CommentImpl _value, $Res Function(_$CommentImpl) _then) : super(_value, _then); +class __$$CommentImplCopyWithImpl<$Res> + extends _$CommentCopyWithImpl<$Res, _$CommentImpl> + implements _$$CommentImplCopyWith<$Res> { + __$$CommentImplCopyWithImpl( + _$CommentImpl _value, $Res Function(_$CommentImpl) _then) + : super(_value, _then); /// Create a copy of Comment /// with the given fields replaced by the non-null parameter values. @@ -404,11 +418,13 @@ class _$CommentImpl implements _Comment { @JsonKey(name: "author_name") required this.authorName, @JsonKey(name: "author_profile_icon") required this.authorProfileIcon, @JsonKey(name: "body") required this.body, - @JsonKey(name: "children_comments") required final List childrenComments, + @JsonKey(name: "children_comments") + required final List childrenComments, @JsonKey(name: "created_at") required this.createdAt}) : _childrenComments = childrenComments; - factory _$CommentImpl.fromJson(Map json) => _$$CommentImplFromJson(json); + factory _$CommentImpl.fromJson(Map json) => + _$$CommentImplFromJson(json); @override @JsonKey(name: "id") @@ -423,11 +439,11 @@ class _$CommentImpl implements _Comment { @JsonKey(name: "body") final String body; final List _childrenComments; - @override @JsonKey(name: "children_comments") List get childrenComments { - if (_childrenComments is EqualUnmodifiableListView) return _childrenComments; + if (_childrenComments is EqualUnmodifiableListView) + return _childrenComments; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_childrenComments); } @@ -447,23 +463,35 @@ class _$CommentImpl implements _Comment { (other.runtimeType == runtimeType && other is _$CommentImpl && (identical(other.id, id) || other.id == id) && - (identical(other.authorName, authorName) || other.authorName == authorName) && - (identical(other.authorProfileIcon, authorProfileIcon) || other.authorProfileIcon == authorProfileIcon) && + (identical(other.authorName, authorName) || + other.authorName == authorName) && + (identical(other.authorProfileIcon, authorProfileIcon) || + other.authorProfileIcon == authorProfileIcon) && (identical(other.body, body) || other.body == body) && - const DeepCollectionEquality().equals(other._childrenComments, _childrenComments) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt)); + const DeepCollectionEquality() + .equals(other._childrenComments, _childrenComments) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, authorName, authorProfileIcon, body, const DeepCollectionEquality().hash(_childrenComments), createdAt); + int get hashCode => Object.hash( + runtimeType, + id, + authorName, + authorProfileIcon, + body, + const DeepCollectionEquality().hash(_childrenComments), + createdAt); /// Create a copy of Comment /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => + __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); @override Map toJson() { @@ -475,35 +503,33 @@ class _$CommentImpl implements _Comment { abstract class _Comment implements Comment { const factory _Comment( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "author_name") required final String authorName, - @JsonKey(name: "author_profile_icon") required final String authorProfileIcon, - @JsonKey(name: "body") required final String body, - @JsonKey(name: "children_comments") required final List childrenComments, - @JsonKey(name: "created_at") required final DateTime createdAt}) = _$CommentImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "author_name") required final String authorName, + @JsonKey(name: "author_profile_icon") + required final String authorProfileIcon, + @JsonKey(name: "body") required final String body, + @JsonKey(name: "children_comments") + required final List childrenComments, + @JsonKey(name: "created_at") required final DateTime createdAt}) = + _$CommentImpl; factory _Comment.fromJson(Map json) = _$CommentImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "author_name") String get authorName; - @override @JsonKey(name: "author_profile_icon") String get authorProfileIcon; - @override @JsonKey(name: "body") String get body; - @override @JsonKey(name: "children_comments") List get childrenComments; - @override @JsonKey(name: "created_at") DateTime get createdAt; @@ -512,5 +538,6 @@ abstract class _Comment implements Comment { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/comment_model.g.dart b/lib/features/feed/models/comment_model.g.dart index 503322f9..1410cfcc 100644 --- a/lib/features/feed/models/comment_model.g.dart +++ b/lib/features/feed/models/comment_model.g.dart @@ -6,28 +6,36 @@ part of 'comment_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CommentModelImpl _$$CommentModelImplFromJson(Map json) => _$CommentModelImpl( - data: (json['data'] as List).map((e) => Comment.fromJson(e as Map)).toList(), +_$CommentModelImpl _$$CommentModelImplFromJson(Map json) => + _$CommentModelImpl( + data: (json['data'] as List) + .map((e) => Comment.fromJson(e as Map)) + .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$CommentModelImplToJson(_$CommentModelImpl instance) => { +Map _$$CommentModelImplToJson(_$CommentModelImpl instance) => + { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$CommentImpl _$$CommentImplFromJson(Map json) => _$CommentImpl( +_$CommentImpl _$$CommentImplFromJson(Map json) => + _$CommentImpl( id: (json['id'] as num).toInt(), authorName: json['author_name'] as String, authorProfileIcon: json['author_profile_icon'] as String, body: json['body'] as String, - childrenComments: (json['children_comments'] as List).map((e) => Comment.fromJson(e as Map)).toList(), + childrenComments: (json['children_comments'] as List) + .map((e) => Comment.fromJson(e as Map)) + .toList(), createdAt: DateTime.parse(json['created_at'] as String), ); -Map _$$CommentImplToJson(_$CommentImpl instance) => { +Map _$$CommentImplToJson(_$CommentImpl instance) => + { 'id': instance.id, 'author_name': instance.authorName, 'author_profile_icon': instance.authorProfileIcon, diff --git a/lib/features/feed/models/diets_pagination_model.freezed.dart b/lib/features/feed/models/diets_pagination_model.freezed.dart index 9e81d064..15b651f3 100644 --- a/lib/features/feed/models/diets_pagination_model.freezed.dart +++ b/lib/features/feed/models/diets_pagination_model.freezed.dart @@ -22,10 +22,8 @@ DietsPagination _$DietsPaginationFromJson(Map json) { mixin _$DietsPagination { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; - @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; - @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -35,28 +33,32 @@ mixin _$DietsPagination { /// Create a copy of DietsPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DietsPaginationCopyWith get copyWith => throw _privateConstructorUsedError; + $DietsPaginationCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $DietsPaginationCopyWith<$Res> { - factory $DietsPaginationCopyWith(DietsPagination value, $Res Function(DietsPagination) then) = _$DietsPaginationCopyWithImpl<$Res, DietsPagination>; - + factory $DietsPaginationCopyWith( + DietsPagination value, $Res Function(DietsPagination) then) = + _$DietsPaginationCopyWithImpl<$Res, DietsPagination>; @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; - $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> implements $DietsPaginationCopyWith<$Res> { +class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> + implements $DietsPaginationCopyWith<$Res> { _$DietsPaginationCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -107,24 +109,31 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> implemen } /// @nodoc -abstract class _$$DietsPaginationImplCopyWith<$Res> implements $DietsPaginationCopyWith<$Res> { - factory _$$DietsPaginationImplCopyWith(_$DietsPaginationImpl value, $Res Function(_$DietsPaginationImpl) then) = __$$DietsPaginationImplCopyWithImpl<$Res>; - +abstract class _$$DietsPaginationImplCopyWith<$Res> + implements $DietsPaginationCopyWith<$Res> { + factory _$$DietsPaginationImplCopyWith(_$DietsPaginationImpl value, + $Res Function(_$DietsPaginationImpl) then) = + __$$DietsPaginationImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; - @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$DietsPaginationImplCopyWithImpl<$Res> extends _$DietsPaginationCopyWithImpl<$Res, _$DietsPaginationImpl> +class __$$DietsPaginationImplCopyWithImpl<$Res> + extends _$DietsPaginationCopyWithImpl<$Res, _$DietsPaginationImpl> implements _$$DietsPaginationImplCopyWith<$Res> { - __$$DietsPaginationImplCopyWithImpl(_$DietsPaginationImpl _value, $Res Function(_$DietsPaginationImpl) _then) : super(_value, _then); + __$$DietsPaginationImplCopyWithImpl( + _$DietsPaginationImpl _value, $Res Function(_$DietsPaginationImpl) _then) + : super(_value, _then); /// Create a copy of DietsPagination /// with the given fields replaced by the non-null parameter values. @@ -156,13 +165,15 @@ class __$$DietsPaginationImplCopyWithImpl<$Res> extends _$DietsPaginationCopyWit @JsonSerializable() class _$DietsPaginationImpl implements _DietsPagination { const _$DietsPaginationImpl( - {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$DietsPaginationImpl.fromJson(Map json) => _$$DietsPaginationImplFromJson(json); + factory _$DietsPaginationImpl.fromJson(Map json) => + _$$DietsPaginationImplFromJson(json); final List _data; - @override @JsonKey(name: "data") List get data { @@ -195,14 +206,17 @@ class _$DietsPaginationImpl implements _DietsPagination { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of DietsPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => __$$DietsPaginationImplCopyWithImpl<_$DietsPaginationImpl>(this, _$identity); + _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => + __$$DietsPaginationImplCopyWithImpl<_$DietsPaginationImpl>( + this, _$identity); @override Map toJson() { @@ -218,16 +232,15 @@ abstract class _DietsPagination implements DietsPagination { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$DietsPaginationImpl; - factory _DietsPagination.fromJson(Map json) = _$DietsPaginationImpl.fromJson; + factory _DietsPagination.fromJson(Map json) = + _$DietsPaginationImpl.fromJson; @override @JsonKey(name: "data") List get data; - @override @JsonKey(name: "links") Links get links; - @override @JsonKey(name: "meta") Meta get meta; @@ -236,7 +249,8 @@ abstract class _DietsPagination implements DietsPagination { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => throw _privateConstructorUsedError; + _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => + throw _privateConstructorUsedError; } Diet _$DietFromJson(Map json) { @@ -247,37 +261,27 @@ Diet _$DietFromJson(Map json) { mixin _$Diet { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "image") String get image => throw _privateConstructorUsedError; - @JsonKey(name: "duration") int get duration => throw _privateConstructorUsedError; - @JsonKey(name: "state") String get state => throw _privateConstructorUsedError; - @JsonKey(name: "type") DietType get type => throw _privateConstructorUsedError; - @JsonKey(name: "details") String get details => throw _privateConstructorUsedError; - @JsonKey(name: "daily_schedule") - List>> get dailySchedule => throw _privateConstructorUsedError; - + List>> get dailySchedule => + throw _privateConstructorUsedError; @JsonKey(name: "author") Author get author => throw _privateConstructorUsedError; - @JsonKey(name: "total_likes") int get totalLikes => throw _privateConstructorUsedError; - @JsonKey(name: "total_views") int get totalViews => throw _privateConstructorUsedError; - @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; @@ -292,8 +296,8 @@ mixin _$Diet { /// @nodoc abstract class $DietCopyWith<$Res> { - factory $DietCopyWith(Diet value, $Res Function(Diet) then) = _$DietCopyWithImpl<$Res, Diet>; - + factory $DietCopyWith(Diet value, $Res Function(Diet) then) = + _$DietCopyWithImpl<$Res, Diet>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -303,24 +307,24 @@ abstract class $DietCopyWith<$Res> { @JsonKey(name: "state") String state, @JsonKey(name: "type") DietType type, @JsonKey(name: "details") String details, - @JsonKey(name: "daily_schedule") List>> dailySchedule, + @JsonKey(name: "daily_schedule") + List>> dailySchedule, @JsonKey(name: "author") Author author, @JsonKey(name: "total_likes") int totalLikes, @JsonKey(name: "total_views") int totalViews, @JsonKey(name: "total_comments") int totalComments}); $DietTypeCopyWith<$Res> get type; - $AuthorCopyWith<$Res> get author; } /// @nodoc -class _$DietCopyWithImpl<$Res, $Val extends Diet> implements $DietCopyWith<$Res> { +class _$DietCopyWithImpl<$Res, $Val extends Diet> + implements $DietCopyWith<$Res> { _$DietCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -417,8 +421,9 @@ class _$DietCopyWithImpl<$Res, $Val extends Diet> implements $DietCopyWith<$Res> /// @nodoc abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> { - factory _$$DietImplCopyWith(_$DietImpl value, $Res Function(_$DietImpl) then) = __$$DietImplCopyWithImpl<$Res>; - + factory _$$DietImplCopyWith( + _$DietImpl value, $Res Function(_$DietImpl) then) = + __$$DietImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -429,7 +434,8 @@ abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> { @JsonKey(name: "state") String state, @JsonKey(name: "type") DietType type, @JsonKey(name: "details") String details, - @JsonKey(name: "daily_schedule") List>> dailySchedule, + @JsonKey(name: "daily_schedule") + List>> dailySchedule, @JsonKey(name: "author") Author author, @JsonKey(name: "total_likes") int totalLikes, @JsonKey(name: "total_views") int totalViews, @@ -437,14 +443,16 @@ abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> { @override $DietTypeCopyWith<$Res> get type; - @override $AuthorCopyWith<$Res> get author; } /// @nodoc -class __$$DietImplCopyWithImpl<$Res> extends _$DietCopyWithImpl<$Res, _$DietImpl> implements _$$DietImplCopyWith<$Res> { - __$$DietImplCopyWithImpl(_$DietImpl _value, $Res Function(_$DietImpl) _then) : super(_value, _then); +class __$$DietImplCopyWithImpl<$Res> + extends _$DietCopyWithImpl<$Res, _$DietImpl> + implements _$$DietImplCopyWith<$Res> { + __$$DietImplCopyWithImpl(_$DietImpl _value, $Res Function(_$DietImpl) _then) + : super(_value, _then); /// Create a copy of Diet /// with the given fields replaced by the non-null parameter values. @@ -528,14 +536,16 @@ class _$DietImpl implements _Diet { @JsonKey(name: "state") required this.state, @JsonKey(name: "type") required this.type, @JsonKey(name: "details") required this.details, - @JsonKey(name: "daily_schedule") required final List>> dailySchedule, + @JsonKey(name: "daily_schedule") + required final List>> dailySchedule, @JsonKey(name: "author") required this.author, @JsonKey(name: "total_likes") required this.totalLikes, @JsonKey(name: "total_views") required this.totalViews, @JsonKey(name: "total_comments") required this.totalComments}) : _dailySchedule = dailySchedule; - factory _$DietImpl.fromJson(Map json) => _$$DietImplFromJson(json); + factory _$DietImpl.fromJson(Map json) => + _$$DietImplFromJson(json); @override @JsonKey(name: "id") @@ -559,7 +569,6 @@ class _$DietImpl implements _Diet { @JsonKey(name: "details") final String details; final List>> _dailySchedule; - @override @JsonKey(name: "daily_schedule") List>> get dailySchedule { @@ -594,28 +603,46 @@ class _$DietImpl implements _Diet { (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.image, image) || other.image == image) && - (identical(other.duration, duration) || other.duration == duration) && + (identical(other.duration, duration) || + other.duration == duration) && (identical(other.state, state) || other.state == state) && (identical(other.type, type) || other.type == type) && (identical(other.details, details) || other.details == details) && - const DeepCollectionEquality().equals(other._dailySchedule, _dailySchedule) && + const DeepCollectionEquality() + .equals(other._dailySchedule, _dailySchedule) && (identical(other.author, author) || other.author == author) && - (identical(other.totalLikes, totalLikes) || other.totalLikes == totalLikes) && - (identical(other.totalViews, totalViews) || other.totalViews == totalViews) && - (identical(other.totalComments, totalComments) || other.totalComments == totalComments)); + (identical(other.totalLikes, totalLikes) || + other.totalLikes == totalLikes) && + (identical(other.totalViews, totalViews) || + other.totalViews == totalViews) && + (identical(other.totalComments, totalComments) || + other.totalComments == totalComments)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, image, duration, state, type, details, const DeepCollectionEquality().hash(_dailySchedule), author, - totalLikes, totalViews, totalComments); + int get hashCode => Object.hash( + runtimeType, + id, + name, + image, + duration, + state, + type, + details, + const DeepCollectionEquality().hash(_dailySchedule), + author, + totalLikes, + totalViews, + totalComments); /// Create a copy of Diet /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietImplCopyWith<_$DietImpl> get copyWith => __$$DietImplCopyWithImpl<_$DietImpl>(this, _$identity); + _$$DietImplCopyWith<_$DietImpl> get copyWith => + __$$DietImplCopyWithImpl<_$DietImpl>(this, _$identity); @override Map toJson() { @@ -627,65 +654,56 @@ class _$DietImpl implements _Diet { abstract class _Diet implements Diet { const factory _Diet( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "image") required final String image, - @JsonKey(name: "duration") required final int duration, - @JsonKey(name: "state") required final String state, - @JsonKey(name: "type") required final DietType type, - @JsonKey(name: "details") required final String details, - @JsonKey(name: "daily_schedule") required final List>> dailySchedule, - @JsonKey(name: "author") required final Author author, - @JsonKey(name: "total_likes") required final int totalLikes, - @JsonKey(name: "total_views") required final int totalViews, - @JsonKey(name: "total_comments") required final int totalComments}) = _$DietImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "image") required final String image, + @JsonKey(name: "duration") required final int duration, + @JsonKey(name: "state") required final String state, + @JsonKey(name: "type") required final DietType type, + @JsonKey(name: "details") required final String details, + @JsonKey(name: "daily_schedule") + required final List>> dailySchedule, + @JsonKey(name: "author") required final Author author, + @JsonKey(name: "total_likes") required final int totalLikes, + @JsonKey(name: "total_views") required final int totalViews, + @JsonKey(name: "total_comments") required final int totalComments}) = + _$DietImpl; factory _Diet.fromJson(Map json) = _$DietImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "image") String get image; - @override @JsonKey(name: "duration") int get duration; - @override @JsonKey(name: "state") String get state; - @override @JsonKey(name: "type") DietType get type; - @override @JsonKey(name: "details") String get details; - @override @JsonKey(name: "daily_schedule") List>> get dailySchedule; - @override @JsonKey(name: "author") Author get author; - @override @JsonKey(name: "total_likes") int get totalLikes; - @override @JsonKey(name: "total_views") int get totalViews; - @override @JsonKey(name: "total_comments") int get totalComments; @@ -694,7 +712,8 @@ abstract class _Diet implements Diet { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietImplCopyWith<_$DietImpl> get copyWith => throw _privateConstructorUsedError; + _$$DietImplCopyWith<_$DietImpl> get copyWith => + throw _privateConstructorUsedError; } Author _$AuthorFromJson(Map json) { @@ -705,13 +724,10 @@ Author _$AuthorFromJson(Map json) { mixin _$Author { @JsonKey(name: "author_slug") String get authorSlug => throw _privateConstructorUsedError; - @JsonKey(name: "author_name") String get authorName => throw _privateConstructorUsedError; - @JsonKey(name: "author_profile_icon") String get authorProfileIcon => throw _privateConstructorUsedError; - @JsonKey(name: "author_is_me") bool get authorIsMe => throw _privateConstructorUsedError; @@ -726,8 +742,8 @@ mixin _$Author { /// @nodoc abstract class $AuthorCopyWith<$Res> { - factory $AuthorCopyWith(Author value, $Res Function(Author) then) = _$AuthorCopyWithImpl<$Res, Author>; - + factory $AuthorCopyWith(Author value, $Res Function(Author) then) = + _$AuthorCopyWithImpl<$Res, Author>; @useResult $Res call( {@JsonKey(name: "author_slug") String authorSlug, @@ -737,12 +753,12 @@ abstract class $AuthorCopyWith<$Res> { } /// @nodoc -class _$AuthorCopyWithImpl<$Res, $Val extends Author> implements $AuthorCopyWith<$Res> { +class _$AuthorCopyWithImpl<$Res, $Val extends Author> + implements $AuthorCopyWith<$Res> { _$AuthorCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -779,8 +795,9 @@ class _$AuthorCopyWithImpl<$Res, $Val extends Author> implements $AuthorCopyWith /// @nodoc abstract class _$$AuthorImplCopyWith<$Res> implements $AuthorCopyWith<$Res> { - factory _$$AuthorImplCopyWith(_$AuthorImpl value, $Res Function(_$AuthorImpl) then) = __$$AuthorImplCopyWithImpl<$Res>; - + factory _$$AuthorImplCopyWith( + _$AuthorImpl value, $Res Function(_$AuthorImpl) then) = + __$$AuthorImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -791,8 +808,12 @@ abstract class _$$AuthorImplCopyWith<$Res> implements $AuthorCopyWith<$Res> { } /// @nodoc -class __$$AuthorImplCopyWithImpl<$Res> extends _$AuthorCopyWithImpl<$Res, _$AuthorImpl> implements _$$AuthorImplCopyWith<$Res> { - __$$AuthorImplCopyWithImpl(_$AuthorImpl _value, $Res Function(_$AuthorImpl) _then) : super(_value, _then); +class __$$AuthorImplCopyWithImpl<$Res> + extends _$AuthorCopyWithImpl<$Res, _$AuthorImpl> + implements _$$AuthorImplCopyWith<$Res> { + __$$AuthorImplCopyWithImpl( + _$AuthorImpl _value, $Res Function(_$AuthorImpl) _then) + : super(_value, _then); /// Create a copy of Author /// with the given fields replaced by the non-null parameter values. @@ -834,7 +855,8 @@ class _$AuthorImpl implements _Author { @JsonKey(name: "author_profile_icon") required this.authorProfileIcon, @JsonKey(name: "author_is_me") required this.authorIsMe}); - factory _$AuthorImpl.fromJson(Map json) => _$$AuthorImplFromJson(json); + factory _$AuthorImpl.fromJson(Map json) => + _$$AuthorImplFromJson(json); @override @JsonKey(name: "author_slug") @@ -859,22 +881,28 @@ class _$AuthorImpl implements _Author { return identical(this, other) || (other.runtimeType == runtimeType && other is _$AuthorImpl && - (identical(other.authorSlug, authorSlug) || other.authorSlug == authorSlug) && - (identical(other.authorName, authorName) || other.authorName == authorName) && - (identical(other.authorProfileIcon, authorProfileIcon) || other.authorProfileIcon == authorProfileIcon) && - (identical(other.authorIsMe, authorIsMe) || other.authorIsMe == authorIsMe)); + (identical(other.authorSlug, authorSlug) || + other.authorSlug == authorSlug) && + (identical(other.authorName, authorName) || + other.authorName == authorName) && + (identical(other.authorProfileIcon, authorProfileIcon) || + other.authorProfileIcon == authorProfileIcon) && + (identical(other.authorIsMe, authorIsMe) || + other.authorIsMe == authorIsMe)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, authorSlug, authorName, authorProfileIcon, authorIsMe); + int get hashCode => Object.hash( + runtimeType, authorSlug, authorName, authorProfileIcon, authorIsMe); /// Create a copy of Author /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => __$$AuthorImplCopyWithImpl<_$AuthorImpl>(this, _$identity); + _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => + __$$AuthorImplCopyWithImpl<_$AuthorImpl>(this, _$identity); @override Map toJson() { @@ -886,25 +914,24 @@ class _$AuthorImpl implements _Author { abstract class _Author implements Author { const factory _Author( - {@JsonKey(name: "author_slug") required final String authorSlug, - @JsonKey(name: "author_name") required final String authorName, - @JsonKey(name: "author_profile_icon") required final String authorProfileIcon, - @JsonKey(name: "author_is_me") required final bool authorIsMe}) = _$AuthorImpl; + {@JsonKey(name: "author_slug") required final String authorSlug, + @JsonKey(name: "author_name") required final String authorName, + @JsonKey(name: "author_profile_icon") + required final String authorProfileIcon, + @JsonKey(name: "author_is_me") required final bool authorIsMe}) = + _$AuthorImpl; factory _Author.fromJson(Map json) = _$AuthorImpl.fromJson; @override @JsonKey(name: "author_slug") String get authorSlug; - @override @JsonKey(name: "author_name") String get authorName; - @override @JsonKey(name: "author_profile_icon") String get authorProfileIcon; - @override @JsonKey(name: "author_is_me") bool get authorIsMe; @@ -913,7 +940,8 @@ abstract class _Author implements Author { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => throw _privateConstructorUsedError; + _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => + throw _privateConstructorUsedError; } DailySchedule _$DailyScheduleFromJson(Map json) { @@ -924,13 +952,10 @@ DailySchedule _$DailyScheduleFromJson(Map json) { mixin _$DailySchedule { @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "uniq") String get uniq => throw _privateConstructorUsedError; - @JsonKey(name: "portion") Portion get portion => throw _privateConstructorUsedError; - @JsonKey(name: "quantity") int get quantity => throw _privateConstructorUsedError; @@ -940,13 +965,15 @@ mixin _$DailySchedule { /// Create a copy of DailySchedule /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DailyScheduleCopyWith get copyWith => throw _privateConstructorUsedError; + $DailyScheduleCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $DailyScheduleCopyWith<$Res> { - factory $DailyScheduleCopyWith(DailySchedule value, $Res Function(DailySchedule) then) = _$DailyScheduleCopyWithImpl<$Res, DailySchedule>; - + factory $DailyScheduleCopyWith( + DailySchedule value, $Res Function(DailySchedule) then) = + _$DailyScheduleCopyWithImpl<$Res, DailySchedule>; @useResult $Res call( {@JsonKey(name: "name") String name, @@ -956,12 +983,12 @@ abstract class $DailyScheduleCopyWith<$Res> { } /// @nodoc -class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> implements $DailyScheduleCopyWith<$Res> { +class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> + implements $DailyScheduleCopyWith<$Res> { _$DailyScheduleCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -997,9 +1024,11 @@ class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> implements $ } /// @nodoc -abstract class _$$DailyScheduleImplCopyWith<$Res> implements $DailyScheduleCopyWith<$Res> { - factory _$$DailyScheduleImplCopyWith(_$DailyScheduleImpl value, $Res Function(_$DailyScheduleImpl) then) = __$$DailyScheduleImplCopyWithImpl<$Res>; - +abstract class _$$DailyScheduleImplCopyWith<$Res> + implements $DailyScheduleCopyWith<$Res> { + factory _$$DailyScheduleImplCopyWith( + _$DailyScheduleImpl value, $Res Function(_$DailyScheduleImpl) then) = + __$$DailyScheduleImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -1010,8 +1039,12 @@ abstract class _$$DailyScheduleImplCopyWith<$Res> implements $DailyScheduleCopyW } /// @nodoc -class __$$DailyScheduleImplCopyWithImpl<$Res> extends _$DailyScheduleCopyWithImpl<$Res, _$DailyScheduleImpl> implements _$$DailyScheduleImplCopyWith<$Res> { - __$$DailyScheduleImplCopyWithImpl(_$DailyScheduleImpl _value, $Res Function(_$DailyScheduleImpl) _then) : super(_value, _then); +class __$$DailyScheduleImplCopyWithImpl<$Res> + extends _$DailyScheduleCopyWithImpl<$Res, _$DailyScheduleImpl> + implements _$$DailyScheduleImplCopyWith<$Res> { + __$$DailyScheduleImplCopyWithImpl( + _$DailyScheduleImpl _value, $Res Function(_$DailyScheduleImpl) _then) + : super(_value, _then); /// Create a copy of DailySchedule /// with the given fields replaced by the non-null parameter values. @@ -1053,7 +1086,8 @@ class _$DailyScheduleImpl implements _DailySchedule { @JsonKey(name: "portion") required this.portion, @JsonKey(name: "quantity") required this.quantity}); - factory _$DailyScheduleImpl.fromJson(Map json) => _$$DailyScheduleImplFromJson(json); + factory _$DailyScheduleImpl.fromJson(Map json) => + _$$DailyScheduleImplFromJson(json); @override @JsonKey(name: "name") @@ -1081,7 +1115,8 @@ class _$DailyScheduleImpl implements _DailySchedule { (identical(other.name, name) || other.name == name) && (identical(other.uniq, uniq) || other.uniq == uniq) && (identical(other.portion, portion) || other.portion == portion) && - (identical(other.quantity, quantity) || other.quantity == quantity)); + (identical(other.quantity, quantity) || + other.quantity == quantity)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -1093,7 +1128,8 @@ class _$DailyScheduleImpl implements _DailySchedule { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => __$$DailyScheduleImplCopyWithImpl<_$DailyScheduleImpl>(this, _$identity); + _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => + __$$DailyScheduleImplCopyWithImpl<_$DailyScheduleImpl>(this, _$identity); @override Map toJson() { @@ -1105,25 +1141,24 @@ class _$DailyScheduleImpl implements _DailySchedule { abstract class _DailySchedule implements DailySchedule { const factory _DailySchedule( - {@JsonKey(name: "name") required final String name, - @JsonKey(name: "uniq") required final String uniq, - @JsonKey(name: "portion") required final Portion portion, - @JsonKey(name: "quantity") required final int quantity}) = _$DailyScheduleImpl; + {@JsonKey(name: "name") required final String name, + @JsonKey(name: "uniq") required final String uniq, + @JsonKey(name: "portion") required final Portion portion, + @JsonKey(name: "quantity") required final int quantity}) = + _$DailyScheduleImpl; - factory _DailySchedule.fromJson(Map json) = _$DailyScheduleImpl.fromJson; + factory _DailySchedule.fromJson(Map json) = + _$DailyScheduleImpl.fromJson; @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "uniq") String get uniq; - @override @JsonKey(name: "portion") Portion get portion; - @override @JsonKey(name: "quantity") int get quantity; @@ -1132,7 +1167,8 @@ abstract class _DailySchedule implements DailySchedule { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => throw _privateConstructorUsedError; + _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => + throw _privateConstructorUsedError; } DietType _$DietTypeFromJson(Map json) { @@ -1143,13 +1179,10 @@ DietType _$DietTypeFromJson(Map json) { mixin _$DietType { @JsonKey(name: "alko") bool? get alko => throw _privateConstructorUsedError; - @JsonKey(name: "veg") bool? get veg => throw _privateConstructorUsedError; - @JsonKey(name: "corb") bool? get corb => throw _privateConstructorUsedError; - @JsonKey(name: "meat") bool? get meat => throw _privateConstructorUsedError; @@ -1159,24 +1192,29 @@ mixin _$DietType { /// Create a copy of DietType /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $DietTypeCopyWith get copyWith => throw _privateConstructorUsedError; + $DietTypeCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $DietTypeCopyWith<$Res> { - factory $DietTypeCopyWith(DietType value, $Res Function(DietType) then) = _$DietTypeCopyWithImpl<$Res, DietType>; - + factory $DietTypeCopyWith(DietType value, $Res Function(DietType) then) = + _$DietTypeCopyWithImpl<$Res, DietType>; @useResult - $Res call({@JsonKey(name: "alko") bool? alko, @JsonKey(name: "veg") bool? veg, @JsonKey(name: "corb") bool? corb, @JsonKey(name: "meat") bool? meat}); + $Res call( + {@JsonKey(name: "alko") bool? alko, + @JsonKey(name: "veg") bool? veg, + @JsonKey(name: "corb") bool? corb, + @JsonKey(name: "meat") bool? meat}); } /// @nodoc -class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> implements $DietTypeCopyWith<$Res> { +class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> + implements $DietTypeCopyWith<$Res> { _$DietTypeCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -1212,17 +1250,27 @@ class _$DietTypeCopyWithImpl<$Res, $Val extends DietType> implements $DietTypeCo } /// @nodoc -abstract class _$$DietTypeImplCopyWith<$Res> implements $DietTypeCopyWith<$Res> { - factory _$$DietTypeImplCopyWith(_$DietTypeImpl value, $Res Function(_$DietTypeImpl) then) = __$$DietTypeImplCopyWithImpl<$Res>; - +abstract class _$$DietTypeImplCopyWith<$Res> + implements $DietTypeCopyWith<$Res> { + factory _$$DietTypeImplCopyWith( + _$DietTypeImpl value, $Res Function(_$DietTypeImpl) then) = + __$$DietTypeImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "alko") bool? alko, @JsonKey(name: "veg") bool? veg, @JsonKey(name: "corb") bool? corb, @JsonKey(name: "meat") bool? meat}); + $Res call( + {@JsonKey(name: "alko") bool? alko, + @JsonKey(name: "veg") bool? veg, + @JsonKey(name: "corb") bool? corb, + @JsonKey(name: "meat") bool? meat}); } /// @nodoc -class __$$DietTypeImplCopyWithImpl<$Res> extends _$DietTypeCopyWithImpl<$Res, _$DietTypeImpl> implements _$$DietTypeImplCopyWith<$Res> { - __$$DietTypeImplCopyWithImpl(_$DietTypeImpl _value, $Res Function(_$DietTypeImpl) _then) : super(_value, _then); +class __$$DietTypeImplCopyWithImpl<$Res> + extends _$DietTypeCopyWithImpl<$Res, _$DietTypeImpl> + implements _$$DietTypeImplCopyWith<$Res> { + __$$DietTypeImplCopyWithImpl( + _$DietTypeImpl _value, $Res Function(_$DietTypeImpl) _then) + : super(_value, _then); /// Create a copy of DietType /// with the given fields replaced by the non-null parameter values. @@ -1258,9 +1306,14 @@ class __$$DietTypeImplCopyWithImpl<$Res> extends _$DietTypeCopyWithImpl<$Res, _$ /// @nodoc @JsonSerializable() class _$DietTypeImpl implements _DietType { - const _$DietTypeImpl({@JsonKey(name: "alko") this.alko, @JsonKey(name: "veg") this.veg, @JsonKey(name: "corb") this.corb, @JsonKey(name: "meat") this.meat}); + const _$DietTypeImpl( + {@JsonKey(name: "alko") this.alko, + @JsonKey(name: "veg") this.veg, + @JsonKey(name: "corb") this.corb, + @JsonKey(name: "meat") this.meat}); - factory _$DietTypeImpl.fromJson(Map json) => _$$DietTypeImplFromJson(json); + factory _$DietTypeImpl.fromJson(Map json) => + _$$DietTypeImplFromJson(json); @override @JsonKey(name: "alko") @@ -1300,7 +1353,8 @@ class _$DietTypeImpl implements _DietType { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => __$$DietTypeImplCopyWithImpl<_$DietTypeImpl>(this, _$identity); + _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => + __$$DietTypeImplCopyWithImpl<_$DietTypeImpl>(this, _$identity); @override Map toJson() { @@ -1317,20 +1371,18 @@ abstract class _DietType implements DietType { @JsonKey(name: "corb") final bool? corb, @JsonKey(name: "meat") final bool? meat}) = _$DietTypeImpl; - factory _DietType.fromJson(Map json) = _$DietTypeImpl.fromJson; + factory _DietType.fromJson(Map json) = + _$DietTypeImpl.fromJson; @override @JsonKey(name: "alko") bool? get alko; - @override @JsonKey(name: "veg") bool? get veg; - @override @JsonKey(name: "corb") bool? get corb; - @override @JsonKey(name: "meat") bool? get meat; @@ -1339,5 +1391,6 @@ abstract class _DietType implements DietType { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => throw _privateConstructorUsedError; + _$$DietTypeImplCopyWith<_$DietTypeImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/diets_pagination_model.g.dart b/lib/features/feed/models/diets_pagination_model.g.dart index fd3e231c..7fcab8cd 100644 --- a/lib/features/feed/models/diets_pagination_model.g.dart +++ b/lib/features/feed/models/diets_pagination_model.g.dart @@ -6,13 +6,19 @@ part of 'diets_pagination_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$DietsPaginationImpl _$$DietsPaginationImplFromJson(Map json) => _$DietsPaginationImpl( - data: (json['data'] as List).map((e) => Diet.fromJson(e as Map)).toList(), +_$DietsPaginationImpl _$$DietsPaginationImplFromJson( + Map json) => + _$DietsPaginationImpl( + data: (json['data'] as List) + .map((e) => Diet.fromJson(e as Map)) + .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$DietsPaginationImplToJson(_$DietsPaginationImpl instance) => { +Map _$$DietsPaginationImplToJson( + _$DietsPaginationImpl instance) => + { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, @@ -27,7 +33,11 @@ _$DietImpl _$$DietImplFromJson(Map json) => _$DietImpl( type: DietType.fromJson(json['type'] as Map), details: json['details'] as String, dailySchedule: (json['daily_schedule'] as List) - .map((e) => (e as List).map((e) => (e as List).map((e) => DailySchedule.fromJson(e as Map)).toList()).toList()) + .map((e) => (e as List) + .map((e) => (e as List) + .map((e) => DailySchedule.fromJson(e as Map)) + .toList()) + .toList()) .toList(), author: Author.fromJson(json['author'] as Map), totalLikes: (json['total_likes'] as num).toInt(), @@ -35,7 +45,8 @@ _$DietImpl _$$DietImplFromJson(Map json) => _$DietImpl( totalComments: (json['total_comments'] as num).toInt(), ); -Map _$$DietImplToJson(_$DietImpl instance) => { +Map _$$DietImplToJson(_$DietImpl instance) => + { 'id': instance.id, 'name': instance.name, 'image': instance.image, @@ -57,21 +68,24 @@ _$AuthorImpl _$$AuthorImplFromJson(Map json) => _$AuthorImpl( authorIsMe: json['author_is_me'] as bool, ); -Map _$$AuthorImplToJson(_$AuthorImpl instance) => { +Map _$$AuthorImplToJson(_$AuthorImpl instance) => + { 'author_slug': instance.authorSlug, 'author_name': instance.authorName, 'author_profile_icon': instance.authorProfileIcon, 'author_is_me': instance.authorIsMe, }; -_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map json) => _$DailyScheduleImpl( +_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map json) => + _$DailyScheduleImpl( name: json['name'] as String, uniq: json['uniq'] as String, portion: $enumDecode(_$PortionEnumMap, json['portion']), quantity: (json['quantity'] as num).toInt(), ); -Map _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) => { +Map _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) => + { 'name': instance.name, 'uniq': instance.uniq, 'portion': _$PortionEnumMap[instance.portion]!, @@ -84,14 +98,16 @@ const _$PortionEnumMap = { Portion.PCS: 'pcs', }; -_$DietTypeImpl _$$DietTypeImplFromJson(Map json) => _$DietTypeImpl( +_$DietTypeImpl _$$DietTypeImplFromJson(Map json) => + _$DietTypeImpl( alko: json['alko'] as bool?, veg: json['veg'] as bool?, corb: json['corb'] as bool?, meat: json['meat'] as bool?, ); -Map _$$DietTypeImplToJson(_$DietTypeImpl instance) => { +Map _$$DietTypeImplToJson(_$DietTypeImpl instance) => + { 'alko': instance.alko, 'veg': instance.veg, 'corb': instance.corb, diff --git a/lib/features/feed/models/feed_blog_post_model.freezed.dart b/lib/features/feed/models/feed_blog_post_model.freezed.dart index ce6612b7..89087373 100644 --- a/lib/features/feed/models/feed_blog_post_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_model.freezed.dart @@ -21,35 +21,23 @@ FeedBlogPostModel _$FeedBlogPostModelFromJson(Map json) { /// @nodoc mixin _$FeedBlogPostModel { int get id => throw _privateConstructorUsedError; - String get state => throw _privateConstructorUsedError; - String get image => throw _privateConstructorUsedError; - String get description => throw _privateConstructorUsedError; - Author get author => throw _privateConstructorUsedError; - @JsonKey(name: "youtube_url") String get youtubeUrl => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; - String get title => throw _privateConstructorUsedError; - @JsonKey(name: "total_likes") int get totalLikes => throw _privateConstructorUsedError; - @JsonKey(name: "total_views") int get totalViews => throw _privateConstructorUsedError; - @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; - @JsonKey(name: "was_liked_by_me") bool get wasLikedByMe => throw _privateConstructorUsedError; @@ -59,13 +47,15 @@ mixin _$FeedBlogPostModel { /// Create a copy of FeedBlogPostModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $FeedBlogPostModelCopyWith get copyWith => throw _privateConstructorUsedError; + $FeedBlogPostModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $FeedBlogPostModelCopyWith<$Res> { - factory $FeedBlogPostModelCopyWith(FeedBlogPostModel value, $Res Function(FeedBlogPostModel) then) = _$FeedBlogPostModelCopyWithImpl<$Res, FeedBlogPostModel>; - + factory $FeedBlogPostModelCopyWith( + FeedBlogPostModel value, $Res Function(FeedBlogPostModel) then) = + _$FeedBlogPostModelCopyWithImpl<$Res, FeedBlogPostModel>; @useResult $Res call( {int id, @@ -86,12 +76,12 @@ abstract class $FeedBlogPostModelCopyWith<$Res> { } /// @nodoc -class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> implements $FeedBlogPostModelCopyWith<$Res> { +class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> + implements $FeedBlogPostModelCopyWith<$Res> { _$FeedBlogPostModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -182,10 +172,11 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> impl } /// @nodoc -abstract class _$$FeedBlogPostModelImplCopyWith<$Res> implements $FeedBlogPostModelCopyWith<$Res> { - factory _$$FeedBlogPostModelImplCopyWith(_$FeedBlogPostModelImpl value, $Res Function(_$FeedBlogPostModelImpl) then) = +abstract class _$$FeedBlogPostModelImplCopyWith<$Res> + implements $FeedBlogPostModelCopyWith<$Res> { + factory _$$FeedBlogPostModelImplCopyWith(_$FeedBlogPostModelImpl value, + $Res Function(_$FeedBlogPostModelImpl) then) = __$$FeedBlogPostModelImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -208,9 +199,12 @@ abstract class _$$FeedBlogPostModelImplCopyWith<$Res> implements $FeedBlogPostMo } /// @nodoc -class __$$FeedBlogPostModelImplCopyWithImpl<$Res> extends _$FeedBlogPostModelCopyWithImpl<$Res, _$FeedBlogPostModelImpl> +class __$$FeedBlogPostModelImplCopyWithImpl<$Res> + extends _$FeedBlogPostModelCopyWithImpl<$Res, _$FeedBlogPostModelImpl> implements _$$FeedBlogPostModelImplCopyWith<$Res> { - __$$FeedBlogPostModelImplCopyWithImpl(_$FeedBlogPostModelImpl _value, $Res Function(_$FeedBlogPostModelImpl) _then) : super(_value, _then); + __$$FeedBlogPostModelImplCopyWithImpl(_$FeedBlogPostModelImpl _value, + $Res Function(_$FeedBlogPostModelImpl) _then) + : super(_value, _then); /// Create a copy of FeedBlogPostModel /// with the given fields replaced by the non-null parameter values. @@ -306,7 +300,8 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { @JsonKey(name: "total_comments") required this.totalComments, @JsonKey(name: "was_liked_by_me") required this.wasLikedByMe}); - factory _$FeedBlogPostModelImpl.fromJson(Map json) => _$$FeedBlogPostModelImplFromJson(json); + factory _$FeedBlogPostModelImpl.fromJson(Map json) => + _$$FeedBlogPostModelImplFromJson(json); @override final int id; @@ -355,29 +350,52 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { (identical(other.id, id) || other.id == id) && (identical(other.state, state) || other.state == state) && (identical(other.image, image) || other.image == image) && - (identical(other.description, description) || other.description == description) && + (identical(other.description, description) || + other.description == description) && (identical(other.author, author) || other.author == author) && - (identical(other.youtubeUrl, youtubeUrl) || other.youtubeUrl == youtubeUrl) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && + (identical(other.youtubeUrl, youtubeUrl) || + other.youtubeUrl == youtubeUrl) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && (identical(other.title, title) || other.title == title) && - (identical(other.totalLikes, totalLikes) || other.totalLikes == totalLikes) && - (identical(other.totalViews, totalViews) || other.totalViews == totalViews) && - (identical(other.totalComments, totalComments) || other.totalComments == totalComments) && - (identical(other.wasLikedByMe, wasLikedByMe) || other.wasLikedByMe == wasLikedByMe)); + (identical(other.totalLikes, totalLikes) || + other.totalLikes == totalLikes) && + (identical(other.totalViews, totalViews) || + other.totalViews == totalViews) && + (identical(other.totalComments, totalComments) || + other.totalComments == totalComments) && + (identical(other.wasLikedByMe, wasLikedByMe) || + other.wasLikedByMe == wasLikedByMe)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, id, state, image, description, author, youtubeUrl, createdAt, updatedAt, title, totalLikes, totalViews, totalComments, wasLikedByMe); + runtimeType, + id, + state, + image, + description, + author, + youtubeUrl, + createdAt, + updatedAt, + title, + totalLikes, + totalViews, + totalComments, + wasLikedByMe); /// Create a copy of FeedBlogPostModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => __$$FeedBlogPostModelImplCopyWithImpl<_$FeedBlogPostModelImpl>(this, _$identity); + _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => + __$$FeedBlogPostModelImplCopyWithImpl<_$FeedBlogPostModelImpl>( + this, _$identity); @override Map toJson() { @@ -389,64 +407,54 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { abstract class _FeedBlogPostModel implements FeedBlogPostModel { const factory _FeedBlogPostModel( - {required final int id, - required final String state, - required final String image, - required final String description, - required final Author author, - @JsonKey(name: "youtube_url") required final String youtubeUrl, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") required final DateTime updatedAt, - required final String title, - @JsonKey(name: "total_likes") required final int totalLikes, - @JsonKey(name: "total_views") required final int totalViews, - @JsonKey(name: "total_comments") required final int totalComments, - @JsonKey(name: "was_liked_by_me") required final bool wasLikedByMe}) = _$FeedBlogPostModelImpl; + {required final int id, + required final String state, + required final String image, + required final String description, + required final Author author, + @JsonKey(name: "youtube_url") required final String youtubeUrl, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt, + required final String title, + @JsonKey(name: "total_likes") required final int totalLikes, + @JsonKey(name: "total_views") required final int totalViews, + @JsonKey(name: "total_comments") required final int totalComments, + @JsonKey(name: "was_liked_by_me") required final bool wasLikedByMe}) = + _$FeedBlogPostModelImpl; - factory _FeedBlogPostModel.fromJson(Map json) = _$FeedBlogPostModelImpl.fromJson; + factory _FeedBlogPostModel.fromJson(Map json) = + _$FeedBlogPostModelImpl.fromJson; @override int get id; - @override String get state; - @override String get image; - @override String get description; - @override Author get author; - @override @JsonKey(name: "youtube_url") String get youtubeUrl; - @override @JsonKey(name: "created_at") DateTime get createdAt; - @override @JsonKey(name: "updated_at") DateTime get updatedAt; - @override String get title; - @override @JsonKey(name: "total_likes") int get totalLikes; - @override @JsonKey(name: "total_views") int get totalViews; - @override @JsonKey(name: "total_comments") int get totalComments; - @override @JsonKey(name: "was_liked_by_me") bool get wasLikedByMe; @@ -455,5 +463,6 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/feed_blog_post_model.g.dart b/lib/features/feed/models/feed_blog_post_model.g.dart index 29ecd6f7..fadf4302 100644 --- a/lib/features/feed/models/feed_blog_post_model.g.dart +++ b/lib/features/feed/models/feed_blog_post_model.g.dart @@ -6,7 +6,9 @@ part of 'feed_blog_post_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(Map json) => _$FeedBlogPostModelImpl( +_$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson( + Map json) => + _$FeedBlogPostModelImpl( id: (json['id'] as num).toInt(), state: json['state'] as String, image: json['image'] as String, @@ -22,7 +24,9 @@ _$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(Map js wasLikedByMe: json['was_liked_by_me'] as bool, ); -Map _$$FeedBlogPostModelImplToJson(_$FeedBlogPostModelImpl instance) => { +Map _$$FeedBlogPostModelImplToJson( + _$FeedBlogPostModelImpl instance) => + { 'id': instance.id, 'state': instance.state, 'image': instance.image, diff --git a/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart b/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart index 1121d5e1..9bddceae 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart @@ -14,15 +14,16 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -FeedBlogPostSettingsModel _$FeedBlogPostSettingsModelFromJson(Map json) { +FeedBlogPostSettingsModel _$FeedBlogPostSettingsModelFromJson( + Map json) { return _FeedBlogPostSettingsModel.fromJson(json); } /// @nodoc mixin _$FeedBlogPostSettingsModel { @JsonKey(name: 'data') - List get feedBlogPostList => throw _privateConstructorUsedError; - + List get feedBlogPostList => + throw _privateConstructorUsedError; Meta get meta => throw _privateConstructorUsedError; /// Serializes this FeedBlogPostSettingsModel to a JSON map. @@ -31,27 +32,31 @@ mixin _$FeedBlogPostSettingsModel { /// Create a copy of FeedBlogPostSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $FeedBlogPostSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; + $FeedBlogPostSettingsModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $FeedBlogPostSettingsModelCopyWith<$Res> { - factory $FeedBlogPostSettingsModelCopyWith(FeedBlogPostSettingsModel value, $Res Function(FeedBlogPostSettingsModel) then) = + factory $FeedBlogPostSettingsModelCopyWith(FeedBlogPostSettingsModel value, + $Res Function(FeedBlogPostSettingsModel) then) = _$FeedBlogPostSettingsModelCopyWithImpl<$Res, FeedBlogPostSettingsModel>; - @useResult - $Res call({@JsonKey(name: 'data') List feedBlogPostList, Meta meta}); + $Res call( + {@JsonKey(name: 'data') List feedBlogPostList, + Meta meta}); $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, $Val extends FeedBlogPostSettingsModel> implements $FeedBlogPostSettingsModelCopyWith<$Res> { +class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, + $Val extends FeedBlogPostSettingsModel> + implements $FeedBlogPostSettingsModelCopyWith<$Res> { _$FeedBlogPostSettingsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -87,22 +92,30 @@ class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, $Val extends FeedBlogPostSet } /// @nodoc -abstract class _$$FeedBlogPostSettingsModelImplCopyWith<$Res> implements $FeedBlogPostSettingsModelCopyWith<$Res> { - factory _$$FeedBlogPostSettingsModelImplCopyWith(_$FeedBlogPostSettingsModelImpl value, $Res Function(_$FeedBlogPostSettingsModelImpl) then) = +abstract class _$$FeedBlogPostSettingsModelImplCopyWith<$Res> + implements $FeedBlogPostSettingsModelCopyWith<$Res> { + factory _$$FeedBlogPostSettingsModelImplCopyWith( + _$FeedBlogPostSettingsModelImpl value, + $Res Function(_$FeedBlogPostSettingsModelImpl) then) = __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res>; - @override @useResult - $Res call({@JsonKey(name: 'data') List feedBlogPostList, Meta meta}); + $Res call( + {@JsonKey(name: 'data') List feedBlogPostList, + Meta meta}); @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> extends _$FeedBlogPostSettingsModelCopyWithImpl<$Res, _$FeedBlogPostSettingsModelImpl> +class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> + extends _$FeedBlogPostSettingsModelCopyWithImpl<$Res, + _$FeedBlogPostSettingsModelImpl> implements _$$FeedBlogPostSettingsModelImplCopyWith<$Res> { - __$$FeedBlogPostSettingsModelImplCopyWithImpl(_$FeedBlogPostSettingsModelImpl _value, $Res Function(_$FeedBlogPostSettingsModelImpl) _then) + __$$FeedBlogPostSettingsModelImplCopyWithImpl( + _$FeedBlogPostSettingsModelImpl _value, + $Res Function(_$FeedBlogPostSettingsModelImpl) _then) : super(_value, _then); /// Create a copy of FeedBlogPostSettingsModel @@ -129,17 +142,21 @@ class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> extends _$FeedBlogPost /// @nodoc @JsonSerializable() class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { - const _$FeedBlogPostSettingsModelImpl({@JsonKey(name: 'data') required final List feedBlogPostList, required this.meta}) + const _$FeedBlogPostSettingsModelImpl( + {@JsonKey(name: 'data') + required final List feedBlogPostList, + required this.meta}) : _feedBlogPostList = feedBlogPostList; - factory _$FeedBlogPostSettingsModelImpl.fromJson(Map json) => _$$FeedBlogPostSettingsModelImplFromJson(json); + factory _$FeedBlogPostSettingsModelImpl.fromJson(Map json) => + _$$FeedBlogPostSettingsModelImplFromJson(json); final List _feedBlogPostList; - @override @JsonKey(name: 'data') List get feedBlogPostList { - if (_feedBlogPostList is EqualUnmodifiableListView) return _feedBlogPostList; + if (_feedBlogPostList is EqualUnmodifiableListView) + return _feedBlogPostList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_feedBlogPostList); } @@ -157,21 +174,24 @@ class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedBlogPostSettingsModelImpl && - const DeepCollectionEquality().equals(other._feedBlogPostList, _feedBlogPostList) && + const DeepCollectionEquality() + .equals(other._feedBlogPostList, _feedBlogPostList) && (identical(other.meta, meta) || other.meta == meta)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList), meta); + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_feedBlogPostList), meta); /// Create a copy of FeedBlogPostSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> get copyWith => - __$$FeedBlogPostSettingsModelImplCopyWithImpl<_$FeedBlogPostSettingsModelImpl>(this, _$identity); + _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> + get copyWith => __$$FeedBlogPostSettingsModelImplCopyWithImpl< + _$FeedBlogPostSettingsModelImpl>(this, _$identity); @override Map toJson() { @@ -182,15 +202,17 @@ class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { } abstract class _FeedBlogPostSettingsModel implements FeedBlogPostSettingsModel { - const factory _FeedBlogPostSettingsModel({@JsonKey(name: 'data') required final List feedBlogPostList, required final Meta meta}) = - _$FeedBlogPostSettingsModelImpl; + const factory _FeedBlogPostSettingsModel( + {@JsonKey(name: 'data') + required final List feedBlogPostList, + required final Meta meta}) = _$FeedBlogPostSettingsModelImpl; - factory _FeedBlogPostSettingsModel.fromJson(Map json) = _$FeedBlogPostSettingsModelImpl.fromJson; + factory _FeedBlogPostSettingsModel.fromJson(Map json) = + _$FeedBlogPostSettingsModelImpl.fromJson; @override @JsonKey(name: 'data') List get feedBlogPostList; - @override Meta get meta; @@ -198,5 +220,6 @@ abstract class _FeedBlogPostSettingsModel implements FeedBlogPostSettingsModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/feed_blog_post_settings_model.g.dart b/lib/features/feed/models/feed_blog_post_settings_model.g.dart index 9566ca99..e300b594 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.g.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.g.dart @@ -6,12 +6,18 @@ part of 'feed_blog_post_settings_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$FeedBlogPostSettingsModelImpl _$$FeedBlogPostSettingsModelImplFromJson(Map json) => _$FeedBlogPostSettingsModelImpl( - feedBlogPostList: (json['data'] as List).map((e) => FeedBlogPostModel.fromJson(e as Map)).toList(), +_$FeedBlogPostSettingsModelImpl _$$FeedBlogPostSettingsModelImplFromJson( + Map json) => + _$FeedBlogPostSettingsModelImpl( + feedBlogPostList: (json['data'] as List) + .map((e) => FeedBlogPostModel.fromJson(e as Map)) + .toList(), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$FeedBlogPostSettingsModelImplToJson(_$FeedBlogPostSettingsModelImpl instance) => { +Map _$$FeedBlogPostSettingsModelImplToJson( + _$FeedBlogPostSettingsModelImpl instance) => + { 'data': instance.feedBlogPostList, 'meta': instance.meta, }; diff --git a/lib/features/feed/models/recipes_model.freezed.dart b/lib/features/feed/models/recipes_model.freezed.dart index 6b59786a..9dd4f54e 100644 --- a/lib/features/feed/models/recipes_model.freezed.dart +++ b/lib/features/feed/models/recipes_model.freezed.dart @@ -21,44 +21,28 @@ Recipes _$RecipesFromJson(Map json) { /// @nodoc mixin _$Recipes { int get id => throw _privateConstructorUsedError; - String get image => throw _privateConstructorUsedError; - String get state => throw _privateConstructorUsedError; - @JsonKey(name: 'cooking_time') int get cookingTime => throw _privateConstructorUsedError; - List get ingredients => throw _privateConstructorUsedError; - String get description => throw _privateConstructorUsedError; - List get steps => throw _privateConstructorUsedError; - @JsonKey(name: 'video_url') String get videoUrl => throw _privateConstructorUsedError; - @JsonKey(name: 'created_at') DateTime get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: 'updated_at') DateTime get updatedAt => throw _privateConstructorUsedError; - String get title => throw _privateConstructorUsedError; - String get type => throw _privateConstructorUsedError; - String get slug => throw _privateConstructorUsedError; - @JsonKey(name: 'total_comments') int get commentsCount => throw _privateConstructorUsedError; - @JsonKey(name: 'total_likes') int get likesCount => throw _privateConstructorUsedError; - @JsonKey(name: 'total_views') int get viewsCount => throw _privateConstructorUsedError; - Author get author => throw _privateConstructorUsedError; /// Serializes this Recipes to a JSON map. @@ -72,8 +56,8 @@ mixin _$Recipes { /// @nodoc abstract class $RecipesCopyWith<$Res> { - factory $RecipesCopyWith(Recipes value, $Res Function(Recipes) then) = _$RecipesCopyWithImpl<$Res, Recipes>; - + factory $RecipesCopyWith(Recipes value, $Res Function(Recipes) then) = + _$RecipesCopyWithImpl<$Res, Recipes>; @useResult $Res call( {int id, @@ -98,12 +82,12 @@ abstract class $RecipesCopyWith<$Res> { } /// @nodoc -class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> implements $RecipesCopyWith<$Res> { +class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> + implements $RecipesCopyWith<$Res> { _$RecipesCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -215,8 +199,9 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> implements $RecipesCopyW /// @nodoc abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> { - factory _$$RecipesImplCopyWith(_$RecipesImpl value, $Res Function(_$RecipesImpl) then) = __$$RecipesImplCopyWithImpl<$Res>; - + factory _$$RecipesImplCopyWith( + _$RecipesImpl value, $Res Function(_$RecipesImpl) then) = + __$$RecipesImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -243,8 +228,12 @@ abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> { } /// @nodoc -class __$$RecipesImplCopyWithImpl<$Res> extends _$RecipesCopyWithImpl<$Res, _$RecipesImpl> implements _$$RecipesImplCopyWith<$Res> { - __$$RecipesImplCopyWithImpl(_$RecipesImpl _value, $Res Function(_$RecipesImpl) _then) : super(_value, _then); +class __$$RecipesImplCopyWithImpl<$Res> + extends _$RecipesCopyWithImpl<$Res, _$RecipesImpl> + implements _$$RecipesImplCopyWith<$Res> { + __$$RecipesImplCopyWithImpl( + _$RecipesImpl _value, $Res Function(_$RecipesImpl) _then) + : super(_value, _then); /// Create a copy of Recipes /// with the given fields replaced by the non-null parameter values. @@ -366,7 +355,8 @@ class _$RecipesImpl implements _Recipes { : _ingredients = ingredients, _steps = steps; - factory _$RecipesImpl.fromJson(Map json) => _$$RecipesImplFromJson(json); + factory _$RecipesImpl.fromJson(Map json) => + _$$RecipesImplFromJson(json); @override final int id; @@ -378,7 +368,6 @@ class _$RecipesImpl implements _Recipes { @JsonKey(name: 'cooking_time') final int cookingTime; final List _ingredients; - @override List get ingredients { if (_ingredients is EqualUnmodifiableListView) return _ingredients; @@ -389,7 +378,6 @@ class _$RecipesImpl implements _Recipes { @override final String description; final List _steps; - @override List get steps { if (_steps is EqualUnmodifiableListView) return _steps; @@ -437,33 +425,60 @@ class _$RecipesImpl implements _Recipes { (identical(other.id, id) || other.id == id) && (identical(other.image, image) || other.image == image) && (identical(other.state, state) || other.state == state) && - (identical(other.cookingTime, cookingTime) || other.cookingTime == cookingTime) && - const DeepCollectionEquality().equals(other._ingredients, _ingredients) && - (identical(other.description, description) || other.description == description) && + (identical(other.cookingTime, cookingTime) || + other.cookingTime == cookingTime) && + const DeepCollectionEquality() + .equals(other._ingredients, _ingredients) && + (identical(other.description, description) || + other.description == description) && const DeepCollectionEquality().equals(other._steps, _steps) && - (identical(other.videoUrl, videoUrl) || other.videoUrl == videoUrl) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && + (identical(other.videoUrl, videoUrl) || + other.videoUrl == videoUrl) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && (identical(other.title, title) || other.title == title) && (identical(other.type, type) || other.type == type) && (identical(other.slug, slug) || other.slug == slug) && - (identical(other.commentsCount, commentsCount) || other.commentsCount == commentsCount) && - (identical(other.likesCount, likesCount) || other.likesCount == likesCount) && - (identical(other.viewsCount, viewsCount) || other.viewsCount == viewsCount) && + (identical(other.commentsCount, commentsCount) || + other.commentsCount == commentsCount) && + (identical(other.likesCount, likesCount) || + other.likesCount == likesCount) && + (identical(other.viewsCount, viewsCount) || + other.viewsCount == viewsCount) && (identical(other.author, author) || other.author == author)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, image, state, cookingTime, const DeepCollectionEquality().hash(_ingredients), description, - const DeepCollectionEquality().hash(_steps), videoUrl, createdAt, updatedAt, title, type, slug, commentsCount, likesCount, viewsCount, author); + int get hashCode => Object.hash( + runtimeType, + id, + image, + state, + cookingTime, + const DeepCollectionEquality().hash(_ingredients), + description, + const DeepCollectionEquality().hash(_steps), + videoUrl, + createdAt, + updatedAt, + title, + type, + slug, + commentsCount, + likesCount, + viewsCount, + author); /// Create a copy of Recipes /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => __$$RecipesImplCopyWithImpl<_$RecipesImpl>(this, _$identity); + _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => + __$$RecipesImplCopyWithImpl<_$RecipesImpl>(this, _$identity); @override Map toJson() { @@ -497,59 +512,43 @@ abstract class _Recipes implements Recipes { @override int get id; - @override String get image; - @override String get state; - @override @JsonKey(name: 'cooking_time') int get cookingTime; - @override List get ingredients; - @override String get description; - @override List get steps; - @override @JsonKey(name: 'video_url') String get videoUrl; - @override @JsonKey(name: 'created_at') DateTime get createdAt; - @override @JsonKey(name: 'updated_at') DateTime get updatedAt; - @override String get title; - @override String get type; - @override String get slug; - @override @JsonKey(name: 'total_comments') int get commentsCount; - @override @JsonKey(name: 'total_likes') int get likesCount; - @override @JsonKey(name: 'total_views') int get viewsCount; - @override Author get author; @@ -557,7 +556,8 @@ abstract class _Recipes implements Recipes { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => + throw _privateConstructorUsedError; } Ingredient _$IngredientFromJson(Map json) { @@ -567,9 +567,7 @@ Ingredient _$IngredientFromJson(Map json) { /// @nodoc mixin _$Ingredient { String get name => throw _privateConstructorUsedError; - String? get unit => throw _privateConstructorUsedError; - String get portion => throw _privateConstructorUsedError; /// Serializes this Ingredient to a JSON map. @@ -578,24 +576,26 @@ mixin _$Ingredient { /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $IngredientCopyWith get copyWith => throw _privateConstructorUsedError; + $IngredientCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $IngredientCopyWith<$Res> { - factory $IngredientCopyWith(Ingredient value, $Res Function(Ingredient) then) = _$IngredientCopyWithImpl<$Res, Ingredient>; - + factory $IngredientCopyWith( + Ingredient value, $Res Function(Ingredient) then) = + _$IngredientCopyWithImpl<$Res, Ingredient>; @useResult $Res call({String name, String? unit, String portion}); } /// @nodoc -class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $IngredientCopyWith<$Res> { +class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> + implements $IngredientCopyWith<$Res> { _$IngredientCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -626,17 +626,23 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $Ingred } /// @nodoc -abstract class _$$IngredientImplCopyWith<$Res> implements $IngredientCopyWith<$Res> { - factory _$$IngredientImplCopyWith(_$IngredientImpl value, $Res Function(_$IngredientImpl) then) = __$$IngredientImplCopyWithImpl<$Res>; - +abstract class _$$IngredientImplCopyWith<$Res> + implements $IngredientCopyWith<$Res> { + factory _$$IngredientImplCopyWith( + _$IngredientImpl value, $Res Function(_$IngredientImpl) then) = + __$$IngredientImplCopyWithImpl<$Res>; @override @useResult $Res call({String name, String? unit, String portion}); } /// @nodoc -class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> implements _$$IngredientImplCopyWith<$Res> { - __$$IngredientImplCopyWithImpl(_$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) : super(_value, _then); +class __$$IngredientImplCopyWithImpl<$Res> + extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> + implements _$$IngredientImplCopyWith<$Res> { + __$$IngredientImplCopyWithImpl( + _$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) + : super(_value, _then); /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @@ -667,9 +673,11 @@ class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$Res /// @nodoc @JsonSerializable() class _$IngredientImpl implements _Ingredient { - const _$IngredientImpl({required this.name, this.unit, required this.portion}); + const _$IngredientImpl( + {required this.name, this.unit, required this.portion}); - factory _$IngredientImpl.fromJson(Map json) => _$$IngredientImplFromJson(json); + factory _$IngredientImpl.fromJson(Map json) => + _$$IngredientImplFromJson(json); @override final String name; @@ -702,7 +710,8 @@ class _$IngredientImpl implements _Ingredient { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => + __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); @override Map toJson() { @@ -713,16 +722,18 @@ class _$IngredientImpl implements _Ingredient { } abstract class _Ingredient implements Ingredient { - const factory _Ingredient({required final String name, final String? unit, required final String portion}) = _$IngredientImpl; + const factory _Ingredient( + {required final String name, + final String? unit, + required final String portion}) = _$IngredientImpl; - factory _Ingredient.fromJson(Map json) = _$IngredientImpl.fromJson; + factory _Ingredient.fromJson(Map json) = + _$IngredientImpl.fromJson; @override String get name; - @override String? get unit; - @override String get portion; @@ -730,7 +741,8 @@ abstract class _Ingredient implements Ingredient { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError; + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => + throw _privateConstructorUsedError; } Step _$StepFromJson(Map json) { @@ -740,7 +752,6 @@ Step _$StepFromJson(Map json) { /// @nodoc mixin _$Step { String get image => throw _privateConstructorUsedError; - String get description => throw _privateConstructorUsedError; /// Serializes this Step to a JSON map. @@ -754,19 +765,19 @@ mixin _$Step { /// @nodoc abstract class $StepCopyWith<$Res> { - factory $StepCopyWith(Step value, $Res Function(Step) then) = _$StepCopyWithImpl<$Res, Step>; - + factory $StepCopyWith(Step value, $Res Function(Step) then) = + _$StepCopyWithImpl<$Res, Step>; @useResult $Res call({String image, String description}); } /// @nodoc -class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res> { +class _$StepCopyWithImpl<$Res, $Val extends Step> + implements $StepCopyWith<$Res> { _$StepCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -793,16 +804,20 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res> /// @nodoc abstract class _$$StepImplCopyWith<$Res> implements $StepCopyWith<$Res> { - factory _$$StepImplCopyWith(_$StepImpl value, $Res Function(_$StepImpl) then) = __$$StepImplCopyWithImpl<$Res>; - + factory _$$StepImplCopyWith( + _$StepImpl value, $Res Function(_$StepImpl) then) = + __$$StepImplCopyWithImpl<$Res>; @override @useResult $Res call({String image, String description}); } /// @nodoc -class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl> implements _$$StepImplCopyWith<$Res> { - __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) : super(_value, _then); +class __$$StepImplCopyWithImpl<$Res> + extends _$StepCopyWithImpl<$Res, _$StepImpl> + implements _$$StepImplCopyWith<$Res> { + __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) + : super(_value, _then); /// Create a copy of Step /// with the given fields replaced by the non-null parameter values. @@ -830,7 +845,8 @@ class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl class _$StepImpl implements _Step { const _$StepImpl({required this.image, required this.description}); - factory _$StepImpl.fromJson(Map json) => _$$StepImplFromJson(json); + factory _$StepImpl.fromJson(Map json) => + _$$StepImplFromJson(json); @override final String image; @@ -848,7 +864,8 @@ class _$StepImpl implements _Step { (other.runtimeType == runtimeType && other is _$StepImpl && (identical(other.image, image) || other.image == image) && - (identical(other.description, description) || other.description == description)); + (identical(other.description, description) || + other.description == description)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -860,7 +877,8 @@ class _$StepImpl implements _Step { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$StepImplCopyWith<_$StepImpl> get copyWith => __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); + _$$StepImplCopyWith<_$StepImpl> get copyWith => + __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); @override Map toJson() { @@ -871,13 +889,14 @@ class _$StepImpl implements _Step { } abstract class _Step implements Step { - const factory _Step({required final String image, required final String description}) = _$StepImpl; + const factory _Step( + {required final String image, + required final String description}) = _$StepImpl; factory _Step.fromJson(Map json) = _$StepImpl.fromJson; @override String get image; - @override String get description; @@ -885,5 +904,6 @@ abstract class _Step implements Step { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$StepImplCopyWith<_$StepImpl> get copyWith => throw _privateConstructorUsedError; + _$$StepImplCopyWith<_$StepImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/recipes_model.g.dart b/lib/features/feed/models/recipes_model.g.dart index 0f9e0a0d..7f8c0142 100644 --- a/lib/features/feed/models/recipes_model.g.dart +++ b/lib/features/feed/models/recipes_model.g.dart @@ -6,14 +6,19 @@ part of 'recipes_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipesImpl _$$RecipesImplFromJson(Map json) => _$RecipesImpl( +_$RecipesImpl _$$RecipesImplFromJson(Map json) => + _$RecipesImpl( id: (json['id'] as num).toInt(), image: json['image'] as String, state: json['state'] as String, cookingTime: (json['cooking_time'] as num).toInt(), - ingredients: (json['ingredients'] as List).map((e) => Ingredient.fromJson(e as Map)).toList(), + ingredients: (json['ingredients'] as List) + .map((e) => Ingredient.fromJson(e as Map)) + .toList(), description: json['description'] as String, - steps: (json['steps'] as List).map((e) => Step.fromJson(e as Map)).toList(), + steps: (json['steps'] as List) + .map((e) => Step.fromJson(e as Map)) + .toList(), videoUrl: json['video_url'] as String, createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), @@ -26,7 +31,8 @@ _$RecipesImpl _$$RecipesImplFromJson(Map json) => _$RecipesImpl author: Author.fromJson(json['author'] as Map), ); -Map _$$RecipesImplToJson(_$RecipesImpl instance) => { +Map _$$RecipesImplToJson(_$RecipesImpl instance) => + { 'id': instance.id, 'image': instance.image, 'state': instance.state, @@ -46,13 +52,15 @@ Map _$$RecipesImplToJson(_$RecipesImpl instance) => json) => _$IngredientImpl( +_$IngredientImpl _$$IngredientImplFromJson(Map json) => + _$IngredientImpl( name: json['name'] as String, unit: json['unit'] as String?, portion: json['portion'] as String, ); -Map _$$IngredientImplToJson(_$IngredientImpl instance) => { +Map _$$IngredientImplToJson(_$IngredientImpl instance) => + { 'name': instance.name, 'unit': instance.unit, 'portion': instance.portion, @@ -63,7 +71,8 @@ _$StepImpl _$$StepImplFromJson(Map json) => _$StepImpl( description: json['description'] as String, ); -Map _$$StepImplToJson(_$StepImpl instance) => { +Map _$$StepImplToJson(_$StepImpl instance) => + { 'image': instance.image, 'description': instance.description, }; diff --git a/lib/features/feed/models/recipes_pagination_model.freezed.dart b/lib/features/feed/models/recipes_pagination_model.freezed.dart index 8d95450d..ca8e9f92 100644 --- a/lib/features/feed/models/recipes_pagination_model.freezed.dart +++ b/lib/features/feed/models/recipes_pagination_model.freezed.dart @@ -29,24 +29,26 @@ mixin _$RecipesPagination { /// Create a copy of RecipesPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipesPaginationCopyWith get copyWith => throw _privateConstructorUsedError; + $RecipesPaginationCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipesPaginationCopyWith<$Res> { - factory $RecipesPaginationCopyWith(RecipesPagination value, $Res Function(RecipesPagination) then) = _$RecipesPaginationCopyWithImpl<$Res, RecipesPagination>; - + factory $RecipesPaginationCopyWith( + RecipesPagination value, $Res Function(RecipesPagination) then) = + _$RecipesPaginationCopyWithImpl<$Res, RecipesPagination>; @useResult $Res call({@JsonKey(name: 'data') List recipesList}); } /// @nodoc -class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> implements $RecipesPaginationCopyWith<$Res> { +class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> + implements $RecipesPaginationCopyWith<$Res> { _$RecipesPaginationCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -67,19 +69,23 @@ class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> impl } /// @nodoc -abstract class _$$RecipesPaginationImplCopyWith<$Res> implements $RecipesPaginationCopyWith<$Res> { - factory _$$RecipesPaginationImplCopyWith(_$RecipesPaginationImpl value, $Res Function(_$RecipesPaginationImpl) then) = +abstract class _$$RecipesPaginationImplCopyWith<$Res> + implements $RecipesPaginationCopyWith<$Res> { + factory _$$RecipesPaginationImplCopyWith(_$RecipesPaginationImpl value, + $Res Function(_$RecipesPaginationImpl) then) = __$$RecipesPaginationImplCopyWithImpl<$Res>; - @override @useResult $Res call({@JsonKey(name: 'data') List recipesList}); } /// @nodoc -class __$$RecipesPaginationImplCopyWithImpl<$Res> extends _$RecipesPaginationCopyWithImpl<$Res, _$RecipesPaginationImpl> +class __$$RecipesPaginationImplCopyWithImpl<$Res> + extends _$RecipesPaginationCopyWithImpl<$Res, _$RecipesPaginationImpl> implements _$$RecipesPaginationImplCopyWith<$Res> { - __$$RecipesPaginationImplCopyWithImpl(_$RecipesPaginationImpl _value, $Res Function(_$RecipesPaginationImpl) _then) : super(_value, _then); + __$$RecipesPaginationImplCopyWithImpl(_$RecipesPaginationImpl _value, + $Res Function(_$RecipesPaginationImpl) _then) + : super(_value, _then); /// Create a copy of RecipesPagination /// with the given fields replaced by the non-null parameter values. @@ -100,12 +106,14 @@ class __$$RecipesPaginationImplCopyWithImpl<$Res> extends _$RecipesPaginationCop /// @nodoc @JsonSerializable() class _$RecipesPaginationImpl implements _RecipesPagination { - const _$RecipesPaginationImpl({@JsonKey(name: 'data') required final List recipesList}) : _recipesList = recipesList; + const _$RecipesPaginationImpl( + {@JsonKey(name: 'data') required final List recipesList}) + : _recipesList = recipesList; - factory _$RecipesPaginationImpl.fromJson(Map json) => _$$RecipesPaginationImplFromJson(json); + factory _$RecipesPaginationImpl.fromJson(Map json) => + _$$RecipesPaginationImplFromJson(json); final List _recipesList; - @override @JsonKey(name: 'data') List get recipesList { @@ -122,19 +130,25 @@ class _$RecipesPaginationImpl implements _RecipesPagination { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$RecipesPaginationImpl && const DeepCollectionEquality().equals(other._recipesList, _recipesList)); + (other.runtimeType == runtimeType && + other is _$RecipesPaginationImpl && + const DeepCollectionEquality() + .equals(other._recipesList, _recipesList)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_recipesList)); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_recipesList)); /// Create a copy of RecipesPagination /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => __$$RecipesPaginationImplCopyWithImpl<_$RecipesPaginationImpl>(this, _$identity); + _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => + __$$RecipesPaginationImplCopyWithImpl<_$RecipesPaginationImpl>( + this, _$identity); @override Map toJson() { @@ -145,9 +159,12 @@ class _$RecipesPaginationImpl implements _RecipesPagination { } abstract class _RecipesPagination implements RecipesPagination { - const factory _RecipesPagination({@JsonKey(name: 'data') required final List recipesList}) = _$RecipesPaginationImpl; + const factory _RecipesPagination( + {@JsonKey(name: 'data') required final List recipesList}) = + _$RecipesPaginationImpl; - factory _RecipesPagination.fromJson(Map json) = _$RecipesPaginationImpl.fromJson; + factory _RecipesPagination.fromJson(Map json) = + _$RecipesPaginationImpl.fromJson; @override @JsonKey(name: 'data') @@ -157,5 +174,6 @@ abstract class _RecipesPagination implements RecipesPagination { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/recipes_pagination_model.g.dart b/lib/features/feed/models/recipes_pagination_model.g.dart index e14428fb..109f39d5 100644 --- a/lib/features/feed/models/recipes_pagination_model.g.dart +++ b/lib/features/feed/models/recipes_pagination_model.g.dart @@ -6,10 +6,16 @@ part of 'recipes_pagination_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipesPaginationImpl _$$RecipesPaginationImplFromJson(Map json) => _$RecipesPaginationImpl( - recipesList: (json['data'] as List).map((e) => Recipes.fromJson(e as Map)).toList(), +_$RecipesPaginationImpl _$$RecipesPaginationImplFromJson( + Map json) => + _$RecipesPaginationImpl( + recipesList: (json['data'] as List) + .map((e) => Recipes.fromJson(e as Map)) + .toList(), ); -Map _$$RecipesPaginationImplToJson(_$RecipesPaginationImpl instance) => { +Map _$$RecipesPaginationImplToJson( + _$RecipesPaginationImpl instance) => + { 'data': instance.recipesList, }; diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart index 41a00d05..dbfdaeb0 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart @@ -19,13 +19,13 @@ class CommentsCubit extends Cubit { try { switch (commentSourceType) { case CommentSourceType.blogPost: - emit(CommentsState.loaded(comment: await feedRepository.getBlogPostComments(id))); + emit(CommentsState.loaded(comment: await feedRepository.getBlogPostComments(id: id))); break; case CommentSourceType.diet: - emit(CommentsState.loaded(comment: await feedRepository.getDietsComments(id))); + emit(CommentsState.loaded(comment: await feedRepository.getDietsComments(id: id))); break; case CommentSourceType.recipe: - emit(CommentsState.loaded(comment: await feedRepository.getRecipesComments(id))); + emit(CommentsState.loaded(comment: await feedRepository.getRecipesComments(id: id))); break; } } catch (e) { diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart index caa93548..c3b582ce 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$CommentsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$CommentsState { /// @nodoc abstract class $CommentsStateCopyWith<$Res> { - factory $CommentsStateCopyWith(CommentsState value, $Res Function(CommentsState) then) = _$CommentsStateCopyWithImpl<$Res, CommentsState>; + factory $CommentsStateCopyWith( + CommentsState value, $Res Function(CommentsState) then) = + _$CommentsStateCopyWithImpl<$Res, CommentsState>; } /// @nodoc -class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> implements $CommentsStateCopyWith<$Res> { +class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> + implements $CommentsStateCopyWith<$Res> { _$CommentsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +91,18 @@ class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> implements $ /// @nodoc abstract class _$$CommentsStateImplCopyWith<$Res> { - factory _$$CommentsStateImplCopyWith(_$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) = __$$CommentsStateImplCopyWithImpl<$Res>; + factory _$$CommentsStateImplCopyWith( + _$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) = + __$$CommentsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CommentsStateImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl> implements _$$CommentsStateImplCopyWith<$Res> { - __$$CommentsStateImplCopyWithImpl(_$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) : super(_value, _then); +class __$$CommentsStateImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl> + implements _$$CommentsStateImplCopyWith<$Res> { + __$$CommentsStateImplCopyWithImpl( + _$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +120,8 @@ class _$CommentsStateImpl implements _CommentsState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$CommentsStateImpl); } @override @@ -200,14 +208,18 @@ abstract class _CommentsState implements CommentsState { /// @nodoc abstract class _$$CommentsStateLoadingImplCopyWith<$Res> { - factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value, $Res Function(_$CommentsStateLoadingImpl) then) = + factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value, + $Res Function(_$CommentsStateLoadingImpl) then) = __$$CommentsStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CommentsStateLoadingImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl> +class __$$CommentsStateLoadingImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl> implements _$$CommentsStateLoadingImplCopyWith<$Res> { - __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, $Res Function(_$CommentsStateLoadingImpl) _then) : super(_value, _then); + __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, + $Res Function(_$CommentsStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +237,9 @@ class _$CommentsStateLoadingImpl implements CommentsStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$CommentsStateLoadingImpl); } @override @@ -312,9 +326,9 @@ abstract class CommentsStateLoading implements CommentsState { /// @nodoc abstract class _$$CommentsStateLoadedImplCopyWith<$Res> { - factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value, $Res Function(_$CommentsStateLoadedImpl) then) = + factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value, + $Res Function(_$CommentsStateLoadedImpl) then) = __$$CommentsStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({CommentModel comment, int? replyId}); @@ -322,9 +336,12 @@ abstract class _$$CommentsStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$CommentsStateLoadedImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl> +class __$$CommentsStateLoadedImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl> implements _$$CommentsStateLoadedImplCopyWith<$Res> { - __$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value, $Res Function(_$CommentsStateLoadedImpl) _then) : super(_value, _then); + __$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value, + $Res Function(_$CommentsStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -390,7 +407,8 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { @override @pragma('vm:prefer-inline') _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => - __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>(this, _$identity); + __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -468,31 +486,36 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { } abstract class CommentsStateLoaded implements CommentsState { - const factory CommentsStateLoaded({required final CommentModel comment, final int? replyId}) = _$CommentsStateLoadedImpl; + const factory CommentsStateLoaded( + {required final CommentModel comment, + final int? replyId}) = _$CommentsStateLoadedImpl; CommentModel get comment; - int? get replyId; /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$CommentsStateErrorImplCopyWith<$Res> { - factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value, $Res Function(_$CommentsStateErrorImpl) then) = + factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value, + $Res Function(_$CommentsStateErrorImpl) then) = __$$CommentsStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$CommentsStateErrorImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl> +class __$$CommentsStateErrorImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl> implements _$$CommentsStateErrorImplCopyWith<$Res> { - __$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value, $Res Function(_$CommentsStateErrorImpl) _then) : super(_value, _then); + __$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value, + $Res Function(_$CommentsStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -528,7 +551,8 @@ class _$CommentsStateErrorImpl implements CommentsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -540,7 +564,8 @@ class _$CommentsStateErrorImpl implements CommentsStateError { @override @pragma('vm:prefer-inline') _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => - __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>(this, _$identity); + __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -618,12 +643,14 @@ class _$CommentsStateErrorImpl implements CommentsStateError { } abstract class CommentsStateError implements CommentsState { - const factory CommentsStateError({required final String errorMessage}) = _$CommentsStateErrorImpl; + const factory CommentsStateError({required final String errorMessage}) = + _$CommentsStateErrorImpl; String get errorMessage; /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart b/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart index e1797ea0..dd30f73d 100644 --- a/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$DietsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$DietsState { /// @nodoc abstract class $DietsStateCopyWith<$Res> { - factory $DietsStateCopyWith(DietsState value, $Res Function(DietsState) then) = _$DietsStateCopyWithImpl<$Res, DietsState>; + factory $DietsStateCopyWith( + DietsState value, $Res Function(DietsState) then) = + _$DietsStateCopyWithImpl<$Res, DietsState>; } /// @nodoc -class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> implements $DietsStateCopyWith<$Res> { +class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> + implements $DietsStateCopyWith<$Res> { _$DietsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +91,18 @@ class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> implements $DietsS /// @nodoc abstract class _$$DietsStateImplCopyWith<$Res> { - factory _$$DietsStateImplCopyWith(_$DietsStateImpl value, $Res Function(_$DietsStateImpl) then) = __$$DietsStateImplCopyWithImpl<$Res>; + factory _$$DietsStateImplCopyWith( + _$DietsStateImpl value, $Res Function(_$DietsStateImpl) then) = + __$$DietsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$DietsStateImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateImpl> implements _$$DietsStateImplCopyWith<$Res> { - __$$DietsStateImplCopyWithImpl(_$DietsStateImpl _value, $Res Function(_$DietsStateImpl) _then) : super(_value, _then); +class __$$DietsStateImplCopyWithImpl<$Res> + extends _$DietsStateCopyWithImpl<$Res, _$DietsStateImpl> + implements _$$DietsStateImplCopyWith<$Res> { + __$$DietsStateImplCopyWithImpl( + _$DietsStateImpl _value, $Res Function(_$DietsStateImpl) _then) + : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +120,8 @@ class _$DietsStateImpl implements _DietsState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$DietsStateImpl); } @override @@ -200,14 +208,18 @@ abstract class _DietsState implements DietsState { /// @nodoc abstract class _$$DietsStateLoadingImplCopyWith<$Res> { - factory _$$DietsStateLoadingImplCopyWith(_$DietsStateLoadingImpl value, $Res Function(_$DietsStateLoadingImpl) then) = + factory _$$DietsStateLoadingImplCopyWith(_$DietsStateLoadingImpl value, + $Res Function(_$DietsStateLoadingImpl) then) = __$$DietsStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$DietsStateLoadingImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadingImpl> +class __$$DietsStateLoadingImplCopyWithImpl<$Res> + extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadingImpl> implements _$$DietsStateLoadingImplCopyWith<$Res> { - __$$DietsStateLoadingImplCopyWithImpl(_$DietsStateLoadingImpl _value, $Res Function(_$DietsStateLoadingImpl) _then) : super(_value, _then); + __$$DietsStateLoadingImplCopyWithImpl(_$DietsStateLoadingImpl _value, + $Res Function(_$DietsStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +237,8 @@ class _$DietsStateLoadingImpl implements DietsStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$DietsStateLoadingImpl); } @override @@ -312,9 +325,9 @@ abstract class DietsStateLoading implements DietsState { /// @nodoc abstract class _$$DietsStateLoadedImplCopyWith<$Res> { - factory _$$DietsStateLoadedImplCopyWith(_$DietsStateLoadedImpl value, $Res Function(_$DietsStateLoadedImpl) then) = + factory _$$DietsStateLoadedImplCopyWith(_$DietsStateLoadedImpl value, + $Res Function(_$DietsStateLoadedImpl) then) = __$$DietsStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({DietsPagination diets}); @@ -322,9 +335,12 @@ abstract class _$$DietsStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$DietsStateLoadedImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadedImpl> +class __$$DietsStateLoadedImplCopyWithImpl<$Res> + extends _$DietsStateCopyWithImpl<$Res, _$DietsStateLoadedImpl> implements _$$DietsStateLoadedImplCopyWith<$Res> { - __$$DietsStateLoadedImplCopyWithImpl(_$DietsStateLoadedImpl _value, $Res Function(_$DietsStateLoadedImpl) _then) : super(_value, _then); + __$$DietsStateLoadedImplCopyWithImpl(_$DietsStateLoadedImpl _value, + $Res Function(_$DietsStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -368,7 +384,9 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$DietsStateLoadedImpl && (identical(other.diets, diets) || other.diets == diets)); + (other.runtimeType == runtimeType && + other is _$DietsStateLoadedImpl && + (identical(other.diets, diets) || other.diets == diets)); } @override @@ -379,7 +397,9 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => __$$DietsStateLoadedImplCopyWithImpl<_$DietsStateLoadedImpl>(this, _$identity); + _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => + __$$DietsStateLoadedImplCopyWithImpl<_$DietsStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -457,27 +477,34 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { } abstract class DietsStateLoaded implements DietsState { - const factory DietsStateLoaded({required final DietsPagination diets}) = _$DietsStateLoadedImpl; + const factory DietsStateLoaded({required final DietsPagination diets}) = + _$DietsStateLoadedImpl; DietsPagination get diets; /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$DietsStateErrorImplCopyWith<$Res> { - factory _$$DietsStateErrorImplCopyWith(_$DietsStateErrorImpl value, $Res Function(_$DietsStateErrorImpl) then) = __$$DietsStateErrorImplCopyWithImpl<$Res>; - + factory _$$DietsStateErrorImplCopyWith(_$DietsStateErrorImpl value, + $Res Function(_$DietsStateErrorImpl) then) = + __$$DietsStateErrorImplCopyWithImpl<$Res>; @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$DietsStateErrorImplCopyWithImpl<$Res> extends _$DietsStateCopyWithImpl<$Res, _$DietsStateErrorImpl> implements _$$DietsStateErrorImplCopyWith<$Res> { - __$$DietsStateErrorImplCopyWithImpl(_$DietsStateErrorImpl _value, $Res Function(_$DietsStateErrorImpl) _then) : super(_value, _then); +class __$$DietsStateErrorImplCopyWithImpl<$Res> + extends _$DietsStateCopyWithImpl<$Res, _$DietsStateErrorImpl> + implements _$$DietsStateErrorImplCopyWith<$Res> { + __$$DietsStateErrorImplCopyWithImpl( + _$DietsStateErrorImpl _value, $Res Function(_$DietsStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @@ -513,7 +540,8 @@ class _$DietsStateErrorImpl implements DietsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DietsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -524,7 +552,9 @@ class _$DietsStateErrorImpl implements DietsStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => __$$DietsStateErrorImplCopyWithImpl<_$DietsStateErrorImpl>(this, _$identity); + _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => + __$$DietsStateErrorImplCopyWithImpl<_$DietsStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -602,12 +632,14 @@ class _$DietsStateErrorImpl implements DietsStateError { } abstract class DietsStateError implements DietsState { - const factory DietsStateError({required final String errorMessage}) = _$DietsStateErrorImpl; + const factory DietsStateError({required final String errorMessage}) = + _$DietsStateErrorImpl; String get errorMessage; /// Create a copy of DietsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart b/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart index 11cbd4e2..83df5eb0 100644 --- a/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart +++ b/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart @@ -7,12 +7,16 @@ class FeedCubit extends Cubit { int currentPage = 1; late int lastPage; bool isLoading = false; + String? _query; FeedCubit({required this.feedRepository}) : super(const FeedState.loading()); - loadFeedBlogPostList() async { + loadFeedBlogPostList({ + String? query, + }) async { try { - final feedBlogPosts = await feedRepository.getFeedBlogPosts(); + _query = query; + final feedBlogPosts = await feedRepository.getFeedBlogPosts(query: query); lastPage = feedBlogPosts.meta.lastPage; emit( FeedState.loaded( @@ -34,7 +38,10 @@ class FeedCubit extends Cubit { try { if (currentPage < lastPage) { currentPage++; - final feedBlogPosts = await feedRepository.getFeedBlogPosts(page: currentPage); + final feedBlogPosts = await feedRepository.getFeedBlogPosts( + page: currentPage, + query: _query, + ); isLoading = false; emit( FeedState.loaded( @@ -52,7 +59,7 @@ class FeedCubit extends Cubit { } } - likePost(int id) async => await feedRepository.likeBlogPost(id); + likePost(int id) async => await feedRepository.likeBlogPost(id: id); - unlikedPost(int id) async => await feedRepository.unlikedBlogPost(id); + unlikedPost(int id) async => await feedRepository.unlikedBlogPost(id: id); } diff --git a/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart b/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart index 377ed8d7..70cb30d4 100644 --- a/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart @@ -20,16 +20,18 @@ mixin _$FeedState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List feedBlogPostList, bool isLoading) loaded, + required TResult Function( + List feedBlogPostList, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +39,8 @@ mixin _$FeedState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? loaded, + TResult Function(List feedBlogPostList, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,16 +74,17 @@ mixin _$FeedState { /// @nodoc abstract class $FeedStateCopyWith<$Res> { - factory $FeedStateCopyWith(FeedState value, $Res Function(FeedState) then) = _$FeedStateCopyWithImpl<$Res, FeedState>; + factory $FeedStateCopyWith(FeedState value, $Res Function(FeedState) then) = + _$FeedStateCopyWithImpl<$Res, FeedState>; } /// @nodoc -class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> implements $FeedStateCopyWith<$Res> { +class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> + implements $FeedStateCopyWith<$Res> { _$FeedStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +94,18 @@ class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> implements $FeedStat /// @nodoc abstract class _$$FeedStateImplCopyWith<$Res> { - factory _$$FeedStateImplCopyWith(_$FeedStateImpl value, $Res Function(_$FeedStateImpl) then) = __$$FeedStateImplCopyWithImpl<$Res>; + factory _$$FeedStateImplCopyWith( + _$FeedStateImpl value, $Res Function(_$FeedStateImpl) then) = + __$$FeedStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$FeedStateImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateImpl> implements _$$FeedStateImplCopyWith<$Res> { - __$$FeedStateImplCopyWithImpl(_$FeedStateImpl _value, $Res Function(_$FeedStateImpl) _then) : super(_value, _then); +class __$$FeedStateImplCopyWithImpl<$Res> + extends _$FeedStateCopyWithImpl<$Res, _$FeedStateImpl> + implements _$$FeedStateImplCopyWith<$Res> { + __$$FeedStateImplCopyWithImpl( + _$FeedStateImpl _value, $Res Function(_$FeedStateImpl) _then) + : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +123,8 @@ class _$FeedStateImpl implements _FeedState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$FeedStateImpl); } @override @@ -124,7 +135,9 @@ class _$FeedStateImpl implements _FeedState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List feedBlogPostList, bool isLoading) loaded, + required TResult Function( + List feedBlogPostList, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -135,7 +148,8 @@ class _$FeedStateImpl implements _FeedState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -146,7 +160,8 @@ class _$FeedStateImpl implements _FeedState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? loaded, + TResult Function(List feedBlogPostList, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -200,14 +215,18 @@ abstract class _FeedState implements FeedState { /// @nodoc abstract class _$$FeedStateLoadingImplCopyWith<$Res> { - factory _$$FeedStateLoadingImplCopyWith(_$FeedStateLoadingImpl value, $Res Function(_$FeedStateLoadingImpl) then) = + factory _$$FeedStateLoadingImplCopyWith(_$FeedStateLoadingImpl value, + $Res Function(_$FeedStateLoadingImpl) then) = __$$FeedStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$FeedStateLoadingImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadingImpl> +class __$$FeedStateLoadingImplCopyWithImpl<$Res> + extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadingImpl> implements _$$FeedStateLoadingImplCopyWith<$Res> { - __$$FeedStateLoadingImplCopyWithImpl(_$FeedStateLoadingImpl _value, $Res Function(_$FeedStateLoadingImpl) _then) : super(_value, _then); + __$$FeedStateLoadingImplCopyWithImpl(_$FeedStateLoadingImpl _value, + $Res Function(_$FeedStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +244,8 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$FeedStateLoadingImpl); } @override @@ -236,7 +256,9 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List feedBlogPostList, bool isLoading) loaded, + required TResult Function( + List feedBlogPostList, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -247,7 +269,8 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -258,7 +281,8 @@ class _$FeedStateLoadingImpl implements FeedStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? loaded, + TResult Function(List feedBlogPostList, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -312,15 +336,20 @@ abstract class FeedStateLoading implements FeedState { /// @nodoc abstract class _$$FeedStateLoadedImplCopyWith<$Res> { - factory _$$FeedStateLoadedImplCopyWith(_$FeedStateLoadedImpl value, $Res Function(_$FeedStateLoadedImpl) then) = __$$FeedStateLoadedImplCopyWithImpl<$Res>; - + factory _$$FeedStateLoadedImplCopyWith(_$FeedStateLoadedImpl value, + $Res Function(_$FeedStateLoadedImpl) then) = + __$$FeedStateLoadedImplCopyWithImpl<$Res>; @useResult $Res call({List feedBlogPostList, bool isLoading}); } /// @nodoc -class __$$FeedStateLoadedImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadedImpl> implements _$$FeedStateLoadedImplCopyWith<$Res> { - __$$FeedStateLoadedImplCopyWithImpl(_$FeedStateLoadedImpl _value, $Res Function(_$FeedStateLoadedImpl) _then) : super(_value, _then); +class __$$FeedStateLoadedImplCopyWithImpl<$Res> + extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadedImpl> + implements _$$FeedStateLoadedImplCopyWith<$Res> { + __$$FeedStateLoadedImplCopyWithImpl( + _$FeedStateLoadedImpl _value, $Res Function(_$FeedStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -346,13 +375,16 @@ class __$$FeedStateLoadedImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl< /// @nodoc class _$FeedStateLoadedImpl implements FeedStateLoaded { - const _$FeedStateLoadedImpl({required final List feedBlogPostList, required this.isLoading}) : _feedBlogPostList = feedBlogPostList; + const _$FeedStateLoadedImpl( + {required final List feedBlogPostList, + required this.isLoading}) + : _feedBlogPostList = feedBlogPostList; final List _feedBlogPostList; - @override List get feedBlogPostList { - if (_feedBlogPostList is EqualUnmodifiableListView) return _feedBlogPostList; + if (_feedBlogPostList is EqualUnmodifiableListView) + return _feedBlogPostList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_feedBlogPostList); } @@ -370,26 +402,33 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateLoadedImpl && - const DeepCollectionEquality().equals(other._feedBlogPostList, _feedBlogPostList) && - (identical(other.isLoading, isLoading) || other.isLoading == isLoading)); + const DeepCollectionEquality() + .equals(other._feedBlogPostList, _feedBlogPostList) && + (identical(other.isLoading, isLoading) || + other.isLoading == isLoading)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList), isLoading); + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_feedBlogPostList), isLoading); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => __$$FeedStateLoadedImplCopyWithImpl<_$FeedStateLoadedImpl>(this, _$identity); + _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => + __$$FeedStateLoadedImplCopyWithImpl<_$FeedStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List feedBlogPostList, bool isLoading) loaded, + required TResult Function( + List feedBlogPostList, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loaded(feedBlogPostList, isLoading); @@ -400,7 +439,8 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(feedBlogPostList, isLoading); @@ -411,7 +451,8 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? loaded, + TResult Function(List feedBlogPostList, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -460,29 +501,36 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { } abstract class FeedStateLoaded implements FeedState { - const factory FeedStateLoaded({required final List feedBlogPostList, required final bool isLoading}) = _$FeedStateLoadedImpl; + const factory FeedStateLoaded( + {required final List feedBlogPostList, + required final bool isLoading}) = _$FeedStateLoadedImpl; List get feedBlogPostList; - bool get isLoading; /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$FeedStateErrorImplCopyWith<$Res> { - factory _$$FeedStateErrorImplCopyWith(_$FeedStateErrorImpl value, $Res Function(_$FeedStateErrorImpl) then) = __$$FeedStateErrorImplCopyWithImpl<$Res>; - + factory _$$FeedStateErrorImplCopyWith(_$FeedStateErrorImpl value, + $Res Function(_$FeedStateErrorImpl) then) = + __$$FeedStateErrorImplCopyWithImpl<$Res>; @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$FeedStateErrorImplCopyWithImpl<$Res> extends _$FeedStateCopyWithImpl<$Res, _$FeedStateErrorImpl> implements _$$FeedStateErrorImplCopyWith<$Res> { - __$$FeedStateErrorImplCopyWithImpl(_$FeedStateErrorImpl _value, $Res Function(_$FeedStateErrorImpl) _then) : super(_value, _then); +class __$$FeedStateErrorImplCopyWithImpl<$Res> + extends _$FeedStateCopyWithImpl<$Res, _$FeedStateErrorImpl> + implements _$$FeedStateErrorImplCopyWith<$Res> { + __$$FeedStateErrorImplCopyWithImpl( + _$FeedStateErrorImpl _value, $Res Function(_$FeedStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @@ -518,7 +566,8 @@ class _$FeedStateErrorImpl implements FeedStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$FeedStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -529,14 +578,18 @@ class _$FeedStateErrorImpl implements FeedStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => __$$FeedStateErrorImplCopyWithImpl<_$FeedStateErrorImpl>(this, _$identity); + _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => + __$$FeedStateErrorImplCopyWithImpl<_$FeedStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List feedBlogPostList, bool isLoading) loaded, + required TResult Function( + List feedBlogPostList, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -547,7 +600,8 @@ class _$FeedStateErrorImpl implements FeedStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List feedBlogPostList, bool isLoading)? loaded, + TResult? Function(List feedBlogPostList, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -558,7 +612,8 @@ class _$FeedStateErrorImpl implements FeedStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List feedBlogPostList, bool isLoading)? loaded, + TResult Function(List feedBlogPostList, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -607,12 +662,14 @@ class _$FeedStateErrorImpl implements FeedStateError { } abstract class FeedStateError implements FeedState { - const factory FeedStateError({required final String errorMessage}) = _$FeedStateErrorImpl; + const factory FeedStateError({required final String errorMessage}) = + _$FeedStateErrorImpl; String get errorMessage; /// Create a copy of FeedState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart index 93bcf399..621880fe 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart @@ -13,11 +13,6 @@ class RecipesCubit extends Cubit { bool isLoading = false; String? _query; - RecipesCubit({ - required this.feedRepository, - required this.recipeRepository, - }) : super(const RecipesState.loading()); - loadRecipesList({ String? query, }) async { @@ -40,6 +35,11 @@ class RecipesCubit extends Cubit { } } + RecipesCubit({ + required this.feedRepository, + required this.recipeRepository, + }) : super(const RecipesState.loading()); + loadNextPage() async { if (currentPage < lastPage && !isLoading) { isLoading = true; diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart index 3b29fac8..34100adb 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart @@ -20,16 +20,23 @@ mixin _$RecipesState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +44,9 @@ mixin _$RecipesState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,16 +80,18 @@ mixin _$RecipesState { /// @nodoc abstract class $RecipesStateCopyWith<$Res> { - factory $RecipesStateCopyWith(RecipesState value, $Res Function(RecipesState) then) = _$RecipesStateCopyWithImpl<$Res, RecipesState>; + factory $RecipesStateCopyWith( + RecipesState value, $Res Function(RecipesState) then) = + _$RecipesStateCopyWithImpl<$Res, RecipesState>; } /// @nodoc -class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> implements $RecipesStateCopyWith<$Res> { +class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> + implements $RecipesStateCopyWith<$Res> { _$RecipesStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +101,18 @@ class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> implements $Re /// @nodoc abstract class _$$RecipesStateImplCopyWith<$Res> { - factory _$$RecipesStateImplCopyWith(_$RecipesStateImpl value, $Res Function(_$RecipesStateImpl) then) = __$$RecipesStateImplCopyWithImpl<$Res>; + factory _$$RecipesStateImplCopyWith( + _$RecipesStateImpl value, $Res Function(_$RecipesStateImpl) then) = + __$$RecipesStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipesStateImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateImpl> implements _$$RecipesStateImplCopyWith<$Res> { - __$$RecipesStateImplCopyWithImpl(_$RecipesStateImpl _value, $Res Function(_$RecipesStateImpl) _then) : super(_value, _then); +class __$$RecipesStateImplCopyWithImpl<$Res> + extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateImpl> + implements _$$RecipesStateImplCopyWith<$Res> { + __$$RecipesStateImplCopyWithImpl( + _$RecipesStateImpl _value, $Res Function(_$RecipesStateImpl) _then) + : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +130,8 @@ class _$RecipesStateImpl implements _RecipesState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$RecipesStateImpl); } @override @@ -124,7 +142,13 @@ class _$RecipesStateImpl implements _RecipesState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -135,7 +159,9 @@ class _$RecipesStateImpl implements _RecipesState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -146,7 +172,9 @@ class _$RecipesStateImpl implements _RecipesState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -200,14 +228,18 @@ abstract class _RecipesState implements RecipesState { /// @nodoc abstract class _$$RecipesStateLoadingImplCopyWith<$Res> { - factory _$$RecipesStateLoadingImplCopyWith(_$RecipesStateLoadingImpl value, $Res Function(_$RecipesStateLoadingImpl) then) = + factory _$$RecipesStateLoadingImplCopyWith(_$RecipesStateLoadingImpl value, + $Res Function(_$RecipesStateLoadingImpl) then) = __$$RecipesStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipesStateLoadingImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadingImpl> +class __$$RecipesStateLoadingImplCopyWithImpl<$Res> + extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadingImpl> implements _$$RecipesStateLoadingImplCopyWith<$Res> { - __$$RecipesStateLoadingImplCopyWithImpl(_$RecipesStateLoadingImpl _value, $Res Function(_$RecipesStateLoadingImpl) _then) : super(_value, _then); + __$$RecipesStateLoadingImplCopyWithImpl(_$RecipesStateLoadingImpl _value, + $Res Function(_$RecipesStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +257,9 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$RecipesStateLoadingImpl); } @override @@ -236,7 +270,13 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -247,7 +287,9 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -258,7 +300,9 @@ class _$RecipesStateLoadingImpl implements RecipesStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -312,17 +356,25 @@ abstract class RecipesStateLoading implements RecipesState { /// @nodoc abstract class _$$RecipesStateLoadedImplCopyWith<$Res> { - factory _$$RecipesStateLoadedImplCopyWith(_$RecipesStateLoadedImpl value, $Res Function(_$RecipesStateLoadedImpl) then) = + factory _$$RecipesStateLoadedImplCopyWith(_$RecipesStateLoadedImpl value, + $Res Function(_$RecipesStateLoadedImpl) then) = __$$RecipesStateLoadedImplCopyWithImpl<$Res>; - @useResult - $Res call({List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading}); + $Res call( + {List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading}); } /// @nodoc -class __$$RecipesStateLoadedImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadedImpl> +class __$$RecipesStateLoadedImplCopyWithImpl<$Res> + extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateLoadedImpl> implements _$$RecipesStateLoadedImplCopyWith<$Res> { - __$$RecipesStateLoadedImplCopyWithImpl(_$RecipesStateLoadedImpl _value, $Res Function(_$RecipesStateLoadedImpl) _then) : super(_value, _then); + __$$RecipesStateLoadedImplCopyWithImpl(_$RecipesStateLoadedImpl _value, + $Res Function(_$RecipesStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -374,7 +426,6 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { _selectedTags = selectedTags; final List _recipesList; - @override List get recipesList { if (_recipesList is EqualUnmodifiableListView) return _recipesList; @@ -383,7 +434,6 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { } final List _recipesTags; - @override List get recipesTags { if (_recipesTags is EqualUnmodifiableListView) return _recipesTags; @@ -392,7 +442,6 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { } final Set _selectedTags; - @override Set get selectedTags { if (_selectedTags is EqualUnmodifiableSetView) return _selectedTags; @@ -415,16 +464,26 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateLoadedImpl && - const DeepCollectionEquality().equals(other._recipesList, _recipesList) && - const DeepCollectionEquality().equals(other._recipesTags, _recipesTags) && - const DeepCollectionEquality().equals(other._selectedTags, _selectedTags) && - (identical(other.selectedTagsCounter, selectedTagsCounter) || other.selectedTagsCounter == selectedTagsCounter) && - (identical(other.isLoading, isLoading) || other.isLoading == isLoading)); + const DeepCollectionEquality() + .equals(other._recipesList, _recipesList) && + const DeepCollectionEquality() + .equals(other._recipesTags, _recipesTags) && + const DeepCollectionEquality() + .equals(other._selectedTags, _selectedTags) && + (identical(other.selectedTagsCounter, selectedTagsCounter) || + other.selectedTagsCounter == selectedTagsCounter) && + (identical(other.isLoading, isLoading) || + other.isLoading == isLoading)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_recipesList), const DeepCollectionEquality().hash(_recipesTags), - const DeepCollectionEquality().hash(_selectedTags), selectedTagsCounter, isLoading); + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(_recipesList), + const DeepCollectionEquality().hash(_recipesTags), + const DeepCollectionEquality().hash(_selectedTags), + selectedTagsCounter, + isLoading); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -432,17 +491,25 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { @override @pragma('vm:prefer-inline') _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => - __$$RecipesStateLoadedImplCopyWithImpl<_$RecipesStateLoadedImpl>(this, _$identity); + __$$RecipesStateLoadedImplCopyWithImpl<_$RecipesStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { - return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); + return loaded( + recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); } @override @@ -450,10 +517,13 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { - return loaded?.call(recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); + return loaded?.call( + recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); } @override @@ -461,12 +531,15 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { if (loaded != null) { - return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter, isLoading); + return loaded(recipesList, recipesTags, selectedTags, selectedTagsCounter, + isLoading); } return orElse(); } @@ -518,34 +591,34 @@ abstract class RecipesStateLoaded implements RecipesState { required final bool isLoading}) = _$RecipesStateLoadedImpl; List get recipesList; - List get recipesTags; - Set get selectedTags; - int get selectedTagsCounter; - bool get isLoading; /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$RecipesStateErrorImplCopyWith<$Res> { - factory _$$RecipesStateErrorImplCopyWith(_$RecipesStateErrorImpl value, $Res Function(_$RecipesStateErrorImpl) then) = + factory _$$RecipesStateErrorImplCopyWith(_$RecipesStateErrorImpl value, + $Res Function(_$RecipesStateErrorImpl) then) = __$$RecipesStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$RecipesStateErrorImplCopyWithImpl<$Res> extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateErrorImpl> +class __$$RecipesStateErrorImplCopyWithImpl<$Res> + extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateErrorImpl> implements _$$RecipesStateErrorImplCopyWith<$Res> { - __$$RecipesStateErrorImplCopyWithImpl(_$RecipesStateErrorImpl _value, $Res Function(_$RecipesStateErrorImpl) _then) : super(_value, _then); + __$$RecipesStateErrorImplCopyWithImpl(_$RecipesStateErrorImpl _value, + $Res Function(_$RecipesStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @@ -581,7 +654,8 @@ class _$RecipesStateErrorImpl implements RecipesStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipesStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -592,14 +666,22 @@ class _$RecipesStateErrorImpl implements RecipesStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => __$$RecipesStateErrorImplCopyWithImpl<_$RecipesStateErrorImpl>(this, _$identity); + _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => + __$$RecipesStateErrorImplCopyWithImpl<_$RecipesStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading) loaded, + required TResult Function( + List recipesList, + List recipesTags, + Set selectedTags, + int selectedTagsCounter, + bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -610,7 +692,9 @@ class _$RecipesStateErrorImpl implements RecipesStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult? Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -621,7 +705,9 @@ class _$RecipesStateErrorImpl implements RecipesStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(List recipesList, List recipesTags, Set selectedTags, int selectedTagsCounter, bool isLoading)? loaded, + TResult Function(List recipesList, List recipesTags, + Set selectedTags, int selectedTagsCounter, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -670,12 +756,14 @@ class _$RecipesStateErrorImpl implements RecipesStateError { } abstract class RecipesStateError implements RecipesState { - const factory RecipesStateError({required final String errorMessage}) = _$RecipesStateErrorImpl; + const factory RecipesStateError({required final String errorMessage}) = + _$RecipesStateErrorImpl; String get errorMessage; /// Create a copy of RecipesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/pages/feed_screen.dart b/lib/features/feed/presentation/pages/feed_screen.dart index 02691888..e74a9cf3 100644 --- a/lib/features/feed/presentation/pages/feed_screen.dart +++ b/lib/features/feed/presentation/pages/feed_screen.dart @@ -87,22 +87,11 @@ class _FeedScreenState extends State { await showModalBottomSheet( useRootNavigator: true, context: context, - builder: (context) { - return BlocBuilder( - builder: (BuildContext context, RecipesState state) { - if (state is RecipesStateLoaded) { - return TagsModalWidget( - tagsList: state.recipesTags, - selectedTags: state.selectedTags, - ); - } else { - return Container(); - } - }, - ); - }, + builder: (context) => TagsModalWidget( + recipesCubit: recipesCubit, + ), ); - context.read().loadRecipesList(); + recipesCubit.loadRecipesList(); }, ) : null, @@ -402,8 +391,11 @@ class _FeedScreenState extends State { Duration(milliseconds: 500), () { switch (_selectedChipIndex) { + case 0: + feedCubit.loadFeedBlogPostList(query: query); + break; case 1: - context.read().loadRecipesList(query: query); + recipesCubit.loadRecipesList(query: query); break; } }, @@ -414,8 +406,12 @@ class _FeedScreenState extends State { Duration(milliseconds: 500), () { switch (_selectedChipIndex) { + case 0: + feedCubit.loadFeedBlogPostList(); + break; case 1: - context.read().loadRecipesList(query: query); + recipesCubit.loadRecipesList(); + break; } }, ); diff --git a/lib/features/feed/presentation/widgets/blog_post_widget.dart b/lib/features/feed/presentation/widgets/blog_post_widget.dart index b3b6024c..781024cb 100644 --- a/lib/features/feed/presentation/widgets/blog_post_widget.dart +++ b/lib/features/feed/presentation/widgets/blog_post_widget.dart @@ -105,7 +105,9 @@ class _BlogPostWidgetState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 4), child: Html( - data: widget.feedBlogPostModel.description, + data: widget.feedBlogPostModel.description.length > 200 + ? widget.feedBlogPostModel.description.substring(0, 200) + : widget.feedBlogPostModel.description, style: { "*": Style( color: Colors.black87, @@ -113,6 +115,18 @@ class _BlogPostWidgetState extends State { }, ), ), + if (widget.feedBlogPostModel.description.length > 200) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Text( + 'Читать полностью...', + style: TextStyle( + height: 1, + color: appTheme.blueA400, + decoration: TextDecoration.underline, + ), + ), + ), if (widget.feedBlogPostModel.title.isNotEmpty || widget.feedBlogPostModel.description.isNotEmpty) SizedBox(height: 8), GestureDetector( onTap: () { diff --git a/lib/features/feed/presentation/widgets/diets_widget.dart b/lib/features/feed/presentation/widgets/diets_widget.dart index 038e1c73..ce8a9e15 100644 --- a/lib/features/feed/presentation/widgets/diets_widget.dart +++ b/lib/features/feed/presentation/widgets/diets_widget.dart @@ -1,6 +1,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; @@ -124,17 +125,30 @@ class _DietsWidgetState extends State { ), ), ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 4), - child: Html( - data: widget.diet.details, - style: { - "*": Style( - color: Colors.black87, - ), - }, + if (widget.diet.details.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Html( + data: widget.diet.details.length > 200 ? widget.diet.details.substring(0, 200) : widget.diet.details, + style: { + "*": Style( + color: Colors.black87, + ), + }, + ), + ), + if (widget.diet.details.length > 200) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Text( + 'Читать полностью...', + style: TextStyle( + height: 1, + color: appTheme.blueA400, + decoration: TextDecoration.underline, + ), + ), ), - ), SizedBox(height: 12), ], ), diff --git a/lib/features/feed/presentation/widgets/recipes_widget.dart b/lib/features/feed/presentation/widgets/recipes_widget.dart index 16291797..348ac841 100644 --- a/lib/features/feed/presentation/widgets/recipes_widget.dart +++ b/lib/features/feed/presentation/widgets/recipes_widget.dart @@ -1,6 +1,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/features/feed/models/recipes_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; @@ -124,17 +125,30 @@ class _RecipesWidgetState extends State { ), ), ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 4), - child: Html( - data: widget.recipes.description, - style: { - "*": Style( - color: Colors.black87, - ), - }, + if (widget.recipes.description.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Html( + data: widget.recipes.description.length > 200 ? widget.recipes.description.substring(0, 200) : widget.recipes.description, + style: { + "*": Style( + color: Colors.black87, + ), + }, + ), + ), + if (widget.recipes.description.length > 200) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Text( + 'Читать полностью...', + style: TextStyle( + height: 1, + color: appTheme.blueA400, + decoration: TextDecoration.underline, + ), + ), ), - ), SizedBox(height: 12), ], ), diff --git a/lib/features/feed/presentation/widgets/tags_modal_widget.dart b/lib/features/feed/presentation/widgets/tags_modal_widget.dart index 5d66b330..21618511 100644 --- a/lib/features/feed/presentation/widgets/tags_modal_widget.dart +++ b/lib/features/feed/presentation/widgets/tags_modal_widget.dart @@ -1,17 +1,16 @@ import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart'; +import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart'; import 'package:eatvio_app/features/recipes/models/recipe_tag_model.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class TagsModalWidget extends StatefulWidget { - final List tagsList; - final Set selectedTags; + final RecipesCubit recipesCubit; const TagsModalWidget({ super.key, - required this.tagsList, - required this.selectedTags, + required this.recipesCubit, }); @override @@ -21,20 +20,29 @@ class TagsModalWidget extends StatefulWidget { class _TagsModalWidgetState extends State { @override Widget build(BuildContext context) { - return Container( - padding: EdgeInsets.all(16), - width: MediaQuery.of(context).size.width, - child: Wrap( - spacing: 8, - runSpacing: -8, - children: [ - for (int i = 0; i < widget.tagsList.length; i++) - _tagChip( - tag: widget.tagsList[i], - isSelected: widget.selectedTags.contains(widget.tagsList[i].id), + return BlocBuilder( + bloc: widget.recipesCubit, + builder: (BuildContext context, RecipesState state) { + if (state is RecipesStateLoaded) { + return Container( + padding: EdgeInsets.all(16), + width: MediaQuery.of(context).size.width, + child: Wrap( + spacing: 8, + runSpacing: -8, + children: [ + for (int i = 0; i < state.recipesTags.length; i++) + _tagChip( + tag: state.recipesTags[i], + isSelected: state.selectedTags.contains(state.recipesTags[i].id), + ), + ], ), - ], - ), + ); + } else { + return Container(); + } + }, ); } @@ -58,7 +66,7 @@ class _TagsModalWidgetState extends State { ), selected: isSelected, backgroundColor: appTheme.gray100, - onSelected: (bool selected) => context.read().updateTags(tag), + onSelected: (bool selected) => widget.recipesCubit.updateTags(tag), label: Text( '${tag.name} ${tag.recipesCount}', ), diff --git a/lib/features/feed/repositories/feed_repository.dart b/lib/features/feed/repositories/feed_repository.dart index 7d6397d2..459923fc 100644 --- a/lib/features/feed/repositories/feed_repository.dart +++ b/lib/features/feed/repositories/feed_repository.dart @@ -7,17 +7,29 @@ import 'package:eatvio_app/features/feed/services/feed_service.dart'; class FeedRepository { final FeedService feedService; - FeedRepository({required this.feedService}); + FeedRepository({ + required this.feedService, + }); - Future getFeedBlogPosts({int page = 1}) async { + Future getFeedBlogPosts({ + String? query, + int page = 1, + }) async { try { - return (await feedService.getBlogPostList(page: page)); + return (await feedService.getBlogPostList( + page: page, + query: query, + )); } catch (e) { rethrow; } } - Future> getRecipes({String? query, List? tags, int page = 1}) async { + Future> getRecipes({ + String? query, + List? tags, + int page = 1, + }) async { try { return (await feedService.getRecipes( query: query, @@ -30,15 +42,23 @@ class FeedRepository { } } - Future getDiets({int page = 1}) async { + Future getDiets({ + int page = 1, + String? query, + }) async { try { - return (await feedService.getDiets(page: page)); + return (await feedService.getDiets( + page: page, + query: query, + )); } catch (e) { rethrow; } } - Future getBlogPostComments(String id) async { + Future getBlogPostComments({ + required String id, + }) async { try { return (await feedService.getBlogPostComments(id: id)); } catch (e) { @@ -62,7 +82,9 @@ class FeedRepository { } } - Future getDietsComments(String id) async { + Future getDietsComments({ + required String id, + }) async { try { return (await feedService.getDietsComments(id: id)); } catch (e) { @@ -86,7 +108,9 @@ class FeedRepository { } } - Future getRecipesComments(String id) async { + Future getRecipesComments({ + required String id, + }) async { try { return (await feedService.getRecipesComments(id: id)); } catch (e) { @@ -110,7 +134,9 @@ class FeedRepository { } } - Future likeBlogPost(int id) async { + Future likeBlogPost({ + required int id, + }) async { try { await feedService.likeBlogPost(id: id); } catch (e) { @@ -118,7 +144,9 @@ class FeedRepository { } } - Future unlikedBlogPost(int id) async { + Future unlikedBlogPost({ + required int id, + }) async { try { await feedService.unlikedBlogPost(id: id); } catch (e) { diff --git a/lib/features/feed/services/feed_service.dart b/lib/features/feed/services/feed_service.dart index db211b26..9d0cd1bd 100644 --- a/lib/features/feed/services/feed_service.dart +++ b/lib/features/feed/services/feed_service.dart @@ -11,9 +11,10 @@ part 'feed_service.g.dart'; abstract class FeedService { factory FeedService(Dio dio, {String baseUrl}) = _FeedService; - @GET('/api/blogPosts/index?page={page}') + @GET('/api/blogPosts/index') Future getBlogPostList({ @Path() required int page, + @Query('query_search') String? query, }); @GET('/api/recipes/index') @@ -26,6 +27,7 @@ abstract class FeedService { @GET('/api/diets/index') Future getDiets({ @Path() required int page, + @Query('query_search') String? query, }); @GET('/api/blogPosts/{id}/comments/show') diff --git a/lib/features/feed/services/feed_service.g.dart b/lib/features/feed/services/feed_service.g.dart index fe36ea64..d074b0a2 100644 --- a/lib/features/feed/services/feed_service.g.dart +++ b/lib/features/feed/services/feed_service.g.dart @@ -22,9 +22,13 @@ class _FeedService implements FeedService { final ParseErrorLogger? errorLogger; @override - Future getBlogPostList({required int page}) async { + Future getBlogPostList({ + required int page, + String? query, + }) async { final _extra = {}; - final queryParameters = {}; + final queryParameters = {r'query_search': query}; + queryParameters.removeWhere((k, v) => v == null); final _headers = {}; const Map? _data = null; final _options = _setStreamType(Options( @@ -34,7 +38,7 @@ class _FeedService implements FeedService { ) .compose( _dio.options, - '/api/blogPosts/index?page=${page}', + '/api/blogPosts/index', queryParameters: queryParameters, data: _data, ) @@ -96,9 +100,13 @@ class _FeedService implements FeedService { } @override - Future getDiets({required int page}) async { + Future getDiets({ + required int page, + String? query, + }) async { final _extra = {}; - final queryParameters = {}; + final queryParameters = {r'query_search': query}; + queryParameters.removeWhere((k, v) => v == null); final _headers = {}; const Map? _data = null; final _options = _setStreamType(Options( @@ -398,7 +406,9 @@ class _FeedService implements FeedService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/plans/models/plan_pagination_model.freezed.dart b/lib/features/plans/models/plan_pagination_model.freezed.dart index 59ad65ae..caa2ef10 100644 --- a/lib/features/plans/models/plan_pagination_model.freezed.dart +++ b/lib/features/plans/models/plan_pagination_model.freezed.dart @@ -22,10 +22,8 @@ PlanPaginationModel _$PlanPaginationModelFromJson(Map json) { mixin _$PlanPaginationModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; - @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; - @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -35,29 +33,32 @@ mixin _$PlanPaginationModel { /// Create a copy of PlanPaginationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PlanPaginationModelCopyWith get copyWith => throw _privateConstructorUsedError; + $PlanPaginationModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $PlanPaginationModelCopyWith<$Res> { - factory $PlanPaginationModelCopyWith(PlanPaginationModel value, $Res Function(PlanPaginationModel) then) = + factory $PlanPaginationModelCopyWith( + PlanPaginationModel value, $Res Function(PlanPaginationModel) then) = _$PlanPaginationModelCopyWithImpl<$Res, PlanPaginationModel>; - @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; - $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$PlanPaginationModelCopyWithImpl<$Res, $Val extends PlanPaginationModel> implements $PlanPaginationModelCopyWith<$Res> { +class _$PlanPaginationModelCopyWithImpl<$Res, $Val extends PlanPaginationModel> + implements $PlanPaginationModelCopyWith<$Res> { _$PlanPaginationModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -108,25 +109,31 @@ class _$PlanPaginationModelCopyWithImpl<$Res, $Val extends PlanPaginationModel> } /// @nodoc -abstract class _$$PlanPaginationModelImplCopyWith<$Res> implements $PlanPaginationModelCopyWith<$Res> { - factory _$$PlanPaginationModelImplCopyWith(_$PlanPaginationModelImpl value, $Res Function(_$PlanPaginationModelImpl) then) = +abstract class _$$PlanPaginationModelImplCopyWith<$Res> + implements $PlanPaginationModelCopyWith<$Res> { + factory _$$PlanPaginationModelImplCopyWith(_$PlanPaginationModelImpl value, + $Res Function(_$PlanPaginationModelImpl) then) = __$$PlanPaginationModelImplCopyWithImpl<$Res>; - @override @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; - @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$PlanPaginationModelImplCopyWithImpl<$Res> extends _$PlanPaginationModelCopyWithImpl<$Res, _$PlanPaginationModelImpl> +class __$$PlanPaginationModelImplCopyWithImpl<$Res> + extends _$PlanPaginationModelCopyWithImpl<$Res, _$PlanPaginationModelImpl> implements _$$PlanPaginationModelImplCopyWith<$Res> { - __$$PlanPaginationModelImplCopyWithImpl(_$PlanPaginationModelImpl _value, $Res Function(_$PlanPaginationModelImpl) _then) : super(_value, _then); + __$$PlanPaginationModelImplCopyWithImpl(_$PlanPaginationModelImpl _value, + $Res Function(_$PlanPaginationModelImpl) _then) + : super(_value, _then); /// Create a copy of PlanPaginationModel /// with the given fields replaced by the non-null parameter values. @@ -158,13 +165,15 @@ class __$$PlanPaginationModelImplCopyWithImpl<$Res> extends _$PlanPaginationMode @JsonSerializable() class _$PlanPaginationModelImpl implements _PlanPaginationModel { const _$PlanPaginationModelImpl( - {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$PlanPaginationModelImpl.fromJson(Map json) => _$$PlanPaginationModelImplFromJson(json); + factory _$PlanPaginationModelImpl.fromJson(Map json) => + _$$PlanPaginationModelImplFromJson(json); final List _data; - @override @JsonKey(name: "data") List get data { @@ -197,7 +206,8 @@ class _$PlanPaginationModelImpl implements _PlanPaginationModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of PlanPaginationModel /// with the given fields replaced by the non-null parameter values. @@ -205,7 +215,8 @@ class _$PlanPaginationModelImpl implements _PlanPaginationModel { @override @pragma('vm:prefer-inline') _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => - __$$PlanPaginationModelImplCopyWithImpl<_$PlanPaginationModelImpl>(this, _$identity); + __$$PlanPaginationModelImplCopyWithImpl<_$PlanPaginationModelImpl>( + this, _$identity); @override Map toJson() { @@ -217,20 +228,20 @@ class _$PlanPaginationModelImpl implements _PlanPaginationModel { abstract class _PlanPaginationModel implements PlanPaginationModel { const factory _PlanPaginationModel( - {@JsonKey(name: "data") required final List data, - @JsonKey(name: "links") required final Links links, - @JsonKey(name: "meta") required final Meta meta}) = _$PlanPaginationModelImpl; + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required final Links links, + @JsonKey(name: "meta") required final Meta meta}) = + _$PlanPaginationModelImpl; - factory _PlanPaginationModel.fromJson(Map json) = _$PlanPaginationModelImpl.fromJson; + factory _PlanPaginationModel.fromJson(Map json) = + _$PlanPaginationModelImpl.fromJson; @override @JsonKey(name: "data") List get data; - @override @JsonKey(name: "links") Links get links; - @override @JsonKey(name: "meta") Meta get meta; @@ -239,7 +250,8 @@ abstract class _PlanPaginationModel implements PlanPaginationModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$PlanPaginationModelImplCopyWith<_$PlanPaginationModelImpl> get copyWith => + throw _privateConstructorUsedError; } PlanModel _$PlanModelFromJson(Map json) { @@ -250,46 +262,32 @@ PlanModel _$PlanModelFromJson(Map json) { mixin _$PlanModel { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "image") String get image => throw _privateConstructorUsedError; - @JsonKey(name: "duration") int get duration => throw _privateConstructorUsedError; - @JsonKey(name: "state") String get state => throw _privateConstructorUsedError; - @JsonKey(name: "type") PlanType get type => throw _privateConstructorUsedError; - @JsonKey(name: "details") String get details => throw _privateConstructorUsedError; - @JsonKey(name: "packets_count") int get packetsCount => throw _privateConstructorUsedError; - @JsonKey(name: "packet1_options") dynamic get packet1Options => throw _privateConstructorUsedError; - @JsonKey(name: "packet2_options") dynamic get packet2Options => throw _privateConstructorUsedError; - @JsonKey(name: "packet3_options") dynamic get packet3Options => throw _privateConstructorUsedError; - @JsonKey(name: "author") Author get author => throw _privateConstructorUsedError; - @JsonKey(name: "total_likes") int get totalLikes => throw _privateConstructorUsedError; - @JsonKey(name: "total_views") int get totalViews => throw _privateConstructorUsedError; - @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; @@ -299,13 +297,14 @@ mixin _$PlanModel { /// Create a copy of PlanModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PlanModelCopyWith get copyWith => throw _privateConstructorUsedError; + $PlanModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $PlanModelCopyWith<$Res> { - factory $PlanModelCopyWith(PlanModel value, $Res Function(PlanModel) then) = _$PlanModelCopyWithImpl<$Res, PlanModel>; - + factory $PlanModelCopyWith(PlanModel value, $Res Function(PlanModel) then) = + _$PlanModelCopyWithImpl<$Res, PlanModel>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -325,17 +324,16 @@ abstract class $PlanModelCopyWith<$Res> { @JsonKey(name: "total_comments") int totalComments}); $PlanTypeCopyWith<$Res> get type; - $AuthorCopyWith<$Res> get author; } /// @nodoc -class _$PlanModelCopyWithImpl<$Res, $Val extends PlanModel> implements $PlanModelCopyWith<$Res> { +class _$PlanModelCopyWithImpl<$Res, $Val extends PlanModel> + implements $PlanModelCopyWith<$Res> { _$PlanModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -446,9 +444,11 @@ class _$PlanModelCopyWithImpl<$Res, $Val extends PlanModel> implements $PlanMode } /// @nodoc -abstract class _$$PlanModelImplCopyWith<$Res> implements $PlanModelCopyWith<$Res> { - factory _$$PlanModelImplCopyWith(_$PlanModelImpl value, $Res Function(_$PlanModelImpl) then) = __$$PlanModelImplCopyWithImpl<$Res>; - +abstract class _$$PlanModelImplCopyWith<$Res> + implements $PlanModelCopyWith<$Res> { + factory _$$PlanModelImplCopyWith( + _$PlanModelImpl value, $Res Function(_$PlanModelImpl) then) = + __$$PlanModelImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -470,14 +470,17 @@ abstract class _$$PlanModelImplCopyWith<$Res> implements $PlanModelCopyWith<$Res @override $PlanTypeCopyWith<$Res> get type; - @override $AuthorCopyWith<$Res> get author; } /// @nodoc -class __$$PlanModelImplCopyWithImpl<$Res> extends _$PlanModelCopyWithImpl<$Res, _$PlanModelImpl> implements _$$PlanModelImplCopyWith<$Res> { - __$$PlanModelImplCopyWithImpl(_$PlanModelImpl _value, $Res Function(_$PlanModelImpl) _then) : super(_value, _then); +class __$$PlanModelImplCopyWithImpl<$Res> + extends _$PlanModelCopyWithImpl<$Res, _$PlanModelImpl> + implements _$$PlanModelImplCopyWith<$Res> { + __$$PlanModelImplCopyWithImpl( + _$PlanModelImpl _value, $Res Function(_$PlanModelImpl) _then) + : super(_value, _then); /// Create a copy of PlanModel /// with the given fields replaced by the non-null parameter values. @@ -585,7 +588,8 @@ class _$PlanModelImpl implements _PlanModel { @JsonKey(name: "total_views") required this.totalViews, @JsonKey(name: "total_comments") required this.totalComments}); - factory _$PlanModelImpl.fromJson(Map json) => _$$PlanModelImplFromJson(json); + factory _$PlanModelImpl.fromJson(Map json) => + _$$PlanModelImplFromJson(json); @override @JsonKey(name: "id") @@ -646,18 +650,26 @@ class _$PlanModelImpl implements _PlanModel { (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.image, image) || other.image == image) && - (identical(other.duration, duration) || other.duration == duration) && + (identical(other.duration, duration) || + other.duration == duration) && (identical(other.state, state) || other.state == state) && (identical(other.type, type) || other.type == type) && (identical(other.details, details) || other.details == details) && - (identical(other.packetsCount, packetsCount) || other.packetsCount == packetsCount) && - const DeepCollectionEquality().equals(other.packet1Options, packet1Options) && - const DeepCollectionEquality().equals(other.packet2Options, packet2Options) && - const DeepCollectionEquality().equals(other.packet3Options, packet3Options) && + (identical(other.packetsCount, packetsCount) || + other.packetsCount == packetsCount) && + const DeepCollectionEquality() + .equals(other.packet1Options, packet1Options) && + const DeepCollectionEquality() + .equals(other.packet2Options, packet2Options) && + const DeepCollectionEquality() + .equals(other.packet3Options, packet3Options) && (identical(other.author, author) || other.author == author) && - (identical(other.totalLikes, totalLikes) || other.totalLikes == totalLikes) && - (identical(other.totalViews, totalViews) || other.totalViews == totalViews) && - (identical(other.totalComments, totalComments) || other.totalComments == totalComments)); + (identical(other.totalLikes, totalLikes) || + other.totalLikes == totalLikes) && + (identical(other.totalViews, totalViews) || + other.totalViews == totalViews) && + (identical(other.totalComments, totalComments) || + other.totalComments == totalComments)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -685,7 +697,8 @@ class _$PlanModelImpl implements _PlanModel { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => __$$PlanModelImplCopyWithImpl<_$PlanModelImpl>(this, _$identity); + _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => + __$$PlanModelImplCopyWithImpl<_$PlanModelImpl>(this, _$identity); @override Map toJson() { @@ -697,80 +710,68 @@ class _$PlanModelImpl implements _PlanModel { abstract class _PlanModel implements PlanModel { const factory _PlanModel( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "image") required final String image, - @JsonKey(name: "duration") required final int duration, - @JsonKey(name: "state") required final String state, - @JsonKey(name: "type") required final PlanType type, - @JsonKey(name: "details") required final String details, - @JsonKey(name: "packets_count") required final int packetsCount, - @JsonKey(name: "packet1_options") final dynamic packet1Options, - @JsonKey(name: "packet2_options") final dynamic packet2Options, - @JsonKey(name: "packet3_options") final dynamic packet3Options, - @JsonKey(name: "author") required final Author author, - @JsonKey(name: "total_likes") required final int totalLikes, - @JsonKey(name: "total_views") required final int totalViews, - @JsonKey(name: "total_comments") required final int totalComments}) = _$PlanModelImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "image") required final String image, + @JsonKey(name: "duration") required final int duration, + @JsonKey(name: "state") required final String state, + @JsonKey(name: "type") required final PlanType type, + @JsonKey(name: "details") required final String details, + @JsonKey(name: "packets_count") required final int packetsCount, + @JsonKey(name: "packet1_options") final dynamic packet1Options, + @JsonKey(name: "packet2_options") final dynamic packet2Options, + @JsonKey(name: "packet3_options") final dynamic packet3Options, + @JsonKey(name: "author") required final Author author, + @JsonKey(name: "total_likes") required final int totalLikes, + @JsonKey(name: "total_views") required final int totalViews, + @JsonKey(name: "total_comments") required final int totalComments}) = + _$PlanModelImpl; - factory _PlanModel.fromJson(Map json) = _$PlanModelImpl.fromJson; + factory _PlanModel.fromJson(Map json) = + _$PlanModelImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "image") String get image; - @override @JsonKey(name: "duration") int get duration; - @override @JsonKey(name: "state") String get state; - @override @JsonKey(name: "type") PlanType get type; - @override @JsonKey(name: "details") String get details; - @override @JsonKey(name: "packets_count") int get packetsCount; - @override @JsonKey(name: "packet1_options") dynamic get packet1Options; - @override @JsonKey(name: "packet2_options") dynamic get packet2Options; - @override @JsonKey(name: "packet3_options") dynamic get packet3Options; - @override @JsonKey(name: "author") Author get author; - @override @JsonKey(name: "total_likes") int get totalLikes; - @override @JsonKey(name: "total_views") int get totalViews; - @override @JsonKey(name: "total_comments") int get totalComments; @@ -779,7 +780,8 @@ abstract class _PlanModel implements PlanModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$PlanModelImplCopyWith<_$PlanModelImpl> get copyWith => + throw _privateConstructorUsedError; } PacketOptions _$PacketOptionsFromJson(Map json) { @@ -790,13 +792,10 @@ PacketOptions _$PacketOptionsFromJson(Map json) { mixin _$PacketOptions { @JsonKey(name: "items") List get items => throw _privateConstructorUsedError; - @JsonKey(name: "price") dynamic get price => throw _privateConstructorUsedError; - @JsonKey(name: "short") String get short => throw _privateConstructorUsedError; - @JsonKey(name: "description") String get description => throw _privateConstructorUsedError; @@ -806,13 +805,15 @@ mixin _$PacketOptions { /// Create a copy of PacketOptions /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PacketOptionsCopyWith get copyWith => throw _privateConstructorUsedError; + $PacketOptionsCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $PacketOptionsCopyWith<$Res> { - factory $PacketOptionsCopyWith(PacketOptions value, $Res Function(PacketOptions) then) = _$PacketOptionsCopyWithImpl<$Res, PacketOptions>; - + factory $PacketOptionsCopyWith( + PacketOptions value, $Res Function(PacketOptions) then) = + _$PacketOptionsCopyWithImpl<$Res, PacketOptions>; @useResult $Res call( {@JsonKey(name: "items") List items, @@ -822,12 +823,12 @@ abstract class $PacketOptionsCopyWith<$Res> { } /// @nodoc -class _$PacketOptionsCopyWithImpl<$Res, $Val extends PacketOptions> implements $PacketOptionsCopyWith<$Res> { +class _$PacketOptionsCopyWithImpl<$Res, $Val extends PacketOptions> + implements $PacketOptionsCopyWith<$Res> { _$PacketOptionsCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -863,9 +864,11 @@ class _$PacketOptionsCopyWithImpl<$Res, $Val extends PacketOptions> implements $ } /// @nodoc -abstract class _$$PacketOptionsImplCopyWith<$Res> implements $PacketOptionsCopyWith<$Res> { - factory _$$PacketOptionsImplCopyWith(_$PacketOptionsImpl value, $Res Function(_$PacketOptionsImpl) then) = __$$PacketOptionsImplCopyWithImpl<$Res>; - +abstract class _$$PacketOptionsImplCopyWith<$Res> + implements $PacketOptionsCopyWith<$Res> { + factory _$$PacketOptionsImplCopyWith( + _$PacketOptionsImpl value, $Res Function(_$PacketOptionsImpl) then) = + __$$PacketOptionsImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -876,8 +879,12 @@ abstract class _$$PacketOptionsImplCopyWith<$Res> implements $PacketOptionsCopyW } /// @nodoc -class __$$PacketOptionsImplCopyWithImpl<$Res> extends _$PacketOptionsCopyWithImpl<$Res, _$PacketOptionsImpl> implements _$$PacketOptionsImplCopyWith<$Res> { - __$$PacketOptionsImplCopyWithImpl(_$PacketOptionsImpl _value, $Res Function(_$PacketOptionsImpl) _then) : super(_value, _then); +class __$$PacketOptionsImplCopyWithImpl<$Res> + extends _$PacketOptionsCopyWithImpl<$Res, _$PacketOptionsImpl> + implements _$$PacketOptionsImplCopyWith<$Res> { + __$$PacketOptionsImplCopyWithImpl( + _$PacketOptionsImpl _value, $Res Function(_$PacketOptionsImpl) _then) + : super(_value, _then); /// Create a copy of PacketOptions /// with the given fields replaced by the non-null parameter values. @@ -920,10 +927,10 @@ class _$PacketOptionsImpl implements _PacketOptions { @JsonKey(name: "description") required this.description}) : _items = items; - factory _$PacketOptionsImpl.fromJson(Map json) => _$$PacketOptionsImplFromJson(json); + factory _$PacketOptionsImpl.fromJson(Map json) => + _$$PacketOptionsImplFromJson(json); final List _items; - @override @JsonKey(name: "items") List get items { @@ -955,19 +962,26 @@ class _$PacketOptionsImpl implements _PacketOptions { const DeepCollectionEquality().equals(other._items, _items) && const DeepCollectionEquality().equals(other.price, price) && (identical(other.short, short) || other.short == short) && - (identical(other.description, description) || other.description == description)); + (identical(other.description, description) || + other.description == description)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_items), const DeepCollectionEquality().hash(price), short, description); + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(_items), + const DeepCollectionEquality().hash(price), + short, + description); /// Create a copy of PacketOptions /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => __$$PacketOptionsImplCopyWithImpl<_$PacketOptionsImpl>(this, _$identity); + _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => + __$$PacketOptionsImplCopyWithImpl<_$PacketOptionsImpl>(this, _$identity); @override Map toJson() { @@ -979,25 +993,24 @@ class _$PacketOptionsImpl implements _PacketOptions { abstract class _PacketOptions implements PacketOptions { const factory _PacketOptions( - {@JsonKey(name: "items") required final List items, - @JsonKey(name: "price") required final dynamic price, - @JsonKey(name: "short") required final String short, - @JsonKey(name: "description") required final String description}) = _$PacketOptionsImpl; + {@JsonKey(name: "items") required final List items, + @JsonKey(name: "price") required final dynamic price, + @JsonKey(name: "short") required final String short, + @JsonKey(name: "description") required final String description}) = + _$PacketOptionsImpl; - factory _PacketOptions.fromJson(Map json) = _$PacketOptionsImpl.fromJson; + factory _PacketOptions.fromJson(Map json) = + _$PacketOptionsImpl.fromJson; @override @JsonKey(name: "items") List get items; - @override @JsonKey(name: "price") dynamic get price; - @override @JsonKey(name: "short") String get short; - @override @JsonKey(name: "description") String get description; @@ -1006,7 +1019,8 @@ abstract class _PacketOptions implements PacketOptions { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => throw _privateConstructorUsedError; + _$$PacketOptionsImplCopyWith<_$PacketOptionsImpl> get copyWith => + throw _privateConstructorUsedError; } PlanType _$PlanTypeFromJson(Map json) { @@ -1017,13 +1031,10 @@ PlanType _$PlanTypeFromJson(Map json) { mixin _$PlanType { @JsonKey(name: "fit") bool get fit => throw _privateConstructorUsedError; - @JsonKey(name: "slim") bool get slim => throw _privateConstructorUsedError; - @JsonKey(name: "behavior") bool get behavior => throw _privateConstructorUsedError; - @JsonKey(name: "wellness") bool get wellness => throw _privateConstructorUsedError; @@ -1033,25 +1044,29 @@ mixin _$PlanType { /// Create a copy of PlanType /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $PlanTypeCopyWith get copyWith => throw _privateConstructorUsedError; + $PlanTypeCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $PlanTypeCopyWith<$Res> { - factory $PlanTypeCopyWith(PlanType value, $Res Function(PlanType) then) = _$PlanTypeCopyWithImpl<$Res, PlanType>; - + factory $PlanTypeCopyWith(PlanType value, $Res Function(PlanType) then) = + _$PlanTypeCopyWithImpl<$Res, PlanType>; @useResult $Res call( - {@JsonKey(name: "fit") bool fit, @JsonKey(name: "slim") bool slim, @JsonKey(name: "behavior") bool behavior, @JsonKey(name: "wellness") bool wellness}); + {@JsonKey(name: "fit") bool fit, + @JsonKey(name: "slim") bool slim, + @JsonKey(name: "behavior") bool behavior, + @JsonKey(name: "wellness") bool wellness}); } /// @nodoc -class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType> implements $PlanTypeCopyWith<$Res> { +class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType> + implements $PlanTypeCopyWith<$Res> { _$PlanTypeCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -1087,18 +1102,27 @@ class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType> implements $PlanTypeCo } /// @nodoc -abstract class _$$PlanTypeImplCopyWith<$Res> implements $PlanTypeCopyWith<$Res> { - factory _$$PlanTypeImplCopyWith(_$PlanTypeImpl value, $Res Function(_$PlanTypeImpl) then) = __$$PlanTypeImplCopyWithImpl<$Res>; - +abstract class _$$PlanTypeImplCopyWith<$Res> + implements $PlanTypeCopyWith<$Res> { + factory _$$PlanTypeImplCopyWith( + _$PlanTypeImpl value, $Res Function(_$PlanTypeImpl) then) = + __$$PlanTypeImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey(name: "fit") bool fit, @JsonKey(name: "slim") bool slim, @JsonKey(name: "behavior") bool behavior, @JsonKey(name: "wellness") bool wellness}); + {@JsonKey(name: "fit") bool fit, + @JsonKey(name: "slim") bool slim, + @JsonKey(name: "behavior") bool behavior, + @JsonKey(name: "wellness") bool wellness}); } /// @nodoc -class __$$PlanTypeImplCopyWithImpl<$Res> extends _$PlanTypeCopyWithImpl<$Res, _$PlanTypeImpl> implements _$$PlanTypeImplCopyWith<$Res> { - __$$PlanTypeImplCopyWithImpl(_$PlanTypeImpl _value, $Res Function(_$PlanTypeImpl) _then) : super(_value, _then); +class __$$PlanTypeImplCopyWithImpl<$Res> + extends _$PlanTypeCopyWithImpl<$Res, _$PlanTypeImpl> + implements _$$PlanTypeImplCopyWith<$Res> { + __$$PlanTypeImplCopyWithImpl( + _$PlanTypeImpl _value, $Res Function(_$PlanTypeImpl) _then) + : super(_value, _then); /// Create a copy of PlanType /// with the given fields replaced by the non-null parameter values. @@ -1140,7 +1164,8 @@ class _$PlanTypeImpl implements _PlanType { @JsonKey(name: "behavior") required this.behavior, @JsonKey(name: "wellness") required this.wellness}); - factory _$PlanTypeImpl.fromJson(Map json) => _$$PlanTypeImplFromJson(json); + factory _$PlanTypeImpl.fromJson(Map json) => + _$$PlanTypeImplFromJson(json); @override @JsonKey(name: "fit") @@ -1167,8 +1192,10 @@ class _$PlanTypeImpl implements _PlanType { other is _$PlanTypeImpl && (identical(other.fit, fit) || other.fit == fit) && (identical(other.slim, slim) || other.slim == slim) && - (identical(other.behavior, behavior) || other.behavior == behavior) && - (identical(other.wellness, wellness) || other.wellness == wellness)); + (identical(other.behavior, behavior) || + other.behavior == behavior) && + (identical(other.wellness, wellness) || + other.wellness == wellness)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -1180,7 +1207,8 @@ class _$PlanTypeImpl implements _PlanType { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => __$$PlanTypeImplCopyWithImpl<_$PlanTypeImpl>(this, _$identity); + _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => + __$$PlanTypeImplCopyWithImpl<_$PlanTypeImpl>(this, _$identity); @override Map toJson() { @@ -1192,25 +1220,24 @@ class _$PlanTypeImpl implements _PlanType { abstract class _PlanType implements PlanType { const factory _PlanType( - {@JsonKey(name: "fit") required final bool fit, - @JsonKey(name: "slim") required final bool slim, - @JsonKey(name: "behavior") required final bool behavior, - @JsonKey(name: "wellness") required final bool wellness}) = _$PlanTypeImpl; + {@JsonKey(name: "fit") required final bool fit, + @JsonKey(name: "slim") required final bool slim, + @JsonKey(name: "behavior") required final bool behavior, + @JsonKey(name: "wellness") required final bool wellness}) = + _$PlanTypeImpl; - factory _PlanType.fromJson(Map json) = _$PlanTypeImpl.fromJson; + factory _PlanType.fromJson(Map json) = + _$PlanTypeImpl.fromJson; @override @JsonKey(name: "fit") bool get fit; - @override @JsonKey(name: "slim") bool get slim; - @override @JsonKey(name: "behavior") bool get behavior; - @override @JsonKey(name: "wellness") bool get wellness; @@ -1219,5 +1246,6 @@ abstract class _PlanType implements PlanType { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => throw _privateConstructorUsedError; + _$$PlanTypeImplCopyWith<_$PlanTypeImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/plans/models/plan_pagination_model.g.dart b/lib/features/plans/models/plan_pagination_model.g.dart index 595e52b4..8f203fa8 100644 --- a/lib/features/plans/models/plan_pagination_model.g.dart +++ b/lib/features/plans/models/plan_pagination_model.g.dart @@ -6,19 +6,26 @@ part of 'plan_pagination_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PlanPaginationModelImpl _$$PlanPaginationModelImplFromJson(Map json) => _$PlanPaginationModelImpl( - data: (json['data'] as List).map((e) => PlanModel.fromJson(e as Map)).toList(), +_$PlanPaginationModelImpl _$$PlanPaginationModelImplFromJson( + Map json) => + _$PlanPaginationModelImpl( + data: (json['data'] as List) + .map((e) => PlanModel.fromJson(e as Map)) + .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$PlanPaginationModelImplToJson(_$PlanPaginationModelImpl instance) => { +Map _$$PlanPaginationModelImplToJson( + _$PlanPaginationModelImpl instance) => + { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$PlanModelImpl _$$PlanModelImplFromJson(Map json) => _$PlanModelImpl( +_$PlanModelImpl _$$PlanModelImplFromJson(Map json) => + _$PlanModelImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, image: json['image'] as String, @@ -36,7 +43,8 @@ _$PlanModelImpl _$$PlanModelImplFromJson(Map json) => _$PlanMod totalComments: (json['total_comments'] as num).toInt(), ); -Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => { +Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => + { 'id': instance.id, 'name': instance.name, 'image': instance.image, @@ -54,28 +62,32 @@ Map _$$PlanModelImplToJson(_$PlanModelImpl instance) => json) => _$PacketOptionsImpl( +_$PacketOptionsImpl _$$PacketOptionsImplFromJson(Map json) => + _$PacketOptionsImpl( items: (json['items'] as List).map((e) => e as String).toList(), price: json['price'], short: json['short'] as String, description: json['description'] as String, ); -Map _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) => { +Map _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) => + { 'items': instance.items, 'price': instance.price, 'short': instance.short, 'description': instance.description, }; -_$PlanTypeImpl _$$PlanTypeImplFromJson(Map json) => _$PlanTypeImpl( +_$PlanTypeImpl _$$PlanTypeImplFromJson(Map json) => + _$PlanTypeImpl( fit: json['fit'] as bool, slim: json['slim'] as bool, behavior: json['behavior'] as bool, wellness: json['wellness'] as bool, ); -Map _$$PlanTypeImplToJson(_$PlanTypeImpl instance) => { +Map _$$PlanTypeImplToJson(_$PlanTypeImpl instance) => + { 'fit': instance.fit, 'slim': instance.slim, 'behavior': instance.behavior, diff --git a/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart b/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart index e16e4e4d..1bbe3cac 100644 --- a/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart +++ b/lib/features/plans/presentation/bloc/plans_cubit/plans_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$PlansState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$PlansState { /// @nodoc abstract class $PlansStateCopyWith<$Res> { - factory $PlansStateCopyWith(PlansState value, $Res Function(PlansState) then) = _$PlansStateCopyWithImpl<$Res, PlansState>; + factory $PlansStateCopyWith( + PlansState value, $Res Function(PlansState) then) = + _$PlansStateCopyWithImpl<$Res, PlansState>; } /// @nodoc -class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState> implements $PlansStateCopyWith<$Res> { +class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState> + implements $PlansStateCopyWith<$Res> { _$PlansStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +91,18 @@ class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState> implements $PlansS /// @nodoc abstract class _$$PlansStateImplCopyWith<$Res> { - factory _$$PlansStateImplCopyWith(_$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) = __$$PlansStateImplCopyWithImpl<$Res>; + factory _$$PlansStateImplCopyWith( + _$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) = + __$$PlansStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$PlansStateImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl> implements _$$PlansStateImplCopyWith<$Res> { - __$$PlansStateImplCopyWithImpl(_$PlansStateImpl _value, $Res Function(_$PlansStateImpl) _then) : super(_value, _then); +class __$$PlansStateImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl> + implements _$$PlansStateImplCopyWith<$Res> { + __$$PlansStateImplCopyWithImpl( + _$PlansStateImpl _value, $Res Function(_$PlansStateImpl) _then) + : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +120,8 @@ class _$PlansStateImpl implements _PlansState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$PlansStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$PlansStateImpl); } @override @@ -200,14 +208,18 @@ abstract class _PlansState implements PlansState { /// @nodoc abstract class _$$PlansStateLoadingImplCopyWith<$Res> { - factory _$$PlansStateLoadingImplCopyWith(_$PlansStateLoadingImpl value, $Res Function(_$PlansStateLoadingImpl) then) = + factory _$$PlansStateLoadingImplCopyWith(_$PlansStateLoadingImpl value, + $Res Function(_$PlansStateLoadingImpl) then) = __$$PlansStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$PlansStateLoadingImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadingImpl> +class __$$PlansStateLoadingImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadingImpl> implements _$$PlansStateLoadingImplCopyWith<$Res> { - __$$PlansStateLoadingImplCopyWithImpl(_$PlansStateLoadingImpl _value, $Res Function(_$PlansStateLoadingImpl) _then) : super(_value, _then); + __$$PlansStateLoadingImplCopyWithImpl(_$PlansStateLoadingImpl _value, + $Res Function(_$PlansStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +237,8 @@ class _$PlansStateLoadingImpl implements PlansStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$PlansStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$PlansStateLoadingImpl); } @override @@ -312,9 +325,9 @@ abstract class PlansStateLoading implements PlansState { /// @nodoc abstract class _$$PlansStateLoadedImplCopyWith<$Res> { - factory _$$PlansStateLoadedImplCopyWith(_$PlansStateLoadedImpl value, $Res Function(_$PlansStateLoadedImpl) then) = + factory _$$PlansStateLoadedImplCopyWith(_$PlansStateLoadedImpl value, + $Res Function(_$PlansStateLoadedImpl) then) = __$$PlansStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({PlanPaginationModel plansModel}); @@ -322,9 +335,12 @@ abstract class _$$PlansStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$PlansStateLoadedImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadedImpl> +class __$$PlansStateLoadedImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadedImpl> implements _$$PlansStateLoadedImplCopyWith<$Res> { - __$$PlansStateLoadedImplCopyWithImpl(_$PlansStateLoadedImpl _value, $Res Function(_$PlansStateLoadedImpl) _then) : super(_value, _then); + __$$PlansStateLoadedImplCopyWithImpl(_$PlansStateLoadedImpl _value, + $Res Function(_$PlansStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -368,7 +384,10 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$PlansStateLoadedImpl && (identical(other.plansModel, plansModel) || other.plansModel == plansModel)); + (other.runtimeType == runtimeType && + other is _$PlansStateLoadedImpl && + (identical(other.plansModel, plansModel) || + other.plansModel == plansModel)); } @override @@ -379,7 +398,9 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => __$$PlansStateLoadedImplCopyWithImpl<_$PlansStateLoadedImpl>(this, _$identity); + _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => + __$$PlansStateLoadedImplCopyWithImpl<_$PlansStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -457,27 +478,34 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded { } abstract class PlansStateLoaded implements PlansState { - const factory PlansStateLoaded({required final PlanPaginationModel plansModel}) = _$PlansStateLoadedImpl; + const factory PlansStateLoaded( + {required final PlanPaginationModel plansModel}) = _$PlansStateLoadedImpl; PlanPaginationModel get plansModel; /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$PlansStateErrorImplCopyWith<$Res> { - factory _$$PlansStateErrorImplCopyWith(_$PlansStateErrorImpl value, $Res Function(_$PlansStateErrorImpl) then) = __$$PlansStateErrorImplCopyWithImpl<$Res>; - + factory _$$PlansStateErrorImplCopyWith(_$PlansStateErrorImpl value, + $Res Function(_$PlansStateErrorImpl) then) = + __$$PlansStateErrorImplCopyWithImpl<$Res>; @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$PlansStateErrorImplCopyWithImpl<$Res> extends _$PlansStateCopyWithImpl<$Res, _$PlansStateErrorImpl> implements _$$PlansStateErrorImplCopyWith<$Res> { - __$$PlansStateErrorImplCopyWithImpl(_$PlansStateErrorImpl _value, $Res Function(_$PlansStateErrorImpl) _then) : super(_value, _then); +class __$$PlansStateErrorImplCopyWithImpl<$Res> + extends _$PlansStateCopyWithImpl<$Res, _$PlansStateErrorImpl> + implements _$$PlansStateErrorImplCopyWith<$Res> { + __$$PlansStateErrorImplCopyWithImpl( + _$PlansStateErrorImpl _value, $Res Function(_$PlansStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @@ -513,7 +541,8 @@ class _$PlansStateErrorImpl implements PlansStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$PlansStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -524,7 +553,9 @@ class _$PlansStateErrorImpl implements PlansStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => __$$PlansStateErrorImplCopyWithImpl<_$PlansStateErrorImpl>(this, _$identity); + _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => + __$$PlansStateErrorImplCopyWithImpl<_$PlansStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -602,12 +633,14 @@ class _$PlansStateErrorImpl implements PlansStateError { } abstract class PlansStateError implements PlansState { - const factory PlansStateError({required final String errorMessage}) = _$PlansStateErrorImpl; + const factory PlansStateError({required final String errorMessage}) = + _$PlansStateErrorImpl; String get errorMessage; /// Create a copy of PlansState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/plans/services/plans_service.g.dart b/lib/features/plans/services/plans_service.g.dart index 2f655a5d..bce687f0 100644 --- a/lib/features/plans/services/plans_service.g.dart +++ b/lib/features/plans/services/plans_service.g.dart @@ -55,7 +55,9 @@ class _PlansService implements PlansService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/profile/models/circumference_model.dart b/lib/features/profile/models/circumference_model.dart new file mode 100644 index 00000000..eeb4f6e0 --- /dev/null +++ b/lib/features/profile/models/circumference_model.dart @@ -0,0 +1,19 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'circumference_model.freezed.dart'; +part 'circumference_model.g.dart'; + +@freezed +class CircumferenceModel with _$CircumferenceModel { + const factory CircumferenceModel({ + @JsonKey(name: "id") required int id, + @JsonKey(name: "user_id") required int userId, + @JsonKey(name: "chest_circumference") required int chestCircumference, + @JsonKey(name: "waist_circumference") required int waistCircumference, + @JsonKey(name: "hip_circumference") required int hipCircumference, + @JsonKey(name: "created_at") required DateTime createdAt, + @JsonKey(name: "updated_at") required DateTime updatedAt, + }) = _CircumferenceModel; + + factory CircumferenceModel.fromJson(Map json) => _$CircumferenceModelFromJson(json); +} diff --git a/lib/features/profile/models/circumference_model.freezed.dart b/lib/features/profile/models/circumference_model.freezed.dart new file mode 100644 index 00000000..870620f3 --- /dev/null +++ b/lib/features/profile/models/circumference_model.freezed.dart @@ -0,0 +1,319 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'circumference_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +CircumferenceModel _$CircumferenceModelFromJson(Map json) { + return _CircumferenceModel.fromJson(json); +} + +/// @nodoc +mixin _$CircumferenceModel { + @JsonKey(name: "id") + int get id => throw _privateConstructorUsedError; + @JsonKey(name: "user_id") + int get userId => throw _privateConstructorUsedError; + @JsonKey(name: "chest_circumference") + int get chestCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "waist_circumference") + int get waistCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "hip_circumference") + int get hipCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") + DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") + DateTime get updatedAt => throw _privateConstructorUsedError; + + /// Serializes this CircumferenceModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of CircumferenceModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $CircumferenceModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $CircumferenceModelCopyWith<$Res> { + factory $CircumferenceModelCopyWith( + CircumferenceModel value, $Res Function(CircumferenceModel) then) = + _$CircumferenceModelCopyWithImpl<$Res, CircumferenceModel>; + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "chest_circumference") int chestCircumference, + @JsonKey(name: "waist_circumference") int waistCircumference, + @JsonKey(name: "hip_circumference") int hipCircumference, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt}); +} + +/// @nodoc +class _$CircumferenceModelCopyWithImpl<$Res, $Val extends CircumferenceModel> + implements $CircumferenceModelCopyWith<$Res> { + _$CircumferenceModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of CircumferenceModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? chestCircumference = null, + Object? waistCircumference = null, + Object? hipCircumference = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + chestCircumference: null == chestCircumference + ? _value.chestCircumference + : chestCircumference // ignore: cast_nullable_to_non_nullable + as int, + waistCircumference: null == waistCircumference + ? _value.waistCircumference + : waistCircumference // ignore: cast_nullable_to_non_nullable + as int, + hipCircumference: null == hipCircumference + ? _value.hipCircumference + : hipCircumference // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$CircumferenceModelImplCopyWith<$Res> + implements $CircumferenceModelCopyWith<$Res> { + factory _$$CircumferenceModelImplCopyWith(_$CircumferenceModelImpl value, + $Res Function(_$CircumferenceModelImpl) then) = + __$$CircumferenceModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "chest_circumference") int chestCircumference, + @JsonKey(name: "waist_circumference") int waistCircumference, + @JsonKey(name: "hip_circumference") int hipCircumference, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt}); +} + +/// @nodoc +class __$$CircumferenceModelImplCopyWithImpl<$Res> + extends _$CircumferenceModelCopyWithImpl<$Res, _$CircumferenceModelImpl> + implements _$$CircumferenceModelImplCopyWith<$Res> { + __$$CircumferenceModelImplCopyWithImpl(_$CircumferenceModelImpl _value, + $Res Function(_$CircumferenceModelImpl) _then) + : super(_value, _then); + + /// Create a copy of CircumferenceModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? chestCircumference = null, + Object? waistCircumference = null, + Object? hipCircumference = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then(_$CircumferenceModelImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + chestCircumference: null == chestCircumference + ? _value.chestCircumference + : chestCircumference // ignore: cast_nullable_to_non_nullable + as int, + waistCircumference: null == waistCircumference + ? _value.waistCircumference + : waistCircumference // ignore: cast_nullable_to_non_nullable + as int, + hipCircumference: null == hipCircumference + ? _value.hipCircumference + : hipCircumference // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$CircumferenceModelImpl implements _CircumferenceModel { + const _$CircumferenceModelImpl( + {@JsonKey(name: "id") required this.id, + @JsonKey(name: "user_id") required this.userId, + @JsonKey(name: "chest_circumference") required this.chestCircumference, + @JsonKey(name: "waist_circumference") required this.waistCircumference, + @JsonKey(name: "hip_circumference") required this.hipCircumference, + @JsonKey(name: "created_at") required this.createdAt, + @JsonKey(name: "updated_at") required this.updatedAt}); + + factory _$CircumferenceModelImpl.fromJson(Map json) => + _$$CircumferenceModelImplFromJson(json); + + @override + @JsonKey(name: "id") + final int id; + @override + @JsonKey(name: "user_id") + final int userId; + @override + @JsonKey(name: "chest_circumference") + final int chestCircumference; + @override + @JsonKey(name: "waist_circumference") + final int waistCircumference; + @override + @JsonKey(name: "hip_circumference") + final int hipCircumference; + @override + @JsonKey(name: "created_at") + final DateTime createdAt; + @override + @JsonKey(name: "updated_at") + final DateTime updatedAt; + + @override + String toString() { + return 'CircumferenceModel(id: $id, userId: $userId, chestCircumference: $chestCircumference, waistCircumference: $waistCircumference, hipCircumference: $hipCircumference, createdAt: $createdAt, updatedAt: $updatedAt)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$CircumferenceModelImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.userId, userId) || other.userId == userId) && + (identical(other.chestCircumference, chestCircumference) || + other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || + other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || + other.hipCircumference == hipCircumference) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, id, userId, chestCircumference, + waistCircumference, hipCircumference, createdAt, updatedAt); + + /// Create a copy of CircumferenceModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$CircumferenceModelImplCopyWith<_$CircumferenceModelImpl> get copyWith => + __$$CircumferenceModelImplCopyWithImpl<_$CircumferenceModelImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$CircumferenceModelImplToJson( + this, + ); + } +} + +abstract class _CircumferenceModel implements CircumferenceModel { + const factory _CircumferenceModel( + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "user_id") required final int userId, + @JsonKey(name: "chest_circumference") + required final int chestCircumference, + @JsonKey(name: "waist_circumference") + required final int waistCircumference, + @JsonKey(name: "hip_circumference") required final int hipCircumference, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") + required final DateTime updatedAt}) = _$CircumferenceModelImpl; + + factory _CircumferenceModel.fromJson(Map json) = + _$CircumferenceModelImpl.fromJson; + + @override + @JsonKey(name: "id") + int get id; + @override + @JsonKey(name: "user_id") + int get userId; + @override + @JsonKey(name: "chest_circumference") + int get chestCircumference; + @override + @JsonKey(name: "waist_circumference") + int get waistCircumference; + @override + @JsonKey(name: "hip_circumference") + int get hipCircumference; + @override + @JsonKey(name: "created_at") + DateTime get createdAt; + @override + @JsonKey(name: "updated_at") + DateTime get updatedAt; + + /// Create a copy of CircumferenceModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$CircumferenceModelImplCopyWith<_$CircumferenceModelImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/profile/models/circumference_model.g.dart b/lib/features/profile/models/circumference_model.g.dart new file mode 100644 index 00000000..07a10f71 --- /dev/null +++ b/lib/features/profile/models/circumference_model.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'circumference_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$CircumferenceModelImpl _$$CircumferenceModelImplFromJson( + Map json) => + _$CircumferenceModelImpl( + id: (json['id'] as num).toInt(), + userId: (json['user_id'] as num).toInt(), + chestCircumference: (json['chest_circumference'] as num).toInt(), + waistCircumference: (json['waist_circumference'] as num).toInt(), + hipCircumference: (json['hip_circumference'] as num).toInt(), + createdAt: DateTime.parse(json['created_at'] as String), + updatedAt: DateTime.parse(json['updated_at'] as String), + ); + +Map _$$CircumferenceModelImplToJson( + _$CircumferenceModelImpl instance) => + { + 'id': instance.id, + 'user_id': instance.userId, + 'chest_circumference': instance.chestCircumference, + 'waist_circumference': instance.waistCircumference, + 'hip_circumference': instance.hipCircumference, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + }; diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index 3732e837..94b860a3 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -22,28 +22,20 @@ ProfileModel _$ProfileModelFromJson(Map json) { mixin _$ProfileModel { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "email") String get email => throw _privateConstructorUsedError; - @JsonKey(name: "email_verified_at") DateTime? get emailVerifiedAt => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime? get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime? get updatedAt => throw _privateConstructorUsedError; - @JsonKey(name: "is_public_profile") bool get isPublicProfile => throw _privateConstructorUsedError; - @JsonKey(name: "slug") String get slug => throw _privateConstructorUsedError; - @JsonKey(name: "profile_photo_url") String get profilePhotoUrl => throw _privateConstructorUsedError; @@ -53,13 +45,15 @@ mixin _$ProfileModel { /// Create a copy of ProfileModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ProfileModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ProfileModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ProfileModelCopyWith<$Res> { - factory $ProfileModelCopyWith(ProfileModel value, $Res Function(ProfileModel) then) = _$ProfileModelCopyWithImpl<$Res, ProfileModel>; - + factory $ProfileModelCopyWith( + ProfileModel value, $Res Function(ProfileModel) then) = + _$ProfileModelCopyWithImpl<$Res, ProfileModel>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -74,12 +68,12 @@ abstract class $ProfileModelCopyWith<$Res> { } /// @nodoc -class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> implements $ProfileModelCopyWith<$Res> { +class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> + implements $ProfileModelCopyWith<$Res> { _$ProfileModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -140,9 +134,11 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> implements $Pr } /// @nodoc -abstract class _$$ProfileModelImplCopyWith<$Res> implements $ProfileModelCopyWith<$Res> { - factory _$$ProfileModelImplCopyWith(_$ProfileModelImpl value, $Res Function(_$ProfileModelImpl) then) = __$$ProfileModelImplCopyWithImpl<$Res>; - +abstract class _$$ProfileModelImplCopyWith<$Res> + implements $ProfileModelCopyWith<$Res> { + factory _$$ProfileModelImplCopyWith( + _$ProfileModelImpl value, $Res Function(_$ProfileModelImpl) then) = + __$$ProfileModelImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -158,8 +154,12 @@ abstract class _$$ProfileModelImplCopyWith<$Res> implements $ProfileModelCopyWit } /// @nodoc -class __$$ProfileModelImplCopyWithImpl<$Res> extends _$ProfileModelCopyWithImpl<$Res, _$ProfileModelImpl> implements _$$ProfileModelImplCopyWith<$Res> { - __$$ProfileModelImplCopyWithImpl(_$ProfileModelImpl _value, $Res Function(_$ProfileModelImpl) _then) : super(_value, _then); +class __$$ProfileModelImplCopyWithImpl<$Res> + extends _$ProfileModelCopyWithImpl<$Res, _$ProfileModelImpl> + implements _$$ProfileModelImplCopyWith<$Res> { + __$$ProfileModelImplCopyWithImpl( + _$ProfileModelImpl _value, $Res Function(_$ProfileModelImpl) _then) + : super(_value, _then); /// Create a copy of ProfileModel /// with the given fields replaced by the non-null parameter values. @@ -231,7 +231,8 @@ class _$ProfileModelImpl implements _ProfileModel { @JsonKey(name: "slug") required this.slug, @JsonKey(name: "profile_photo_url") required this.profilePhotoUrl}); - factory _$ProfileModelImpl.fromJson(Map json) => _$$ProfileModelImplFromJson(json); + factory _$ProfileModelImpl.fromJson(Map json) => + _$$ProfileModelImplFromJson(json); @override @JsonKey(name: "id") @@ -274,24 +275,31 @@ class _$ProfileModelImpl implements _ProfileModel { (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.email, email) || other.email == email) && - (identical(other.emailVerifiedAt, emailVerifiedAt) || other.emailVerifiedAt == emailVerifiedAt) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && - (identical(other.isPublicProfile, isPublicProfile) || other.isPublicProfile == isPublicProfile) && + (identical(other.emailVerifiedAt, emailVerifiedAt) || + other.emailVerifiedAt == emailVerifiedAt) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.isPublicProfile, isPublicProfile) || + other.isPublicProfile == isPublicProfile) && (identical(other.slug, slug) || other.slug == slug) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoUrl, profilePhotoUrl) || + other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, email, emailVerifiedAt, createdAt, updatedAt, isPublicProfile, slug, profilePhotoUrl); + int get hashCode => Object.hash(runtimeType, id, name, email, emailVerifiedAt, + createdAt, updatedAt, isPublicProfile, slug, profilePhotoUrl); /// Create a copy of ProfileModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => __$$ProfileModelImplCopyWithImpl<_$ProfileModelImpl>(this, _$identity); + _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => + __$$ProfileModelImplCopyWithImpl<_$ProfileModelImpl>(this, _$identity); @override Map toJson() { @@ -311,42 +319,36 @@ abstract class _ProfileModel implements ProfileModel { @JsonKey(name: "updated_at") final DateTime? updatedAt, @JsonKey(name: "is_public_profile") required final bool isPublicProfile, @JsonKey(name: "slug") required final String slug, - @JsonKey(name: "profile_photo_url") required final String profilePhotoUrl}) = _$ProfileModelImpl; + @JsonKey(name: "profile_photo_url") + required final String profilePhotoUrl}) = _$ProfileModelImpl; - factory _ProfileModel.fromJson(Map json) = _$ProfileModelImpl.fromJson; + factory _ProfileModel.fromJson(Map json) = + _$ProfileModelImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "email") String get email; - @override @JsonKey(name: "email_verified_at") DateTime? get emailVerifiedAt; - @override @JsonKey(name: "created_at") DateTime? get createdAt; - @override @JsonKey(name: "updated_at") DateTime? get updatedAt; - @override @JsonKey(name: "is_public_profile") bool get isPublicProfile; - @override @JsonKey(name: "slug") String get slug; - @override @JsonKey(name: "profile_photo_url") String get profilePhotoUrl; @@ -355,7 +357,8 @@ abstract class _ProfileModel implements ProfileModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => + throw _privateConstructorUsedError; } ProfileDetailsModel _$ProfileDetailsModelFromJson(Map json) { @@ -366,82 +369,56 @@ ProfileDetailsModel _$ProfileDetailsModelFromJson(Map json) { mixin _$ProfileDetailsModel { @JsonKey(name: "first_name") String get firstName => throw _privateConstructorUsedError; - @JsonKey(name: "last_name") String get lastName => throw _privateConstructorUsedError; - @JsonKey(name: "birthdate") String get birthdate => throw _privateConstructorUsedError; - @JsonKey(name: "gender") String get gender => throw _privateConstructorUsedError; - @JsonKey(name: "country") String get country => throw _privateConstructorUsedError; - @JsonKey(name: "city") String get city => throw _privateConstructorUsedError; - @JsonKey(name: "lang") String get lang => throw _privateConstructorUsedError; - @JsonKey(name: "weight") double get weight => throw _privateConstructorUsedError; - @JsonKey(name: "height") int get height => throw _privateConstructorUsedError; - @JsonKey(name: "chest_circumference") int get chestCircumference => throw _privateConstructorUsedError; - @JsonKey(name: "waist_circumference") int get waistCircumference => throw _privateConstructorUsedError; - @JsonKey(name: "hip_circumference") int get hipCircumference => throw _privateConstructorUsedError; - @JsonKey(name: "blood_pressure_up") int get bloodPressureUp => throw _privateConstructorUsedError; - @JsonKey(name: "blood_pressure_down") int get bloodPressureDown => throw _privateConstructorUsedError; - @JsonKey(name: "has_hypo") bool get hasHypo => throw _privateConstructorUsedError; - @JsonKey(name: "has_hyper") bool get hasHyper => throw _privateConstructorUsedError; - @JsonKey(name: "about_alergy") String get aboutAlergy => throw _privateConstructorUsedError; - @JsonKey(name: "about_taking_pils") String get aboutTakingPils => throw _privateConstructorUsedError; - @JsonKey(name: "about_sport_hobbies") String get aboutSportHobbies => throw _privateConstructorUsedError; - @JsonKey(name: "favorite_foods") String get favoriteFoods => throw _privateConstructorUsedError; - @JsonKey(name: "unfavorite_foods") String get unfavoriteFoods => throw _privateConstructorUsedError; - @JsonKey(name: "additional_info") String get additionalInfo => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime? get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime? get updatedAt => throw _privateConstructorUsedError; - @JsonKey(name: "is_mood_fillable") bool get isMoodFillable => throw _privateConstructorUsedError; - @JsonKey(name: "is_bedtime_fillable") bool get isBedtimeFillable => throw _privateConstructorUsedError; - @JsonKey(name: "activity_coefficient") double get activityCoefficient => throw _privateConstructorUsedError; @@ -451,14 +428,15 @@ mixin _$ProfileDetailsModel { /// Create a copy of ProfileDetailsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ProfileDetailsModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ProfileDetailsModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ProfileDetailsModelCopyWith<$Res> { - factory $ProfileDetailsModelCopyWith(ProfileDetailsModel value, $Res Function(ProfileDetailsModel) then) = + factory $ProfileDetailsModelCopyWith( + ProfileDetailsModel value, $Res Function(ProfileDetailsModel) then) = _$ProfileDetailsModelCopyWithImpl<$Res, ProfileDetailsModel>; - @useResult $Res call( {@JsonKey(name: "first_name") String firstName, @@ -491,12 +469,12 @@ abstract class $ProfileDetailsModelCopyWith<$Res> { } /// @nodoc -class _$ProfileDetailsModelCopyWithImpl<$Res, $Val extends ProfileDetailsModel> implements $ProfileDetailsModelCopyWith<$Res> { +class _$ProfileDetailsModelCopyWithImpl<$Res, $Val extends ProfileDetailsModel> + implements $ProfileDetailsModelCopyWith<$Res> { _$ProfileDetailsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -647,10 +625,11 @@ class _$ProfileDetailsModelCopyWithImpl<$Res, $Val extends ProfileDetailsModel> } /// @nodoc -abstract class _$$ProfileDetailsModelImplCopyWith<$Res> implements $ProfileDetailsModelCopyWith<$Res> { - factory _$$ProfileDetailsModelImplCopyWith(_$ProfileDetailsModelImpl value, $Res Function(_$ProfileDetailsModelImpl) then) = +abstract class _$$ProfileDetailsModelImplCopyWith<$Res> + implements $ProfileDetailsModelCopyWith<$Res> { + factory _$$ProfileDetailsModelImplCopyWith(_$ProfileDetailsModelImpl value, + $Res Function(_$ProfileDetailsModelImpl) then) = __$$ProfileDetailsModelImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -684,9 +663,12 @@ abstract class _$$ProfileDetailsModelImplCopyWith<$Res> implements $ProfileDetai } /// @nodoc -class __$$ProfileDetailsModelImplCopyWithImpl<$Res> extends _$ProfileDetailsModelCopyWithImpl<$Res, _$ProfileDetailsModelImpl> +class __$$ProfileDetailsModelImplCopyWithImpl<$Res> + extends _$ProfileDetailsModelCopyWithImpl<$Res, _$ProfileDetailsModelImpl> implements _$$ProfileDetailsModelImplCopyWith<$Res> { - __$$ProfileDetailsModelImplCopyWithImpl(_$ProfileDetailsModelImpl _value, $Res Function(_$ProfileDetailsModelImpl) _then) : super(_value, _then); + __$$ProfileDetailsModelImplCopyWithImpl(_$ProfileDetailsModelImpl _value, + $Res Function(_$ProfileDetailsModelImpl) _then) + : super(_value, _then); /// Create a copy of ProfileDetailsModel /// with the given fields replaced by the non-null parameter values. @@ -864,9 +846,11 @@ class _$ProfileDetailsModelImpl implements _ProfileDetailsModel { @JsonKey(name: "updated_at") this.updatedAt, @JsonKey(name: "is_mood_fillable") required this.isMoodFillable, @JsonKey(name: "is_bedtime_fillable") required this.isBedtimeFillable, - @JsonKey(name: "activity_coefficient") required this.activityCoefficient}); + @JsonKey(name: "activity_coefficient") + required this.activityCoefficient}); - factory _$ProfileDetailsModelImpl.fromJson(Map json) => _$$ProfileDetailsModelImplFromJson(json); + factory _$ProfileDetailsModelImpl.fromJson(Map json) => + _$$ProfileDetailsModelImplFromJson(json); @override @JsonKey(name: "first_name") @@ -960,33 +944,53 @@ class _$ProfileDetailsModelImpl implements _ProfileDetailsModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileDetailsModelImpl && - (identical(other.firstName, firstName) || other.firstName == firstName) && - (identical(other.lastName, lastName) || other.lastName == lastName) && - (identical(other.birthdate, birthdate) || other.birthdate == birthdate) && + (identical(other.firstName, firstName) || + other.firstName == firstName) && + (identical(other.lastName, lastName) || + other.lastName == lastName) && + (identical(other.birthdate, birthdate) || + other.birthdate == birthdate) && (identical(other.gender, gender) || other.gender == gender) && (identical(other.country, country) || other.country == country) && (identical(other.city, city) || other.city == city) && (identical(other.lang, lang) || other.lang == lang) && (identical(other.weight, weight) || other.weight == weight) && (identical(other.height, height) || other.height == height) && - (identical(other.chestCircumference, chestCircumference) || other.chestCircumference == chestCircumference) && - (identical(other.waistCircumference, waistCircumference) || other.waistCircumference == waistCircumference) && - (identical(other.hipCircumference, hipCircumference) || other.hipCircumference == hipCircumference) && - (identical(other.bloodPressureUp, bloodPressureUp) || other.bloodPressureUp == bloodPressureUp) && - (identical(other.bloodPressureDown, bloodPressureDown) || other.bloodPressureDown == bloodPressureDown) && + (identical(other.chestCircumference, chestCircumference) || + other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || + other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || + other.hipCircumference == hipCircumference) && + (identical(other.bloodPressureUp, bloodPressureUp) || + other.bloodPressureUp == bloodPressureUp) && + (identical(other.bloodPressureDown, bloodPressureDown) || + other.bloodPressureDown == bloodPressureDown) && (identical(other.hasHypo, hasHypo) || other.hasHypo == hasHypo) && - (identical(other.hasHyper, hasHyper) || other.hasHyper == hasHyper) && - (identical(other.aboutAlergy, aboutAlergy) || other.aboutAlergy == aboutAlergy) && - (identical(other.aboutTakingPils, aboutTakingPils) || other.aboutTakingPils == aboutTakingPils) && - (identical(other.aboutSportHobbies, aboutSportHobbies) || other.aboutSportHobbies == aboutSportHobbies) && - (identical(other.favoriteFoods, favoriteFoods) || other.favoriteFoods == favoriteFoods) && - (identical(other.unfavoriteFoods, unfavoriteFoods) || other.unfavoriteFoods == unfavoriteFoods) && - (identical(other.additionalInfo, additionalInfo) || other.additionalInfo == additionalInfo) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && - (identical(other.isMoodFillable, isMoodFillable) || other.isMoodFillable == isMoodFillable) && - (identical(other.isBedtimeFillable, isBedtimeFillable) || other.isBedtimeFillable == isBedtimeFillable) && - (identical(other.activityCoefficient, activityCoefficient) || other.activityCoefficient == activityCoefficient)); + (identical(other.hasHyper, hasHyper) || + other.hasHyper == hasHyper) && + (identical(other.aboutAlergy, aboutAlergy) || + other.aboutAlergy == aboutAlergy) && + (identical(other.aboutTakingPils, aboutTakingPils) || + other.aboutTakingPils == aboutTakingPils) && + (identical(other.aboutSportHobbies, aboutSportHobbies) || + other.aboutSportHobbies == aboutSportHobbies) && + (identical(other.favoriteFoods, favoriteFoods) || + other.favoriteFoods == favoriteFoods) && + (identical(other.unfavoriteFoods, unfavoriteFoods) || + other.unfavoriteFoods == unfavoriteFoods) && + (identical(other.additionalInfo, additionalInfo) || + other.additionalInfo == additionalInfo) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.isMoodFillable, isMoodFillable) || + other.isMoodFillable == isMoodFillable) && + (identical(other.isBedtimeFillable, isBedtimeFillable) || + other.isBedtimeFillable == isBedtimeFillable) && + (identical(other.activityCoefficient, activityCoefficient) || + other.activityCoefficient == activityCoefficient)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -1028,7 +1032,8 @@ class _$ProfileDetailsModelImpl implements _ProfileDetailsModel { @override @pragma('vm:prefer-inline') _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => - __$$ProfileDetailsModelImplCopyWithImpl<_$ProfileDetailsModelImpl>(this, _$identity); + __$$ProfileDetailsModelImplCopyWithImpl<_$ProfileDetailsModelImpl>( + this, _$identity); @override Map toJson() { @@ -1049,131 +1054,112 @@ abstract class _ProfileDetailsModel implements ProfileDetailsModel { @JsonKey(name: "lang") required final String lang, @JsonKey(name: "weight") required final double weight, @JsonKey(name: "height") required final int height, - @JsonKey(name: "chest_circumference") required final int chestCircumference, - @JsonKey(name: "waist_circumference") required final int waistCircumference, + @JsonKey(name: "chest_circumference") + required final int chestCircumference, + @JsonKey(name: "waist_circumference") + required final int waistCircumference, @JsonKey(name: "hip_circumference") required final int hipCircumference, @JsonKey(name: "blood_pressure_up") required final int bloodPressureUp, - @JsonKey(name: "blood_pressure_down") required final int bloodPressureDown, + @JsonKey(name: "blood_pressure_down") + required final int bloodPressureDown, @JsonKey(name: "has_hypo") required final bool hasHypo, @JsonKey(name: "has_hyper") required final bool hasHyper, @JsonKey(name: "about_alergy") required final String aboutAlergy, @JsonKey(name: "about_taking_pils") required final String aboutTakingPils, - @JsonKey(name: "about_sport_hobbies") required final String aboutSportHobbies, + @JsonKey(name: "about_sport_hobbies") + required final String aboutSportHobbies, @JsonKey(name: "favorite_foods") required final String favoriteFoods, @JsonKey(name: "unfavorite_foods") required final String unfavoriteFoods, @JsonKey(name: "additional_info") required final String additionalInfo, @JsonKey(name: "created_at") final DateTime? createdAt, @JsonKey(name: "updated_at") final DateTime? updatedAt, @JsonKey(name: "is_mood_fillable") required final bool isMoodFillable, - @JsonKey(name: "is_bedtime_fillable") required final bool isBedtimeFillable, - @JsonKey(name: "activity_coefficient") required final double activityCoefficient}) = _$ProfileDetailsModelImpl; + @JsonKey(name: "is_bedtime_fillable") + required final bool isBedtimeFillable, + @JsonKey(name: "activity_coefficient") + required final double activityCoefficient}) = _$ProfileDetailsModelImpl; - factory _ProfileDetailsModel.fromJson(Map json) = _$ProfileDetailsModelImpl.fromJson; + factory _ProfileDetailsModel.fromJson(Map json) = + _$ProfileDetailsModelImpl.fromJson; @override @JsonKey(name: "first_name") String get firstName; - @override @JsonKey(name: "last_name") String get lastName; - @override @JsonKey(name: "birthdate") String get birthdate; - @override @JsonKey(name: "gender") String get gender; - @override @JsonKey(name: "country") String get country; - @override @JsonKey(name: "city") String get city; - @override @JsonKey(name: "lang") String get lang; - @override @JsonKey(name: "weight") double get weight; - @override @JsonKey(name: "height") int get height; - @override @JsonKey(name: "chest_circumference") int get chestCircumference; - @override @JsonKey(name: "waist_circumference") int get waistCircumference; - @override @JsonKey(name: "hip_circumference") int get hipCircumference; - @override @JsonKey(name: "blood_pressure_up") int get bloodPressureUp; - @override @JsonKey(name: "blood_pressure_down") int get bloodPressureDown; - @override @JsonKey(name: "has_hypo") bool get hasHypo; - @override @JsonKey(name: "has_hyper") bool get hasHyper; - @override @JsonKey(name: "about_alergy") String get aboutAlergy; - @override @JsonKey(name: "about_taking_pils") String get aboutTakingPils; - @override @JsonKey(name: "about_sport_hobbies") String get aboutSportHobbies; - @override @JsonKey(name: "favorite_foods") String get favoriteFoods; - @override @JsonKey(name: "unfavorite_foods") String get unfavoriteFoods; - @override @JsonKey(name: "additional_info") String get additionalInfo; - @override @JsonKey(name: "created_at") DateTime? get createdAt; - @override @JsonKey(name: "updated_at") DateTime? get updatedAt; - @override @JsonKey(name: "is_mood_fillable") bool get isMoodFillable; - @override @JsonKey(name: "is_bedtime_fillable") bool get isBedtimeFillable; - @override @JsonKey(name: "activity_coefficient") double get activityCoefficient; @@ -1182,5 +1168,6 @@ abstract class _ProfileDetailsModel implements ProfileDetailsModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileDetailsModelImplCopyWith<_$ProfileDetailsModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/profile/models/profile_model.g.dart b/lib/features/profile/models/profile_model.g.dart index 56e201fb..28e10ccf 100644 --- a/lib/features/profile/models/profile_model.g.dart +++ b/lib/features/profile/models/profile_model.g.dart @@ -6,19 +6,27 @@ part of 'profile_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ProfileModelImpl _$$ProfileModelImplFromJson(Map json) => _$ProfileModelImpl( +_$ProfileModelImpl _$$ProfileModelImplFromJson(Map json) => + _$ProfileModelImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, email: json['email'] as String, - emailVerifiedAt: json['email_verified_at'] == null ? null : DateTime.parse(json['email_verified_at'] as String), - createdAt: json['created_at'] == null ? null : DateTime.parse(json['created_at'] as String), - updatedAt: json['updated_at'] == null ? null : DateTime.parse(json['updated_at'] as String), + emailVerifiedAt: json['email_verified_at'] == null + ? null + : DateTime.parse(json['email_verified_at'] as String), + createdAt: json['created_at'] == null + ? null + : DateTime.parse(json['created_at'] as String), + updatedAt: json['updated_at'] == null + ? null + : DateTime.parse(json['updated_at'] as String), isPublicProfile: json['is_public_profile'] as bool, slug: json['slug'] as String, profilePhotoUrl: json['profile_photo_url'] as String, ); -Map _$$ProfileModelImplToJson(_$ProfileModelImpl instance) => { +Map _$$ProfileModelImplToJson(_$ProfileModelImpl instance) => + { 'id': instance.id, 'name': instance.name, 'email': instance.email, @@ -30,7 +38,9 @@ Map _$$ProfileModelImplToJson(_$ProfileModelImpl instance) => < 'profile_photo_url': instance.profilePhotoUrl, }; -_$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson(Map json) => _$ProfileDetailsModelImpl( +_$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson( + Map json) => + _$ProfileDetailsModelImpl( firstName: json['first_name'] as String, lastName: json['last_name'] as String, birthdate: json['birthdate'] as String, @@ -53,14 +63,20 @@ _$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson(Map _$$ProfileDetailsModelImplToJson(_$ProfileDetailsModelImpl instance) => { +Map _$$ProfileDetailsModelImplToJson( + _$ProfileDetailsModelImpl instance) => + { 'first_name': instance.firstName, 'last_name': instance.lastName, 'birthdate': instance.birthdate, diff --git a/lib/features/profile/models/weight_model.dart b/lib/features/profile/models/weight_model.dart new file mode 100644 index 00000000..1a24424e --- /dev/null +++ b/lib/features/profile/models/weight_model.dart @@ -0,0 +1,18 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'weight_model.freezed.dart'; +part 'weight_model.g.dart'; + +@freezed +class WeightModel with _$WeightModel { + const factory WeightModel({ + @JsonKey(name: "id") required int id, + @JsonKey(name: "user_id") required int userId, + @JsonKey(name: "weight") required int weight, + @JsonKey(name: "created_at") required DateTime createdAt, + @JsonKey(name: "updated_at") required DateTime updatedAt, + @JsonKey(name: "bmi") required double bmi, + }) = _WeightModel; + + factory WeightModel.fromJson(Map json) => _$WeightModelFromJson(json); +} diff --git a/lib/features/profile/models/weight_model.freezed.dart b/lib/features/profile/models/weight_model.freezed.dart new file mode 100644 index 00000000..3ca65637 --- /dev/null +++ b/lib/features/profile/models/weight_model.freezed.dart @@ -0,0 +1,289 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'weight_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +WeightModel _$WeightModelFromJson(Map json) { + return _WeightModel.fromJson(json); +} + +/// @nodoc +mixin _$WeightModel { + @JsonKey(name: "id") + int get id => throw _privateConstructorUsedError; + @JsonKey(name: "user_id") + int get userId => throw _privateConstructorUsedError; + @JsonKey(name: "weight") + int get weight => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") + DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") + DateTime get updatedAt => throw _privateConstructorUsedError; + @JsonKey(name: "bmi") + double get bmi => throw _privateConstructorUsedError; + + /// Serializes this WeightModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of WeightModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $WeightModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $WeightModelCopyWith<$Res> { + factory $WeightModelCopyWith( + WeightModel value, $Res Function(WeightModel) then) = + _$WeightModelCopyWithImpl<$Res, WeightModel>; + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "weight") int weight, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt, + @JsonKey(name: "bmi") double bmi}); +} + +/// @nodoc +class _$WeightModelCopyWithImpl<$Res, $Val extends WeightModel> + implements $WeightModelCopyWith<$Res> { + _$WeightModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of WeightModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? weight = null, + Object? createdAt = null, + Object? updatedAt = null, + Object? bmi = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + weight: null == weight + ? _value.weight + : weight // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + bmi: null == bmi + ? _value.bmi + : bmi // ignore: cast_nullable_to_non_nullable + as double, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$WeightModelImplCopyWith<$Res> + implements $WeightModelCopyWith<$Res> { + factory _$$WeightModelImplCopyWith( + _$WeightModelImpl value, $Res Function(_$WeightModelImpl) then) = + __$$WeightModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "weight") int weight, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt, + @JsonKey(name: "bmi") double bmi}); +} + +/// @nodoc +class __$$WeightModelImplCopyWithImpl<$Res> + extends _$WeightModelCopyWithImpl<$Res, _$WeightModelImpl> + implements _$$WeightModelImplCopyWith<$Res> { + __$$WeightModelImplCopyWithImpl( + _$WeightModelImpl _value, $Res Function(_$WeightModelImpl) _then) + : super(_value, _then); + + /// Create a copy of WeightModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? weight = null, + Object? createdAt = null, + Object? updatedAt = null, + Object? bmi = null, + }) { + return _then(_$WeightModelImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + weight: null == weight + ? _value.weight + : weight // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + bmi: null == bmi + ? _value.bmi + : bmi // ignore: cast_nullable_to_non_nullable + as double, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$WeightModelImpl implements _WeightModel { + const _$WeightModelImpl( + {@JsonKey(name: "id") required this.id, + @JsonKey(name: "user_id") required this.userId, + @JsonKey(name: "weight") required this.weight, + @JsonKey(name: "created_at") required this.createdAt, + @JsonKey(name: "updated_at") required this.updatedAt, + @JsonKey(name: "bmi") required this.bmi}); + + factory _$WeightModelImpl.fromJson(Map json) => + _$$WeightModelImplFromJson(json); + + @override + @JsonKey(name: "id") + final int id; + @override + @JsonKey(name: "user_id") + final int userId; + @override + @JsonKey(name: "weight") + final int weight; + @override + @JsonKey(name: "created_at") + final DateTime createdAt; + @override + @JsonKey(name: "updated_at") + final DateTime updatedAt; + @override + @JsonKey(name: "bmi") + final double bmi; + + @override + String toString() { + return 'WeightModel(id: $id, userId: $userId, weight: $weight, createdAt: $createdAt, updatedAt: $updatedAt, bmi: $bmi)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$WeightModelImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.userId, userId) || other.userId == userId) && + (identical(other.weight, weight) || other.weight == weight) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.bmi, bmi) || other.bmi == bmi)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, id, userId, weight, createdAt, updatedAt, bmi); + + /// Create a copy of WeightModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$WeightModelImplCopyWith<_$WeightModelImpl> get copyWith => + __$$WeightModelImplCopyWithImpl<_$WeightModelImpl>(this, _$identity); + + @override + Map toJson() { + return _$$WeightModelImplToJson( + this, + ); + } +} + +abstract class _WeightModel implements WeightModel { + const factory _WeightModel( + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "user_id") required final int userId, + @JsonKey(name: "weight") required final int weight, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt, + @JsonKey(name: "bmi") required final double bmi}) = _$WeightModelImpl; + + factory _WeightModel.fromJson(Map json) = + _$WeightModelImpl.fromJson; + + @override + @JsonKey(name: "id") + int get id; + @override + @JsonKey(name: "user_id") + int get userId; + @override + @JsonKey(name: "weight") + int get weight; + @override + @JsonKey(name: "created_at") + DateTime get createdAt; + @override + @JsonKey(name: "updated_at") + DateTime get updatedAt; + @override + @JsonKey(name: "bmi") + double get bmi; + + /// Create a copy of WeightModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$WeightModelImplCopyWith<_$WeightModelImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/profile/models/weight_model.g.dart b/lib/features/profile/models/weight_model.g.dart new file mode 100644 index 00000000..cd18ea8b --- /dev/null +++ b/lib/features/profile/models/weight_model.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'weight_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$WeightModelImpl _$$WeightModelImplFromJson(Map json) => + _$WeightModelImpl( + id: (json['id'] as num).toInt(), + userId: (json['user_id'] as num).toInt(), + weight: (json['weight'] as num).toInt(), + createdAt: DateTime.parse(json['created_at'] as String), + updatedAt: DateTime.parse(json['updated_at'] as String), + bmi: (json['bmi'] as num).toDouble(), + ); + +Map _$$WeightModelImplToJson(_$WeightModelImpl instance) => + { + 'id': instance.id, + 'user_id': instance.userId, + 'weight': instance.weight, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + 'bmi': instance.bmi, + }; diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index 6cdcff7a..11fb8f42 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -15,6 +15,8 @@ class ProfileCubit extends Cubit { profile: await profileRepository.getProfileBySlug(slug), profileDetails: await profileRepository.getMyProfileDetails(), blogPosts: await profileRepository.getBlogPostsByAuthorSlug(slug: slug), + weightPoints: await profileRepository.getWeight(period: '1', slug: slug), + circumferencePoints: await profileRepository.getCircumferences(period: '1', slug: slug), )); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); @@ -29,6 +31,8 @@ class ProfileCubit extends Cubit { profile: profile, profileDetails: await profileRepository.getMyProfileDetails(), blogPosts: await profileRepository.getBlogPostsByAuthorSlug(slug: profile.slug), + weightPoints: await profileRepository.getWeight(period: '1'), + circumferencePoints: await profileRepository.getCircumferences(period: '1'), )); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart index ff3c148f..696008ac 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart @@ -1,5 +1,7 @@ import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; +import 'package:eatvio_app/features/profile/models/circumference_model.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/profile/models/weight_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'profile_state.freezed.dart'; @@ -14,6 +16,8 @@ abstract class ProfileState with _$ProfileState { required ProfileModel profile, required ProfileDetailsModel profileDetails, required List blogPosts, + required List weightPoints, + required List circumferencePoints, }) = ProfileStateLoaded; const factory ProfileState.error({ diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart index e8e4c2ba..b110d522 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart @@ -20,16 +20,27 @@ mixin _$ProfileState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, + required TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult? Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +48,13 @@ mixin _$ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,16 +88,18 @@ mixin _$ProfileState { /// @nodoc abstract class $ProfileStateCopyWith<$Res> { - factory $ProfileStateCopyWith(ProfileState value, $Res Function(ProfileState) then) = _$ProfileStateCopyWithImpl<$Res, ProfileState>; + factory $ProfileStateCopyWith( + ProfileState value, $Res Function(ProfileState) then) = + _$ProfileStateCopyWithImpl<$Res, ProfileState>; } /// @nodoc -class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> implements $ProfileStateCopyWith<$Res> { +class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> + implements $ProfileStateCopyWith<$Res> { _$ProfileStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +109,18 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> implements $Pr /// @nodoc abstract class _$$ProfileStateImplCopyWith<$Res> { - factory _$$ProfileStateImplCopyWith(_$ProfileStateImpl value, $Res Function(_$ProfileStateImpl) then) = __$$ProfileStateImplCopyWithImpl<$Res>; + factory _$$ProfileStateImplCopyWith( + _$ProfileStateImpl value, $Res Function(_$ProfileStateImpl) then) = + __$$ProfileStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileStateImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateImpl> implements _$$ProfileStateImplCopyWith<$Res> { - __$$ProfileStateImplCopyWithImpl(_$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then) : super(_value, _then); +class __$$ProfileStateImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateImpl> + implements _$$ProfileStateImplCopyWith<$Res> { + __$$ProfileStateImplCopyWithImpl( + _$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then) + : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +138,8 @@ class _$ProfileStateImpl implements _ProfileState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ProfileStateImpl); } @override @@ -124,7 +150,13 @@ class _$ProfileStateImpl implements _ProfileState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, + required TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -135,7 +167,13 @@ class _$ProfileStateImpl implements _ProfileState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult? Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -146,7 +184,13 @@ class _$ProfileStateImpl implements _ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -200,14 +244,18 @@ abstract class _ProfileState implements ProfileState { /// @nodoc abstract class _$$ProfileStateLoadingImplCopyWith<$Res> { - factory _$$ProfileStateLoadingImplCopyWith(_$ProfileStateLoadingImpl value, $Res Function(_$ProfileStateLoadingImpl) then) = + factory _$$ProfileStateLoadingImplCopyWith(_$ProfileStateLoadingImpl value, + $Res Function(_$ProfileStateLoadingImpl) then) = __$$ProfileStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ProfileStateLoadingImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadingImpl> +class __$$ProfileStateLoadingImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadingImpl> implements _$$ProfileStateLoadingImplCopyWith<$Res> { - __$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value, $Res Function(_$ProfileStateLoadingImpl) _then) : super(_value, _then); + __$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value, + $Res Function(_$ProfileStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +273,9 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileStateLoadingImpl); } @override @@ -236,7 +286,13 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, + required TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -247,7 +303,13 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult? Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -258,7 +320,13 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -312,21 +380,28 @@ abstract class ProfileStateLoading implements ProfileState { /// @nodoc abstract class _$$ProfileStateLoadedImplCopyWith<$Res> { - factory _$$ProfileStateLoadedImplCopyWith(_$ProfileStateLoadedImpl value, $Res Function(_$ProfileStateLoadedImpl) then) = + factory _$$ProfileStateLoadedImplCopyWith(_$ProfileStateLoadedImpl value, + $Res Function(_$ProfileStateLoadedImpl) then) = __$$ProfileStateLoadedImplCopyWithImpl<$Res>; - @useResult - $Res call({ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts}); + $Res call( + {ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints}); $ProfileModelCopyWith<$Res> get profile; - $ProfileDetailsModelCopyWith<$Res> get profileDetails; } /// @nodoc -class __$$ProfileStateLoadedImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadedImpl> +class __$$ProfileStateLoadedImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadedImpl> implements _$$ProfileStateLoadedImplCopyWith<$Res> { - __$$ProfileStateLoadedImplCopyWithImpl(_$ProfileStateLoadedImpl _value, $Res Function(_$ProfileStateLoadedImpl) _then) : super(_value, _then); + __$$ProfileStateLoadedImplCopyWithImpl(_$ProfileStateLoadedImpl _value, + $Res Function(_$ProfileStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -336,6 +411,8 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> extends _$ProfileStateCopyWit Object? profile = null, Object? profileDetails = null, Object? blogPosts = null, + Object? weightPoints = null, + Object? circumferencePoints = null, }) { return _then(_$ProfileStateLoadedImpl( profile: null == profile @@ -350,6 +427,14 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> extends _$ProfileStateCopyWit ? _value._blogPosts : blogPosts // ignore: cast_nullable_to_non_nullable as List, + weightPoints: null == weightPoints + ? _value._weightPoints + : weightPoints // ignore: cast_nullable_to_non_nullable + as List, + circumferencePoints: null == circumferencePoints + ? _value._circumferencePoints + : circumferencePoints // ignore: cast_nullable_to_non_nullable + as List, )); } @@ -377,15 +462,21 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> extends _$ProfileStateCopyWit /// @nodoc class _$ProfileStateLoadedImpl implements ProfileStateLoaded { - const _$ProfileStateLoadedImpl({required this.profile, required this.profileDetails, required final List blogPosts}) - : _blogPosts = blogPosts; + const _$ProfileStateLoadedImpl( + {required this.profile, + required this.profileDetails, + required final List blogPosts, + required final List weightPoints, + required final List circumferencePoints}) + : _blogPosts = blogPosts, + _weightPoints = weightPoints, + _circumferencePoints = circumferencePoints; @override final ProfileModel profile; @override final ProfileDetailsModel profileDetails; final List _blogPosts; - @override List get blogPosts { if (_blogPosts is EqualUnmodifiableListView) return _blogPosts; @@ -393,9 +484,26 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { return EqualUnmodifiableListView(_blogPosts); } + final List _weightPoints; + @override + List get weightPoints { + if (_weightPoints is EqualUnmodifiableListView) return _weightPoints; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_weightPoints); + } + + final List _circumferencePoints; + @override + List get circumferencePoints { + if (_circumferencePoints is EqualUnmodifiableListView) + return _circumferencePoints; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_circumferencePoints); + } + @override String toString() { - return 'ProfileState.loaded(profile: $profile, profileDetails: $profileDetails, blogPosts: $blogPosts)'; + return 'ProfileState.loaded(profile: $profile, profileDetails: $profileDetails, blogPosts: $blogPosts, weightPoints: $weightPoints, circumferencePoints: $circumferencePoints)'; } @override @@ -404,12 +512,24 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { (other.runtimeType == runtimeType && other is _$ProfileStateLoadedImpl && (identical(other.profile, profile) || other.profile == profile) && - (identical(other.profileDetails, profileDetails) || other.profileDetails == profileDetails) && - const DeepCollectionEquality().equals(other._blogPosts, _blogPosts)); + (identical(other.profileDetails, profileDetails) || + other.profileDetails == profileDetails) && + const DeepCollectionEquality() + .equals(other._blogPosts, _blogPosts) && + const DeepCollectionEquality() + .equals(other._weightPoints, _weightPoints) && + const DeepCollectionEquality() + .equals(other._circumferencePoints, _circumferencePoints)); } @override - int get hashCode => Object.hash(runtimeType, profile, profileDetails, const DeepCollectionEquality().hash(_blogPosts)); + int get hashCode => Object.hash( + runtimeType, + profile, + profileDetails, + const DeepCollectionEquality().hash(_blogPosts), + const DeepCollectionEquality().hash(_weightPoints), + const DeepCollectionEquality().hash(_circumferencePoints)); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -417,17 +537,25 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { @override @pragma('vm:prefer-inline') _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => - __$$ProfileStateLoadedImplCopyWithImpl<_$ProfileStateLoadedImpl>(this, _$identity); + __$$ProfileStateLoadedImplCopyWithImpl<_$ProfileStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, + required TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints) + loaded, required TResult Function(String errorMessage) error, }) { - return loaded(profile, profileDetails, blogPosts); + return loaded( + profile, profileDetails, blogPosts, weightPoints, circumferencePoints); } @override @@ -435,10 +563,17 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult? Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult? Function(String errorMessage)? error, }) { - return loaded?.call(profile, profileDetails, blogPosts); + return loaded?.call( + profile, profileDetails, blogPosts, weightPoints, circumferencePoints); } @override @@ -446,12 +581,19 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { if (loaded != null) { - return loaded(profile, profileDetails, blogPosts); + return loaded(profile, profileDetails, blogPosts, weightPoints, + circumferencePoints); } return orElse(); } @@ -496,35 +638,42 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { abstract class ProfileStateLoaded implements ProfileState { const factory ProfileStateLoaded( - {required final ProfileModel profile, - required final ProfileDetailsModel profileDetails, - required final List blogPosts}) = _$ProfileStateLoadedImpl; + {required final ProfileModel profile, + required final ProfileDetailsModel profileDetails, + required final List blogPosts, + required final List weightPoints, + required final List circumferencePoints}) = + _$ProfileStateLoadedImpl; ProfileModel get profile; - ProfileDetailsModel get profileDetails; - List get blogPosts; + List get weightPoints; + List get circumferencePoints; /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ProfileStateErrorImplCopyWith<$Res> { - factory _$$ProfileStateErrorImplCopyWith(_$ProfileStateErrorImpl value, $Res Function(_$ProfileStateErrorImpl) then) = + factory _$$ProfileStateErrorImplCopyWith(_$ProfileStateErrorImpl value, + $Res Function(_$ProfileStateErrorImpl) then) = __$$ProfileStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ProfileStateErrorImplCopyWithImpl<$Res> extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateErrorImpl> +class __$$ProfileStateErrorImplCopyWithImpl<$Res> + extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateErrorImpl> implements _$$ProfileStateErrorImplCopyWith<$Res> { - __$$ProfileStateErrorImplCopyWithImpl(_$ProfileStateErrorImpl _value, $Res Function(_$ProfileStateErrorImpl) _then) : super(_value, _then); + __$$ProfileStateErrorImplCopyWithImpl(_$ProfileStateErrorImpl _value, + $Res Function(_$ProfileStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -560,7 +709,8 @@ class _$ProfileStateErrorImpl implements ProfileStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ProfileStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -571,14 +721,22 @@ class _$ProfileStateErrorImpl implements ProfileStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => __$$ProfileStateErrorImplCopyWithImpl<_$ProfileStateErrorImpl>(this, _$identity); + _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => + __$$ProfileStateErrorImplCopyWithImpl<_$ProfileStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts) loaded, + required TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -589,7 +747,13 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult? Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -600,7 +764,13 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts)? loaded, + TResult Function( + ProfileModel profile, + ProfileDetailsModel profileDetails, + List blogPosts, + List weightPoints, + List circumferencePoints)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -649,12 +819,14 @@ class _$ProfileStateErrorImpl implements ProfileStateError { } abstract class ProfileStateError implements ProfileState { - const factory ProfileStateError({required final String errorMessage}) = _$ProfileStateErrorImpl; + const factory ProfileStateError({required final String errorMessage}) = + _$ProfileStateErrorImpl; String get errorMessage; /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index c31a7d2f..b388853a 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -1,8 +1,13 @@ import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/feed/presentation/widgets/blog_post_widget.dart'; +import 'package:eatvio_app/features/profile/models/circumference_model.dart'; +import 'package:eatvio_app/features/profile/models/weight_model.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart'; +import 'package:eatvio_app/features/profile/presentation/widgets/circumference_chart_widget.dart'; +import 'package:eatvio_app/features/profile/presentation/widgets/imt_chart_widget.dart'; +import 'package:eatvio_app/features/profile/presentation/widgets/weight_chart_widget.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; @@ -21,8 +26,8 @@ class ProfileScreen extends StatefulWidget { } class _ProfileScreenState extends State { - // List chartData = []; - // List chartPoints = []; + List circumferencePoints = []; + List weightPoints = []; final List chipsLabelList = ['Вес', 'Замеры', 'ИМТ']; final List chipsIntervalLabelList = ['1М', '3М', '6М', '1Г', 'ВСЁ ВРЕМЯ']; int _selectedChipIndex = 0; @@ -40,8 +45,8 @@ class _ProfileScreenState extends State { child: BlocBuilder( builder: (BuildContext context, ProfileState state) { if (state is ProfileStateLoaded) { - // chartData = state.profile.circumferences; - // chartPoints = state.profile.chartPoints; + circumferencePoints = state.circumferencePoints; + weightPoints = state.weightPoints; return Scaffold( backgroundColor: Colors.grey.shade200, appBar: widget.author == null ? AppBar(toolbarHeight: 0) : AppBar(), @@ -209,25 +214,27 @@ class _ProfileScreenState extends State { ], ), ), - // Builder( - // builder: (context) { - // switch (_selectedChipIndex) { - // case 0: - // return WeightChartWidget( - // chartPoints: chartPoints, - // profileCubit: context.read(), - // ); - // case 1: - // return CircumferenceChartWidget( - // chartData: chartData, - // profileCubit: context.read(), - // ); - // case 2: - // return ImtChartWidget(chartPoints: chartPoints); - // } - // return SizedBox.shrink(); - // }, - // ), + Builder( + builder: (context) { + switch (_selectedChipIndex) { + case 0: + return WeightChartWidget( + weightPoints: weightPoints, + profileCubit: context.read(), + ); + case 1: + return CircumferenceChartWidget( + circumferencePoints: circumferencePoints, + profileCubit: context.read(), + ); + case 2: + return ImtChartWidget( + weightPoints: weightPoints, + ); + } + return SizedBox.shrink(); + }, + ), SizedBox(height: 8), Row( children: [ diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index a27450ce..21fef10c 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -1,374 +1,374 @@ -// -// import 'package:eatvio_app/features/profile/models/profile_model.dart'; -// import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; -// import 'package:flutter/cupertino.dart'; -// import 'package:flutter/material.dart'; -// import 'package:intl/intl.dart'; -// import 'package:syncfusion_flutter_charts/charts.dart'; -// -// class CircumferenceChartWidget extends StatefulWidget { -// final List chartData; -// final ProfileCubit profileCubit; -// -// const CircumferenceChartWidget({ -// super.key, -// required this.chartData, -// required this.profileCubit, -// }); -// -// @override -// State createState() => _CircumferenceChartWidgetState(); -// } -// -// class _CircumferenceChartWidgetState extends State { -// late FixedExtentScrollController chestController; -// late FixedExtentScrollController waistController; -// late FixedExtentScrollController hipController; -// late int chest; -// late int waist; -// late int hip; -// -// @override -// Widget build(BuildContext context) { -// return Column( -// children: [ -// if (widget.chartData.isNotEmpty) -// Padding( -// padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), -// child: Row( -// children: [ -// Text( -// '${widget.chartData.last.chestCircumference}', -// style: TextStyle( -// color: Colors.black, -// fontSize: 40, -// fontWeight: FontWeight.w500, -// ), -// ), -// if (widget.chartData.length == 1) -// Container( -// margin: EdgeInsets.symmetric(horizontal: 12), -// width: 8, -// height: 8, -// decoration: BoxDecoration( -// shape: BoxShape.circle, -// color: Colors.black12, -// ), -// ), -// if (widget.chartData.length > 1) -// widget.chartData.last.chestCircumference > widget.chartData[widget.chartData.length - 2].chestCircumference -// ? Icon( -// Icons.arrow_drop_up, -// size: 40, -// color: Colors.grey, -// ) -// : Icon( -// Icons.arrow_drop_down, -// size: 40, -// color: Colors.grey, -// ), -// Text( -// '${widget.chartData.last.waistCircumference}', -// style: TextStyle( -// color: Colors.black, -// fontSize: 40, -// fontWeight: FontWeight.w500, -// ), -// ), -// if (widget.chartData.length == 1) -// Container( -// margin: EdgeInsets.symmetric(horizontal: 12), -// width: 8, -// height: 8, -// decoration: BoxDecoration( -// shape: BoxShape.circle, -// color: Colors.black12, -// ), -// ), -// if (widget.chartData.length > 1) -// widget.chartData.last.waistCircumference > widget.chartData[widget.chartData.length - 2].waistCircumference -// ? Icon( -// Icons.arrow_drop_up, -// size: 40, -// color: Colors.grey, -// ) -// : Icon( -// Icons.arrow_drop_down, -// size: 40, -// color: Colors.grey, -// ), -// Text( -// '${widget.chartData.last.hipCircumference}', -// style: TextStyle( -// color: Colors.black, -// fontSize: 40, -// fontWeight: FontWeight.w500, -// ), -// ), -// if (widget.chartData.length == 1) -// Container( -// margin: EdgeInsets.symmetric(horizontal: 12), -// width: 8, -// height: 8, -// decoration: BoxDecoration( -// shape: BoxShape.circle, -// color: Colors.black12, -// ), -// ), -// if (widget.chartData.length > 1) -// widget.chartData.last.hipCircumference > widget.chartData[widget.chartData.length - 2].hipCircumference -// ? Icon( -// Icons.arrow_drop_up, -// size: 40, -// color: Colors.grey, -// ) -// : Icon( -// Icons.arrow_drop_down, -// size: 40, -// color: Colors.grey, -// ), -// ], -// ), -// ), -// Stack( -// alignment: Alignment.bottomRight, -// children: [ -// SfCartesianChart( -// margin: EdgeInsets.symmetric(horizontal: 8), -// enableAxisAnimation: true, -// plotAreaBorderWidth: 0, -// trackballBehavior: TrackballBehavior( -// enable: true, -// activationMode: ActivationMode.singleTap, -// tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, -// tooltipSettings: InteractiveTooltip(), -// lineType: TrackballLineType.vertical, -// ), -// primaryXAxis: DateTimeCategoryAxis( -// tickPosition: TickPosition.inside, -// majorTickLines: MajorTickLines( -// size: 0, -// ), -// edgeLabelPlacement: EdgeLabelPlacement.shift, -// dateFormat: DateFormat.MMMd('ru'), -// labelStyle: TextStyle( -// color: Colors.grey, -// ), -// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), -// axisLine: AxisLine( -// color: Colors.grey.withOpacity(0.3), -// width: 0.4, -// ), -// ), -// primaryYAxis: NumericAxis( -// isVisible: false, -// labelFormat: '{value} см', -// axisLine: AxisLine( -// width: 1, -// ), -// majorTickLines: MajorTickLines(size: 0), -// ), -// series: _getSplineSeries(), -// tooltipBehavior: TooltipBehavior(enable: true), -// ), -// FloatingActionButton.small( -// heroTag: 'addCircumference', -// onPressed: () { -// if (widget.chartData.isNotEmpty) { -// chest = widget.chartData.last.chestCircumference; -// waist = widget.chartData.last.waistCircumference; -// hip = widget.chartData.last.hipCircumference; -// chestController = FixedExtentScrollController(initialItem: chest - 20); -// waistController = FixedExtentScrollController(initialItem: waist - 20); -// hipController = FixedExtentScrollController(initialItem: hip - 20); -// } else { -// chestController = FixedExtentScrollController(); -// waistController = FixedExtentScrollController(); -// hipController = FixedExtentScrollController(); -// } -// showModalBottomSheet( -// useRootNavigator: true, -// context: context, -// builder: (context) { -// return Column( -// children: [ -// Expanded( -// child: Row( -// children: [ -// Expanded( -// child: CupertinoPicker( -// magnification: 1.22, -// squeeze: 1.2, -// useMagnifier: true, -// scrollController: chestController, -// itemExtent: 24, -// onSelectedItemChanged: (int value) { -// chest = value; -// }, -// children: [ -// for (int i = 20; i < 200; i++) Text('$i'), -// ], -// ), -// ), -// Expanded( -// child: CupertinoPicker( -// magnification: 1.22, -// squeeze: 1.2, -// useMagnifier: true, -// scrollController: waistController, -// itemExtent: 24, -// onSelectedItemChanged: (int value) { -// waist = value; -// }, -// children: [ -// for (int i = 20; i < 200; i++) Text('$i'), -// ], -// ), -// ), -// Expanded( -// child: CupertinoPicker( -// magnification: 1.22, -// squeeze: 1.2, -// useMagnifier: true, -// scrollController: hipController, -// itemExtent: 24, -// onSelectedItemChanged: (int value) { -// hip = value; -// }, -// children: [ -// for (int i = 20; i < 200; i++) Text('$i'), -// ], -// ), -// ), -// ], -// ), -// ), -// InkWell( -// onTap: () { -// widget.profileCubit.addCircumference( -// chestCircumference: chest, -// waistCircumference: waist, -// hipCircumference: hip, -// ); -// Navigator.of(context).pop(); -// }, -// borderRadius: BorderRadius.circular(16), -// child: Ink( -// width: MediaQuery.of(context).size.width - 32, -// padding: EdgeInsets.all(16), -// decoration: BoxDecoration( -// color: appTheme.blueA400, -// borderRadius: BorderRadius.circular(16), -// ), -// child: Center( -// child: Text( -// 'Сохранить', -// style: TextStyle( -// color: Colors.white, -// ), -// ), -// ), -// ), -// ), -// ], -// ); -// }, -// ); -// }, -// backgroundColor: Colors.red, -// shape: CircleBorder(), -// child: Icon( -// Icons.add, -// color: Colors.white, -// ), -// ), -// ], -// ), -// ], -// ); -// } -// -// List> _getSplineSeries() { -// final Color seriesColor1 = Colors.red; -// final Color seriesColor2 = appTheme.blueA400; -// final Color seriesColor3 = Colors.green; -// -// return >[ -// SplineAreaSeries( -// markerSettings: MarkerSettings( -// isVisible: true, -// color: seriesColor1, -// height: 8, -// width: 8, -// ), -// dataLabelSettings: DataLabelSettings( -// labelAlignment: ChartDataLabelAlignment.top, -// isVisible: true, -// ), -// dataSource: widget.chartData, -// borderColor: seriesColor1, -// gradient: LinearGradient( -// colors: [ -// seriesColor1.withOpacity(0.14), -// Colors.transparent, -// ], -// begin: Alignment.topCenter, -// end: Alignment(0, 0.6), -// ), -// name: 'Грудь', -// xValueMapper: (Circumference value, int index) => value.createdAt, -// yValueMapper: (Circumference value, int index) => value.chestCircumference, -// ), -// SplineAreaSeries( -// markerSettings: MarkerSettings( -// isVisible: true, -// color: seriesColor2, -// height: 8, -// width: 8, -// ), -// dataLabelSettings: DataLabelSettings( -// labelAlignment: ChartDataLabelAlignment.top, -// isVisible: true, -// ), -// dataSource: widget.chartData, -// borderColor: seriesColor2, -// gradient: LinearGradient( -// colors: [ -// seriesColor2.withOpacity(0.14), -// Colors.transparent, -// ], -// begin: Alignment.topCenter, -// end: Alignment(0, 0.6), -// ), -// name: 'Талия', -// xValueMapper: (Circumference value, int index) => value.createdAt, -// yValueMapper: (Circumference value, int index) => value.waistCircumference, -// ), -// SplineAreaSeries( -// markerSettings: MarkerSettings( -// isVisible: true, -// color: seriesColor3, -// height: 8, -// width: 8, -// ), -// dataLabelSettings: DataLabelSettings( -// labelAlignment: ChartDataLabelAlignment.top, -// isVisible: true, -// ), -// dataSource: widget.chartData, -// borderColor: seriesColor3, -// gradient: LinearGradient( -// colors: [ -// seriesColor3.withOpacity(0.14), -// Colors.transparent, -// ], -// begin: Alignment.topCenter, -// end: Alignment(0, 0.6), -// ), -// name: 'Бёдра', -// xValueMapper: (Circumference value, int index) => value.createdAt, -// yValueMapper: (Circumference value, int index) => value.hipCircumference, -// ), -// ]; -// } -// } +import 'package:eatvio_app/features/profile/models/circumference_model.dart'; +import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; + +class CircumferenceChartWidget extends StatefulWidget { + final List circumferencePoints; + final ProfileCubit profileCubit; + + const CircumferenceChartWidget({ + super.key, + required this.circumferencePoints, + required this.profileCubit, + }); + + @override + State createState() => _CircumferenceChartWidgetState(); +} + +class _CircumferenceChartWidgetState extends State { + late FixedExtentScrollController chestController; + late FixedExtentScrollController waistController; + late FixedExtentScrollController hipController; + late int chest; + late int waist; + late int hip; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + if (widget.circumferencePoints.isNotEmpty) + Padding( + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Text( + '${widget.circumferencePoints.last.chestCircumference}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), + ), + if (widget.circumferencePoints.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, + ), + ), + if (widget.circumferencePoints.length > 1) + widget.circumferencePoints.last.chestCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].chestCircumference + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey, + ), + Text( + '${widget.circumferencePoints.last.waistCircumference}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), + ), + if (widget.circumferencePoints.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, + ), + ), + if (widget.circumferencePoints.length > 1) + widget.circumferencePoints.last.waistCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].waistCircumference + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey, + ), + Text( + '${widget.circumferencePoints.last.hipCircumference}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), + ), + if (widget.circumferencePoints.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, + ), + ), + if (widget.circumferencePoints.length > 1) + widget.circumferencePoints.last.hipCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].hipCircumference + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey, + ), + ], + ), + ), + Stack( + alignment: Alignment.bottomRight, + children: [ + SfCartesianChart( + margin: EdgeInsets.symmetric(horizontal: 8), + enableAxisAnimation: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, + ), + primaryXAxis: DateTimeCategoryAxis( + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, + dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + axisLine: AxisLine( + color: Colors.grey.withOpacity(0.3), + width: 0.4, + ), + ), + primaryYAxis: NumericAxis( + isVisible: false, + labelFormat: '{value} см', + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), + ), + FloatingActionButton.small( + heroTag: 'addCircumference', + onPressed: () { + if (widget.circumferencePoints.isNotEmpty) { + chest = widget.circumferencePoints.last.chestCircumference; + waist = widget.circumferencePoints.last.waistCircumference; + hip = widget.circumferencePoints.last.hipCircumference; + chestController = FixedExtentScrollController(initialItem: chest - 20); + waistController = FixedExtentScrollController(initialItem: waist - 20); + hipController = FixedExtentScrollController(initialItem: hip - 20); + } else { + chestController = FixedExtentScrollController(); + waistController = FixedExtentScrollController(); + hipController = FixedExtentScrollController(); + } + showModalBottomSheet( + useRootNavigator: true, + context: context, + builder: (context) { + return Column( + children: [ + Expanded( + child: Row( + children: [ + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: chestController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + chest = value; + }, + children: [ + for (int i = 20; i < 200; i++) Text('$i'), + ], + ), + ), + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: waistController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + waist = value; + }, + children: [ + for (int i = 20; i < 200; i++) Text('$i'), + ], + ), + ), + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: hipController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + hip = value; + }, + children: [ + for (int i = 20; i < 200; i++) Text('$i'), + ], + ), + ), + ], + ), + ), + InkWell( + onTap: () { + widget.profileCubit.addCircumference( + chestCircumference: chest, + waistCircumference: waist, + hipCircumference: hip, + ); + Navigator.of(context).pop(); + }, + borderRadius: BorderRadius.circular(16), + child: Ink( + width: MediaQuery.of(context).size.width - 32, + padding: EdgeInsets.all(16), + decoration: BoxDecoration( + color: appTheme.blueA400, + borderRadius: BorderRadius.circular(16), + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + ), + ), + ), + ), + ), + ], + ); + }, + ); + }, + backgroundColor: Colors.red, + shape: CircleBorder(), + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ], + ), + ], + ); + } + + List> _getSplineSeries() { + final Color seriesColor1 = Colors.red; + final Color seriesColor2 = appTheme.blueA400; + final Color seriesColor3 = Colors.green; + + return >[ + SplineAreaSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor1, + height: 8, + width: 8, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: widget.circumferencePoints, + borderColor: seriesColor1, + gradient: LinearGradient( + colors: [ + seriesColor1.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), + name: 'Грудь', + xValueMapper: (CircumferenceModel value, int index) => value.createdAt, + yValueMapper: (CircumferenceModel value, int index) => value.chestCircumference, + ), + SplineAreaSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor2, + height: 8, + width: 8, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: widget.circumferencePoints, + borderColor: seriesColor2, + gradient: LinearGradient( + colors: [ + seriesColor2.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), + name: 'Талия', + xValueMapper: (CircumferenceModel value, int index) => value.createdAt, + yValueMapper: (CircumferenceModel value, int index) => value.waistCircumference, + ), + SplineAreaSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor3, + height: 8, + width: 8, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: widget.circumferencePoints, + borderColor: seriesColor3, + gradient: LinearGradient( + colors: [ + seriesColor3.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), + name: 'Бёдра', + xValueMapper: (CircumferenceModel value, int index) => value.createdAt, + yValueMapper: (CircumferenceModel value, int index) => value.hipCircumference, + ), + ]; + } +} diff --git a/lib/features/profile/presentation/widgets/imt_chart_widget.dart b/lib/features/profile/presentation/widgets/imt_chart_widget.dart index 258bd004..abd8e05b 100644 --- a/lib/features/profile/presentation/widgets/imt_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/imt_chart_widget.dart @@ -1,114 +1,114 @@ -// import 'package:eatvio_app/features/profile/models/profile_model.dart'; -// import 'package:eatvio_app/theme/theme_helper.dart'; -// import 'package:flutter/material.dart'; -// import 'package:syncfusion_flutter_charts/charts.dart'; -// import 'package:intl/intl.dart'; -// -// class ImtChartWidget extends StatelessWidget { -// final List chartPoints; -// -// const ImtChartWidget({ -// super.key, -// required this.chartPoints, -// }); -// -// @override -// Widget build(BuildContext context) { -// return Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Padding( -// padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), -// child: Row( -// children: [ -// Text( -// '${chartPoints.last.bmi.toStringAsFixed(2)}', -// style: TextStyle( -// color: Colors.black, -// fontSize: 40, -// fontWeight: FontWeight.w500, -// ), -// ), -// chartPoints.last.bmi > chartPoints[chartPoints.length - 2].bmi -// ? Icon( -// Icons.arrow_drop_up, -// size: 40, -// color: Colors.grey, -// ) -// : Icon( -// Icons.arrow_drop_down, -// size: 40, -// color: Colors.grey, -// ), -// ], -// ), -// ), -// SfCartesianChart( -// margin: EdgeInsets.symmetric(horizontal: 8), -// enableAxisAnimation: true, -// plotAreaBorderWidth: 0, -// trackballBehavior: TrackballBehavior( -// enable: true, -// activationMode: ActivationMode.singleTap, -// tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, -// tooltipSettings: InteractiveTooltip(), -// lineType: TrackballLineType.vertical, -// ), -// primaryXAxis: DateTimeCategoryAxis( -// initialVisibleMinimum: chartPoints.first.createdAt, -// initialVisibleMaximum: chartPoints.last.createdAt, -// tickPosition: TickPosition.inside, -// majorTickLines: MajorTickLines( -// size: 0, -// ), -// edgeLabelPlacement: EdgeLabelPlacement.shift, -// dateFormat: DateFormat.MMMd('ru'), -// labelStyle: TextStyle( -// color: Colors.grey, -// ), -// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), -// axisLine: AxisLine( -// color: Colors.grey.withOpacity(0.3), -// width: 0.4, -// ), -// ), -// primaryYAxis: NumericAxis( -// isVisible: false, -// ), -// series: _getSplineSeries(), -// tooltipBehavior: TooltipBehavior(enable: true), -// ), -// ], -// ); -// } -// -// List> _getSplineSeries() { -// return >[ -// SplineAreaSeries( -// markerSettings: MarkerSettings( -// isVisible: true, -// color: appTheme.blueA400, -// height: 8, -// width: 8, -// ), -// dataLabelSettings: DataLabelSettings( -// labelAlignment: ChartDataLabelAlignment.top, -// isVisible: true, -// ), -// dataSource: chartPoints, -// borderColor: appTheme.blueA400, -// gradient: LinearGradient( -// colors: [ -// appTheme.blueA400.withOpacity(0.14), -// Colors.transparent, -// ], -// begin: Alignment.topCenter, -// end: Alignment(0, 0.6), -// ), -// name: 'ИМТ', -// xValueMapper: (ChartPointModel value, int index) => value.createdAt, -// yValueMapper: (ChartPointModel value, int index) => double.parse(value.bmi.toStringAsFixed(2)), -// ), -// ]; -// } -// } +import 'package:eatvio_app/features/profile/models/weight_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:flutter/material.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; +import 'package:intl/intl.dart'; + +class ImtChartWidget extends StatelessWidget { + final List weightPoints; + + const ImtChartWidget({ + super.key, + required this.weightPoints, + }); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Text( + '${weightPoints.last.bmi.toStringAsFixed(2)}', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), + ), + weightPoints.last.bmi > weightPoints[weightPoints.length - 2].bmi + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey, + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey, + ), + ], + ), + ), + SfCartesianChart( + margin: EdgeInsets.symmetric(horizontal: 8), + enableAxisAnimation: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, + ), + primaryXAxis: DateTimeCategoryAxis( + initialVisibleMinimum: weightPoints.first.createdAt, + initialVisibleMaximum: weightPoints.last.createdAt, + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, + dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + axisLine: AxisLine( + color: Colors.grey.withOpacity(0.3), + width: 0.4, + ), + ), + primaryYAxis: NumericAxis( + isVisible: false, + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), + ), + ], + ); + } + + List> _getSplineSeries() { + return >[ + SplineAreaSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: appTheme.blueA400, + height: 8, + width: 8, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: weightPoints, + borderColor: appTheme.blueA400, + gradient: LinearGradient( + colors: [ + appTheme.blueA400.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), + name: 'ИМТ', + xValueMapper: (WeightModel value, int index) => value.createdAt, + yValueMapper: (WeightModel value, int index) => double.parse(value.bmi.toStringAsFixed(2)), + ), + ]; + } +} diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index ab457ebe..f5f2a579 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -1,237 +1,237 @@ -// -// import 'package:eatvio_app/features/profile/models/profile_model.dart'; -// import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; -// import 'package:flutter/cupertino.dart'; -// import 'package:flutter/material.dart'; -// import 'package:intl/intl.dart'; -// import 'package:syncfusion_flutter_charts/charts.dart'; -// -// class WeightChartWidget extends StatefulWidget { -// final List chartPoints; -// final ProfileCubit profileCubit; -// -// const WeightChartWidget({ -// super.key, -// required this.chartPoints, -// required this.profileCubit, -// }); -// -// @override -// State createState() => _WeightChartWidgetState(); -// } -// -// class _WeightChartWidgetState extends State { -// late FixedExtentScrollController weightKiloController; -// late FixedExtentScrollController weightGramsController; -// late int weightKilo; -// late int weightGrams; -// -// @override -// Widget build(BuildContext context) { -// return Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// if (widget.chartPoints.isNotEmpty) -// Padding( -// padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), -// child: Row( -// children: [ -// Text( -// '${widget.chartPoints.last.weight.toStringAsFixed(1)} кг', -// style: TextStyle( -// color: Colors.black, -// fontSize: 40, -// fontWeight: FontWeight.w500, -// ), -// ), -// if (widget.chartPoints.length == 1) -// Container( -// margin: EdgeInsets.symmetric(horizontal: 12), -// width: 8, -// height: 8, -// decoration: BoxDecoration( -// shape: BoxShape.circle, -// color: Colors.black12, -// ), -// ), -// if (widget.chartPoints.length > 1) widget.chartPoints.last.weight > widget.chartPoints[widget.chartPoints.length - 2].weight -// ? Icon( -// Icons.arrow_drop_up, -// size: 40, -// color: Colors.grey.withOpacity(0.4), -// ) -// : Icon( -// Icons.arrow_drop_down, -// size: 40, -// color: Colors.grey.withOpacity(0.4), -// ), -// ], -// ), -// ), -// Stack( -// alignment: Alignment.bottomRight, -// children: [ -// SfCartesianChart( -// margin: EdgeInsets.symmetric(horizontal: 8), -// enableAxisAnimation: true, -// plotAreaBorderWidth: 0, -// trackballBehavior: TrackballBehavior( -// enable: true, -// activationMode: ActivationMode.singleTap, -// tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, -// tooltipSettings: InteractiveTooltip(), -// lineType: TrackballLineType.vertical, -// ), -// primaryXAxis: DateTimeCategoryAxis( -// tickPosition: TickPosition.inside, -// majorTickLines: MajorTickLines( -// size: 0, -// ), -// edgeLabelPlacement: EdgeLabelPlacement.shift, -// dateFormat: DateFormat.MMMd('ru'), -// labelStyle: TextStyle( -// color: Colors.grey, -// ), -// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), -// axisLine: AxisLine( -// color: Colors.grey.withOpacity(0.3), -// width: 0.4, -// ), -// ), -// primaryYAxis: NumericAxis( -// isVisible: false, -// labelFormat: '{value} кг', -// majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), -// axisLine: AxisLine( -// width: 1, -// ), -// majorTickLines: MajorTickLines(size: 0), -// ), -// series: _getSplineSeries(), -// tooltipBehavior: TooltipBehavior(enable: true), -// ), -// FloatingActionButton.small( -// heroTag: 'addWeight', -// onPressed: () { -// if (widget.chartPoints.isNotEmpty) { -// weightKilo = int.parse(widget.chartPoints.last.weight.toString().split('.')[0]); -// weightGrams = int.parse(widget.chartPoints.last.weight.toString().split('.')[1][0]); -// weightKiloController = FixedExtentScrollController(initialItem: weightKilo - 20); -// weightGramsController = FixedExtentScrollController(initialItem: weightGrams); -// } else { -// weightKiloController = FixedExtentScrollController(); -// weightGramsController = FixedExtentScrollController(); -// } -// showModalBottomSheet( -// useRootNavigator: true, -// context: context, -// builder: (context) { -// return Column( -// children: [ -// Expanded( -// child: Row( -// children: [ -// Expanded( -// child: CupertinoPicker( -// magnification: 1.22, -// squeeze: 1.2, -// useMagnifier: true, -// scrollController: weightKiloController, -// itemExtent: 24, -// onSelectedItemChanged: (int value) { -// weightKilo = value + 20; -// }, -// children: [ -// for (int i = 20; i < 300; i++) Text('$i'), -// ], -// ), -// ), -// Expanded( -// child: CupertinoPicker( -// magnification: 1.22, -// squeeze: 1.2, -// useMagnifier: true, -// scrollController: weightGramsController, -// itemExtent: 24, -// onSelectedItemChanged: (int value) { -// weightGrams = value; -// }, -// children: [ -// for (int i = 0; i < 10; i++) Text('$i'), -// ], -// ), -// ), -// ], -// ), -// ), -// InkWell( -// onTap: () { -// widget.profileCubit.addWeight(weight: double.parse('$weightKilo.$weightGrams')); -// Navigator.of(context).pop(); -// }, -// borderRadius: BorderRadius.circular(16), -// child: Ink( -// width: MediaQuery.of(context).size.width - 32, -// padding: EdgeInsets.all(16), -// decoration: BoxDecoration( -// color: appTheme.blueA400, -// borderRadius: BorderRadius.circular(16), -// ), -// child: Center( -// child: Text( -// 'Сохранить', -// style: TextStyle( -// color: Colors.white, -// ), -// ), -// ), -// ), -// ), -// ], -// ); -// }, -// ); -// }, -// backgroundColor: Colors.red, -// shape: CircleBorder(), -// child: Icon( -// Icons.add, -// color: Colors.white, -// ), -// ), -// ], -// ), -// ], -// ); -// } -// -// List> _getSplineSeries() { -// return >[ -// SplineAreaSeries( -// markerSettings: MarkerSettings( -// isVisible: true, -// color: appTheme.blueA400, -// height: 8, -// width: 8, -// ), -// dataLabelSettings: DataLabelSettings( -// labelAlignment: ChartDataLabelAlignment.top, -// isVisible: true, -// ), -// dataSource: widget.chartPoints, -// borderColor: appTheme.blueA400, -// gradient: LinearGradient( -// colors: [ -// appTheme.blueA400.withOpacity(0.14), -// Colors.transparent, -// ], -// begin: Alignment.topCenter, -// end: Alignment(0, 0.6), -// ), -// name: 'Вес', -// xValueMapper: (ChartPointModel value, int index) => value.createdAt, -// yValueMapper: (ChartPointModel value, int index) => value.weight, -// ), -// ]; -// } -// } +import 'package:eatvio_app/features/profile/models/weight_model.dart'; +import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; + +class WeightChartWidget extends StatefulWidget { + final List weightPoints; + final ProfileCubit profileCubit; + + const WeightChartWidget({ + super.key, + required this.weightPoints, + required this.profileCubit, + }); + + @override + State createState() => _WeightChartWidgetState(); +} + +class _WeightChartWidgetState extends State { + late FixedExtentScrollController weightKiloController; + late FixedExtentScrollController weightGramsController; + late int weightKilo; + late int weightGrams; + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (widget.weightPoints.isNotEmpty) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + children: [ + Text( + '${widget.weightPoints.last.weight.toStringAsFixed(1)} кг', + style: TextStyle( + color: Colors.black, + fontSize: 40, + fontWeight: FontWeight.w500, + ), + ), + if (widget.weightPoints.length == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 12), + width: 8, + height: 8, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black12, + ), + ), + if (widget.weightPoints.length > 1) widget.weightPoints.last.weight > widget.weightPoints[widget.weightPoints.length - 2].weight + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey.withOpacity(0.4), + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey.withOpacity(0.4), + ), + ], + ), + ), + Stack( + alignment: Alignment.bottomRight, + children: [ + SfCartesianChart( + margin: EdgeInsets.symmetric(horizontal: 8), + enableAxisAnimation: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, + ), + primaryXAxis: DateTimeCategoryAxis( + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, + dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + axisLine: AxisLine( + color: Colors.grey.withOpacity(0.3), + width: 0.4, + ), + ), + primaryYAxis: NumericAxis( + isVisible: false, + labelFormat: '{value} кг', + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), + ), + FloatingActionButton.small( + heroTag: 'addWeight', + onPressed: () { + if (widget.weightPoints.isNotEmpty) { + weightKilo = int.parse(widget.weightPoints.last.weight.toString().split('.')[0]); + weightGrams = int.parse(widget.weightPoints.last.weight.toString().split('.')[1][0]); + weightKiloController = FixedExtentScrollController(initialItem: weightKilo - 20); + weightGramsController = FixedExtentScrollController(initialItem: weightGrams); + } else { + weightKiloController = FixedExtentScrollController(); + weightGramsController = FixedExtentScrollController(); + } + showModalBottomSheet( + useRootNavigator: true, + context: context, + builder: (context) { + return Column( + children: [ + Expanded( + child: Row( + children: [ + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: weightKiloController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + weightKilo = value + 20; + }, + children: [ + for (int i = 20; i < 300; i++) Text('$i'), + ], + ), + ), + Expanded( + child: CupertinoPicker( + magnification: 1.22, + squeeze: 1.2, + useMagnifier: true, + scrollController: weightGramsController, + itemExtent: 24, + onSelectedItemChanged: (int value) { + weightGrams = value; + }, + children: [ + for (int i = 0; i < 10; i++) Text('$i'), + ], + ), + ), + ], + ), + ), + InkWell( + onTap: () { + widget.profileCubit.addWeight(weight: double.parse('$weightKilo.$weightGrams')); + Navigator.of(context).pop(); + }, + borderRadius: BorderRadius.circular(16), + child: Ink( + width: MediaQuery.of(context).size.width - 32, + padding: EdgeInsets.all(16), + decoration: BoxDecoration( + color: appTheme.blueA400, + borderRadius: BorderRadius.circular(16), + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + ), + ), + ), + ), + ), + ], + ); + }, + ); + }, + backgroundColor: Colors.red, + shape: CircleBorder(), + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ], + ), + ], + ); + } + + List> _getSplineSeries() { + return >[ + SplineAreaSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: appTheme.blueA400, + height: 8, + width: 8, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: widget.weightPoints, + borderColor: appTheme.blueA400, + gradient: LinearGradient( + colors: [ + appTheme.blueA400.withOpacity(0.14), + Colors.transparent, + ], + begin: Alignment.topCenter, + end: Alignment(0, 0.6), + ), + name: 'Вес', + xValueMapper: (WeightModel value, int index) => value.createdAt, + yValueMapper: (WeightModel value, int index) => value.weight, + ), + ]; + } +} diff --git a/lib/features/profile/repositories/profile_repository.dart b/lib/features/profile/repositories/profile_repository.dart index de8c37cf..2e927ca0 100644 --- a/lib/features/profile/repositories/profile_repository.dart +++ b/lib/features/profile/repositories/profile_repository.dart @@ -1,5 +1,7 @@ import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; +import 'package:eatvio_app/features/profile/models/circumference_model.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/profile/models/weight_model.dart'; import 'package:eatvio_app/features/profile/services/profile_service.dart'; class ProfileRepository { @@ -69,4 +71,44 @@ class ProfileRepository { rethrow; } } + + Future> getWeight({ + required String period, + String? slug, + }) async { + try { + if (slug != null) { + return (await profileService.getWeightBySlug( + period: period, + slug: slug, + )); + } else { + return (await profileService.getWeight( + period: period, + )); + } + } catch (e) { + rethrow; + } + } + + Future> getCircumferences({ + required String period, + String? slug, + }) async { + try { + if (slug != null) { + return (await profileService.getCircumferencesBySlug( + period: period, + slug: slug, + )); + } else { + return (await profileService.getCircumferences( + period: period, + )); + } + } catch (e) { + rethrow; + } + } } diff --git a/lib/features/profile/services/profile_service.dart b/lib/features/profile/services/profile_service.dart index 078eb61d..f5490213 100644 --- a/lib/features/profile/services/profile_service.dart +++ b/lib/features/profile/services/profile_service.dart @@ -1,6 +1,8 @@ import 'package:dio/dio.dart'; import 'package:eatvio_app/features/feed/models/feed_blog_post_settings_model.dart'; +import 'package:eatvio_app/features/profile/models/circumference_model.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/profile/models/weight_model.dart'; import 'package:retrofit/retrofit.dart'; part 'profile_service.g.dart'; @@ -36,4 +38,26 @@ abstract class ProfileService { Future getBlogPostByAuthorSlug({ @Path() required String slug, }); + + @GET('/api/profile/measure/weight/{period}') + Future> getWeight({ + @Path() required String period, + }); + + @GET('/api/profile/measure/weight/{period}/{slug}') + Future> getWeightBySlug({ + @Path() required String period, + @Path() required String slug, + }); + + @GET('/api/profile/measure/circumferences/{period}') + Future> getCircumferences({ + @Path() required String period, + }); + + @GET('/api/profile/measure/circumferences/{period}/{user}') + Future> getCircumferencesBySlug({ + @Path() required String period, + @Path() required String slug, + }); } diff --git a/lib/features/profile/services/profile_service.g.dart b/lib/features/profile/services/profile_service.g.dart index 47070f20..36b64eb3 100644 --- a/lib/features/profile/services/profile_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -191,7 +191,8 @@ class _ProfileService implements ProfileService { } @override - Future getBlogPostByAuthorSlug({required String slug}) async { + Future getBlogPostByAuthorSlug( + {required String slug}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -223,8 +224,159 @@ class _ProfileService implements ProfileService { return _value; } + @override + Future> getWeight({required String period}) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/measure/weight/${period}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late List _value; + try { + _value = _result.data! + .map((dynamic i) => WeightModel.fromJson(i as Map)) + .toList(); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + + @override + Future> getWeightBySlug({ + required String period, + required String slug, + }) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/measure/weight/${period}/${slug}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late List _value; + try { + _value = _result.data! + .map((dynamic i) => WeightModel.fromJson(i as Map)) + .toList(); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + + @override + Future> getCircumferences( + {required String period}) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/measure/circumferences/${period}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late List _value; + try { + _value = _result.data! + .map((dynamic i) => + CircumferenceModel.fromJson(i as Map)) + .toList(); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + + @override + Future> getCircumferencesBySlug({ + required String period, + required String slug, + }) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/measure/circumferences/${period}/{user}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late List _value; + try { + _value = _result.data! + .map((dynamic i) => + CircumferenceModel.fromJson(i as Map)) + .toList(); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/recipes/models/ingredient.freezed.dart b/lib/features/recipes/models/ingredient.freezed.dart index 24468f59..2bf96fb3 100644 --- a/lib/features/recipes/models/ingredient.freezed.dart +++ b/lib/features/recipes/models/ingredient.freezed.dart @@ -21,9 +21,7 @@ Ingredient _$IngredientFromJson(Map json) { /// @nodoc mixin _$Ingredient { String get name => throw _privateConstructorUsedError; - String get unit => throw _privateConstructorUsedError; - String get portion => throw _privateConstructorUsedError; /// Serializes this Ingredient to a JSON map. @@ -32,24 +30,26 @@ mixin _$Ingredient { /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $IngredientCopyWith get copyWith => throw _privateConstructorUsedError; + $IngredientCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $IngredientCopyWith<$Res> { - factory $IngredientCopyWith(Ingredient value, $Res Function(Ingredient) then) = _$IngredientCopyWithImpl<$Res, Ingredient>; - + factory $IngredientCopyWith( + Ingredient value, $Res Function(Ingredient) then) = + _$IngredientCopyWithImpl<$Res, Ingredient>; @useResult $Res call({String name, String unit, String portion}); } /// @nodoc -class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $IngredientCopyWith<$Res> { +class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> + implements $IngredientCopyWith<$Res> { _$IngredientCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -80,17 +80,23 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> implements $Ingred } /// @nodoc -abstract class _$$IngredientImplCopyWith<$Res> implements $IngredientCopyWith<$Res> { - factory _$$IngredientImplCopyWith(_$IngredientImpl value, $Res Function(_$IngredientImpl) then) = __$$IngredientImplCopyWithImpl<$Res>; - +abstract class _$$IngredientImplCopyWith<$Res> + implements $IngredientCopyWith<$Res> { + factory _$$IngredientImplCopyWith( + _$IngredientImpl value, $Res Function(_$IngredientImpl) then) = + __$$IngredientImplCopyWithImpl<$Res>; @override @useResult $Res call({String name, String unit, String portion}); } /// @nodoc -class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> implements _$$IngredientImplCopyWith<$Res> { - __$$IngredientImplCopyWithImpl(_$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) : super(_value, _then); +class __$$IngredientImplCopyWithImpl<$Res> + extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl> + implements _$$IngredientImplCopyWith<$Res> { + __$$IngredientImplCopyWithImpl( + _$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) + : super(_value, _then); /// Create a copy of Ingredient /// with the given fields replaced by the non-null parameter values. @@ -121,9 +127,11 @@ class __$$IngredientImplCopyWithImpl<$Res> extends _$IngredientCopyWithImpl<$Res /// @nodoc @JsonSerializable() class _$IngredientImpl implements _Ingredient { - const _$IngredientImpl({required this.name, required this.unit, required this.portion}); + const _$IngredientImpl( + {required this.name, required this.unit, required this.portion}); - factory _$IngredientImpl.fromJson(Map json) => _$$IngredientImplFromJson(json); + factory _$IngredientImpl.fromJson(Map json) => + _$$IngredientImplFromJson(json); @override final String name; @@ -156,7 +164,8 @@ class _$IngredientImpl implements _Ingredient { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => + __$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity); @override Map toJson() { @@ -167,16 +176,18 @@ class _$IngredientImpl implements _Ingredient { } abstract class _Ingredient implements Ingredient { - const factory _Ingredient({required final String name, required final String unit, required final String portion}) = _$IngredientImpl; + const factory _Ingredient( + {required final String name, + required final String unit, + required final String portion}) = _$IngredientImpl; - factory _Ingredient.fromJson(Map json) = _$IngredientImpl.fromJson; + factory _Ingredient.fromJson(Map json) = + _$IngredientImpl.fromJson; @override String get name; - @override String get unit; - @override String get portion; @@ -184,5 +195,6 @@ abstract class _Ingredient implements Ingredient { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError; + _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/ingredient.g.dart b/lib/features/recipes/models/ingredient.g.dart index 3d2f63b5..b3f1844d 100644 --- a/lib/features/recipes/models/ingredient.g.dart +++ b/lib/features/recipes/models/ingredient.g.dart @@ -6,13 +6,15 @@ part of 'ingredient.dart'; // JsonSerializableGenerator // ************************************************************************** -_$IngredientImpl _$$IngredientImplFromJson(Map json) => _$IngredientImpl( +_$IngredientImpl _$$IngredientImplFromJson(Map json) => + _$IngredientImpl( name: json['name'] as String, unit: json['unit'] as String, portion: json['portion'] as String, ); -Map _$$IngredientImplToJson(_$IngredientImpl instance) => { +Map _$$IngredientImplToJson(_$IngredientImpl instance) => + { 'name': instance.name, 'unit': instance.unit, 'portion': instance.portion, diff --git a/lib/features/recipes/models/recipe_model.freezed.dart b/lib/features/recipes/models/recipe_model.freezed.dart index de1cbd2e..691ac1f3 100644 --- a/lib/features/recipes/models/recipe_model.freezed.dart +++ b/lib/features/recipes/models/recipe_model.freezed.dart @@ -21,21 +21,13 @@ RecipeModel _$RecipeModelFromJson(Map json) { /// @nodoc mixin _$RecipeModel { List? get ingredients => throw _privateConstructorUsedError; - List? get steps => throw _privateConstructorUsedError; - String? get type => throw _privateConstructorUsedError; - String? get state => throw _privateConstructorUsedError; - String? get title => throw _privateConstructorUsedError; - String? get description => throw _privateConstructorUsedError; - String? get video_url => throw _privateConstructorUsedError; - String? get image => throw _privateConstructorUsedError; - int? get cooking_time => throw _privateConstructorUsedError; /// Serializes this RecipeModel to a JSON map. @@ -44,13 +36,15 @@ mixin _$RecipeModel { /// Create a copy of RecipeModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeModelCopyWith get copyWith => throw _privateConstructorUsedError; + $RecipeModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeModelCopyWith<$Res> { - factory $RecipeModelCopyWith(RecipeModel value, $Res Function(RecipeModel) then) = _$RecipeModelCopyWithImpl<$Res, RecipeModel>; - + factory $RecipeModelCopyWith( + RecipeModel value, $Res Function(RecipeModel) then) = + _$RecipeModelCopyWithImpl<$Res, RecipeModel>; @useResult $Res call( {List? ingredients, @@ -65,12 +59,12 @@ abstract class $RecipeModelCopyWith<$Res> { } /// @nodoc -class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> implements $RecipeModelCopyWith<$Res> { +class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> + implements $RecipeModelCopyWith<$Res> { _$RecipeModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -131,9 +125,11 @@ class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> implements $Reci } /// @nodoc -abstract class _$$RecipeModelImplCopyWith<$Res> implements $RecipeModelCopyWith<$Res> { - factory _$$RecipeModelImplCopyWith(_$RecipeModelImpl value, $Res Function(_$RecipeModelImpl) then) = __$$RecipeModelImplCopyWithImpl<$Res>; - +abstract class _$$RecipeModelImplCopyWith<$Res> + implements $RecipeModelCopyWith<$Res> { + factory _$$RecipeModelImplCopyWith( + _$RecipeModelImpl value, $Res Function(_$RecipeModelImpl) then) = + __$$RecipeModelImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -149,8 +145,12 @@ abstract class _$$RecipeModelImplCopyWith<$Res> implements $RecipeModelCopyWith< } /// @nodoc -class __$$RecipeModelImplCopyWithImpl<$Res> extends _$RecipeModelCopyWithImpl<$Res, _$RecipeModelImpl> implements _$$RecipeModelImplCopyWith<$Res> { - __$$RecipeModelImplCopyWithImpl(_$RecipeModelImpl _value, $Res Function(_$RecipeModelImpl) _then) : super(_value, _then); +class __$$RecipeModelImplCopyWithImpl<$Res> + extends _$RecipeModelCopyWithImpl<$Res, _$RecipeModelImpl> + implements _$$RecipeModelImplCopyWith<$Res> { + __$$RecipeModelImplCopyWithImpl( + _$RecipeModelImpl _value, $Res Function(_$RecipeModelImpl) _then) + : super(_value, _then); /// Create a copy of RecipeModel /// with the given fields replaced by the non-null parameter values. @@ -224,10 +224,10 @@ class _$RecipeModelImpl implements _RecipeModel { : _ingredients = ingredients, _steps = steps; - factory _$RecipeModelImpl.fromJson(Map json) => _$$RecipeModelImplFromJson(json); + factory _$RecipeModelImpl.fromJson(Map json) => + _$$RecipeModelImplFromJson(json); final List? _ingredients; - @override List? get ingredients { final value = _ingredients; @@ -238,7 +238,6 @@ class _$RecipeModelImpl implements _RecipeModel { } final List? _steps; - @override List? get steps { final value = _steps; @@ -273,28 +272,42 @@ class _$RecipeModelImpl implements _RecipeModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeModelImpl && - const DeepCollectionEquality().equals(other._ingredients, _ingredients) && + const DeepCollectionEquality() + .equals(other._ingredients, _ingredients) && const DeepCollectionEquality().equals(other._steps, _steps) && (identical(other.type, type) || other.type == type) && (identical(other.state, state) || other.state == state) && (identical(other.title, title) || other.title == title) && - (identical(other.description, description) || other.description == description) && - (identical(other.video_url, video_url) || other.video_url == video_url) && + (identical(other.description, description) || + other.description == description) && + (identical(other.video_url, video_url) || + other.video_url == video_url) && (identical(other.image, image) || other.image == image) && - (identical(other.cooking_time, cooking_time) || other.cooking_time == cooking_time)); + (identical(other.cooking_time, cooking_time) || + other.cooking_time == cooking_time)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_ingredients), const DeepCollectionEquality().hash(_steps), type, state, - title, description, video_url, image, cooking_time); + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(_ingredients), + const DeepCollectionEquality().hash(_steps), + type, + state, + title, + description, + video_url, + image, + cooking_time); /// Create a copy of RecipeModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => __$$RecipeModelImplCopyWithImpl<_$RecipeModelImpl>(this, _$identity); + _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => + __$$RecipeModelImplCopyWithImpl<_$RecipeModelImpl>(this, _$identity); @override Map toJson() { @@ -316,32 +329,25 @@ abstract class _RecipeModel implements RecipeModel { final String? image, final int? cooking_time}) = _$RecipeModelImpl; - factory _RecipeModel.fromJson(Map json) = _$RecipeModelImpl.fromJson; + factory _RecipeModel.fromJson(Map json) = + _$RecipeModelImpl.fromJson; @override List? get ingredients; - @override List? get steps; - @override String? get type; - @override String? get state; - @override String? get title; - @override String? get description; - @override String? get video_url; - @override String? get image; - @override int? get cooking_time; @@ -349,5 +355,6 @@ abstract class _RecipeModel implements RecipeModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/recipe_model.g.dart b/lib/features/recipes/models/recipe_model.g.dart index ac7c7c2d..d5ab9c96 100644 --- a/lib/features/recipes/models/recipe_model.g.dart +++ b/lib/features/recipes/models/recipe_model.g.dart @@ -6,9 +6,16 @@ part of 'recipe_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipeModelImpl _$$RecipeModelImplFromJson(Map json) => _$RecipeModelImpl( - ingredients: (json['ingredients'] as List?)?.map((e) => e == null ? null : Ingredient.fromJson(e as Map)).toList(), - steps: (json['steps'] as List?)?.map((e) => e == null ? null : Step.fromJson(e as Map)).toList(), +_$RecipeModelImpl _$$RecipeModelImplFromJson(Map json) => + _$RecipeModelImpl( + ingredients: (json['ingredients'] as List?) + ?.map((e) => + e == null ? null : Ingredient.fromJson(e as Map)) + .toList(), + steps: (json['steps'] as List?) + ?.map((e) => + e == null ? null : Step.fromJson(e as Map)) + .toList(), type: json['type'] as String?, state: json['state'] as String?, title: json['title'] as String?, @@ -18,7 +25,8 @@ _$RecipeModelImpl _$$RecipeModelImplFromJson(Map json) => _$Rec cooking_time: (json['cooking_time'] as num?)?.toInt(), ); -Map _$$RecipeModelImplToJson(_$RecipeModelImpl instance) => { +Map _$$RecipeModelImplToJson(_$RecipeModelImpl instance) => + { 'ingredients': instance.ingredients, 'steps': instance.steps, 'type': instance.type, diff --git a/lib/features/recipes/models/recipe_tag_model.freezed.dart b/lib/features/recipes/models/recipe_tag_model.freezed.dart index cfeff53c..d9993da3 100644 --- a/lib/features/recipes/models/recipe_tag_model.freezed.dart +++ b/lib/features/recipes/models/recipe_tag_model.freezed.dart @@ -22,10 +22,8 @@ RecipeTagModel _$RecipeTagModelFromJson(Map json) { mixin _$RecipeTagModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; - @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; - @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -35,28 +33,32 @@ mixin _$RecipeTagModel { /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeTagModelCopyWith get copyWith => throw _privateConstructorUsedError; + $RecipeTagModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeTagModelCopyWith<$Res> { - factory $RecipeTagModelCopyWith(RecipeTagModel value, $Res Function(RecipeTagModel) then) = _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>; - + factory $RecipeTagModelCopyWith( + RecipeTagModel value, $Res Function(RecipeTagModel) then) = + _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>; @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; - $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> implements $RecipeTagModelCopyWith<$Res> { +class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> + implements $RecipeTagModelCopyWith<$Res> { _$RecipeTagModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -107,23 +109,31 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> implements } /// @nodoc -abstract class _$$RecipeTagModelImplCopyWith<$Res> implements $RecipeTagModelCopyWith<$Res> { - factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value, $Res Function(_$RecipeTagModelImpl) then) = __$$RecipeTagModelImplCopyWithImpl<$Res>; - +abstract class _$$RecipeTagModelImplCopyWith<$Res> + implements $RecipeTagModelCopyWith<$Res> { + factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value, + $Res Function(_$RecipeTagModelImpl) then) = + __$$RecipeTagModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; - @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$RecipeTagModelImplCopyWithImpl<$Res> extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl> implements _$$RecipeTagModelImplCopyWith<$Res> { - __$$RecipeTagModelImplCopyWithImpl(_$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) : super(_value, _then); +class __$$RecipeTagModelImplCopyWithImpl<$Res> + extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl> + implements _$$RecipeTagModelImplCopyWith<$Res> { + __$$RecipeTagModelImplCopyWithImpl( + _$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) + : super(_value, _then); /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @@ -155,13 +165,15 @@ class __$$RecipeTagModelImplCopyWithImpl<$Res> extends _$RecipeTagModelCopyWithI @JsonSerializable() class _$RecipeTagModelImpl implements _RecipeTagModel { const _$RecipeTagModelImpl( - {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$RecipeTagModelImpl.fromJson(Map json) => _$$RecipeTagModelImplFromJson(json); + factory _$RecipeTagModelImpl.fromJson(Map json) => + _$$RecipeTagModelImplFromJson(json); final List _data; - @override @JsonKey(name: "data") List get data { @@ -194,14 +206,17 @@ class _$RecipeTagModelImpl implements _RecipeTagModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => __$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>(this, _$identity); + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => + __$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>( + this, _$identity); @override Map toJson() { @@ -217,16 +232,15 @@ abstract class _RecipeTagModel implements RecipeTagModel { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$RecipeTagModelImpl; - factory _RecipeTagModel.fromJson(Map json) = _$RecipeTagModelImpl.fromJson; + factory _RecipeTagModel.fromJson(Map json) = + _$RecipeTagModelImpl.fromJson; @override @JsonKey(name: "data") List get data; - @override @JsonKey(name: "links") Links get links; - @override @JsonKey(name: "meta") Meta get meta; @@ -235,7 +249,8 @@ abstract class _RecipeTagModel implements RecipeTagModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => + throw _privateConstructorUsedError; } RecipeTag _$RecipeTagFromJson(Map json) { @@ -246,16 +261,12 @@ RecipeTag _$RecipeTagFromJson(Map json) { mixin _$RecipeTag { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "recipes_count") int get recipesCount => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; @@ -265,13 +276,14 @@ mixin _$RecipeTag { /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeTagCopyWith get copyWith => throw _privateConstructorUsedError; + $RecipeTagCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeTagCopyWith<$Res> { - factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) = _$RecipeTagCopyWithImpl<$Res, RecipeTag>; - + factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) = + _$RecipeTagCopyWithImpl<$Res, RecipeTag>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -282,12 +294,12 @@ abstract class $RecipeTagCopyWith<$Res> { } /// @nodoc -class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> implements $RecipeTagCopyWith<$Res> { +class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> + implements $RecipeTagCopyWith<$Res> { _$RecipeTagCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -328,9 +340,11 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> implements $RecipeTa } /// @nodoc -abstract class _$$RecipeTagImplCopyWith<$Res> implements $RecipeTagCopyWith<$Res> { - factory _$$RecipeTagImplCopyWith(_$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) = __$$RecipeTagImplCopyWithImpl<$Res>; - +abstract class _$$RecipeTagImplCopyWith<$Res> + implements $RecipeTagCopyWith<$Res> { + factory _$$RecipeTagImplCopyWith( + _$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) = + __$$RecipeTagImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -342,8 +356,12 @@ abstract class _$$RecipeTagImplCopyWith<$Res> implements $RecipeTagCopyWith<$Res } /// @nodoc -class __$$RecipeTagImplCopyWithImpl<$Res> extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl> implements _$$RecipeTagImplCopyWith<$Res> { - __$$RecipeTagImplCopyWithImpl(_$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) : super(_value, _then); +class __$$RecipeTagImplCopyWithImpl<$Res> + extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl> + implements _$$RecipeTagImplCopyWith<$Res> { + __$$RecipeTagImplCopyWithImpl( + _$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) + : super(_value, _then); /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @@ -391,7 +409,8 @@ class _$RecipeTagImpl implements _RecipeTag { @JsonKey(name: "created_at") required this.createdAt, @JsonKey(name: "updated_at") required this.updatedAt}); - factory _$RecipeTagImpl.fromJson(Map json) => _$$RecipeTagImplFromJson(json); + factory _$RecipeTagImpl.fromJson(Map json) => + _$$RecipeTagImplFromJson(json); @override @JsonKey(name: "id") @@ -421,21 +440,26 @@ class _$RecipeTagImpl implements _RecipeTag { other is _$RecipeTagImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.recipesCount, recipesCount) || other.recipesCount == recipesCount) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + (identical(other.recipesCount, recipesCount) || + other.recipesCount == recipesCount) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); + int get hashCode => + Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => __$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity); + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => + __$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity); @override Map toJson() { @@ -447,30 +471,28 @@ class _$RecipeTagImpl implements _RecipeTag { abstract class _RecipeTag implements RecipeTag { const factory _RecipeTag( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "recipes_count") required final int recipesCount, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$RecipeTagImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "recipes_count") required final int recipesCount, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = + _$RecipeTagImpl; - factory _RecipeTag.fromJson(Map json) = _$RecipeTagImpl.fromJson; + factory _RecipeTag.fromJson(Map json) = + _$RecipeTagImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "recipes_count") int get recipesCount; - @override @JsonKey(name: "created_at") DateTime get createdAt; - @override @JsonKey(name: "updated_at") DateTime get updatedAt; @@ -479,5 +501,6 @@ abstract class _RecipeTag implements RecipeTag { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/recipe_tag_model.g.dart b/lib/features/recipes/models/recipe_tag_model.g.dart index 9a6ea20f..cd387547 100644 --- a/lib/features/recipes/models/recipe_tag_model.g.dart +++ b/lib/features/recipes/models/recipe_tag_model.g.dart @@ -6,19 +6,25 @@ part of 'recipe_tag_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map json) => _$RecipeTagModelImpl( - data: (json['data'] as List).map((e) => RecipeTag.fromJson(e as Map)).toList(), +_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map json) => + _$RecipeTagModelImpl( + data: (json['data'] as List) + .map((e) => RecipeTag.fromJson(e as Map)) + .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$RecipeTagModelImplToJson(_$RecipeTagModelImpl instance) => { +Map _$$RecipeTagModelImplToJson( + _$RecipeTagModelImpl instance) => + { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => _$RecipeTagImpl( +_$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => + _$RecipeTagImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, recipesCount: (json['recipes_count'] as num).toInt(), @@ -26,7 +32,8 @@ _$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => _$RecipeT updatedAt: DateTime.parse(json['updated_at'] as String), ); -Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => { +Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => + { 'id': instance.id, 'name': instance.name, 'recipes_count': instance.recipesCount, diff --git a/lib/features/recipes/models/step.freezed.dart b/lib/features/recipes/models/step.freezed.dart index a0877daa..040dd5aa 100644 --- a/lib/features/recipes/models/step.freezed.dart +++ b/lib/features/recipes/models/step.freezed.dart @@ -21,7 +21,6 @@ Step _$StepFromJson(Map json) { /// @nodoc mixin _$Step { String? get image => throw _privateConstructorUsedError; - String? get description => throw _privateConstructorUsedError; /// Serializes this Step to a JSON map. @@ -35,19 +34,19 @@ mixin _$Step { /// @nodoc abstract class $StepCopyWith<$Res> { - factory $StepCopyWith(Step value, $Res Function(Step) then) = _$StepCopyWithImpl<$Res, Step>; - + factory $StepCopyWith(Step value, $Res Function(Step) then) = + _$StepCopyWithImpl<$Res, Step>; @useResult $Res call({String? image, String? description}); } /// @nodoc -class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res> { +class _$StepCopyWithImpl<$Res, $Val extends Step> + implements $StepCopyWith<$Res> { _$StepCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -74,16 +73,20 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> implements $StepCopyWith<$Res> /// @nodoc abstract class _$$StepImplCopyWith<$Res> implements $StepCopyWith<$Res> { - factory _$$StepImplCopyWith(_$StepImpl value, $Res Function(_$StepImpl) then) = __$$StepImplCopyWithImpl<$Res>; - + factory _$$StepImplCopyWith( + _$StepImpl value, $Res Function(_$StepImpl) then) = + __$$StepImplCopyWithImpl<$Res>; @override @useResult $Res call({String? image, String? description}); } /// @nodoc -class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl> implements _$$StepImplCopyWith<$Res> { - __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) : super(_value, _then); +class __$$StepImplCopyWithImpl<$Res> + extends _$StepCopyWithImpl<$Res, _$StepImpl> + implements _$$StepImplCopyWith<$Res> { + __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) + : super(_value, _then); /// Create a copy of Step /// with the given fields replaced by the non-null parameter values. @@ -111,7 +114,8 @@ class __$$StepImplCopyWithImpl<$Res> extends _$StepCopyWithImpl<$Res, _$StepImpl class _$StepImpl implements _Step { const _$StepImpl({this.image, this.description}); - factory _$StepImpl.fromJson(Map json) => _$$StepImplFromJson(json); + factory _$StepImpl.fromJson(Map json) => + _$$StepImplFromJson(json); @override final String? image; @@ -129,7 +133,8 @@ class _$StepImpl implements _Step { (other.runtimeType == runtimeType && other is _$StepImpl && (identical(other.image, image) || other.image == image) && - (identical(other.description, description) || other.description == description)); + (identical(other.description, description) || + other.description == description)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -141,7 +146,8 @@ class _$StepImpl implements _Step { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$StepImplCopyWith<_$StepImpl> get copyWith => __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); + _$$StepImplCopyWith<_$StepImpl> get copyWith => + __$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity); @override Map toJson() { @@ -152,13 +158,13 @@ class _$StepImpl implements _Step { } abstract class _Step implements Step { - const factory _Step({final String? image, final String? description}) = _$StepImpl; + const factory _Step({final String? image, final String? description}) = + _$StepImpl; factory _Step.fromJson(Map json) = _$StepImpl.fromJson; @override String? get image; - @override String? get description; @@ -166,5 +172,6 @@ abstract class _Step implements Step { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$StepImplCopyWith<_$StepImpl> get copyWith => throw _privateConstructorUsedError; + _$$StepImplCopyWith<_$StepImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/step.g.dart b/lib/features/recipes/models/step.g.dart index 1ead263e..31d97f9f 100644 --- a/lib/features/recipes/models/step.g.dart +++ b/lib/features/recipes/models/step.g.dart @@ -11,7 +11,8 @@ _$StepImpl _$$StepImplFromJson(Map json) => _$StepImpl( description: json['description'] as String?, ); -Map _$$StepImplToJson(_$StepImpl instance) => { +Map _$$StepImplToJson(_$StepImpl instance) => + { 'image': instance.image, 'description': instance.description, }; diff --git a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart index a0f3d59f..e15a1a52 100644 --- a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart +++ b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart @@ -45,7 +45,6 @@ mixin _$RecipeCreateState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -134,16 +133,18 @@ mixin _$RecipeCreateState { /// @nodoc abstract class $RecipeCreateStateCopyWith<$Res> { - factory $RecipeCreateStateCopyWith(RecipeCreateState value, $Res Function(RecipeCreateState) then) = _$RecipeCreateStateCopyWithImpl<$Res, RecipeCreateState>; + factory $RecipeCreateStateCopyWith( + RecipeCreateState value, $Res Function(RecipeCreateState) then) = + _$RecipeCreateStateCopyWithImpl<$Res, RecipeCreateState>; } /// @nodoc -class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> implements $RecipeCreateStateCopyWith<$Res> { +class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> + implements $RecipeCreateStateCopyWith<$Res> { _$RecipeCreateStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -153,14 +154,18 @@ class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> impl /// @nodoc abstract class _$$RecipeCreateStateImplCopyWith<$Res> { - factory _$$RecipeCreateStateImplCopyWith(_$RecipeCreateStateImpl value, $Res Function(_$RecipeCreateStateImpl) then) = + factory _$$RecipeCreateStateImplCopyWith(_$RecipeCreateStateImpl value, + $Res Function(_$RecipeCreateStateImpl) then) = __$$RecipeCreateStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipeCreateStateImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateImpl> +class __$$RecipeCreateStateImplCopyWithImpl<$Res> + extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateImpl> implements _$$RecipeCreateStateImplCopyWith<$Res> { - __$$RecipeCreateStateImplCopyWithImpl(_$RecipeCreateStateImpl _value, $Res Function(_$RecipeCreateStateImpl) _then) : super(_value, _then); + __$$RecipeCreateStateImplCopyWithImpl(_$RecipeCreateStateImpl _value, + $Res Function(_$RecipeCreateStateImpl) _then) + : super(_value, _then); /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @@ -178,7 +183,8 @@ class _$RecipeCreateStateImpl implements _RecipeCreateState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeCreateStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$RecipeCreateStateImpl); } @override @@ -328,14 +334,20 @@ abstract class _RecipeCreateState implements RecipeCreateState { /// @nodoc abstract class _$$RecipeCreateStateLoadingImplCopyWith<$Res> { - factory _$$RecipeCreateStateLoadingImplCopyWith(_$RecipeCreateStateLoadingImpl value, $Res Function(_$RecipeCreateStateLoadingImpl) then) = + factory _$$RecipeCreateStateLoadingImplCopyWith( + _$RecipeCreateStateLoadingImpl value, + $Res Function(_$RecipeCreateStateLoadingImpl) then) = __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadingImpl> +class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res> + extends _$RecipeCreateStateCopyWithImpl<$Res, + _$RecipeCreateStateLoadingImpl> implements _$$RecipeCreateStateLoadingImplCopyWith<$Res> { - __$$RecipeCreateStateLoadingImplCopyWithImpl(_$RecipeCreateStateLoadingImpl _value, $Res Function(_$RecipeCreateStateLoadingImpl) _then) + __$$RecipeCreateStateLoadingImplCopyWithImpl( + _$RecipeCreateStateLoadingImpl _value, + $Res Function(_$RecipeCreateStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of RecipeCreateState @@ -354,7 +366,9 @@ class _$RecipeCreateStateLoadingImpl implements RecipeCreateStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeCreateStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$RecipeCreateStateLoadingImpl); } @override @@ -504,9 +518,10 @@ abstract class RecipeCreateStateLoading implements RecipeCreateState { /// @nodoc abstract class _$$RecipeCreateStateLoadedImplCopyWith<$Res> { - factory _$$RecipeCreateStateLoadedImplCopyWith(_$RecipeCreateStateLoadedImpl value, $Res Function(_$RecipeCreateStateLoadedImpl) then) = + factory _$$RecipeCreateStateLoadedImplCopyWith( + _$RecipeCreateStateLoadedImpl value, + $Res Function(_$RecipeCreateStateLoadedImpl) then) = __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call( {RecipeModel? recipe, @@ -531,18 +546,19 @@ abstract class _$$RecipeCreateStateLoadedImplCopyWith<$Res> { SelectionPopupModel selectedStatus}); $RecipeModelCopyWith<$Res>? get recipe; - $SelectionPopupModelCopyWith<$Res> get selectedType; - $SelectionPopupModelCopyWith<$Res> get selectedCookingTime; - $SelectionPopupModelCopyWith<$Res> get selectedStatus; } /// @nodoc -class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadedImpl> +class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> + extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateLoadedImpl> implements _$$RecipeCreateStateLoadedImplCopyWith<$Res> { - __$$RecipeCreateStateLoadedImplCopyWithImpl(_$RecipeCreateStateLoadedImpl _value, $Res Function(_$RecipeCreateStateLoadedImpl) _then) : super(_value, _then); + __$$RecipeCreateStateLoadedImplCopyWithImpl( + _$RecipeCreateStateLoadedImpl _value, + $Res Function(_$RecipeCreateStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @@ -683,7 +699,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> extends _$RecipeCreateSt @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get selectedCookingTime { - return $SelectionPopupModelCopyWith<$Res>(_value.selectedCookingTime, (value) { + return $SelectionPopupModelCopyWith<$Res>(_value.selectedCookingTime, + (value) { return _then(_value.copyWith(selectedCookingTime: value)); }); } @@ -746,7 +763,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final TextEditingController youtubeLinkController; final List _stepControllers; - @override List get stepControllers { if (_stepControllers is EqualUnmodifiableListView) return _stepControllers; @@ -757,7 +773,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final XFile? recipeImage; final List _stepImages; - @override List get stepImages { if (_stepImages is EqualUnmodifiableListView) return _stepImages; @@ -766,7 +781,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _ingredients; - @override List get ingredients { if (_ingredients is EqualUnmodifiableListView) return _ingredients; @@ -775,10 +789,10 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _autocompleteList; - @override List get autocompleteList { - if (_autocompleteList is EqualUnmodifiableListView) return _autocompleteList; + if (_autocompleteList is EqualUnmodifiableListView) + return _autocompleteList; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_autocompleteList); } @@ -788,7 +802,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final bool ingredientAsItems; final List _types; - @override List get types { if (_types is EqualUnmodifiableListView) return _types; @@ -797,7 +810,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _cookingTimes; - @override List get cookingTimes { if (_cookingTimes is EqualUnmodifiableListView) return _cookingTimes; @@ -806,7 +818,6 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { } final List _statuses; - @override List get statuses { if (_statuses is EqualUnmodifiableListView) return _statuses; @@ -833,24 +844,41 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { other is _$RecipeCreateStateLoadedImpl && (identical(other.recipe, recipe) || other.recipe == recipe) && (identical(other.picker, picker) || other.picker == picker) && - (identical(other.titleController, titleController) || other.titleController == titleController) && - (identical(other.productNameController, productNameController) || other.productNameController == productNameController) && - (identical(other.ingredientController, ingredientController) || other.ingredientController == ingredientController) && - (identical(other.stepDescriptionController, stepDescriptionController) || other.stepDescriptionController == stepDescriptionController) && - (identical(other.youtubeLinkController, youtubeLinkController) || other.youtubeLinkController == youtubeLinkController) && - const DeepCollectionEquality().equals(other._stepControllers, _stepControllers) && - (identical(other.recipeImage, recipeImage) || other.recipeImage == recipeImage) && - const DeepCollectionEquality().equals(other._stepImages, _stepImages) && - const DeepCollectionEquality().equals(other._ingredients, _ingredients) && - const DeepCollectionEquality().equals(other._autocompleteList, _autocompleteList) && - (identical(other.numberOfSteps, numberOfSteps) || other.numberOfSteps == numberOfSteps) && - (identical(other.ingredientAsItems, ingredientAsItems) || other.ingredientAsItems == ingredientAsItems) && + (identical(other.titleController, titleController) || + other.titleController == titleController) && + (identical(other.productNameController, productNameController) || + other.productNameController == productNameController) && + (identical(other.ingredientController, ingredientController) || + other.ingredientController == ingredientController) && + (identical(other.stepDescriptionController, + stepDescriptionController) || + other.stepDescriptionController == stepDescriptionController) && + (identical(other.youtubeLinkController, youtubeLinkController) || + other.youtubeLinkController == youtubeLinkController) && + const DeepCollectionEquality() + .equals(other._stepControllers, _stepControllers) && + (identical(other.recipeImage, recipeImage) || + other.recipeImage == recipeImage) && + const DeepCollectionEquality() + .equals(other._stepImages, _stepImages) && + const DeepCollectionEquality() + .equals(other._ingredients, _ingredients) && + const DeepCollectionEquality() + .equals(other._autocompleteList, _autocompleteList) && + (identical(other.numberOfSteps, numberOfSteps) || + other.numberOfSteps == numberOfSteps) && + (identical(other.ingredientAsItems, ingredientAsItems) || + other.ingredientAsItems == ingredientAsItems) && const DeepCollectionEquality().equals(other._types, _types) && - const DeepCollectionEquality().equals(other._cookingTimes, _cookingTimes) && + const DeepCollectionEquality() + .equals(other._cookingTimes, _cookingTimes) && const DeepCollectionEquality().equals(other._statuses, _statuses) && - (identical(other.selectedType, selectedType) || other.selectedType == selectedType) && - (identical(other.selectedCookingTime, selectedCookingTime) || other.selectedCookingTime == selectedCookingTime) && - (identical(other.selectedStatus, selectedStatus) || other.selectedStatus == selectedStatus)); + (identical(other.selectedType, selectedType) || + other.selectedType == selectedType) && + (identical(other.selectedCookingTime, selectedCookingTime) || + other.selectedCookingTime == selectedCookingTime) && + (identical(other.selectedStatus, selectedStatus) || + other.selectedStatus == selectedStatus)); } @override @@ -883,8 +911,9 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> get copyWith => - __$$RecipeCreateStateLoadedImplCopyWithImpl<_$RecipeCreateStateLoadedImpl>(this, _$identity); + _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> + get copyWith => __$$RecipeCreateStateLoadedImplCopyWithImpl< + _$RecipeCreateStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -1086,86 +1115,74 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { abstract class RecipeCreateStateLoaded implements RecipeCreateState { const factory RecipeCreateStateLoaded( - {final RecipeModel? recipe, - required final ImagePicker picker, - required final TextEditingController titleController, - required final TextEditingController productNameController, - required final TextEditingController ingredientController, - required final TextEditingController stepDescriptionController, - required final TextEditingController youtubeLinkController, - required final List stepControllers, - final XFile? recipeImage, - required final List stepImages, - required final List ingredients, - required final List autocompleteList, - required final int numberOfSteps, - required final bool ingredientAsItems, - required final List types, - required final List cookingTimes, - required final List statuses, - required final SelectionPopupModel selectedType, - required final SelectionPopupModel selectedCookingTime, - required final SelectionPopupModel selectedStatus}) = _$RecipeCreateStateLoadedImpl; + {final RecipeModel? recipe, + required final ImagePicker picker, + required final TextEditingController titleController, + required final TextEditingController productNameController, + required final TextEditingController ingredientController, + required final TextEditingController stepDescriptionController, + required final TextEditingController youtubeLinkController, + required final List stepControllers, + final XFile? recipeImage, + required final List stepImages, + required final List ingredients, + required final List autocompleteList, + required final int numberOfSteps, + required final bool ingredientAsItems, + required final List types, + required final List cookingTimes, + required final List statuses, + required final SelectionPopupModel selectedType, + required final SelectionPopupModel selectedCookingTime, + required final SelectionPopupModel selectedStatus}) = + _$RecipeCreateStateLoadedImpl; RecipeModel? get recipe; - ImagePicker get picker; - TextEditingController get titleController; - TextEditingController get productNameController; - TextEditingController get ingredientController; - TextEditingController get stepDescriptionController; - TextEditingController get youtubeLinkController; - List get stepControllers; - XFile? get recipeImage; - List get stepImages; - List get ingredients; - List get autocompleteList; - int get numberOfSteps; - bool get ingredientAsItems; - List get types; - List get cookingTimes; - List get statuses; - SelectionPopupModel get selectedType; - SelectionPopupModel get selectedCookingTime; - SelectionPopupModel get selectedStatus; /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$RecipeCreateStateErrorImplCopyWith<$Res> { - factory _$$RecipeCreateStateErrorImplCopyWith(_$RecipeCreateStateErrorImpl value, $Res Function(_$RecipeCreateStateErrorImpl) then) = + factory _$$RecipeCreateStateErrorImplCopyWith( + _$RecipeCreateStateErrorImpl value, + $Res Function(_$RecipeCreateStateErrorImpl) then) = __$$RecipeCreateStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$RecipeCreateStateErrorImplCopyWithImpl<$Res> extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateErrorImpl> +class __$$RecipeCreateStateErrorImplCopyWithImpl<$Res> + extends _$RecipeCreateStateCopyWithImpl<$Res, _$RecipeCreateStateErrorImpl> implements _$$RecipeCreateStateErrorImplCopyWith<$Res> { - __$$RecipeCreateStateErrorImplCopyWithImpl(_$RecipeCreateStateErrorImpl _value, $Res Function(_$RecipeCreateStateErrorImpl) _then) : super(_value, _then); + __$$RecipeCreateStateErrorImplCopyWithImpl( + _$RecipeCreateStateErrorImpl _value, + $Res Function(_$RecipeCreateStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @@ -1201,7 +1218,8 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RecipeCreateStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -1212,8 +1230,9 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> get copyWith => - __$$RecipeCreateStateErrorImplCopyWithImpl<_$RecipeCreateStateErrorImpl>(this, _$identity); + _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> + get copyWith => __$$RecipeCreateStateErrorImplCopyWithImpl< + _$RecipeCreateStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -1354,12 +1373,14 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { } abstract class RecipeCreateStateError implements RecipeCreateState { - const factory RecipeCreateStateError({required final String errorMessage}) = _$RecipeCreateStateErrorImpl; + const factory RecipeCreateStateError({required final String errorMessage}) = + _$RecipeCreateStateErrorImpl; String get errorMessage; /// Create a copy of RecipeCreateState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/services/recipe_service.g.dart b/lib/features/recipes/services/recipe_service.g.dart index 65636a26..c32c9e8a 100644 --- a/lib/features/recipes/services/recipe_service.g.dart +++ b/lib/features/recipes/services/recipe_service.g.dart @@ -79,7 +79,11 @@ class _RecipeService implements RecipeService { final _result = await _dio.fetch>(_options); late Map> _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry(k, (v as List).map((i) => Product.fromJson(i as Map)).toList())); + _value = _result.data!.map((k, dynamic v) => MapEntry( + k, + (v as List) + .map((i) => Product.fromJson(i as Map)) + .toList())); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -250,7 +254,9 @@ class _RecipeService implements RecipeService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/registration/models/location_model.freezed.dart b/lib/features/registration/models/location_model.freezed.dart index 052bc27b..95f81d60 100644 --- a/lib/features/registration/models/location_model.freezed.dart +++ b/lib/features/registration/models/location_model.freezed.dart @@ -21,7 +21,6 @@ LocationModel _$LocationModelFromJson(Map json) { /// @nodoc mixin _$LocationModel { List get locations => throw _privateConstructorUsedError; - @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; @@ -31,24 +30,28 @@ mixin _$LocationModel { /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $LocationModelCopyWith get copyWith => throw _privateConstructorUsedError; + $LocationModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $LocationModelCopyWith<$Res> { - factory $LocationModelCopyWith(LocationModel value, $Res Function(LocationModel) then) = _$LocationModelCopyWithImpl<$Res, LocationModel>; - + factory $LocationModelCopyWith( + LocationModel value, $Res Function(LocationModel) then) = + _$LocationModelCopyWithImpl<$Res, LocationModel>; @useResult - $Res call({List locations, @JsonKey(name: 'response_body') String responseBody}); + $Res call( + {List locations, + @JsonKey(name: 'response_body') String responseBody}); } /// @nodoc -class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> implements $LocationModelCopyWith<$Res> { +class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> + implements $LocationModelCopyWith<$Res> { _$LocationModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -74,17 +77,25 @@ class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> implements $ } /// @nodoc -abstract class _$$LocationModelImplCopyWith<$Res> implements $LocationModelCopyWith<$Res> { - factory _$$LocationModelImplCopyWith(_$LocationModelImpl value, $Res Function(_$LocationModelImpl) then) = __$$LocationModelImplCopyWithImpl<$Res>; - +abstract class _$$LocationModelImplCopyWith<$Res> + implements $LocationModelCopyWith<$Res> { + factory _$$LocationModelImplCopyWith( + _$LocationModelImpl value, $Res Function(_$LocationModelImpl) then) = + __$$LocationModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({List locations, @JsonKey(name: 'response_body') String responseBody}); + $Res call( + {List locations, + @JsonKey(name: 'response_body') String responseBody}); } /// @nodoc -class __$$LocationModelImplCopyWithImpl<$Res> extends _$LocationModelCopyWithImpl<$Res, _$LocationModelImpl> implements _$$LocationModelImplCopyWith<$Res> { - __$$LocationModelImplCopyWithImpl(_$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) : super(_value, _then); +class __$$LocationModelImplCopyWithImpl<$Res> + extends _$LocationModelCopyWithImpl<$Res, _$LocationModelImpl> + implements _$$LocationModelImplCopyWith<$Res> { + __$$LocationModelImplCopyWithImpl( + _$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) + : super(_value, _then); /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @@ -110,12 +121,15 @@ class __$$LocationModelImplCopyWithImpl<$Res> extends _$LocationModelCopyWithImp /// @nodoc @JsonSerializable() class _$LocationModelImpl implements _LocationModel { - const _$LocationModelImpl({required final List locations, @JsonKey(name: 'response_body') required this.responseBody}) : _locations = locations; + const _$LocationModelImpl( + {required final List locations, + @JsonKey(name: 'response_body') required this.responseBody}) + : _locations = locations; - factory _$LocationModelImpl.fromJson(Map json) => _$$LocationModelImplFromJson(json); + factory _$LocationModelImpl.fromJson(Map json) => + _$$LocationModelImplFromJson(json); final List _locations; - @override List get locations { if (_locations is EqualUnmodifiableListView) return _locations; @@ -137,20 +151,24 @@ class _$LocationModelImpl implements _LocationModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$LocationModelImpl && - const DeepCollectionEquality().equals(other._locations, _locations) && - (identical(other.responseBody, responseBody) || other.responseBody == responseBody)); + const DeepCollectionEquality() + .equals(other._locations, _locations) && + (identical(other.responseBody, responseBody) || + other.responseBody == responseBody)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_locations), responseBody); + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_locations), responseBody); /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); + _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => + __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); @override Map toJson() { @@ -161,14 +179,16 @@ class _$LocationModelImpl implements _LocationModel { } abstract class _LocationModel implements LocationModel { - const factory _LocationModel({required final List locations, @JsonKey(name: 'response_body') required final String responseBody}) = + const factory _LocationModel( + {required final List locations, + @JsonKey(name: 'response_body') required final String responseBody}) = _$LocationModelImpl; - factory _LocationModel.fromJson(Map json) = _$LocationModelImpl.fromJson; + factory _LocationModel.fromJson(Map json) = + _$LocationModelImpl.fromJson; @override List get locations; - @override @JsonKey(name: 'response_body') String get responseBody; @@ -177,5 +197,6 @@ abstract class _LocationModel implements LocationModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/registration/models/location_model.g.dart b/lib/features/registration/models/location_model.g.dart index da69ba9b..449630a4 100644 --- a/lib/features/registration/models/location_model.g.dart +++ b/lib/features/registration/models/location_model.g.dart @@ -6,12 +6,15 @@ part of 'location_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$LocationModelImpl _$$LocationModelImplFromJson(Map json) => _$LocationModelImpl( - locations: (json['locations'] as List).map((e) => e as String).toList(), +_$LocationModelImpl _$$LocationModelImplFromJson(Map json) => + _$LocationModelImpl( + locations: + (json['locations'] as List).map((e) => e as String).toList(), responseBody: json['response_body'] as String, ); -Map _$$LocationModelImplToJson(_$LocationModelImpl instance) => { +Map _$$LocationModelImplToJson(_$LocationModelImpl instance) => + { 'locations': instance.locations, 'response_body': instance.responseBody, }; diff --git a/lib/features/registration/models/user_registration_model.freezed.dart b/lib/features/registration/models/user_registration_model.freezed.dart index ed0044cc..fd835a26 100644 --- a/lib/features/registration/models/user_registration_model.freezed.dart +++ b/lib/features/registration/models/user_registration_model.freezed.dart @@ -3,7 +3,7 @@ // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark -part of '../../../features/registration/models/user_registration_model.dart'; +part of 'user_registration_model.dart'; // ************************************************************************** // FreezedGenerator @@ -14,7 +14,8 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -UserRegistrationSheet _$UserRegistrationSheetFromJson(Map json) { +UserRegistrationSheet _$UserRegistrationSheetFromJson( + Map json) { return _UserRegistrationSheet.fromJson(json); } @@ -22,74 +23,48 @@ UserRegistrationSheet _$UserRegistrationSheetFromJson(Map json) mixin _$UserRegistrationSheet { @JsonKey(name: 'first_name') String get firstName => throw _privateConstructorUsedError; - @JsonKey(name: 'last_name') String get lastName => throw _privateConstructorUsedError; - String get email => throw _privateConstructorUsedError; - String get password => throw _privateConstructorUsedError; - @JsonKey(name: 'password_confirmation') String get passwordConfirmation => throw _privateConstructorUsedError; - @JsonKey(name: 'terms') String get termsAccepted => throw _privateConstructorUsedError; - String get birthdate => throw _privateConstructorUsedError; - String get gender => throw _privateConstructorUsedError; - String get location => throw _privateConstructorUsedError; - @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; - String get lang => throw _privateConstructorUsedError; - int get weight => throw _privateConstructorUsedError; - int get height => throw _privateConstructorUsedError; - @JsonKey(name: 'chest_circumference') int get chestCircumference => throw _privateConstructorUsedError; - @JsonKey(name: 'waist_circumference') int get waistCircumference => throw _privateConstructorUsedError; - @JsonKey(name: 'hip_circumference') int get hipCircumference => throw _privateConstructorUsedError; - @JsonKey(name: 'blood_pressure_up') int get bloodPressureUp => throw _privateConstructorUsedError; - @JsonKey(name: 'blood_pressure_down') int get bloodPressureDown => throw _privateConstructorUsedError; - @JsonKey(name: 'has_hypo') int get hasHypo => throw _privateConstructorUsedError; - @JsonKey(name: 'has_hyper') int get hasHyper => throw _privateConstructorUsedError; - @JsonKey(name: 'about_alergy') String get aboutAllergy => throw _privateConstructorUsedError; - @JsonKey(name: 'about_taking_pils') String get aboutTakingPils => throw _privateConstructorUsedError; - @JsonKey(name: 'about_sport_hobbies') String get aboutSportHobbies => throw _privateConstructorUsedError; - @JsonKey(name: 'favorite_foods') String get favoriteFoods => throw _privateConstructorUsedError; - @JsonKey(name: 'unfavorite_foods') String get unfavoriteFoods => throw _privateConstructorUsedError; - @JsonKey(name: 'additional_info') String get additionalInfo => throw _privateConstructorUsedError; - @JsonKey(name: 'activity_coefficient') double get activityCoefficient => throw _privateConstructorUsedError; @@ -99,14 +74,15 @@ mixin _$UserRegistrationSheet { /// Create a copy of UserRegistrationSheet /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $UserRegistrationSheetCopyWith get copyWith => throw _privateConstructorUsedError; + $UserRegistrationSheetCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $UserRegistrationSheetCopyWith<$Res> { - factory $UserRegistrationSheetCopyWith(UserRegistrationSheet value, $Res Function(UserRegistrationSheet) then) = + factory $UserRegistrationSheetCopyWith(UserRegistrationSheet value, + $Res Function(UserRegistrationSheet) then) = _$UserRegistrationSheetCopyWithImpl<$Res, UserRegistrationSheet>; - @useResult $Res call( {@JsonKey(name: 'first_name') String firstName, @@ -139,12 +115,13 @@ abstract class $UserRegistrationSheetCopyWith<$Res> { } /// @nodoc -class _$UserRegistrationSheetCopyWithImpl<$Res, $Val extends UserRegistrationSheet> implements $UserRegistrationSheetCopyWith<$Res> { +class _$UserRegistrationSheetCopyWithImpl<$Res, + $Val extends UserRegistrationSheet> + implements $UserRegistrationSheetCopyWith<$Res> { _$UserRegistrationSheetCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -295,10 +272,12 @@ class _$UserRegistrationSheetCopyWithImpl<$Res, $Val extends UserRegistrationShe } /// @nodoc -abstract class _$$UserRegistrationSheetImplCopyWith<$Res> implements $UserRegistrationSheetCopyWith<$Res> { - factory _$$UserRegistrationSheetImplCopyWith(_$UserRegistrationSheetImpl value, $Res Function(_$UserRegistrationSheetImpl) then) = +abstract class _$$UserRegistrationSheetImplCopyWith<$Res> + implements $UserRegistrationSheetCopyWith<$Res> { + factory _$$UserRegistrationSheetImplCopyWith( + _$UserRegistrationSheetImpl value, + $Res Function(_$UserRegistrationSheetImpl) then) = __$$UserRegistrationSheetImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -332,9 +311,13 @@ abstract class _$$UserRegistrationSheetImplCopyWith<$Res> implements $UserRegist } /// @nodoc -class __$$UserRegistrationSheetImplCopyWithImpl<$Res> extends _$UserRegistrationSheetCopyWithImpl<$Res, _$UserRegistrationSheetImpl> +class __$$UserRegistrationSheetImplCopyWithImpl<$Res> + extends _$UserRegistrationSheetCopyWithImpl<$Res, + _$UserRegistrationSheetImpl> implements _$$UserRegistrationSheetImplCopyWith<$Res> { - __$$UserRegistrationSheetImplCopyWithImpl(_$UserRegistrationSheetImpl _value, $Res Function(_$UserRegistrationSheetImpl) _then) : super(_value, _then); + __$$UserRegistrationSheetImplCopyWithImpl(_$UserRegistrationSheetImpl _value, + $Res Function(_$UserRegistrationSheetImpl) _then) + : super(_value, _then); /// Create a copy of UserRegistrationSheet /// with the given fields replaced by the non-null parameter values. @@ -490,7 +473,8 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(name: 'last_name') required this.lastName, required this.email, required this.password, - @JsonKey(name: 'password_confirmation') required this.passwordConfirmation, + @JsonKey(name: 'password_confirmation') + required this.passwordConfirmation, @JsonKey(name: 'terms') this.termsAccepted = 'accepted', required this.birthdate, required this.gender, @@ -514,7 +498,8 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(name: 'additional_info') required this.additionalInfo, @JsonKey(name: 'activity_coefficient') this.activityCoefficient = 1.2}); - factory _$UserRegistrationSheetImpl.fromJson(Map json) => _$$UserRegistrationSheetImplFromJson(json); + factory _$UserRegistrationSheetImpl.fromJson(Map json) => + _$$UserRegistrationSheetImplFromJson(json); @override @JsonKey(name: 'first_name') @@ -600,33 +585,54 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { return identical(this, other) || (other.runtimeType == runtimeType && other is _$UserRegistrationSheetImpl && - (identical(other.firstName, firstName) || other.firstName == firstName) && - (identical(other.lastName, lastName) || other.lastName == lastName) && + (identical(other.firstName, firstName) || + other.firstName == firstName) && + (identical(other.lastName, lastName) || + other.lastName == lastName) && (identical(other.email, email) || other.email == email) && - (identical(other.password, password) || other.password == password) && - (identical(other.passwordConfirmation, passwordConfirmation) || other.passwordConfirmation == passwordConfirmation) && - (identical(other.termsAccepted, termsAccepted) || other.termsAccepted == termsAccepted) && - (identical(other.birthdate, birthdate) || other.birthdate == birthdate) && + (identical(other.password, password) || + other.password == password) && + (identical(other.passwordConfirmation, passwordConfirmation) || + other.passwordConfirmation == passwordConfirmation) && + (identical(other.termsAccepted, termsAccepted) || + other.termsAccepted == termsAccepted) && + (identical(other.birthdate, birthdate) || + other.birthdate == birthdate) && (identical(other.gender, gender) || other.gender == gender) && - (identical(other.location, location) || other.location == location) && - (identical(other.responseBody, responseBody) || other.responseBody == responseBody) && + (identical(other.location, location) || + other.location == location) && + (identical(other.responseBody, responseBody) || + other.responseBody == responseBody) && (identical(other.lang, lang) || other.lang == lang) && (identical(other.weight, weight) || other.weight == weight) && (identical(other.height, height) || other.height == height) && - (identical(other.chestCircumference, chestCircumference) || other.chestCircumference == chestCircumference) && - (identical(other.waistCircumference, waistCircumference) || other.waistCircumference == waistCircumference) && - (identical(other.hipCircumference, hipCircumference) || other.hipCircumference == hipCircumference) && - (identical(other.bloodPressureUp, bloodPressureUp) || other.bloodPressureUp == bloodPressureUp) && - (identical(other.bloodPressureDown, bloodPressureDown) || other.bloodPressureDown == bloodPressureDown) && + (identical(other.chestCircumference, chestCircumference) || + other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || + other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || + other.hipCircumference == hipCircumference) && + (identical(other.bloodPressureUp, bloodPressureUp) || + other.bloodPressureUp == bloodPressureUp) && + (identical(other.bloodPressureDown, bloodPressureDown) || + other.bloodPressureDown == bloodPressureDown) && (identical(other.hasHypo, hasHypo) || other.hasHypo == hasHypo) && - (identical(other.hasHyper, hasHyper) || other.hasHyper == hasHyper) && - (identical(other.aboutAllergy, aboutAllergy) || other.aboutAllergy == aboutAllergy) && - (identical(other.aboutTakingPils, aboutTakingPils) || other.aboutTakingPils == aboutTakingPils) && - (identical(other.aboutSportHobbies, aboutSportHobbies) || other.aboutSportHobbies == aboutSportHobbies) && - (identical(other.favoriteFoods, favoriteFoods) || other.favoriteFoods == favoriteFoods) && - (identical(other.unfavoriteFoods, unfavoriteFoods) || other.unfavoriteFoods == unfavoriteFoods) && - (identical(other.additionalInfo, additionalInfo) || other.additionalInfo == additionalInfo) && - (identical(other.activityCoefficient, activityCoefficient) || other.activityCoefficient == activityCoefficient)); + (identical(other.hasHyper, hasHyper) || + other.hasHyper == hasHyper) && + (identical(other.aboutAllergy, aboutAllergy) || + other.aboutAllergy == aboutAllergy) && + (identical(other.aboutTakingPils, aboutTakingPils) || + other.aboutTakingPils == aboutTakingPils) && + (identical(other.aboutSportHobbies, aboutSportHobbies) || + other.aboutSportHobbies == aboutSportHobbies) && + (identical(other.favoriteFoods, favoriteFoods) || + other.favoriteFoods == favoriteFoods) && + (identical(other.unfavoriteFoods, unfavoriteFoods) || + other.unfavoriteFoods == unfavoriteFoods) && + (identical(other.additionalInfo, additionalInfo) || + other.additionalInfo == additionalInfo) && + (identical(other.activityCoefficient, activityCoefficient) || + other.activityCoefficient == activityCoefficient)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -667,8 +673,9 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => - __$$UserRegistrationSheetImplCopyWithImpl<_$UserRegistrationSheetImpl>(this, _$identity); + _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> + get copyWith => __$$UserRegistrationSheetImplCopyWithImpl< + _$UserRegistrationSheetImpl>(this, _$identity); @override Map toJson() { @@ -684,7 +691,8 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { @JsonKey(name: 'last_name') required final String lastName, required final String email, required final String password, - @JsonKey(name: 'password_confirmation') required final String passwordConfirmation, + @JsonKey(name: 'password_confirmation') + required final String passwordConfirmation, @JsonKey(name: 'terms') final String termsAccepted, required final String birthdate, required final String gender, @@ -693,119 +701,99 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { required final String lang, required final int weight, required final int height, - @JsonKey(name: 'chest_circumference') required final int chestCircumference, - @JsonKey(name: 'waist_circumference') required final int waistCircumference, + @JsonKey(name: 'chest_circumference') + required final int chestCircumference, + @JsonKey(name: 'waist_circumference') + required final int waistCircumference, @JsonKey(name: 'hip_circumference') required final int hipCircumference, @JsonKey(name: 'blood_pressure_up') required final int bloodPressureUp, - @JsonKey(name: 'blood_pressure_down') required final int bloodPressureDown, + @JsonKey(name: 'blood_pressure_down') + required final int bloodPressureDown, @JsonKey(name: 'has_hypo') required final int hasHypo, @JsonKey(name: 'has_hyper') required final int hasHyper, @JsonKey(name: 'about_alergy') required final String aboutAllergy, @JsonKey(name: 'about_taking_pils') required final String aboutTakingPils, - @JsonKey(name: 'about_sport_hobbies') required final String aboutSportHobbies, + @JsonKey(name: 'about_sport_hobbies') + required final String aboutSportHobbies, @JsonKey(name: 'favorite_foods') required final String favoriteFoods, @JsonKey(name: 'unfavorite_foods') required final String unfavoriteFoods, @JsonKey(name: 'additional_info') required final String additionalInfo, - @JsonKey(name: 'activity_coefficient') final double activityCoefficient}) = _$UserRegistrationSheetImpl; + @JsonKey(name: 'activity_coefficient') + final double activityCoefficient}) = _$UserRegistrationSheetImpl; - factory _UserRegistrationSheet.fromJson(Map json) = _$UserRegistrationSheetImpl.fromJson; + factory _UserRegistrationSheet.fromJson(Map json) = + _$UserRegistrationSheetImpl.fromJson; @override @JsonKey(name: 'first_name') String get firstName; - @override @JsonKey(name: 'last_name') String get lastName; - @override String get email; - @override String get password; - @override @JsonKey(name: 'password_confirmation') String get passwordConfirmation; - @override @JsonKey(name: 'terms') String get termsAccepted; - @override String get birthdate; - @override String get gender; - @override String get location; - @override @JsonKey(name: 'response_body') String get responseBody; - @override String get lang; - @override int get weight; - @override int get height; - @override @JsonKey(name: 'chest_circumference') int get chestCircumference; - @override @JsonKey(name: 'waist_circumference') int get waistCircumference; - @override @JsonKey(name: 'hip_circumference') int get hipCircumference; - @override @JsonKey(name: 'blood_pressure_up') int get bloodPressureUp; - @override @JsonKey(name: 'blood_pressure_down') int get bloodPressureDown; - @override @JsonKey(name: 'has_hypo') int get hasHypo; - @override @JsonKey(name: 'has_hyper') int get hasHyper; - @override @JsonKey(name: 'about_alergy') String get aboutAllergy; - @override @JsonKey(name: 'about_taking_pils') String get aboutTakingPils; - @override @JsonKey(name: 'about_sport_hobbies') String get aboutSportHobbies; - @override @JsonKey(name: 'favorite_foods') String get favoriteFoods; - @override @JsonKey(name: 'unfavorite_foods') String get unfavoriteFoods; - @override @JsonKey(name: 'additional_info') String get additionalInfo; - @override @JsonKey(name: 'activity_coefficient') double get activityCoefficient; @@ -814,5 +802,6 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => throw _privateConstructorUsedError; + _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/models/user_registration_model.g.dart b/lib/features/registration/models/user_registration_model.g.dart index 7690dbb1..9500e915 100644 --- a/lib/features/registration/models/user_registration_model.g.dart +++ b/lib/features/registration/models/user_registration_model.g.dart @@ -6,7 +6,9 @@ part of 'user_registration_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson(Map json) => _$UserRegistrationSheetImpl( +_$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson( + Map json) => + _$UserRegistrationSheetImpl( firstName: json['first_name'] as String, lastName: json['last_name'] as String, email: json['email'] as String, @@ -33,10 +35,13 @@ _$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson(Map _$$UserRegistrationSheetImplToJson(_$UserRegistrationSheetImpl instance) => { +Map _$$UserRegistrationSheetImplToJson( + _$UserRegistrationSheetImpl instance) => + { 'first_name': instance.firstName, 'last_name': instance.lastName, 'email': instance.email, diff --git a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart index eb722a2b..ae0a9706 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart @@ -21,13 +21,15 @@ mixin _$RegistrationState { /// Create a copy of RegistrationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RegistrationStateCopyWith get copyWith => throw _privateConstructorUsedError; + $RegistrationStateCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RegistrationStateCopyWith<$Res> { - factory $RegistrationStateCopyWith(RegistrationState value, $Res Function(RegistrationState) then) = _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; - + factory $RegistrationStateCopyWith( + RegistrationState value, $Res Function(RegistrationState) then) = + _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; @useResult $Res call({UserRegistrationSheet sheet}); @@ -35,12 +37,12 @@ abstract class $RegistrationStateCopyWith<$Res> { } /// @nodoc -class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> implements $RegistrationStateCopyWith<$Res> { +class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> + implements $RegistrationStateCopyWith<$Res> { _$RegistrationStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -71,10 +73,11 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> impl } /// @nodoc -abstract class _$$RegistrationStateImplCopyWith<$Res> implements $RegistrationStateCopyWith<$Res> { - factory _$$RegistrationStateImplCopyWith(_$RegistrationStateImpl value, $Res Function(_$RegistrationStateImpl) then) = +abstract class _$$RegistrationStateImplCopyWith<$Res> + implements $RegistrationStateCopyWith<$Res> { + factory _$$RegistrationStateImplCopyWith(_$RegistrationStateImpl value, + $Res Function(_$RegistrationStateImpl) then) = __$$RegistrationStateImplCopyWithImpl<$Res>; - @override @useResult $Res call({UserRegistrationSheet sheet}); @@ -84,9 +87,12 @@ abstract class _$$RegistrationStateImplCopyWith<$Res> implements $RegistrationSt } /// @nodoc -class __$$RegistrationStateImplCopyWithImpl<$Res> extends _$RegistrationStateCopyWithImpl<$Res, _$RegistrationStateImpl> +class __$$RegistrationStateImplCopyWithImpl<$Res> + extends _$RegistrationStateCopyWithImpl<$Res, _$RegistrationStateImpl> implements _$$RegistrationStateImplCopyWith<$Res> { - __$$RegistrationStateImplCopyWithImpl(_$RegistrationStateImpl _value, $Res Function(_$RegistrationStateImpl) _then) : super(_value, _then); + __$$RegistrationStateImplCopyWithImpl(_$RegistrationStateImpl _value, + $Res Function(_$RegistrationStateImpl) _then) + : super(_value, _then); /// Create a copy of RegistrationState /// with the given fields replaced by the non-null parameter values. @@ -120,7 +126,9 @@ class _$RegistrationStateImpl implements _RegistrationState { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$RegistrationStateImpl && (identical(other.sheet, sheet) || other.sheet == sheet)); + (other.runtimeType == runtimeType && + other is _$RegistrationStateImpl && + (identical(other.sheet, sheet) || other.sheet == sheet)); } @override @@ -131,11 +139,14 @@ class _$RegistrationStateImpl implements _RegistrationState { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => __$$RegistrationStateImplCopyWithImpl<_$RegistrationStateImpl>(this, _$identity); + _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => + __$$RegistrationStateImplCopyWithImpl<_$RegistrationStateImpl>( + this, _$identity); } abstract class _RegistrationState implements RegistrationState { - const factory _RegistrationState({required final UserRegistrationSheet sheet}) = _$RegistrationStateImpl; + const factory _RegistrationState( + {required final UserRegistrationSheet sheet}) = _$RegistrationStateImpl; @override UserRegistrationSheet get sheet; @@ -144,5 +155,6 @@ abstract class _RegistrationState implements RegistrationState { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => throw _privateConstructorUsedError; + _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/registration/services/registration_service.g.dart b/lib/features/registration/services/registration_service.g.dart index 50d9fd82..4aaccede 100644 --- a/lib/features/registration/services/registration_service.g.dart +++ b/lib/features/registration/services/registration_service.g.dart @@ -22,7 +22,8 @@ class _RegistrationService implements RegistrationService { final ParseErrorLogger? errorLogger; @override - Future> register({required Map sheet}) async { + Future> register( + {required Map sheet}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -128,7 +129,9 @@ class _RegistrationService implements RegistrationService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/pubspec.yaml b/pubspec.yaml index 0dbf3d7a..c3a96e3b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -64,5 +64,6 @@ flutter: - assets/images/ - assets/audio/ - assets/icons/ + flutter_intl: enabled: true From d771feefe33521a5121249fa869f04492a4f3a31 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 18 Sep 2024 16:14:00 +0300 Subject: [PATCH 21/31] fix: charts, profile, bottom nav bar --- .../initialization_state.freezed.dart | 94 ++-- lib/core/models/pagination_model.freezed.dart | 169 +++---- lib/core/models/pagination_model.g.dart | 13 +- .../selection_popup_model.freezed.dart | 52 +- .../new_messages_state.freezed.dart | 90 ++-- .../notifications_state.freezed.dart | 157 ++---- .../widgets/bottom_navigation_bar_widget.dart | 38 +- .../models/calendar_model.freezed.dart | 89 ++-- .../calendar/models/calendar_model.g.dart | 13 +- .../bloc/calendar_state.freezed.dart | 95 ++-- .../calendar/services/calendar_service.g.dart | 8 +- .../models/chat_message_model.freezed.dart | 71 ++- .../chat/models/chat_message_model.g.dart | 8 +- .../models/chat_messages_model.freezed.dart | 68 +-- .../chat/models/chat_messages_model.g.dart | 12 +- .../chat/models/chat_meta_model.freezed.dart | 52 +- .../chat/models/chat_meta_model.g.dart | 6 +- .../chat/models/chat_room_model.freezed.dart | 76 ++- .../chat/models/chat_room_model.g.dart | 12 +- .../chat_room_preview_model.freezed.dart | 332 ++++++------- .../models/chat_room_preview_model.g.dart | 41 +- .../chat_room_settings_model.freezed.dart | 76 ++- .../models/chat_room_settings_model.g.dart | 8 +- .../chat/models/chat_user_model.freezed.dart | 76 ++- .../chat/models/chat_user_model.g.dart | 6 +- .../models/websocket_info_model.freezed.dart | 79 ++- .../chat/models/websocket_info_model.g.dart | 8 +- .../chat_room_state.freezed.dart | 169 ++----- .../chat_select_state.freezed.dart | 100 ++-- .../chat/services/chat_service.g.dart | 7 +- lib/features/diary/models/diary_model.dart | 1 + lib/features/diary/models/meal.dart | 1 + lib/features/diary/models/photo.dart | 1 + lib/features/diary/models/portion.dart | 1 + lib/features/diary/models/product.dart | 1 + lib/features/diary/models/state.dart | 1 + .../feed/models/comment_model.freezed.dart | 147 +++--- lib/features/feed/models/comment_model.g.dart | 20 +- .../feed/models/diets_pagination_model.dart | 1 + .../models/feed_blog_post_settings_model.dart | 1 + .../feed/models/recipes_pagination_model.dart | 1 + .../comments_state.freezed.dart | 83 ++-- .../plans/models/plan_pagination_model.dart | 1 + .../profile/models/circumference_model.dart | 1 + .../profile/models/profile_model.dart | 1 + lib/features/profile/models/weight_model.dart | 1 + .../bloc/profile_cubit/profile_cubit.dart | 16 +- .../bloc/profile_cubit/profile_state.dart | 4 +- .../profile_cubit/profile_state.freezed.dart | 104 ++-- .../presentation/pages/profile_screen.dart | 452 +++++++++--------- .../widgets/weight_chart_widget.dart | 109 +++-- lib/features/recipes/models/ingredient.dart | 1 + lib/features/recipes/models/recipe_model.dart | 1 + .../models/recipe_tag_model.freezed.dart | 135 +++--- .../recipes/models/recipe_tag_model.g.dart | 17 +- lib/features/recipes/models/step.dart | 1 + .../models/location_model.freezed.dart | 69 +-- .../registration/models/location_model.g.dart | 9 +- .../user_registration_model.freezed.dart | 181 +++---- .../models/user_registration_model.g.dart | 11 +- .../registration_state.freezed.dart | 40 +- .../pages/registration_screen.dart | 2 +- .../services/registration_service.g.dart | 7 +- lib/generated/intl/messages_all.dart | 8 +- lib/generated/intl/messages_en.dart | 154 ++---- lib/generated/l10n.dart | 12 +- lib/main.dart | 29 -- lib/old/auth/auth_screen/auth_screen.dart | 2 +- .../bloc/diet_create_bloc.dart | 3 +- .../diet_edit_screen/bloc/diet_edit_bloc.dart | 3 +- .../bloc/diet_select_bloc.dart | 3 +- .../diet_show_screen/bloc/diet_show_bloc.dart | 3 +- .../bloc/blog_post_create_bloc.dart | 1 + .../bloc/blog_post_edit_bloc.dart | 5 +- .../blog_post_edit_screen.dart | 1 - .../widgets/comment_widget.dart | 1 - .../bloc/glossary_screen_bloc.dart | 3 +- .../bloc/plan_create_bloc.dart | 3 +- .../plan_edit_screen/bloc/plan_edit_bloc.dart | 3 +- .../bloc/plan_select_bloc.dart | 3 +- .../plan_show_screen/bloc/plan_show_bloc.dart | 3 +- 81 files changed, 1478 insertions(+), 2209 deletions(-) diff --git a/lib/core/initialization_cubit/initialization_state.freezed.dart b/lib/core/initialization_cubit/initialization_state.freezed.dart index b0535c68..d9ece2ef 100644 --- a/lib/core/initialization_cubit/initialization_state.freezed.dart +++ b/lib/core/initialization_cubit/initialization_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$InitializationState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,17 @@ mixin _$InitializationState { /// @nodoc abstract class $InitializationStateCopyWith<$Res> { - factory $InitializationStateCopyWith( - InitializationState value, $Res Function(InitializationState) then) = + factory $InitializationStateCopyWith(InitializationState value, $Res Function(InitializationState) then) = _$InitializationStateCopyWithImpl<$Res, InitializationState>; } /// @nodoc -class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> - implements $InitializationStateCopyWith<$Res> { +class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> implements $InitializationStateCopyWith<$Res> { _$InitializationStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +91,14 @@ class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> /// @nodoc abstract class _$$InitializationStateImplCopyWith<$Res> { - factory _$$InitializationStateImplCopyWith(_$InitializationStateImpl value, - $Res Function(_$InitializationStateImpl) then) = + factory _$$InitializationStateImplCopyWith(_$InitializationStateImpl value, $Res Function(_$InitializationStateImpl) then) = __$$InitializationStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitializationStateImplCopyWithImpl<$Res> - extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateImpl> +class __$$InitializationStateImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateImpl> implements _$$InitializationStateImplCopyWith<$Res> { - __$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value, - $Res Function(_$InitializationStateImpl) _then) - : super(_value, _then); + __$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value, $Res Function(_$InitializationStateImpl) _then) : super(_value, _then); /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @@ -120,9 +116,7 @@ class _$InitializationStateImpl implements _InitializationState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$InitializationStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateImpl); } @override @@ -209,20 +203,14 @@ abstract class _InitializationState implements InitializationState { /// @nodoc abstract class _$$InitializationStateLoadingImplCopyWith<$Res> { - factory _$$InitializationStateLoadingImplCopyWith( - _$InitializationStateLoadingImpl value, - $Res Function(_$InitializationStateLoadingImpl) then) = + factory _$$InitializationStateLoadingImplCopyWith(_$InitializationStateLoadingImpl value, $Res Function(_$InitializationStateLoadingImpl) then) = __$$InitializationStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitializationStateLoadingImplCopyWithImpl<$Res> - extends _$InitializationStateCopyWithImpl<$Res, - _$InitializationStateLoadingImpl> +class __$$InitializationStateLoadingImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateLoadingImpl> implements _$$InitializationStateLoadingImplCopyWith<$Res> { - __$$InitializationStateLoadingImplCopyWithImpl( - _$InitializationStateLoadingImpl _value, - $Res Function(_$InitializationStateLoadingImpl) _then) + __$$InitializationStateLoadingImplCopyWithImpl(_$InitializationStateLoadingImpl _value, $Res Function(_$InitializationStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -241,9 +229,7 @@ class _$InitializationStateLoadingImpl implements InitializationStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$InitializationStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateLoadingImpl); } @override @@ -330,22 +316,17 @@ abstract class InitializationStateLoading implements InitializationState { /// @nodoc abstract class _$$InitializationStateSuccessImplCopyWith<$Res> { - factory _$$InitializationStateSuccessImplCopyWith( - _$InitializationStateSuccessImpl value, - $Res Function(_$InitializationStateSuccessImpl) then) = + factory _$$InitializationStateSuccessImplCopyWith(_$InitializationStateSuccessImpl value, $Res Function(_$InitializationStateSuccessImpl) then) = __$$InitializationStateSuccessImplCopyWithImpl<$Res>; + @useResult $Res call({PusherChannelsClient client}); } /// @nodoc -class __$$InitializationStateSuccessImplCopyWithImpl<$Res> - extends _$InitializationStateCopyWithImpl<$Res, - _$InitializationStateSuccessImpl> +class __$$InitializationStateSuccessImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateSuccessImpl> implements _$$InitializationStateSuccessImplCopyWith<$Res> { - __$$InitializationStateSuccessImplCopyWithImpl( - _$InitializationStateSuccessImpl _value, - $Res Function(_$InitializationStateSuccessImpl) _then) + __$$InitializationStateSuccessImplCopyWithImpl(_$InitializationStateSuccessImpl _value, $Res Function(_$InitializationStateSuccessImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -380,9 +361,7 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$InitializationStateSuccessImpl && - (identical(other.client, client) || other.client == client)); + (other.runtimeType == runtimeType && other is _$InitializationStateSuccessImpl && (identical(other.client, client) || other.client == client)); } @override @@ -393,9 +372,8 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> - get copyWith => __$$InitializationStateSuccessImplCopyWithImpl< - _$InitializationStateSuccessImpl>(this, _$identity); + _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => + __$$InitializationStateSuccessImplCopyWithImpl<_$InitializationStateSuccessImpl>(this, _$identity); @override @optionalTypeArgs @@ -473,37 +451,29 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { } abstract class InitializationStateSuccess implements InitializationState { - const factory InitializationStateSuccess( - {required final PusherChannelsClient client}) = - _$InitializationStateSuccessImpl; + const factory InitializationStateSuccess({required final PusherChannelsClient client}) = _$InitializationStateSuccessImpl; PusherChannelsClient get client; /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> - get copyWith => throw _privateConstructorUsedError; + _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$InitializationStateErrorImplCopyWith<$Res> { - factory _$$InitializationStateErrorImplCopyWith( - _$InitializationStateErrorImpl value, - $Res Function(_$InitializationStateErrorImpl) then) = + factory _$$InitializationStateErrorImplCopyWith(_$InitializationStateErrorImpl value, $Res Function(_$InitializationStateErrorImpl) then) = __$$InitializationStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$InitializationStateErrorImplCopyWithImpl<$Res> - extends _$InitializationStateCopyWithImpl<$Res, - _$InitializationStateErrorImpl> +class __$$InitializationStateErrorImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateErrorImpl> implements _$$InitializationStateErrorImplCopyWith<$Res> { - __$$InitializationStateErrorImplCopyWithImpl( - _$InitializationStateErrorImpl _value, - $Res Function(_$InitializationStateErrorImpl) _then) + __$$InitializationStateErrorImplCopyWithImpl(_$InitializationStateErrorImpl _value, $Res Function(_$InitializationStateErrorImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -540,8 +510,7 @@ class _$InitializationStateErrorImpl implements InitializationStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -552,9 +521,8 @@ class _$InitializationStateErrorImpl implements InitializationStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> - get copyWith => __$$InitializationStateErrorImplCopyWithImpl< - _$InitializationStateErrorImpl>(this, _$identity); + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => + __$$InitializationStateErrorImplCopyWithImpl<_$InitializationStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -632,14 +600,12 @@ class _$InitializationStateErrorImpl implements InitializationStateError { } abstract class InitializationStateError implements InitializationState { - const factory InitializationStateError({required final String errorMessage}) = - _$InitializationStateErrorImpl; + const factory InitializationStateError({required final String errorMessage}) = _$InitializationStateErrorImpl; String get errorMessage; /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/models/pagination_model.freezed.dart b/lib/core/models/pagination_model.freezed.dart index 35f2c080..692c6ef3 100644 --- a/lib/core/models/pagination_model.freezed.dart +++ b/lib/core/models/pagination_model.freezed.dart @@ -22,10 +22,13 @@ Links _$LinksFromJson(Map json) { mixin _$Links { @JsonKey(name: "first") String get first => throw _privateConstructorUsedError; + @JsonKey(name: "last") String get last => throw _privateConstructorUsedError; + @JsonKey(name: "prev") dynamic get prev => throw _privateConstructorUsedError; + @JsonKey(name: "next") dynamic get next => throw _privateConstructorUsedError; @@ -40,23 +43,20 @@ mixin _$Links { /// @nodoc abstract class $LinksCopyWith<$Res> { - factory $LinksCopyWith(Links value, $Res Function(Links) then) = - _$LinksCopyWithImpl<$Res, Links>; + factory $LinksCopyWith(Links value, $Res Function(Links) then) = _$LinksCopyWithImpl<$Res, Links>; + @useResult $Res call( - {@JsonKey(name: "first") String first, - @JsonKey(name: "last") String last, - @JsonKey(name: "prev") dynamic prev, - @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); } /// @nodoc -class _$LinksCopyWithImpl<$Res, $Val extends Links> - implements $LinksCopyWith<$Res> { +class _$LinksCopyWithImpl<$Res, $Val extends Links> implements $LinksCopyWith<$Res> { _$LinksCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -93,25 +93,17 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links> /// @nodoc abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$Res> { - factory _$$LinksImplCopyWith( - _$LinksImpl value, $Res Function(_$LinksImpl) then) = - __$$LinksImplCopyWithImpl<$Res>; + factory _$$LinksImplCopyWith(_$LinksImpl value, $Res Function(_$LinksImpl) then) = __$$LinksImplCopyWithImpl<$Res>; + @override @useResult $Res call( - {@JsonKey(name: "first") String first, - @JsonKey(name: "last") String last, - @JsonKey(name: "prev") dynamic prev, - @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); } /// @nodoc -class __$$LinksImplCopyWithImpl<$Res> - extends _$LinksCopyWithImpl<$Res, _$LinksImpl> - implements _$$LinksImplCopyWith<$Res> { - __$$LinksImplCopyWithImpl( - _$LinksImpl _value, $Res Function(_$LinksImpl) _then) - : super(_value, _then); +class __$$LinksImplCopyWithImpl<$Res> extends _$LinksCopyWithImpl<$Res, _$LinksImpl> implements _$$LinksImplCopyWith<$Res> { + __$$LinksImplCopyWithImpl(_$LinksImpl _value, $Res Function(_$LinksImpl) _then) : super(_value, _then); /// Create a copy of Links /// with the given fields replaced by the non-null parameter values. @@ -153,8 +145,7 @@ class _$LinksImpl implements _Links { @JsonKey(name: "prev") required this.prev, @JsonKey(name: "next") required this.next}); - factory _$LinksImpl.fromJson(Map json) => - _$$LinksImplFromJson(json); + factory _$LinksImpl.fromJson(Map json) => _$$LinksImplFromJson(json); @override @JsonKey(name: "first") @@ -187,20 +178,14 @@ class _$LinksImpl implements _Links { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - first, - last, - const DeepCollectionEquality().hash(prev), - const DeepCollectionEquality().hash(next)); + int get hashCode => Object.hash(runtimeType, first, last, const DeepCollectionEquality().hash(prev), const DeepCollectionEquality().hash(next)); /// Create a copy of Links /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => - __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); @override Map toJson() { @@ -222,12 +207,15 @@ abstract class _Links implements Links { @override @JsonKey(name: "first") String get first; + @override @JsonKey(name: "last") String get last; + @override @JsonKey(name: "prev") dynamic get prev; + @override @JsonKey(name: "next") dynamic get next; @@ -236,8 +224,7 @@ abstract class _Links implements Links { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => throw _privateConstructorUsedError; } Meta _$MetaFromJson(Map json) { @@ -248,18 +235,25 @@ Meta _$MetaFromJson(Map json) { mixin _$Meta { @JsonKey(name: "current_page") int get currentPage => throw _privateConstructorUsedError; + @JsonKey(name: "from") dynamic get from => throw _privateConstructorUsedError; + @JsonKey(name: "last_page") int get lastPage => throw _privateConstructorUsedError; + @JsonKey(name: "links") List get links => throw _privateConstructorUsedError; + @JsonKey(name: "path") String? get path => throw _privateConstructorUsedError; + @JsonKey(name: "per_page") int get perPage => throw _privateConstructorUsedError; + @JsonKey(name: "to") dynamic get to => throw _privateConstructorUsedError; + @JsonKey(name: "total") int get total => throw _privateConstructorUsedError; @@ -274,8 +268,8 @@ mixin _$Meta { /// @nodoc abstract class $MetaCopyWith<$Res> { - factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = - _$MetaCopyWithImpl<$Res, Meta>; + factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = _$MetaCopyWithImpl<$Res, Meta>; + @useResult $Res call( {@JsonKey(name: "current_page") int currentPage, @@ -289,12 +283,12 @@ abstract class $MetaCopyWith<$Res> { } /// @nodoc -class _$MetaCopyWithImpl<$Res, $Val extends Meta> - implements $MetaCopyWith<$Res> { +class _$MetaCopyWithImpl<$Res, $Val extends Meta> implements $MetaCopyWith<$Res> { _$MetaCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -351,9 +345,8 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> /// @nodoc abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { - factory _$$MetaImplCopyWith( - _$MetaImpl value, $Res Function(_$MetaImpl) then) = - __$$MetaImplCopyWithImpl<$Res>; + factory _$$MetaImplCopyWith(_$MetaImpl value, $Res Function(_$MetaImpl) then) = __$$MetaImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -368,11 +361,8 @@ abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { } /// @nodoc -class __$$MetaImplCopyWithImpl<$Res> - extends _$MetaCopyWithImpl<$Res, _$MetaImpl> - implements _$$MetaImplCopyWith<$Res> { - __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) - : super(_value, _then); +class __$$MetaImplCopyWithImpl<$Res> extends _$MetaCopyWithImpl<$Res, _$MetaImpl> implements _$$MetaImplCopyWith<$Res> { + __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) : super(_value, _then); /// Create a copy of Meta /// with the given fields replaced by the non-null parameter values. @@ -439,8 +429,7 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "total") required this.total}) : _links = links; - factory _$MetaImpl.fromJson(Map json) => - _$$MetaImplFromJson(json); + factory _$MetaImpl.fromJson(Map json) => _$$MetaImplFromJson(json); @override @JsonKey(name: "current_page") @@ -452,6 +441,7 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "last_page") final int lastPage; final List _links; + @override @JsonKey(name: "links") List get links { @@ -483,11 +473,9 @@ class _$MetaImpl implements _Meta { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MetaImpl && - (identical(other.currentPage, currentPage) || - other.currentPage == currentPage) && + (identical(other.currentPage, currentPage) || other.currentPage == currentPage) && const DeepCollectionEquality().equals(other.from, from) && - (identical(other.lastPage, lastPage) || - other.lastPage == lastPage) && + (identical(other.lastPage, lastPage) || other.lastPage == lastPage) && const DeepCollectionEquality().equals(other._links, _links) && (identical(other.path, path) || other.path == path) && (identical(other.perPage, perPage) || other.perPage == perPage) && @@ -497,24 +485,15 @@ class _$MetaImpl implements _Meta { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - currentPage, - const DeepCollectionEquality().hash(from), - lastPage, - const DeepCollectionEquality().hash(_links), - path, - perPage, - const DeepCollectionEquality().hash(to), - total); + int get hashCode => Object.hash(runtimeType, currentPage, const DeepCollectionEquality().hash(from), lastPage, const DeepCollectionEquality().hash(_links), + path, perPage, const DeepCollectionEquality().hash(to), total); /// Create a copy of Meta /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => - __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); @override Map toJson() { @@ -540,24 +519,31 @@ abstract class _Meta implements Meta { @override @JsonKey(name: "current_page") int get currentPage; + @override @JsonKey(name: "from") dynamic get from; + @override @JsonKey(name: "last_page") int get lastPage; + @override @JsonKey(name: "links") List get links; + @override @JsonKey(name: "path") String? get path; + @override @JsonKey(name: "per_page") int get perPage; + @override @JsonKey(name: "to") dynamic get to; + @override @JsonKey(name: "total") int get total; @@ -566,8 +552,7 @@ abstract class _Meta implements Meta { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => - throw _privateConstructorUsedError; + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => throw _privateConstructorUsedError; } Link _$LinkFromJson(Map json) { @@ -578,8 +563,10 @@ Link _$LinkFromJson(Map json) { mixin _$Link { @JsonKey(name: "url") String? get url => throw _privateConstructorUsedError; + @JsonKey(name: "label") String? get label => throw _privateConstructorUsedError; + @JsonKey(name: "active") bool? get active => throw _privateConstructorUsedError; @@ -594,22 +581,19 @@ mixin _$Link { /// @nodoc abstract class $LinkCopyWith<$Res> { - factory $LinkCopyWith(Link value, $Res Function(Link) then) = - _$LinkCopyWithImpl<$Res, Link>; + factory $LinkCopyWith(Link value, $Res Function(Link) then) = _$LinkCopyWithImpl<$Res, Link>; + @useResult - $Res call( - {@JsonKey(name: "url") String? url, - @JsonKey(name: "label") String? label, - @JsonKey(name: "active") bool? active}); + $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String? label, @JsonKey(name: "active") bool? active}); } /// @nodoc -class _$LinkCopyWithImpl<$Res, $Val extends Link> - implements $LinkCopyWith<$Res> { +class _$LinkCopyWithImpl<$Res, $Val extends Link> implements $LinkCopyWith<$Res> { _$LinkCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -641,23 +625,16 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link> /// @nodoc abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> { - factory _$$LinkImplCopyWith( - _$LinkImpl value, $Res Function(_$LinkImpl) then) = - __$$LinkImplCopyWithImpl<$Res>; + factory _$$LinkImplCopyWith(_$LinkImpl value, $Res Function(_$LinkImpl) then) = __$$LinkImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "url") String? url, - @JsonKey(name: "label") String? label, - @JsonKey(name: "active") bool? active}); + $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String? label, @JsonKey(name: "active") bool? active}); } /// @nodoc -class __$$LinkImplCopyWithImpl<$Res> - extends _$LinkCopyWithImpl<$Res, _$LinkImpl> - implements _$$LinkImplCopyWith<$Res> { - __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) - : super(_value, _then); +class __$$LinkImplCopyWithImpl<$Res> extends _$LinkCopyWithImpl<$Res, _$LinkImpl> implements _$$LinkImplCopyWith<$Res> { + __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) : super(_value, _then); /// Create a copy of Link /// with the given fields replaced by the non-null parameter values. @@ -688,13 +665,9 @@ class __$$LinkImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$LinkImpl implements _Link { - const _$LinkImpl( - {@JsonKey(name: "url") this.url, - @JsonKey(name: "label") this.label, - @JsonKey(name: "active") this.active}); + const _$LinkImpl({@JsonKey(name: "url") this.url, @JsonKey(name: "label") this.label, @JsonKey(name: "active") this.active}); - factory _$LinkImpl.fromJson(Map json) => - _$$LinkImplFromJson(json); + factory _$LinkImpl.fromJson(Map json) => _$$LinkImplFromJson(json); @override @JsonKey(name: "url") @@ -730,8 +703,7 @@ class _$LinkImpl implements _Link { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => - __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); @override Map toJson() { @@ -742,19 +714,19 @@ class _$LinkImpl implements _Link { } abstract class _Link implements Link { - const factory _Link( - {@JsonKey(name: "url") final String? url, - @JsonKey(name: "label") final String? label, - @JsonKey(name: "active") final bool? active}) = _$LinkImpl; + const factory _Link({@JsonKey(name: "url") final String? url, @JsonKey(name: "label") final String? label, @JsonKey(name: "active") final bool? active}) = + _$LinkImpl; factory _Link.fromJson(Map json) = _$LinkImpl.fromJson; @override @JsonKey(name: "url") String? get url; + @override @JsonKey(name: "label") String? get label; + @override @JsonKey(name: "active") bool? get active; @@ -763,6 +735,5 @@ abstract class _Link implements Link { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/models/pagination_model.g.dart b/lib/core/models/pagination_model.g.dart index 610d19b2..d0baeab8 100644 --- a/lib/core/models/pagination_model.g.dart +++ b/lib/core/models/pagination_model.g.dart @@ -13,8 +13,7 @@ _$LinksImpl _$$LinksImplFromJson(Map json) => _$LinksImpl( next: json['next'], ); -Map _$$LinksImplToJson(_$LinksImpl instance) => - { +Map _$$LinksImplToJson(_$LinksImpl instance) => { 'first': instance.first, 'last': instance.last, 'prev': instance.prev, @@ -25,17 +24,14 @@ _$MetaImpl _$$MetaImplFromJson(Map json) => _$MetaImpl( currentPage: (json['current_page'] as num).toInt(), from: json['from'], lastPage: (json['last_page'] as num).toInt(), - links: (json['links'] as List) - .map((e) => Link.fromJson(e as Map)) - .toList(), + links: (json['links'] as List).map((e) => Link.fromJson(e as Map)).toList(), path: json['path'] as String?, perPage: (json['per_page'] as num).toInt(), to: json['to'], total: (json['total'] as num).toInt(), ); -Map _$$MetaImplToJson(_$MetaImpl instance) => - { +Map _$$MetaImplToJson(_$MetaImpl instance) => { 'current_page': instance.currentPage, 'from': instance.from, 'last_page': instance.lastPage, @@ -52,8 +48,7 @@ _$LinkImpl _$$LinkImplFromJson(Map json) => _$LinkImpl( active: json['active'] as bool?, ); -Map _$$LinkImplToJson(_$LinkImpl instance) => - { +Map _$$LinkImplToJson(_$LinkImpl instance) => { 'url': instance.url, 'label': instance.label, 'active': instance.active, diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart index 97ab368c..46367fd1 100644 --- a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart +++ b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart @@ -17,33 +17,35 @@ final _privateConstructorUsedError = UnsupportedError( /// @nodoc mixin _$SelectionPopupModel { int? get id => throw _privateConstructorUsedError; + String get title => throw _privateConstructorUsedError; + dynamic get value => throw _privateConstructorUsedError; + bool get isSelected => throw _privateConstructorUsedError; /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $SelectionPopupModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $SelectionPopupModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $SelectionPopupModelCopyWith<$Res> { - factory $SelectionPopupModelCopyWith( - SelectionPopupModel value, $Res Function(SelectionPopupModel) then) = + factory $SelectionPopupModelCopyWith(SelectionPopupModel value, $Res Function(SelectionPopupModel) then) = _$SelectionPopupModelCopyWithImpl<$Res, SelectionPopupModel>; + @useResult $Res call({int? id, String title, dynamic value, bool isSelected}); } /// @nodoc -class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> - implements $SelectionPopupModelCopyWith<$Res> { +class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> implements $SelectionPopupModelCopyWith<$Res> { _$SelectionPopupModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -79,23 +81,19 @@ class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> } /// @nodoc -abstract class _$$SelectionPopupModelImplCopyWith<$Res> - implements $SelectionPopupModelCopyWith<$Res> { - factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value, - $Res Function(_$SelectionPopupModelImpl) then) = +abstract class _$$SelectionPopupModelImplCopyWith<$Res> implements $SelectionPopupModelCopyWith<$Res> { + factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value, $Res Function(_$SelectionPopupModelImpl) then) = __$$SelectionPopupModelImplCopyWithImpl<$Res>; + @override @useResult $Res call({int? id, String title, dynamic value, bool isSelected}); } /// @nodoc -class __$$SelectionPopupModelImplCopyWithImpl<$Res> - extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl> +class __$$SelectionPopupModelImplCopyWithImpl<$Res> extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl> implements _$$SelectionPopupModelImplCopyWith<$Res> { - __$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value, - $Res Function(_$SelectionPopupModelImpl) _then) - : super(_value, _then); + __$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value, $Res Function(_$SelectionPopupModelImpl) _then) : super(_value, _then); /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @@ -131,8 +129,7 @@ class __$$SelectionPopupModelImplCopyWithImpl<$Res> /// @nodoc class _$SelectionPopupModelImpl implements _SelectionPopupModel { - const _$SelectionPopupModelImpl( - {this.id, required this.title, this.value, this.isSelected = false}); + const _$SelectionPopupModelImpl({this.id, required this.title, this.value, this.isSelected = false}); @override final int? id; @@ -157,13 +154,11 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && const DeepCollectionEquality().equals(other.value, value) && - (identical(other.isSelected, isSelected) || - other.isSelected == isSelected)); + (identical(other.isSelected, isSelected) || other.isSelected == isSelected)); } @override - int get hashCode => Object.hash(runtimeType, id, title, - const DeepCollectionEquality().hash(value), isSelected); + int get hashCode => Object.hash(runtimeType, id, title, const DeepCollectionEquality().hash(value), isSelected); /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @@ -171,23 +166,21 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { @override @pragma('vm:prefer-inline') _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => - __$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>( - this, _$identity); + __$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>(this, _$identity); } abstract class _SelectionPopupModel implements SelectionPopupModel { - const factory _SelectionPopupModel( - {final int? id, - required final String title, - final dynamic value, - final bool isSelected}) = _$SelectionPopupModelImpl; + const factory _SelectionPopupModel({final int? id, required final String title, final dynamic value, final bool isSelected}) = _$SelectionPopupModelImpl; @override int? get id; + @override String get title; + @override dynamic get value; + @override bool get isSelected; @@ -195,6 +188,5 @@ abstract class _SelectionPopupModel implements SelectionPopupModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart index 7c5d7ffd..433a7e15 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$NewMessagesState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ mixin _$NewMessagesState { /// @nodoc abstract class $NewMessagesStateCopyWith<$Res> { - factory $NewMessagesStateCopyWith( - NewMessagesState value, $Res Function(NewMessagesState) then) = - _$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>; + factory $NewMessagesStateCopyWith(NewMessagesState value, $Res Function(NewMessagesState) then) = _$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>; } /// @nodoc -class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> - implements $NewMessagesStateCopyWith<$Res> { +class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> implements $NewMessagesStateCopyWith<$Res> { _$NewMessagesStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +90,14 @@ class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> /// @nodoc abstract class _$$NewMessagesStateImplCopyWith<$Res> { - factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value, - $Res Function(_$NewMessagesStateImpl) then) = + factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value, $Res Function(_$NewMessagesStateImpl) then) = __$$NewMessagesStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NewMessagesStateImplCopyWithImpl<$Res> - extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl> +class __$$NewMessagesStateImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl> implements _$$NewMessagesStateImplCopyWith<$Res> { - __$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value, - $Res Function(_$NewMessagesStateImpl) _then) - : super(_value, _then); + __$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value, $Res Function(_$NewMessagesStateImpl) _then) : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -120,8 +115,7 @@ class _$NewMessagesStateImpl implements _NewMessagesState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$NewMessagesStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateImpl); } @override @@ -208,19 +202,14 @@ abstract class _NewMessagesState implements NewMessagesState { /// @nodoc abstract class _$$NewMessagesStateEmptyImplCopyWith<$Res> { - factory _$$NewMessagesStateEmptyImplCopyWith( - _$NewMessagesStateEmptyImpl value, - $Res Function(_$NewMessagesStateEmptyImpl) then) = + factory _$$NewMessagesStateEmptyImplCopyWith(_$NewMessagesStateEmptyImpl value, $Res Function(_$NewMessagesStateEmptyImpl) then) = __$$NewMessagesStateEmptyImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res> - extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl> +class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl> implements _$$NewMessagesStateEmptyImplCopyWith<$Res> { - __$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value, - $Res Function(_$NewMessagesStateEmptyImpl) _then) - : super(_value, _then); + __$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value, $Res Function(_$NewMessagesStateEmptyImpl) _then) : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -238,9 +227,7 @@ class _$NewMessagesStateEmptyImpl implements NewMessagesStateEmpty { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$NewMessagesStateEmptyImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateEmptyImpl); } @override @@ -327,22 +314,17 @@ abstract class NewMessagesStateEmpty implements NewMessagesState { /// @nodoc abstract class _$$NewMessagesStateLoadedImplCopyWith<$Res> { - factory _$$NewMessagesStateLoadedImplCopyWith( - _$NewMessagesStateLoadedImpl value, - $Res Function(_$NewMessagesStateLoadedImpl) then) = + factory _$$NewMessagesStateLoadedImplCopyWith(_$NewMessagesStateLoadedImpl value, $Res Function(_$NewMessagesStateLoadedImpl) then) = __$$NewMessagesStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({int messagesCount}); } /// @nodoc -class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res> - extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl> +class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl> implements _$$NewMessagesStateLoadedImplCopyWith<$Res> { - __$$NewMessagesStateLoadedImplCopyWithImpl( - _$NewMessagesStateLoadedImpl _value, - $Res Function(_$NewMessagesStateLoadedImpl) _then) - : super(_value, _then); + __$$NewMessagesStateLoadedImplCopyWithImpl(_$NewMessagesStateLoadedImpl _value, $Res Function(_$NewMessagesStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -378,8 +360,7 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateLoadedImpl && - (identical(other.messagesCount, messagesCount) || - other.messagesCount == messagesCount)); + (identical(other.messagesCount, messagesCount) || other.messagesCount == messagesCount)); } @override @@ -390,9 +371,8 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> - get copyWith => __$$NewMessagesStateLoadedImplCopyWithImpl< - _$NewMessagesStateLoadedImpl>(this, _$identity); + _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => + __$$NewMessagesStateLoadedImplCopyWithImpl<_$NewMessagesStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -470,35 +450,29 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { } abstract class NewMessagesStateLoaded implements NewMessagesState { - const factory NewMessagesStateLoaded({required final int messagesCount}) = - _$NewMessagesStateLoadedImpl; + const factory NewMessagesStateLoaded({required final int messagesCount}) = _$NewMessagesStateLoadedImpl; int get messagesCount; /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> - get copyWith => throw _privateConstructorUsedError; + _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$NewMessagesStateErrorImplCopyWith<$Res> { - factory _$$NewMessagesStateErrorImplCopyWith( - _$NewMessagesStateErrorImpl value, - $Res Function(_$NewMessagesStateErrorImpl) then) = + factory _$$NewMessagesStateErrorImplCopyWith(_$NewMessagesStateErrorImpl value, $Res Function(_$NewMessagesStateErrorImpl) then) = __$$NewMessagesStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$NewMessagesStateErrorImplCopyWithImpl<$Res> - extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl> +class __$$NewMessagesStateErrorImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl> implements _$$NewMessagesStateErrorImplCopyWith<$Res> { - __$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value, - $Res Function(_$NewMessagesStateErrorImpl) _then) - : super(_value, _then); + __$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value, $Res Function(_$NewMessagesStateErrorImpl) _then) : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -534,8 +508,7 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -546,9 +519,8 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> - get copyWith => __$$NewMessagesStateErrorImplCopyWithImpl< - _$NewMessagesStateErrorImpl>(this, _$identity); + _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => + __$$NewMessagesStateErrorImplCopyWithImpl<_$NewMessagesStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -626,14 +598,12 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { } abstract class NewMessagesStateError implements NewMessagesState { - const factory NewMessagesStateError({required final String errorMessage}) = - _$NewMessagesStateErrorImpl; + const factory NewMessagesStateError({required final String errorMessage}) = _$NewMessagesStateErrorImpl; String get errorMessage; /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart index d634b318..6fa44e3d 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart @@ -20,18 +20,16 @@ mixin _$NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function( - List notifications, int notificationsCount) - loaded, + required TResult Function(List notifications, int notificationsCount) loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? - loaded, + TResult? Function(List notifications, int notificationsCount)? loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -39,8 +37,7 @@ mixin _$NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? - loaded, + TResult Function(List notifications, int notificationsCount)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -74,18 +71,17 @@ mixin _$NotificationsState { /// @nodoc abstract class $NotificationsStateCopyWith<$Res> { - factory $NotificationsStateCopyWith( - NotificationsState value, $Res Function(NotificationsState) then) = + factory $NotificationsStateCopyWith(NotificationsState value, $Res Function(NotificationsState) then) = _$NotificationsStateCopyWithImpl<$Res, NotificationsState>; } /// @nodoc -class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> - implements $NotificationsStateCopyWith<$Res> { +class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> implements $NotificationsStateCopyWith<$Res> { _$NotificationsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -95,18 +91,14 @@ class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> /// @nodoc abstract class _$$NotificationsStateImplCopyWith<$Res> { - factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value, - $Res Function(_$NotificationsStateImpl) then) = + factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value, $Res Function(_$NotificationsStateImpl) then) = __$$NotificationsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NotificationsStateImplCopyWithImpl<$Res> - extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl> +class __$$NotificationsStateImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl> implements _$$NotificationsStateImplCopyWith<$Res> { - __$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value, - $Res Function(_$NotificationsStateImpl) _then) - : super(_value, _then); + __$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value, $Res Function(_$NotificationsStateImpl) _then) : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -124,8 +116,7 @@ class _$NotificationsStateImpl implements _NotificationsState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$NotificationsStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateImpl); } @override @@ -136,9 +127,7 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function( - List notifications, int notificationsCount) - loaded, + required TResult Function(List notifications, int notificationsCount) loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -149,8 +138,7 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? - loaded, + TResult? Function(List notifications, int notificationsCount)? loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -161,8 +149,7 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? - loaded, + TResult Function(List notifications, int notificationsCount)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -216,21 +203,14 @@ abstract class _NotificationsState implements NotificationsState { /// @nodoc abstract class _$$NotificationsStateEmptyImplCopyWith<$Res> { - factory _$$NotificationsStateEmptyImplCopyWith( - _$NotificationsStateEmptyImpl value, - $Res Function(_$NotificationsStateEmptyImpl) then) = + factory _$$NotificationsStateEmptyImplCopyWith(_$NotificationsStateEmptyImpl value, $Res Function(_$NotificationsStateEmptyImpl) then) = __$$NotificationsStateEmptyImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NotificationsStateEmptyImplCopyWithImpl<$Res> - extends _$NotificationsStateCopyWithImpl<$Res, - _$NotificationsStateEmptyImpl> +class __$$NotificationsStateEmptyImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateEmptyImpl> implements _$$NotificationsStateEmptyImplCopyWith<$Res> { - __$$NotificationsStateEmptyImplCopyWithImpl( - _$NotificationsStateEmptyImpl _value, - $Res Function(_$NotificationsStateEmptyImpl) _then) - : super(_value, _then); + __$$NotificationsStateEmptyImplCopyWithImpl(_$NotificationsStateEmptyImpl _value, $Res Function(_$NotificationsStateEmptyImpl) _then) : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -248,9 +228,7 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$NotificationsStateEmptyImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateEmptyImpl); } @override @@ -261,9 +239,7 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function( - List notifications, int notificationsCount) - loaded, + required TResult Function(List notifications, int notificationsCount) loaded, required TResult Function(String errorMessage) error, }) { return empty(); @@ -274,8 +250,7 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? - loaded, + TResult? Function(List notifications, int notificationsCount)? loaded, TResult? Function(String errorMessage)? error, }) { return empty?.call(); @@ -286,8 +261,7 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? - loaded, + TResult Function(List notifications, int notificationsCount)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -341,22 +315,17 @@ abstract class NotificationsStateEmpty implements NotificationsState { /// @nodoc abstract class _$$NotificationsStateLoadedImplCopyWith<$Res> { - factory _$$NotificationsStateLoadedImplCopyWith( - _$NotificationsStateLoadedImpl value, - $Res Function(_$NotificationsStateLoadedImpl) then) = + factory _$$NotificationsStateLoadedImplCopyWith(_$NotificationsStateLoadedImpl value, $Res Function(_$NotificationsStateLoadedImpl) then) = __$$NotificationsStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({List notifications, int notificationsCount}); } /// @nodoc -class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> - extends _$NotificationsStateCopyWithImpl<$Res, - _$NotificationsStateLoadedImpl> +class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateLoadedImpl> implements _$$NotificationsStateLoadedImplCopyWith<$Res> { - __$$NotificationsStateLoadedImplCopyWithImpl( - _$NotificationsStateLoadedImpl _value, - $Res Function(_$NotificationsStateLoadedImpl) _then) + __$$NotificationsStateLoadedImplCopyWithImpl(_$NotificationsStateLoadedImpl _value, $Res Function(_$NotificationsStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of NotificationsState @@ -383,12 +352,10 @@ class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { - const _$NotificationsStateLoadedImpl( - {required final List notifications, - required this.notificationsCount}) - : _notifications = notifications; + const _$NotificationsStateLoadedImpl({required final List notifications, required this.notificationsCount}) : _notifications = notifications; final List _notifications; + @override List get notifications { if (_notifications is EqualUnmodifiableListView) return _notifications; @@ -409,33 +376,27 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateLoadedImpl && - const DeepCollectionEquality() - .equals(other._notifications, _notifications) && - (identical(other.notificationsCount, notificationsCount) || - other.notificationsCount == notificationsCount)); + const DeepCollectionEquality().equals(other._notifications, _notifications) && + (identical(other.notificationsCount, notificationsCount) || other.notificationsCount == notificationsCount)); } @override - int get hashCode => Object.hash(runtimeType, - const DeepCollectionEquality().hash(_notifications), notificationsCount); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_notifications), notificationsCount); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> - get copyWith => __$$NotificationsStateLoadedImplCopyWithImpl< - _$NotificationsStateLoadedImpl>(this, _$identity); + _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => + __$$NotificationsStateLoadedImplCopyWithImpl<_$NotificationsStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function( - List notifications, int notificationsCount) - loaded, + required TResult Function(List notifications, int notificationsCount) loaded, required TResult Function(String errorMessage) error, }) { return loaded(notifications, notificationsCount); @@ -446,8 +407,7 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? - loaded, + TResult? Function(List notifications, int notificationsCount)? loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(notifications, notificationsCount); @@ -458,8 +418,7 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? - loaded, + TResult Function(List notifications, int notificationsCount)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -508,39 +467,31 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { } abstract class NotificationsStateLoaded implements NotificationsState { - const factory NotificationsStateLoaded( - {required final List notifications, - required final int notificationsCount}) = _$NotificationsStateLoadedImpl; + const factory NotificationsStateLoaded({required final List notifications, required final int notificationsCount}) = _$NotificationsStateLoadedImpl; List get notifications; + int get notificationsCount; /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> - get copyWith => throw _privateConstructorUsedError; + _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$NotificationsStateErrorImplCopyWith<$Res> { - factory _$$NotificationsStateErrorImplCopyWith( - _$NotificationsStateErrorImpl value, - $Res Function(_$NotificationsStateErrorImpl) then) = + factory _$$NotificationsStateErrorImplCopyWith(_$NotificationsStateErrorImpl value, $Res Function(_$NotificationsStateErrorImpl) then) = __$$NotificationsStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$NotificationsStateErrorImplCopyWithImpl<$Res> - extends _$NotificationsStateCopyWithImpl<$Res, - _$NotificationsStateErrorImpl> +class __$$NotificationsStateErrorImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateErrorImpl> implements _$$NotificationsStateErrorImplCopyWith<$Res> { - __$$NotificationsStateErrorImplCopyWithImpl( - _$NotificationsStateErrorImpl _value, - $Res Function(_$NotificationsStateErrorImpl) _then) - : super(_value, _then); + __$$NotificationsStateErrorImplCopyWithImpl(_$NotificationsStateErrorImpl _value, $Res Function(_$NotificationsStateErrorImpl) _then) : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -576,8 +527,7 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -588,18 +538,15 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> - get copyWith => __$$NotificationsStateErrorImplCopyWithImpl< - _$NotificationsStateErrorImpl>(this, _$identity); + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => + __$$NotificationsStateErrorImplCopyWithImpl<_$NotificationsStateErrorImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function( - List notifications, int notificationsCount) - loaded, + required TResult Function(List notifications, int notificationsCount) loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -610,8 +557,7 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? - loaded, + TResult? Function(List notifications, int notificationsCount)? loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -622,8 +568,7 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? - loaded, + TResult Function(List notifications, int notificationsCount)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -672,14 +617,12 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { } abstract class NotificationsStateError implements NotificationsState { - const factory NotificationsStateError({required final String errorMessage}) = - _$NotificationsStateErrorImpl; + const factory NotificationsStateError({required final String errorMessage}) = _$NotificationsStateErrorImpl; String get errorMessage; /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart index f17bb065..ce8a8bca 100644 --- a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart +++ b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart @@ -74,9 +74,22 @@ class _BottomNavigationBarWidgetState extends State { items: [ BottomNavigationBarItem( label: '', - icon: SvgPicture.asset( - ImageConstant.imgLogo, - height: 32, + icon: BlocProvider( + create: (context) => sl()..getMyProfile(), + child: BlocBuilder( + builder: (BuildContext context, ProfileAvatarState state) { + if (state is ProfileAvatarStateLoaded) { + return CircleAvatar( + backgroundImage: NetworkImage(state.profile.profilePhotoUrl), + radius: 16, + ); + } + return CircleAvatar( + radius: 16, + backgroundColor: Colors.black12, + ); + }, + ), ), ), BottomNavigationBarItem( @@ -193,22 +206,9 @@ class _BottomNavigationBarWidgetState extends State { ), BottomNavigationBarItem( label: '', - icon: BlocProvider( - create: (context) => sl()..getMyProfile(), - child: BlocBuilder( - builder: (BuildContext context, ProfileAvatarState state) { - if (state is ProfileAvatarStateLoaded) { - return CircleAvatar( - backgroundImage: NetworkImage(state.profile.profilePhotoUrl), - radius: 16, - ); - } - return CircleAvatar( - radius: 16, - backgroundColor: Colors.black12, - ); - }, - ), + icon: SvgPicture.asset( + ImageConstant.imgLogo, + height: 32, ), ), ], diff --git a/lib/features/calendar/models/calendar_model.freezed.dart b/lib/features/calendar/models/calendar_model.freezed.dart index d10fc8f2..f7a1d191 100644 --- a/lib/features/calendar/models/calendar_model.freezed.dart +++ b/lib/features/calendar/models/calendar_model.freezed.dart @@ -21,8 +21,9 @@ CalendarModel _$CalendarModelFromJson(Map json) { /// @nodoc mixin _$CalendarModel { String get date => throw _privateConstructorUsedError; - bool get is_current_day_included_in_the_chosen_diet_progression => - throw _privateConstructorUsedError; + + bool get is_current_day_included_in_the_chosen_diet_progression => throw _privateConstructorUsedError; + Object? get diary => throw _privateConstructorUsedError; /// Serializes this CalendarModel to a JSON map. @@ -31,29 +32,24 @@ mixin _$CalendarModel { /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $CalendarModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $CalendarModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $CalendarModelCopyWith<$Res> { - factory $CalendarModelCopyWith( - CalendarModel value, $Res Function(CalendarModel) then) = - _$CalendarModelCopyWithImpl<$Res, CalendarModel>; + factory $CalendarModelCopyWith(CalendarModel value, $Res Function(CalendarModel) then) = _$CalendarModelCopyWithImpl<$Res, CalendarModel>; + @useResult - $Res call( - {String date, - bool is_current_day_included_in_the_chosen_diet_progression, - Object? diary}); + $Res call({String date, bool is_current_day_included_in_the_chosen_diet_progression, Object? diary}); } /// @nodoc -class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> - implements $CalendarModelCopyWith<$Res> { +class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> implements $CalendarModelCopyWith<$Res> { _$CalendarModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -71,8 +67,7 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> ? _value.date : date // ignore: cast_nullable_to_non_nullable as String, - is_current_day_included_in_the_chosen_diet_progression: null == - is_current_day_included_in_the_chosen_diet_progression + is_current_day_included_in_the_chosen_diet_progression: null == is_current_day_included_in_the_chosen_diet_progression ? _value.is_current_day_included_in_the_chosen_diet_progression : is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable as bool, @@ -82,26 +77,17 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> } /// @nodoc -abstract class _$$CalendarModelImplCopyWith<$Res> - implements $CalendarModelCopyWith<$Res> { - factory _$$CalendarModelImplCopyWith( - _$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) = - __$$CalendarModelImplCopyWithImpl<$Res>; +abstract class _$$CalendarModelImplCopyWith<$Res> implements $CalendarModelCopyWith<$Res> { + factory _$$CalendarModelImplCopyWith(_$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) = __$$CalendarModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {String date, - bool is_current_day_included_in_the_chosen_diet_progression, - Object? diary}); + $Res call({String date, bool is_current_day_included_in_the_chosen_diet_progression, Object? diary}); } /// @nodoc -class __$$CalendarModelImplCopyWithImpl<$Res> - extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl> - implements _$$CalendarModelImplCopyWith<$Res> { - __$$CalendarModelImplCopyWithImpl( - _$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then) - : super(_value, _then); +class __$$CalendarModelImplCopyWithImpl<$Res> extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl> implements _$$CalendarModelImplCopyWith<$Res> { + __$$CalendarModelImplCopyWithImpl(_$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then) : super(_value, _then); /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @@ -117,8 +103,7 @@ class __$$CalendarModelImplCopyWithImpl<$Res> ? _value.date : date // ignore: cast_nullable_to_non_nullable as String, - is_current_day_included_in_the_chosen_diet_progression: null == - is_current_day_included_in_the_chosen_diet_progression + is_current_day_included_in_the_chosen_diet_progression: null == is_current_day_included_in_the_chosen_diet_progression ? _value.is_current_day_included_in_the_chosen_diet_progression : is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable as bool, @@ -130,13 +115,9 @@ class __$$CalendarModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$CalendarModelImpl implements _CalendarModel { - const _$CalendarModelImpl( - {required this.date, - required this.is_current_day_included_in_the_chosen_diet_progression, - this.diary}); + const _$CalendarModelImpl({required this.date, required this.is_current_day_included_in_the_chosen_diet_progression, this.diary}); - factory _$CalendarModelImpl.fromJson(Map json) => - _$$CalendarModelImplFromJson(json); + factory _$CalendarModelImpl.fromJson(Map json) => _$$CalendarModelImplFromJson(json); @override final String date; @@ -156,30 +137,21 @@ class _$CalendarModelImpl implements _CalendarModel { (other.runtimeType == runtimeType && other is _$CalendarModelImpl && (identical(other.date, date) || other.date == date) && - (identical( - other - .is_current_day_included_in_the_chosen_diet_progression, - is_current_day_included_in_the_chosen_diet_progression) || - other.is_current_day_included_in_the_chosen_diet_progression == - is_current_day_included_in_the_chosen_diet_progression) && + (identical(other.is_current_day_included_in_the_chosen_diet_progression, is_current_day_included_in_the_chosen_diet_progression) || + other.is_current_day_included_in_the_chosen_diet_progression == is_current_day_included_in_the_chosen_diet_progression) && const DeepCollectionEquality().equals(other.diary, diary)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - date, - is_current_day_included_in_the_chosen_diet_progression, - const DeepCollectionEquality().hash(diary)); + int get hashCode => Object.hash(runtimeType, date, is_current_day_included_in_the_chosen_diet_progression, const DeepCollectionEquality().hash(diary)); /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => - __$$CalendarModelImplCopyWithImpl<_$CalendarModelImpl>(this, _$identity); + _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => __$$CalendarModelImplCopyWithImpl<_$CalendarModelImpl>(this, _$identity); @override Map toJson() { @@ -190,19 +162,17 @@ class _$CalendarModelImpl implements _CalendarModel { } abstract class _CalendarModel implements CalendarModel { - const factory _CalendarModel( - {required final String date, - required final bool - is_current_day_included_in_the_chosen_diet_progression, - final Object? diary}) = _$CalendarModelImpl; + const factory _CalendarModel({required final String date, required final bool is_current_day_included_in_the_chosen_diet_progression, final Object? diary}) = + _$CalendarModelImpl; - factory _CalendarModel.fromJson(Map json) = - _$CalendarModelImpl.fromJson; + factory _CalendarModel.fromJson(Map json) = _$CalendarModelImpl.fromJson; @override String get date; + @override bool get is_current_day_included_in_the_chosen_diet_progression; + @override Object? get diary; @@ -210,6 +180,5 @@ abstract class _CalendarModel implements CalendarModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/models/calendar_model.g.dart b/lib/features/calendar/models/calendar_model.g.dart index 65fd0063..4134c22e 100644 --- a/lib/features/calendar/models/calendar_model.g.dart +++ b/lib/features/calendar/models/calendar_model.g.dart @@ -6,19 +6,14 @@ part of 'calendar_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CalendarModelImpl _$$CalendarModelImplFromJson(Map json) => - _$CalendarModelImpl( +_$CalendarModelImpl _$$CalendarModelImplFromJson(Map json) => _$CalendarModelImpl( date: json['date'] as String, - is_current_day_included_in_the_chosen_diet_progression: - json['is_current_day_included_in_the_chosen_diet_progression'] - as bool, + is_current_day_included_in_the_chosen_diet_progression: json['is_current_day_included_in_the_chosen_diet_progression'] as bool, diary: json['diary'], ); -Map _$$CalendarModelImplToJson(_$CalendarModelImpl instance) => - { +Map _$$CalendarModelImplToJson(_$CalendarModelImpl instance) => { 'date': instance.date, - 'is_current_day_included_in_the_chosen_diet_progression': - instance.is_current_day_included_in_the_chosen_diet_progression, + 'is_current_day_included_in_the_chosen_diet_progression': instance.is_current_day_included_in_the_chosen_diet_progression, 'diary': instance.diary, }; diff --git a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart index 0e7bdbcd..76a12423 100644 --- a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart +++ b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$CalendarState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ mixin _$CalendarState { /// @nodoc abstract class $CalendarStateCopyWith<$Res> { - factory $CalendarStateCopyWith( - CalendarState value, $Res Function(CalendarState) then) = - _$CalendarStateCopyWithImpl<$Res, CalendarState>; + factory $CalendarStateCopyWith(CalendarState value, $Res Function(CalendarState) then) = _$CalendarStateCopyWithImpl<$Res, CalendarState>; } /// @nodoc -class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> - implements $CalendarStateCopyWith<$Res> { +class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> implements $CalendarStateCopyWith<$Res> { _$CalendarStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +90,12 @@ class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> /// @nodoc abstract class _$$CalendarStateImplCopyWith<$Res> { - factory _$$CalendarStateImplCopyWith( - _$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) = - __$$CalendarStateImplCopyWithImpl<$Res>; + factory _$$CalendarStateImplCopyWith(_$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) = __$$CalendarStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CalendarStateImplCopyWithImpl<$Res> - extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl> - implements _$$CalendarStateImplCopyWith<$Res> { - __$$CalendarStateImplCopyWithImpl( - _$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then) - : super(_value, _then); +class __$$CalendarStateImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl> implements _$$CalendarStateImplCopyWith<$Res> { + __$$CalendarStateImplCopyWithImpl(_$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then) : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -120,8 +113,7 @@ class _$CalendarStateImpl implements _CalendarState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$CalendarStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateImpl); } @override @@ -208,18 +200,14 @@ abstract class _CalendarState implements CalendarState { /// @nodoc abstract class _$$CalendarStateLoadingImplCopyWith<$Res> { - factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value, - $Res Function(_$CalendarStateLoadingImpl) then) = + factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value, $Res Function(_$CalendarStateLoadingImpl) then) = __$$CalendarStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CalendarStateLoadingImplCopyWithImpl<$Res> - extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl> +class __$$CalendarStateLoadingImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl> implements _$$CalendarStateLoadingImplCopyWith<$Res> { - __$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value, - $Res Function(_$CalendarStateLoadingImpl) _then) - : super(_value, _then); + __$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value, $Res Function(_$CalendarStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -237,9 +225,7 @@ class _$CalendarStateLoadingImpl implements CalendarStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CalendarStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateLoadingImpl); } @override @@ -326,20 +312,17 @@ abstract class CalendarStateLoading implements CalendarState { /// @nodoc abstract class _$$CalendarStateLoadedImplCopyWith<$Res> { - factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value, - $Res Function(_$CalendarStateLoadedImpl) then) = + factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value, $Res Function(_$CalendarStateLoadedImpl) then) = __$$CalendarStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({List calendarList}); } /// @nodoc -class __$$CalendarStateLoadedImplCopyWithImpl<$Res> - extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl> +class __$$CalendarStateLoadedImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl> implements _$$CalendarStateLoadedImplCopyWith<$Res> { - __$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value, - $Res Function(_$CalendarStateLoadedImpl) _then) - : super(_value, _then); + __$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value, $Res Function(_$CalendarStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -360,11 +343,10 @@ class __$$CalendarStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$CalendarStateLoadedImpl implements CalendarStateLoaded { - const _$CalendarStateLoadedImpl( - {required final List calendarList}) - : _calendarList = calendarList; + const _$CalendarStateLoadedImpl({required final List calendarList}) : _calendarList = calendarList; final List _calendarList; + @override List get calendarList { if (_calendarList is EqualUnmodifiableListView) return _calendarList; @@ -380,15 +362,11 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CalendarStateLoadedImpl && - const DeepCollectionEquality() - .equals(other._calendarList, _calendarList)); + (other.runtimeType == runtimeType && other is _$CalendarStateLoadedImpl && const DeepCollectionEquality().equals(other._calendarList, _calendarList)); } @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_calendarList)); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_calendarList)); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -396,8 +374,7 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { @override @pragma('vm:prefer-inline') _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => - __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>( - this, _$identity); + __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -475,35 +452,29 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { } abstract class CalendarStateLoaded implements CalendarState { - const factory CalendarStateLoaded( - {required final List calendarList}) = - _$CalendarStateLoadedImpl; + const factory CalendarStateLoaded({required final List calendarList}) = _$CalendarStateLoadedImpl; List get calendarList; /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$CalendarStateErrorImplCopyWith<$Res> { - factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value, - $Res Function(_$CalendarStateErrorImpl) then) = + factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value, $Res Function(_$CalendarStateErrorImpl) then) = __$$CalendarStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$CalendarStateErrorImplCopyWithImpl<$Res> - extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl> +class __$$CalendarStateErrorImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl> implements _$$CalendarStateErrorImplCopyWith<$Res> { - __$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value, - $Res Function(_$CalendarStateErrorImpl) _then) - : super(_value, _then); + __$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value, $Res Function(_$CalendarStateErrorImpl) _then) : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -539,8 +510,7 @@ class _$CalendarStateErrorImpl implements CalendarStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -552,8 +522,7 @@ class _$CalendarStateErrorImpl implements CalendarStateError { @override @pragma('vm:prefer-inline') _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => - __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>( - this, _$identity); + __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -631,14 +600,12 @@ class _$CalendarStateErrorImpl implements CalendarStateError { } abstract class CalendarStateError implements CalendarState { - const factory CalendarStateError({required final String errorMessage}) = - _$CalendarStateErrorImpl; + const factory CalendarStateError({required final String errorMessage}) = _$CalendarStateErrorImpl; String get errorMessage; /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/services/calendar_service.g.dart b/lib/features/calendar/services/calendar_service.g.dart index 903145dc..223e1a2e 100644 --- a/lib/features/calendar/services/calendar_service.g.dart +++ b/lib/features/calendar/services/calendar_service.g.dart @@ -46,9 +46,7 @@ class _CalendarService implements CalendarService { final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data! - .map((dynamic i) => CalendarModel.fromJson(i as Map)) - .toList(); + _value = _result.data!.map((dynamic i) => CalendarModel.fromJson(i as Map)).toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -57,9 +55,7 @@ class _CalendarService implements CalendarService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/chat/models/chat_message_model.freezed.dart b/lib/features/chat/models/chat_message_model.freezed.dart index 8f921425..558753ef 100644 --- a/lib/features/chat/models/chat_message_model.freezed.dart +++ b/lib/features/chat/models/chat_message_model.freezed.dart @@ -21,11 +21,15 @@ ChatMessageModel _$ChatMessageModelFromJson(Map json) { /// @nodoc mixin _$ChatMessageModel { int get id => throw _privateConstructorUsedError; + String get data => throw _privateConstructorUsedError; + @JsonKey(name: 'media_data') List? get mediaData => throw _privateConstructorUsedError; + @JsonKey(name: 'author_id') int get authorId => throw _privateConstructorUsedError; + @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; @@ -35,15 +39,13 @@ mixin _$ChatMessageModel { /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMessageModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatMessageModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMessageModelCopyWith<$Res> { - factory $ChatMessageModelCopyWith( - ChatMessageModel value, $Res Function(ChatMessageModel) then) = - _$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>; + factory $ChatMessageModelCopyWith(ChatMessageModel value, $Res Function(ChatMessageModel) then) = _$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>; + @useResult $Res call( {int id, @@ -54,12 +56,12 @@ abstract class $ChatMessageModelCopyWith<$Res> { } /// @nodoc -class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> - implements $ChatMessageModelCopyWith<$Res> { +class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> implements $ChatMessageModelCopyWith<$Res> { _$ChatMessageModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -100,11 +102,10 @@ class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> } /// @nodoc -abstract class _$$ChatMessageModelImplCopyWith<$Res> - implements $ChatMessageModelCopyWith<$Res> { - factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value, - $Res Function(_$ChatMessageModelImpl) then) = +abstract class _$$ChatMessageModelImplCopyWith<$Res> implements $ChatMessageModelCopyWith<$Res> { + factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value, $Res Function(_$ChatMessageModelImpl) then) = __$$ChatMessageModelImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -116,12 +117,9 @@ abstract class _$$ChatMessageModelImplCopyWith<$Res> } /// @nodoc -class __$$ChatMessageModelImplCopyWithImpl<$Res> - extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl> +class __$$ChatMessageModelImplCopyWithImpl<$Res> extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl> implements _$$ChatMessageModelImplCopyWith<$Res> { - __$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value, - $Res Function(_$ChatMessageModelImpl) _then) - : super(_value, _then); + __$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value, $Res Function(_$ChatMessageModelImpl) _then) : super(_value, _then); /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @@ -170,14 +168,14 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { @JsonKey(name: 'updated_at') required this.updatedAt}) : _mediaData = mediaData; - factory _$ChatMessageModelImpl.fromJson(Map json) => - _$$ChatMessageModelImplFromJson(json); + factory _$ChatMessageModelImpl.fromJson(Map json) => _$$ChatMessageModelImplFromJson(json); @override final int id; @override final String data; final List? _mediaData; + @override @JsonKey(name: 'media_data') List? get mediaData { @@ -207,27 +205,21 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { other is _$ChatMessageModelImpl && (identical(other.id, id) || other.id == id) && (identical(other.data, data) || other.data == data) && - const DeepCollectionEquality() - .equals(other._mediaData, _mediaData) && - (identical(other.authorId, authorId) || - other.authorId == authorId) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); + const DeepCollectionEquality().equals(other._mediaData, _mediaData) && + (identical(other.authorId, authorId) || other.authorId == authorId) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, data, - const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); + int get hashCode => Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => - __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>( - this, _$identity); + _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>(this, _$identity); @override Map toJson() { @@ -239,26 +231,28 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { abstract class _ChatMessageModel implements ChatMessageModel { const factory _ChatMessageModel( - {required final int id, - required final String data, - @JsonKey(name: 'media_data') required final List? mediaData, - @JsonKey(name: 'author_id') required final int authorId, - @JsonKey(name: 'updated_at') required final String updatedAt}) = - _$ChatMessageModelImpl; + {required final int id, + required final String data, + @JsonKey(name: 'media_data') required final List? mediaData, + @JsonKey(name: 'author_id') required final int authorId, + @JsonKey(name: 'updated_at') required final String updatedAt}) = _$ChatMessageModelImpl; - factory _ChatMessageModel.fromJson(Map json) = - _$ChatMessageModelImpl.fromJson; + factory _ChatMessageModel.fromJson(Map json) = _$ChatMessageModelImpl.fromJson; @override int get id; + @override String get data; + @override @JsonKey(name: 'media_data') List? get mediaData; + @override @JsonKey(name: 'author_id') int get authorId; + @override @JsonKey(name: 'updated_at') String get updatedAt; @@ -267,6 +261,5 @@ abstract class _ChatMessageModel implements ChatMessageModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_message_model.g.dart b/lib/features/chat/models/chat_message_model.g.dart index 3a8d1827..70531099 100644 --- a/lib/features/chat/models/chat_message_model.g.dart +++ b/lib/features/chat/models/chat_message_model.g.dart @@ -6,9 +6,7 @@ part of 'chat_message_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson( - Map json) => - _$ChatMessageModelImpl( +_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson(Map json) => _$ChatMessageModelImpl( id: (json['id'] as num).toInt(), data: json['data'] as String, mediaData: json['media_data'] as List?, @@ -16,9 +14,7 @@ _$ChatMessageModelImpl _$$ChatMessageModelImplFromJson( updatedAt: json['updated_at'] as String, ); -Map _$$ChatMessageModelImplToJson( - _$ChatMessageModelImpl instance) => - { +Map _$$ChatMessageModelImplToJson(_$ChatMessageModelImpl instance) => { 'id': instance.id, 'data': instance.data, 'media_data': instance.mediaData, diff --git a/lib/features/chat/models/chat_messages_model.freezed.dart b/lib/features/chat/models/chat_messages_model.freezed.dart index 852b33e4..d4dad1cb 100644 --- a/lib/features/chat/models/chat_messages_model.freezed.dart +++ b/lib/features/chat/models/chat_messages_model.freezed.dart @@ -22,6 +22,7 @@ ChatMessagesModel _$ChatMessagesModelFromJson(Map json) { mixin _$ChatMessagesModel { @JsonKey(name: 'data') List get messagesList => throw _privateConstructorUsedError; + ChatMetaModel get meta => throw _privateConstructorUsedError; /// Serializes this ChatMessagesModel to a JSON map. @@ -30,30 +31,26 @@ mixin _$ChatMessagesModel { /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMessagesModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatMessagesModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMessagesModelCopyWith<$Res> { - factory $ChatMessagesModelCopyWith( - ChatMessagesModel value, $Res Function(ChatMessagesModel) then) = - _$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>; + factory $ChatMessagesModelCopyWith(ChatMessagesModel value, $Res Function(ChatMessagesModel) then) = _$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>; + @useResult - $Res call( - {@JsonKey(name: 'data') List messagesList, - ChatMetaModel meta}); + $Res call({@JsonKey(name: 'data') List messagesList, ChatMetaModel meta}); $ChatMetaModelCopyWith<$Res> get meta; } /// @nodoc -class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> - implements $ChatMessagesModelCopyWith<$Res> { +class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> implements $ChatMessagesModelCopyWith<$Res> { _$ChatMessagesModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -89,28 +86,22 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> } /// @nodoc -abstract class _$$ChatMessagesModelImplCopyWith<$Res> - implements $ChatMessagesModelCopyWith<$Res> { - factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value, - $Res Function(_$ChatMessagesModelImpl) then) = +abstract class _$$ChatMessagesModelImplCopyWith<$Res> implements $ChatMessagesModelCopyWith<$Res> { + factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value, $Res Function(_$ChatMessagesModelImpl) then) = __$$ChatMessagesModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: 'data') List messagesList, - ChatMetaModel meta}); + $Res call({@JsonKey(name: 'data') List messagesList, ChatMetaModel meta}); @override $ChatMetaModelCopyWith<$Res> get meta; } /// @nodoc -class __$$ChatMessagesModelImplCopyWithImpl<$Res> - extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl> +class __$$ChatMessagesModelImplCopyWithImpl<$Res> extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl> implements _$$ChatMessagesModelImplCopyWith<$Res> { - __$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value, - $Res Function(_$ChatMessagesModelImpl) _then) - : super(_value, _then); + __$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value, $Res Function(_$ChatMessagesModelImpl) _then) : super(_value, _then); /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @@ -136,16 +127,12 @@ class __$$ChatMessagesModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$ChatMessagesModelImpl implements _ChatMessagesModel { - const _$ChatMessagesModelImpl( - {@JsonKey(name: 'data') - required final List messagesList, - required this.meta}) - : _messagesList = messagesList; + const _$ChatMessagesModelImpl({@JsonKey(name: 'data') required final List messagesList, required this.meta}) : _messagesList = messagesList; - factory _$ChatMessagesModelImpl.fromJson(Map json) => - _$$ChatMessagesModelImplFromJson(json); + factory _$ChatMessagesModelImpl.fromJson(Map json) => _$$ChatMessagesModelImplFromJson(json); final List _messagesList; + @override @JsonKey(name: 'data') List get messagesList { @@ -167,24 +154,20 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatMessagesModelImpl && - const DeepCollectionEquality() - .equals(other._messagesList, _messagesList) && + const DeepCollectionEquality().equals(other._messagesList, _messagesList) && (identical(other.meta, meta) || other.meta == meta)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => - __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>( - this, _$identity); + _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>(this, _$identity); @override Map toJson() { @@ -195,17 +178,15 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { } abstract class _ChatMessagesModel implements ChatMessagesModel { - const factory _ChatMessagesModel( - {@JsonKey(name: 'data') - required final List messagesList, - required final ChatMetaModel meta}) = _$ChatMessagesModelImpl; + const factory _ChatMessagesModel({@JsonKey(name: 'data') required final List messagesList, required final ChatMetaModel meta}) = + _$ChatMessagesModelImpl; - factory _ChatMessagesModel.fromJson(Map json) = - _$ChatMessagesModelImpl.fromJson; + factory _ChatMessagesModel.fromJson(Map json) = _$ChatMessagesModelImpl.fromJson; @override @JsonKey(name: 'data') List get messagesList; + @override ChatMetaModel get meta; @@ -213,6 +194,5 @@ abstract class _ChatMessagesModel implements ChatMessagesModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_messages_model.g.dart b/lib/features/chat/models/chat_messages_model.g.dart index 6216cd83..1a7fe48b 100644 --- a/lib/features/chat/models/chat_messages_model.g.dart +++ b/lib/features/chat/models/chat_messages_model.g.dart @@ -6,18 +6,12 @@ part of 'chat_messages_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson( - Map json) => - _$ChatMessagesModelImpl( - messagesList: (json['data'] as List) - .map((e) => ChatMessageModel.fromJson(e as Map)) - .toList(), +_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson(Map json) => _$ChatMessagesModelImpl( + messagesList: (json['data'] as List).map((e) => ChatMessageModel.fromJson(e as Map)).toList(), meta: ChatMetaModel.fromJson(json['meta'] as Map), ); -Map _$$ChatMessagesModelImplToJson( - _$ChatMessagesModelImpl instance) => - { +Map _$$ChatMessagesModelImplToJson(_$ChatMessagesModelImpl instance) => { 'data': instance.messagesList, 'meta': instance.meta, }; diff --git a/lib/features/chat/models/chat_meta_model.freezed.dart b/lib/features/chat/models/chat_meta_model.freezed.dart index e8e4e96b..b4354b59 100644 --- a/lib/features/chat/models/chat_meta_model.freezed.dart +++ b/lib/features/chat/models/chat_meta_model.freezed.dart @@ -29,26 +29,24 @@ mixin _$ChatMetaModel { /// Create a copy of ChatMetaModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMetaModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatMetaModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMetaModelCopyWith<$Res> { - factory $ChatMetaModelCopyWith( - ChatMetaModel value, $Res Function(ChatMetaModel) then) = - _$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>; + factory $ChatMetaModelCopyWith(ChatMetaModel value, $Res Function(ChatMetaModel) then) = _$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>; + @useResult $Res call({@JsonKey(name: "last_page") int lastPage}); } /// @nodoc -class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> - implements $ChatMetaModelCopyWith<$Res> { +class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> implements $ChatMetaModelCopyWith<$Res> { _$ChatMetaModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -69,23 +67,17 @@ class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> } /// @nodoc -abstract class _$$ChatMetaModelImplCopyWith<$Res> - implements $ChatMetaModelCopyWith<$Res> { - factory _$$ChatMetaModelImplCopyWith( - _$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) = - __$$ChatMetaModelImplCopyWithImpl<$Res>; +abstract class _$$ChatMetaModelImplCopyWith<$Res> implements $ChatMetaModelCopyWith<$Res> { + factory _$$ChatMetaModelImplCopyWith(_$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) = __$$ChatMetaModelImplCopyWithImpl<$Res>; + @override @useResult $Res call({@JsonKey(name: "last_page") int lastPage}); } /// @nodoc -class __$$ChatMetaModelImplCopyWithImpl<$Res> - extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl> - implements _$$ChatMetaModelImplCopyWith<$Res> { - __$$ChatMetaModelImplCopyWithImpl( - _$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then) - : super(_value, _then); +class __$$ChatMetaModelImplCopyWithImpl<$Res> extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl> implements _$$ChatMetaModelImplCopyWith<$Res> { + __$$ChatMetaModelImplCopyWithImpl(_$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then) : super(_value, _then); /// Create a copy of ChatMetaModel /// with the given fields replaced by the non-null parameter values. @@ -106,11 +98,9 @@ class __$$ChatMetaModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$ChatMetaModelImpl implements _ChatMetaModel { - const _$ChatMetaModelImpl( - {@JsonKey(name: "last_page") required this.lastPage}); + const _$ChatMetaModelImpl({@JsonKey(name: "last_page") required this.lastPage}); - factory _$ChatMetaModelImpl.fromJson(Map json) => - _$$ChatMetaModelImplFromJson(json); + factory _$ChatMetaModelImpl.fromJson(Map json) => _$$ChatMetaModelImplFromJson(json); @override @JsonKey(name: "last_page") @@ -124,10 +114,7 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChatMetaModelImpl && - (identical(other.lastPage, lastPage) || - other.lastPage == lastPage)); + (other.runtimeType == runtimeType && other is _$ChatMetaModelImpl && (identical(other.lastPage, lastPage) || other.lastPage == lastPage)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -139,8 +126,7 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => - __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); + _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); @override Map toJson() { @@ -151,12 +137,9 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { } abstract class _ChatMetaModel implements ChatMetaModel { - const factory _ChatMetaModel( - {@JsonKey(name: "last_page") required final int lastPage}) = - _$ChatMetaModelImpl; + const factory _ChatMetaModel({@JsonKey(name: "last_page") required final int lastPage}) = _$ChatMetaModelImpl; - factory _ChatMetaModel.fromJson(Map json) = - _$ChatMetaModelImpl.fromJson; + factory _ChatMetaModel.fromJson(Map json) = _$ChatMetaModelImpl.fromJson; @override @JsonKey(name: "last_page") @@ -166,6 +149,5 @@ abstract class _ChatMetaModel implements ChatMetaModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_meta_model.g.dart b/lib/features/chat/models/chat_meta_model.g.dart index 7126e2dd..bbd16d10 100644 --- a/lib/features/chat/models/chat_meta_model.g.dart +++ b/lib/features/chat/models/chat_meta_model.g.dart @@ -6,12 +6,10 @@ part of 'chat_meta_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map json) => - _$ChatMetaModelImpl( +_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map json) => _$ChatMetaModelImpl( lastPage: (json['last_page'] as num).toInt(), ); -Map _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) => - { +Map _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) => { 'last_page': instance.lastPage, }; diff --git a/lib/features/chat/models/chat_room_model.freezed.dart b/lib/features/chat/models/chat_room_model.freezed.dart index 6afb3a94..cef12fbe 100644 --- a/lib/features/chat/models/chat_room_model.freezed.dart +++ b/lib/features/chat/models/chat_room_model.freezed.dart @@ -21,9 +21,10 @@ ChatRoomModel _$ChatRoomModelFromJson(Map json) { /// @nodoc mixin _$ChatRoomModel { String get id => throw _privateConstructorUsedError; + @JsonKey(name: 'chat_room_setting') - ChatRoomSettingsModel get chatRoomSettings => - throw _privateConstructorUsedError; + ChatRoomSettingsModel get chatRoomSettings => throw _privateConstructorUsedError; + Map get users => throw _privateConstructorUsedError; /// Serializes this ChatRoomModel to a JSON map. @@ -32,32 +33,26 @@ mixin _$ChatRoomModel { /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatRoomModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomModelCopyWith<$Res> { - factory $ChatRoomModelCopyWith( - ChatRoomModel value, $Res Function(ChatRoomModel) then) = - _$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>; + factory $ChatRoomModelCopyWith(ChatRoomModel value, $Res Function(ChatRoomModel) then) = _$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>; + @useResult - $Res call( - {String id, - @JsonKey(name: 'chat_room_setting') - ChatRoomSettingsModel chatRoomSettings, - Map users}); + $Res call({String id, @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings, Map users}); $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings; } /// @nodoc -class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> - implements $ChatRoomModelCopyWith<$Res> { +class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> implements $ChatRoomModelCopyWith<$Res> { _$ChatRoomModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,38 +86,27 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> @override @pragma('vm:prefer-inline') $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings { - return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings, - (value) { + return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings, (value) { return _then(_value.copyWith(chatRoomSettings: value) as $Val); }); } } /// @nodoc -abstract class _$$ChatRoomModelImplCopyWith<$Res> - implements $ChatRoomModelCopyWith<$Res> { - factory _$$ChatRoomModelImplCopyWith( - _$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) = - __$$ChatRoomModelImplCopyWithImpl<$Res>; +abstract class _$$ChatRoomModelImplCopyWith<$Res> implements $ChatRoomModelCopyWith<$Res> { + factory _$$ChatRoomModelImplCopyWith(_$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) = __$$ChatRoomModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {String id, - @JsonKey(name: 'chat_room_setting') - ChatRoomSettingsModel chatRoomSettings, - Map users}); + $Res call({String id, @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings, Map users}); @override $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings; } /// @nodoc -class __$$ChatRoomModelImplCopyWithImpl<$Res> - extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl> - implements _$$ChatRoomModelImplCopyWith<$Res> { - __$$ChatRoomModelImplCopyWithImpl( - _$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then) - : super(_value, _then); +class __$$ChatRoomModelImplCopyWithImpl<$Res> extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl> implements _$$ChatRoomModelImplCopyWith<$Res> { + __$$ChatRoomModelImplCopyWithImpl(_$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @@ -154,13 +138,10 @@ class __$$ChatRoomModelImplCopyWithImpl<$Res> @JsonSerializable() class _$ChatRoomModelImpl implements _ChatRoomModel { const _$ChatRoomModelImpl( - {required this.id, - @JsonKey(name: 'chat_room_setting') required this.chatRoomSettings, - required final Map users}) + {required this.id, @JsonKey(name: 'chat_room_setting') required this.chatRoomSettings, required final Map users}) : _users = users; - factory _$ChatRoomModelImpl.fromJson(Map json) => - _$$ChatRoomModelImplFromJson(json); + factory _$ChatRoomModelImpl.fromJson(Map json) => _$$ChatRoomModelImplFromJson(json); @override final String id; @@ -168,6 +149,7 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { @JsonKey(name: 'chat_room_setting') final ChatRoomSettingsModel chatRoomSettings; final Map _users; + @override Map get users { if (_users is EqualUnmodifiableMapView) return _users; @@ -186,23 +168,20 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { (other.runtimeType == runtimeType && other is _$ChatRoomModelImpl && (identical(other.id, id) || other.id == id) && - (identical(other.chatRoomSettings, chatRoomSettings) || - other.chatRoomSettings == chatRoomSettings) && + (identical(other.chatRoomSettings, chatRoomSettings) || other.chatRoomSettings == chatRoomSettings) && const DeepCollectionEquality().equals(other._users, _users)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, - const DeepCollectionEquality().hash(_users)); + int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, const DeepCollectionEquality().hash(_users)); /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => - __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); + _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); @override Map toJson() { @@ -215,18 +194,18 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { abstract class _ChatRoomModel implements ChatRoomModel { const factory _ChatRoomModel( {required final String id, - @JsonKey(name: 'chat_room_setting') - required final ChatRoomSettingsModel chatRoomSettings, + @JsonKey(name: 'chat_room_setting') required final ChatRoomSettingsModel chatRoomSettings, required final Map users}) = _$ChatRoomModelImpl; - factory _ChatRoomModel.fromJson(Map json) = - _$ChatRoomModelImpl.fromJson; + factory _ChatRoomModel.fromJson(Map json) = _$ChatRoomModelImpl.fromJson; @override String get id; + @override @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel get chatRoomSettings; + @override Map get users; @@ -234,6 +213,5 @@ abstract class _ChatRoomModel implements ChatRoomModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_model.g.dart b/lib/features/chat/models/chat_room_model.g.dart index 68d3195c..6230d4f4 100644 --- a/lib/features/chat/models/chat_room_model.g.dart +++ b/lib/features/chat/models/chat_room_model.g.dart @@ -6,19 +6,15 @@ part of 'chat_room_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map json) => - _$ChatRoomModelImpl( +_$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map json) => _$ChatRoomModelImpl( id: json['id'] as String, - chatRoomSettings: ChatRoomSettingsModel.fromJson( - json['chat_room_setting'] as Map), + chatRoomSettings: ChatRoomSettingsModel.fromJson(json['chat_room_setting'] as Map), users: (json['users'] as Map).map( - (k, e) => - MapEntry(k, ChatUserModel.fromJson(e as Map)), + (k, e) => MapEntry(k, ChatUserModel.fromJson(e as Map)), ), ); -Map _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) => - { +Map _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) => { 'id': instance.id, 'chat_room_setting': instance.chatRoomSettings, 'users': instance.users, diff --git a/lib/features/chat/models/chat_room_preview_model.freezed.dart b/lib/features/chat/models/chat_room_preview_model.freezed.dart index 4b006cf0..468bfb92 100644 --- a/lib/features/chat/models/chat_room_preview_model.freezed.dart +++ b/lib/features/chat/models/chat_room_preview_model.freezed.dart @@ -29,27 +29,25 @@ mixin _$ChatRoomPreviewModel { /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomPreviewModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatRoomPreviewModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomPreviewModelCopyWith<$Res> { - factory $ChatRoomPreviewModelCopyWith(ChatRoomPreviewModel value, - $Res Function(ChatRoomPreviewModel) then) = + factory $ChatRoomPreviewModelCopyWith(ChatRoomPreviewModel value, $Res Function(ChatRoomPreviewModel) then) = _$ChatRoomPreviewModelCopyWithImpl<$Res, ChatRoomPreviewModel>; + @useResult $Res call({@JsonKey(name: "chatRooms") List chatRooms}); } /// @nodoc -class _$ChatRoomPreviewModelCopyWithImpl<$Res, - $Val extends ChatRoomPreviewModel> - implements $ChatRoomPreviewModelCopyWith<$Res> { +class _$ChatRoomPreviewModelCopyWithImpl<$Res, $Val extends ChatRoomPreviewModel> implements $ChatRoomPreviewModelCopyWith<$Res> { _$ChatRoomPreviewModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -70,23 +68,19 @@ class _$ChatRoomPreviewModelCopyWithImpl<$Res, } /// @nodoc -abstract class _$$ChatRoomPreviewModelImplCopyWith<$Res> - implements $ChatRoomPreviewModelCopyWith<$Res> { - factory _$$ChatRoomPreviewModelImplCopyWith(_$ChatRoomPreviewModelImpl value, - $Res Function(_$ChatRoomPreviewModelImpl) then) = +abstract class _$$ChatRoomPreviewModelImplCopyWith<$Res> implements $ChatRoomPreviewModelCopyWith<$Res> { + factory _$$ChatRoomPreviewModelImplCopyWith(_$ChatRoomPreviewModelImpl value, $Res Function(_$ChatRoomPreviewModelImpl) then) = __$$ChatRoomPreviewModelImplCopyWithImpl<$Res>; + @override @useResult $Res call({@JsonKey(name: "chatRooms") List chatRooms}); } /// @nodoc -class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> - extends _$ChatRoomPreviewModelCopyWithImpl<$Res, _$ChatRoomPreviewModelImpl> +class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> extends _$ChatRoomPreviewModelCopyWithImpl<$Res, _$ChatRoomPreviewModelImpl> implements _$$ChatRoomPreviewModelImplCopyWith<$Res> { - __$$ChatRoomPreviewModelImplCopyWithImpl(_$ChatRoomPreviewModelImpl _value, - $Res Function(_$ChatRoomPreviewModelImpl) _then) - : super(_value, _then); + __$$ChatRoomPreviewModelImplCopyWithImpl(_$ChatRoomPreviewModelImpl _value, $Res Function(_$ChatRoomPreviewModelImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @@ -107,14 +101,12 @@ class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { - const _$ChatRoomPreviewModelImpl( - {@JsonKey(name: "chatRooms") required final List chatRooms}) - : _chatRooms = chatRooms; + const _$ChatRoomPreviewModelImpl({@JsonKey(name: "chatRooms") required final List chatRooms}) : _chatRooms = chatRooms; - factory _$ChatRoomPreviewModelImpl.fromJson(Map json) => - _$$ChatRoomPreviewModelImplFromJson(json); + factory _$ChatRoomPreviewModelImpl.fromJson(Map json) => _$$ChatRoomPreviewModelImplFromJson(json); final List _chatRooms; + @override @JsonKey(name: "chatRooms") List get chatRooms { @@ -131,26 +123,20 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChatRoomPreviewModelImpl && - const DeepCollectionEquality() - .equals(other._chatRooms, _chatRooms)); + (other.runtimeType == runtimeType && other is _$ChatRoomPreviewModelImpl && const DeepCollectionEquality().equals(other._chatRooms, _chatRooms)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> - get copyWith => - __$$ChatRoomPreviewModelImplCopyWithImpl<_$ChatRoomPreviewModelImpl>( - this, _$identity); + _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => + __$$ChatRoomPreviewModelImplCopyWithImpl<_$ChatRoomPreviewModelImpl>(this, _$identity); @override Map toJson() { @@ -161,12 +147,9 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { } abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel { - const factory _ChatRoomPreviewModel( - {@JsonKey(name: "chatRooms") - required final List chatRooms}) = _$ChatRoomPreviewModelImpl; + const factory _ChatRoomPreviewModel({@JsonKey(name: "chatRooms") required final List chatRooms}) = _$ChatRoomPreviewModelImpl; - factory _ChatRoomPreviewModel.fromJson(Map json) = - _$ChatRoomPreviewModelImpl.fromJson; + factory _ChatRoomPreviewModel.fromJson(Map json) = _$ChatRoomPreviewModelImpl.fromJson; @override @JsonKey(name: "chatRooms") @@ -176,8 +159,7 @@ abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => throw _privateConstructorUsedError; } ChatRoom _$ChatRoomFromJson(Map json) { @@ -188,10 +170,13 @@ ChatRoom _$ChatRoomFromJson(Map json) { mixin _$ChatRoom { @JsonKey(name: "id") String get id => throw _privateConstructorUsedError; + @JsonKey(name: "room_name") String get roomName => throw _privateConstructorUsedError; + @JsonKey(name: "last_message") dynamic get lastMessage => throw _privateConstructorUsedError; + @JsonKey(name: "users") Users get users => throw _privateConstructorUsedError; @@ -201,14 +186,13 @@ mixin _$ChatRoom { /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatRoomCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomCopyWith<$Res> { - factory $ChatRoomCopyWith(ChatRoom value, $Res Function(ChatRoom) then) = - _$ChatRoomCopyWithImpl<$Res, ChatRoom>; + factory $ChatRoomCopyWith(ChatRoom value, $Res Function(ChatRoom) then) = _$ChatRoomCopyWithImpl<$Res, ChatRoom>; + @useResult $Res call( {@JsonKey(name: "id") String id, @@ -220,12 +204,12 @@ abstract class $ChatRoomCopyWith<$Res> { } /// @nodoc -class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> - implements $ChatRoomCopyWith<$Res> { +class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> implements $ChatRoomCopyWith<$Res> { _$ChatRoomCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -271,11 +255,9 @@ class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> } /// @nodoc -abstract class _$$ChatRoomImplCopyWith<$Res> - implements $ChatRoomCopyWith<$Res> { - factory _$$ChatRoomImplCopyWith( - _$ChatRoomImpl value, $Res Function(_$ChatRoomImpl) then) = - __$$ChatRoomImplCopyWithImpl<$Res>; +abstract class _$$ChatRoomImplCopyWith<$Res> implements $ChatRoomCopyWith<$Res> { + factory _$$ChatRoomImplCopyWith(_$ChatRoomImpl value, $Res Function(_$ChatRoomImpl) then) = __$$ChatRoomImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -289,12 +271,8 @@ abstract class _$$ChatRoomImplCopyWith<$Res> } /// @nodoc -class __$$ChatRoomImplCopyWithImpl<$Res> - extends _$ChatRoomCopyWithImpl<$Res, _$ChatRoomImpl> - implements _$$ChatRoomImplCopyWith<$Res> { - __$$ChatRoomImplCopyWithImpl( - _$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then) - : super(_value, _then); +class __$$ChatRoomImplCopyWithImpl<$Res> extends _$ChatRoomCopyWithImpl<$Res, _$ChatRoomImpl> implements _$$ChatRoomImplCopyWith<$Res> { + __$$ChatRoomImplCopyWithImpl(_$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then) : super(_value, _then); /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @@ -336,8 +314,7 @@ class _$ChatRoomImpl implements _ChatRoom { @JsonKey(name: "last_message") required this.lastMessage, @JsonKey(name: "users") required this.users}); - factory _$ChatRoomImpl.fromJson(Map json) => - _$$ChatRoomImplFromJson(json); + factory _$ChatRoomImpl.fromJson(Map json) => _$$ChatRoomImplFromJson(json); @override @JsonKey(name: "id") @@ -363,25 +340,21 @@ class _$ChatRoomImpl implements _ChatRoom { (other.runtimeType == runtimeType && other is _$ChatRoomImpl && (identical(other.id, id) || other.id == id) && - (identical(other.roomName, roomName) || - other.roomName == roomName) && - const DeepCollectionEquality() - .equals(other.lastMessage, lastMessage) && + (identical(other.roomName, roomName) || other.roomName == roomName) && + const DeepCollectionEquality().equals(other.lastMessage, lastMessage) && (identical(other.users, users) || other.users == users)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, roomName, - const DeepCollectionEquality().hash(lastMessage), users); + int get hashCode => Object.hash(runtimeType, id, roomName, const DeepCollectionEquality().hash(lastMessage), users); /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => - __$$ChatRoomImplCopyWithImpl<_$ChatRoomImpl>(this, _$identity); + _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => __$$ChatRoomImplCopyWithImpl<_$ChatRoomImpl>(this, _$identity); @override Map toJson() { @@ -398,18 +371,20 @@ abstract class _ChatRoom implements ChatRoom { @JsonKey(name: "last_message") required final dynamic lastMessage, @JsonKey(name: "users") required final Users users}) = _$ChatRoomImpl; - factory _ChatRoom.fromJson(Map json) = - _$ChatRoomImpl.fromJson; + factory _ChatRoom.fromJson(Map json) = _$ChatRoomImpl.fromJson; @override @JsonKey(name: "id") String get id; + @override @JsonKey(name: "room_name") String get roomName; + @override @JsonKey(name: "last_message") dynamic get lastMessage; + @override @JsonKey(name: "users") Users get users; @@ -418,8 +393,7 @@ abstract class _ChatRoom implements ChatRoom { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => throw _privateConstructorUsedError; } LastMessageClass _$LastMessageClassFromJson(Map json) { @@ -430,16 +404,22 @@ LastMessageClass _$LastMessageClassFromJson(Map json) { mixin _$LastMessageClass { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "data") String get data => throw _privateConstructorUsedError; + @JsonKey(name: "media_data") List get mediaData => throw _privateConstructorUsedError; + @JsonKey(name: "author_id") int get authorId => throw _privateConstructorUsedError; + @JsonKey(name: "is_author_message_auth_user") bool get isAuthorMessageAuthUser => throw _privateConstructorUsedError; + @JsonKey(name: "read_by_to_user") bool get readByToUser => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; @@ -449,34 +429,31 @@ mixin _$LastMessageClass { /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $LastMessageClassCopyWith get copyWith => - throw _privateConstructorUsedError; + $LastMessageClassCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $LastMessageClassCopyWith<$Res> { - factory $LastMessageClassCopyWith( - LastMessageClass value, $Res Function(LastMessageClass) then) = - _$LastMessageClassCopyWithImpl<$Res, LastMessageClass>; + factory $LastMessageClassCopyWith(LastMessageClass value, $Res Function(LastMessageClass) then) = _$LastMessageClassCopyWithImpl<$Res, LastMessageClass>; + @useResult $Res call( {@JsonKey(name: "id") int id, @JsonKey(name: "data") String data, @JsonKey(name: "media_data") List mediaData, @JsonKey(name: "author_id") int authorId, - @JsonKey(name: "is_author_message_auth_user") - bool isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") bool isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") bool readByToUser, @JsonKey(name: "updated_at") DateTime updatedAt}); } /// @nodoc -class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> - implements $LastMessageClassCopyWith<$Res> { +class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> implements $LastMessageClassCopyWith<$Res> { _$LastMessageClassCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -527,11 +504,10 @@ class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> } /// @nodoc -abstract class _$$LastMessageClassImplCopyWith<$Res> - implements $LastMessageClassCopyWith<$Res> { - factory _$$LastMessageClassImplCopyWith(_$LastMessageClassImpl value, - $Res Function(_$LastMessageClassImpl) then) = +abstract class _$$LastMessageClassImplCopyWith<$Res> implements $LastMessageClassCopyWith<$Res> { + factory _$$LastMessageClassImplCopyWith(_$LastMessageClassImpl value, $Res Function(_$LastMessageClassImpl) then) = __$$LastMessageClassImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -539,19 +515,15 @@ abstract class _$$LastMessageClassImplCopyWith<$Res> @JsonKey(name: "data") String data, @JsonKey(name: "media_data") List mediaData, @JsonKey(name: "author_id") int authorId, - @JsonKey(name: "is_author_message_auth_user") - bool isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") bool isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") bool readByToUser, @JsonKey(name: "updated_at") DateTime updatedAt}); } /// @nodoc -class __$$LastMessageClassImplCopyWithImpl<$Res> - extends _$LastMessageClassCopyWithImpl<$Res, _$LastMessageClassImpl> +class __$$LastMessageClassImplCopyWithImpl<$Res> extends _$LastMessageClassCopyWithImpl<$Res, _$LastMessageClassImpl> implements _$$LastMessageClassImplCopyWith<$Res> { - __$$LastMessageClassImplCopyWithImpl(_$LastMessageClassImpl _value, - $Res Function(_$LastMessageClassImpl) _then) - : super(_value, _then); + __$$LastMessageClassImplCopyWithImpl(_$LastMessageClassImpl _value, $Res Function(_$LastMessageClassImpl) _then) : super(_value, _then); /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @@ -607,14 +579,12 @@ class _$LastMessageClassImpl implements _LastMessageClass { @JsonKey(name: "data") required this.data, @JsonKey(name: "media_data") required final List mediaData, @JsonKey(name: "author_id") required this.authorId, - @JsonKey(name: "is_author_message_auth_user") - required this.isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") required this.isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") required this.readByToUser, @JsonKey(name: "updated_at") required this.updatedAt}) : _mediaData = mediaData; - factory _$LastMessageClassImpl.fromJson(Map json) => - _$$LastMessageClassImplFromJson(json); + factory _$LastMessageClassImpl.fromJson(Map json) => _$$LastMessageClassImplFromJson(json); @override @JsonKey(name: "id") @@ -623,6 +593,7 @@ class _$LastMessageClassImpl implements _LastMessageClass { @JsonKey(name: "data") final String data; final List _mediaData; + @override @JsonKey(name: "media_data") List get mediaData { @@ -656,39 +627,24 @@ class _$LastMessageClassImpl implements _LastMessageClass { other is _$LastMessageClassImpl && (identical(other.id, id) || other.id == id) && (identical(other.data, data) || other.data == data) && - const DeepCollectionEquality() - .equals(other._mediaData, _mediaData) && - (identical(other.authorId, authorId) || - other.authorId == authorId) && - (identical( - other.isAuthorMessageAuthUser, isAuthorMessageAuthUser) || - other.isAuthorMessageAuthUser == isAuthorMessageAuthUser) && - (identical(other.readByToUser, readByToUser) || - other.readByToUser == readByToUser) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); + const DeepCollectionEquality().equals(other._mediaData, _mediaData) && + (identical(other.authorId, authorId) || other.authorId == authorId) && + (identical(other.isAuthorMessageAuthUser, isAuthorMessageAuthUser) || other.isAuthorMessageAuthUser == isAuthorMessageAuthUser) && + (identical(other.readByToUser, readByToUser) || other.readByToUser == readByToUser) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - id, - data, - const DeepCollectionEquality().hash(_mediaData), - authorId, - isAuthorMessageAuthUser, - readByToUser, - updatedAt); + int get hashCode => + Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, isAuthorMessageAuthUser, readByToUser, updatedAt); /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => - __$$LastMessageClassImplCopyWithImpl<_$LastMessageClassImpl>( - this, _$identity); + _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => __$$LastMessageClassImplCopyWithImpl<_$LastMessageClassImpl>(this, _$identity); @override Map toJson() { @@ -700,37 +656,40 @@ class _$LastMessageClassImpl implements _LastMessageClass { abstract class _LastMessageClass implements LastMessageClass { const factory _LastMessageClass( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "data") required final String data, - @JsonKey(name: "media_data") required final List mediaData, - @JsonKey(name: "author_id") required final int authorId, - @JsonKey(name: "is_author_message_auth_user") - required final bool isAuthorMessageAuthUser, - @JsonKey(name: "read_by_to_user") required final bool readByToUser, - @JsonKey(name: "updated_at") required final DateTime updatedAt}) = - _$LastMessageClassImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "data") required final String data, + @JsonKey(name: "media_data") required final List mediaData, + @JsonKey(name: "author_id") required final int authorId, + @JsonKey(name: "is_author_message_auth_user") required final bool isAuthorMessageAuthUser, + @JsonKey(name: "read_by_to_user") required final bool readByToUser, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$LastMessageClassImpl; - factory _LastMessageClass.fromJson(Map json) = - _$LastMessageClassImpl.fromJson; + factory _LastMessageClass.fromJson(Map json) = _$LastMessageClassImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "data") String get data; + @override @JsonKey(name: "media_data") List get mediaData; + @override @JsonKey(name: "author_id") int get authorId; + @override @JsonKey(name: "is_author_message_auth_user") bool get isAuthorMessageAuthUser; + @override @JsonKey(name: "read_by_to_user") bool get readByToUser; + @override @JsonKey(name: "updated_at") DateTime get updatedAt; @@ -739,8 +698,7 @@ abstract class _LastMessageClass implements LastMessageClass { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => throw _privateConstructorUsedError; } Users _$UsersFromJson(Map json) { @@ -751,6 +709,7 @@ Users _$UsersFromJson(Map json) { mixin _$Users { @JsonKey(name: "from_chat_user") ChatUser get fromChatUser => throw _privateConstructorUsedError; + @JsonKey(name: "to_chat_user") ChatUser get toChatUser => throw _privateConstructorUsedError; @@ -765,24 +724,23 @@ mixin _$Users { /// @nodoc abstract class $UsersCopyWith<$Res> { - factory $UsersCopyWith(Users value, $Res Function(Users) then) = - _$UsersCopyWithImpl<$Res, Users>; + factory $UsersCopyWith(Users value, $Res Function(Users) then) = _$UsersCopyWithImpl<$Res, Users>; + @useResult - $Res call( - {@JsonKey(name: "from_chat_user") ChatUser fromChatUser, - @JsonKey(name: "to_chat_user") ChatUser toChatUser}); + $Res call({@JsonKey(name: "from_chat_user") ChatUser fromChatUser, @JsonKey(name: "to_chat_user") ChatUser toChatUser}); $ChatUserCopyWith<$Res> get fromChatUser; + $ChatUserCopyWith<$Res> get toChatUser; } /// @nodoc -class _$UsersCopyWithImpl<$Res, $Val extends Users> - implements $UsersCopyWith<$Res> { +class _$UsersCopyWithImpl<$Res, $Val extends Users> implements $UsersCopyWith<$Res> { _$UsersCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -829,28 +787,22 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users> /// @nodoc abstract class _$$UsersImplCopyWith<$Res> implements $UsersCopyWith<$Res> { - factory _$$UsersImplCopyWith( - _$UsersImpl value, $Res Function(_$UsersImpl) then) = - __$$UsersImplCopyWithImpl<$Res>; + factory _$$UsersImplCopyWith(_$UsersImpl value, $Res Function(_$UsersImpl) then) = __$$UsersImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "from_chat_user") ChatUser fromChatUser, - @JsonKey(name: "to_chat_user") ChatUser toChatUser}); + $Res call({@JsonKey(name: "from_chat_user") ChatUser fromChatUser, @JsonKey(name: "to_chat_user") ChatUser toChatUser}); @override $ChatUserCopyWith<$Res> get fromChatUser; + @override $ChatUserCopyWith<$Res> get toChatUser; } /// @nodoc -class __$$UsersImplCopyWithImpl<$Res> - extends _$UsersCopyWithImpl<$Res, _$UsersImpl> - implements _$$UsersImplCopyWith<$Res> { - __$$UsersImplCopyWithImpl( - _$UsersImpl _value, $Res Function(_$UsersImpl) _then) - : super(_value, _then); +class __$$UsersImplCopyWithImpl<$Res> extends _$UsersCopyWithImpl<$Res, _$UsersImpl> implements _$$UsersImplCopyWith<$Res> { + __$$UsersImplCopyWithImpl(_$UsersImpl _value, $Res Function(_$UsersImpl) _then) : super(_value, _then); /// Create a copy of Users /// with the given fields replaced by the non-null parameter values. @@ -876,12 +828,9 @@ class __$$UsersImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$UsersImpl implements _Users { - const _$UsersImpl( - {@JsonKey(name: "from_chat_user") required this.fromChatUser, - @JsonKey(name: "to_chat_user") required this.toChatUser}); + const _$UsersImpl({@JsonKey(name: "from_chat_user") required this.fromChatUser, @JsonKey(name: "to_chat_user") required this.toChatUser}); - factory _$UsersImpl.fromJson(Map json) => - _$$UsersImplFromJson(json); + factory _$UsersImpl.fromJson(Map json) => _$$UsersImplFromJson(json); @override @JsonKey(name: "from_chat_user") @@ -900,10 +849,8 @@ class _$UsersImpl implements _Users { return identical(this, other) || (other.runtimeType == runtimeType && other is _$UsersImpl && - (identical(other.fromChatUser, fromChatUser) || - other.fromChatUser == fromChatUser) && - (identical(other.toChatUser, toChatUser) || - other.toChatUser == toChatUser)); + (identical(other.fromChatUser, fromChatUser) || other.fromChatUser == fromChatUser) && + (identical(other.toChatUser, toChatUser) || other.toChatUser == toChatUser)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -915,8 +862,7 @@ class _$UsersImpl implements _Users { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UsersImplCopyWith<_$UsersImpl> get copyWith => - __$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity); + _$$UsersImplCopyWith<_$UsersImpl> get copyWith => __$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity); @override Map toJson() { @@ -928,15 +874,14 @@ class _$UsersImpl implements _Users { abstract class _Users implements Users { const factory _Users( - {@JsonKey(name: "from_chat_user") required final ChatUser fromChatUser, - @JsonKey(name: "to_chat_user") - required final ChatUser toChatUser}) = _$UsersImpl; + {@JsonKey(name: "from_chat_user") required final ChatUser fromChatUser, @JsonKey(name: "to_chat_user") required final ChatUser toChatUser}) = _$UsersImpl; factory _Users.fromJson(Map json) = _$UsersImpl.fromJson; @override @JsonKey(name: "from_chat_user") ChatUser get fromChatUser; + @override @JsonKey(name: "to_chat_user") ChatUser get toChatUser; @@ -945,8 +890,7 @@ abstract class _Users implements Users { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$UsersImplCopyWith<_$UsersImpl> get copyWith => - throw _privateConstructorUsedError; + _$$UsersImplCopyWith<_$UsersImpl> get copyWith => throw _privateConstructorUsedError; } ChatUser _$ChatUserFromJson(Map json) { @@ -957,10 +901,13 @@ ChatUser _$ChatUserFromJson(Map json) { mixin _$ChatUser { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; + @JsonKey(name: "profile_photo_path") String? get profilePhotoPath => throw _privateConstructorUsedError; + @JsonKey(name: "profile_photo_url") String get profilePhotoUrl => throw _privateConstructorUsedError; @@ -970,14 +917,13 @@ mixin _$ChatUser { /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatUserCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatUserCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatUserCopyWith<$Res> { - factory $ChatUserCopyWith(ChatUser value, $Res Function(ChatUser) then) = - _$ChatUserCopyWithImpl<$Res, ChatUser>; + factory $ChatUserCopyWith(ChatUser value, $Res Function(ChatUser) then) = _$ChatUserCopyWithImpl<$Res, ChatUser>; + @useResult $Res call( {@JsonKey(name: "id") int id, @@ -987,12 +933,12 @@ abstract class $ChatUserCopyWith<$Res> { } /// @nodoc -class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> - implements $ChatUserCopyWith<$Res> { +class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> implements $ChatUserCopyWith<$Res> { _$ChatUserCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -1028,11 +974,9 @@ class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> } /// @nodoc -abstract class _$$ChatUserImplCopyWith<$Res> - implements $ChatUserCopyWith<$Res> { - factory _$$ChatUserImplCopyWith( - _$ChatUserImpl value, $Res Function(_$ChatUserImpl) then) = - __$$ChatUserImplCopyWithImpl<$Res>; +abstract class _$$ChatUserImplCopyWith<$Res> implements $ChatUserCopyWith<$Res> { + factory _$$ChatUserImplCopyWith(_$ChatUserImpl value, $Res Function(_$ChatUserImpl) then) = __$$ChatUserImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -1043,12 +987,8 @@ abstract class _$$ChatUserImplCopyWith<$Res> } /// @nodoc -class __$$ChatUserImplCopyWithImpl<$Res> - extends _$ChatUserCopyWithImpl<$Res, _$ChatUserImpl> - implements _$$ChatUserImplCopyWith<$Res> { - __$$ChatUserImplCopyWithImpl( - _$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then) - : super(_value, _then); +class __$$ChatUserImplCopyWithImpl<$Res> extends _$ChatUserCopyWithImpl<$Res, _$ChatUserImpl> implements _$$ChatUserImplCopyWith<$Res> { + __$$ChatUserImplCopyWithImpl(_$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then) : super(_value, _then); /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @@ -1090,8 +1030,7 @@ class _$ChatUserImpl implements _ChatUser { @JsonKey(name: "profile_photo_path") required this.profilePhotoPath, @JsonKey(name: "profile_photo_url") required this.profilePhotoUrl}); - factory _$ChatUserImpl.fromJson(Map json) => - _$$ChatUserImplFromJson(json); + factory _$ChatUserImpl.fromJson(Map json) => _$$ChatUserImplFromJson(json); @override @JsonKey(name: "id") @@ -1118,24 +1057,20 @@ class _$ChatUserImpl implements _ChatUser { other is _$ChatUserImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.profilePhotoPath, profilePhotoPath) || - other.profilePhotoPath == profilePhotoPath) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || - other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoPath, profilePhotoPath) || other.profilePhotoPath == profilePhotoPath) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); + int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => - __$$ChatUserImplCopyWithImpl<_$ChatUserImpl>(this, _$identity); + _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => __$$ChatUserImplCopyWithImpl<_$ChatUserImpl>(this, _$identity); @override Map toJson() { @@ -1149,23 +1084,23 @@ abstract class _ChatUser implements ChatUser { const factory _ChatUser( {@JsonKey(name: "id") required final int id, @JsonKey(name: "name") required final String name, - @JsonKey(name: "profile_photo_path") - required final String? profilePhotoPath, - @JsonKey(name: "profile_photo_url") - required final String profilePhotoUrl}) = _$ChatUserImpl; + @JsonKey(name: "profile_photo_path") required final String? profilePhotoPath, + @JsonKey(name: "profile_photo_url") required final String profilePhotoUrl}) = _$ChatUserImpl; - factory _ChatUser.fromJson(Map json) = - _$ChatUserImpl.fromJson; + factory _ChatUser.fromJson(Map json) = _$ChatUserImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "name") String get name; + @override @JsonKey(name: "profile_photo_path") String? get profilePhotoPath; + @override @JsonKey(name: "profile_photo_url") String get profilePhotoUrl; @@ -1174,6 +1109,5 @@ abstract class _ChatUser implements ChatUser { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_preview_model.g.dart b/lib/features/chat/models/chat_room_preview_model.g.dart index 5ae3f709..ef589a94 100644 --- a/lib/features/chat/models/chat_room_preview_model.g.dart +++ b/lib/features/chat/models/chat_room_preview_model.g.dart @@ -6,39 +6,29 @@ part of 'chat_room_preview_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson( - Map json) => - _$ChatRoomPreviewModelImpl( - chatRooms: (json['chatRooms'] as List) - .map((e) => ChatRoom.fromJson(e as Map)) - .toList(), +_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson(Map json) => _$ChatRoomPreviewModelImpl( + chatRooms: (json['chatRooms'] as List).map((e) => ChatRoom.fromJson(e as Map)).toList(), ); -Map _$$ChatRoomPreviewModelImplToJson( - _$ChatRoomPreviewModelImpl instance) => - { +Map _$$ChatRoomPreviewModelImplToJson(_$ChatRoomPreviewModelImpl instance) => { 'chatRooms': instance.chatRooms, }; -_$ChatRoomImpl _$$ChatRoomImplFromJson(Map json) => - _$ChatRoomImpl( +_$ChatRoomImpl _$$ChatRoomImplFromJson(Map json) => _$ChatRoomImpl( id: json['id'] as String, roomName: json['room_name'] as String, lastMessage: json['last_message'], users: Users.fromJson(json['users'] as Map), ); -Map _$$ChatRoomImplToJson(_$ChatRoomImpl instance) => - { +Map _$$ChatRoomImplToJson(_$ChatRoomImpl instance) => { 'id': instance.id, 'room_name': instance.roomName, 'last_message': instance.lastMessage, 'users': instance.users, }; -_$LastMessageClassImpl _$$LastMessageClassImplFromJson( - Map json) => - _$LastMessageClassImpl( +_$LastMessageClassImpl _$$LastMessageClassImplFromJson(Map json) => _$LastMessageClassImpl( id: (json['id'] as num).toInt(), data: json['data'] as String, mediaData: json['media_data'] as List, @@ -48,9 +38,7 @@ _$LastMessageClassImpl _$$LastMessageClassImplFromJson( updatedAt: DateTime.parse(json['updated_at'] as String), ); -Map _$$LastMessageClassImplToJson( - _$LastMessageClassImpl instance) => - { +Map _$$LastMessageClassImplToJson(_$LastMessageClassImpl instance) => { 'id': instance.id, 'data': instance.data, 'media_data': instance.mediaData, @@ -61,28 +49,23 @@ Map _$$LastMessageClassImplToJson( }; _$UsersImpl _$$UsersImplFromJson(Map json) => _$UsersImpl( - fromChatUser: - ChatUser.fromJson(json['from_chat_user'] as Map), - toChatUser: - ChatUser.fromJson(json['to_chat_user'] as Map), + fromChatUser: ChatUser.fromJson(json['from_chat_user'] as Map), + toChatUser: ChatUser.fromJson(json['to_chat_user'] as Map), ); -Map _$$UsersImplToJson(_$UsersImpl instance) => - { +Map _$$UsersImplToJson(_$UsersImpl instance) => { 'from_chat_user': instance.fromChatUser, 'to_chat_user': instance.toChatUser, }; -_$ChatUserImpl _$$ChatUserImplFromJson(Map json) => - _$ChatUserImpl( +_$ChatUserImpl _$$ChatUserImplFromJson(Map json) => _$ChatUserImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, profilePhotoPath: json['profile_photo_path'] as String?, profilePhotoUrl: json['profile_photo_url'] as String, ); -Map _$$ChatUserImplToJson(_$ChatUserImpl instance) => - { +Map _$$ChatUserImplToJson(_$ChatUserImpl instance) => { 'id': instance.id, 'name': instance.name, 'profile_photo_path': instance.profilePhotoPath, diff --git a/lib/features/chat/models/chat_room_settings_model.freezed.dart b/lib/features/chat/models/chat_room_settings_model.freezed.dart index 9d12eefa..76419b76 100644 --- a/lib/features/chat/models/chat_room_settings_model.freezed.dart +++ b/lib/features/chat/models/chat_room_settings_model.freezed.dart @@ -14,19 +14,22 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson( - Map json) { +ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson(Map json) { return _ChatRoomSettingsModel.fromJson(json); } /// @nodoc mixin _$ChatRoomSettingsModel { int get id => throw _privateConstructorUsedError; + @JsonKey(name: 'room_name') String get roomName => throw _privateConstructorUsedError; + String get state => throw _privateConstructorUsedError; + @JsonKey(name: 'access_level') String get accessLevel => throw _privateConstructorUsedError; + @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; @@ -36,15 +39,14 @@ mixin _$ChatRoomSettingsModel { /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomSettingsModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatRoomSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomSettingsModelCopyWith<$Res> { - factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value, - $Res Function(ChatRoomSettingsModel) then) = + factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value, $Res Function(ChatRoomSettingsModel) then) = _$ChatRoomSettingsModelCopyWithImpl<$Res, ChatRoomSettingsModel>; + @useResult $Res call( {int id, @@ -55,13 +57,12 @@ abstract class $ChatRoomSettingsModelCopyWith<$Res> { } /// @nodoc -class _$ChatRoomSettingsModelCopyWithImpl<$Res, - $Val extends ChatRoomSettingsModel> - implements $ChatRoomSettingsModelCopyWith<$Res> { +class _$ChatRoomSettingsModelCopyWithImpl<$Res, $Val extends ChatRoomSettingsModel> implements $ChatRoomSettingsModelCopyWith<$Res> { _$ChatRoomSettingsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -102,12 +103,10 @@ class _$ChatRoomSettingsModelCopyWithImpl<$Res, } /// @nodoc -abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> - implements $ChatRoomSettingsModelCopyWith<$Res> { - factory _$$ChatRoomSettingsModelImplCopyWith( - _$ChatRoomSettingsModelImpl value, - $Res Function(_$ChatRoomSettingsModelImpl) then) = +abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> implements $ChatRoomSettingsModelCopyWith<$Res> { + factory _$$ChatRoomSettingsModelImplCopyWith(_$ChatRoomSettingsModelImpl value, $Res Function(_$ChatRoomSettingsModelImpl) then) = __$$ChatRoomSettingsModelImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -119,13 +118,9 @@ abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> } /// @nodoc -class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res> - extends _$ChatRoomSettingsModelCopyWithImpl<$Res, - _$ChatRoomSettingsModelImpl> +class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res> extends _$ChatRoomSettingsModelCopyWithImpl<$Res, _$ChatRoomSettingsModelImpl> implements _$$ChatRoomSettingsModelImplCopyWith<$Res> { - __$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value, - $Res Function(_$ChatRoomSettingsModelImpl) _then) - : super(_value, _then); + __$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value, $Res Function(_$ChatRoomSettingsModelImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @@ -173,8 +168,7 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { @JsonKey(name: 'access_level') required this.accessLevel, @JsonKey(name: 'updated_at') required this.updatedAt}); - factory _$ChatRoomSettingsModelImpl.fromJson(Map json) => - _$$ChatRoomSettingsModelImplFromJson(json); + factory _$ChatRoomSettingsModelImpl.fromJson(Map json) => _$$ChatRoomSettingsModelImplFromJson(json); @override final int id; @@ -201,28 +195,23 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { (other.runtimeType == runtimeType && other is _$ChatRoomSettingsModelImpl && (identical(other.id, id) || other.id == id) && - (identical(other.roomName, roomName) || - other.roomName == roomName) && + (identical(other.roomName, roomName) || other.roomName == roomName) && (identical(other.state, state) || other.state == state) && - (identical(other.accessLevel, accessLevel) || - other.accessLevel == accessLevel) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); + (identical(other.accessLevel, accessLevel) || other.accessLevel == accessLevel) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); + int get hashCode => Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> - get copyWith => __$$ChatRoomSettingsModelImplCopyWithImpl< - _$ChatRoomSettingsModelImpl>(this, _$identity); + _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => + __$$ChatRoomSettingsModelImplCopyWithImpl<_$ChatRoomSettingsModelImpl>(this, _$identity); @override Map toJson() { @@ -234,26 +223,28 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel { const factory _ChatRoomSettingsModel( - {required final int id, - @JsonKey(name: 'room_name') required final String roomName, - required final String state, - @JsonKey(name: 'access_level') required final String accessLevel, - @JsonKey(name: 'updated_at') required final String updatedAt}) = - _$ChatRoomSettingsModelImpl; + {required final int id, + @JsonKey(name: 'room_name') required final String roomName, + required final String state, + @JsonKey(name: 'access_level') required final String accessLevel, + @JsonKey(name: 'updated_at') required final String updatedAt}) = _$ChatRoomSettingsModelImpl; - factory _ChatRoomSettingsModel.fromJson(Map json) = - _$ChatRoomSettingsModelImpl.fromJson; + factory _ChatRoomSettingsModel.fromJson(Map json) = _$ChatRoomSettingsModelImpl.fromJson; @override int get id; + @override @JsonKey(name: 'room_name') String get roomName; + @override String get state; + @override @JsonKey(name: 'access_level') String get accessLevel; + @override @JsonKey(name: 'updated_at') String get updatedAt; @@ -262,6 +253,5 @@ abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_settings_model.g.dart b/lib/features/chat/models/chat_room_settings_model.g.dart index 7b824334..1a2ef327 100644 --- a/lib/features/chat/models/chat_room_settings_model.g.dart +++ b/lib/features/chat/models/chat_room_settings_model.g.dart @@ -6,9 +6,7 @@ part of 'chat_room_settings_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson( - Map json) => - _$ChatRoomSettingsModelImpl( +_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson(Map json) => _$ChatRoomSettingsModelImpl( id: (json['id'] as num).toInt(), roomName: json['room_name'] as String, state: json['state'] as String, @@ -16,9 +14,7 @@ _$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson( updatedAt: json['updated_at'] as String, ); -Map _$$ChatRoomSettingsModelImplToJson( - _$ChatRoomSettingsModelImpl instance) => - { +Map _$$ChatRoomSettingsModelImplToJson(_$ChatRoomSettingsModelImpl instance) => { 'id': instance.id, 'room_name': instance.roomName, 'state': instance.state, diff --git a/lib/features/chat/models/chat_user_model.freezed.dart b/lib/features/chat/models/chat_user_model.freezed.dart index 94718168..166e3870 100644 --- a/lib/features/chat/models/chat_user_model.freezed.dart +++ b/lib/features/chat/models/chat_user_model.freezed.dart @@ -21,9 +21,12 @@ ChatUserModel _$ChatUserModelFromJson(Map json) { /// @nodoc mixin _$ChatUserModel { int get id => throw _privateConstructorUsedError; + String get name => throw _privateConstructorUsedError; + @JsonKey(name: 'profile_photo_path') String? get profilePhotoPath => throw _privateConstructorUsedError; + @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl => throw _privateConstructorUsedError; @@ -33,30 +36,24 @@ mixin _$ChatUserModel { /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatUserModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChatUserModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatUserModelCopyWith<$Res> { - factory $ChatUserModelCopyWith( - ChatUserModel value, $Res Function(ChatUserModel) then) = - _$ChatUserModelCopyWithImpl<$Res, ChatUserModel>; + factory $ChatUserModelCopyWith(ChatUserModel value, $Res Function(ChatUserModel) then) = _$ChatUserModelCopyWithImpl<$Res, ChatUserModel>; + @useResult - $Res call( - {int id, - String name, - @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, - @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); + $Res call({int id, String name, @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); } /// @nodoc -class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> - implements $ChatUserModelCopyWith<$Res> { +class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> implements $ChatUserModelCopyWith<$Res> { _$ChatUserModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -92,27 +89,17 @@ class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> } /// @nodoc -abstract class _$$ChatUserModelImplCopyWith<$Res> - implements $ChatUserModelCopyWith<$Res> { - factory _$$ChatUserModelImplCopyWith( - _$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) = - __$$ChatUserModelImplCopyWithImpl<$Res>; +abstract class _$$ChatUserModelImplCopyWith<$Res> implements $ChatUserModelCopyWith<$Res> { + factory _$$ChatUserModelImplCopyWith(_$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) = __$$ChatUserModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {int id, - String name, - @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, - @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); + $Res call({int id, String name, @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); } /// @nodoc -class __$$ChatUserModelImplCopyWithImpl<$Res> - extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl> - implements _$$ChatUserModelImplCopyWith<$Res> { - __$$ChatUserModelImplCopyWithImpl( - _$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then) - : super(_value, _then); +class __$$ChatUserModelImplCopyWithImpl<$Res> extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl> implements _$$ChatUserModelImplCopyWith<$Res> { + __$$ChatUserModelImplCopyWithImpl(_$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then) : super(_value, _then); /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @@ -154,8 +141,7 @@ class _$ChatUserModelImpl implements _ChatUserModel { @JsonKey(name: 'profile_photo_path') this.profilePhotoPath, @JsonKey(name: 'profile_photo_url') this.profilePhotoUrl}); - factory _$ChatUserModelImpl.fromJson(Map json) => - _$$ChatUserModelImplFromJson(json); + factory _$ChatUserModelImpl.fromJson(Map json) => _$$ChatUserModelImplFromJson(json); @override final int id; @@ -180,24 +166,20 @@ class _$ChatUserModelImpl implements _ChatUserModel { other is _$ChatUserModelImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.profilePhotoPath, profilePhotoPath) || - other.profilePhotoPath == profilePhotoPath) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || - other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoPath, profilePhotoPath) || other.profilePhotoPath == profilePhotoPath) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); + int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => - __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); + _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); @override Map toJson() { @@ -209,22 +191,23 @@ class _$ChatUserModelImpl implements _ChatUserModel { abstract class _ChatUserModel implements ChatUserModel { const factory _ChatUserModel( - {required final int id, - required final String name, - @JsonKey(name: 'profile_photo_path') final String? profilePhotoPath, - @JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) = - _$ChatUserModelImpl; + {required final int id, + required final String name, + @JsonKey(name: 'profile_photo_path') final String? profilePhotoPath, + @JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) = _$ChatUserModelImpl; - factory _ChatUserModel.fromJson(Map json) = - _$ChatUserModelImpl.fromJson; + factory _ChatUserModel.fromJson(Map json) = _$ChatUserModelImpl.fromJson; @override int get id; + @override String get name; + @override @JsonKey(name: 'profile_photo_path') String? get profilePhotoPath; + @override @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl; @@ -233,6 +216,5 @@ abstract class _ChatUserModel implements ChatUserModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_user_model.g.dart b/lib/features/chat/models/chat_user_model.g.dart index 78e0f981..06fa92a0 100644 --- a/lib/features/chat/models/chat_user_model.g.dart +++ b/lib/features/chat/models/chat_user_model.g.dart @@ -6,16 +6,14 @@ part of 'chat_user_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatUserModelImpl _$$ChatUserModelImplFromJson(Map json) => - _$ChatUserModelImpl( +_$ChatUserModelImpl _$$ChatUserModelImplFromJson(Map json) => _$ChatUserModelImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, profilePhotoPath: json['profile_photo_path'] as String?, profilePhotoUrl: json['profile_photo_url'] as String?, ); -Map _$$ChatUserModelImplToJson(_$ChatUserModelImpl instance) => - { +Map _$$ChatUserModelImplToJson(_$ChatUserModelImpl instance) => { 'id': instance.id, 'name': instance.name, 'profile_photo_path': instance.profilePhotoPath, diff --git a/lib/features/chat/models/websocket_info_model.freezed.dart b/lib/features/chat/models/websocket_info_model.freezed.dart index 9cddabee..dd7a6bb0 100644 --- a/lib/features/chat/models/websocket_info_model.freezed.dart +++ b/lib/features/chat/models/websocket_info_model.freezed.dart @@ -21,9 +21,13 @@ WebsocketInfoModel _$WebsocketInfoModelFromJson(Map json) { /// @nodoc mixin _$WebsocketInfoModel { String get key => throw _privateConstructorUsedError; + String get host => throw _privateConstructorUsedError; + String get port => throw _privateConstructorUsedError; + String get cluster => throw _privateConstructorUsedError; + @JsonKey(name: 'user_id') int get userId => throw _privateConstructorUsedError; @@ -33,31 +37,25 @@ mixin _$WebsocketInfoModel { /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $WebsocketInfoModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $WebsocketInfoModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $WebsocketInfoModelCopyWith<$Res> { - factory $WebsocketInfoModelCopyWith( - WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) = + factory $WebsocketInfoModelCopyWith(WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) = _$WebsocketInfoModelCopyWithImpl<$Res, WebsocketInfoModel>; + @useResult - $Res call( - {String key, - String host, - String port, - String cluster, - @JsonKey(name: 'user_id') int userId}); + $Res call({String key, String host, String port, String cluster, @JsonKey(name: 'user_id') int userId}); } /// @nodoc -class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> - implements $WebsocketInfoModelCopyWith<$Res> { +class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> implements $WebsocketInfoModelCopyWith<$Res> { _$WebsocketInfoModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -98,28 +96,19 @@ class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> } /// @nodoc -abstract class _$$WebsocketInfoModelImplCopyWith<$Res> - implements $WebsocketInfoModelCopyWith<$Res> { - factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value, - $Res Function(_$WebsocketInfoModelImpl) then) = +abstract class _$$WebsocketInfoModelImplCopyWith<$Res> implements $WebsocketInfoModelCopyWith<$Res> { + factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value, $Res Function(_$WebsocketInfoModelImpl) then) = __$$WebsocketInfoModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {String key, - String host, - String port, - String cluster, - @JsonKey(name: 'user_id') int userId}); + $Res call({String key, String host, String port, String cluster, @JsonKey(name: 'user_id') int userId}); } /// @nodoc -class __$$WebsocketInfoModelImplCopyWithImpl<$Res> - extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl> +class __$$WebsocketInfoModelImplCopyWithImpl<$Res> extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl> implements _$$WebsocketInfoModelImplCopyWith<$Res> { - __$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value, - $Res Function(_$WebsocketInfoModelImpl) _then) - : super(_value, _then); + __$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value, $Res Function(_$WebsocketInfoModelImpl) _then) : super(_value, _then); /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @@ -161,14 +150,9 @@ class __$$WebsocketInfoModelImplCopyWithImpl<$Res> @JsonSerializable() class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { const _$WebsocketInfoModelImpl( - {required this.key, - required this.host, - required this.port, - required this.cluster, - @JsonKey(name: 'user_id') required this.userId}); + {required this.key, required this.host, required this.port, required this.cluster, @JsonKey(name: 'user_id') required this.userId}); - factory _$WebsocketInfoModelImpl.fromJson(Map json) => - _$$WebsocketInfoModelImplFromJson(json); + factory _$WebsocketInfoModelImpl.fromJson(Map json) => _$$WebsocketInfoModelImplFromJson(json); @override final String key; @@ -201,8 +185,7 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, key, host, port, cluster, userId); + int get hashCode => Object.hash(runtimeType, key, host, port, cluster, userId); /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @@ -210,8 +193,7 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @override @pragma('vm:prefer-inline') _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => - __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>( - this, _$identity); + __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>(this, _$identity); @override Map toJson() { @@ -223,24 +205,26 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { abstract class _WebsocketInfoModel implements WebsocketInfoModel { const factory _WebsocketInfoModel( - {required final String key, - required final String host, - required final String port, - required final String cluster, - @JsonKey(name: 'user_id') required final int userId}) = - _$WebsocketInfoModelImpl; + {required final String key, + required final String host, + required final String port, + required final String cluster, + @JsonKey(name: 'user_id') required final int userId}) = _$WebsocketInfoModelImpl; - factory _WebsocketInfoModel.fromJson(Map json) = - _$WebsocketInfoModelImpl.fromJson; + factory _WebsocketInfoModel.fromJson(Map json) = _$WebsocketInfoModelImpl.fromJson; @override String get key; + @override String get host; + @override String get port; + @override String get cluster; + @override @JsonKey(name: 'user_id') int get userId; @@ -249,6 +233,5 @@ abstract class _WebsocketInfoModel implements WebsocketInfoModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/websocket_info_model.g.dart b/lib/features/chat/models/websocket_info_model.g.dart index b2bb1248..91c386f8 100644 --- a/lib/features/chat/models/websocket_info_model.g.dart +++ b/lib/features/chat/models/websocket_info_model.g.dart @@ -6,9 +6,7 @@ part of 'websocket_info_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson( - Map json) => - _$WebsocketInfoModelImpl( +_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson(Map json) => _$WebsocketInfoModelImpl( key: json['key'] as String, host: json['host'] as String, port: json['port'] as String, @@ -16,9 +14,7 @@ _$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson( userId: (json['user_id'] as num).toInt(), ); -Map _$$WebsocketInfoModelImplToJson( - _$WebsocketInfoModelImpl instance) => - { +Map _$$WebsocketInfoModelImplToJson(_$WebsocketInfoModelImpl instance) => { 'key': instance.key, 'host': instance.host, 'port': instance.port, diff --git a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart index 4695b4ad..9a27a0ba 100644 --- a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart @@ -20,19 +20,16 @@ mixin _$ChatRoomState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading) - loaded, + required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -40,9 +37,7 @@ mixin _$ChatRoomState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -76,18 +71,16 @@ mixin _$ChatRoomState { /// @nodoc abstract class $ChatRoomStateCopyWith<$Res> { - factory $ChatRoomStateCopyWith( - ChatRoomState value, $Res Function(ChatRoomState) then) = - _$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>; + factory $ChatRoomStateCopyWith(ChatRoomState value, $Res Function(ChatRoomState) then) = _$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>; } /// @nodoc -class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> - implements $ChatRoomStateCopyWith<$Res> { +class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> implements $ChatRoomStateCopyWith<$Res> { _$ChatRoomStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -97,18 +90,12 @@ class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> /// @nodoc abstract class _$$ChatRoomStateImplCopyWith<$Res> { - factory _$$ChatRoomStateImplCopyWith( - _$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) = - __$$ChatRoomStateImplCopyWithImpl<$Res>; + factory _$$ChatRoomStateImplCopyWith(_$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) = __$$ChatRoomStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatRoomStateImplCopyWithImpl<$Res> - extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl> - implements _$$ChatRoomStateImplCopyWith<$Res> { - __$$ChatRoomStateImplCopyWithImpl( - _$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then) - : super(_value, _then); +class __$$ChatRoomStateImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl> implements _$$ChatRoomStateImplCopyWith<$Res> { + __$$ChatRoomStateImplCopyWithImpl(_$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -126,8 +113,7 @@ class _$ChatRoomStateImpl implements _ChatRoomState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatRoomStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateImpl); } @override @@ -138,9 +124,7 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading) - loaded, + required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -151,9 +135,7 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -164,9 +146,7 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -220,18 +200,14 @@ abstract class _ChatRoomState implements ChatRoomState { /// @nodoc abstract class _$$ChatRoomStateLoadingImplCopyWith<$Res> { - factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value, - $Res Function(_$ChatRoomStateLoadingImpl) then) = + factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value, $Res Function(_$ChatRoomStateLoadingImpl) then) = __$$ChatRoomStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res> - extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl> +class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl> implements _$$ChatRoomStateLoadingImplCopyWith<$Res> { - __$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value, - $Res Function(_$ChatRoomStateLoadingImpl) _then) - : super(_value, _then); + __$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value, $Res Function(_$ChatRoomStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -249,9 +225,7 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChatRoomStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateLoadingImpl); } @override @@ -262,9 +236,7 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading) - loaded, + required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -275,9 +247,7 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -288,9 +258,7 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -344,26 +312,19 @@ abstract class ChatRoomStateLoading implements ChatRoomState { /// @nodoc abstract class _$$ChatRoomStateLoadedImplCopyWith<$Res> { - factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value, - $Res Function(_$ChatRoomStateLoadedImpl) then) = + factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value, $Res Function(_$ChatRoomStateLoadedImpl) then) = __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>; + @useResult - $Res call( - {ChatRoomModel chatRoom, - List chatMessages, - bool isTyping, - bool isLoading}); + $Res call({ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading}); $ChatRoomModelCopyWith<$Res> get chatRoom; } /// @nodoc -class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> - extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl> +class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl> implements _$$ChatRoomStateLoadedImplCopyWith<$Res> { - __$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value, - $Res Function(_$ChatRoomStateLoadedImpl) _then) - : super(_value, _then); + __$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value, $Res Function(_$ChatRoomStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -409,16 +370,13 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { - const _$ChatRoomStateLoadedImpl( - {required this.chatRoom, - required final List chatMessages, - required this.isTyping, - required this.isLoading}) + const _$ChatRoomStateLoadedImpl({required this.chatRoom, required final List chatMessages, required this.isTyping, required this.isLoading}) : _chatMessages = chatMessages; @override final ChatRoomModel chatRoom; final List _chatMessages; + @override List get chatMessages { if (_chatMessages is EqualUnmodifiableListView) return _chatMessages; @@ -441,19 +399,14 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateLoadedImpl && - (identical(other.chatRoom, chatRoom) || - other.chatRoom == chatRoom) && - const DeepCollectionEquality() - .equals(other._chatMessages, _chatMessages) && - (identical(other.isTyping, isTyping) || - other.isTyping == isTyping) && - (identical(other.isLoading, isLoading) || - other.isLoading == isLoading)); + (identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom) && + const DeepCollectionEquality().equals(other._chatMessages, _chatMessages) && + (identical(other.isTyping, isTyping) || other.isTyping == isTyping) && + (identical(other.isLoading, isLoading) || other.isLoading == isLoading)); } @override - int get hashCode => Object.hash(runtimeType, chatRoom, - const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); + int get hashCode => Object.hash(runtimeType, chatRoom, const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -461,17 +414,14 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { @override @pragma('vm:prefer-inline') _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => - __$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>( - this, _$identity); + __$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading) - loaded, + required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return loaded(chatRoom, chatMessages, isTyping, isLoading); @@ -482,9 +432,7 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(chatRoom, chatMessages, isTyping, isLoading); @@ -495,9 +443,7 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -553,33 +499,32 @@ abstract class ChatRoomStateLoaded implements ChatRoomState { required final bool isLoading}) = _$ChatRoomStateLoadedImpl; ChatRoomModel get chatRoom; + List get chatMessages; + bool get isTyping; + bool get isLoading; /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ChatRoomStateErrorImplCopyWith<$Res> { - factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value, - $Res Function(_$ChatRoomStateErrorImpl) then) = + factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value, $Res Function(_$ChatRoomStateErrorImpl) then) = __$$ChatRoomStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ChatRoomStateErrorImplCopyWithImpl<$Res> - extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl> +class __$$ChatRoomStateErrorImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl> implements _$$ChatRoomStateErrorImplCopyWith<$Res> { - __$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value, - $Res Function(_$ChatRoomStateErrorImpl) _then) - : super(_value, _then); + __$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value, $Res Function(_$ChatRoomStateErrorImpl) _then) : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -615,8 +560,7 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -628,17 +572,14 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { @override @pragma('vm:prefer-inline') _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => - __$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>( - this, _$identity); + __$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading) - loaded, + required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -649,9 +590,7 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -662,9 +601,7 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, - List chatMessages, bool isTyping, bool isLoading)? - loaded, + TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -713,14 +650,12 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { } abstract class ChatRoomStateError implements ChatRoomState { - const factory ChatRoomStateError({required final String errorMessage}) = - _$ChatRoomStateErrorImpl; + const factory ChatRoomStateError({required final String errorMessage}) = _$ChatRoomStateErrorImpl; String get errorMessage; /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart index 99fa9054..1b216a02 100644 --- a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$ChatSelectState { required TResult Function(List chatRooms) loaded, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ mixin _$ChatSelectState { /// @nodoc abstract class $ChatSelectStateCopyWith<$Res> { - factory $ChatSelectStateCopyWith( - ChatSelectState value, $Res Function(ChatSelectState) then) = - _$ChatSelectStateCopyWithImpl<$Res, ChatSelectState>; + factory $ChatSelectStateCopyWith(ChatSelectState value, $Res Function(ChatSelectState) then) = _$ChatSelectStateCopyWithImpl<$Res, ChatSelectState>; } /// @nodoc -class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> - implements $ChatSelectStateCopyWith<$Res> { +class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> implements $ChatSelectStateCopyWith<$Res> { _$ChatSelectStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +90,13 @@ class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> /// @nodoc abstract class _$$ChatSelectStateImplCopyWith<$Res> { - factory _$$ChatSelectStateImplCopyWith(_$ChatSelectStateImpl value, - $Res Function(_$ChatSelectStateImpl) then) = - __$$ChatSelectStateImplCopyWithImpl<$Res>; + factory _$$ChatSelectStateImplCopyWith(_$ChatSelectStateImpl value, $Res Function(_$ChatSelectStateImpl) then) = __$$ChatSelectStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatSelectStateImplCopyWithImpl<$Res> - extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateImpl> +class __$$ChatSelectStateImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateImpl> implements _$$ChatSelectStateImplCopyWith<$Res> { - __$$ChatSelectStateImplCopyWithImpl( - _$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then) - : super(_value, _then); + __$$ChatSelectStateImplCopyWithImpl(_$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then) : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -120,8 +114,7 @@ class _$ChatSelectStateImpl implements _ChatSelectState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatSelectStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateImpl); } @override @@ -208,20 +201,14 @@ abstract class _ChatSelectState implements ChatSelectState { /// @nodoc abstract class _$$ChatSelectStateLoadingImplCopyWith<$Res> { - factory _$$ChatSelectStateLoadingImplCopyWith( - _$ChatSelectStateLoadingImpl value, - $Res Function(_$ChatSelectStateLoadingImpl) then) = + factory _$$ChatSelectStateLoadingImplCopyWith(_$ChatSelectStateLoadingImpl value, $Res Function(_$ChatSelectStateLoadingImpl) then) = __$$ChatSelectStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res> - extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadingImpl> +class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadingImpl> implements _$$ChatSelectStateLoadingImplCopyWith<$Res> { - __$$ChatSelectStateLoadingImplCopyWithImpl( - _$ChatSelectStateLoadingImpl _value, - $Res Function(_$ChatSelectStateLoadingImpl) _then) - : super(_value, _then); + __$$ChatSelectStateLoadingImplCopyWithImpl(_$ChatSelectStateLoadingImpl _value, $Res Function(_$ChatSelectStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -239,9 +226,7 @@ class _$ChatSelectStateLoadingImpl implements ChatSelectStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChatSelectStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateLoadingImpl); } @override @@ -328,20 +313,17 @@ abstract class ChatSelectStateLoading implements ChatSelectState { /// @nodoc abstract class _$$ChatSelectStateErrorImplCopyWith<$Res> { - factory _$$ChatSelectStateErrorImplCopyWith(_$ChatSelectStateErrorImpl value, - $Res Function(_$ChatSelectStateErrorImpl) then) = + factory _$$ChatSelectStateErrorImplCopyWith(_$ChatSelectStateErrorImpl value, $Res Function(_$ChatSelectStateErrorImpl) then) = __$$ChatSelectStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ChatSelectStateErrorImplCopyWithImpl<$Res> - extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateErrorImpl> +class __$$ChatSelectStateErrorImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateErrorImpl> implements _$$ChatSelectStateErrorImplCopyWith<$Res> { - __$$ChatSelectStateErrorImplCopyWithImpl(_$ChatSelectStateErrorImpl _value, - $Res Function(_$ChatSelectStateErrorImpl) _then) - : super(_value, _then); + __$$ChatSelectStateErrorImplCopyWithImpl(_$ChatSelectStateErrorImpl _value, $Res Function(_$ChatSelectStateErrorImpl) _then) : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -377,8 +359,7 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -389,10 +370,8 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> - get copyWith => - __$$ChatSelectStateErrorImplCopyWithImpl<_$ChatSelectStateErrorImpl>( - this, _$identity); + _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => + __$$ChatSelectStateErrorImplCopyWithImpl<_$ChatSelectStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -470,35 +449,29 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { } abstract class ChatSelectStateError implements ChatSelectState { - const factory ChatSelectStateError({required final String errorMessage}) = - _$ChatSelectStateErrorImpl; + const factory ChatSelectStateError({required final String errorMessage}) = _$ChatSelectStateErrorImpl; String get errorMessage; /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ChatSelectStateLoadedImplCopyWith<$Res> { - factory _$$ChatSelectStateLoadedImplCopyWith( - _$ChatSelectStateLoadedImpl value, - $Res Function(_$ChatSelectStateLoadedImpl) then) = + factory _$$ChatSelectStateLoadedImplCopyWith(_$ChatSelectStateLoadedImpl value, $Res Function(_$ChatSelectStateLoadedImpl) then) = __$$ChatSelectStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({List chatRooms}); } /// @nodoc -class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> - extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadedImpl> +class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadedImpl> implements _$$ChatSelectStateLoadedImplCopyWith<$Res> { - __$$ChatSelectStateLoadedImplCopyWithImpl(_$ChatSelectStateLoadedImpl _value, - $Res Function(_$ChatSelectStateLoadedImpl) _then) - : super(_value, _then); + __$$ChatSelectStateLoadedImplCopyWithImpl(_$ChatSelectStateLoadedImpl _value, $Res Function(_$ChatSelectStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -519,10 +492,10 @@ class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { - const _$ChatSelectStateLoadedImpl({required final List chatRooms}) - : _chatRooms = chatRooms; + const _$ChatSelectStateLoadedImpl({required final List chatRooms}) : _chatRooms = chatRooms; final List _chatRooms; + @override List get chatRooms { if (_chatRooms is EqualUnmodifiableListView) return _chatRooms; @@ -538,24 +511,19 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ChatSelectStateLoadedImpl && - const DeepCollectionEquality() - .equals(other._chatRooms, _chatRooms)); + (other.runtimeType == runtimeType && other is _$ChatSelectStateLoadedImpl && const DeepCollectionEquality().equals(other._chatRooms, _chatRooms)); } @override - int get hashCode => - Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> - get copyWith => __$$ChatSelectStateLoadedImplCopyWithImpl< - _$ChatSelectStateLoadedImpl>(this, _$identity); + _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> get copyWith => + __$$ChatSelectStateLoadedImplCopyWithImpl<_$ChatSelectStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -633,14 +601,12 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { } abstract class ChatSelectStateLoaded implements ChatSelectState { - const factory ChatSelectStateLoaded( - {required final List chatRooms}) = _$ChatSelectStateLoadedImpl; + const factory ChatSelectStateLoaded({required final List chatRooms}) = _$ChatSelectStateLoadedImpl; List get chatRooms; /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/services/chat_service.g.dart b/lib/features/chat/services/chat_service.g.dart index 4e84a7b3..fa32d6fd 100644 --- a/lib/features/chat/services/chat_service.g.dart +++ b/lib/features/chat/services/chat_service.g.dart @@ -80,8 +80,7 @@ class _ChatService implements ChatService { final _result = await _dio.fetch>(_options); late Map _value; try { - _value = _result.data!.map((k, dynamic v) => - MapEntry(k, ChatRoomModel.fromJson(v as Map))); + _value = _result.data!.map((k, dynamic v) => MapEntry(k, ChatRoomModel.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -199,9 +198,7 @@ class _ChatService implements ChatService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/diary/models/diary_model.dart b/lib/features/diary/models/diary_model.dart index d9abc3a9..8c152997 100644 --- a/lib/features/diary/models/diary_model.dart +++ b/lib/features/diary/models/diary_model.dart @@ -4,6 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import './meal.dart'; part 'diary_model.freezed.dart'; + part 'diary_model.g.dart'; @freezed diff --git a/lib/features/diary/models/meal.dart b/lib/features/diary/models/meal.dart index 415242c6..b5e12d83 100644 --- a/lib/features/diary/models/meal.dart +++ b/lib/features/diary/models/meal.dart @@ -4,6 +4,7 @@ import './photo.dart'; import './portion.dart'; part 'meal.freezed.dart'; + part 'meal.g.dart'; @freezed diff --git a/lib/features/diary/models/photo.dart b/lib/features/diary/models/photo.dart index e3a485d8..d3e4f695 100644 --- a/lib/features/diary/models/photo.dart +++ b/lib/features/diary/models/photo.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'photo.freezed.dart'; + part 'photo.g.dart'; @freezed diff --git a/lib/features/diary/models/portion.dart b/lib/features/diary/models/portion.dart index 59ad837d..f829dcf9 100644 --- a/lib/features/diary/models/portion.dart +++ b/lib/features/diary/models/portion.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'portion.freezed.dart'; + part 'portion.g.dart'; @freezed diff --git a/lib/features/diary/models/product.dart b/lib/features/diary/models/product.dart index 050b97de..48b1de0e 100644 --- a/lib/features/diary/models/product.dart +++ b/lib/features/diary/models/product.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'product.freezed.dart'; + part 'product.g.dart'; @freezed diff --git a/lib/features/diary/models/state.dart b/lib/features/diary/models/state.dart index 874592ed..b1da05c4 100644 --- a/lib/features/diary/models/state.dart +++ b/lib/features/diary/models/state.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'state.freezed.dart'; + part 'state.g.dart'; @freezed diff --git a/lib/features/feed/models/comment_model.freezed.dart b/lib/features/feed/models/comment_model.freezed.dart index 4e520131..b32da824 100644 --- a/lib/features/feed/models/comment_model.freezed.dart +++ b/lib/features/feed/models/comment_model.freezed.dart @@ -22,8 +22,10 @@ CommentModel _$CommentModelFromJson(Map json) { mixin _$CommentModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; + @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; + @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -33,32 +35,28 @@ mixin _$CommentModel { /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $CommentModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $CommentModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $CommentModelCopyWith<$Res> { - factory $CommentModelCopyWith( - CommentModel value, $Res Function(CommentModel) then) = - _$CommentModelCopyWithImpl<$Res, CommentModel>; + factory $CommentModelCopyWith(CommentModel value, $Res Function(CommentModel) then) = _$CommentModelCopyWithImpl<$Res, CommentModel>; + @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; + $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> - implements $CommentModelCopyWith<$Res> { +class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> implements $CommentModelCopyWith<$Res> { _$CommentModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -109,31 +107,23 @@ class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> } /// @nodoc -abstract class _$$CommentModelImplCopyWith<$Res> - implements $CommentModelCopyWith<$Res> { - factory _$$CommentModelImplCopyWith( - _$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) = - __$$CommentModelImplCopyWithImpl<$Res>; +abstract class _$$CommentModelImplCopyWith<$Res> implements $CommentModelCopyWith<$Res> { + factory _$$CommentModelImplCopyWith(_$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) = __$$CommentModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; + @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$CommentModelImplCopyWithImpl<$Res> - extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl> - implements _$$CommentModelImplCopyWith<$Res> { - __$$CommentModelImplCopyWithImpl( - _$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) - : super(_value, _then); +class __$$CommentModelImplCopyWithImpl<$Res> extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl> implements _$$CommentModelImplCopyWith<$Res> { + __$$CommentModelImplCopyWithImpl(_$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) : super(_value, _then); /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @@ -165,15 +155,13 @@ class __$$CommentModelImplCopyWithImpl<$Res> @JsonSerializable() class _$CommentModelImpl implements _CommentModel { const _$CommentModelImpl( - {@JsonKey(name: "data") required final List data, - @JsonKey(name: "links") required this.links, - @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$CommentModelImpl.fromJson(Map json) => - _$$CommentModelImplFromJson(json); + factory _$CommentModelImpl.fromJson(Map json) => _$$CommentModelImplFromJson(json); final List _data; + @override @JsonKey(name: "data") List get data { @@ -206,16 +194,14 @@ class _$CommentModelImpl implements _CommentModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => - __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity); + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity); @override Map toJson() { @@ -231,15 +217,16 @@ abstract class _CommentModel implements CommentModel { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$CommentModelImpl; - factory _CommentModel.fromJson(Map json) = - _$CommentModelImpl.fromJson; + factory _CommentModel.fromJson(Map json) = _$CommentModelImpl.fromJson; @override @JsonKey(name: "data") List get data; + @override @JsonKey(name: "links") Links get links; + @override @JsonKey(name: "meta") Meta get meta; @@ -248,8 +235,7 @@ abstract class _CommentModel implements CommentModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => throw _privateConstructorUsedError; } Comment _$CommentFromJson(Map json) { @@ -260,14 +246,19 @@ Comment _$CommentFromJson(Map json) { mixin _$Comment { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "author_name") String get authorName => throw _privateConstructorUsedError; + @JsonKey(name: "author_profile_icon") String get authorProfileIcon => throw _privateConstructorUsedError; + @JsonKey(name: "body") String get body => throw _privateConstructorUsedError; + @JsonKey(name: "children_comments") List get childrenComments => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; @@ -282,8 +273,8 @@ mixin _$Comment { /// @nodoc abstract class $CommentCopyWith<$Res> { - factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = - _$CommentCopyWithImpl<$Res, Comment>; + factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = _$CommentCopyWithImpl<$Res, Comment>; + @useResult $Res call( {@JsonKey(name: "id") int id, @@ -295,12 +286,12 @@ abstract class $CommentCopyWith<$Res> { } /// @nodoc -class _$CommentCopyWithImpl<$Res, $Val extends Comment> - implements $CommentCopyWith<$Res> { +class _$CommentCopyWithImpl<$Res, $Val extends Comment> implements $CommentCopyWith<$Res> { _$CommentCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -347,9 +338,8 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> /// @nodoc abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { - factory _$$CommentImplCopyWith( - _$CommentImpl value, $Res Function(_$CommentImpl) then) = - __$$CommentImplCopyWithImpl<$Res>; + factory _$$CommentImplCopyWith(_$CommentImpl value, $Res Function(_$CommentImpl) then) = __$$CommentImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -362,12 +352,8 @@ abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { } /// @nodoc -class __$$CommentImplCopyWithImpl<$Res> - extends _$CommentCopyWithImpl<$Res, _$CommentImpl> - implements _$$CommentImplCopyWith<$Res> { - __$$CommentImplCopyWithImpl( - _$CommentImpl _value, $Res Function(_$CommentImpl) _then) - : super(_value, _then); +class __$$CommentImplCopyWithImpl<$Res> extends _$CommentCopyWithImpl<$Res, _$CommentImpl> implements _$$CommentImplCopyWith<$Res> { + __$$CommentImplCopyWithImpl(_$CommentImpl _value, $Res Function(_$CommentImpl) _then) : super(_value, _then); /// Create a copy of Comment /// with the given fields replaced by the non-null parameter values. @@ -418,13 +404,11 @@ class _$CommentImpl implements _Comment { @JsonKey(name: "author_name") required this.authorName, @JsonKey(name: "author_profile_icon") required this.authorProfileIcon, @JsonKey(name: "body") required this.body, - @JsonKey(name: "children_comments") - required final List childrenComments, + @JsonKey(name: "children_comments") required final List childrenComments, @JsonKey(name: "created_at") required this.createdAt}) : _childrenComments = childrenComments; - factory _$CommentImpl.fromJson(Map json) => - _$$CommentImplFromJson(json); + factory _$CommentImpl.fromJson(Map json) => _$$CommentImplFromJson(json); @override @JsonKey(name: "id") @@ -439,11 +423,11 @@ class _$CommentImpl implements _Comment { @JsonKey(name: "body") final String body; final List _childrenComments; + @override @JsonKey(name: "children_comments") List get childrenComments { - if (_childrenComments is EqualUnmodifiableListView) - return _childrenComments; + if (_childrenComments is EqualUnmodifiableListView) return _childrenComments; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_childrenComments); } @@ -463,35 +447,23 @@ class _$CommentImpl implements _Comment { (other.runtimeType == runtimeType && other is _$CommentImpl && (identical(other.id, id) || other.id == id) && - (identical(other.authorName, authorName) || - other.authorName == authorName) && - (identical(other.authorProfileIcon, authorProfileIcon) || - other.authorProfileIcon == authorProfileIcon) && + (identical(other.authorName, authorName) || other.authorName == authorName) && + (identical(other.authorProfileIcon, authorProfileIcon) || other.authorProfileIcon == authorProfileIcon) && (identical(other.body, body) || other.body == body) && - const DeepCollectionEquality() - .equals(other._childrenComments, _childrenComments) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt)); + const DeepCollectionEquality().equals(other._childrenComments, _childrenComments) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - id, - authorName, - authorProfileIcon, - body, - const DeepCollectionEquality().hash(_childrenComments), - createdAt); + int get hashCode => Object.hash(runtimeType, id, authorName, authorProfileIcon, body, const DeepCollectionEquality().hash(_childrenComments), createdAt); /// Create a copy of Comment /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => - __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); @override Map toJson() { @@ -503,33 +475,35 @@ class _$CommentImpl implements _Comment { abstract class _Comment implements Comment { const factory _Comment( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "author_name") required final String authorName, - @JsonKey(name: "author_profile_icon") - required final String authorProfileIcon, - @JsonKey(name: "body") required final String body, - @JsonKey(name: "children_comments") - required final List childrenComments, - @JsonKey(name: "created_at") required final DateTime createdAt}) = - _$CommentImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "author_name") required final String authorName, + @JsonKey(name: "author_profile_icon") required final String authorProfileIcon, + @JsonKey(name: "body") required final String body, + @JsonKey(name: "children_comments") required final List childrenComments, + @JsonKey(name: "created_at") required final DateTime createdAt}) = _$CommentImpl; factory _Comment.fromJson(Map json) = _$CommentImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "author_name") String get authorName; + @override @JsonKey(name: "author_profile_icon") String get authorProfileIcon; + @override @JsonKey(name: "body") String get body; + @override @JsonKey(name: "children_comments") List get childrenComments; + @override @JsonKey(name: "created_at") DateTime get createdAt; @@ -538,6 +512,5 @@ abstract class _Comment implements Comment { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/comment_model.g.dart b/lib/features/feed/models/comment_model.g.dart index 1410cfcc..503322f9 100644 --- a/lib/features/feed/models/comment_model.g.dart +++ b/lib/features/feed/models/comment_model.g.dart @@ -6,36 +6,28 @@ part of 'comment_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CommentModelImpl _$$CommentModelImplFromJson(Map json) => - _$CommentModelImpl( - data: (json['data'] as List) - .map((e) => Comment.fromJson(e as Map)) - .toList(), +_$CommentModelImpl _$$CommentModelImplFromJson(Map json) => _$CommentModelImpl( + data: (json['data'] as List).map((e) => Comment.fromJson(e as Map)).toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$CommentModelImplToJson(_$CommentModelImpl instance) => - { +Map _$$CommentModelImplToJson(_$CommentModelImpl instance) => { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$CommentImpl _$$CommentImplFromJson(Map json) => - _$CommentImpl( +_$CommentImpl _$$CommentImplFromJson(Map json) => _$CommentImpl( id: (json['id'] as num).toInt(), authorName: json['author_name'] as String, authorProfileIcon: json['author_profile_icon'] as String, body: json['body'] as String, - childrenComments: (json['children_comments'] as List) - .map((e) => Comment.fromJson(e as Map)) - .toList(), + childrenComments: (json['children_comments'] as List).map((e) => Comment.fromJson(e as Map)).toList(), createdAt: DateTime.parse(json['created_at'] as String), ); -Map _$$CommentImplToJson(_$CommentImpl instance) => - { +Map _$$CommentImplToJson(_$CommentImpl instance) => { 'id': instance.id, 'author_name': instance.authorName, 'author_profile_icon': instance.authorProfileIcon, diff --git a/lib/features/feed/models/diets_pagination_model.dart b/lib/features/feed/models/diets_pagination_model.dart index a83be43f..dd7f4491 100644 --- a/lib/features/feed/models/diets_pagination_model.dart +++ b/lib/features/feed/models/diets_pagination_model.dart @@ -2,6 +2,7 @@ import 'package:eatvio_app/core/models/pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'diets_pagination_model.freezed.dart'; + part 'diets_pagination_model.g.dart'; @freezed 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 2998cddd..064facfa 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.dart @@ -3,6 +3,7 @@ import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'feed_blog_post_settings_model.freezed.dart'; + part 'feed_blog_post_settings_model.g.dart'; @freezed diff --git a/lib/features/feed/models/recipes_pagination_model.dart b/lib/features/feed/models/recipes_pagination_model.dart index 0d2abdca..25384082 100644 --- a/lib/features/feed/models/recipes_pagination_model.dart +++ b/lib/features/feed/models/recipes_pagination_model.dart @@ -2,6 +2,7 @@ import 'package:eatvio_app/features/feed/models/recipes_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'recipes_pagination_model.freezed.dart'; + part 'recipes_pagination_model.g.dart'; @freezed diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart index c3b582ce..caa93548 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart @@ -24,6 +24,7 @@ mixin _$CommentsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -70,18 +71,16 @@ mixin _$CommentsState { /// @nodoc abstract class $CommentsStateCopyWith<$Res> { - factory $CommentsStateCopyWith( - CommentsState value, $Res Function(CommentsState) then) = - _$CommentsStateCopyWithImpl<$Res, CommentsState>; + factory $CommentsStateCopyWith(CommentsState value, $Res Function(CommentsState) then) = _$CommentsStateCopyWithImpl<$Res, CommentsState>; } /// @nodoc -class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> - implements $CommentsStateCopyWith<$Res> { +class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> implements $CommentsStateCopyWith<$Res> { _$CommentsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -91,18 +90,12 @@ class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> /// @nodoc abstract class _$$CommentsStateImplCopyWith<$Res> { - factory _$$CommentsStateImplCopyWith( - _$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) = - __$$CommentsStateImplCopyWithImpl<$Res>; + factory _$$CommentsStateImplCopyWith(_$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) = __$$CommentsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CommentsStateImplCopyWithImpl<$Res> - extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl> - implements _$$CommentsStateImplCopyWith<$Res> { - __$$CommentsStateImplCopyWithImpl( - _$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) - : super(_value, _then); +class __$$CommentsStateImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl> implements _$$CommentsStateImplCopyWith<$Res> { + __$$CommentsStateImplCopyWithImpl(_$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -120,8 +113,7 @@ class _$CommentsStateImpl implements _CommentsState { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$CommentsStateImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateImpl); } @override @@ -208,18 +200,14 @@ abstract class _CommentsState implements CommentsState { /// @nodoc abstract class _$$CommentsStateLoadingImplCopyWith<$Res> { - factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value, - $Res Function(_$CommentsStateLoadingImpl) then) = + factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value, $Res Function(_$CommentsStateLoadingImpl) then) = __$$CommentsStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CommentsStateLoadingImplCopyWithImpl<$Res> - extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl> +class __$$CommentsStateLoadingImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl> implements _$$CommentsStateLoadingImplCopyWith<$Res> { - __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, - $Res Function(_$CommentsStateLoadingImpl) _then) - : super(_value, _then); + __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, $Res Function(_$CommentsStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -237,9 +225,7 @@ class _$CommentsStateLoadingImpl implements CommentsStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CommentsStateLoadingImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateLoadingImpl); } @override @@ -326,9 +312,9 @@ abstract class CommentsStateLoading implements CommentsState { /// @nodoc abstract class _$$CommentsStateLoadedImplCopyWith<$Res> { - factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value, - $Res Function(_$CommentsStateLoadedImpl) then) = + factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value, $Res Function(_$CommentsStateLoadedImpl) then) = __$$CommentsStateLoadedImplCopyWithImpl<$Res>; + @useResult $Res call({CommentModel comment, int? replyId}); @@ -336,12 +322,9 @@ abstract class _$$CommentsStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$CommentsStateLoadedImplCopyWithImpl<$Res> - extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl> +class __$$CommentsStateLoadedImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl> implements _$$CommentsStateLoadedImplCopyWith<$Res> { - __$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value, - $Res Function(_$CommentsStateLoadedImpl) _then) - : super(_value, _then); + __$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value, $Res Function(_$CommentsStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -407,8 +390,7 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { @override @pragma('vm:prefer-inline') _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => - __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>( - this, _$identity); + __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -486,36 +468,31 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { } abstract class CommentsStateLoaded implements CommentsState { - const factory CommentsStateLoaded( - {required final CommentModel comment, - final int? replyId}) = _$CommentsStateLoadedImpl; + const factory CommentsStateLoaded({required final CommentModel comment, final int? replyId}) = _$CommentsStateLoadedImpl; CommentModel get comment; + int? get replyId; /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$CommentsStateErrorImplCopyWith<$Res> { - factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value, - $Res Function(_$CommentsStateErrorImpl) then) = + factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value, $Res Function(_$CommentsStateErrorImpl) then) = __$$CommentsStateErrorImplCopyWithImpl<$Res>; + @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$CommentsStateErrorImplCopyWithImpl<$Res> - extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl> +class __$$CommentsStateErrorImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl> implements _$$CommentsStateErrorImplCopyWith<$Res> { - __$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value, - $Res Function(_$CommentsStateErrorImpl) _then) - : super(_value, _then); + __$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value, $Res Function(_$CommentsStateErrorImpl) _then) : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -551,8 +528,7 @@ class _$CommentsStateErrorImpl implements CommentsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || - other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override @@ -564,8 +540,7 @@ class _$CommentsStateErrorImpl implements CommentsStateError { @override @pragma('vm:prefer-inline') _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => - __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>( - this, _$identity); + __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -643,14 +618,12 @@ class _$CommentsStateErrorImpl implements CommentsStateError { } abstract class CommentsStateError implements CommentsState { - const factory CommentsStateError({required final String errorMessage}) = - _$CommentsStateErrorImpl; + const factory CommentsStateError({required final String errorMessage}) = _$CommentsStateErrorImpl; String get errorMessage; /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => - throw _privateConstructorUsedError; + _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/plans/models/plan_pagination_model.dart b/lib/features/plans/models/plan_pagination_model.dart index e9fef491..637961e3 100644 --- a/lib/features/plans/models/plan_pagination_model.dart +++ b/lib/features/plans/models/plan_pagination_model.dart @@ -3,6 +3,7 @@ import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'plan_pagination_model.freezed.dart'; + part 'plan_pagination_model.g.dart'; @freezed diff --git a/lib/features/profile/models/circumference_model.dart b/lib/features/profile/models/circumference_model.dart index eeb4f6e0..62b54d23 100644 --- a/lib/features/profile/models/circumference_model.dart +++ b/lib/features/profile/models/circumference_model.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'circumference_model.freezed.dart'; + part 'circumference_model.g.dart'; @freezed diff --git a/lib/features/profile/models/profile_model.dart b/lib/features/profile/models/profile_model.dart index 2ef4d073..d209e6d7 100644 --- a/lib/features/profile/models/profile_model.dart +++ b/lib/features/profile/models/profile_model.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'profile_model.freezed.dart'; + part 'profile_model.g.dart'; @freezed diff --git a/lib/features/profile/models/weight_model.dart b/lib/features/profile/models/weight_model.dart index 1a24424e..fc901df5 100644 --- a/lib/features/profile/models/weight_model.dart +++ b/lib/features/profile/models/weight_model.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'weight_model.freezed.dart'; + part 'weight_model.g.dart'; @freezed diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index 11fb8f42..f6052a4b 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -4,6 +4,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; class ProfileCubit extends Cubit { final ProfileRepository profileRepository; + String _currentPeriod = '1'; ProfileCubit({ required this.profileRepository, @@ -15,8 +16,6 @@ class ProfileCubit extends Cubit { profile: await profileRepository.getProfileBySlug(slug), profileDetails: await profileRepository.getMyProfileDetails(), blogPosts: await profileRepository.getBlogPostsByAuthorSlug(slug: slug), - weightPoints: await profileRepository.getWeight(period: '1', slug: slug), - circumferencePoints: await profileRepository.getCircumferences(period: '1', slug: slug), )); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); @@ -24,15 +23,18 @@ class ProfileCubit extends Cubit { } } - getMyProfile() async { + getMyProfile({ + String period = '1', + }) async { + _currentPeriod = period; try { final profile = await profileRepository.getMyProfile(); emit(ProfileState.loaded( profile: profile, profileDetails: await profileRepository.getMyProfileDetails(), blogPosts: await profileRepository.getBlogPostsByAuthorSlug(slug: profile.slug), - weightPoints: await profileRepository.getWeight(period: '1'), - circumferencePoints: await profileRepository.getCircumferences(period: '1'), + weightPoints: await profileRepository.getWeight(period: period), + circumferencePoints: await profileRepository.getCircumferences(period: period), )); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); @@ -51,7 +53,7 @@ class ProfileCubit extends Cubit { waistCircumference: waistCircumference, hipCircumference: hipCircumference, ); - emit((state as ProfileStateLoaded).copyWith()); + await getMyProfile(period: _currentPeriod); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); print(e); @@ -63,7 +65,7 @@ class ProfileCubit extends Cubit { }) async { try { await profileRepository.addWeight(weight: weight); - emit((state as ProfileStateLoaded).copyWith()); + await getMyProfile(period: _currentPeriod); } 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 index 696008ac..ec7fd13d 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart @@ -16,8 +16,8 @@ abstract class ProfileState with _$ProfileState { required ProfileModel profile, required ProfileDetailsModel profileDetails, required List blogPosts, - required List weightPoints, - required List circumferencePoints, + List? weightPoints, + List? circumferencePoints, }) = ProfileStateLoaded; const factory ProfileState.error({ diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart index b110d522..8919e36f 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart @@ -24,8 +24,8 @@ mixin _$ProfileState { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints) + List? weightPoints, + List? circumferencePoints) loaded, required TResult Function(String errorMessage) error, }) => @@ -38,8 +38,8 @@ mixin _$ProfileState { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints)? + List? weightPoints, + List? circumferencePoints)? loaded, TResult? Function(String errorMessage)? error, }) => @@ -52,8 +52,8 @@ mixin _$ProfileState { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints)? + List? weightPoints, + List? circumferencePoints)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -154,8 +154,8 @@ class _$ProfileStateImpl implements _ProfileState { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints) + List? weightPoints, + List? circumferencePoints) loaded, required TResult Function(String errorMessage) error, }) { @@ -171,8 +171,8 @@ class _$ProfileStateImpl implements _ProfileState { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints)? + List? weightPoints, + List? circumferencePoints)? loaded, TResult? Function(String errorMessage)? error, }) { @@ -188,8 +188,8 @@ class _$ProfileStateImpl implements _ProfileState { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints)? + List? weightPoints, + List? circumferencePoints)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -290,8 +290,8 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints) + List? weightPoints, + List? circumferencePoints) loaded, required TResult Function(String errorMessage) error, }) { @@ -307,8 +307,8 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints)? + List? weightPoints, + List? circumferencePoints)? loaded, TResult? Function(String errorMessage)? error, }) { @@ -324,8 +324,8 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints)? + List? weightPoints, + List? circumferencePoints)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -388,8 +388,8 @@ abstract class _$$ProfileStateLoadedImplCopyWith<$Res> { {ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints}); + List? weightPoints, + List? circumferencePoints}); $ProfileModelCopyWith<$Res> get profile; $ProfileDetailsModelCopyWith<$Res> get profileDetails; @@ -411,8 +411,8 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> Object? profile = null, Object? profileDetails = null, Object? blogPosts = null, - Object? weightPoints = null, - Object? circumferencePoints = null, + Object? weightPoints = freezed, + Object? circumferencePoints = freezed, }) { return _then(_$ProfileStateLoadedImpl( profile: null == profile @@ -427,14 +427,14 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> ? _value._blogPosts : blogPosts // ignore: cast_nullable_to_non_nullable as List, - weightPoints: null == weightPoints + weightPoints: freezed == weightPoints ? _value._weightPoints : weightPoints // ignore: cast_nullable_to_non_nullable - as List, - circumferencePoints: null == circumferencePoints + as List?, + circumferencePoints: freezed == circumferencePoints ? _value._circumferencePoints : circumferencePoints // ignore: cast_nullable_to_non_nullable - as List, + as List?, )); } @@ -466,8 +466,8 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { {required this.profile, required this.profileDetails, required final List blogPosts, - required final List weightPoints, - required final List circumferencePoints}) + final List? weightPoints, + final List? circumferencePoints}) : _blogPosts = blogPosts, _weightPoints = weightPoints, _circumferencePoints = circumferencePoints; @@ -484,21 +484,25 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { return EqualUnmodifiableListView(_blogPosts); } - final List _weightPoints; + final List? _weightPoints; @override - List get weightPoints { + List? get weightPoints { + final value = _weightPoints; + if (value == null) return null; if (_weightPoints is EqualUnmodifiableListView) return _weightPoints; // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_weightPoints); + return EqualUnmodifiableListView(value); } - final List _circumferencePoints; + final List? _circumferencePoints; @override - List get circumferencePoints { + List? get circumferencePoints { + final value = _circumferencePoints; + if (value == null) return null; if (_circumferencePoints is EqualUnmodifiableListView) return _circumferencePoints; // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_circumferencePoints); + return EqualUnmodifiableListView(value); } @override @@ -549,8 +553,8 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints) + List? weightPoints, + List? circumferencePoints) loaded, required TResult Function(String errorMessage) error, }) { @@ -567,8 +571,8 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints)? + List? weightPoints, + List? circumferencePoints)? loaded, TResult? Function(String errorMessage)? error, }) { @@ -585,8 +589,8 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints)? + List? weightPoints, + List? circumferencePoints)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), @@ -641,15 +645,15 @@ abstract class ProfileStateLoaded implements ProfileState { {required final ProfileModel profile, required final ProfileDetailsModel profileDetails, required final List blogPosts, - required final List weightPoints, - required final List circumferencePoints}) = + final List? weightPoints, + final List? circumferencePoints}) = _$ProfileStateLoadedImpl; ProfileModel get profile; ProfileDetailsModel get profileDetails; List get blogPosts; - List get weightPoints; - List get circumferencePoints; + List? get weightPoints; + List? get circumferencePoints; /// Create a copy of ProfileState /// with the given fields replaced by the non-null parameter values. @@ -734,8 +738,8 @@ class _$ProfileStateErrorImpl implements ProfileStateError { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints) + List? weightPoints, + List? circumferencePoints) loaded, required TResult Function(String errorMessage) error, }) { @@ -751,8 +755,8 @@ class _$ProfileStateErrorImpl implements ProfileStateError { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints)? + List? weightPoints, + List? circumferencePoints)? loaded, TResult? Function(String errorMessage)? error, }) { @@ -768,8 +772,8 @@ class _$ProfileStateErrorImpl implements ProfileStateError { ProfileModel profile, ProfileDetailsModel profileDetails, List blogPosts, - List weightPoints, - List circumferencePoints)? + List? weightPoints, + List? circumferencePoints)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index b388853a..5391fe33 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -30,265 +30,268 @@ class _ProfileScreenState extends State { List weightPoints = []; final List chipsLabelList = ['Вес', 'Замеры', 'ИМТ']; final List chipsIntervalLabelList = ['1М', '3М', '6М', '1Г', 'ВСЁ ВРЕМЯ']; + final List chipsIntervalList = ['1', '3', '6', '12', 'all']; int _selectedChipIndex = 0; int _selectedIntervalChipIndex = 0; + final ProfileCubit profileCubit = sl(); + + @override + void initState() { + super.initState(); + widget.author == null ? profileCubit.getMyProfile() : profileCubit.getProfileBySlug(widget.author!.authorSlug); + } @override Widget build(BuildContext context) { - return BlocProvider( - create: (BuildContext context) { - if (widget.author == null) - return sl()..getMyProfile(); - else - return sl()..getProfileBySlug(widget.author!.authorSlug); - }, - child: BlocBuilder( - builder: (BuildContext context, ProfileState state) { - if (state is ProfileStateLoaded) { - circumferencePoints = state.circumferencePoints; - weightPoints = state.weightPoints; - return Scaffold( - backgroundColor: Colors.grey.shade200, - appBar: widget.author == null ? AppBar(toolbarHeight: 0) : AppBar(), - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.vertical( - bottom: Radius.circular(16), - ), + return BlocBuilder( + bloc: profileCubit, + builder: (BuildContext context, ProfileState state) { + if (state is ProfileStateLoaded) { + if (state.circumferencePoints != null) { + circumferencePoints = state.circumferencePoints!; + weightPoints = state.weightPoints!; + } + return Scaffold( + backgroundColor: Colors.grey.shade200, + appBar: widget.author == null ? AppBar(toolbarHeight: 0) : AppBar(), + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(16), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16), - child: Row( - children: [ - CircleAvatar( - radius: 32, - backgroundImage: NetworkImage(state.profile.profilePhotoUrl), - ), - const SizedBox(width: 12), - Text( - state.profile.name, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.w500, - height: 1, - ), - ), - const Spacer(), - Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: SvgPicture.asset( - height: 28, - width: 28, - 'assets/icons/subscribers.svg', - colorFilter: ColorFilter.mode(appTheme.blueA400, BlendMode.srcIn), - ), - ), - SizedBox(width: 8), - Column( - children: [ - Text( - '123', - style: TextStyle( - height: 1, - fontSize: 18, - fontWeight: FontWeight.w500, - color: Colors.black87, - ), - ), - Text( - 'Подписчика', - style: TextStyle( - height: 1, - fontSize: 12, - fontWeight: FontWeight.w400, - color: Colors.black38, - ), - ), - ], - ), - ], - ), - GestureDetector( - onTap: () => Share.shareUri( - Uri.parse( - baseUrl + '/ru/profile/' + state.profile.slug, - ), - ), - child: Container( - padding: EdgeInsets.only(left: 16), - child: SvgPicture.asset( - height: 24, - width: 24, - 'assets/icons/share.svg', - colorFilter: ColorFilter.mode(appTheme.blueA400, BlendMode.srcIn), - ), - ), - ), - ], - ), - ), - if (state.profileDetails.additionalInfo.isNotEmpty) - Container( - alignment: Alignment.centerLeft, - padding: const EdgeInsets.all(16), - child: Text( - state.profileDetails.additionalInfo, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16), + child: Row( + children: [ + CircleAvatar( + radius: 32, + backgroundImage: NetworkImage(state.profile.profilePhotoUrl), + ), + const SizedBox(width: 12), + Text( + state.profile.name, style: TextStyle( - color: Colors.black.withOpacity(0.4), + color: Colors.black, + fontWeight: FontWeight.w500, height: 1, ), ), - ), - if (widget.author != null) const SizedBox(height: 8), - if (widget.author != null) - Row( - children: [ - SizedBox(width: 16), - GestureDetector( - onTap: () => GoRouter.of(context).pushNamed( - 'chatScreen', + const Spacer(), + Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + child: SvgPicture.asset( + height: 28, + width: 28, + 'assets/icons/subscribers.svg', + colorFilter: ColorFilter.mode(appTheme.blueA400, BlendMode.srcIn), + ), ), - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.all(8), - width: (MediaQuery.of(context).size.width - 40) / 2, - decoration: BoxDecoration( - color: appTheme.blueA400.withOpacity(0.1), - borderRadius: BorderRadius.circular(16), - ), - child: Text( - 'Сообщение', - style: TextStyle( - color: appTheme.blueA400, + SizedBox(width: 8), + Column( + children: [ + Text( + '123', + style: TextStyle( + height: 1, + fontSize: 18, + fontWeight: FontWeight.w500, + color: Colors.black87, + ), ), - ), + Text( + 'Подписчика', + style: TextStyle( + height: 1, + fontSize: 12, + fontWeight: FontWeight.w400, + color: Colors.black38, + ), + ), + ], + ), + ], + ), + GestureDetector( + onTap: () => Share.shareUri( + Uri.parse( + baseUrl + '/ru/profile/' + state.profile.slug, ), ), - SizedBox(width: 8), - Container( + child: Container( + padding: EdgeInsets.only(left: 16), + child: SvgPicture.asset( + height: 24, + width: 24, + 'assets/icons/share.svg', + colorFilter: ColorFilter.mode(appTheme.blueA400, BlendMode.srcIn), + ), + ), + ), + ], + ), + ), + if (state.profileDetails.additionalInfo.isNotEmpty) + Container( + alignment: Alignment.centerLeft, + padding: const EdgeInsets.all(16), + child: Text( + state.profileDetails.additionalInfo, + style: TextStyle( + color: Colors.black.withOpacity(0.4), + height: 1, + ), + ), + ), + if (widget.author != null) const SizedBox(height: 8), + if (widget.author != null) + Row( + children: [ + SizedBox(width: 16), + GestureDetector( + onTap: () => GoRouter.of(context).pushNamed( + 'chatScreen', + ), + child: Container( alignment: Alignment.center, padding: EdgeInsets.all(8), width: (MediaQuery.of(context).size.width - 40) / 2, decoration: BoxDecoration( - color: appTheme.blueA400, + color: appTheme.blueA400.withOpacity(0.1), borderRadius: BorderRadius.circular(16), ), child: Text( - 'Подписаться', + 'Сообщение', style: TextStyle( - color: Colors.white, + color: appTheme.blueA400, ), ), ), - SizedBox(width: 16), - ], - ), - if (widget.author != null) SizedBox(height: 16), - if (widget.author == null) _divider(context), - if (widget.author == null) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox(height: 8), - SingleChildScrollView( - padding: EdgeInsets.symmetric(horizontal: 16), - scrollDirection: Axis.horizontal, - child: Row( - children: [ - _choiceChipWidget(0), - SizedBox(width: 8), - _choiceChipWidget(1), - SizedBox(width: 8), - _choiceChipWidget(2), - ], + ), + SizedBox(width: 8), + Container( + alignment: Alignment.center, + padding: EdgeInsets.all(8), + width: (MediaQuery.of(context).size.width - 40) / 2, + decoration: BoxDecoration( + color: appTheme.blueA400, + borderRadius: BorderRadius.circular(16), + ), + child: Text( + 'Подписаться', + style: TextStyle( + color: Colors.white, ), ), - Builder( - builder: (context) { - switch (_selectedChipIndex) { - case 0: - return WeightChartWidget( - weightPoints: weightPoints, - profileCubit: context.read(), - ); - case 1: - return CircumferenceChartWidget( - circumferencePoints: circumferencePoints, - profileCubit: context.read(), - ); - case 2: - return ImtChartWidget( - weightPoints: weightPoints, - ); - } - return SizedBox.shrink(); - }, - ), - SizedBox(height: 8), - Row( + ), + SizedBox(width: 16), + ], + ), + if (widget.author != null) SizedBox(height: 16), + if (widget.author == null) _divider(context), + if (widget.author == null) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 8), + SingleChildScrollView( + padding: EdgeInsets.symmetric(horizontal: 16), + scrollDirection: Axis.horizontal, + child: Row( children: [ - SizedBox(width: 16), - _choiceIntervalChipWidget(0), + _choiceChipWidget(0), SizedBox(width: 8), - _choiceIntervalChipWidget(1), + _choiceChipWidget(1), SizedBox(width: 8), - _choiceIntervalChipWidget(2), - SizedBox(width: 8), - _choiceIntervalChipWidget(3), - SizedBox(width: 8), - _choiceIntervalChipWidget(4), + _choiceChipWidget(2), ], ), - SizedBox(height: 8), - ], - ), - ], - ), + ), + Builder( + builder: (context) { + switch (_selectedChipIndex) { + case 0: + return WeightChartWidget( + weightPoints: weightPoints, + profileCubit: profileCubit, + ); + case 1: + return CircumferenceChartWidget( + circumferencePoints: circumferencePoints, + profileCubit: profileCubit, + ); + case 2: + return ImtChartWidget( + weightPoints: weightPoints, + ); + } + return SizedBox.shrink(); + }, + ), + SizedBox(height: 8), + Row( + children: [ + SizedBox(width: 16), + _choiceIntervalChipWidget(0), + SizedBox(width: 8), + _choiceIntervalChipWidget(1), + SizedBox(width: 8), + _choiceIntervalChipWidget(2), + SizedBox(width: 8), + _choiceIntervalChipWidget(3), + SizedBox(width: 8), + _choiceIntervalChipWidget(4), + ], + ), + SizedBox(height: 8), + ], + ), + ], ), - SizedBox(height: 16), - ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) => BlogPostWidget(feedBlogPostModel: state.blogPosts[index]), - separatorBuilder: (context, index) => SizedBox(height: 8), - itemCount: state.blogPosts.length, - ), - SizedBox(height: 16), - ], - ), + ), + SizedBox(height: 16), + ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) => BlogPostWidget(feedBlogPostModel: state.blogPosts[index]), + separatorBuilder: (context, index) => SizedBox(height: 8), + itemCount: state.blogPosts.length, + ), + SizedBox(height: 16), + ], ), - ); - } else if (state is ProfileStateError) { - return Scaffold( - appBar: AppBar(), - body: Center( - child: Padding( - padding: const EdgeInsets.all(16), - child: Text(state.errorMessage), - ), + ), + ); + } 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(), - ), - ); - } - }, - ), + ), + ); + } else { + return Scaffold( + appBar: AppBar(), + body: Center( + child: CircularProgressIndicator(), + ), + ); + } + }, ); } @@ -321,6 +324,7 @@ class _ProfileScreenState extends State { ), selected: _selectedIntervalChipIndex == index, onSelected: (bool selected) { + profileCubit.getMyProfile(period: chipsIntervalList[index]); setState(() { _selectedIntervalChipIndex = index; }); diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart index f5f2a579..b1c2b7db 100644 --- a/lib/features/profile/presentation/widgets/weight_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -54,68 +54,73 @@ class _WeightChartWidgetState extends State { color: Colors.black12, ), ), - if (widget.weightPoints.length > 1) widget.weightPoints.last.weight > widget.weightPoints[widget.weightPoints.length - 2].weight - ? Icon( - Icons.arrow_drop_up, - size: 40, - color: Colors.grey.withOpacity(0.4), - ) - : Icon( - Icons.arrow_drop_down, - size: 40, - color: Colors.grey.withOpacity(0.4), - ), + if (widget.weightPoints.length > 1) + widget.weightPoints.last.weight > widget.weightPoints[widget.weightPoints.length - 2].weight + ? Icon( + Icons.arrow_drop_up, + size: 40, + color: Colors.grey.withOpacity(0.4), + ) + : Icon( + Icons.arrow_drop_down, + size: 40, + color: Colors.grey.withOpacity(0.4), + ), ], ), ), Stack( alignment: Alignment.bottomRight, children: [ - SfCartesianChart( - margin: EdgeInsets.symmetric(horizontal: 8), - enableAxisAnimation: true, - plotAreaBorderWidth: 0, - trackballBehavior: TrackballBehavior( - enable: true, - activationMode: ActivationMode.singleTap, - tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, - tooltipSettings: InteractiveTooltip(), - lineType: TrackballLineType.vertical, - ), - primaryXAxis: DateTimeCategoryAxis( - tickPosition: TickPosition.inside, - majorTickLines: MajorTickLines( - size: 0, - ), - edgeLabelPlacement: EdgeLabelPlacement.shift, - dateFormat: DateFormat.MMMd('ru'), - labelStyle: TextStyle( - color: Colors.grey, - ), - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), - axisLine: AxisLine( - color: Colors.grey.withOpacity(0.3), - width: 0.4, - ), - ), - primaryYAxis: NumericAxis( - isVisible: false, - labelFormat: '{value} кг', - majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), - axisLine: AxisLine( - width: 1, - ), - majorTickLines: MajorTickLines(size: 0), - ), - series: _getSplineSeries(), - tooltipBehavior: TooltipBehavior(enable: true), + SfCartesianChart( + margin: EdgeInsets.symmetric(horizontal: 8), + enableAxisAnimation: true, + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, + tooltipSettings: InteractiveTooltip(), + lineType: TrackballLineType.vertical, ), + primaryXAxis: DateTimeCategoryAxis( + tickPosition: TickPosition.inside, + majorTickLines: MajorTickLines( + size: 0, + ), + edgeLabelPlacement: EdgeLabelPlacement.shift, + dateFormat: DateFormat.MMMd('ru'), + labelStyle: TextStyle( + color: Colors.grey, + ), + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withOpacity(0.3)), + axisLine: AxisLine( + color: Colors.grey.withOpacity(0.3), + width: 0.4, + ), + ), + primaryYAxis: NumericAxis( + isVisible: false, + labelFormat: '{value} кг', + majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey), + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), + ), FloatingActionButton.small( heroTag: 'addWeight', onPressed: () { if (widget.weightPoints.isNotEmpty) { - weightKilo = int.parse(widget.weightPoints.last.weight.toString().split('.')[0]); - weightGrams = int.parse(widget.weightPoints.last.weight.toString().split('.')[1][0]); + try { + weightKilo = int.parse(widget.weightPoints.last.weight.toString().split('.')[0]); + weightGrams = int.parse(widget.weightPoints.last.weight.toString().split('.')[1][0]); + } catch (e) { + weightGrams = 0; + } weightKiloController = FixedExtentScrollController(initialItem: weightKilo - 20); weightGramsController = FixedExtentScrollController(initialItem: weightGrams); } else { @@ -192,7 +197,7 @@ class _WeightChartWidgetState extends State { }, ); }, - backgroundColor: Colors.red, + backgroundColor: appTheme.blueA400, shape: CircleBorder(), child: Icon( Icons.add, diff --git a/lib/features/recipes/models/ingredient.dart b/lib/features/recipes/models/ingredient.dart index 5524e744..d7a130e4 100644 --- a/lib/features/recipes/models/ingredient.dart +++ b/lib/features/recipes/models/ingredient.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'ingredient.freezed.dart'; + part 'ingredient.g.dart'; @freezed diff --git a/lib/features/recipes/models/recipe_model.dart b/lib/features/recipes/models/recipe_model.dart index 8b5b8c56..04add902 100644 --- a/lib/features/recipes/models/recipe_model.dart +++ b/lib/features/recipes/models/recipe_model.dart @@ -3,6 +3,7 @@ import 'package:eatvio_app/features/recipes/models/step.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'recipe_model.freezed.dart'; + part 'recipe_model.g.dart'; @freezed diff --git a/lib/features/recipes/models/recipe_tag_model.freezed.dart b/lib/features/recipes/models/recipe_tag_model.freezed.dart index d9993da3..cfeff53c 100644 --- a/lib/features/recipes/models/recipe_tag_model.freezed.dart +++ b/lib/features/recipes/models/recipe_tag_model.freezed.dart @@ -22,8 +22,10 @@ RecipeTagModel _$RecipeTagModelFromJson(Map json) { mixin _$RecipeTagModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; + @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; + @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -33,32 +35,28 @@ mixin _$RecipeTagModel { /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeTagModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $RecipeTagModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeTagModelCopyWith<$Res> { - factory $RecipeTagModelCopyWith( - RecipeTagModel value, $Res Function(RecipeTagModel) then) = - _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>; + factory $RecipeTagModelCopyWith(RecipeTagModel value, $Res Function(RecipeTagModel) then) = _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>; + @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; + $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> - implements $RecipeTagModelCopyWith<$Res> { +class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> implements $RecipeTagModelCopyWith<$Res> { _$RecipeTagModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -109,31 +107,23 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> } /// @nodoc -abstract class _$$RecipeTagModelImplCopyWith<$Res> - implements $RecipeTagModelCopyWith<$Res> { - factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value, - $Res Function(_$RecipeTagModelImpl) then) = - __$$RecipeTagModelImplCopyWithImpl<$Res>; +abstract class _$$RecipeTagModelImplCopyWith<$Res> implements $RecipeTagModelCopyWith<$Res> { + factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value, $Res Function(_$RecipeTagModelImpl) then) = __$$RecipeTagModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {@JsonKey(name: "data") List data, - @JsonKey(name: "links") Links links, - @JsonKey(name: "meta") Meta meta}); + $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; + @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$RecipeTagModelImplCopyWithImpl<$Res> - extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl> - implements _$$RecipeTagModelImplCopyWith<$Res> { - __$$RecipeTagModelImplCopyWithImpl( - _$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) - : super(_value, _then); +class __$$RecipeTagModelImplCopyWithImpl<$Res> extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl> implements _$$RecipeTagModelImplCopyWith<$Res> { + __$$RecipeTagModelImplCopyWithImpl(_$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) : super(_value, _then); /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @@ -165,15 +155,13 @@ class __$$RecipeTagModelImplCopyWithImpl<$Res> @JsonSerializable() class _$RecipeTagModelImpl implements _RecipeTagModel { const _$RecipeTagModelImpl( - {@JsonKey(name: "data") required final List data, - @JsonKey(name: "links") required this.links, - @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$RecipeTagModelImpl.fromJson(Map json) => - _$$RecipeTagModelImplFromJson(json); + factory _$RecipeTagModelImpl.fromJson(Map json) => _$$RecipeTagModelImplFromJson(json); final List _data; + @override @JsonKey(name: "data") List get data { @@ -206,17 +194,14 @@ class _$RecipeTagModelImpl implements _RecipeTagModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => - __$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>( - this, _$identity); + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => __$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>(this, _$identity); @override Map toJson() { @@ -232,15 +217,16 @@ abstract class _RecipeTagModel implements RecipeTagModel { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$RecipeTagModelImpl; - factory _RecipeTagModel.fromJson(Map json) = - _$RecipeTagModelImpl.fromJson; + factory _RecipeTagModel.fromJson(Map json) = _$RecipeTagModelImpl.fromJson; @override @JsonKey(name: "data") List get data; + @override @JsonKey(name: "links") Links get links; + @override @JsonKey(name: "meta") Meta get meta; @@ -249,8 +235,7 @@ abstract class _RecipeTagModel implements RecipeTagModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => throw _privateConstructorUsedError; } RecipeTag _$RecipeTagFromJson(Map json) { @@ -261,12 +246,16 @@ RecipeTag _$RecipeTagFromJson(Map json) { mixin _$RecipeTag { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; + @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; + @JsonKey(name: "recipes_count") int get recipesCount => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; @@ -276,14 +265,13 @@ mixin _$RecipeTag { /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeTagCopyWith get copyWith => - throw _privateConstructorUsedError; + $RecipeTagCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeTagCopyWith<$Res> { - factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) = - _$RecipeTagCopyWithImpl<$Res, RecipeTag>; + factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) = _$RecipeTagCopyWithImpl<$Res, RecipeTag>; + @useResult $Res call( {@JsonKey(name: "id") int id, @@ -294,12 +282,12 @@ abstract class $RecipeTagCopyWith<$Res> { } /// @nodoc -class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> - implements $RecipeTagCopyWith<$Res> { +class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> implements $RecipeTagCopyWith<$Res> { _$RecipeTagCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -340,11 +328,9 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> } /// @nodoc -abstract class _$$RecipeTagImplCopyWith<$Res> - implements $RecipeTagCopyWith<$Res> { - factory _$$RecipeTagImplCopyWith( - _$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) = - __$$RecipeTagImplCopyWithImpl<$Res>; +abstract class _$$RecipeTagImplCopyWith<$Res> implements $RecipeTagCopyWith<$Res> { + factory _$$RecipeTagImplCopyWith(_$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) = __$$RecipeTagImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -356,12 +342,8 @@ abstract class _$$RecipeTagImplCopyWith<$Res> } /// @nodoc -class __$$RecipeTagImplCopyWithImpl<$Res> - extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl> - implements _$$RecipeTagImplCopyWith<$Res> { - __$$RecipeTagImplCopyWithImpl( - _$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) - : super(_value, _then); +class __$$RecipeTagImplCopyWithImpl<$Res> extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl> implements _$$RecipeTagImplCopyWith<$Res> { + __$$RecipeTagImplCopyWithImpl(_$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) : super(_value, _then); /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @@ -409,8 +391,7 @@ class _$RecipeTagImpl implements _RecipeTag { @JsonKey(name: "created_at") required this.createdAt, @JsonKey(name: "updated_at") required this.updatedAt}); - factory _$RecipeTagImpl.fromJson(Map json) => - _$$RecipeTagImplFromJson(json); + factory _$RecipeTagImpl.fromJson(Map json) => _$$RecipeTagImplFromJson(json); @override @JsonKey(name: "id") @@ -440,26 +421,21 @@ class _$RecipeTagImpl implements _RecipeTag { other is _$RecipeTagImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.recipesCount, recipesCount) || - other.recipesCount == recipesCount) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); + (identical(other.recipesCount, recipesCount) || other.recipesCount == recipesCount) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); + int get hashCode => Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => - __$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity); + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => __$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity); @override Map toJson() { @@ -471,28 +447,30 @@ class _$RecipeTagImpl implements _RecipeTag { abstract class _RecipeTag implements RecipeTag { const factory _RecipeTag( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "recipes_count") required final int recipesCount, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") required final DateTime updatedAt}) = - _$RecipeTagImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "recipes_count") required final int recipesCount, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$RecipeTagImpl; - factory _RecipeTag.fromJson(Map json) = - _$RecipeTagImpl.fromJson; + factory _RecipeTag.fromJson(Map json) = _$RecipeTagImpl.fromJson; @override @JsonKey(name: "id") int get id; + @override @JsonKey(name: "name") String get name; + @override @JsonKey(name: "recipes_count") int get recipesCount; + @override @JsonKey(name: "created_at") DateTime get createdAt; + @override @JsonKey(name: "updated_at") DateTime get updatedAt; @@ -501,6 +479,5 @@ abstract class _RecipeTag implements RecipeTag { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/recipe_tag_model.g.dart b/lib/features/recipes/models/recipe_tag_model.g.dart index cd387547..9a6ea20f 100644 --- a/lib/features/recipes/models/recipe_tag_model.g.dart +++ b/lib/features/recipes/models/recipe_tag_model.g.dart @@ -6,25 +6,19 @@ part of 'recipe_tag_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map json) => - _$RecipeTagModelImpl( - data: (json['data'] as List) - .map((e) => RecipeTag.fromJson(e as Map)) - .toList(), +_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map json) => _$RecipeTagModelImpl( + data: (json['data'] as List).map((e) => RecipeTag.fromJson(e as Map)).toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$RecipeTagModelImplToJson( - _$RecipeTagModelImpl instance) => - { +Map _$$RecipeTagModelImplToJson(_$RecipeTagModelImpl instance) => { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => - _$RecipeTagImpl( +_$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => _$RecipeTagImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, recipesCount: (json['recipes_count'] as num).toInt(), @@ -32,8 +26,7 @@ _$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => updatedAt: DateTime.parse(json['updated_at'] as String), ); -Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => - { +Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => { 'id': instance.id, 'name': instance.name, 'recipes_count': instance.recipesCount, diff --git a/lib/features/recipes/models/step.dart b/lib/features/recipes/models/step.dart index 410e397e..9c22eb76 100644 --- a/lib/features/recipes/models/step.dart +++ b/lib/features/recipes/models/step.dart @@ -1,6 +1,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'step.freezed.dart'; + part 'step.g.dart'; @freezed diff --git a/lib/features/registration/models/location_model.freezed.dart b/lib/features/registration/models/location_model.freezed.dart index 95f81d60..052bc27b 100644 --- a/lib/features/registration/models/location_model.freezed.dart +++ b/lib/features/registration/models/location_model.freezed.dart @@ -21,6 +21,7 @@ LocationModel _$LocationModelFromJson(Map json) { /// @nodoc mixin _$LocationModel { List get locations => throw _privateConstructorUsedError; + @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; @@ -30,28 +31,24 @@ mixin _$LocationModel { /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $LocationModelCopyWith get copyWith => - throw _privateConstructorUsedError; + $LocationModelCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $LocationModelCopyWith<$Res> { - factory $LocationModelCopyWith( - LocationModel value, $Res Function(LocationModel) then) = - _$LocationModelCopyWithImpl<$Res, LocationModel>; + factory $LocationModelCopyWith(LocationModel value, $Res Function(LocationModel) then) = _$LocationModelCopyWithImpl<$Res, LocationModel>; + @useResult - $Res call( - {List locations, - @JsonKey(name: 'response_body') String responseBody}); + $Res call({List locations, @JsonKey(name: 'response_body') String responseBody}); } /// @nodoc -class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> - implements $LocationModelCopyWith<$Res> { +class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> implements $LocationModelCopyWith<$Res> { _$LocationModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -77,25 +74,17 @@ class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> } /// @nodoc -abstract class _$$LocationModelImplCopyWith<$Res> - implements $LocationModelCopyWith<$Res> { - factory _$$LocationModelImplCopyWith( - _$LocationModelImpl value, $Res Function(_$LocationModelImpl) then) = - __$$LocationModelImplCopyWithImpl<$Res>; +abstract class _$$LocationModelImplCopyWith<$Res> implements $LocationModelCopyWith<$Res> { + factory _$$LocationModelImplCopyWith(_$LocationModelImpl value, $Res Function(_$LocationModelImpl) then) = __$$LocationModelImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {List locations, - @JsonKey(name: 'response_body') String responseBody}); + $Res call({List locations, @JsonKey(name: 'response_body') String responseBody}); } /// @nodoc -class __$$LocationModelImplCopyWithImpl<$Res> - extends _$LocationModelCopyWithImpl<$Res, _$LocationModelImpl> - implements _$$LocationModelImplCopyWith<$Res> { - __$$LocationModelImplCopyWithImpl( - _$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) - : super(_value, _then); +class __$$LocationModelImplCopyWithImpl<$Res> extends _$LocationModelCopyWithImpl<$Res, _$LocationModelImpl> implements _$$LocationModelImplCopyWith<$Res> { + __$$LocationModelImplCopyWithImpl(_$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) : super(_value, _then); /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @@ -121,15 +110,12 @@ class __$$LocationModelImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$LocationModelImpl implements _LocationModel { - const _$LocationModelImpl( - {required final List locations, - @JsonKey(name: 'response_body') required this.responseBody}) - : _locations = locations; + const _$LocationModelImpl({required final List locations, @JsonKey(name: 'response_body') required this.responseBody}) : _locations = locations; - factory _$LocationModelImpl.fromJson(Map json) => - _$$LocationModelImplFromJson(json); + factory _$LocationModelImpl.fromJson(Map json) => _$$LocationModelImplFromJson(json); final List _locations; + @override List get locations { if (_locations is EqualUnmodifiableListView) return _locations; @@ -151,24 +137,20 @@ class _$LocationModelImpl implements _LocationModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$LocationModelImpl && - const DeepCollectionEquality() - .equals(other._locations, _locations) && - (identical(other.responseBody, responseBody) || - other.responseBody == responseBody)); + const DeepCollectionEquality().equals(other._locations, _locations) && + (identical(other.responseBody, responseBody) || other.responseBody == responseBody)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, - const DeepCollectionEquality().hash(_locations), responseBody); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_locations), responseBody); /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => - __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); + _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); @override Map toJson() { @@ -179,16 +161,14 @@ class _$LocationModelImpl implements _LocationModel { } abstract class _LocationModel implements LocationModel { - const factory _LocationModel( - {required final List locations, - @JsonKey(name: 'response_body') required final String responseBody}) = + const factory _LocationModel({required final List locations, @JsonKey(name: 'response_body') required final String responseBody}) = _$LocationModelImpl; - factory _LocationModel.fromJson(Map json) = - _$LocationModelImpl.fromJson; + factory _LocationModel.fromJson(Map json) = _$LocationModelImpl.fromJson; @override List get locations; + @override @JsonKey(name: 'response_body') String get responseBody; @@ -197,6 +177,5 @@ abstract class _LocationModel implements LocationModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/models/location_model.g.dart b/lib/features/registration/models/location_model.g.dart index 449630a4..da69ba9b 100644 --- a/lib/features/registration/models/location_model.g.dart +++ b/lib/features/registration/models/location_model.g.dart @@ -6,15 +6,12 @@ part of 'location_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$LocationModelImpl _$$LocationModelImplFromJson(Map json) => - _$LocationModelImpl( - locations: - (json['locations'] as List).map((e) => e as String).toList(), +_$LocationModelImpl _$$LocationModelImplFromJson(Map json) => _$LocationModelImpl( + locations: (json['locations'] as List).map((e) => e as String).toList(), responseBody: json['response_body'] as String, ); -Map _$$LocationModelImplToJson(_$LocationModelImpl instance) => - { +Map _$$LocationModelImplToJson(_$LocationModelImpl instance) => { 'locations': instance.locations, 'response_body': instance.responseBody, }; diff --git a/lib/features/registration/models/user_registration_model.freezed.dart b/lib/features/registration/models/user_registration_model.freezed.dart index fd835a26..b8ccb29b 100644 --- a/lib/features/registration/models/user_registration_model.freezed.dart +++ b/lib/features/registration/models/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,48 +22,74 @@ UserRegistrationSheet _$UserRegistrationSheetFromJson( mixin _$UserRegistrationSheet { @JsonKey(name: 'first_name') String get firstName => throw _privateConstructorUsedError; + @JsonKey(name: 'last_name') String get lastName => throw _privateConstructorUsedError; + String get email => throw _privateConstructorUsedError; + String get password => throw _privateConstructorUsedError; + @JsonKey(name: 'password_confirmation') String get passwordConfirmation => throw _privateConstructorUsedError; + @JsonKey(name: 'terms') String get termsAccepted => throw _privateConstructorUsedError; + String get birthdate => throw _privateConstructorUsedError; + String get gender => throw _privateConstructorUsedError; + String get location => throw _privateConstructorUsedError; + @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; + String get lang => throw _privateConstructorUsedError; + int get weight => throw _privateConstructorUsedError; + int get height => throw _privateConstructorUsedError; + @JsonKey(name: 'chest_circumference') int get chestCircumference => throw _privateConstructorUsedError; + @JsonKey(name: 'waist_circumference') int get waistCircumference => throw _privateConstructorUsedError; + @JsonKey(name: 'hip_circumference') int get hipCircumference => throw _privateConstructorUsedError; + @JsonKey(name: 'blood_pressure_up') int get bloodPressureUp => throw _privateConstructorUsedError; + @JsonKey(name: 'blood_pressure_down') int get bloodPressureDown => throw _privateConstructorUsedError; + @JsonKey(name: 'has_hypo') int get hasHypo => throw _privateConstructorUsedError; + @JsonKey(name: 'has_hyper') int get hasHyper => throw _privateConstructorUsedError; + @JsonKey(name: 'about_alergy') String get aboutAllergy => throw _privateConstructorUsedError; + @JsonKey(name: 'about_taking_pils') String get aboutTakingPils => throw _privateConstructorUsedError; + @JsonKey(name: 'about_sport_hobbies') String get aboutSportHobbies => throw _privateConstructorUsedError; + @JsonKey(name: 'favorite_foods') String get favoriteFoods => throw _privateConstructorUsedError; + @JsonKey(name: 'unfavorite_foods') String get unfavoriteFoods => throw _privateConstructorUsedError; + @JsonKey(name: 'additional_info') String get additionalInfo => throw _privateConstructorUsedError; + @JsonKey(name: 'activity_coefficient') double get activityCoefficient => throw _privateConstructorUsedError; @@ -74,15 +99,14 @@ mixin _$UserRegistrationSheet { /// Create a copy of UserRegistrationSheet /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $UserRegistrationSheetCopyWith get copyWith => - throw _privateConstructorUsedError; + $UserRegistrationSheetCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $UserRegistrationSheetCopyWith<$Res> { - factory $UserRegistrationSheetCopyWith(UserRegistrationSheet value, - $Res Function(UserRegistrationSheet) then) = + factory $UserRegistrationSheetCopyWith(UserRegistrationSheet value, $Res Function(UserRegistrationSheet) then) = _$UserRegistrationSheetCopyWithImpl<$Res, UserRegistrationSheet>; + @useResult $Res call( {@JsonKey(name: 'first_name') String firstName, @@ -115,13 +139,12 @@ abstract class $UserRegistrationSheetCopyWith<$Res> { } /// @nodoc -class _$UserRegistrationSheetCopyWithImpl<$Res, - $Val extends UserRegistrationSheet> - implements $UserRegistrationSheetCopyWith<$Res> { +class _$UserRegistrationSheetCopyWithImpl<$Res, $Val extends UserRegistrationSheet> implements $UserRegistrationSheetCopyWith<$Res> { _$UserRegistrationSheetCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -272,12 +295,10 @@ class _$UserRegistrationSheetCopyWithImpl<$Res, } /// @nodoc -abstract class _$$UserRegistrationSheetImplCopyWith<$Res> - implements $UserRegistrationSheetCopyWith<$Res> { - factory _$$UserRegistrationSheetImplCopyWith( - _$UserRegistrationSheetImpl value, - $Res Function(_$UserRegistrationSheetImpl) then) = +abstract class _$$UserRegistrationSheetImplCopyWith<$Res> implements $UserRegistrationSheetCopyWith<$Res> { + factory _$$UserRegistrationSheetImplCopyWith(_$UserRegistrationSheetImpl value, $Res Function(_$UserRegistrationSheetImpl) then) = __$$UserRegistrationSheetImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -311,13 +332,9 @@ abstract class _$$UserRegistrationSheetImplCopyWith<$Res> } /// @nodoc -class __$$UserRegistrationSheetImplCopyWithImpl<$Res> - extends _$UserRegistrationSheetCopyWithImpl<$Res, - _$UserRegistrationSheetImpl> +class __$$UserRegistrationSheetImplCopyWithImpl<$Res> extends _$UserRegistrationSheetCopyWithImpl<$Res, _$UserRegistrationSheetImpl> implements _$$UserRegistrationSheetImplCopyWith<$Res> { - __$$UserRegistrationSheetImplCopyWithImpl(_$UserRegistrationSheetImpl _value, - $Res Function(_$UserRegistrationSheetImpl) _then) - : super(_value, _then); + __$$UserRegistrationSheetImplCopyWithImpl(_$UserRegistrationSheetImpl _value, $Res Function(_$UserRegistrationSheetImpl) _then) : super(_value, _then); /// Create a copy of UserRegistrationSheet /// with the given fields replaced by the non-null parameter values. @@ -473,8 +490,7 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(name: 'last_name') required this.lastName, required this.email, required this.password, - @JsonKey(name: 'password_confirmation') - required this.passwordConfirmation, + @JsonKey(name: 'password_confirmation') required this.passwordConfirmation, @JsonKey(name: 'terms') this.termsAccepted = 'accepted', required this.birthdate, required this.gender, @@ -498,8 +514,7 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(name: 'additional_info') required this.additionalInfo, @JsonKey(name: 'activity_coefficient') this.activityCoefficient = 1.2}); - factory _$UserRegistrationSheetImpl.fromJson(Map json) => - _$$UserRegistrationSheetImplFromJson(json); + factory _$UserRegistrationSheetImpl.fromJson(Map json) => _$$UserRegistrationSheetImplFromJson(json); @override @JsonKey(name: 'first_name') @@ -585,54 +600,33 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { return identical(this, other) || (other.runtimeType == runtimeType && other is _$UserRegistrationSheetImpl && - (identical(other.firstName, firstName) || - other.firstName == firstName) && - (identical(other.lastName, lastName) || - other.lastName == lastName) && + (identical(other.firstName, firstName) || other.firstName == firstName) && + (identical(other.lastName, lastName) || other.lastName == lastName) && (identical(other.email, email) || other.email == email) && - (identical(other.password, password) || - other.password == password) && - (identical(other.passwordConfirmation, passwordConfirmation) || - other.passwordConfirmation == passwordConfirmation) && - (identical(other.termsAccepted, termsAccepted) || - other.termsAccepted == termsAccepted) && - (identical(other.birthdate, birthdate) || - other.birthdate == birthdate) && + (identical(other.password, password) || other.password == password) && + (identical(other.passwordConfirmation, passwordConfirmation) || other.passwordConfirmation == passwordConfirmation) && + (identical(other.termsAccepted, termsAccepted) || other.termsAccepted == termsAccepted) && + (identical(other.birthdate, birthdate) || other.birthdate == birthdate) && (identical(other.gender, gender) || other.gender == gender) && - (identical(other.location, location) || - other.location == location) && - (identical(other.responseBody, responseBody) || - other.responseBody == responseBody) && + (identical(other.location, location) || other.location == location) && + (identical(other.responseBody, responseBody) || other.responseBody == responseBody) && (identical(other.lang, lang) || other.lang == lang) && (identical(other.weight, weight) || other.weight == weight) && (identical(other.height, height) || other.height == height) && - (identical(other.chestCircumference, chestCircumference) || - other.chestCircumference == chestCircumference) && - (identical(other.waistCircumference, waistCircumference) || - other.waistCircumference == waistCircumference) && - (identical(other.hipCircumference, hipCircumference) || - other.hipCircumference == hipCircumference) && - (identical(other.bloodPressureUp, bloodPressureUp) || - other.bloodPressureUp == bloodPressureUp) && - (identical(other.bloodPressureDown, bloodPressureDown) || - other.bloodPressureDown == bloodPressureDown) && + (identical(other.chestCircumference, chestCircumference) || other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || other.hipCircumference == hipCircumference) && + (identical(other.bloodPressureUp, bloodPressureUp) || other.bloodPressureUp == bloodPressureUp) && + (identical(other.bloodPressureDown, bloodPressureDown) || other.bloodPressureDown == bloodPressureDown) && (identical(other.hasHypo, hasHypo) || other.hasHypo == hasHypo) && - (identical(other.hasHyper, hasHyper) || - other.hasHyper == hasHyper) && - (identical(other.aboutAllergy, aboutAllergy) || - other.aboutAllergy == aboutAllergy) && - (identical(other.aboutTakingPils, aboutTakingPils) || - other.aboutTakingPils == aboutTakingPils) && - (identical(other.aboutSportHobbies, aboutSportHobbies) || - other.aboutSportHobbies == aboutSportHobbies) && - (identical(other.favoriteFoods, favoriteFoods) || - other.favoriteFoods == favoriteFoods) && - (identical(other.unfavoriteFoods, unfavoriteFoods) || - other.unfavoriteFoods == unfavoriteFoods) && - (identical(other.additionalInfo, additionalInfo) || - other.additionalInfo == additionalInfo) && - (identical(other.activityCoefficient, activityCoefficient) || - other.activityCoefficient == activityCoefficient)); + (identical(other.hasHyper, hasHyper) || other.hasHyper == hasHyper) && + (identical(other.aboutAllergy, aboutAllergy) || other.aboutAllergy == aboutAllergy) && + (identical(other.aboutTakingPils, aboutTakingPils) || other.aboutTakingPils == aboutTakingPils) && + (identical(other.aboutSportHobbies, aboutSportHobbies) || other.aboutSportHobbies == aboutSportHobbies) && + (identical(other.favoriteFoods, favoriteFoods) || other.favoriteFoods == favoriteFoods) && + (identical(other.unfavoriteFoods, unfavoriteFoods) || other.unfavoriteFoods == unfavoriteFoods) && + (identical(other.additionalInfo, additionalInfo) || other.additionalInfo == additionalInfo) && + (identical(other.activityCoefficient, activityCoefficient) || other.activityCoefficient == activityCoefficient)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -673,9 +667,8 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> - get copyWith => __$$UserRegistrationSheetImplCopyWithImpl< - _$UserRegistrationSheetImpl>(this, _$identity); + _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => + __$$UserRegistrationSheetImplCopyWithImpl<_$UserRegistrationSheetImpl>(this, _$identity); @override Map toJson() { @@ -691,8 +684,7 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { @JsonKey(name: 'last_name') required final String lastName, required final String email, required final String password, - @JsonKey(name: 'password_confirmation') - required final String passwordConfirmation, + @JsonKey(name: 'password_confirmation') required final String passwordConfirmation, @JsonKey(name: 'terms') final String termsAccepted, required final String birthdate, required final String gender, @@ -701,99 +693,119 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { required final String lang, required final int weight, required final int height, - @JsonKey(name: 'chest_circumference') - required final int chestCircumference, - @JsonKey(name: 'waist_circumference') - required final int waistCircumference, + @JsonKey(name: 'chest_circumference') required final int chestCircumference, + @JsonKey(name: 'waist_circumference') required final int waistCircumference, @JsonKey(name: 'hip_circumference') required final int hipCircumference, @JsonKey(name: 'blood_pressure_up') required final int bloodPressureUp, - @JsonKey(name: 'blood_pressure_down') - required final int bloodPressureDown, + @JsonKey(name: 'blood_pressure_down') required final int bloodPressureDown, @JsonKey(name: 'has_hypo') required final int hasHypo, @JsonKey(name: 'has_hyper') required final int hasHyper, @JsonKey(name: 'about_alergy') required final String aboutAllergy, @JsonKey(name: 'about_taking_pils') required final String aboutTakingPils, - @JsonKey(name: 'about_sport_hobbies') - required final String aboutSportHobbies, + @JsonKey(name: 'about_sport_hobbies') required final String aboutSportHobbies, @JsonKey(name: 'favorite_foods') required final String favoriteFoods, @JsonKey(name: 'unfavorite_foods') required final String unfavoriteFoods, @JsonKey(name: 'additional_info') required final String additionalInfo, - @JsonKey(name: 'activity_coefficient') - final double activityCoefficient}) = _$UserRegistrationSheetImpl; + @JsonKey(name: 'activity_coefficient') final double activityCoefficient}) = _$UserRegistrationSheetImpl; - factory _UserRegistrationSheet.fromJson(Map json) = - _$UserRegistrationSheetImpl.fromJson; + factory _UserRegistrationSheet.fromJson(Map json) = _$UserRegistrationSheetImpl.fromJson; @override @JsonKey(name: 'first_name') String get firstName; + @override @JsonKey(name: 'last_name') String get lastName; + @override String get email; + @override String get password; + @override @JsonKey(name: 'password_confirmation') String get passwordConfirmation; + @override @JsonKey(name: 'terms') String get termsAccepted; + @override String get birthdate; + @override String get gender; + @override String get location; + @override @JsonKey(name: 'response_body') String get responseBody; + @override String get lang; + @override int get weight; + @override int get height; + @override @JsonKey(name: 'chest_circumference') int get chestCircumference; + @override @JsonKey(name: 'waist_circumference') int get waistCircumference; + @override @JsonKey(name: 'hip_circumference') int get hipCircumference; + @override @JsonKey(name: 'blood_pressure_up') int get bloodPressureUp; + @override @JsonKey(name: 'blood_pressure_down') int get bloodPressureDown; + @override @JsonKey(name: 'has_hypo') int get hasHypo; + @override @JsonKey(name: 'has_hyper') int get hasHyper; + @override @JsonKey(name: 'about_alergy') String get aboutAllergy; + @override @JsonKey(name: 'about_taking_pils') String get aboutTakingPils; + @override @JsonKey(name: 'about_sport_hobbies') String get aboutSportHobbies; + @override @JsonKey(name: 'favorite_foods') String get favoriteFoods; + @override @JsonKey(name: 'unfavorite_foods') String get unfavoriteFoods; + @override @JsonKey(name: 'additional_info') String get additionalInfo; + @override @JsonKey(name: 'activity_coefficient') double get activityCoefficient; @@ -802,6 +814,5 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> - get copyWith => throw _privateConstructorUsedError; + _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/models/user_registration_model.g.dart b/lib/features/registration/models/user_registration_model.g.dart index 9500e915..7690dbb1 100644 --- a/lib/features/registration/models/user_registration_model.g.dart +++ b/lib/features/registration/models/user_registration_model.g.dart @@ -6,9 +6,7 @@ part of 'user_registration_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson( - Map json) => - _$UserRegistrationSheetImpl( +_$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson(Map json) => _$UserRegistrationSheetImpl( firstName: json['first_name'] as String, lastName: json['last_name'] as String, email: json['email'] as String, @@ -35,13 +33,10 @@ _$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson( favoriteFoods: json['favorite_foods'] as String, unfavoriteFoods: json['unfavorite_foods'] as String, additionalInfo: json['additional_info'] as String, - activityCoefficient: - (json['activity_coefficient'] as num?)?.toDouble() ?? 1.2, + activityCoefficient: (json['activity_coefficient'] as num?)?.toDouble() ?? 1.2, ); -Map _$$UserRegistrationSheetImplToJson( - _$UserRegistrationSheetImpl instance) => - { +Map _$$UserRegistrationSheetImplToJson(_$UserRegistrationSheetImpl instance) => { 'first_name': instance.firstName, 'last_name': instance.lastName, 'email': instance.email, diff --git a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart index ae0a9706..eb722a2b 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart @@ -21,15 +21,13 @@ mixin _$RegistrationState { /// Create a copy of RegistrationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RegistrationStateCopyWith get copyWith => - throw _privateConstructorUsedError; + $RegistrationStateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RegistrationStateCopyWith<$Res> { - factory $RegistrationStateCopyWith( - RegistrationState value, $Res Function(RegistrationState) then) = - _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; + factory $RegistrationStateCopyWith(RegistrationState value, $Res Function(RegistrationState) then) = _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; + @useResult $Res call({UserRegistrationSheet sheet}); @@ -37,12 +35,12 @@ abstract class $RegistrationStateCopyWith<$Res> { } /// @nodoc -class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> - implements $RegistrationStateCopyWith<$Res> { +class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> implements $RegistrationStateCopyWith<$Res> { _$RegistrationStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -73,11 +71,10 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> } /// @nodoc -abstract class _$$RegistrationStateImplCopyWith<$Res> - implements $RegistrationStateCopyWith<$Res> { - factory _$$RegistrationStateImplCopyWith(_$RegistrationStateImpl value, - $Res Function(_$RegistrationStateImpl) then) = +abstract class _$$RegistrationStateImplCopyWith<$Res> implements $RegistrationStateCopyWith<$Res> { + factory _$$RegistrationStateImplCopyWith(_$RegistrationStateImpl value, $Res Function(_$RegistrationStateImpl) then) = __$$RegistrationStateImplCopyWithImpl<$Res>; + @override @useResult $Res call({UserRegistrationSheet sheet}); @@ -87,12 +84,9 @@ abstract class _$$RegistrationStateImplCopyWith<$Res> } /// @nodoc -class __$$RegistrationStateImplCopyWithImpl<$Res> - extends _$RegistrationStateCopyWithImpl<$Res, _$RegistrationStateImpl> +class __$$RegistrationStateImplCopyWithImpl<$Res> extends _$RegistrationStateCopyWithImpl<$Res, _$RegistrationStateImpl> implements _$$RegistrationStateImplCopyWith<$Res> { - __$$RegistrationStateImplCopyWithImpl(_$RegistrationStateImpl _value, - $Res Function(_$RegistrationStateImpl) _then) - : super(_value, _then); + __$$RegistrationStateImplCopyWithImpl(_$RegistrationStateImpl _value, $Res Function(_$RegistrationStateImpl) _then) : super(_value, _then); /// Create a copy of RegistrationState /// with the given fields replaced by the non-null parameter values. @@ -126,9 +120,7 @@ class _$RegistrationStateImpl implements _RegistrationState { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$RegistrationStateImpl && - (identical(other.sheet, sheet) || other.sheet == sheet)); + (other.runtimeType == runtimeType && other is _$RegistrationStateImpl && (identical(other.sheet, sheet) || other.sheet == sheet)); } @override @@ -139,14 +131,11 @@ class _$RegistrationStateImpl implements _RegistrationState { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => - __$$RegistrationStateImplCopyWithImpl<_$RegistrationStateImpl>( - this, _$identity); + _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => __$$RegistrationStateImplCopyWithImpl<_$RegistrationStateImpl>(this, _$identity); } abstract class _RegistrationState implements RegistrationState { - const factory _RegistrationState( - {required final UserRegistrationSheet sheet}) = _$RegistrationStateImpl; + const factory _RegistrationState({required final UserRegistrationSheet sheet}) = _$RegistrationStateImpl; @override UserRegistrationSheet get sheet; @@ -155,6 +144,5 @@ abstract class _RegistrationState implements RegistrationState { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/presentation/pages/registration_screen.dart b/lib/features/registration/presentation/pages/registration_screen.dart index aa3ca881..7f5b33e8 100644 --- a/lib/features/registration/presentation/pages/registration_screen.dart +++ b/lib/features/registration/presentation/pages/registration_screen.dart @@ -346,7 +346,7 @@ class _RegistrationScreenState extends State { BuildContext context, ) { final s = S.of(context); - + List errors = []; if (chestCircumference.isEmpty | waistCircumference.isEmpty | hipCircumference.isEmpty) { diff --git a/lib/features/registration/services/registration_service.g.dart b/lib/features/registration/services/registration_service.g.dart index 4aaccede..50d9fd82 100644 --- a/lib/features/registration/services/registration_service.g.dart +++ b/lib/features/registration/services/registration_service.g.dart @@ -22,8 +22,7 @@ class _RegistrationService implements RegistrationService { final ParseErrorLogger? errorLogger; @override - Future> register( - {required Map sheet}) async { + Future> register({required Map sheet}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -129,9 +128,7 @@ class _RegistrationService implements RegistrationService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/generated/intl/messages_all.dart b/lib/generated/intl/messages_all.dart index 203415cc..8e3e2726 100644 --- a/lib/generated/intl/messages_all.dart +++ b/lib/generated/intl/messages_all.dart @@ -19,6 +19,7 @@ import 'package:intl/src/intl_helpers.dart'; import 'messages_en.dart' as messages_en; typedef Future LibraryLoader(); + Map _deferredLibraries = { 'en': () => new SynchronousFuture(null), }; @@ -34,9 +35,7 @@ MessageLookupByLibrary? _findExact(String localeName) { /// User programs should call this before using [localeName] for messages. Future initializeMessages(String localeName) { - var availableLocale = Intl.verifiedLocale( - localeName, (locale) => _deferredLibraries[locale] != null, - onFailure: (_) => null); + var availableLocale = Intl.verifiedLocale(localeName, (locale) => _deferredLibraries[locale] != null, onFailure: (_) => null); if (availableLocale == null) { return new SynchronousFuture(false); } @@ -56,8 +55,7 @@ bool _messagesExistFor(String locale) { } MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { - var actualLocale = - Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); + var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); if (actualLocale == null) return null; return _findExact(actualLocale); } diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 2fee5ba3..123ac71e 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -21,151 +21,101 @@ class MessageLookup extends MessageLookupByLibrary { String get localeName => 'en'; final messages = _notInlinedMessages(_notInlinedMessages); + static Map _notInlinedMessages(_) => { "Moscow": MessageLookupByLibrary.simpleMessage("Москва"), "Russia": MessageLookupByLibrary.simpleMessage("Россия"), "active": MessageLookupByLibrary.simpleMessage("Активен"), "add_measure": MessageLookupByLibrary.simpleMessage("Добавить замер"), - "additional_information": - MessageLookupByLibrary.simpleMessage("Дополнительная информация"), + "additional_information": MessageLookupByLibrary.simpleMessage("Дополнительная информация"), "admin": MessageLookupByLibrary.simpleMessage("Админ"), - "allergies_presence": - MessageLookupByLibrary.simpleMessage("Наличие аллергии"), + "allergies_presence": MessageLookupByLibrary.simpleMessage("Наличие аллергии"), "archived": MessageLookupByLibrary.simpleMessage("В архиве"), "authentificate": MessageLookupByLibrary.simpleMessage("Войти"), - "average_pressure": MessageLookupByLibrary.simpleMessage( - "Средние показатели давления:"), + "average_pressure": MessageLookupByLibrary.simpleMessage("Средние показатели давления:"), "bodymass_chart": MessageLookupByLibrary.simpleMessage("График ИМТ"), "chat": MessageLookupByLibrary.simpleMessage("Чат"), "chest": MessageLookupByLibrary.simpleMessage("Грудь"), - "chest_circumference": - MessageLookupByLibrary.simpleMessage("Обхват груди"), - "circumference_empty": MessageLookupByLibrary.simpleMessage( - "Все замеры обязательны к заполнению"), - "circumference_is_not_a_number": MessageLookupByLibrary.simpleMessage( - "Все замеры должны быть числами"), - "circumferences_chart": - MessageLookupByLibrary.simpleMessage("График обхватов"), + "chest_circumference": MessageLookupByLibrary.simpleMessage("Обхват груди"), + "circumference_empty": MessageLookupByLibrary.simpleMessage("Все замеры обязательны к заполнению"), + "circumference_is_not_a_number": MessageLookupByLibrary.simpleMessage("Все замеры должны быть числами"), + "circumferences_chart": MessageLookupByLibrary.simpleMessage("График обхватов"), "city": MessageLookupByLibrary.simpleMessage("Город"), - "city_of_living": - MessageLookupByLibrary.simpleMessage("Город проживания"), + "city_of_living": MessageLookupByLibrary.simpleMessage("Город проживания"), "continueButton": MessageLookupByLibrary.simpleMessage("Продолжить"), "country": MessageLookupByLibrary.simpleMessage("Страна"), "date_of_birth": MessageLookupByLibrary.simpleMessage("Дата рождения"), "diary": MessageLookupByLibrary.simpleMessage("Дневник"), - "do_you_have_hypertension_tendency": - MessageLookupByLibrary.simpleMessage("Есть ли у вас гипертония?"), - "do_you_have_hypotension_tendency": - MessageLookupByLibrary.simpleMessage("Есть ли у вас гипотония?"), - "do_you_take_pills": MessageLookupByLibrary.simpleMessage( - "Принимаете ли вы лекарства или бады?"), - "down_pressure": - MessageLookupByLibrary.simpleMessage("Нижние показатели давления:"), + "do_you_have_hypertension_tendency": MessageLookupByLibrary.simpleMessage("Есть ли у вас гипертония?"), + "do_you_have_hypotension_tendency": MessageLookupByLibrary.simpleMessage("Есть ли у вас гипотония?"), + "do_you_take_pills": MessageLookupByLibrary.simpleMessage("Принимаете ли вы лекарства или бады?"), + "down_pressure": MessageLookupByLibrary.simpleMessage("Нижние показатели давления:"), "draft": MessageLookupByLibrary.simpleMessage("Черновик"), "email": MessageLookupByLibrary.simpleMessage("Элетронная почта"), - "email_empty": MessageLookupByLibrary.simpleMessage( - "Необходимо ввести адрес электронной почты"), - "email_invalid": MessageLookupByLibrary.simpleMessage( - "Некорректный адрес электронной почты"), - "enter_additional_information": MessageLookupByLibrary.simpleMessage( - "Введите любую дополнительную информацию на своё усмотрение:"), - "enter_information": - MessageLookupByLibrary.simpleMessage("Введите информацию..."), + "email_empty": MessageLookupByLibrary.simpleMessage("Необходимо ввести адрес электронной почты"), + "email_invalid": MessageLookupByLibrary.simpleMessage("Некорректный адрес электронной почты"), + "enter_additional_information": MessageLookupByLibrary.simpleMessage("Введите любую дополнительную информацию на своё усмотрение:"), + "enter_information": MessageLookupByLibrary.simpleMessage("Введите информацию..."), "exit": MessageLookupByLibrary.simpleMessage("Выйти"), - "favorite_foods": - MessageLookupByLibrary.simpleMessage("Любимые продукты"), - "favorite_unfavorite_foods": MessageLookupByLibrary.simpleMessage( - "Ваши любимые/нелюбимые продукты питания?"), + "favorite_foods": MessageLookupByLibrary.simpleMessage("Любимые продукты"), + "favorite_unfavorite_foods": MessageLookupByLibrary.simpleMessage("Ваши любимые/нелюбимые продукты питания?"), "female": MessageLookupByLibrary.simpleMessage("Женский"), - "fill_in_information": - MessageLookupByLibrary.simpleMessage("Заполните информацию:"), + "fill_in_information": MessageLookupByLibrary.simpleMessage("Заполните информацию:"), "finish": MessageLookupByLibrary.simpleMessage("Завершить"), "first_name": MessageLookupByLibrary.simpleMessage("Имя"), - "first_name_empty": MessageLookupByLibrary.simpleMessage( - "Имя обязательно для заполнения"), - "first_name_short": MessageLookupByLibrary.simpleMessage( - "В имени должен быть минимум 1 символ"), + "first_name_empty": MessageLookupByLibrary.simpleMessage("Имя обязательно для заполнения"), + "first_name_short": MessageLookupByLibrary.simpleMessage("В имени должен быть минимум 1 символ"), "gr": MessageLookupByLibrary.simpleMessage("гр"), "grams": MessageLookupByLibrary.simpleMessage("гр"), - "height_measurements": - MessageLookupByLibrary.simpleMessage("Замер роста"), - "hip_circumference": - MessageLookupByLibrary.simpleMessage("Обхват бедер"), + "height_measurements": MessageLookupByLibrary.simpleMessage("Замер роста"), + "hip_circumference": MessageLookupByLibrary.simpleMessage("Обхват бедер"), "hips": MessageLookupByLibrary.simpleMessage("Бедра"), "in_progress": MessageLookupByLibrary.simpleMessage("В процессе"), - "initial_measurements": - MessageLookupByLibrary.simpleMessage("Первичные замеры"), + "initial_measurements": MessageLookupByLibrary.simpleMessage("Первичные замеры"), "language": MessageLookupByLibrary.simpleMessage("Язык:"), "last_name": MessageLookupByLibrary.simpleMessage("Фамилия"), - "last_name_empty": MessageLookupByLibrary.simpleMessage( - "Фамилия обязательна для заполнения"), - "last_name_short": MessageLookupByLibrary.simpleMessage( - "В фамилии должен быть минимум 6 символов"), + "last_name_empty": MessageLookupByLibrary.simpleMessage("Фамилия обязательна для заполнения"), + "last_name_short": MessageLookupByLibrary.simpleMessage("В фамилии должен быть минимум 6 символов"), "lbl_english": MessageLookupByLibrary.simpleMessage("English"), "loading": MessageLookupByLibrary.simpleMessage("Загрузка..."), "male": MessageLookupByLibrary.simpleMessage("Мужской"), - "msg_network_err": - MessageLookupByLibrary.simpleMessage("Сетевая ошибка!"), - "msg_something_went_wrong": - MessageLookupByLibrary.simpleMessage("Что то пошло не так!"), + "msg_network_err": MessageLookupByLibrary.simpleMessage("Сетевая ошибка!"), + "msg_something_went_wrong": MessageLookupByLibrary.simpleMessage("Что то пошло не так!"), "my_blog": MessageLookupByLibrary.simpleMessage("Мой блог"), "my_settings": MessageLookupByLibrary.simpleMessage("Мои настройки"), - "name_empty": MessageLookupByLibrary.simpleMessage( - "Имя пользователя обязательно для заполнения"), - "name_short": MessageLookupByLibrary.simpleMessage( - "В имени пользователя должно быть минимум 6 символов"), + "name_empty": MessageLookupByLibrary.simpleMessage("Имя пользователя обязательно для заполнения"), + "name_short": MessageLookupByLibrary.simpleMessage("В имени пользователя должно быть минимум 6 символов"), "no": MessageLookupByLibrary.simpleMessage("Нет"), - "no_account": - MessageLookupByLibrary.simpleMessage("У меня нет аккаунта"), + "no_account": MessageLookupByLibrary.simpleMessage("У меня нет аккаунта"), "password": MessageLookupByLibrary.simpleMessage("Пароль"), - "password_confirmation": - MessageLookupByLibrary.simpleMessage("Подтвердите пароль"), - "password_confirmation_mismatch": - MessageLookupByLibrary.simpleMessage("Пароли не совпадают"), - "password_empty": MessageLookupByLibrary.simpleMessage( - "Пароль обязателен для заполнения"), - "password_short": MessageLookupByLibrary.simpleMessage( - "В пароле должно быть минимум 6 символов"), + "password_confirmation": MessageLookupByLibrary.simpleMessage("Подтвердите пароль"), + "password_confirmation_mismatch": MessageLookupByLibrary.simpleMessage("Пароли не совпадают"), + "password_empty": MessageLookupByLibrary.simpleMessage("Пароль обязателен для заполнения"), + "password_short": MessageLookupByLibrary.simpleMessage("В пароле должно быть минимум 6 символов"), "pcs": MessageLookupByLibrary.simpleMessage("шт"), - "place_of_living": - MessageLookupByLibrary.simpleMessage("Место проживания"), - "plans_complete": - MessageLookupByLibrary.simpleMessage("Пройденные планы"), - "preferred_language": - MessageLookupByLibrary.simpleMessage("Предпочитаемый язык общения"), - "pressure_empty": MessageLookupByLibrary.simpleMessage( - "Все показатели давления обязательны к заполнению"), - "pressure_is_not_a_number": MessageLookupByLibrary.simpleMessage( - "Все показатели давления должны быть числами"), + "place_of_living": MessageLookupByLibrary.simpleMessage("Место проживания"), + "plans_complete": MessageLookupByLibrary.simpleMessage("Пройденные планы"), + "preferred_language": MessageLookupByLibrary.simpleMessage("Предпочитаемый язык общения"), + "pressure_empty": MessageLookupByLibrary.simpleMessage("Все показатели давления обязательны к заполнению"), + "pressure_is_not_a_number": MessageLookupByLibrary.simpleMessage("Все показатели давления должны быть числами"), "profile": MessageLookupByLibrary.simpleMessage("Профиль"), "save": MessageLookupByLibrary.simpleMessage("Сохранить"), "skip": MessageLookupByLibrary.simpleMessage("Пропустить"), - "tell_your_schedule": MessageLookupByLibrary.simpleMessage( - "Расскажите в свободной форме о том как просыпаетесь, когда едите, когда ложитесь спать:"), - "unfavorite_foods": - MessageLookupByLibrary.simpleMessage("Нелюбимые продукты"), - "up_pressure": MessageLookupByLibrary.simpleMessage( - "Верхние показатели давления:"), - "user_authorization": - MessageLookupByLibrary.simpleMessage("Аутентификация"), - "user_registration": - MessageLookupByLibrary.simpleMessage("Регистрация пользователя"), + "tell_your_schedule": MessageLookupByLibrary.simpleMessage("Расскажите в свободной форме о том как просыпаетесь, когда едите, когда ложитесь спать:"), + "unfavorite_foods": MessageLookupByLibrary.simpleMessage("Нелюбимые продукты"), + "up_pressure": MessageLookupByLibrary.simpleMessage("Верхние показатели давления:"), + "user_authorization": MessageLookupByLibrary.simpleMessage("Аутентификация"), + "user_registration": MessageLookupByLibrary.simpleMessage("Регистрация пользователя"), "username": MessageLookupByLibrary.simpleMessage("Имя пользователя"), "waist": MessageLookupByLibrary.simpleMessage("Талия"), - "waist_circumference": - MessageLookupByLibrary.simpleMessage("Обхват талии"), + "waist_circumference": MessageLookupByLibrary.simpleMessage("Обхват талии"), "weight": MessageLookupByLibrary.simpleMessage("Вес"), "weight_chart": MessageLookupByLibrary.simpleMessage("График веса"), - "weight_measurements": - MessageLookupByLibrary.simpleMessage("Замер веса"), - "what_is_your_name": - MessageLookupByLibrary.simpleMessage("Как вас зовут?"), - "wrong_credentials": MessageLookupByLibrary.simpleMessage( - "Неверные данные пользователя"), - "your_blood_pressure": - MessageLookupByLibrary.simpleMessage("Ваше артериальное давление?"), - "your_favorite_sports": - MessageLookupByLibrary.simpleMessage("Ваши спортивные увлечения?"), + "weight_measurements": MessageLookupByLibrary.simpleMessage("Замер веса"), + "what_is_your_name": MessageLookupByLibrary.simpleMessage("Как вас зовут?"), + "wrong_credentials": MessageLookupByLibrary.simpleMessage("Неверные данные пользователя"), + "your_blood_pressure": MessageLookupByLibrary.simpleMessage("Ваше артериальное давление?"), + "your_favorite_sports": MessageLookupByLibrary.simpleMessage("Ваши спортивные увлечения?"), "your_gender": MessageLookupByLibrary.simpleMessage("Ваш пол?"), "your_height": MessageLookupByLibrary.simpleMessage("Ваш рост:"), "your_schedule": MessageLookupByLibrary.simpleMessage("Ваш режим дня?"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 8440a2b7..a7a8dfc8 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -18,17 +18,14 @@ class S { static S? _current; static S get current { - assert(_current != null, - 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); + assert(_current != null, 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); return _current!; } static const AppLocalizationDelegate delegate = AppLocalizationDelegate(); static Future load(Locale locale) { - final name = (locale.countryCode?.isEmpty ?? false) - ? locale.languageCode - : locale.toString(); + final name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString(); final localeName = Intl.canonicalizedLocale(name); return initializeMessages(localeName).then((_) { Intl.defaultLocale = localeName; @@ -41,8 +38,7 @@ class S { static S of(BuildContext context) { final instance = S.maybeOf(context); - assert(instance != null, - 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); + assert(instance != null, 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); return instance!; } @@ -1032,8 +1028,10 @@ class AppLocalizationDelegate extends LocalizationsDelegate { @override bool isSupported(Locale locale) => _isSupported(locale); + @override Future load(Locale locale) => S.load(locale); + @override bool shouldReload(AppLocalizationDelegate old) => false; diff --git a/lib/main.dart b/lib/main.dart index bab50f72..ce09857f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -11,8 +11,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:keyboard_dismisser/keyboard_dismisser.dart'; -var globalMessengerKey = GlobalKey(); - Future main() async { WidgetsFlutterBinding.ensureInitialized(); await di.init(); @@ -31,33 +29,6 @@ class MyApp extends StatelessWidget { child: KeyboardDismisser( child: MaterialApp.router( theme: ThemeHelper().themeData(), - // theme: ThemeData.light().copyWith( - // colorScheme: ColorScheme.fromSeed( - // seedColor: appTheme.blueA400, - // brightness: Brightness.light, - // ), - // appBarTheme: AppBarTheme( - // systemOverlayStyle: SystemUiOverlayStyle.light.copyWith( - // statusBarIconBrightness: Brightness.dark, - // systemNavigationBarIconBrightness: Brightness.dark, - // systemNavigationBarColor: ThemeData.light().scaffoldBackgroundColor, - // ), - // ), - // ), - // darkTheme: ThemeData.dark().copyWith( - // colorScheme: ColorScheme.fromSeed( - // seedColor: appTheme.blueA400, - // brightness: Brightness.dark, - // ), - // appBarTheme: AppBarTheme( - // systemOverlayStyle: SystemUiOverlayStyle.dark.copyWith( - // statusBarIconBrightness: Brightness.light, - // systemNavigationBarIconBrightness: Brightness.light, - // systemNavigationBarColor: ThemeData.dark().scaffoldBackgroundColor, - // ), - // ), - // ), - themeMode: ThemeMode.system, routerConfig: AppRouter.appRouter, debugShowCheckedModeBanner: false, localizationsDelegates: const [ diff --git a/lib/old/auth/auth_screen/auth_screen.dart b/lib/old/auth/auth_screen/auth_screen.dart index fc69d52d..f84875af 100644 --- a/lib/old/auth/auth_screen/auth_screen.dart +++ b/lib/old/auth/auth_screen/auth_screen.dart @@ -216,7 +216,7 @@ class _AuthScreenState extends State { List validateFields(String email, String password) { final s = S.of(context); - + List errors = []; if (!isEmail(email)) { diff --git a/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart b/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart index c1ab8e0f..3491e60f 100644 --- a/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart +++ b/lib/old/diets/diet_create_screen/bloc/diet_create_bloc.dart @@ -11,7 +11,8 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -part 'diet_create_event.dart';part 'diet_create_state.dart'; +part 'diet_create_event.dart'; +part 'diet_create_state.dart'; /// A bloc that manages the state of a DietCreate according to the event that is dispatched to it. class DietCreateBloc extends Bloc { diff --git a/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart b/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart index 5069b0ad..1fd4610a 100644 --- a/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart +++ b/lib/old/diets/diet_edit_screen/bloc/diet_edit_bloc.dart @@ -11,7 +11,8 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -part 'diet_edit_event.dart';part 'diet_edit_state.dart'; +part 'diet_edit_event.dart'; +part 'diet_edit_state.dart'; /// A bloc that manages the state of a DietEdit according to the event that is dispatched to it. class DietEditBloc extends Bloc { diff --git a/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart b/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart index e06469f5..69bd3d7b 100644 --- a/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart +++ b/lib/old/diets/diet_select_screen/bloc/diet_select_bloc.dart @@ -13,7 +13,8 @@ import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; -part 'diet_select_event.dart';part 'diet_select_state.dart'; +part 'diet_select_event.dart'; +part 'diet_select_state.dart'; /// A bloc that manages the state of a DietSelect according to the event that is dispatched to it. class DietSelectBloc extends Bloc { diff --git a/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart b/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart index 78ed67fd..91026abc 100644 --- a/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart +++ b/lib/old/diets/diet_show_screen/bloc/diet_show_bloc.dart @@ -11,7 +11,8 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -part 'diet_show_event.dart';part 'diet_show_state.dart'; +part 'diet_show_event.dart'; +part 'diet_show_state.dart'; /// A bloc that manages the state of a Diet according to the event that is dispatched to it. class DietBloc extends Bloc { diff --git a/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart b/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart index b0b4f10f..15e80977 100644 --- a/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart +++ b/lib/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart @@ -1,4 +1,5 @@ import 'dart:async'; + import 'package:dio/dio.dart'; import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/const.dart'; diff --git a/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart b/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart index 4869330e..553e301d 100644 --- a/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart +++ b/lib/old/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart @@ -11,10 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; - - -part 'blog_post_edit_event.dart'; -part 'blog_post_edit_state.dart'; +part 'blog_post_edit_event.dart';part 'blog_post_edit_state.dart'; /// A bloc that manages the state of a BlogPostEdit according to the event that is dispatched to it. class BlogPostEditBloc extends Bloc { diff --git a/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart b/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart index 223c6ce6..694df40c 100644 --- a/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart +++ b/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart @@ -1,7 +1,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/old/feed/blog_post_screen/widgets/comment_widget.dart b/lib/old/feed/blog_post_screen/widgets/comment_widget.dart index b47f34d6..78db0293 100644 --- a/lib/old/feed/blog_post_screen/widgets/comment_widget.dart +++ b/lib/old/feed/blog_post_screen/widgets/comment_widget.dart @@ -3,7 +3,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/utils/image_constant.dart'; - import 'package:eatvio_app/old/feed/blog_post_screen/models/comment_model.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; diff --git a/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart b/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart index 58310e30..3c3817d4 100644 --- a/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart +++ b/lib/old/glossary/glossary_screen/bloc/glossary_screen_bloc.dart @@ -12,7 +12,8 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -part 'glossary_screen_event.dart';part 'glossary_screen_state.dart'; +part 'glossary_screen_event.dart'; +part 'glossary_screen_state.dart'; /// A bloc that manages the state of a Glossary according to the event that is dispatched to it. class GlossaryBloc extends Bloc { diff --git a/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart b/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart index 1b4f5727..fa446a7c 100644 --- a/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart +++ b/lib/old/plans/plan_create_screen/bloc/plan_create_bloc.dart @@ -11,7 +11,8 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -part 'plan_create_event.dart';part 'plan_create_state.dart'; +part 'plan_create_event.dart'; +part 'plan_create_state.dart'; /// A bloc that manages the state of a PlanCreate according to the event that is dispatched to it. class PlanCreateBloc extends Bloc { diff --git a/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart b/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart index d60c7df8..ca78a970 100644 --- a/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart +++ b/lib/old/plans/plan_edit_screen/bloc/plan_edit_bloc.dart @@ -11,7 +11,8 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -part 'plan_edit_event.dart';part 'plan_edit_state.dart'; +part 'plan_edit_event.dart'; +part 'plan_edit_state.dart'; /// A bloc that manages the state of a PlanEdit according to the event that is dispatched to it. class PlanEditBloc extends Bloc { diff --git a/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart b/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart index e471fcc5..a08a00f2 100644 --- a/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart +++ b/lib/old/plans/plan_select_screen/bloc/plan_select_bloc.dart @@ -13,7 +13,8 @@ import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; -part 'plan_select_event.dart';part 'plan_select_state.dart'; +part 'plan_select_event.dart'; +part 'plan_select_state.dart'; /// A bloc that manages the state of a PlanSelect according to the event that is dispatched to it. class PlanSelectBloc extends Bloc { diff --git a/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart b/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart index 9c7ea9ce..36cdea7f 100644 --- a/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart +++ b/lib/old/plans/plan_show_screen/bloc/plan_show_bloc.dart @@ -11,7 +11,8 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; -part 'plan_show_event.dart';part 'plan_show_state.dart'; +part 'plan_show_event.dart'; +part 'plan_show_state.dart'; /// A bloc that manages the state of a Plan according to the event that is dispatched to it. class PlanBloc extends Bloc { From 2dcb677c7c003c9f84c927ef25153b877a0754f5 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 23 Sep 2024 15:17:14 +0300 Subject: [PATCH 22/31] feat(settings): add settings screen, general info, font --- lib/app_router.dart | 38 ++ .../initialization_state.freezed.dart | 94 ++-- lib/core/models/pagination_model.freezed.dart | 169 +++++--- lib/core/models/pagination_model.g.dart | 13 +- .../selection_popup_model.freezed.dart | 52 ++- .../new_messages_state.freezed.dart | 90 ++-- .../notifications_state.freezed.dart | 157 ++++--- .../models/calendar_model.freezed.dart | 89 ++-- .../calendar/models/calendar_model.g.dart | 13 +- .../bloc/calendar_state.freezed.dart | 95 ++-- .../calendar/services/calendar_service.g.dart | 8 +- .../models/chat_message_model.freezed.dart | 71 +-- .../chat/models/chat_message_model.g.dart | 8 +- .../models/chat_messages_model.freezed.dart | 68 ++- .../chat/models/chat_messages_model.g.dart | 12 +- .../chat/models/chat_meta_model.freezed.dart | 52 ++- .../chat/models/chat_meta_model.g.dart | 6 +- .../chat/models/chat_room_model.freezed.dart | 76 ++-- .../chat/models/chat_room_model.g.dart | 12 +- .../chat_room_preview_model.freezed.dart | 332 ++++++++------ .../models/chat_room_preview_model.g.dart | 41 +- .../chat_room_settings_model.freezed.dart | 76 ++-- .../models/chat_room_settings_model.g.dart | 8 +- .../chat/models/chat_user_model.freezed.dart | 76 ++-- .../chat/models/chat_user_model.g.dart | 6 +- .../models/websocket_info_model.freezed.dart | 79 ++-- .../chat/models/websocket_info_model.g.dart | 8 +- .../chat_room_state.freezed.dart | 169 +++++--- .../chat_select_state.freezed.dart | 100 +++-- .../chat/services/chat_service.g.dart | 7 +- .../feed/models/comment_model.freezed.dart | 147 ++++--- lib/features/feed/models/comment_model.g.dart | 20 +- .../comments_state.freezed.dart | 83 ++-- .../menu/presentation/pages/menu_screen.dart | 2 +- .../presentation/pages/profile_screen.dart | 2 +- .../models/recipe_tag_model.freezed.dart | 135 +++--- .../recipes/models/recipe_tag_model.g.dart | 17 +- .../models/location_model.freezed.dart | 69 ++- .../registration/models/location_model.g.dart | 9 +- .../user_registration_model.freezed.dart | 181 ++++---- .../models/user_registration_model.g.dart | 11 +- .../registration_state.freezed.dart | 40 +- .../pages/city_of_living_screen.dart | 3 +- .../pages/date_of_birth_screen.dart | 7 +- .../presentation/pages/name_screen.dart | 2 +- .../pages/registration_screen.dart | 2 +- .../services/registration_service.g.dart | 7 +- .../pages/general_info_screen.dart | 83 ++++ .../presentation/pages/other_info_screen.dart | 15 + .../pages/physical_activity_screen.dart | 15 + .../pages/physical_form_screen.dart | 15 + .../presentation/pages/pressure_screen.dart | 15 + .../presentation/pages/settings_screen.dart | 409 ++++++++++++++++++ lib/generated/intl/messages_all.dart | 8 +- lib/generated/intl/messages_en.dart | 157 ++++--- lib/generated/l10n.dart | 26 +- lib/l10n/intl_en.arb | 3 +- lib/old/auth/auth_screen/auth_screen.dart | 2 +- .../bloc/my_profile_bloc.dart | 2 + lib/theme/theme_helper.dart | 46 +- pubspec.yaml | 2 +- 61 files changed, 2429 insertions(+), 1131 deletions(-) create mode 100644 lib/features/settings/presentation/pages/general_info_screen.dart create mode 100644 lib/features/settings/presentation/pages/other_info_screen.dart create mode 100644 lib/features/settings/presentation/pages/physical_activity_screen.dart create mode 100644 lib/features/settings/presentation/pages/physical_form_screen.dart create mode 100644 lib/features/settings/presentation/pages/pressure_screen.dart create mode 100644 lib/features/settings/presentation/pages/settings_screen.dart diff --git a/lib/app_router.dart b/lib/app_router.dart index e0f60978..7d6fe865 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -22,6 +22,12 @@ import 'package:eatvio_app/features/recipes/presentation/pages/about_recipes_scr import 'package:eatvio_app/features/recipes/presentation/pages/recipe_create_screen.dart'; import 'package:eatvio_app/features/recipes/presentation/pages/recipe_edit_screen.dart'; import 'package:eatvio_app/features/registration/presentation/pages/registration_screen.dart'; +import 'package:eatvio_app/features/settings/presentation/pages/general_info_screen.dart'; +import 'package:eatvio_app/features/settings/presentation/pages/other_info_screen.dart'; +import 'package:eatvio_app/features/settings/presentation/pages/physical_activity_screen.dart'; +import 'package:eatvio_app/features/settings/presentation/pages/physical_form_screen.dart'; +import 'package:eatvio_app/features/settings/presentation/pages/pressure_screen.dart'; +import 'package:eatvio_app/features/settings/presentation/pages/settings_screen.dart'; import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart'; import 'package:eatvio_app/old/diets/diet_create_screen/diet_create_screen.dart'; import 'package:eatvio_app/old/diets/diet_select_screen/diet_select_screen.dart'; @@ -159,6 +165,38 @@ class AppRouter { name: 'chatScreen', builder: (context, state) => ChatScreen(chatId: state.extra as String), ), + GoRoute( + path: '/settings-screen', + name: 'settingsScreen', + builder: (context, state) => SettingsScreen(), + routes: [ + GoRoute( + path: 'general-info-screen', + name: 'generalInfoScreen', + builder: (context, state) => GeneralInfoScreen(), + ), + GoRoute( + path: 'other-info-screen', + name: 'otherInfoScreen', + builder: (context, state) => OtherInfoScreen(), + ), + GoRoute( + path: 'physical-activity-screen', + name: 'physicalActivityScreen', + builder: (context, state) => PhysicalActivityScreen(), + ), + GoRoute( + path: 'physical-form-screen', + name: 'physicalFormScreen', + builder: (context, state) => PhysicalFormScreen(), + ), + GoRoute( + path: 'pressure-screen', + name: 'pressureScreen', + builder: (context, state) => PressureScreen(), + ), + ], + ), GoRoute( path: '/my-settings-screen', name: 'mySettingsScreen', diff --git a/lib/core/initialization_cubit/initialization_state.freezed.dart b/lib/core/initialization_cubit/initialization_state.freezed.dart index d9ece2ef..b0535c68 100644 --- a/lib/core/initialization_cubit/initialization_state.freezed.dart +++ b/lib/core/initialization_cubit/initialization_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$InitializationState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,17 +70,18 @@ mixin _$InitializationState { /// @nodoc abstract class $InitializationStateCopyWith<$Res> { - factory $InitializationStateCopyWith(InitializationState value, $Res Function(InitializationState) then) = + factory $InitializationStateCopyWith( + InitializationState value, $Res Function(InitializationState) then) = _$InitializationStateCopyWithImpl<$Res, InitializationState>; } /// @nodoc -class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> implements $InitializationStateCopyWith<$Res> { +class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> + implements $InitializationStateCopyWith<$Res> { _$InitializationStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -91,14 +91,18 @@ class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> /// @nodoc abstract class _$$InitializationStateImplCopyWith<$Res> { - factory _$$InitializationStateImplCopyWith(_$InitializationStateImpl value, $Res Function(_$InitializationStateImpl) then) = + factory _$$InitializationStateImplCopyWith(_$InitializationStateImpl value, + $Res Function(_$InitializationStateImpl) then) = __$$InitializationStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitializationStateImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateImpl> +class __$$InitializationStateImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateImpl> implements _$$InitializationStateImplCopyWith<$Res> { - __$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value, $Res Function(_$InitializationStateImpl) _then) : super(_value, _then); + __$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value, + $Res Function(_$InitializationStateImpl) _then) + : super(_value, _then); /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @@ -116,7 +120,9 @@ class _$InitializationStateImpl implements _InitializationState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InitializationStateImpl); } @override @@ -203,14 +209,20 @@ abstract class _InitializationState implements InitializationState { /// @nodoc abstract class _$$InitializationStateLoadingImplCopyWith<$Res> { - factory _$$InitializationStateLoadingImplCopyWith(_$InitializationStateLoadingImpl value, $Res Function(_$InitializationStateLoadingImpl) then) = + factory _$$InitializationStateLoadingImplCopyWith( + _$InitializationStateLoadingImpl value, + $Res Function(_$InitializationStateLoadingImpl) then) = __$$InitializationStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$InitializationStateLoadingImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateLoadingImpl> +class __$$InitializationStateLoadingImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateLoadingImpl> implements _$$InitializationStateLoadingImplCopyWith<$Res> { - __$$InitializationStateLoadingImplCopyWithImpl(_$InitializationStateLoadingImpl _value, $Res Function(_$InitializationStateLoadingImpl) _then) + __$$InitializationStateLoadingImplCopyWithImpl( + _$InitializationStateLoadingImpl _value, + $Res Function(_$InitializationStateLoadingImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -229,7 +241,9 @@ class _$InitializationStateLoadingImpl implements InitializationStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InitializationStateLoadingImpl); } @override @@ -316,17 +330,22 @@ abstract class InitializationStateLoading implements InitializationState { /// @nodoc abstract class _$$InitializationStateSuccessImplCopyWith<$Res> { - factory _$$InitializationStateSuccessImplCopyWith(_$InitializationStateSuccessImpl value, $Res Function(_$InitializationStateSuccessImpl) then) = + factory _$$InitializationStateSuccessImplCopyWith( + _$InitializationStateSuccessImpl value, + $Res Function(_$InitializationStateSuccessImpl) then) = __$$InitializationStateSuccessImplCopyWithImpl<$Res>; - @useResult $Res call({PusherChannelsClient client}); } /// @nodoc -class __$$InitializationStateSuccessImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateSuccessImpl> +class __$$InitializationStateSuccessImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateSuccessImpl> implements _$$InitializationStateSuccessImplCopyWith<$Res> { - __$$InitializationStateSuccessImplCopyWithImpl(_$InitializationStateSuccessImpl _value, $Res Function(_$InitializationStateSuccessImpl) _then) + __$$InitializationStateSuccessImplCopyWithImpl( + _$InitializationStateSuccessImpl _value, + $Res Function(_$InitializationStateSuccessImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -361,7 +380,9 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$InitializationStateSuccessImpl && (identical(other.client, client) || other.client == client)); + (other.runtimeType == runtimeType && + other is _$InitializationStateSuccessImpl && + (identical(other.client, client) || other.client == client)); } @override @@ -372,8 +393,9 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => - __$$InitializationStateSuccessImplCopyWithImpl<_$InitializationStateSuccessImpl>(this, _$identity); + _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> + get copyWith => __$$InitializationStateSuccessImplCopyWithImpl< + _$InitializationStateSuccessImpl>(this, _$identity); @override @optionalTypeArgs @@ -451,29 +473,37 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { } abstract class InitializationStateSuccess implements InitializationState { - const factory InitializationStateSuccess({required final PusherChannelsClient client}) = _$InitializationStateSuccessImpl; + const factory InitializationStateSuccess( + {required final PusherChannelsClient client}) = + _$InitializationStateSuccessImpl; PusherChannelsClient get client; /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => throw _privateConstructorUsedError; + _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$InitializationStateErrorImplCopyWith<$Res> { - factory _$$InitializationStateErrorImplCopyWith(_$InitializationStateErrorImpl value, $Res Function(_$InitializationStateErrorImpl) then) = + factory _$$InitializationStateErrorImplCopyWith( + _$InitializationStateErrorImpl value, + $Res Function(_$InitializationStateErrorImpl) then) = __$$InitializationStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$InitializationStateErrorImplCopyWithImpl<$Res> extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateErrorImpl> +class __$$InitializationStateErrorImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateErrorImpl> implements _$$InitializationStateErrorImplCopyWith<$Res> { - __$$InitializationStateErrorImplCopyWithImpl(_$InitializationStateErrorImpl _value, $Res Function(_$InitializationStateErrorImpl) _then) + __$$InitializationStateErrorImplCopyWithImpl( + _$InitializationStateErrorImpl _value, + $Res Function(_$InitializationStateErrorImpl) _then) : super(_value, _then); /// Create a copy of InitializationState @@ -510,7 +540,8 @@ class _$InitializationStateErrorImpl implements InitializationStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitializationStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -521,8 +552,9 @@ class _$InitializationStateErrorImpl implements InitializationStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => - __$$InitializationStateErrorImplCopyWithImpl<_$InitializationStateErrorImpl>(this, _$identity); + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> + get copyWith => __$$InitializationStateErrorImplCopyWithImpl< + _$InitializationStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -600,12 +632,14 @@ class _$InitializationStateErrorImpl implements InitializationStateError { } abstract class InitializationStateError implements InitializationState { - const factory InitializationStateError({required final String errorMessage}) = _$InitializationStateErrorImpl; + const factory InitializationStateError({required final String errorMessage}) = + _$InitializationStateErrorImpl; String get errorMessage; /// Create a copy of InitializationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/core/models/pagination_model.freezed.dart b/lib/core/models/pagination_model.freezed.dart index 692c6ef3..35f2c080 100644 --- a/lib/core/models/pagination_model.freezed.dart +++ b/lib/core/models/pagination_model.freezed.dart @@ -22,13 +22,10 @@ Links _$LinksFromJson(Map json) { mixin _$Links { @JsonKey(name: "first") String get first => throw _privateConstructorUsedError; - @JsonKey(name: "last") String get last => throw _privateConstructorUsedError; - @JsonKey(name: "prev") dynamic get prev => throw _privateConstructorUsedError; - @JsonKey(name: "next") dynamic get next => throw _privateConstructorUsedError; @@ -43,20 +40,23 @@ mixin _$Links { /// @nodoc abstract class $LinksCopyWith<$Res> { - factory $LinksCopyWith(Links value, $Res Function(Links) then) = _$LinksCopyWithImpl<$Res, Links>; - + factory $LinksCopyWith(Links value, $Res Function(Links) then) = + _$LinksCopyWithImpl<$Res, Links>; @useResult $Res call( - {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, + @JsonKey(name: "last") String last, + @JsonKey(name: "prev") dynamic prev, + @JsonKey(name: "next") dynamic next}); } /// @nodoc -class _$LinksCopyWithImpl<$Res, $Val extends Links> implements $LinksCopyWith<$Res> { +class _$LinksCopyWithImpl<$Res, $Val extends Links> + implements $LinksCopyWith<$Res> { _$LinksCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -93,17 +93,25 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links> implements $LinksCopyWith<$R /// @nodoc abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$Res> { - factory _$$LinksImplCopyWith(_$LinksImpl value, $Res Function(_$LinksImpl) then) = __$$LinksImplCopyWithImpl<$Res>; - + factory _$$LinksImplCopyWith( + _$LinksImpl value, $Res Function(_$LinksImpl) then) = + __$$LinksImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey(name: "first") String first, @JsonKey(name: "last") String last, @JsonKey(name: "prev") dynamic prev, @JsonKey(name: "next") dynamic next}); + {@JsonKey(name: "first") String first, + @JsonKey(name: "last") String last, + @JsonKey(name: "prev") dynamic prev, + @JsonKey(name: "next") dynamic next}); } /// @nodoc -class __$$LinksImplCopyWithImpl<$Res> extends _$LinksCopyWithImpl<$Res, _$LinksImpl> implements _$$LinksImplCopyWith<$Res> { - __$$LinksImplCopyWithImpl(_$LinksImpl _value, $Res Function(_$LinksImpl) _then) : super(_value, _then); +class __$$LinksImplCopyWithImpl<$Res> + extends _$LinksCopyWithImpl<$Res, _$LinksImpl> + implements _$$LinksImplCopyWith<$Res> { + __$$LinksImplCopyWithImpl( + _$LinksImpl _value, $Res Function(_$LinksImpl) _then) + : super(_value, _then); /// Create a copy of Links /// with the given fields replaced by the non-null parameter values. @@ -145,7 +153,8 @@ class _$LinksImpl implements _Links { @JsonKey(name: "prev") required this.prev, @JsonKey(name: "next") required this.next}); - factory _$LinksImpl.fromJson(Map json) => _$$LinksImplFromJson(json); + factory _$LinksImpl.fromJson(Map json) => + _$$LinksImplFromJson(json); @override @JsonKey(name: "first") @@ -178,14 +187,20 @@ class _$LinksImpl implements _Links { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, first, last, const DeepCollectionEquality().hash(prev), const DeepCollectionEquality().hash(next)); + int get hashCode => Object.hash( + runtimeType, + first, + last, + const DeepCollectionEquality().hash(prev), + const DeepCollectionEquality().hash(next)); /// Create a copy of Links /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => + __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity); @override Map toJson() { @@ -207,15 +222,12 @@ abstract class _Links implements Links { @override @JsonKey(name: "first") String get first; - @override @JsonKey(name: "last") String get last; - @override @JsonKey(name: "prev") dynamic get prev; - @override @JsonKey(name: "next") dynamic get next; @@ -224,7 +236,8 @@ abstract class _Links implements Links { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LinksImplCopyWith<_$LinksImpl> get copyWith => throw _privateConstructorUsedError; + _$$LinksImplCopyWith<_$LinksImpl> get copyWith => + throw _privateConstructorUsedError; } Meta _$MetaFromJson(Map json) { @@ -235,25 +248,18 @@ Meta _$MetaFromJson(Map json) { mixin _$Meta { @JsonKey(name: "current_page") int get currentPage => throw _privateConstructorUsedError; - @JsonKey(name: "from") dynamic get from => throw _privateConstructorUsedError; - @JsonKey(name: "last_page") int get lastPage => throw _privateConstructorUsedError; - @JsonKey(name: "links") List get links => throw _privateConstructorUsedError; - @JsonKey(name: "path") String? get path => throw _privateConstructorUsedError; - @JsonKey(name: "per_page") int get perPage => throw _privateConstructorUsedError; - @JsonKey(name: "to") dynamic get to => throw _privateConstructorUsedError; - @JsonKey(name: "total") int get total => throw _privateConstructorUsedError; @@ -268,8 +274,8 @@ mixin _$Meta { /// @nodoc abstract class $MetaCopyWith<$Res> { - factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = _$MetaCopyWithImpl<$Res, Meta>; - + factory $MetaCopyWith(Meta value, $Res Function(Meta) then) = + _$MetaCopyWithImpl<$Res, Meta>; @useResult $Res call( {@JsonKey(name: "current_page") int currentPage, @@ -283,12 +289,12 @@ abstract class $MetaCopyWith<$Res> { } /// @nodoc -class _$MetaCopyWithImpl<$Res, $Val extends Meta> implements $MetaCopyWith<$Res> { +class _$MetaCopyWithImpl<$Res, $Val extends Meta> + implements $MetaCopyWith<$Res> { _$MetaCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -345,8 +351,9 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> implements $MetaCopyWith<$Res> /// @nodoc abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { - factory _$$MetaImplCopyWith(_$MetaImpl value, $Res Function(_$MetaImpl) then) = __$$MetaImplCopyWithImpl<$Res>; - + factory _$$MetaImplCopyWith( + _$MetaImpl value, $Res Function(_$MetaImpl) then) = + __$$MetaImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -361,8 +368,11 @@ abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> { } /// @nodoc -class __$$MetaImplCopyWithImpl<$Res> extends _$MetaCopyWithImpl<$Res, _$MetaImpl> implements _$$MetaImplCopyWith<$Res> { - __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) : super(_value, _then); +class __$$MetaImplCopyWithImpl<$Res> + extends _$MetaCopyWithImpl<$Res, _$MetaImpl> + implements _$$MetaImplCopyWith<$Res> { + __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then) + : super(_value, _then); /// Create a copy of Meta /// with the given fields replaced by the non-null parameter values. @@ -429,7 +439,8 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "total") required this.total}) : _links = links; - factory _$MetaImpl.fromJson(Map json) => _$$MetaImplFromJson(json); + factory _$MetaImpl.fromJson(Map json) => + _$$MetaImplFromJson(json); @override @JsonKey(name: "current_page") @@ -441,7 +452,6 @@ class _$MetaImpl implements _Meta { @JsonKey(name: "last_page") final int lastPage; final List _links; - @override @JsonKey(name: "links") List get links { @@ -473,9 +483,11 @@ class _$MetaImpl implements _Meta { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MetaImpl && - (identical(other.currentPage, currentPage) || other.currentPage == currentPage) && + (identical(other.currentPage, currentPage) || + other.currentPage == currentPage) && const DeepCollectionEquality().equals(other.from, from) && - (identical(other.lastPage, lastPage) || other.lastPage == lastPage) && + (identical(other.lastPage, lastPage) || + other.lastPage == lastPage) && const DeepCollectionEquality().equals(other._links, _links) && (identical(other.path, path) || other.path == path) && (identical(other.perPage, perPage) || other.perPage == perPage) && @@ -485,15 +497,24 @@ class _$MetaImpl implements _Meta { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, currentPage, const DeepCollectionEquality().hash(from), lastPage, const DeepCollectionEquality().hash(_links), - path, perPage, const DeepCollectionEquality().hash(to), total); + int get hashCode => Object.hash( + runtimeType, + currentPage, + const DeepCollectionEquality().hash(from), + lastPage, + const DeepCollectionEquality().hash(_links), + path, + perPage, + const DeepCollectionEquality().hash(to), + total); /// Create a copy of Meta /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => + __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity); @override Map toJson() { @@ -519,31 +540,24 @@ abstract class _Meta implements Meta { @override @JsonKey(name: "current_page") int get currentPage; - @override @JsonKey(name: "from") dynamic get from; - @override @JsonKey(name: "last_page") int get lastPage; - @override @JsonKey(name: "links") List get links; - @override @JsonKey(name: "path") String? get path; - @override @JsonKey(name: "per_page") int get perPage; - @override @JsonKey(name: "to") dynamic get to; - @override @JsonKey(name: "total") int get total; @@ -552,7 +566,8 @@ abstract class _Meta implements Meta { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$MetaImplCopyWith<_$MetaImpl> get copyWith => throw _privateConstructorUsedError; + _$$MetaImplCopyWith<_$MetaImpl> get copyWith => + throw _privateConstructorUsedError; } Link _$LinkFromJson(Map json) { @@ -563,10 +578,8 @@ Link _$LinkFromJson(Map json) { mixin _$Link { @JsonKey(name: "url") String? get url => throw _privateConstructorUsedError; - @JsonKey(name: "label") String? get label => throw _privateConstructorUsedError; - @JsonKey(name: "active") bool? get active => throw _privateConstructorUsedError; @@ -581,19 +594,22 @@ mixin _$Link { /// @nodoc abstract class $LinkCopyWith<$Res> { - factory $LinkCopyWith(Link value, $Res Function(Link) then) = _$LinkCopyWithImpl<$Res, Link>; - + factory $LinkCopyWith(Link value, $Res Function(Link) then) = + _$LinkCopyWithImpl<$Res, Link>; @useResult - $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String? label, @JsonKey(name: "active") bool? active}); + $Res call( + {@JsonKey(name: "url") String? url, + @JsonKey(name: "label") String? label, + @JsonKey(name: "active") bool? active}); } /// @nodoc -class _$LinkCopyWithImpl<$Res, $Val extends Link> implements $LinkCopyWith<$Res> { +class _$LinkCopyWithImpl<$Res, $Val extends Link> + implements $LinkCopyWith<$Res> { _$LinkCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -625,16 +641,23 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link> implements $LinkCopyWith<$Res> /// @nodoc abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> { - factory _$$LinkImplCopyWith(_$LinkImpl value, $Res Function(_$LinkImpl) then) = __$$LinkImplCopyWithImpl<$Res>; - + factory _$$LinkImplCopyWith( + _$LinkImpl value, $Res Function(_$LinkImpl) then) = + __$$LinkImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "url") String? url, @JsonKey(name: "label") String? label, @JsonKey(name: "active") bool? active}); + $Res call( + {@JsonKey(name: "url") String? url, + @JsonKey(name: "label") String? label, + @JsonKey(name: "active") bool? active}); } /// @nodoc -class __$$LinkImplCopyWithImpl<$Res> extends _$LinkCopyWithImpl<$Res, _$LinkImpl> implements _$$LinkImplCopyWith<$Res> { - __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) : super(_value, _then); +class __$$LinkImplCopyWithImpl<$Res> + extends _$LinkCopyWithImpl<$Res, _$LinkImpl> + implements _$$LinkImplCopyWith<$Res> { + __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then) + : super(_value, _then); /// Create a copy of Link /// with the given fields replaced by the non-null parameter values. @@ -665,9 +688,13 @@ class __$$LinkImplCopyWithImpl<$Res> extends _$LinkCopyWithImpl<$Res, _$LinkImpl /// @nodoc @JsonSerializable() class _$LinkImpl implements _Link { - const _$LinkImpl({@JsonKey(name: "url") this.url, @JsonKey(name: "label") this.label, @JsonKey(name: "active") this.active}); + const _$LinkImpl( + {@JsonKey(name: "url") this.url, + @JsonKey(name: "label") this.label, + @JsonKey(name: "active") this.active}); - factory _$LinkImpl.fromJson(Map json) => _$$LinkImplFromJson(json); + factory _$LinkImpl.fromJson(Map json) => + _$$LinkImplFromJson(json); @override @JsonKey(name: "url") @@ -703,7 +730,8 @@ class _$LinkImpl implements _Link { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => + __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity); @override Map toJson() { @@ -714,19 +742,19 @@ class _$LinkImpl implements _Link { } abstract class _Link implements Link { - const factory _Link({@JsonKey(name: "url") final String? url, @JsonKey(name: "label") final String? label, @JsonKey(name: "active") final bool? active}) = - _$LinkImpl; + const factory _Link( + {@JsonKey(name: "url") final String? url, + @JsonKey(name: "label") final String? label, + @JsonKey(name: "active") final bool? active}) = _$LinkImpl; factory _Link.fromJson(Map json) = _$LinkImpl.fromJson; @override @JsonKey(name: "url") String? get url; - @override @JsonKey(name: "label") String? get label; - @override @JsonKey(name: "active") bool? get active; @@ -735,5 +763,6 @@ abstract class _Link implements Link { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LinkImplCopyWith<_$LinkImpl> get copyWith => throw _privateConstructorUsedError; + _$$LinkImplCopyWith<_$LinkImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/core/models/pagination_model.g.dart b/lib/core/models/pagination_model.g.dart index d0baeab8..610d19b2 100644 --- a/lib/core/models/pagination_model.g.dart +++ b/lib/core/models/pagination_model.g.dart @@ -13,7 +13,8 @@ _$LinksImpl _$$LinksImplFromJson(Map json) => _$LinksImpl( next: json['next'], ); -Map _$$LinksImplToJson(_$LinksImpl instance) => { +Map _$$LinksImplToJson(_$LinksImpl instance) => + { 'first': instance.first, 'last': instance.last, 'prev': instance.prev, @@ -24,14 +25,17 @@ _$MetaImpl _$$MetaImplFromJson(Map json) => _$MetaImpl( currentPage: (json['current_page'] as num).toInt(), from: json['from'], lastPage: (json['last_page'] as num).toInt(), - links: (json['links'] as List).map((e) => Link.fromJson(e as Map)).toList(), + links: (json['links'] as List) + .map((e) => Link.fromJson(e as Map)) + .toList(), path: json['path'] as String?, perPage: (json['per_page'] as num).toInt(), to: json['to'], total: (json['total'] as num).toInt(), ); -Map _$$MetaImplToJson(_$MetaImpl instance) => { +Map _$$MetaImplToJson(_$MetaImpl instance) => + { 'current_page': instance.currentPage, 'from': instance.from, 'last_page': instance.lastPage, @@ -48,7 +52,8 @@ _$LinkImpl _$$LinkImplFromJson(Map json) => _$LinkImpl( active: json['active'] as bool?, ); -Map _$$LinkImplToJson(_$LinkImpl instance) => { +Map _$$LinkImplToJson(_$LinkImpl instance) => + { 'url': instance.url, 'label': instance.label, 'active': instance.active, diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart index 46367fd1..97ab368c 100644 --- a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart +++ b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart @@ -17,35 +17,33 @@ final _privateConstructorUsedError = UnsupportedError( /// @nodoc mixin _$SelectionPopupModel { int? get id => throw _privateConstructorUsedError; - String get title => throw _privateConstructorUsedError; - dynamic get value => throw _privateConstructorUsedError; - bool get isSelected => throw _privateConstructorUsedError; /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $SelectionPopupModelCopyWith get copyWith => throw _privateConstructorUsedError; + $SelectionPopupModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $SelectionPopupModelCopyWith<$Res> { - factory $SelectionPopupModelCopyWith(SelectionPopupModel value, $Res Function(SelectionPopupModel) then) = + factory $SelectionPopupModelCopyWith( + SelectionPopupModel value, $Res Function(SelectionPopupModel) then) = _$SelectionPopupModelCopyWithImpl<$Res, SelectionPopupModel>; - @useResult $Res call({int? id, String title, dynamic value, bool isSelected}); } /// @nodoc -class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> implements $SelectionPopupModelCopyWith<$Res> { +class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> + implements $SelectionPopupModelCopyWith<$Res> { _$SelectionPopupModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -81,19 +79,23 @@ class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel> } /// @nodoc -abstract class _$$SelectionPopupModelImplCopyWith<$Res> implements $SelectionPopupModelCopyWith<$Res> { - factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value, $Res Function(_$SelectionPopupModelImpl) then) = +abstract class _$$SelectionPopupModelImplCopyWith<$Res> + implements $SelectionPopupModelCopyWith<$Res> { + factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value, + $Res Function(_$SelectionPopupModelImpl) then) = __$$SelectionPopupModelImplCopyWithImpl<$Res>; - @override @useResult $Res call({int? id, String title, dynamic value, bool isSelected}); } /// @nodoc -class __$$SelectionPopupModelImplCopyWithImpl<$Res> extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl> +class __$$SelectionPopupModelImplCopyWithImpl<$Res> + extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl> implements _$$SelectionPopupModelImplCopyWith<$Res> { - __$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value, $Res Function(_$SelectionPopupModelImpl) _then) : super(_value, _then); + __$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value, + $Res Function(_$SelectionPopupModelImpl) _then) + : super(_value, _then); /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @@ -129,7 +131,8 @@ class __$$SelectionPopupModelImplCopyWithImpl<$Res> extends _$SelectionPopupMode /// @nodoc class _$SelectionPopupModelImpl implements _SelectionPopupModel { - const _$SelectionPopupModelImpl({this.id, required this.title, this.value, this.isSelected = false}); + const _$SelectionPopupModelImpl( + {this.id, required this.title, this.value, this.isSelected = false}); @override final int? id; @@ -154,11 +157,13 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && const DeepCollectionEquality().equals(other.value, value) && - (identical(other.isSelected, isSelected) || other.isSelected == isSelected)); + (identical(other.isSelected, isSelected) || + other.isSelected == isSelected)); } @override - int get hashCode => Object.hash(runtimeType, id, title, const DeepCollectionEquality().hash(value), isSelected); + int get hashCode => Object.hash(runtimeType, id, title, + const DeepCollectionEquality().hash(value), isSelected); /// Create a copy of SelectionPopupModel /// with the given fields replaced by the non-null parameter values. @@ -166,21 +171,23 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { @override @pragma('vm:prefer-inline') _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => - __$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>(this, _$identity); + __$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>( + this, _$identity); } abstract class _SelectionPopupModel implements SelectionPopupModel { - const factory _SelectionPopupModel({final int? id, required final String title, final dynamic value, final bool isSelected}) = _$SelectionPopupModelImpl; + const factory _SelectionPopupModel( + {final int? id, + required final String title, + final dynamic value, + final bool isSelected}) = _$SelectionPopupModelImpl; @override int? get id; - @override String get title; - @override dynamic get value; - @override bool get isSelected; @@ -188,5 +195,6 @@ abstract class _SelectionPopupModel implements SelectionPopupModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart index 433a7e15..7c5d7ffd 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$NewMessagesState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$NewMessagesState { /// @nodoc abstract class $NewMessagesStateCopyWith<$Res> { - factory $NewMessagesStateCopyWith(NewMessagesState value, $Res Function(NewMessagesState) then) = _$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>; + factory $NewMessagesStateCopyWith( + NewMessagesState value, $Res Function(NewMessagesState) then) = + _$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>; } /// @nodoc -class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> implements $NewMessagesStateCopyWith<$Res> { +class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> + implements $NewMessagesStateCopyWith<$Res> { _$NewMessagesStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,14 +91,18 @@ class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState> implem /// @nodoc abstract class _$$NewMessagesStateImplCopyWith<$Res> { - factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value, $Res Function(_$NewMessagesStateImpl) then) = + factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value, + $Res Function(_$NewMessagesStateImpl) then) = __$$NewMessagesStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NewMessagesStateImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl> +class __$$NewMessagesStateImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl> implements _$$NewMessagesStateImplCopyWith<$Res> { - __$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value, $Res Function(_$NewMessagesStateImpl) _then) : super(_value, _then); + __$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value, + $Res Function(_$NewMessagesStateImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -115,7 +120,8 @@ class _$NewMessagesStateImpl implements _NewMessagesState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$NewMessagesStateImpl); } @override @@ -202,14 +208,19 @@ abstract class _NewMessagesState implements NewMessagesState { /// @nodoc abstract class _$$NewMessagesStateEmptyImplCopyWith<$Res> { - factory _$$NewMessagesStateEmptyImplCopyWith(_$NewMessagesStateEmptyImpl value, $Res Function(_$NewMessagesStateEmptyImpl) then) = + factory _$$NewMessagesStateEmptyImplCopyWith( + _$NewMessagesStateEmptyImpl value, + $Res Function(_$NewMessagesStateEmptyImpl) then) = __$$NewMessagesStateEmptyImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl> +class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl> implements _$$NewMessagesStateEmptyImplCopyWith<$Res> { - __$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value, $Res Function(_$NewMessagesStateEmptyImpl) _then) : super(_value, _then); + __$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value, + $Res Function(_$NewMessagesStateEmptyImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -227,7 +238,9 @@ class _$NewMessagesStateEmptyImpl implements NewMessagesStateEmpty { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateEmptyImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NewMessagesStateEmptyImpl); } @override @@ -314,17 +327,22 @@ abstract class NewMessagesStateEmpty implements NewMessagesState { /// @nodoc abstract class _$$NewMessagesStateLoadedImplCopyWith<$Res> { - factory _$$NewMessagesStateLoadedImplCopyWith(_$NewMessagesStateLoadedImpl value, $Res Function(_$NewMessagesStateLoadedImpl) then) = + factory _$$NewMessagesStateLoadedImplCopyWith( + _$NewMessagesStateLoadedImpl value, + $Res Function(_$NewMessagesStateLoadedImpl) then) = __$$NewMessagesStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({int messagesCount}); } /// @nodoc -class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl> +class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl> implements _$$NewMessagesStateLoadedImplCopyWith<$Res> { - __$$NewMessagesStateLoadedImplCopyWithImpl(_$NewMessagesStateLoadedImpl _value, $Res Function(_$NewMessagesStateLoadedImpl) _then) : super(_value, _then); + __$$NewMessagesStateLoadedImplCopyWithImpl( + _$NewMessagesStateLoadedImpl _value, + $Res Function(_$NewMessagesStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -360,7 +378,8 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateLoadedImpl && - (identical(other.messagesCount, messagesCount) || other.messagesCount == messagesCount)); + (identical(other.messagesCount, messagesCount) || + other.messagesCount == messagesCount)); } @override @@ -371,8 +390,9 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => - __$$NewMessagesStateLoadedImplCopyWithImpl<_$NewMessagesStateLoadedImpl>(this, _$identity); + _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> + get copyWith => __$$NewMessagesStateLoadedImplCopyWithImpl< + _$NewMessagesStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -450,29 +470,35 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { } abstract class NewMessagesStateLoaded implements NewMessagesState { - const factory NewMessagesStateLoaded({required final int messagesCount}) = _$NewMessagesStateLoadedImpl; + const factory NewMessagesStateLoaded({required final int messagesCount}) = + _$NewMessagesStateLoadedImpl; int get messagesCount; /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$NewMessagesStateErrorImplCopyWith<$Res> { - factory _$$NewMessagesStateErrorImplCopyWith(_$NewMessagesStateErrorImpl value, $Res Function(_$NewMessagesStateErrorImpl) then) = + factory _$$NewMessagesStateErrorImplCopyWith( + _$NewMessagesStateErrorImpl value, + $Res Function(_$NewMessagesStateErrorImpl) then) = __$$NewMessagesStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$NewMessagesStateErrorImplCopyWithImpl<$Res> extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl> +class __$$NewMessagesStateErrorImplCopyWithImpl<$Res> + extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl> implements _$$NewMessagesStateErrorImplCopyWith<$Res> { - __$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value, $Res Function(_$NewMessagesStateErrorImpl) _then) : super(_value, _then); + __$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value, + $Res Function(_$NewMessagesStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @@ -508,7 +534,8 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NewMessagesStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -519,8 +546,9 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => - __$$NewMessagesStateErrorImplCopyWithImpl<_$NewMessagesStateErrorImpl>(this, _$identity); + _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> + get copyWith => __$$NewMessagesStateErrorImplCopyWithImpl< + _$NewMessagesStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -598,12 +626,14 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { } abstract class NewMessagesStateError implements NewMessagesState { - const factory NewMessagesStateError({required final String errorMessage}) = _$NewMessagesStateErrorImpl; + const factory NewMessagesStateError({required final String errorMessage}) = + _$NewMessagesStateErrorImpl; String get errorMessage; /// Create a copy of NewMessagesState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart index 6fa44e3d..d634b318 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart @@ -20,16 +20,18 @@ mixin _$NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +39,8 @@ mixin _$NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,17 +74,18 @@ mixin _$NotificationsState { /// @nodoc abstract class $NotificationsStateCopyWith<$Res> { - factory $NotificationsStateCopyWith(NotificationsState value, $Res Function(NotificationsState) then) = + factory $NotificationsStateCopyWith( + NotificationsState value, $Res Function(NotificationsState) then) = _$NotificationsStateCopyWithImpl<$Res, NotificationsState>; } /// @nodoc -class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> implements $NotificationsStateCopyWith<$Res> { +class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> + implements $NotificationsStateCopyWith<$Res> { _$NotificationsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -91,14 +95,18 @@ class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState> im /// @nodoc abstract class _$$NotificationsStateImplCopyWith<$Res> { - factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value, $Res Function(_$NotificationsStateImpl) then) = + factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value, + $Res Function(_$NotificationsStateImpl) then) = __$$NotificationsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NotificationsStateImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl> +class __$$NotificationsStateImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl> implements _$$NotificationsStateImplCopyWith<$Res> { - __$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value, $Res Function(_$NotificationsStateImpl) _then) : super(_value, _then); + __$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value, + $Res Function(_$NotificationsStateImpl) _then) + : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -116,7 +124,8 @@ class _$NotificationsStateImpl implements _NotificationsState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$NotificationsStateImpl); } @override @@ -127,7 +136,9 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -138,7 +149,8 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -149,7 +161,8 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -203,14 +216,21 @@ abstract class _NotificationsState implements NotificationsState { /// @nodoc abstract class _$$NotificationsStateEmptyImplCopyWith<$Res> { - factory _$$NotificationsStateEmptyImplCopyWith(_$NotificationsStateEmptyImpl value, $Res Function(_$NotificationsStateEmptyImpl) then) = + factory _$$NotificationsStateEmptyImplCopyWith( + _$NotificationsStateEmptyImpl value, + $Res Function(_$NotificationsStateEmptyImpl) then) = __$$NotificationsStateEmptyImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NotificationsStateEmptyImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateEmptyImpl> +class __$$NotificationsStateEmptyImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, + _$NotificationsStateEmptyImpl> implements _$$NotificationsStateEmptyImplCopyWith<$Res> { - __$$NotificationsStateEmptyImplCopyWithImpl(_$NotificationsStateEmptyImpl _value, $Res Function(_$NotificationsStateEmptyImpl) _then) : super(_value, _then); + __$$NotificationsStateEmptyImplCopyWithImpl( + _$NotificationsStateEmptyImpl _value, + $Res Function(_$NotificationsStateEmptyImpl) _then) + : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -228,7 +248,9 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateEmptyImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NotificationsStateEmptyImpl); } @override @@ -239,7 +261,9 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return empty(); @@ -250,7 +274,8 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return empty?.call(); @@ -261,7 +286,8 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -315,17 +341,22 @@ abstract class NotificationsStateEmpty implements NotificationsState { /// @nodoc abstract class _$$NotificationsStateLoadedImplCopyWith<$Res> { - factory _$$NotificationsStateLoadedImplCopyWith(_$NotificationsStateLoadedImpl value, $Res Function(_$NotificationsStateLoadedImpl) then) = + factory _$$NotificationsStateLoadedImplCopyWith( + _$NotificationsStateLoadedImpl value, + $Res Function(_$NotificationsStateLoadedImpl) then) = __$$NotificationsStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({List notifications, int notificationsCount}); } /// @nodoc -class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateLoadedImpl> +class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, + _$NotificationsStateLoadedImpl> implements _$$NotificationsStateLoadedImplCopyWith<$Res> { - __$$NotificationsStateLoadedImplCopyWithImpl(_$NotificationsStateLoadedImpl _value, $Res Function(_$NotificationsStateLoadedImpl) _then) + __$$NotificationsStateLoadedImplCopyWithImpl( + _$NotificationsStateLoadedImpl _value, + $Res Function(_$NotificationsStateLoadedImpl) _then) : super(_value, _then); /// Create a copy of NotificationsState @@ -352,10 +383,12 @@ class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> extends _$Notifications /// @nodoc class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { - const _$NotificationsStateLoadedImpl({required final List notifications, required this.notificationsCount}) : _notifications = notifications; + const _$NotificationsStateLoadedImpl( + {required final List notifications, + required this.notificationsCount}) + : _notifications = notifications; final List _notifications; - @override List get notifications { if (_notifications is EqualUnmodifiableListView) return _notifications; @@ -376,27 +409,33 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateLoadedImpl && - const DeepCollectionEquality().equals(other._notifications, _notifications) && - (identical(other.notificationsCount, notificationsCount) || other.notificationsCount == notificationsCount)); + const DeepCollectionEquality() + .equals(other._notifications, _notifications) && + (identical(other.notificationsCount, notificationsCount) || + other.notificationsCount == notificationsCount)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_notifications), notificationsCount); + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_notifications), notificationsCount); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => - __$$NotificationsStateLoadedImplCopyWithImpl<_$NotificationsStateLoadedImpl>(this, _$identity); + _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> + get copyWith => __$$NotificationsStateLoadedImplCopyWithImpl< + _$NotificationsStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return loaded(notifications, notificationsCount); @@ -407,7 +446,8 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(notifications, notificationsCount); @@ -418,7 +458,8 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -467,31 +508,39 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { } abstract class NotificationsStateLoaded implements NotificationsState { - const factory NotificationsStateLoaded({required final List notifications, required final int notificationsCount}) = _$NotificationsStateLoadedImpl; + const factory NotificationsStateLoaded( + {required final List notifications, + required final int notificationsCount}) = _$NotificationsStateLoadedImpl; List get notifications; - int get notificationsCount; /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$NotificationsStateErrorImplCopyWith<$Res> { - factory _$$NotificationsStateErrorImplCopyWith(_$NotificationsStateErrorImpl value, $Res Function(_$NotificationsStateErrorImpl) then) = + factory _$$NotificationsStateErrorImplCopyWith( + _$NotificationsStateErrorImpl value, + $Res Function(_$NotificationsStateErrorImpl) then) = __$$NotificationsStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$NotificationsStateErrorImplCopyWithImpl<$Res> extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateErrorImpl> +class __$$NotificationsStateErrorImplCopyWithImpl<$Res> + extends _$NotificationsStateCopyWithImpl<$Res, + _$NotificationsStateErrorImpl> implements _$$NotificationsStateErrorImplCopyWith<$Res> { - __$$NotificationsStateErrorImplCopyWithImpl(_$NotificationsStateErrorImpl _value, $Res Function(_$NotificationsStateErrorImpl) _then) : super(_value, _then); + __$$NotificationsStateErrorImplCopyWithImpl( + _$NotificationsStateErrorImpl _value, + $Res Function(_$NotificationsStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @@ -527,7 +576,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -538,15 +588,18 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => - __$$NotificationsStateErrorImplCopyWithImpl<_$NotificationsStateErrorImpl>(this, _$identity); + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> + get copyWith => __$$NotificationsStateErrorImplCopyWithImpl< + _$NotificationsStateErrorImpl>(this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(List notifications, int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -557,7 +610,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(List notifications, int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -568,7 +622,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(List notifications, int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -617,12 +672,14 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { } abstract class NotificationsStateError implements NotificationsState { - const factory NotificationsStateError({required final String errorMessage}) = _$NotificationsStateErrorImpl; + const factory NotificationsStateError({required final String errorMessage}) = + _$NotificationsStateErrorImpl; String get errorMessage; /// Create a copy of NotificationsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/models/calendar_model.freezed.dart b/lib/features/calendar/models/calendar_model.freezed.dart index f7a1d191..d10fc8f2 100644 --- a/lib/features/calendar/models/calendar_model.freezed.dart +++ b/lib/features/calendar/models/calendar_model.freezed.dart @@ -21,9 +21,8 @@ CalendarModel _$CalendarModelFromJson(Map json) { /// @nodoc mixin _$CalendarModel { String get date => throw _privateConstructorUsedError; - - bool get is_current_day_included_in_the_chosen_diet_progression => throw _privateConstructorUsedError; - + bool get is_current_day_included_in_the_chosen_diet_progression => + throw _privateConstructorUsedError; Object? get diary => throw _privateConstructorUsedError; /// Serializes this CalendarModel to a JSON map. @@ -32,24 +31,29 @@ mixin _$CalendarModel { /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $CalendarModelCopyWith get copyWith => throw _privateConstructorUsedError; + $CalendarModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $CalendarModelCopyWith<$Res> { - factory $CalendarModelCopyWith(CalendarModel value, $Res Function(CalendarModel) then) = _$CalendarModelCopyWithImpl<$Res, CalendarModel>; - + factory $CalendarModelCopyWith( + CalendarModel value, $Res Function(CalendarModel) then) = + _$CalendarModelCopyWithImpl<$Res, CalendarModel>; @useResult - $Res call({String date, bool is_current_day_included_in_the_chosen_diet_progression, Object? diary}); + $Res call( + {String date, + bool is_current_day_included_in_the_chosen_diet_progression, + Object? diary}); } /// @nodoc -class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> implements $CalendarModelCopyWith<$Res> { +class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> + implements $CalendarModelCopyWith<$Res> { _$CalendarModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -67,7 +71,8 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> implements $ ? _value.date : date // ignore: cast_nullable_to_non_nullable as String, - is_current_day_included_in_the_chosen_diet_progression: null == is_current_day_included_in_the_chosen_diet_progression + is_current_day_included_in_the_chosen_diet_progression: null == + is_current_day_included_in_the_chosen_diet_progression ? _value.is_current_day_included_in_the_chosen_diet_progression : is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable as bool, @@ -77,17 +82,26 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel> implements $ } /// @nodoc -abstract class _$$CalendarModelImplCopyWith<$Res> implements $CalendarModelCopyWith<$Res> { - factory _$$CalendarModelImplCopyWith(_$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) = __$$CalendarModelImplCopyWithImpl<$Res>; - +abstract class _$$CalendarModelImplCopyWith<$Res> + implements $CalendarModelCopyWith<$Res> { + factory _$$CalendarModelImplCopyWith( + _$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) = + __$$CalendarModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({String date, bool is_current_day_included_in_the_chosen_diet_progression, Object? diary}); + $Res call( + {String date, + bool is_current_day_included_in_the_chosen_diet_progression, + Object? diary}); } /// @nodoc -class __$$CalendarModelImplCopyWithImpl<$Res> extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl> implements _$$CalendarModelImplCopyWith<$Res> { - __$$CalendarModelImplCopyWithImpl(_$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then) : super(_value, _then); +class __$$CalendarModelImplCopyWithImpl<$Res> + extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl> + implements _$$CalendarModelImplCopyWith<$Res> { + __$$CalendarModelImplCopyWithImpl( + _$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then) + : super(_value, _then); /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @@ -103,7 +117,8 @@ class __$$CalendarModelImplCopyWithImpl<$Res> extends _$CalendarModelCopyWithImp ? _value.date : date // ignore: cast_nullable_to_non_nullable as String, - is_current_day_included_in_the_chosen_diet_progression: null == is_current_day_included_in_the_chosen_diet_progression + is_current_day_included_in_the_chosen_diet_progression: null == + is_current_day_included_in_the_chosen_diet_progression ? _value.is_current_day_included_in_the_chosen_diet_progression : is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable as bool, @@ -115,9 +130,13 @@ class __$$CalendarModelImplCopyWithImpl<$Res> extends _$CalendarModelCopyWithImp /// @nodoc @JsonSerializable() class _$CalendarModelImpl implements _CalendarModel { - const _$CalendarModelImpl({required this.date, required this.is_current_day_included_in_the_chosen_diet_progression, this.diary}); + const _$CalendarModelImpl( + {required this.date, + required this.is_current_day_included_in_the_chosen_diet_progression, + this.diary}); - factory _$CalendarModelImpl.fromJson(Map json) => _$$CalendarModelImplFromJson(json); + factory _$CalendarModelImpl.fromJson(Map json) => + _$$CalendarModelImplFromJson(json); @override final String date; @@ -137,21 +156,30 @@ class _$CalendarModelImpl implements _CalendarModel { (other.runtimeType == runtimeType && other is _$CalendarModelImpl && (identical(other.date, date) || other.date == date) && - (identical(other.is_current_day_included_in_the_chosen_diet_progression, is_current_day_included_in_the_chosen_diet_progression) || - other.is_current_day_included_in_the_chosen_diet_progression == is_current_day_included_in_the_chosen_diet_progression) && + (identical( + other + .is_current_day_included_in_the_chosen_diet_progression, + is_current_day_included_in_the_chosen_diet_progression) || + other.is_current_day_included_in_the_chosen_diet_progression == + is_current_day_included_in_the_chosen_diet_progression) && const DeepCollectionEquality().equals(other.diary, diary)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, date, is_current_day_included_in_the_chosen_diet_progression, const DeepCollectionEquality().hash(diary)); + int get hashCode => Object.hash( + runtimeType, + date, + is_current_day_included_in_the_chosen_diet_progression, + const DeepCollectionEquality().hash(diary)); /// Create a copy of CalendarModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => __$$CalendarModelImplCopyWithImpl<_$CalendarModelImpl>(this, _$identity); + _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => + __$$CalendarModelImplCopyWithImpl<_$CalendarModelImpl>(this, _$identity); @override Map toJson() { @@ -162,17 +190,19 @@ class _$CalendarModelImpl implements _CalendarModel { } abstract class _CalendarModel implements CalendarModel { - const factory _CalendarModel({required final String date, required final bool is_current_day_included_in_the_chosen_diet_progression, final Object? diary}) = - _$CalendarModelImpl; + const factory _CalendarModel( + {required final String date, + required final bool + is_current_day_included_in_the_chosen_diet_progression, + final Object? diary}) = _$CalendarModelImpl; - factory _CalendarModel.fromJson(Map json) = _$CalendarModelImpl.fromJson; + factory _CalendarModel.fromJson(Map json) = + _$CalendarModelImpl.fromJson; @override String get date; - @override bool get is_current_day_included_in_the_chosen_diet_progression; - @override Object? get diary; @@ -180,5 +210,6 @@ abstract class _CalendarModel implements CalendarModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/models/calendar_model.g.dart b/lib/features/calendar/models/calendar_model.g.dart index 4134c22e..65fd0063 100644 --- a/lib/features/calendar/models/calendar_model.g.dart +++ b/lib/features/calendar/models/calendar_model.g.dart @@ -6,14 +6,19 @@ part of 'calendar_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CalendarModelImpl _$$CalendarModelImplFromJson(Map json) => _$CalendarModelImpl( +_$CalendarModelImpl _$$CalendarModelImplFromJson(Map json) => + _$CalendarModelImpl( date: json['date'] as String, - is_current_day_included_in_the_chosen_diet_progression: json['is_current_day_included_in_the_chosen_diet_progression'] as bool, + is_current_day_included_in_the_chosen_diet_progression: + json['is_current_day_included_in_the_chosen_diet_progression'] + as bool, diary: json['diary'], ); -Map _$$CalendarModelImplToJson(_$CalendarModelImpl instance) => { +Map _$$CalendarModelImplToJson(_$CalendarModelImpl instance) => + { 'date': instance.date, - 'is_current_day_included_in_the_chosen_diet_progression': instance.is_current_day_included_in_the_chosen_diet_progression, + 'is_current_day_included_in_the_chosen_diet_progression': + instance.is_current_day_included_in_the_chosen_diet_progression, 'diary': instance.diary, }; diff --git a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart index 76a12423..0e7bdbcd 100644 --- a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart +++ b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$CalendarState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$CalendarState { /// @nodoc abstract class $CalendarStateCopyWith<$Res> { - factory $CalendarStateCopyWith(CalendarState value, $Res Function(CalendarState) then) = _$CalendarStateCopyWithImpl<$Res, CalendarState>; + factory $CalendarStateCopyWith( + CalendarState value, $Res Function(CalendarState) then) = + _$CalendarStateCopyWithImpl<$Res, CalendarState>; } /// @nodoc -class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> implements $CalendarStateCopyWith<$Res> { +class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> + implements $CalendarStateCopyWith<$Res> { _$CalendarStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +91,18 @@ class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState> implements $ /// @nodoc abstract class _$$CalendarStateImplCopyWith<$Res> { - factory _$$CalendarStateImplCopyWith(_$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) = __$$CalendarStateImplCopyWithImpl<$Res>; + factory _$$CalendarStateImplCopyWith( + _$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) = + __$$CalendarStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CalendarStateImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl> implements _$$CalendarStateImplCopyWith<$Res> { - __$$CalendarStateImplCopyWithImpl(_$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then) : super(_value, _then); +class __$$CalendarStateImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl> + implements _$$CalendarStateImplCopyWith<$Res> { + __$$CalendarStateImplCopyWithImpl( + _$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +120,8 @@ class _$CalendarStateImpl implements _CalendarState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$CalendarStateImpl); } @override @@ -200,14 +208,18 @@ abstract class _CalendarState implements CalendarState { /// @nodoc abstract class _$$CalendarStateLoadingImplCopyWith<$Res> { - factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value, $Res Function(_$CalendarStateLoadingImpl) then) = + factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value, + $Res Function(_$CalendarStateLoadingImpl) then) = __$$CalendarStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CalendarStateLoadingImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl> +class __$$CalendarStateLoadingImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl> implements _$$CalendarStateLoadingImplCopyWith<$Res> { - __$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value, $Res Function(_$CalendarStateLoadingImpl) _then) : super(_value, _then); + __$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value, + $Res Function(_$CalendarStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +237,9 @@ class _$CalendarStateLoadingImpl implements CalendarStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$CalendarStateLoadingImpl); } @override @@ -312,17 +326,20 @@ abstract class CalendarStateLoading implements CalendarState { /// @nodoc abstract class _$$CalendarStateLoadedImplCopyWith<$Res> { - factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value, $Res Function(_$CalendarStateLoadedImpl) then) = + factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value, + $Res Function(_$CalendarStateLoadedImpl) then) = __$$CalendarStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({List calendarList}); } /// @nodoc -class __$$CalendarStateLoadedImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl> +class __$$CalendarStateLoadedImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl> implements _$$CalendarStateLoadedImplCopyWith<$Res> { - __$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value, $Res Function(_$CalendarStateLoadedImpl) _then) : super(_value, _then); + __$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value, + $Res Function(_$CalendarStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -343,10 +360,11 @@ class __$$CalendarStateLoadedImplCopyWithImpl<$Res> extends _$CalendarStateCopyW /// @nodoc class _$CalendarStateLoadedImpl implements CalendarStateLoaded { - const _$CalendarStateLoadedImpl({required final List calendarList}) : _calendarList = calendarList; + const _$CalendarStateLoadedImpl( + {required final List calendarList}) + : _calendarList = calendarList; final List _calendarList; - @override List get calendarList { if (_calendarList is EqualUnmodifiableListView) return _calendarList; @@ -362,11 +380,15 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$CalendarStateLoadedImpl && const DeepCollectionEquality().equals(other._calendarList, _calendarList)); + (other.runtimeType == runtimeType && + other is _$CalendarStateLoadedImpl && + const DeepCollectionEquality() + .equals(other._calendarList, _calendarList)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_calendarList)); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_calendarList)); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -374,7 +396,8 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { @override @pragma('vm:prefer-inline') _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => - __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>(this, _$identity); + __$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -452,29 +475,35 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { } abstract class CalendarStateLoaded implements CalendarState { - const factory CalendarStateLoaded({required final List calendarList}) = _$CalendarStateLoadedImpl; + const factory CalendarStateLoaded( + {required final List calendarList}) = + _$CalendarStateLoadedImpl; List get calendarList; /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$CalendarStateErrorImplCopyWith<$Res> { - factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value, $Res Function(_$CalendarStateErrorImpl) then) = + factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value, + $Res Function(_$CalendarStateErrorImpl) then) = __$$CalendarStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$CalendarStateErrorImplCopyWithImpl<$Res> extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl> +class __$$CalendarStateErrorImplCopyWithImpl<$Res> + extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl> implements _$$CalendarStateErrorImplCopyWith<$Res> { - __$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value, $Res Function(_$CalendarStateErrorImpl) _then) : super(_value, _then); + __$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value, + $Res Function(_$CalendarStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @@ -510,7 +539,8 @@ class _$CalendarStateErrorImpl implements CalendarStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$CalendarStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -522,7 +552,8 @@ class _$CalendarStateErrorImpl implements CalendarStateError { @override @pragma('vm:prefer-inline') _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => - __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>(this, _$identity); + __$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -600,12 +631,14 @@ class _$CalendarStateErrorImpl implements CalendarStateError { } abstract class CalendarStateError implements CalendarState { - const factory CalendarStateError({required final String errorMessage}) = _$CalendarStateErrorImpl; + const factory CalendarStateError({required final String errorMessage}) = + _$CalendarStateErrorImpl; String get errorMessage; /// Create a copy of CalendarState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/services/calendar_service.g.dart b/lib/features/calendar/services/calendar_service.g.dart index 223e1a2e..903145dc 100644 --- a/lib/features/calendar/services/calendar_service.g.dart +++ b/lib/features/calendar/services/calendar_service.g.dart @@ -46,7 +46,9 @@ class _CalendarService implements CalendarService { final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data!.map((dynamic i) => CalendarModel.fromJson(i as Map)).toList(); + _value = _result.data! + .map((dynamic i) => CalendarModel.fromJson(i as Map)) + .toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -55,7 +57,9 @@ class _CalendarService implements CalendarService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/chat/models/chat_message_model.freezed.dart b/lib/features/chat/models/chat_message_model.freezed.dart index 558753ef..8f921425 100644 --- a/lib/features/chat/models/chat_message_model.freezed.dart +++ b/lib/features/chat/models/chat_message_model.freezed.dart @@ -21,15 +21,11 @@ ChatMessageModel _$ChatMessageModelFromJson(Map json) { /// @nodoc mixin _$ChatMessageModel { int get id => throw _privateConstructorUsedError; - String get data => throw _privateConstructorUsedError; - @JsonKey(name: 'media_data') List? get mediaData => throw _privateConstructorUsedError; - @JsonKey(name: 'author_id') int get authorId => throw _privateConstructorUsedError; - @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; @@ -39,13 +35,15 @@ mixin _$ChatMessageModel { /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMessageModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatMessageModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMessageModelCopyWith<$Res> { - factory $ChatMessageModelCopyWith(ChatMessageModel value, $Res Function(ChatMessageModel) then) = _$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>; - + factory $ChatMessageModelCopyWith( + ChatMessageModel value, $Res Function(ChatMessageModel) then) = + _$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>; @useResult $Res call( {int id, @@ -56,12 +54,12 @@ abstract class $ChatMessageModelCopyWith<$Res> { } /// @nodoc -class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> implements $ChatMessageModelCopyWith<$Res> { +class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> + implements $ChatMessageModelCopyWith<$Res> { _$ChatMessageModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -102,10 +100,11 @@ class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel> implem } /// @nodoc -abstract class _$$ChatMessageModelImplCopyWith<$Res> implements $ChatMessageModelCopyWith<$Res> { - factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value, $Res Function(_$ChatMessageModelImpl) then) = +abstract class _$$ChatMessageModelImplCopyWith<$Res> + implements $ChatMessageModelCopyWith<$Res> { + factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value, + $Res Function(_$ChatMessageModelImpl) then) = __$$ChatMessageModelImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -117,9 +116,12 @@ abstract class _$$ChatMessageModelImplCopyWith<$Res> implements $ChatMessageMode } /// @nodoc -class __$$ChatMessageModelImplCopyWithImpl<$Res> extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl> +class __$$ChatMessageModelImplCopyWithImpl<$Res> + extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl> implements _$$ChatMessageModelImplCopyWith<$Res> { - __$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value, $Res Function(_$ChatMessageModelImpl) _then) : super(_value, _then); + __$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value, + $Res Function(_$ChatMessageModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @@ -168,14 +170,14 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { @JsonKey(name: 'updated_at') required this.updatedAt}) : _mediaData = mediaData; - factory _$ChatMessageModelImpl.fromJson(Map json) => _$$ChatMessageModelImplFromJson(json); + factory _$ChatMessageModelImpl.fromJson(Map json) => + _$$ChatMessageModelImplFromJson(json); @override final int id; @override final String data; final List? _mediaData; - @override @JsonKey(name: 'media_data') List? get mediaData { @@ -205,21 +207,27 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { other is _$ChatMessageModelImpl && (identical(other.id, id) || other.id == id) && (identical(other.data, data) || other.data == data) && - const DeepCollectionEquality().equals(other._mediaData, _mediaData) && - (identical(other.authorId, authorId) || other.authorId == authorId) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + const DeepCollectionEquality() + .equals(other._mediaData, _mediaData) && + (identical(other.authorId, authorId) || + other.authorId == authorId) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); + int get hashCode => Object.hash(runtimeType, id, data, + const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); /// Create a copy of ChatMessageModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>(this, _$identity); + _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => + __$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>( + this, _$identity); @override Map toJson() { @@ -231,28 +239,26 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { abstract class _ChatMessageModel implements ChatMessageModel { const factory _ChatMessageModel( - {required final int id, - required final String data, - @JsonKey(name: 'media_data') required final List? mediaData, - @JsonKey(name: 'author_id') required final int authorId, - @JsonKey(name: 'updated_at') required final String updatedAt}) = _$ChatMessageModelImpl; + {required final int id, + required final String data, + @JsonKey(name: 'media_data') required final List? mediaData, + @JsonKey(name: 'author_id') required final int authorId, + @JsonKey(name: 'updated_at') required final String updatedAt}) = + _$ChatMessageModelImpl; - factory _ChatMessageModel.fromJson(Map json) = _$ChatMessageModelImpl.fromJson; + factory _ChatMessageModel.fromJson(Map json) = + _$ChatMessageModelImpl.fromJson; @override int get id; - @override String get data; - @override @JsonKey(name: 'media_data') List? get mediaData; - @override @JsonKey(name: 'author_id') int get authorId; - @override @JsonKey(name: 'updated_at') String get updatedAt; @@ -261,5 +267,6 @@ abstract class _ChatMessageModel implements ChatMessageModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_message_model.g.dart b/lib/features/chat/models/chat_message_model.g.dart index 70531099..3a8d1827 100644 --- a/lib/features/chat/models/chat_message_model.g.dart +++ b/lib/features/chat/models/chat_message_model.g.dart @@ -6,7 +6,9 @@ part of 'chat_message_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson(Map json) => _$ChatMessageModelImpl( +_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson( + Map json) => + _$ChatMessageModelImpl( id: (json['id'] as num).toInt(), data: json['data'] as String, mediaData: json['media_data'] as List?, @@ -14,7 +16,9 @@ _$ChatMessageModelImpl _$$ChatMessageModelImplFromJson(Map json updatedAt: json['updated_at'] as String, ); -Map _$$ChatMessageModelImplToJson(_$ChatMessageModelImpl instance) => { +Map _$$ChatMessageModelImplToJson( + _$ChatMessageModelImpl instance) => + { 'id': instance.id, 'data': instance.data, 'media_data': instance.mediaData, diff --git a/lib/features/chat/models/chat_messages_model.freezed.dart b/lib/features/chat/models/chat_messages_model.freezed.dart index d4dad1cb..852b33e4 100644 --- a/lib/features/chat/models/chat_messages_model.freezed.dart +++ b/lib/features/chat/models/chat_messages_model.freezed.dart @@ -22,7 +22,6 @@ ChatMessagesModel _$ChatMessagesModelFromJson(Map json) { mixin _$ChatMessagesModel { @JsonKey(name: 'data') List get messagesList => throw _privateConstructorUsedError; - ChatMetaModel get meta => throw _privateConstructorUsedError; /// Serializes this ChatMessagesModel to a JSON map. @@ -31,26 +30,30 @@ mixin _$ChatMessagesModel { /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMessagesModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatMessagesModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMessagesModelCopyWith<$Res> { - factory $ChatMessagesModelCopyWith(ChatMessagesModel value, $Res Function(ChatMessagesModel) then) = _$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>; - + factory $ChatMessagesModelCopyWith( + ChatMessagesModel value, $Res Function(ChatMessagesModel) then) = + _$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>; @useResult - $Res call({@JsonKey(name: 'data') List messagesList, ChatMetaModel meta}); + $Res call( + {@JsonKey(name: 'data') List messagesList, + ChatMetaModel meta}); $ChatMetaModelCopyWith<$Res> get meta; } /// @nodoc -class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> implements $ChatMessagesModelCopyWith<$Res> { +class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> + implements $ChatMessagesModelCopyWith<$Res> { _$ChatMessagesModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -86,22 +89,28 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel> impl } /// @nodoc -abstract class _$$ChatMessagesModelImplCopyWith<$Res> implements $ChatMessagesModelCopyWith<$Res> { - factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value, $Res Function(_$ChatMessagesModelImpl) then) = +abstract class _$$ChatMessagesModelImplCopyWith<$Res> + implements $ChatMessagesModelCopyWith<$Res> { + factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value, + $Res Function(_$ChatMessagesModelImpl) then) = __$$ChatMessagesModelImplCopyWithImpl<$Res>; - @override @useResult - $Res call({@JsonKey(name: 'data') List messagesList, ChatMetaModel meta}); + $Res call( + {@JsonKey(name: 'data') List messagesList, + ChatMetaModel meta}); @override $ChatMetaModelCopyWith<$Res> get meta; } /// @nodoc -class __$$ChatMessagesModelImplCopyWithImpl<$Res> extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl> +class __$$ChatMessagesModelImplCopyWithImpl<$Res> + extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl> implements _$$ChatMessagesModelImplCopyWith<$Res> { - __$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value, $Res Function(_$ChatMessagesModelImpl) _then) : super(_value, _then); + __$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value, + $Res Function(_$ChatMessagesModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @@ -127,12 +136,16 @@ class __$$ChatMessagesModelImplCopyWithImpl<$Res> extends _$ChatMessagesModelCop /// @nodoc @JsonSerializable() class _$ChatMessagesModelImpl implements _ChatMessagesModel { - const _$ChatMessagesModelImpl({@JsonKey(name: 'data') required final List messagesList, required this.meta}) : _messagesList = messagesList; + const _$ChatMessagesModelImpl( + {@JsonKey(name: 'data') + required final List messagesList, + required this.meta}) + : _messagesList = messagesList; - factory _$ChatMessagesModelImpl.fromJson(Map json) => _$$ChatMessagesModelImplFromJson(json); + factory _$ChatMessagesModelImpl.fromJson(Map json) => + _$$ChatMessagesModelImplFromJson(json); final List _messagesList; - @override @JsonKey(name: 'data') List get messagesList { @@ -154,20 +167,24 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatMessagesModelImpl && - const DeepCollectionEquality().equals(other._messagesList, _messagesList) && + const DeepCollectionEquality() + .equals(other._messagesList, _messagesList) && (identical(other.meta, meta) || other.meta == meta)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); /// Create a copy of ChatMessagesModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>(this, _$identity); + _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => + __$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>( + this, _$identity); @override Map toJson() { @@ -178,15 +195,17 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { } abstract class _ChatMessagesModel implements ChatMessagesModel { - const factory _ChatMessagesModel({@JsonKey(name: 'data') required final List messagesList, required final ChatMetaModel meta}) = - _$ChatMessagesModelImpl; + const factory _ChatMessagesModel( + {@JsonKey(name: 'data') + required final List messagesList, + required final ChatMetaModel meta}) = _$ChatMessagesModelImpl; - factory _ChatMessagesModel.fromJson(Map json) = _$ChatMessagesModelImpl.fromJson; + factory _ChatMessagesModel.fromJson(Map json) = + _$ChatMessagesModelImpl.fromJson; @override @JsonKey(name: 'data') List get messagesList; - @override ChatMetaModel get meta; @@ -194,5 +213,6 @@ abstract class _ChatMessagesModel implements ChatMessagesModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_messages_model.g.dart b/lib/features/chat/models/chat_messages_model.g.dart index 1a7fe48b..6216cd83 100644 --- a/lib/features/chat/models/chat_messages_model.g.dart +++ b/lib/features/chat/models/chat_messages_model.g.dart @@ -6,12 +6,18 @@ part of 'chat_messages_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson(Map json) => _$ChatMessagesModelImpl( - messagesList: (json['data'] as List).map((e) => ChatMessageModel.fromJson(e as Map)).toList(), +_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson( + Map json) => + _$ChatMessagesModelImpl( + messagesList: (json['data'] as List) + .map((e) => ChatMessageModel.fromJson(e as Map)) + .toList(), meta: ChatMetaModel.fromJson(json['meta'] as Map), ); -Map _$$ChatMessagesModelImplToJson(_$ChatMessagesModelImpl instance) => { +Map _$$ChatMessagesModelImplToJson( + _$ChatMessagesModelImpl instance) => + { 'data': instance.messagesList, 'meta': instance.meta, }; diff --git a/lib/features/chat/models/chat_meta_model.freezed.dart b/lib/features/chat/models/chat_meta_model.freezed.dart index b4354b59..e8e4e96b 100644 --- a/lib/features/chat/models/chat_meta_model.freezed.dart +++ b/lib/features/chat/models/chat_meta_model.freezed.dart @@ -29,24 +29,26 @@ mixin _$ChatMetaModel { /// Create a copy of ChatMetaModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatMetaModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatMetaModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatMetaModelCopyWith<$Res> { - factory $ChatMetaModelCopyWith(ChatMetaModel value, $Res Function(ChatMetaModel) then) = _$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>; - + factory $ChatMetaModelCopyWith( + ChatMetaModel value, $Res Function(ChatMetaModel) then) = + _$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>; @useResult $Res call({@JsonKey(name: "last_page") int lastPage}); } /// @nodoc -class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> implements $ChatMetaModelCopyWith<$Res> { +class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> + implements $ChatMetaModelCopyWith<$Res> { _$ChatMetaModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -67,17 +69,23 @@ class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel> implements $ } /// @nodoc -abstract class _$$ChatMetaModelImplCopyWith<$Res> implements $ChatMetaModelCopyWith<$Res> { - factory _$$ChatMetaModelImplCopyWith(_$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) = __$$ChatMetaModelImplCopyWithImpl<$Res>; - +abstract class _$$ChatMetaModelImplCopyWith<$Res> + implements $ChatMetaModelCopyWith<$Res> { + factory _$$ChatMetaModelImplCopyWith( + _$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) = + __$$ChatMetaModelImplCopyWithImpl<$Res>; @override @useResult $Res call({@JsonKey(name: "last_page") int lastPage}); } /// @nodoc -class __$$ChatMetaModelImplCopyWithImpl<$Res> extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl> implements _$$ChatMetaModelImplCopyWith<$Res> { - __$$ChatMetaModelImplCopyWithImpl(_$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then) : super(_value, _then); +class __$$ChatMetaModelImplCopyWithImpl<$Res> + extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl> + implements _$$ChatMetaModelImplCopyWith<$Res> { + __$$ChatMetaModelImplCopyWithImpl( + _$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatMetaModel /// with the given fields replaced by the non-null parameter values. @@ -98,9 +106,11 @@ class __$$ChatMetaModelImplCopyWithImpl<$Res> extends _$ChatMetaModelCopyWithImp /// @nodoc @JsonSerializable() class _$ChatMetaModelImpl implements _ChatMetaModel { - const _$ChatMetaModelImpl({@JsonKey(name: "last_page") required this.lastPage}); + const _$ChatMetaModelImpl( + {@JsonKey(name: "last_page") required this.lastPage}); - factory _$ChatMetaModelImpl.fromJson(Map json) => _$$ChatMetaModelImplFromJson(json); + factory _$ChatMetaModelImpl.fromJson(Map json) => + _$$ChatMetaModelImplFromJson(json); @override @JsonKey(name: "last_page") @@ -114,7 +124,10 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatMetaModelImpl && (identical(other.lastPage, lastPage) || other.lastPage == lastPage)); + (other.runtimeType == runtimeType && + other is _$ChatMetaModelImpl && + (identical(other.lastPage, lastPage) || + other.lastPage == lastPage)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -126,7 +139,8 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); + _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => + __$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity); @override Map toJson() { @@ -137,9 +151,12 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { } abstract class _ChatMetaModel implements ChatMetaModel { - const factory _ChatMetaModel({@JsonKey(name: "last_page") required final int lastPage}) = _$ChatMetaModelImpl; + const factory _ChatMetaModel( + {@JsonKey(name: "last_page") required final int lastPage}) = + _$ChatMetaModelImpl; - factory _ChatMetaModel.fromJson(Map json) = _$ChatMetaModelImpl.fromJson; + factory _ChatMetaModel.fromJson(Map json) = + _$ChatMetaModelImpl.fromJson; @override @JsonKey(name: "last_page") @@ -149,5 +166,6 @@ abstract class _ChatMetaModel implements ChatMetaModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_meta_model.g.dart b/lib/features/chat/models/chat_meta_model.g.dart index bbd16d10..7126e2dd 100644 --- a/lib/features/chat/models/chat_meta_model.g.dart +++ b/lib/features/chat/models/chat_meta_model.g.dart @@ -6,10 +6,12 @@ part of 'chat_meta_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map json) => _$ChatMetaModelImpl( +_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map json) => + _$ChatMetaModelImpl( lastPage: (json['last_page'] as num).toInt(), ); -Map _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) => { +Map _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) => + { 'last_page': instance.lastPage, }; diff --git a/lib/features/chat/models/chat_room_model.freezed.dart b/lib/features/chat/models/chat_room_model.freezed.dart index cef12fbe..6afb3a94 100644 --- a/lib/features/chat/models/chat_room_model.freezed.dart +++ b/lib/features/chat/models/chat_room_model.freezed.dart @@ -21,10 +21,9 @@ ChatRoomModel _$ChatRoomModelFromJson(Map json) { /// @nodoc mixin _$ChatRoomModel { String get id => throw _privateConstructorUsedError; - @JsonKey(name: 'chat_room_setting') - ChatRoomSettingsModel get chatRoomSettings => throw _privateConstructorUsedError; - + ChatRoomSettingsModel get chatRoomSettings => + throw _privateConstructorUsedError; Map get users => throw _privateConstructorUsedError; /// Serializes this ChatRoomModel to a JSON map. @@ -33,26 +32,32 @@ mixin _$ChatRoomModel { /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomModelCopyWith<$Res> { - factory $ChatRoomModelCopyWith(ChatRoomModel value, $Res Function(ChatRoomModel) then) = _$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>; - + factory $ChatRoomModelCopyWith( + ChatRoomModel value, $Res Function(ChatRoomModel) then) = + _$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>; @useResult - $Res call({String id, @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings, Map users}); + $Res call( + {String id, + @JsonKey(name: 'chat_room_setting') + ChatRoomSettingsModel chatRoomSettings, + Map users}); $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings; } /// @nodoc -class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> implements $ChatRoomModelCopyWith<$Res> { +class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> + implements $ChatRoomModelCopyWith<$Res> { _$ChatRoomModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -86,27 +91,38 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel> implements $ @override @pragma('vm:prefer-inline') $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings { - return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings, (value) { + return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings, + (value) { return _then(_value.copyWith(chatRoomSettings: value) as $Val); }); } } /// @nodoc -abstract class _$$ChatRoomModelImplCopyWith<$Res> implements $ChatRoomModelCopyWith<$Res> { - factory _$$ChatRoomModelImplCopyWith(_$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) = __$$ChatRoomModelImplCopyWithImpl<$Res>; - +abstract class _$$ChatRoomModelImplCopyWith<$Res> + implements $ChatRoomModelCopyWith<$Res> { + factory _$$ChatRoomModelImplCopyWith( + _$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) = + __$$ChatRoomModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({String id, @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings, Map users}); + $Res call( + {String id, + @JsonKey(name: 'chat_room_setting') + ChatRoomSettingsModel chatRoomSettings, + Map users}); @override $ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings; } /// @nodoc -class __$$ChatRoomModelImplCopyWithImpl<$Res> extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl> implements _$$ChatRoomModelImplCopyWith<$Res> { - __$$ChatRoomModelImplCopyWithImpl(_$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then) : super(_value, _then); +class __$$ChatRoomModelImplCopyWithImpl<$Res> + extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl> + implements _$$ChatRoomModelImplCopyWith<$Res> { + __$$ChatRoomModelImplCopyWithImpl( + _$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @@ -138,10 +154,13 @@ class __$$ChatRoomModelImplCopyWithImpl<$Res> extends _$ChatRoomModelCopyWithImp @JsonSerializable() class _$ChatRoomModelImpl implements _ChatRoomModel { const _$ChatRoomModelImpl( - {required this.id, @JsonKey(name: 'chat_room_setting') required this.chatRoomSettings, required final Map users}) + {required this.id, + @JsonKey(name: 'chat_room_setting') required this.chatRoomSettings, + required final Map users}) : _users = users; - factory _$ChatRoomModelImpl.fromJson(Map json) => _$$ChatRoomModelImplFromJson(json); + factory _$ChatRoomModelImpl.fromJson(Map json) => + _$$ChatRoomModelImplFromJson(json); @override final String id; @@ -149,7 +168,6 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { @JsonKey(name: 'chat_room_setting') final ChatRoomSettingsModel chatRoomSettings; final Map _users; - @override Map get users { if (_users is EqualUnmodifiableMapView) return _users; @@ -168,20 +186,23 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { (other.runtimeType == runtimeType && other is _$ChatRoomModelImpl && (identical(other.id, id) || other.id == id) && - (identical(other.chatRoomSettings, chatRoomSettings) || other.chatRoomSettings == chatRoomSettings) && + (identical(other.chatRoomSettings, chatRoomSettings) || + other.chatRoomSettings == chatRoomSettings) && const DeepCollectionEquality().equals(other._users, _users)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, const DeepCollectionEquality().hash(_users)); + int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, + const DeepCollectionEquality().hash(_users)); /// Create a copy of ChatRoomModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); + _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => + __$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity); @override Map toJson() { @@ -194,18 +215,18 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { abstract class _ChatRoomModel implements ChatRoomModel { const factory _ChatRoomModel( {required final String id, - @JsonKey(name: 'chat_room_setting') required final ChatRoomSettingsModel chatRoomSettings, + @JsonKey(name: 'chat_room_setting') + required final ChatRoomSettingsModel chatRoomSettings, required final Map users}) = _$ChatRoomModelImpl; - factory _ChatRoomModel.fromJson(Map json) = _$ChatRoomModelImpl.fromJson; + factory _ChatRoomModel.fromJson(Map json) = + _$ChatRoomModelImpl.fromJson; @override String get id; - @override @JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel get chatRoomSettings; - @override Map get users; @@ -213,5 +234,6 @@ abstract class _ChatRoomModel implements ChatRoomModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_model.g.dart b/lib/features/chat/models/chat_room_model.g.dart index 6230d4f4..68d3195c 100644 --- a/lib/features/chat/models/chat_room_model.g.dart +++ b/lib/features/chat/models/chat_room_model.g.dart @@ -6,15 +6,19 @@ part of 'chat_room_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map json) => _$ChatRoomModelImpl( +_$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map json) => + _$ChatRoomModelImpl( id: json['id'] as String, - chatRoomSettings: ChatRoomSettingsModel.fromJson(json['chat_room_setting'] as Map), + chatRoomSettings: ChatRoomSettingsModel.fromJson( + json['chat_room_setting'] as Map), users: (json['users'] as Map).map( - (k, e) => MapEntry(k, ChatUserModel.fromJson(e as Map)), + (k, e) => + MapEntry(k, ChatUserModel.fromJson(e as Map)), ), ); -Map _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) => { +Map _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) => + { 'id': instance.id, 'chat_room_setting': instance.chatRoomSettings, 'users': instance.users, diff --git a/lib/features/chat/models/chat_room_preview_model.freezed.dart b/lib/features/chat/models/chat_room_preview_model.freezed.dart index 468bfb92..4b006cf0 100644 --- a/lib/features/chat/models/chat_room_preview_model.freezed.dart +++ b/lib/features/chat/models/chat_room_preview_model.freezed.dart @@ -29,25 +29,27 @@ mixin _$ChatRoomPreviewModel { /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomPreviewModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomPreviewModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomPreviewModelCopyWith<$Res> { - factory $ChatRoomPreviewModelCopyWith(ChatRoomPreviewModel value, $Res Function(ChatRoomPreviewModel) then) = + factory $ChatRoomPreviewModelCopyWith(ChatRoomPreviewModel value, + $Res Function(ChatRoomPreviewModel) then) = _$ChatRoomPreviewModelCopyWithImpl<$Res, ChatRoomPreviewModel>; - @useResult $Res call({@JsonKey(name: "chatRooms") List chatRooms}); } /// @nodoc -class _$ChatRoomPreviewModelCopyWithImpl<$Res, $Val extends ChatRoomPreviewModel> implements $ChatRoomPreviewModelCopyWith<$Res> { +class _$ChatRoomPreviewModelCopyWithImpl<$Res, + $Val extends ChatRoomPreviewModel> + implements $ChatRoomPreviewModelCopyWith<$Res> { _$ChatRoomPreviewModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -68,19 +70,23 @@ class _$ChatRoomPreviewModelCopyWithImpl<$Res, $Val extends ChatRoomPreviewModel } /// @nodoc -abstract class _$$ChatRoomPreviewModelImplCopyWith<$Res> implements $ChatRoomPreviewModelCopyWith<$Res> { - factory _$$ChatRoomPreviewModelImplCopyWith(_$ChatRoomPreviewModelImpl value, $Res Function(_$ChatRoomPreviewModelImpl) then) = +abstract class _$$ChatRoomPreviewModelImplCopyWith<$Res> + implements $ChatRoomPreviewModelCopyWith<$Res> { + factory _$$ChatRoomPreviewModelImplCopyWith(_$ChatRoomPreviewModelImpl value, + $Res Function(_$ChatRoomPreviewModelImpl) then) = __$$ChatRoomPreviewModelImplCopyWithImpl<$Res>; - @override @useResult $Res call({@JsonKey(name: "chatRooms") List chatRooms}); } /// @nodoc -class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> extends _$ChatRoomPreviewModelCopyWithImpl<$Res, _$ChatRoomPreviewModelImpl> +class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> + extends _$ChatRoomPreviewModelCopyWithImpl<$Res, _$ChatRoomPreviewModelImpl> implements _$$ChatRoomPreviewModelImplCopyWith<$Res> { - __$$ChatRoomPreviewModelImplCopyWithImpl(_$ChatRoomPreviewModelImpl _value, $Res Function(_$ChatRoomPreviewModelImpl) _then) : super(_value, _then); + __$$ChatRoomPreviewModelImplCopyWithImpl(_$ChatRoomPreviewModelImpl _value, + $Res Function(_$ChatRoomPreviewModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @@ -101,12 +107,14 @@ class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res> extends _$ChatRoomPreviewMo /// @nodoc @JsonSerializable() class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { - const _$ChatRoomPreviewModelImpl({@JsonKey(name: "chatRooms") required final List chatRooms}) : _chatRooms = chatRooms; + const _$ChatRoomPreviewModelImpl( + {@JsonKey(name: "chatRooms") required final List chatRooms}) + : _chatRooms = chatRooms; - factory _$ChatRoomPreviewModelImpl.fromJson(Map json) => _$$ChatRoomPreviewModelImplFromJson(json); + factory _$ChatRoomPreviewModelImpl.fromJson(Map json) => + _$$ChatRoomPreviewModelImplFromJson(json); final List _chatRooms; - @override @JsonKey(name: "chatRooms") List get chatRooms { @@ -123,20 +131,26 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatRoomPreviewModelImpl && const DeepCollectionEquality().equals(other._chatRooms, _chatRooms)); + (other.runtimeType == runtimeType && + other is _$ChatRoomPreviewModelImpl && + const DeepCollectionEquality() + .equals(other._chatRooms, _chatRooms)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); /// Create a copy of ChatRoomPreviewModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => - __$$ChatRoomPreviewModelImplCopyWithImpl<_$ChatRoomPreviewModelImpl>(this, _$identity); + _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> + get copyWith => + __$$ChatRoomPreviewModelImplCopyWithImpl<_$ChatRoomPreviewModelImpl>( + this, _$identity); @override Map toJson() { @@ -147,9 +161,12 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { } abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel { - const factory _ChatRoomPreviewModel({@JsonKey(name: "chatRooms") required final List chatRooms}) = _$ChatRoomPreviewModelImpl; + const factory _ChatRoomPreviewModel( + {@JsonKey(name: "chatRooms") + required final List chatRooms}) = _$ChatRoomPreviewModelImpl; - factory _ChatRoomPreviewModel.fromJson(Map json) = _$ChatRoomPreviewModelImpl.fromJson; + factory _ChatRoomPreviewModel.fromJson(Map json) = + _$ChatRoomPreviewModelImpl.fromJson; @override @JsonKey(name: "chatRooms") @@ -159,7 +176,8 @@ abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> + get copyWith => throw _privateConstructorUsedError; } ChatRoom _$ChatRoomFromJson(Map json) { @@ -170,13 +188,10 @@ ChatRoom _$ChatRoomFromJson(Map json) { mixin _$ChatRoom { @JsonKey(name: "id") String get id => throw _privateConstructorUsedError; - @JsonKey(name: "room_name") String get roomName => throw _privateConstructorUsedError; - @JsonKey(name: "last_message") dynamic get lastMessage => throw _privateConstructorUsedError; - @JsonKey(name: "users") Users get users => throw _privateConstructorUsedError; @@ -186,13 +201,14 @@ mixin _$ChatRoom { /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomCopyWith<$Res> { - factory $ChatRoomCopyWith(ChatRoom value, $Res Function(ChatRoom) then) = _$ChatRoomCopyWithImpl<$Res, ChatRoom>; - + factory $ChatRoomCopyWith(ChatRoom value, $Res Function(ChatRoom) then) = + _$ChatRoomCopyWithImpl<$Res, ChatRoom>; @useResult $Res call( {@JsonKey(name: "id") String id, @@ -204,12 +220,12 @@ abstract class $ChatRoomCopyWith<$Res> { } /// @nodoc -class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> implements $ChatRoomCopyWith<$Res> { +class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> + implements $ChatRoomCopyWith<$Res> { _$ChatRoomCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -255,9 +271,11 @@ class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom> implements $ChatRoomCo } /// @nodoc -abstract class _$$ChatRoomImplCopyWith<$Res> implements $ChatRoomCopyWith<$Res> { - factory _$$ChatRoomImplCopyWith(_$ChatRoomImpl value, $Res Function(_$ChatRoomImpl) then) = __$$ChatRoomImplCopyWithImpl<$Res>; - +abstract class _$$ChatRoomImplCopyWith<$Res> + implements $ChatRoomCopyWith<$Res> { + factory _$$ChatRoomImplCopyWith( + _$ChatRoomImpl value, $Res Function(_$ChatRoomImpl) then) = + __$$ChatRoomImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -271,8 +289,12 @@ abstract class _$$ChatRoomImplCopyWith<$Res> implements $ChatRoomCopyWith<$Res> } /// @nodoc -class __$$ChatRoomImplCopyWithImpl<$Res> extends _$ChatRoomCopyWithImpl<$Res, _$ChatRoomImpl> implements _$$ChatRoomImplCopyWith<$Res> { - __$$ChatRoomImplCopyWithImpl(_$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then) : super(_value, _then); +class __$$ChatRoomImplCopyWithImpl<$Res> + extends _$ChatRoomCopyWithImpl<$Res, _$ChatRoomImpl> + implements _$$ChatRoomImplCopyWith<$Res> { + __$$ChatRoomImplCopyWithImpl( + _$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @@ -314,7 +336,8 @@ class _$ChatRoomImpl implements _ChatRoom { @JsonKey(name: "last_message") required this.lastMessage, @JsonKey(name: "users") required this.users}); - factory _$ChatRoomImpl.fromJson(Map json) => _$$ChatRoomImplFromJson(json); + factory _$ChatRoomImpl.fromJson(Map json) => + _$$ChatRoomImplFromJson(json); @override @JsonKey(name: "id") @@ -340,21 +363,25 @@ class _$ChatRoomImpl implements _ChatRoom { (other.runtimeType == runtimeType && other is _$ChatRoomImpl && (identical(other.id, id) || other.id == id) && - (identical(other.roomName, roomName) || other.roomName == roomName) && - const DeepCollectionEquality().equals(other.lastMessage, lastMessage) && + (identical(other.roomName, roomName) || + other.roomName == roomName) && + const DeepCollectionEquality() + .equals(other.lastMessage, lastMessage) && (identical(other.users, users) || other.users == users)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, roomName, const DeepCollectionEquality().hash(lastMessage), users); + int get hashCode => Object.hash(runtimeType, id, roomName, + const DeepCollectionEquality().hash(lastMessage), users); /// Create a copy of ChatRoom /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => __$$ChatRoomImplCopyWithImpl<_$ChatRoomImpl>(this, _$identity); + _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => + __$$ChatRoomImplCopyWithImpl<_$ChatRoomImpl>(this, _$identity); @override Map toJson() { @@ -371,20 +398,18 @@ abstract class _ChatRoom implements ChatRoom { @JsonKey(name: "last_message") required final dynamic lastMessage, @JsonKey(name: "users") required final Users users}) = _$ChatRoomImpl; - factory _ChatRoom.fromJson(Map json) = _$ChatRoomImpl.fromJson; + factory _ChatRoom.fromJson(Map json) = + _$ChatRoomImpl.fromJson; @override @JsonKey(name: "id") String get id; - @override @JsonKey(name: "room_name") String get roomName; - @override @JsonKey(name: "last_message") dynamic get lastMessage; - @override @JsonKey(name: "users") Users get users; @@ -393,7 +418,8 @@ abstract class _ChatRoom implements ChatRoom { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => + throw _privateConstructorUsedError; } LastMessageClass _$LastMessageClassFromJson(Map json) { @@ -404,22 +430,16 @@ LastMessageClass _$LastMessageClassFromJson(Map json) { mixin _$LastMessageClass { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "data") String get data => throw _privateConstructorUsedError; - @JsonKey(name: "media_data") List get mediaData => throw _privateConstructorUsedError; - @JsonKey(name: "author_id") int get authorId => throw _privateConstructorUsedError; - @JsonKey(name: "is_author_message_auth_user") bool get isAuthorMessageAuthUser => throw _privateConstructorUsedError; - @JsonKey(name: "read_by_to_user") bool get readByToUser => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; @@ -429,31 +449,34 @@ mixin _$LastMessageClass { /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $LastMessageClassCopyWith get copyWith => throw _privateConstructorUsedError; + $LastMessageClassCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $LastMessageClassCopyWith<$Res> { - factory $LastMessageClassCopyWith(LastMessageClass value, $Res Function(LastMessageClass) then) = _$LastMessageClassCopyWithImpl<$Res, LastMessageClass>; - + factory $LastMessageClassCopyWith( + LastMessageClass value, $Res Function(LastMessageClass) then) = + _$LastMessageClassCopyWithImpl<$Res, LastMessageClass>; @useResult $Res call( {@JsonKey(name: "id") int id, @JsonKey(name: "data") String data, @JsonKey(name: "media_data") List mediaData, @JsonKey(name: "author_id") int authorId, - @JsonKey(name: "is_author_message_auth_user") bool isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") + bool isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") bool readByToUser, @JsonKey(name: "updated_at") DateTime updatedAt}); } /// @nodoc -class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> implements $LastMessageClassCopyWith<$Res> { +class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> + implements $LastMessageClassCopyWith<$Res> { _$LastMessageClassCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -504,10 +527,11 @@ class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass> implem } /// @nodoc -abstract class _$$LastMessageClassImplCopyWith<$Res> implements $LastMessageClassCopyWith<$Res> { - factory _$$LastMessageClassImplCopyWith(_$LastMessageClassImpl value, $Res Function(_$LastMessageClassImpl) then) = +abstract class _$$LastMessageClassImplCopyWith<$Res> + implements $LastMessageClassCopyWith<$Res> { + factory _$$LastMessageClassImplCopyWith(_$LastMessageClassImpl value, + $Res Function(_$LastMessageClassImpl) then) = __$$LastMessageClassImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -515,15 +539,19 @@ abstract class _$$LastMessageClassImplCopyWith<$Res> implements $LastMessageClas @JsonKey(name: "data") String data, @JsonKey(name: "media_data") List mediaData, @JsonKey(name: "author_id") int authorId, - @JsonKey(name: "is_author_message_auth_user") bool isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") + bool isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") bool readByToUser, @JsonKey(name: "updated_at") DateTime updatedAt}); } /// @nodoc -class __$$LastMessageClassImplCopyWithImpl<$Res> extends _$LastMessageClassCopyWithImpl<$Res, _$LastMessageClassImpl> +class __$$LastMessageClassImplCopyWithImpl<$Res> + extends _$LastMessageClassCopyWithImpl<$Res, _$LastMessageClassImpl> implements _$$LastMessageClassImplCopyWith<$Res> { - __$$LastMessageClassImplCopyWithImpl(_$LastMessageClassImpl _value, $Res Function(_$LastMessageClassImpl) _then) : super(_value, _then); + __$$LastMessageClassImplCopyWithImpl(_$LastMessageClassImpl _value, + $Res Function(_$LastMessageClassImpl) _then) + : super(_value, _then); /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @@ -579,12 +607,14 @@ class _$LastMessageClassImpl implements _LastMessageClass { @JsonKey(name: "data") required this.data, @JsonKey(name: "media_data") required final List mediaData, @JsonKey(name: "author_id") required this.authorId, - @JsonKey(name: "is_author_message_auth_user") required this.isAuthorMessageAuthUser, + @JsonKey(name: "is_author_message_auth_user") + required this.isAuthorMessageAuthUser, @JsonKey(name: "read_by_to_user") required this.readByToUser, @JsonKey(name: "updated_at") required this.updatedAt}) : _mediaData = mediaData; - factory _$LastMessageClassImpl.fromJson(Map json) => _$$LastMessageClassImplFromJson(json); + factory _$LastMessageClassImpl.fromJson(Map json) => + _$$LastMessageClassImplFromJson(json); @override @JsonKey(name: "id") @@ -593,7 +623,6 @@ class _$LastMessageClassImpl implements _LastMessageClass { @JsonKey(name: "data") final String data; final List _mediaData; - @override @JsonKey(name: "media_data") List get mediaData { @@ -627,24 +656,39 @@ class _$LastMessageClassImpl implements _LastMessageClass { other is _$LastMessageClassImpl && (identical(other.id, id) || other.id == id) && (identical(other.data, data) || other.data == data) && - const DeepCollectionEquality().equals(other._mediaData, _mediaData) && - (identical(other.authorId, authorId) || other.authorId == authorId) && - (identical(other.isAuthorMessageAuthUser, isAuthorMessageAuthUser) || other.isAuthorMessageAuthUser == isAuthorMessageAuthUser) && - (identical(other.readByToUser, readByToUser) || other.readByToUser == readByToUser) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + const DeepCollectionEquality() + .equals(other._mediaData, _mediaData) && + (identical(other.authorId, authorId) || + other.authorId == authorId) && + (identical( + other.isAuthorMessageAuthUser, isAuthorMessageAuthUser) || + other.isAuthorMessageAuthUser == isAuthorMessageAuthUser) && + (identical(other.readByToUser, readByToUser) || + other.readByToUser == readByToUser) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => - Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, isAuthorMessageAuthUser, readByToUser, updatedAt); + int get hashCode => Object.hash( + runtimeType, + id, + data, + const DeepCollectionEquality().hash(_mediaData), + authorId, + isAuthorMessageAuthUser, + readByToUser, + updatedAt); /// Create a copy of LastMessageClass /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => __$$LastMessageClassImplCopyWithImpl<_$LastMessageClassImpl>(this, _$identity); + _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => + __$$LastMessageClassImplCopyWithImpl<_$LastMessageClassImpl>( + this, _$identity); @override Map toJson() { @@ -656,40 +700,37 @@ class _$LastMessageClassImpl implements _LastMessageClass { abstract class _LastMessageClass implements LastMessageClass { const factory _LastMessageClass( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "data") required final String data, - @JsonKey(name: "media_data") required final List mediaData, - @JsonKey(name: "author_id") required final int authorId, - @JsonKey(name: "is_author_message_auth_user") required final bool isAuthorMessageAuthUser, - @JsonKey(name: "read_by_to_user") required final bool readByToUser, - @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$LastMessageClassImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "data") required final String data, + @JsonKey(name: "media_data") required final List mediaData, + @JsonKey(name: "author_id") required final int authorId, + @JsonKey(name: "is_author_message_auth_user") + required final bool isAuthorMessageAuthUser, + @JsonKey(name: "read_by_to_user") required final bool readByToUser, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = + _$LastMessageClassImpl; - factory _LastMessageClass.fromJson(Map json) = _$LastMessageClassImpl.fromJson; + factory _LastMessageClass.fromJson(Map json) = + _$LastMessageClassImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "data") String get data; - @override @JsonKey(name: "media_data") List get mediaData; - @override @JsonKey(name: "author_id") int get authorId; - @override @JsonKey(name: "is_author_message_auth_user") bool get isAuthorMessageAuthUser; - @override @JsonKey(name: "read_by_to_user") bool get readByToUser; - @override @JsonKey(name: "updated_at") DateTime get updatedAt; @@ -698,7 +739,8 @@ abstract class _LastMessageClass implements LastMessageClass { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => throw _privateConstructorUsedError; + _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => + throw _privateConstructorUsedError; } Users _$UsersFromJson(Map json) { @@ -709,7 +751,6 @@ Users _$UsersFromJson(Map json) { mixin _$Users { @JsonKey(name: "from_chat_user") ChatUser get fromChatUser => throw _privateConstructorUsedError; - @JsonKey(name: "to_chat_user") ChatUser get toChatUser => throw _privateConstructorUsedError; @@ -724,23 +765,24 @@ mixin _$Users { /// @nodoc abstract class $UsersCopyWith<$Res> { - factory $UsersCopyWith(Users value, $Res Function(Users) then) = _$UsersCopyWithImpl<$Res, Users>; - + factory $UsersCopyWith(Users value, $Res Function(Users) then) = + _$UsersCopyWithImpl<$Res, Users>; @useResult - $Res call({@JsonKey(name: "from_chat_user") ChatUser fromChatUser, @JsonKey(name: "to_chat_user") ChatUser toChatUser}); + $Res call( + {@JsonKey(name: "from_chat_user") ChatUser fromChatUser, + @JsonKey(name: "to_chat_user") ChatUser toChatUser}); $ChatUserCopyWith<$Res> get fromChatUser; - $ChatUserCopyWith<$Res> get toChatUser; } /// @nodoc -class _$UsersCopyWithImpl<$Res, $Val extends Users> implements $UsersCopyWith<$Res> { +class _$UsersCopyWithImpl<$Res, $Val extends Users> + implements $UsersCopyWith<$Res> { _$UsersCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -787,22 +829,28 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users> implements $UsersCopyWith<$R /// @nodoc abstract class _$$UsersImplCopyWith<$Res> implements $UsersCopyWith<$Res> { - factory _$$UsersImplCopyWith(_$UsersImpl value, $Res Function(_$UsersImpl) then) = __$$UsersImplCopyWithImpl<$Res>; - + factory _$$UsersImplCopyWith( + _$UsersImpl value, $Res Function(_$UsersImpl) then) = + __$$UsersImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "from_chat_user") ChatUser fromChatUser, @JsonKey(name: "to_chat_user") ChatUser toChatUser}); + $Res call( + {@JsonKey(name: "from_chat_user") ChatUser fromChatUser, + @JsonKey(name: "to_chat_user") ChatUser toChatUser}); @override $ChatUserCopyWith<$Res> get fromChatUser; - @override $ChatUserCopyWith<$Res> get toChatUser; } /// @nodoc -class __$$UsersImplCopyWithImpl<$Res> extends _$UsersCopyWithImpl<$Res, _$UsersImpl> implements _$$UsersImplCopyWith<$Res> { - __$$UsersImplCopyWithImpl(_$UsersImpl _value, $Res Function(_$UsersImpl) _then) : super(_value, _then); +class __$$UsersImplCopyWithImpl<$Res> + extends _$UsersCopyWithImpl<$Res, _$UsersImpl> + implements _$$UsersImplCopyWith<$Res> { + __$$UsersImplCopyWithImpl( + _$UsersImpl _value, $Res Function(_$UsersImpl) _then) + : super(_value, _then); /// Create a copy of Users /// with the given fields replaced by the non-null parameter values. @@ -828,9 +876,12 @@ class __$$UsersImplCopyWithImpl<$Res> extends _$UsersCopyWithImpl<$Res, _$UsersI /// @nodoc @JsonSerializable() class _$UsersImpl implements _Users { - const _$UsersImpl({@JsonKey(name: "from_chat_user") required this.fromChatUser, @JsonKey(name: "to_chat_user") required this.toChatUser}); + const _$UsersImpl( + {@JsonKey(name: "from_chat_user") required this.fromChatUser, + @JsonKey(name: "to_chat_user") required this.toChatUser}); - factory _$UsersImpl.fromJson(Map json) => _$$UsersImplFromJson(json); + factory _$UsersImpl.fromJson(Map json) => + _$$UsersImplFromJson(json); @override @JsonKey(name: "from_chat_user") @@ -849,8 +900,10 @@ class _$UsersImpl implements _Users { return identical(this, other) || (other.runtimeType == runtimeType && other is _$UsersImpl && - (identical(other.fromChatUser, fromChatUser) || other.fromChatUser == fromChatUser) && - (identical(other.toChatUser, toChatUser) || other.toChatUser == toChatUser)); + (identical(other.fromChatUser, fromChatUser) || + other.fromChatUser == fromChatUser) && + (identical(other.toChatUser, toChatUser) || + other.toChatUser == toChatUser)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -862,7 +915,8 @@ class _$UsersImpl implements _Users { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UsersImplCopyWith<_$UsersImpl> get copyWith => __$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity); + _$$UsersImplCopyWith<_$UsersImpl> get copyWith => + __$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity); @override Map toJson() { @@ -874,14 +928,15 @@ class _$UsersImpl implements _Users { abstract class _Users implements Users { const factory _Users( - {@JsonKey(name: "from_chat_user") required final ChatUser fromChatUser, @JsonKey(name: "to_chat_user") required final ChatUser toChatUser}) = _$UsersImpl; + {@JsonKey(name: "from_chat_user") required final ChatUser fromChatUser, + @JsonKey(name: "to_chat_user") + required final ChatUser toChatUser}) = _$UsersImpl; factory _Users.fromJson(Map json) = _$UsersImpl.fromJson; @override @JsonKey(name: "from_chat_user") ChatUser get fromChatUser; - @override @JsonKey(name: "to_chat_user") ChatUser get toChatUser; @@ -890,7 +945,8 @@ abstract class _Users implements Users { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$UsersImplCopyWith<_$UsersImpl> get copyWith => throw _privateConstructorUsedError; + _$$UsersImplCopyWith<_$UsersImpl> get copyWith => + throw _privateConstructorUsedError; } ChatUser _$ChatUserFromJson(Map json) { @@ -901,13 +957,10 @@ ChatUser _$ChatUserFromJson(Map json) { mixin _$ChatUser { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "profile_photo_path") String? get profilePhotoPath => throw _privateConstructorUsedError; - @JsonKey(name: "profile_photo_url") String get profilePhotoUrl => throw _privateConstructorUsedError; @@ -917,13 +970,14 @@ mixin _$ChatUser { /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatUserCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatUserCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatUserCopyWith<$Res> { - factory $ChatUserCopyWith(ChatUser value, $Res Function(ChatUser) then) = _$ChatUserCopyWithImpl<$Res, ChatUser>; - + factory $ChatUserCopyWith(ChatUser value, $Res Function(ChatUser) then) = + _$ChatUserCopyWithImpl<$Res, ChatUser>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -933,12 +987,12 @@ abstract class $ChatUserCopyWith<$Res> { } /// @nodoc -class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> implements $ChatUserCopyWith<$Res> { +class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> + implements $ChatUserCopyWith<$Res> { _$ChatUserCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -974,9 +1028,11 @@ class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser> implements $ChatUserCo } /// @nodoc -abstract class _$$ChatUserImplCopyWith<$Res> implements $ChatUserCopyWith<$Res> { - factory _$$ChatUserImplCopyWith(_$ChatUserImpl value, $Res Function(_$ChatUserImpl) then) = __$$ChatUserImplCopyWithImpl<$Res>; - +abstract class _$$ChatUserImplCopyWith<$Res> + implements $ChatUserCopyWith<$Res> { + factory _$$ChatUserImplCopyWith( + _$ChatUserImpl value, $Res Function(_$ChatUserImpl) then) = + __$$ChatUserImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -987,8 +1043,12 @@ abstract class _$$ChatUserImplCopyWith<$Res> implements $ChatUserCopyWith<$Res> } /// @nodoc -class __$$ChatUserImplCopyWithImpl<$Res> extends _$ChatUserCopyWithImpl<$Res, _$ChatUserImpl> implements _$$ChatUserImplCopyWith<$Res> { - __$$ChatUserImplCopyWithImpl(_$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then) : super(_value, _then); +class __$$ChatUserImplCopyWithImpl<$Res> + extends _$ChatUserCopyWithImpl<$Res, _$ChatUserImpl> + implements _$$ChatUserImplCopyWith<$Res> { + __$$ChatUserImplCopyWithImpl( + _$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then) + : super(_value, _then); /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @@ -1030,7 +1090,8 @@ class _$ChatUserImpl implements _ChatUser { @JsonKey(name: "profile_photo_path") required this.profilePhotoPath, @JsonKey(name: "profile_photo_url") required this.profilePhotoUrl}); - factory _$ChatUserImpl.fromJson(Map json) => _$$ChatUserImplFromJson(json); + factory _$ChatUserImpl.fromJson(Map json) => + _$$ChatUserImplFromJson(json); @override @JsonKey(name: "id") @@ -1057,20 +1118,24 @@ class _$ChatUserImpl implements _ChatUser { other is _$ChatUserImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.profilePhotoPath, profilePhotoPath) || other.profilePhotoPath == profilePhotoPath) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoPath, profilePhotoPath) || + other.profilePhotoPath == profilePhotoPath) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || + other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); + int get hashCode => + Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); /// Create a copy of ChatUser /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => __$$ChatUserImplCopyWithImpl<_$ChatUserImpl>(this, _$identity); + _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => + __$$ChatUserImplCopyWithImpl<_$ChatUserImpl>(this, _$identity); @override Map toJson() { @@ -1084,23 +1149,23 @@ abstract class _ChatUser implements ChatUser { const factory _ChatUser( {@JsonKey(name: "id") required final int id, @JsonKey(name: "name") required final String name, - @JsonKey(name: "profile_photo_path") required final String? profilePhotoPath, - @JsonKey(name: "profile_photo_url") required final String profilePhotoUrl}) = _$ChatUserImpl; + @JsonKey(name: "profile_photo_path") + required final String? profilePhotoPath, + @JsonKey(name: "profile_photo_url") + required final String profilePhotoUrl}) = _$ChatUserImpl; - factory _ChatUser.fromJson(Map json) = _$ChatUserImpl.fromJson; + factory _ChatUser.fromJson(Map json) = + _$ChatUserImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "profile_photo_path") String? get profilePhotoPath; - @override @JsonKey(name: "profile_photo_url") String get profilePhotoUrl; @@ -1109,5 +1174,6 @@ abstract class _ChatUser implements ChatUser { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_preview_model.g.dart b/lib/features/chat/models/chat_room_preview_model.g.dart index ef589a94..5ae3f709 100644 --- a/lib/features/chat/models/chat_room_preview_model.g.dart +++ b/lib/features/chat/models/chat_room_preview_model.g.dart @@ -6,29 +6,39 @@ part of 'chat_room_preview_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson(Map json) => _$ChatRoomPreviewModelImpl( - chatRooms: (json['chatRooms'] as List).map((e) => ChatRoom.fromJson(e as Map)).toList(), +_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson( + Map json) => + _$ChatRoomPreviewModelImpl( + chatRooms: (json['chatRooms'] as List) + .map((e) => ChatRoom.fromJson(e as Map)) + .toList(), ); -Map _$$ChatRoomPreviewModelImplToJson(_$ChatRoomPreviewModelImpl instance) => { +Map _$$ChatRoomPreviewModelImplToJson( + _$ChatRoomPreviewModelImpl instance) => + { 'chatRooms': instance.chatRooms, }; -_$ChatRoomImpl _$$ChatRoomImplFromJson(Map json) => _$ChatRoomImpl( +_$ChatRoomImpl _$$ChatRoomImplFromJson(Map json) => + _$ChatRoomImpl( id: json['id'] as String, roomName: json['room_name'] as String, lastMessage: json['last_message'], users: Users.fromJson(json['users'] as Map), ); -Map _$$ChatRoomImplToJson(_$ChatRoomImpl instance) => { +Map _$$ChatRoomImplToJson(_$ChatRoomImpl instance) => + { 'id': instance.id, 'room_name': instance.roomName, 'last_message': instance.lastMessage, 'users': instance.users, }; -_$LastMessageClassImpl _$$LastMessageClassImplFromJson(Map json) => _$LastMessageClassImpl( +_$LastMessageClassImpl _$$LastMessageClassImplFromJson( + Map json) => + _$LastMessageClassImpl( id: (json['id'] as num).toInt(), data: json['data'] as String, mediaData: json['media_data'] as List, @@ -38,7 +48,9 @@ _$LastMessageClassImpl _$$LastMessageClassImplFromJson(Map json updatedAt: DateTime.parse(json['updated_at'] as String), ); -Map _$$LastMessageClassImplToJson(_$LastMessageClassImpl instance) => { +Map _$$LastMessageClassImplToJson( + _$LastMessageClassImpl instance) => + { 'id': instance.id, 'data': instance.data, 'media_data': instance.mediaData, @@ -49,23 +61,28 @@ Map _$$LastMessageClassImplToJson(_$LastMessageClassImpl instan }; _$UsersImpl _$$UsersImplFromJson(Map json) => _$UsersImpl( - fromChatUser: ChatUser.fromJson(json['from_chat_user'] as Map), - toChatUser: ChatUser.fromJson(json['to_chat_user'] as Map), + fromChatUser: + ChatUser.fromJson(json['from_chat_user'] as Map), + toChatUser: + ChatUser.fromJson(json['to_chat_user'] as Map), ); -Map _$$UsersImplToJson(_$UsersImpl instance) => { +Map _$$UsersImplToJson(_$UsersImpl instance) => + { 'from_chat_user': instance.fromChatUser, 'to_chat_user': instance.toChatUser, }; -_$ChatUserImpl _$$ChatUserImplFromJson(Map json) => _$ChatUserImpl( +_$ChatUserImpl _$$ChatUserImplFromJson(Map json) => + _$ChatUserImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, profilePhotoPath: json['profile_photo_path'] as String?, profilePhotoUrl: json['profile_photo_url'] as String, ); -Map _$$ChatUserImplToJson(_$ChatUserImpl instance) => { +Map _$$ChatUserImplToJson(_$ChatUserImpl instance) => + { 'id': instance.id, 'name': instance.name, 'profile_photo_path': instance.profilePhotoPath, diff --git a/lib/features/chat/models/chat_room_settings_model.freezed.dart b/lib/features/chat/models/chat_room_settings_model.freezed.dart index 76419b76..9d12eefa 100644 --- a/lib/features/chat/models/chat_room_settings_model.freezed.dart +++ b/lib/features/chat/models/chat_room_settings_model.freezed.dart @@ -14,22 +14,19 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson(Map json) { +ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson( + Map json) { return _ChatRoomSettingsModel.fromJson(json); } /// @nodoc mixin _$ChatRoomSettingsModel { int get id => throw _privateConstructorUsedError; - @JsonKey(name: 'room_name') String get roomName => throw _privateConstructorUsedError; - String get state => throw _privateConstructorUsedError; - @JsonKey(name: 'access_level') String get accessLevel => throw _privateConstructorUsedError; - @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; @@ -39,14 +36,15 @@ mixin _$ChatRoomSettingsModel { /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatRoomSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatRoomSettingsModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatRoomSettingsModelCopyWith<$Res> { - factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value, $Res Function(ChatRoomSettingsModel) then) = + factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value, + $Res Function(ChatRoomSettingsModel) then) = _$ChatRoomSettingsModelCopyWithImpl<$Res, ChatRoomSettingsModel>; - @useResult $Res call( {int id, @@ -57,12 +55,13 @@ abstract class $ChatRoomSettingsModelCopyWith<$Res> { } /// @nodoc -class _$ChatRoomSettingsModelCopyWithImpl<$Res, $Val extends ChatRoomSettingsModel> implements $ChatRoomSettingsModelCopyWith<$Res> { +class _$ChatRoomSettingsModelCopyWithImpl<$Res, + $Val extends ChatRoomSettingsModel> + implements $ChatRoomSettingsModelCopyWith<$Res> { _$ChatRoomSettingsModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -103,10 +102,12 @@ class _$ChatRoomSettingsModelCopyWithImpl<$Res, $Val extends ChatRoomSettingsMod } /// @nodoc -abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> implements $ChatRoomSettingsModelCopyWith<$Res> { - factory _$$ChatRoomSettingsModelImplCopyWith(_$ChatRoomSettingsModelImpl value, $Res Function(_$ChatRoomSettingsModelImpl) then) = +abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> + implements $ChatRoomSettingsModelCopyWith<$Res> { + factory _$$ChatRoomSettingsModelImplCopyWith( + _$ChatRoomSettingsModelImpl value, + $Res Function(_$ChatRoomSettingsModelImpl) then) = __$$ChatRoomSettingsModelImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -118,9 +119,13 @@ abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res> implements $ChatRoomSe } /// @nodoc -class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res> extends _$ChatRoomSettingsModelCopyWithImpl<$Res, _$ChatRoomSettingsModelImpl> +class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res> + extends _$ChatRoomSettingsModelCopyWithImpl<$Res, + _$ChatRoomSettingsModelImpl> implements _$$ChatRoomSettingsModelImplCopyWith<$Res> { - __$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value, $Res Function(_$ChatRoomSettingsModelImpl) _then) : super(_value, _then); + __$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value, + $Res Function(_$ChatRoomSettingsModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @@ -168,7 +173,8 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { @JsonKey(name: 'access_level') required this.accessLevel, @JsonKey(name: 'updated_at') required this.updatedAt}); - factory _$ChatRoomSettingsModelImpl.fromJson(Map json) => _$$ChatRoomSettingsModelImplFromJson(json); + factory _$ChatRoomSettingsModelImpl.fromJson(Map json) => + _$$ChatRoomSettingsModelImplFromJson(json); @override final int id; @@ -195,23 +201,28 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { (other.runtimeType == runtimeType && other is _$ChatRoomSettingsModelImpl && (identical(other.id, id) || other.id == id) && - (identical(other.roomName, roomName) || other.roomName == roomName) && + (identical(other.roomName, roomName) || + other.roomName == roomName) && (identical(other.state, state) || other.state == state) && - (identical(other.accessLevel, accessLevel) || other.accessLevel == accessLevel) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + (identical(other.accessLevel, accessLevel) || + other.accessLevel == accessLevel) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); + int get hashCode => + Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); /// Create a copy of ChatRoomSettingsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => - __$$ChatRoomSettingsModelImplCopyWithImpl<_$ChatRoomSettingsModelImpl>(this, _$identity); + _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> + get copyWith => __$$ChatRoomSettingsModelImplCopyWithImpl< + _$ChatRoomSettingsModelImpl>(this, _$identity); @override Map toJson() { @@ -223,28 +234,26 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel { const factory _ChatRoomSettingsModel( - {required final int id, - @JsonKey(name: 'room_name') required final String roomName, - required final String state, - @JsonKey(name: 'access_level') required final String accessLevel, - @JsonKey(name: 'updated_at') required final String updatedAt}) = _$ChatRoomSettingsModelImpl; + {required final int id, + @JsonKey(name: 'room_name') required final String roomName, + required final String state, + @JsonKey(name: 'access_level') required final String accessLevel, + @JsonKey(name: 'updated_at') required final String updatedAt}) = + _$ChatRoomSettingsModelImpl; - factory _ChatRoomSettingsModel.fromJson(Map json) = _$ChatRoomSettingsModelImpl.fromJson; + factory _ChatRoomSettingsModel.fromJson(Map json) = + _$ChatRoomSettingsModelImpl.fromJson; @override int get id; - @override @JsonKey(name: 'room_name') String get roomName; - @override String get state; - @override @JsonKey(name: 'access_level') String get accessLevel; - @override @JsonKey(name: 'updated_at') String get updatedAt; @@ -253,5 +262,6 @@ abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_room_settings_model.g.dart b/lib/features/chat/models/chat_room_settings_model.g.dart index 1a2ef327..7b824334 100644 --- a/lib/features/chat/models/chat_room_settings_model.g.dart +++ b/lib/features/chat/models/chat_room_settings_model.g.dart @@ -6,7 +6,9 @@ part of 'chat_room_settings_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson(Map json) => _$ChatRoomSettingsModelImpl( +_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson( + Map json) => + _$ChatRoomSettingsModelImpl( id: (json['id'] as num).toInt(), roomName: json['room_name'] as String, state: json['state'] as String, @@ -14,7 +16,9 @@ _$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson(Map _$$ChatRoomSettingsModelImplToJson(_$ChatRoomSettingsModelImpl instance) => { +Map _$$ChatRoomSettingsModelImplToJson( + _$ChatRoomSettingsModelImpl instance) => + { 'id': instance.id, 'room_name': instance.roomName, 'state': instance.state, diff --git a/lib/features/chat/models/chat_user_model.freezed.dart b/lib/features/chat/models/chat_user_model.freezed.dart index 166e3870..94718168 100644 --- a/lib/features/chat/models/chat_user_model.freezed.dart +++ b/lib/features/chat/models/chat_user_model.freezed.dart @@ -21,12 +21,9 @@ ChatUserModel _$ChatUserModelFromJson(Map json) { /// @nodoc mixin _$ChatUserModel { int get id => throw _privateConstructorUsedError; - String get name => throw _privateConstructorUsedError; - @JsonKey(name: 'profile_photo_path') String? get profilePhotoPath => throw _privateConstructorUsedError; - @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl => throw _privateConstructorUsedError; @@ -36,24 +33,30 @@ mixin _$ChatUserModel { /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ChatUserModelCopyWith get copyWith => throw _privateConstructorUsedError; + $ChatUserModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ChatUserModelCopyWith<$Res> { - factory $ChatUserModelCopyWith(ChatUserModel value, $Res Function(ChatUserModel) then) = _$ChatUserModelCopyWithImpl<$Res, ChatUserModel>; - + factory $ChatUserModelCopyWith( + ChatUserModel value, $Res Function(ChatUserModel) then) = + _$ChatUserModelCopyWithImpl<$Res, ChatUserModel>; @useResult - $Res call({int id, String name, @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); + $Res call( + {int id, + String name, + @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, + @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); } /// @nodoc -class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> implements $ChatUserModelCopyWith<$Res> { +class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> + implements $ChatUserModelCopyWith<$Res> { _$ChatUserModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -89,17 +92,27 @@ class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel> implements $ } /// @nodoc -abstract class _$$ChatUserModelImplCopyWith<$Res> implements $ChatUserModelCopyWith<$Res> { - factory _$$ChatUserModelImplCopyWith(_$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) = __$$ChatUserModelImplCopyWithImpl<$Res>; - +abstract class _$$ChatUserModelImplCopyWith<$Res> + implements $ChatUserModelCopyWith<$Res> { + factory _$$ChatUserModelImplCopyWith( + _$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) = + __$$ChatUserModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({int id, String name, @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); + $Res call( + {int id, + String name, + @JsonKey(name: 'profile_photo_path') String? profilePhotoPath, + @JsonKey(name: 'profile_photo_url') String? profilePhotoUrl}); } /// @nodoc -class __$$ChatUserModelImplCopyWithImpl<$Res> extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl> implements _$$ChatUserModelImplCopyWith<$Res> { - __$$ChatUserModelImplCopyWithImpl(_$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then) : super(_value, _then); +class __$$ChatUserModelImplCopyWithImpl<$Res> + extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl> + implements _$$ChatUserModelImplCopyWith<$Res> { + __$$ChatUserModelImplCopyWithImpl( + _$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then) + : super(_value, _then); /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @@ -141,7 +154,8 @@ class _$ChatUserModelImpl implements _ChatUserModel { @JsonKey(name: 'profile_photo_path') this.profilePhotoPath, @JsonKey(name: 'profile_photo_url') this.profilePhotoUrl}); - factory _$ChatUserModelImpl.fromJson(Map json) => _$$ChatUserModelImplFromJson(json); + factory _$ChatUserModelImpl.fromJson(Map json) => + _$$ChatUserModelImplFromJson(json); @override final int id; @@ -166,20 +180,24 @@ class _$ChatUserModelImpl implements _ChatUserModel { other is _$ChatUserModelImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.profilePhotoPath, profilePhotoPath) || other.profilePhotoPath == profilePhotoPath) && - (identical(other.profilePhotoUrl, profilePhotoUrl) || other.profilePhotoUrl == profilePhotoUrl)); + (identical(other.profilePhotoPath, profilePhotoPath) || + other.profilePhotoPath == profilePhotoPath) && + (identical(other.profilePhotoUrl, profilePhotoUrl) || + other.profilePhotoUrl == profilePhotoUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); + int get hashCode => + Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); /// Create a copy of ChatUserModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); + _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => + __$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity); @override Map toJson() { @@ -191,23 +209,22 @@ class _$ChatUserModelImpl implements _ChatUserModel { abstract class _ChatUserModel implements ChatUserModel { const factory _ChatUserModel( - {required final int id, - required final String name, - @JsonKey(name: 'profile_photo_path') final String? profilePhotoPath, - @JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) = _$ChatUserModelImpl; + {required final int id, + required final String name, + @JsonKey(name: 'profile_photo_path') final String? profilePhotoPath, + @JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) = + _$ChatUserModelImpl; - factory _ChatUserModel.fromJson(Map json) = _$ChatUserModelImpl.fromJson; + factory _ChatUserModel.fromJson(Map json) = + _$ChatUserModelImpl.fromJson; @override int get id; - @override String get name; - @override @JsonKey(name: 'profile_photo_path') String? get profilePhotoPath; - @override @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl; @@ -216,5 +233,6 @@ abstract class _ChatUserModel implements ChatUserModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_user_model.g.dart b/lib/features/chat/models/chat_user_model.g.dart index 06fa92a0..78e0f981 100644 --- a/lib/features/chat/models/chat_user_model.g.dart +++ b/lib/features/chat/models/chat_user_model.g.dart @@ -6,14 +6,16 @@ part of 'chat_user_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ChatUserModelImpl _$$ChatUserModelImplFromJson(Map json) => _$ChatUserModelImpl( +_$ChatUserModelImpl _$$ChatUserModelImplFromJson(Map json) => + _$ChatUserModelImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, profilePhotoPath: json['profile_photo_path'] as String?, profilePhotoUrl: json['profile_photo_url'] as String?, ); -Map _$$ChatUserModelImplToJson(_$ChatUserModelImpl instance) => { +Map _$$ChatUserModelImplToJson(_$ChatUserModelImpl instance) => + { 'id': instance.id, 'name': instance.name, 'profile_photo_path': instance.profilePhotoPath, diff --git a/lib/features/chat/models/websocket_info_model.freezed.dart b/lib/features/chat/models/websocket_info_model.freezed.dart index dd7a6bb0..9cddabee 100644 --- a/lib/features/chat/models/websocket_info_model.freezed.dart +++ b/lib/features/chat/models/websocket_info_model.freezed.dart @@ -21,13 +21,9 @@ WebsocketInfoModel _$WebsocketInfoModelFromJson(Map json) { /// @nodoc mixin _$WebsocketInfoModel { String get key => throw _privateConstructorUsedError; - String get host => throw _privateConstructorUsedError; - String get port => throw _privateConstructorUsedError; - String get cluster => throw _privateConstructorUsedError; - @JsonKey(name: 'user_id') int get userId => throw _privateConstructorUsedError; @@ -37,25 +33,31 @@ mixin _$WebsocketInfoModel { /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $WebsocketInfoModelCopyWith get copyWith => throw _privateConstructorUsedError; + $WebsocketInfoModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $WebsocketInfoModelCopyWith<$Res> { - factory $WebsocketInfoModelCopyWith(WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) = + factory $WebsocketInfoModelCopyWith( + WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) = _$WebsocketInfoModelCopyWithImpl<$Res, WebsocketInfoModel>; - @useResult - $Res call({String key, String host, String port, String cluster, @JsonKey(name: 'user_id') int userId}); + $Res call( + {String key, + String host, + String port, + String cluster, + @JsonKey(name: 'user_id') int userId}); } /// @nodoc -class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> implements $WebsocketInfoModelCopyWith<$Res> { +class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> + implements $WebsocketInfoModelCopyWith<$Res> { _$WebsocketInfoModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -96,19 +98,28 @@ class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> im } /// @nodoc -abstract class _$$WebsocketInfoModelImplCopyWith<$Res> implements $WebsocketInfoModelCopyWith<$Res> { - factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value, $Res Function(_$WebsocketInfoModelImpl) then) = +abstract class _$$WebsocketInfoModelImplCopyWith<$Res> + implements $WebsocketInfoModelCopyWith<$Res> { + factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value, + $Res Function(_$WebsocketInfoModelImpl) then) = __$$WebsocketInfoModelImplCopyWithImpl<$Res>; - @override @useResult - $Res call({String key, String host, String port, String cluster, @JsonKey(name: 'user_id') int userId}); + $Res call( + {String key, + String host, + String port, + String cluster, + @JsonKey(name: 'user_id') int userId}); } /// @nodoc -class __$$WebsocketInfoModelImplCopyWithImpl<$Res> extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl> +class __$$WebsocketInfoModelImplCopyWithImpl<$Res> + extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl> implements _$$WebsocketInfoModelImplCopyWith<$Res> { - __$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value, $Res Function(_$WebsocketInfoModelImpl) _then) : super(_value, _then); + __$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value, + $Res Function(_$WebsocketInfoModelImpl) _then) + : super(_value, _then); /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @@ -150,9 +161,14 @@ class __$$WebsocketInfoModelImplCopyWithImpl<$Res> extends _$WebsocketInfoModelC @JsonSerializable() class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { const _$WebsocketInfoModelImpl( - {required this.key, required this.host, required this.port, required this.cluster, @JsonKey(name: 'user_id') required this.userId}); + {required this.key, + required this.host, + required this.port, + required this.cluster, + @JsonKey(name: 'user_id') required this.userId}); - factory _$WebsocketInfoModelImpl.fromJson(Map json) => _$$WebsocketInfoModelImplFromJson(json); + factory _$WebsocketInfoModelImpl.fromJson(Map json) => + _$$WebsocketInfoModelImplFromJson(json); @override final String key; @@ -185,7 +201,8 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, key, host, port, cluster, userId); + int get hashCode => + Object.hash(runtimeType, key, host, port, cluster, userId); /// Create a copy of WebsocketInfoModel /// with the given fields replaced by the non-null parameter values. @@ -193,7 +210,8 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { @override @pragma('vm:prefer-inline') _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => - __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>(this, _$identity); + __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>( + this, _$identity); @override Map toJson() { @@ -205,26 +223,24 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { abstract class _WebsocketInfoModel implements WebsocketInfoModel { const factory _WebsocketInfoModel( - {required final String key, - required final String host, - required final String port, - required final String cluster, - @JsonKey(name: 'user_id') required final int userId}) = _$WebsocketInfoModelImpl; + {required final String key, + required final String host, + required final String port, + required final String cluster, + @JsonKey(name: 'user_id') required final int userId}) = + _$WebsocketInfoModelImpl; - factory _WebsocketInfoModel.fromJson(Map json) = _$WebsocketInfoModelImpl.fromJson; + factory _WebsocketInfoModel.fromJson(Map json) = + _$WebsocketInfoModelImpl.fromJson; @override String get key; - @override String get host; - @override String get port; - @override String get cluster; - @override @JsonKey(name: 'user_id') int get userId; @@ -233,5 +249,6 @@ abstract class _WebsocketInfoModel implements WebsocketInfoModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/websocket_info_model.g.dart b/lib/features/chat/models/websocket_info_model.g.dart index 91c386f8..b2bb1248 100644 --- a/lib/features/chat/models/websocket_info_model.g.dart +++ b/lib/features/chat/models/websocket_info_model.g.dart @@ -6,7 +6,9 @@ part of 'websocket_info_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson(Map json) => _$WebsocketInfoModelImpl( +_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson( + Map json) => + _$WebsocketInfoModelImpl( key: json['key'] as String, host: json['host'] as String, port: json['port'] as String, @@ -14,7 +16,9 @@ _$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson(Map userId: (json['user_id'] as num).toInt(), ); -Map _$$WebsocketInfoModelImplToJson(_$WebsocketInfoModelImpl instance) => { +Map _$$WebsocketInfoModelImplToJson( + _$WebsocketInfoModelImpl instance) => + { 'key': instance.key, 'host': instance.host, 'port': instance.port, diff --git a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart index 9a27a0ba..4695b4ad 100644 --- a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart @@ -20,16 +20,19 @@ mixin _$ChatRoomState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -37,7 +40,9 @@ mixin _$ChatRoomState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -71,16 +76,18 @@ mixin _$ChatRoomState { /// @nodoc abstract class $ChatRoomStateCopyWith<$Res> { - factory $ChatRoomStateCopyWith(ChatRoomState value, $Res Function(ChatRoomState) then) = _$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>; + factory $ChatRoomStateCopyWith( + ChatRoomState value, $Res Function(ChatRoomState) then) = + _$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>; } /// @nodoc -class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> implements $ChatRoomStateCopyWith<$Res> { +class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> + implements $ChatRoomStateCopyWith<$Res> { _$ChatRoomStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +97,18 @@ class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState> implements $ /// @nodoc abstract class _$$ChatRoomStateImplCopyWith<$Res> { - factory _$$ChatRoomStateImplCopyWith(_$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) = __$$ChatRoomStateImplCopyWithImpl<$Res>; + factory _$$ChatRoomStateImplCopyWith( + _$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) = + __$$ChatRoomStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatRoomStateImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl> implements _$$ChatRoomStateImplCopyWith<$Res> { - __$$ChatRoomStateImplCopyWithImpl(_$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then) : super(_value, _then); +class __$$ChatRoomStateImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl> + implements _$$ChatRoomStateImplCopyWith<$Res> { + __$$ChatRoomStateImplCopyWithImpl( + _$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +126,8 @@ class _$ChatRoomStateImpl implements _ChatRoomState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ChatRoomStateImpl); } @override @@ -124,7 +138,9 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -135,7 +151,9 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -146,7 +164,9 @@ class _$ChatRoomStateImpl implements _ChatRoomState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -200,14 +220,18 @@ abstract class _ChatRoomState implements ChatRoomState { /// @nodoc abstract class _$$ChatRoomStateLoadingImplCopyWith<$Res> { - factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value, $Res Function(_$ChatRoomStateLoadingImpl) then) = + factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value, + $Res Function(_$ChatRoomStateLoadingImpl) then) = __$$ChatRoomStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl> +class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl> implements _$$ChatRoomStateLoadingImplCopyWith<$Res> { - __$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value, $Res Function(_$ChatRoomStateLoadingImpl) _then) : super(_value, _then); + __$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value, + $Res Function(_$ChatRoomStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +249,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ChatRoomStateLoadingImpl); } @override @@ -236,7 +262,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -247,7 +275,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -258,7 +288,9 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -312,19 +344,26 @@ abstract class ChatRoomStateLoading implements ChatRoomState { /// @nodoc abstract class _$$ChatRoomStateLoadedImplCopyWith<$Res> { - factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value, $Res Function(_$ChatRoomStateLoadedImpl) then) = + factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value, + $Res Function(_$ChatRoomStateLoadedImpl) then) = __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>; - @useResult - $Res call({ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading}); + $Res call( + {ChatRoomModel chatRoom, + List chatMessages, + bool isTyping, + bool isLoading}); $ChatRoomModelCopyWith<$Res> get chatRoom; } /// @nodoc -class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl> +class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl> implements _$$ChatRoomStateLoadedImplCopyWith<$Res> { - __$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value, $Res Function(_$ChatRoomStateLoadedImpl) _then) : super(_value, _then); + __$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value, + $Res Function(_$ChatRoomStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -370,13 +409,16 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyW /// @nodoc class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { - const _$ChatRoomStateLoadedImpl({required this.chatRoom, required final List chatMessages, required this.isTyping, required this.isLoading}) + const _$ChatRoomStateLoadedImpl( + {required this.chatRoom, + required final List chatMessages, + required this.isTyping, + required this.isLoading}) : _chatMessages = chatMessages; @override final ChatRoomModel chatRoom; final List _chatMessages; - @override List get chatMessages { if (_chatMessages is EqualUnmodifiableListView) return _chatMessages; @@ -399,14 +441,19 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateLoadedImpl && - (identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom) && - const DeepCollectionEquality().equals(other._chatMessages, _chatMessages) && - (identical(other.isTyping, isTyping) || other.isTyping == isTyping) && - (identical(other.isLoading, isLoading) || other.isLoading == isLoading)); + (identical(other.chatRoom, chatRoom) || + other.chatRoom == chatRoom) && + const DeepCollectionEquality() + .equals(other._chatMessages, _chatMessages) && + (identical(other.isTyping, isTyping) || + other.isTyping == isTyping) && + (identical(other.isLoading, isLoading) || + other.isLoading == isLoading)); } @override - int get hashCode => Object.hash(runtimeType, chatRoom, const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); + int get hashCode => Object.hash(runtimeType, chatRoom, + const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -414,14 +461,17 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { @override @pragma('vm:prefer-inline') _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => - __$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>(this, _$identity); + __$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return loaded(chatRoom, chatMessages, isTyping, isLoading); @@ -432,7 +482,9 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(chatRoom, chatMessages, isTyping, isLoading); @@ -443,7 +495,9 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -499,32 +553,33 @@ abstract class ChatRoomStateLoaded implements ChatRoomState { required final bool isLoading}) = _$ChatRoomStateLoadedImpl; ChatRoomModel get chatRoom; - List get chatMessages; - bool get isTyping; - bool get isLoading; /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ChatRoomStateErrorImplCopyWith<$Res> { - factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value, $Res Function(_$ChatRoomStateErrorImpl) then) = + factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value, + $Res Function(_$ChatRoomStateErrorImpl) then) = __$$ChatRoomStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ChatRoomStateErrorImplCopyWithImpl<$Res> extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl> +class __$$ChatRoomStateErrorImplCopyWithImpl<$Res> + extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl> implements _$$ChatRoomStateErrorImplCopyWith<$Res> { - __$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value, $Res Function(_$ChatRoomStateErrorImpl) _then) : super(_value, _then); + __$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value, + $Res Function(_$ChatRoomStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @@ -560,7 +615,8 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatRoomStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -572,14 +628,17 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { @override @pragma('vm:prefer-inline') _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => - __$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>(this, _$identity); + __$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading) loaded, + required TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -590,7 +649,9 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult? Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -601,7 +662,9 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(ChatRoomModel chatRoom, List chatMessages, bool isTyping, bool isLoading)? loaded, + TResult Function(ChatRoomModel chatRoom, + List chatMessages, bool isTyping, bool isLoading)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -650,12 +713,14 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { } abstract class ChatRoomStateError implements ChatRoomState { - const factory ChatRoomStateError({required final String errorMessage}) = _$ChatRoomStateErrorImpl; + const factory ChatRoomStateError({required final String errorMessage}) = + _$ChatRoomStateErrorImpl; String get errorMessage; /// Create a copy of ChatRoomState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart index 1b216a02..99fa9054 100644 --- a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart +++ b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$ChatSelectState { required TResult Function(List chatRooms) loaded, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$ChatSelectState { /// @nodoc abstract class $ChatSelectStateCopyWith<$Res> { - factory $ChatSelectStateCopyWith(ChatSelectState value, $Res Function(ChatSelectState) then) = _$ChatSelectStateCopyWithImpl<$Res, ChatSelectState>; + factory $ChatSelectStateCopyWith( + ChatSelectState value, $Res Function(ChatSelectState) then) = + _$ChatSelectStateCopyWithImpl<$Res, ChatSelectState>; } /// @nodoc -class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> implements $ChatSelectStateCopyWith<$Res> { +class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> + implements $ChatSelectStateCopyWith<$Res> { _$ChatSelectStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,13 +91,18 @@ class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState> implemen /// @nodoc abstract class _$$ChatSelectStateImplCopyWith<$Res> { - factory _$$ChatSelectStateImplCopyWith(_$ChatSelectStateImpl value, $Res Function(_$ChatSelectStateImpl) then) = __$$ChatSelectStateImplCopyWithImpl<$Res>; + factory _$$ChatSelectStateImplCopyWith(_$ChatSelectStateImpl value, + $Res Function(_$ChatSelectStateImpl) then) = + __$$ChatSelectStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatSelectStateImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateImpl> +class __$$ChatSelectStateImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateImpl> implements _$$ChatSelectStateImplCopyWith<$Res> { - __$$ChatSelectStateImplCopyWithImpl(_$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then) : super(_value, _then); + __$$ChatSelectStateImplCopyWithImpl( + _$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -114,7 +120,8 @@ class _$ChatSelectStateImpl implements _ChatSelectState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ChatSelectStateImpl); } @override @@ -201,14 +208,20 @@ abstract class _ChatSelectState implements ChatSelectState { /// @nodoc abstract class _$$ChatSelectStateLoadingImplCopyWith<$Res> { - factory _$$ChatSelectStateLoadingImplCopyWith(_$ChatSelectStateLoadingImpl value, $Res Function(_$ChatSelectStateLoadingImpl) then) = + factory _$$ChatSelectStateLoadingImplCopyWith( + _$ChatSelectStateLoadingImpl value, + $Res Function(_$ChatSelectStateLoadingImpl) then) = __$$ChatSelectStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadingImpl> +class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadingImpl> implements _$$ChatSelectStateLoadingImplCopyWith<$Res> { - __$$ChatSelectStateLoadingImplCopyWithImpl(_$ChatSelectStateLoadingImpl _value, $Res Function(_$ChatSelectStateLoadingImpl) _then) : super(_value, _then); + __$$ChatSelectStateLoadingImplCopyWithImpl( + _$ChatSelectStateLoadingImpl _value, + $Res Function(_$ChatSelectStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -226,7 +239,9 @@ class _$ChatSelectStateLoadingImpl implements ChatSelectStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ChatSelectStateLoadingImpl); } @override @@ -313,17 +328,20 @@ abstract class ChatSelectStateLoading implements ChatSelectState { /// @nodoc abstract class _$$ChatSelectStateErrorImplCopyWith<$Res> { - factory _$$ChatSelectStateErrorImplCopyWith(_$ChatSelectStateErrorImpl value, $Res Function(_$ChatSelectStateErrorImpl) then) = + factory _$$ChatSelectStateErrorImplCopyWith(_$ChatSelectStateErrorImpl value, + $Res Function(_$ChatSelectStateErrorImpl) then) = __$$ChatSelectStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$ChatSelectStateErrorImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateErrorImpl> +class __$$ChatSelectStateErrorImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateErrorImpl> implements _$$ChatSelectStateErrorImplCopyWith<$Res> { - __$$ChatSelectStateErrorImplCopyWithImpl(_$ChatSelectStateErrorImpl _value, $Res Function(_$ChatSelectStateErrorImpl) _then) : super(_value, _then); + __$$ChatSelectStateErrorImplCopyWithImpl(_$ChatSelectStateErrorImpl _value, + $Res Function(_$ChatSelectStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -359,7 +377,8 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChatSelectStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -370,8 +389,10 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => - __$$ChatSelectStateErrorImplCopyWithImpl<_$ChatSelectStateErrorImpl>(this, _$identity); + _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> + get copyWith => + __$$ChatSelectStateErrorImplCopyWithImpl<_$ChatSelectStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -449,29 +470,35 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { } abstract class ChatSelectStateError implements ChatSelectState { - const factory ChatSelectStateError({required final String errorMessage}) = _$ChatSelectStateErrorImpl; + const factory ChatSelectStateError({required final String errorMessage}) = + _$ChatSelectStateErrorImpl; String get errorMessage; /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$ChatSelectStateLoadedImplCopyWith<$Res> { - factory _$$ChatSelectStateLoadedImplCopyWith(_$ChatSelectStateLoadedImpl value, $Res Function(_$ChatSelectStateLoadedImpl) then) = + factory _$$ChatSelectStateLoadedImplCopyWith( + _$ChatSelectStateLoadedImpl value, + $Res Function(_$ChatSelectStateLoadedImpl) then) = __$$ChatSelectStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({List chatRooms}); } /// @nodoc -class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadedImpl> +class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> + extends _$ChatSelectStateCopyWithImpl<$Res, _$ChatSelectStateLoadedImpl> implements _$$ChatSelectStateLoadedImplCopyWith<$Res> { - __$$ChatSelectStateLoadedImplCopyWithImpl(_$ChatSelectStateLoadedImpl _value, $Res Function(_$ChatSelectStateLoadedImpl) _then) : super(_value, _then); + __$$ChatSelectStateLoadedImplCopyWithImpl(_$ChatSelectStateLoadedImpl _value, + $Res Function(_$ChatSelectStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @@ -492,10 +519,10 @@ class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res> extends _$ChatSelectStateC /// @nodoc class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { - const _$ChatSelectStateLoadedImpl({required final List chatRooms}) : _chatRooms = chatRooms; + const _$ChatSelectStateLoadedImpl({required final List chatRooms}) + : _chatRooms = chatRooms; final List _chatRooms; - @override List get chatRooms { if (_chatRooms is EqualUnmodifiableListView) return _chatRooms; @@ -511,19 +538,24 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$ChatSelectStateLoadedImpl && const DeepCollectionEquality().equals(other._chatRooms, _chatRooms)); + (other.runtimeType == runtimeType && + other is _$ChatSelectStateLoadedImpl && + const DeepCollectionEquality() + .equals(other._chatRooms, _chatRooms)); } @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> get copyWith => - __$$ChatSelectStateLoadedImplCopyWithImpl<_$ChatSelectStateLoadedImpl>(this, _$identity); + _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> + get copyWith => __$$ChatSelectStateLoadedImplCopyWithImpl< + _$ChatSelectStateLoadedImpl>(this, _$identity); @override @optionalTypeArgs @@ -601,12 +633,14 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { } abstract class ChatSelectStateLoaded implements ChatSelectState { - const factory ChatSelectStateLoaded({required final List chatRooms}) = _$ChatSelectStateLoadedImpl; + const factory ChatSelectStateLoaded( + {required final List chatRooms}) = _$ChatSelectStateLoadedImpl; List get chatRooms; /// Create a copy of ChatSelectState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/services/chat_service.g.dart b/lib/features/chat/services/chat_service.g.dart index fa32d6fd..4e84a7b3 100644 --- a/lib/features/chat/services/chat_service.g.dart +++ b/lib/features/chat/services/chat_service.g.dart @@ -80,7 +80,8 @@ class _ChatService implements ChatService { final _result = await _dio.fetch>(_options); late Map _value; try { - _value = _result.data!.map((k, dynamic v) => MapEntry(k, ChatRoomModel.fromJson(v as Map))); + _value = _result.data!.map((k, dynamic v) => + MapEntry(k, ChatRoomModel.fromJson(v as Map))); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -198,7 +199,9 @@ class _ChatService implements ChatService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/feed/models/comment_model.freezed.dart b/lib/features/feed/models/comment_model.freezed.dart index b32da824..4e520131 100644 --- a/lib/features/feed/models/comment_model.freezed.dart +++ b/lib/features/feed/models/comment_model.freezed.dart @@ -22,10 +22,8 @@ CommentModel _$CommentModelFromJson(Map json) { mixin _$CommentModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; - @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; - @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -35,28 +33,32 @@ mixin _$CommentModel { /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $CommentModelCopyWith get copyWith => throw _privateConstructorUsedError; + $CommentModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $CommentModelCopyWith<$Res> { - factory $CommentModelCopyWith(CommentModel value, $Res Function(CommentModel) then) = _$CommentModelCopyWithImpl<$Res, CommentModel>; - + factory $CommentModelCopyWith( + CommentModel value, $Res Function(CommentModel) then) = + _$CommentModelCopyWithImpl<$Res, CommentModel>; @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; - $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> implements $CommentModelCopyWith<$Res> { +class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> + implements $CommentModelCopyWith<$Res> { _$CommentModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -107,23 +109,31 @@ class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel> implements $Co } /// @nodoc -abstract class _$$CommentModelImplCopyWith<$Res> implements $CommentModelCopyWith<$Res> { - factory _$$CommentModelImplCopyWith(_$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) = __$$CommentModelImplCopyWithImpl<$Res>; - +abstract class _$$CommentModelImplCopyWith<$Res> + implements $CommentModelCopyWith<$Res> { + factory _$$CommentModelImplCopyWith( + _$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) = + __$$CommentModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; - @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$CommentModelImplCopyWithImpl<$Res> extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl> implements _$$CommentModelImplCopyWith<$Res> { - __$$CommentModelImplCopyWithImpl(_$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) : super(_value, _then); +class __$$CommentModelImplCopyWithImpl<$Res> + extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl> + implements _$$CommentModelImplCopyWith<$Res> { + __$$CommentModelImplCopyWithImpl( + _$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then) + : super(_value, _then); /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @@ -155,13 +165,15 @@ class __$$CommentModelImplCopyWithImpl<$Res> extends _$CommentModelCopyWithImpl< @JsonSerializable() class _$CommentModelImpl implements _CommentModel { const _$CommentModelImpl( - {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$CommentModelImpl.fromJson(Map json) => _$$CommentModelImplFromJson(json); + factory _$CommentModelImpl.fromJson(Map json) => + _$$CommentModelImplFromJson(json); final List _data; - @override @JsonKey(name: "data") List get data { @@ -194,14 +206,16 @@ class _$CommentModelImpl implements _CommentModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of CommentModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity); + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => + __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity); @override Map toJson() { @@ -217,16 +231,15 @@ abstract class _CommentModel implements CommentModel { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$CommentModelImpl; - factory _CommentModel.fromJson(Map json) = _$CommentModelImpl.fromJson; + factory _CommentModel.fromJson(Map json) = + _$CommentModelImpl.fromJson; @override @JsonKey(name: "data") List get data; - @override @JsonKey(name: "links") Links get links; - @override @JsonKey(name: "meta") Meta get meta; @@ -235,7 +248,8 @@ abstract class _CommentModel implements CommentModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith => + throw _privateConstructorUsedError; } Comment _$CommentFromJson(Map json) { @@ -246,19 +260,14 @@ Comment _$CommentFromJson(Map json) { mixin _$Comment { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "author_name") String get authorName => throw _privateConstructorUsedError; - @JsonKey(name: "author_profile_icon") String get authorProfileIcon => throw _privateConstructorUsedError; - @JsonKey(name: "body") String get body => throw _privateConstructorUsedError; - @JsonKey(name: "children_comments") List get childrenComments => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; @@ -273,8 +282,8 @@ mixin _$Comment { /// @nodoc abstract class $CommentCopyWith<$Res> { - factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = _$CommentCopyWithImpl<$Res, Comment>; - + factory $CommentCopyWith(Comment value, $Res Function(Comment) then) = + _$CommentCopyWithImpl<$Res, Comment>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -286,12 +295,12 @@ abstract class $CommentCopyWith<$Res> { } /// @nodoc -class _$CommentCopyWithImpl<$Res, $Val extends Comment> implements $CommentCopyWith<$Res> { +class _$CommentCopyWithImpl<$Res, $Val extends Comment> + implements $CommentCopyWith<$Res> { _$CommentCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -338,8 +347,9 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> implements $CommentCopyW /// @nodoc abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { - factory _$$CommentImplCopyWith(_$CommentImpl value, $Res Function(_$CommentImpl) then) = __$$CommentImplCopyWithImpl<$Res>; - + factory _$$CommentImplCopyWith( + _$CommentImpl value, $Res Function(_$CommentImpl) then) = + __$$CommentImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -352,8 +362,12 @@ abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { } /// @nodoc -class __$$CommentImplCopyWithImpl<$Res> extends _$CommentCopyWithImpl<$Res, _$CommentImpl> implements _$$CommentImplCopyWith<$Res> { - __$$CommentImplCopyWithImpl(_$CommentImpl _value, $Res Function(_$CommentImpl) _then) : super(_value, _then); +class __$$CommentImplCopyWithImpl<$Res> + extends _$CommentCopyWithImpl<$Res, _$CommentImpl> + implements _$$CommentImplCopyWith<$Res> { + __$$CommentImplCopyWithImpl( + _$CommentImpl _value, $Res Function(_$CommentImpl) _then) + : super(_value, _then); /// Create a copy of Comment /// with the given fields replaced by the non-null parameter values. @@ -404,11 +418,13 @@ class _$CommentImpl implements _Comment { @JsonKey(name: "author_name") required this.authorName, @JsonKey(name: "author_profile_icon") required this.authorProfileIcon, @JsonKey(name: "body") required this.body, - @JsonKey(name: "children_comments") required final List childrenComments, + @JsonKey(name: "children_comments") + required final List childrenComments, @JsonKey(name: "created_at") required this.createdAt}) : _childrenComments = childrenComments; - factory _$CommentImpl.fromJson(Map json) => _$$CommentImplFromJson(json); + factory _$CommentImpl.fromJson(Map json) => + _$$CommentImplFromJson(json); @override @JsonKey(name: "id") @@ -423,11 +439,11 @@ class _$CommentImpl implements _Comment { @JsonKey(name: "body") final String body; final List _childrenComments; - @override @JsonKey(name: "children_comments") List get childrenComments { - if (_childrenComments is EqualUnmodifiableListView) return _childrenComments; + if (_childrenComments is EqualUnmodifiableListView) + return _childrenComments; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_childrenComments); } @@ -447,23 +463,35 @@ class _$CommentImpl implements _Comment { (other.runtimeType == runtimeType && other is _$CommentImpl && (identical(other.id, id) || other.id == id) && - (identical(other.authorName, authorName) || other.authorName == authorName) && - (identical(other.authorProfileIcon, authorProfileIcon) || other.authorProfileIcon == authorProfileIcon) && + (identical(other.authorName, authorName) || + other.authorName == authorName) && + (identical(other.authorProfileIcon, authorProfileIcon) || + other.authorProfileIcon == authorProfileIcon) && (identical(other.body, body) || other.body == body) && - const DeepCollectionEquality().equals(other._childrenComments, _childrenComments) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt)); + const DeepCollectionEquality() + .equals(other._childrenComments, _childrenComments) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, authorName, authorProfileIcon, body, const DeepCollectionEquality().hash(_childrenComments), createdAt); + int get hashCode => Object.hash( + runtimeType, + id, + authorName, + authorProfileIcon, + body, + const DeepCollectionEquality().hash(_childrenComments), + createdAt); /// Create a copy of Comment /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => + __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); @override Map toJson() { @@ -475,35 +503,33 @@ class _$CommentImpl implements _Comment { abstract class _Comment implements Comment { const factory _Comment( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "author_name") required final String authorName, - @JsonKey(name: "author_profile_icon") required final String authorProfileIcon, - @JsonKey(name: "body") required final String body, - @JsonKey(name: "children_comments") required final List childrenComments, - @JsonKey(name: "created_at") required final DateTime createdAt}) = _$CommentImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "author_name") required final String authorName, + @JsonKey(name: "author_profile_icon") + required final String authorProfileIcon, + @JsonKey(name: "body") required final String body, + @JsonKey(name: "children_comments") + required final List childrenComments, + @JsonKey(name: "created_at") required final DateTime createdAt}) = + _$CommentImpl; factory _Comment.fromJson(Map json) = _$CommentImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "author_name") String get authorName; - @override @JsonKey(name: "author_profile_icon") String get authorProfileIcon; - @override @JsonKey(name: "body") String get body; - @override @JsonKey(name: "children_comments") List get childrenComments; - @override @JsonKey(name: "created_at") DateTime get createdAt; @@ -512,5 +538,6 @@ abstract class _Comment implements Comment { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentImplCopyWith<_$CommentImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/comment_model.g.dart b/lib/features/feed/models/comment_model.g.dart index 503322f9..1410cfcc 100644 --- a/lib/features/feed/models/comment_model.g.dart +++ b/lib/features/feed/models/comment_model.g.dart @@ -6,28 +6,36 @@ part of 'comment_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CommentModelImpl _$$CommentModelImplFromJson(Map json) => _$CommentModelImpl( - data: (json['data'] as List).map((e) => Comment.fromJson(e as Map)).toList(), +_$CommentModelImpl _$$CommentModelImplFromJson(Map json) => + _$CommentModelImpl( + data: (json['data'] as List) + .map((e) => Comment.fromJson(e as Map)) + .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$CommentModelImplToJson(_$CommentModelImpl instance) => { +Map _$$CommentModelImplToJson(_$CommentModelImpl instance) => + { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$CommentImpl _$$CommentImplFromJson(Map json) => _$CommentImpl( +_$CommentImpl _$$CommentImplFromJson(Map json) => + _$CommentImpl( id: (json['id'] as num).toInt(), authorName: json['author_name'] as String, authorProfileIcon: json['author_profile_icon'] as String, body: json['body'] as String, - childrenComments: (json['children_comments'] as List).map((e) => Comment.fromJson(e as Map)).toList(), + childrenComments: (json['children_comments'] as List) + .map((e) => Comment.fromJson(e as Map)) + .toList(), createdAt: DateTime.parse(json['created_at'] as String), ); -Map _$$CommentImplToJson(_$CommentImpl instance) => { +Map _$$CommentImplToJson(_$CommentImpl instance) => + { 'id': instance.id, 'author_name': instance.authorName, 'author_profile_icon': instance.authorProfileIcon, diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart index caa93548..c3b582ce 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart @@ -24,7 +24,6 @@ mixin _$CommentsState { required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; - @optionalTypeArgs TResult? whenOrNull( TResult? Function()? $default, { @@ -71,16 +70,18 @@ mixin _$CommentsState { /// @nodoc abstract class $CommentsStateCopyWith<$Res> { - factory $CommentsStateCopyWith(CommentsState value, $Res Function(CommentsState) then) = _$CommentsStateCopyWithImpl<$Res, CommentsState>; + factory $CommentsStateCopyWith( + CommentsState value, $Res Function(CommentsState) then) = + _$CommentsStateCopyWithImpl<$Res, CommentsState>; } /// @nodoc -class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> implements $CommentsStateCopyWith<$Res> { +class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> + implements $CommentsStateCopyWith<$Res> { _$CommentsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,12 +91,18 @@ class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> implements $ /// @nodoc abstract class _$$CommentsStateImplCopyWith<$Res> { - factory _$$CommentsStateImplCopyWith(_$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) = __$$CommentsStateImplCopyWithImpl<$Res>; + factory _$$CommentsStateImplCopyWith( + _$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) = + __$$CommentsStateImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CommentsStateImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl> implements _$$CommentsStateImplCopyWith<$Res> { - __$$CommentsStateImplCopyWithImpl(_$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) : super(_value, _then); +class __$$CommentsStateImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl> + implements _$$CommentsStateImplCopyWith<$Res> { + __$$CommentsStateImplCopyWithImpl( + _$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -113,7 +120,8 @@ class _$CommentsStateImpl implements _CommentsState { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$CommentsStateImpl); } @override @@ -200,14 +208,18 @@ abstract class _CommentsState implements CommentsState { /// @nodoc abstract class _$$CommentsStateLoadingImplCopyWith<$Res> { - factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value, $Res Function(_$CommentsStateLoadingImpl) then) = + factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value, + $Res Function(_$CommentsStateLoadingImpl) then) = __$$CommentsStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$CommentsStateLoadingImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl> +class __$$CommentsStateLoadingImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl> implements _$$CommentsStateLoadingImplCopyWith<$Res> { - __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, $Res Function(_$CommentsStateLoadingImpl) _then) : super(_value, _then); + __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, + $Res Function(_$CommentsStateLoadingImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -225,7 +237,9 @@ class _$CommentsStateLoadingImpl implements CommentsStateLoading { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateLoadingImpl); + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$CommentsStateLoadingImpl); } @override @@ -312,9 +326,9 @@ abstract class CommentsStateLoading implements CommentsState { /// @nodoc abstract class _$$CommentsStateLoadedImplCopyWith<$Res> { - factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value, $Res Function(_$CommentsStateLoadedImpl) then) = + factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value, + $Res Function(_$CommentsStateLoadedImpl) then) = __$$CommentsStateLoadedImplCopyWithImpl<$Res>; - @useResult $Res call({CommentModel comment, int? replyId}); @@ -322,9 +336,12 @@ abstract class _$$CommentsStateLoadedImplCopyWith<$Res> { } /// @nodoc -class __$$CommentsStateLoadedImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl> +class __$$CommentsStateLoadedImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl> implements _$$CommentsStateLoadedImplCopyWith<$Res> { - __$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value, $Res Function(_$CommentsStateLoadedImpl) _then) : super(_value, _then); + __$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value, + $Res Function(_$CommentsStateLoadedImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -390,7 +407,8 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { @override @pragma('vm:prefer-inline') _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => - __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>(this, _$identity); + __$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs @@ -468,31 +486,36 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { } abstract class CommentsStateLoaded implements CommentsState { - const factory CommentsStateLoaded({required final CommentModel comment, final int? replyId}) = _$CommentsStateLoadedImpl; + const factory CommentsStateLoaded( + {required final CommentModel comment, + final int? replyId}) = _$CommentsStateLoadedImpl; CommentModel get comment; - int? get replyId; /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$CommentsStateErrorImplCopyWith<$Res> { - factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value, $Res Function(_$CommentsStateErrorImpl) then) = + factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value, + $Res Function(_$CommentsStateErrorImpl) then) = __$$CommentsStateErrorImplCopyWithImpl<$Res>; - @useResult $Res call({String errorMessage}); } /// @nodoc -class __$$CommentsStateErrorImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl> +class __$$CommentsStateErrorImplCopyWithImpl<$Res> + extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl> implements _$$CommentsStateErrorImplCopyWith<$Res> { - __$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value, $Res Function(_$CommentsStateErrorImpl) _then) : super(_value, _then); + __$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value, + $Res Function(_$CommentsStateErrorImpl) _then) + : super(_value, _then); /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @@ -528,7 +551,8 @@ class _$CommentsStateErrorImpl implements CommentsStateError { return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateErrorImpl && - (identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); } @override @@ -540,7 +564,8 @@ class _$CommentsStateErrorImpl implements CommentsStateError { @override @pragma('vm:prefer-inline') _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => - __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>(this, _$identity); + __$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>( + this, _$identity); @override @optionalTypeArgs @@ -618,12 +643,14 @@ class _$CommentsStateErrorImpl implements CommentsStateError { } abstract class CommentsStateError implements CommentsState { - const factory CommentsStateError({required final String errorMessage}) = _$CommentsStateErrorImpl; + const factory CommentsStateError({required final String errorMessage}) = + _$CommentsStateErrorImpl; String get errorMessage; /// Create a copy of CommentsState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; + _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/menu/presentation/pages/menu_screen.dart b/lib/features/menu/presentation/pages/menu_screen.dart index 9d55b7b9..1ed46aec 100644 --- a/lib/features/menu/presentation/pages/menu_screen.dart +++ b/lib/features/menu/presentation/pages/menu_screen.dart @@ -24,7 +24,7 @@ class MenuScreen extends StatelessWidget { _tile( title: 'Настройки профиля', leading: ImageConstant.icnProfileSettings, - onTap: () => GoRouter.of(context).push('/my-settings-screen'), + onTap: () => GoRouter.of(context).push('/settings-screen'), ), _divider(context), _tile( diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index 5391fe33..39a64846 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -69,7 +69,7 @@ class _ProfileScreenState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Padding( - padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16), + padding: const EdgeInsets.all(16), child: Row( children: [ CircleAvatar( diff --git a/lib/features/recipes/models/recipe_tag_model.freezed.dart b/lib/features/recipes/models/recipe_tag_model.freezed.dart index cfeff53c..d9993da3 100644 --- a/lib/features/recipes/models/recipe_tag_model.freezed.dart +++ b/lib/features/recipes/models/recipe_tag_model.freezed.dart @@ -22,10 +22,8 @@ RecipeTagModel _$RecipeTagModelFromJson(Map json) { mixin _$RecipeTagModel { @JsonKey(name: "data") List get data => throw _privateConstructorUsedError; - @JsonKey(name: "links") Links get links => throw _privateConstructorUsedError; - @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; @@ -35,28 +33,32 @@ mixin _$RecipeTagModel { /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeTagModelCopyWith get copyWith => throw _privateConstructorUsedError; + $RecipeTagModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeTagModelCopyWith<$Res> { - factory $RecipeTagModelCopyWith(RecipeTagModel value, $Res Function(RecipeTagModel) then) = _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>; - + factory $RecipeTagModelCopyWith( + RecipeTagModel value, $Res Function(RecipeTagModel) then) = + _$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>; @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); $LinksCopyWith<$Res> get links; - $MetaCopyWith<$Res> get meta; } /// @nodoc -class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> implements $RecipeTagModelCopyWith<$Res> { +class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> + implements $RecipeTagModelCopyWith<$Res> { _$RecipeTagModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -107,23 +109,31 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel> implements } /// @nodoc -abstract class _$$RecipeTagModelImplCopyWith<$Res> implements $RecipeTagModelCopyWith<$Res> { - factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value, $Res Function(_$RecipeTagModelImpl) then) = __$$RecipeTagModelImplCopyWithImpl<$Res>; - +abstract class _$$RecipeTagModelImplCopyWith<$Res> + implements $RecipeTagModelCopyWith<$Res> { + factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value, + $Res Function(_$RecipeTagModelImpl) then) = + __$$RecipeTagModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: "data") List data, @JsonKey(name: "links") Links links, @JsonKey(name: "meta") Meta meta}); + $Res call( + {@JsonKey(name: "data") List data, + @JsonKey(name: "links") Links links, + @JsonKey(name: "meta") Meta meta}); @override $LinksCopyWith<$Res> get links; - @override $MetaCopyWith<$Res> get meta; } /// @nodoc -class __$$RecipeTagModelImplCopyWithImpl<$Res> extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl> implements _$$RecipeTagModelImplCopyWith<$Res> { - __$$RecipeTagModelImplCopyWithImpl(_$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) : super(_value, _then); +class __$$RecipeTagModelImplCopyWithImpl<$Res> + extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl> + implements _$$RecipeTagModelImplCopyWith<$Res> { + __$$RecipeTagModelImplCopyWithImpl( + _$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then) + : super(_value, _then); /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @@ -155,13 +165,15 @@ class __$$RecipeTagModelImplCopyWithImpl<$Res> extends _$RecipeTagModelCopyWithI @JsonSerializable() class _$RecipeTagModelImpl implements _RecipeTagModel { const _$RecipeTagModelImpl( - {@JsonKey(name: "data") required final List data, @JsonKey(name: "links") required this.links, @JsonKey(name: "meta") required this.meta}) + {@JsonKey(name: "data") required final List data, + @JsonKey(name: "links") required this.links, + @JsonKey(name: "meta") required this.meta}) : _data = data; - factory _$RecipeTagModelImpl.fromJson(Map json) => _$$RecipeTagModelImplFromJson(json); + factory _$RecipeTagModelImpl.fromJson(Map json) => + _$$RecipeTagModelImplFromJson(json); final List _data; - @override @JsonKey(name: "data") List get data { @@ -194,14 +206,17 @@ class _$RecipeTagModelImpl implements _RecipeTagModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_data), links, meta); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_data), links, meta); /// Create a copy of RecipeTagModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => __$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>(this, _$identity); + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => + __$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>( + this, _$identity); @override Map toJson() { @@ -217,16 +232,15 @@ abstract class _RecipeTagModel implements RecipeTagModel { @JsonKey(name: "links") required final Links links, @JsonKey(name: "meta") required final Meta meta}) = _$RecipeTagModelImpl; - factory _RecipeTagModel.fromJson(Map json) = _$RecipeTagModelImpl.fromJson; + factory _RecipeTagModel.fromJson(Map json) = + _$RecipeTagModelImpl.fromJson; @override @JsonKey(name: "data") List get data; - @override @JsonKey(name: "links") Links get links; - @override @JsonKey(name: "meta") Meta get meta; @@ -235,7 +249,8 @@ abstract class _RecipeTagModel implements RecipeTagModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith => + throw _privateConstructorUsedError; } RecipeTag _$RecipeTagFromJson(Map json) { @@ -246,16 +261,12 @@ RecipeTag _$RecipeTagFromJson(Map json) { mixin _$RecipeTag { @JsonKey(name: "id") int get id => throw _privateConstructorUsedError; - @JsonKey(name: "name") String get name => throw _privateConstructorUsedError; - @JsonKey(name: "recipes_count") int get recipesCount => throw _privateConstructorUsedError; - @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; - @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; @@ -265,13 +276,14 @@ mixin _$RecipeTag { /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RecipeTagCopyWith get copyWith => throw _privateConstructorUsedError; + $RecipeTagCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RecipeTagCopyWith<$Res> { - factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) = _$RecipeTagCopyWithImpl<$Res, RecipeTag>; - + factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) = + _$RecipeTagCopyWithImpl<$Res, RecipeTag>; @useResult $Res call( {@JsonKey(name: "id") int id, @@ -282,12 +294,12 @@ abstract class $RecipeTagCopyWith<$Res> { } /// @nodoc -class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> implements $RecipeTagCopyWith<$Res> { +class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> + implements $RecipeTagCopyWith<$Res> { _$RecipeTagCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -328,9 +340,11 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag> implements $RecipeTa } /// @nodoc -abstract class _$$RecipeTagImplCopyWith<$Res> implements $RecipeTagCopyWith<$Res> { - factory _$$RecipeTagImplCopyWith(_$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) = __$$RecipeTagImplCopyWithImpl<$Res>; - +abstract class _$$RecipeTagImplCopyWith<$Res> + implements $RecipeTagCopyWith<$Res> { + factory _$$RecipeTagImplCopyWith( + _$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) = + __$$RecipeTagImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -342,8 +356,12 @@ abstract class _$$RecipeTagImplCopyWith<$Res> implements $RecipeTagCopyWith<$Res } /// @nodoc -class __$$RecipeTagImplCopyWithImpl<$Res> extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl> implements _$$RecipeTagImplCopyWith<$Res> { - __$$RecipeTagImplCopyWithImpl(_$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) : super(_value, _then); +class __$$RecipeTagImplCopyWithImpl<$Res> + extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl> + implements _$$RecipeTagImplCopyWith<$Res> { + __$$RecipeTagImplCopyWithImpl( + _$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then) + : super(_value, _then); /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @@ -391,7 +409,8 @@ class _$RecipeTagImpl implements _RecipeTag { @JsonKey(name: "created_at") required this.createdAt, @JsonKey(name: "updated_at") required this.updatedAt}); - factory _$RecipeTagImpl.fromJson(Map json) => _$$RecipeTagImplFromJson(json); + factory _$RecipeTagImpl.fromJson(Map json) => + _$$RecipeTagImplFromJson(json); @override @JsonKey(name: "id") @@ -421,21 +440,26 @@ class _$RecipeTagImpl implements _RecipeTag { other is _$RecipeTagImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.recipesCount, recipesCount) || other.recipesCount == recipesCount) && - (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + (identical(other.recipesCount, recipesCount) || + other.recipesCount == recipesCount) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); + int get hashCode => + Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt); /// Create a copy of RecipeTag /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => __$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity); + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => + __$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity); @override Map toJson() { @@ -447,30 +471,28 @@ class _$RecipeTagImpl implements _RecipeTag { abstract class _RecipeTag implements RecipeTag { const factory _RecipeTag( - {@JsonKey(name: "id") required final int id, - @JsonKey(name: "name") required final String name, - @JsonKey(name: "recipes_count") required final int recipesCount, - @JsonKey(name: "created_at") required final DateTime createdAt, - @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$RecipeTagImpl; + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "name") required final String name, + @JsonKey(name: "recipes_count") required final int recipesCount, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = + _$RecipeTagImpl; - factory _RecipeTag.fromJson(Map json) = _$RecipeTagImpl.fromJson; + factory _RecipeTag.fromJson(Map json) = + _$RecipeTagImpl.fromJson; @override @JsonKey(name: "id") int get id; - @override @JsonKey(name: "name") String get name; - @override @JsonKey(name: "recipes_count") int get recipesCount; - @override @JsonKey(name: "created_at") DateTime get createdAt; - @override @JsonKey(name: "updated_at") DateTime get updatedAt; @@ -479,5 +501,6 @@ abstract class _RecipeTag implements RecipeTag { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => throw _privateConstructorUsedError; + _$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/recipe_tag_model.g.dart b/lib/features/recipes/models/recipe_tag_model.g.dart index 9a6ea20f..cd387547 100644 --- a/lib/features/recipes/models/recipe_tag_model.g.dart +++ b/lib/features/recipes/models/recipe_tag_model.g.dart @@ -6,19 +6,25 @@ part of 'recipe_tag_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map json) => _$RecipeTagModelImpl( - data: (json['data'] as List).map((e) => RecipeTag.fromJson(e as Map)).toList(), +_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map json) => + _$RecipeTagModelImpl( + data: (json['data'] as List) + .map((e) => RecipeTag.fromJson(e as Map)) + .toList(), links: Links.fromJson(json['links'] as Map), meta: Meta.fromJson(json['meta'] as Map), ); -Map _$$RecipeTagModelImplToJson(_$RecipeTagModelImpl instance) => { +Map _$$RecipeTagModelImplToJson( + _$RecipeTagModelImpl instance) => + { 'data': instance.data, 'links': instance.links, 'meta': instance.meta, }; -_$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => _$RecipeTagImpl( +_$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => + _$RecipeTagImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, recipesCount: (json['recipes_count'] as num).toInt(), @@ -26,7 +32,8 @@ _$RecipeTagImpl _$$RecipeTagImplFromJson(Map json) => _$RecipeT updatedAt: DateTime.parse(json['updated_at'] as String), ); -Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => { +Map _$$RecipeTagImplToJson(_$RecipeTagImpl instance) => + { 'id': instance.id, 'name': instance.name, 'recipes_count': instance.recipesCount, diff --git a/lib/features/registration/models/location_model.freezed.dart b/lib/features/registration/models/location_model.freezed.dart index 052bc27b..95f81d60 100644 --- a/lib/features/registration/models/location_model.freezed.dart +++ b/lib/features/registration/models/location_model.freezed.dart @@ -21,7 +21,6 @@ LocationModel _$LocationModelFromJson(Map json) { /// @nodoc mixin _$LocationModel { List get locations => throw _privateConstructorUsedError; - @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; @@ -31,24 +30,28 @@ mixin _$LocationModel { /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $LocationModelCopyWith get copyWith => throw _privateConstructorUsedError; + $LocationModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $LocationModelCopyWith<$Res> { - factory $LocationModelCopyWith(LocationModel value, $Res Function(LocationModel) then) = _$LocationModelCopyWithImpl<$Res, LocationModel>; - + factory $LocationModelCopyWith( + LocationModel value, $Res Function(LocationModel) then) = + _$LocationModelCopyWithImpl<$Res, LocationModel>; @useResult - $Res call({List locations, @JsonKey(name: 'response_body') String responseBody}); + $Res call( + {List locations, + @JsonKey(name: 'response_body') String responseBody}); } /// @nodoc -class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> implements $LocationModelCopyWith<$Res> { +class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> + implements $LocationModelCopyWith<$Res> { _$LocationModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -74,17 +77,25 @@ class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> implements $ } /// @nodoc -abstract class _$$LocationModelImplCopyWith<$Res> implements $LocationModelCopyWith<$Res> { - factory _$$LocationModelImplCopyWith(_$LocationModelImpl value, $Res Function(_$LocationModelImpl) then) = __$$LocationModelImplCopyWithImpl<$Res>; - +abstract class _$$LocationModelImplCopyWith<$Res> + implements $LocationModelCopyWith<$Res> { + factory _$$LocationModelImplCopyWith( + _$LocationModelImpl value, $Res Function(_$LocationModelImpl) then) = + __$$LocationModelImplCopyWithImpl<$Res>; @override @useResult - $Res call({List locations, @JsonKey(name: 'response_body') String responseBody}); + $Res call( + {List locations, + @JsonKey(name: 'response_body') String responseBody}); } /// @nodoc -class __$$LocationModelImplCopyWithImpl<$Res> extends _$LocationModelCopyWithImpl<$Res, _$LocationModelImpl> implements _$$LocationModelImplCopyWith<$Res> { - __$$LocationModelImplCopyWithImpl(_$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) : super(_value, _then); +class __$$LocationModelImplCopyWithImpl<$Res> + extends _$LocationModelCopyWithImpl<$Res, _$LocationModelImpl> + implements _$$LocationModelImplCopyWith<$Res> { + __$$LocationModelImplCopyWithImpl( + _$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) + : super(_value, _then); /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @@ -110,12 +121,15 @@ class __$$LocationModelImplCopyWithImpl<$Res> extends _$LocationModelCopyWithImp /// @nodoc @JsonSerializable() class _$LocationModelImpl implements _LocationModel { - const _$LocationModelImpl({required final List locations, @JsonKey(name: 'response_body') required this.responseBody}) : _locations = locations; + const _$LocationModelImpl( + {required final List locations, + @JsonKey(name: 'response_body') required this.responseBody}) + : _locations = locations; - factory _$LocationModelImpl.fromJson(Map json) => _$$LocationModelImplFromJson(json); + factory _$LocationModelImpl.fromJson(Map json) => + _$$LocationModelImplFromJson(json); final List _locations; - @override List get locations { if (_locations is EqualUnmodifiableListView) return _locations; @@ -137,20 +151,24 @@ class _$LocationModelImpl implements _LocationModel { return identical(this, other) || (other.runtimeType == runtimeType && other is _$LocationModelImpl && - const DeepCollectionEquality().equals(other._locations, _locations) && - (identical(other.responseBody, responseBody) || other.responseBody == responseBody)); + const DeepCollectionEquality() + .equals(other._locations, _locations) && + (identical(other.responseBody, responseBody) || + other.responseBody == responseBody)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_locations), responseBody); + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_locations), responseBody); /// Create a copy of LocationModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); + _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => + __$$LocationModelImplCopyWithImpl<_$LocationModelImpl>(this, _$identity); @override Map toJson() { @@ -161,14 +179,16 @@ class _$LocationModelImpl implements _LocationModel { } abstract class _LocationModel implements LocationModel { - const factory _LocationModel({required final List locations, @JsonKey(name: 'response_body') required final String responseBody}) = + const factory _LocationModel( + {required final List locations, + @JsonKey(name: 'response_body') required final String responseBody}) = _$LocationModelImpl; - factory _LocationModel.fromJson(Map json) = _$LocationModelImpl.fromJson; + factory _LocationModel.fromJson(Map json) = + _$LocationModelImpl.fromJson; @override List get locations; - @override @JsonKey(name: 'response_body') String get responseBody; @@ -177,5 +197,6 @@ abstract class _LocationModel implements LocationModel { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => throw _privateConstructorUsedError; + _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/registration/models/location_model.g.dart b/lib/features/registration/models/location_model.g.dart index da69ba9b..449630a4 100644 --- a/lib/features/registration/models/location_model.g.dart +++ b/lib/features/registration/models/location_model.g.dart @@ -6,12 +6,15 @@ part of 'location_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$LocationModelImpl _$$LocationModelImplFromJson(Map json) => _$LocationModelImpl( - locations: (json['locations'] as List).map((e) => e as String).toList(), +_$LocationModelImpl _$$LocationModelImplFromJson(Map json) => + _$LocationModelImpl( + locations: + (json['locations'] as List).map((e) => e as String).toList(), responseBody: json['response_body'] as String, ); -Map _$$LocationModelImplToJson(_$LocationModelImpl instance) => { +Map _$$LocationModelImplToJson(_$LocationModelImpl instance) => + { 'locations': instance.locations, 'response_body': instance.responseBody, }; diff --git a/lib/features/registration/models/user_registration_model.freezed.dart b/lib/features/registration/models/user_registration_model.freezed.dart index b8ccb29b..fd835a26 100644 --- a/lib/features/registration/models/user_registration_model.freezed.dart +++ b/lib/features/registration/models/user_registration_model.freezed.dart @@ -14,7 +14,8 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -UserRegistrationSheet _$UserRegistrationSheetFromJson(Map json) { +UserRegistrationSheet _$UserRegistrationSheetFromJson( + Map json) { return _UserRegistrationSheet.fromJson(json); } @@ -22,74 +23,48 @@ UserRegistrationSheet _$UserRegistrationSheetFromJson(Map json) mixin _$UserRegistrationSheet { @JsonKey(name: 'first_name') String get firstName => throw _privateConstructorUsedError; - @JsonKey(name: 'last_name') String get lastName => throw _privateConstructorUsedError; - String get email => throw _privateConstructorUsedError; - String get password => throw _privateConstructorUsedError; - @JsonKey(name: 'password_confirmation') String get passwordConfirmation => throw _privateConstructorUsedError; - @JsonKey(name: 'terms') String get termsAccepted => throw _privateConstructorUsedError; - String get birthdate => throw _privateConstructorUsedError; - String get gender => throw _privateConstructorUsedError; - String get location => throw _privateConstructorUsedError; - @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; - String get lang => throw _privateConstructorUsedError; - int get weight => throw _privateConstructorUsedError; - int get height => throw _privateConstructorUsedError; - @JsonKey(name: 'chest_circumference') int get chestCircumference => throw _privateConstructorUsedError; - @JsonKey(name: 'waist_circumference') int get waistCircumference => throw _privateConstructorUsedError; - @JsonKey(name: 'hip_circumference') int get hipCircumference => throw _privateConstructorUsedError; - @JsonKey(name: 'blood_pressure_up') int get bloodPressureUp => throw _privateConstructorUsedError; - @JsonKey(name: 'blood_pressure_down') int get bloodPressureDown => throw _privateConstructorUsedError; - @JsonKey(name: 'has_hypo') int get hasHypo => throw _privateConstructorUsedError; - @JsonKey(name: 'has_hyper') int get hasHyper => throw _privateConstructorUsedError; - @JsonKey(name: 'about_alergy') String get aboutAllergy => throw _privateConstructorUsedError; - @JsonKey(name: 'about_taking_pils') String get aboutTakingPils => throw _privateConstructorUsedError; - @JsonKey(name: 'about_sport_hobbies') String get aboutSportHobbies => throw _privateConstructorUsedError; - @JsonKey(name: 'favorite_foods') String get favoriteFoods => throw _privateConstructorUsedError; - @JsonKey(name: 'unfavorite_foods') String get unfavoriteFoods => throw _privateConstructorUsedError; - @JsonKey(name: 'additional_info') String get additionalInfo => throw _privateConstructorUsedError; - @JsonKey(name: 'activity_coefficient') double get activityCoefficient => throw _privateConstructorUsedError; @@ -99,14 +74,15 @@ mixin _$UserRegistrationSheet { /// Create a copy of UserRegistrationSheet /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $UserRegistrationSheetCopyWith get copyWith => throw _privateConstructorUsedError; + $UserRegistrationSheetCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $UserRegistrationSheetCopyWith<$Res> { - factory $UserRegistrationSheetCopyWith(UserRegistrationSheet value, $Res Function(UserRegistrationSheet) then) = + factory $UserRegistrationSheetCopyWith(UserRegistrationSheet value, + $Res Function(UserRegistrationSheet) then) = _$UserRegistrationSheetCopyWithImpl<$Res, UserRegistrationSheet>; - @useResult $Res call( {@JsonKey(name: 'first_name') String firstName, @@ -139,12 +115,13 @@ abstract class $UserRegistrationSheetCopyWith<$Res> { } /// @nodoc -class _$UserRegistrationSheetCopyWithImpl<$Res, $Val extends UserRegistrationSheet> implements $UserRegistrationSheetCopyWith<$Res> { +class _$UserRegistrationSheetCopyWithImpl<$Res, + $Val extends UserRegistrationSheet> + implements $UserRegistrationSheetCopyWith<$Res> { _$UserRegistrationSheetCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -295,10 +272,12 @@ class _$UserRegistrationSheetCopyWithImpl<$Res, $Val extends UserRegistrationShe } /// @nodoc -abstract class _$$UserRegistrationSheetImplCopyWith<$Res> implements $UserRegistrationSheetCopyWith<$Res> { - factory _$$UserRegistrationSheetImplCopyWith(_$UserRegistrationSheetImpl value, $Res Function(_$UserRegistrationSheetImpl) then) = +abstract class _$$UserRegistrationSheetImplCopyWith<$Res> + implements $UserRegistrationSheetCopyWith<$Res> { + factory _$$UserRegistrationSheetImplCopyWith( + _$UserRegistrationSheetImpl value, + $Res Function(_$UserRegistrationSheetImpl) then) = __$$UserRegistrationSheetImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -332,9 +311,13 @@ abstract class _$$UserRegistrationSheetImplCopyWith<$Res> implements $UserRegist } /// @nodoc -class __$$UserRegistrationSheetImplCopyWithImpl<$Res> extends _$UserRegistrationSheetCopyWithImpl<$Res, _$UserRegistrationSheetImpl> +class __$$UserRegistrationSheetImplCopyWithImpl<$Res> + extends _$UserRegistrationSheetCopyWithImpl<$Res, + _$UserRegistrationSheetImpl> implements _$$UserRegistrationSheetImplCopyWith<$Res> { - __$$UserRegistrationSheetImplCopyWithImpl(_$UserRegistrationSheetImpl _value, $Res Function(_$UserRegistrationSheetImpl) _then) : super(_value, _then); + __$$UserRegistrationSheetImplCopyWithImpl(_$UserRegistrationSheetImpl _value, + $Res Function(_$UserRegistrationSheetImpl) _then) + : super(_value, _then); /// Create a copy of UserRegistrationSheet /// with the given fields replaced by the non-null parameter values. @@ -490,7 +473,8 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(name: 'last_name') required this.lastName, required this.email, required this.password, - @JsonKey(name: 'password_confirmation') required this.passwordConfirmation, + @JsonKey(name: 'password_confirmation') + required this.passwordConfirmation, @JsonKey(name: 'terms') this.termsAccepted = 'accepted', required this.birthdate, required this.gender, @@ -514,7 +498,8 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(name: 'additional_info') required this.additionalInfo, @JsonKey(name: 'activity_coefficient') this.activityCoefficient = 1.2}); - factory _$UserRegistrationSheetImpl.fromJson(Map json) => _$$UserRegistrationSheetImplFromJson(json); + factory _$UserRegistrationSheetImpl.fromJson(Map json) => + _$$UserRegistrationSheetImplFromJson(json); @override @JsonKey(name: 'first_name') @@ -600,33 +585,54 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { return identical(this, other) || (other.runtimeType == runtimeType && other is _$UserRegistrationSheetImpl && - (identical(other.firstName, firstName) || other.firstName == firstName) && - (identical(other.lastName, lastName) || other.lastName == lastName) && + (identical(other.firstName, firstName) || + other.firstName == firstName) && + (identical(other.lastName, lastName) || + other.lastName == lastName) && (identical(other.email, email) || other.email == email) && - (identical(other.password, password) || other.password == password) && - (identical(other.passwordConfirmation, passwordConfirmation) || other.passwordConfirmation == passwordConfirmation) && - (identical(other.termsAccepted, termsAccepted) || other.termsAccepted == termsAccepted) && - (identical(other.birthdate, birthdate) || other.birthdate == birthdate) && + (identical(other.password, password) || + other.password == password) && + (identical(other.passwordConfirmation, passwordConfirmation) || + other.passwordConfirmation == passwordConfirmation) && + (identical(other.termsAccepted, termsAccepted) || + other.termsAccepted == termsAccepted) && + (identical(other.birthdate, birthdate) || + other.birthdate == birthdate) && (identical(other.gender, gender) || other.gender == gender) && - (identical(other.location, location) || other.location == location) && - (identical(other.responseBody, responseBody) || other.responseBody == responseBody) && + (identical(other.location, location) || + other.location == location) && + (identical(other.responseBody, responseBody) || + other.responseBody == responseBody) && (identical(other.lang, lang) || other.lang == lang) && (identical(other.weight, weight) || other.weight == weight) && (identical(other.height, height) || other.height == height) && - (identical(other.chestCircumference, chestCircumference) || other.chestCircumference == chestCircumference) && - (identical(other.waistCircumference, waistCircumference) || other.waistCircumference == waistCircumference) && - (identical(other.hipCircumference, hipCircumference) || other.hipCircumference == hipCircumference) && - (identical(other.bloodPressureUp, bloodPressureUp) || other.bloodPressureUp == bloodPressureUp) && - (identical(other.bloodPressureDown, bloodPressureDown) || other.bloodPressureDown == bloodPressureDown) && + (identical(other.chestCircumference, chestCircumference) || + other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || + other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || + other.hipCircumference == hipCircumference) && + (identical(other.bloodPressureUp, bloodPressureUp) || + other.bloodPressureUp == bloodPressureUp) && + (identical(other.bloodPressureDown, bloodPressureDown) || + other.bloodPressureDown == bloodPressureDown) && (identical(other.hasHypo, hasHypo) || other.hasHypo == hasHypo) && - (identical(other.hasHyper, hasHyper) || other.hasHyper == hasHyper) && - (identical(other.aboutAllergy, aboutAllergy) || other.aboutAllergy == aboutAllergy) && - (identical(other.aboutTakingPils, aboutTakingPils) || other.aboutTakingPils == aboutTakingPils) && - (identical(other.aboutSportHobbies, aboutSportHobbies) || other.aboutSportHobbies == aboutSportHobbies) && - (identical(other.favoriteFoods, favoriteFoods) || other.favoriteFoods == favoriteFoods) && - (identical(other.unfavoriteFoods, unfavoriteFoods) || other.unfavoriteFoods == unfavoriteFoods) && - (identical(other.additionalInfo, additionalInfo) || other.additionalInfo == additionalInfo) && - (identical(other.activityCoefficient, activityCoefficient) || other.activityCoefficient == activityCoefficient)); + (identical(other.hasHyper, hasHyper) || + other.hasHyper == hasHyper) && + (identical(other.aboutAllergy, aboutAllergy) || + other.aboutAllergy == aboutAllergy) && + (identical(other.aboutTakingPils, aboutTakingPils) || + other.aboutTakingPils == aboutTakingPils) && + (identical(other.aboutSportHobbies, aboutSportHobbies) || + other.aboutSportHobbies == aboutSportHobbies) && + (identical(other.favoriteFoods, favoriteFoods) || + other.favoriteFoods == favoriteFoods) && + (identical(other.unfavoriteFoods, unfavoriteFoods) || + other.unfavoriteFoods == unfavoriteFoods) && + (identical(other.additionalInfo, additionalInfo) || + other.additionalInfo == additionalInfo) && + (identical(other.activityCoefficient, activityCoefficient) || + other.activityCoefficient == activityCoefficient)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -667,8 +673,9 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => - __$$UserRegistrationSheetImplCopyWithImpl<_$UserRegistrationSheetImpl>(this, _$identity); + _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> + get copyWith => __$$UserRegistrationSheetImplCopyWithImpl< + _$UserRegistrationSheetImpl>(this, _$identity); @override Map toJson() { @@ -684,7 +691,8 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { @JsonKey(name: 'last_name') required final String lastName, required final String email, required final String password, - @JsonKey(name: 'password_confirmation') required final String passwordConfirmation, + @JsonKey(name: 'password_confirmation') + required final String passwordConfirmation, @JsonKey(name: 'terms') final String termsAccepted, required final String birthdate, required final String gender, @@ -693,119 +701,99 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { required final String lang, required final int weight, required final int height, - @JsonKey(name: 'chest_circumference') required final int chestCircumference, - @JsonKey(name: 'waist_circumference') required final int waistCircumference, + @JsonKey(name: 'chest_circumference') + required final int chestCircumference, + @JsonKey(name: 'waist_circumference') + required final int waistCircumference, @JsonKey(name: 'hip_circumference') required final int hipCircumference, @JsonKey(name: 'blood_pressure_up') required final int bloodPressureUp, - @JsonKey(name: 'blood_pressure_down') required final int bloodPressureDown, + @JsonKey(name: 'blood_pressure_down') + required final int bloodPressureDown, @JsonKey(name: 'has_hypo') required final int hasHypo, @JsonKey(name: 'has_hyper') required final int hasHyper, @JsonKey(name: 'about_alergy') required final String aboutAllergy, @JsonKey(name: 'about_taking_pils') required final String aboutTakingPils, - @JsonKey(name: 'about_sport_hobbies') required final String aboutSportHobbies, + @JsonKey(name: 'about_sport_hobbies') + required final String aboutSportHobbies, @JsonKey(name: 'favorite_foods') required final String favoriteFoods, @JsonKey(name: 'unfavorite_foods') required final String unfavoriteFoods, @JsonKey(name: 'additional_info') required final String additionalInfo, - @JsonKey(name: 'activity_coefficient') final double activityCoefficient}) = _$UserRegistrationSheetImpl; + @JsonKey(name: 'activity_coefficient') + final double activityCoefficient}) = _$UserRegistrationSheetImpl; - factory _UserRegistrationSheet.fromJson(Map json) = _$UserRegistrationSheetImpl.fromJson; + factory _UserRegistrationSheet.fromJson(Map json) = + _$UserRegistrationSheetImpl.fromJson; @override @JsonKey(name: 'first_name') String get firstName; - @override @JsonKey(name: 'last_name') String get lastName; - @override String get email; - @override String get password; - @override @JsonKey(name: 'password_confirmation') String get passwordConfirmation; - @override @JsonKey(name: 'terms') String get termsAccepted; - @override String get birthdate; - @override String get gender; - @override String get location; - @override @JsonKey(name: 'response_body') String get responseBody; - @override String get lang; - @override int get weight; - @override int get height; - @override @JsonKey(name: 'chest_circumference') int get chestCircumference; - @override @JsonKey(name: 'waist_circumference') int get waistCircumference; - @override @JsonKey(name: 'hip_circumference') int get hipCircumference; - @override @JsonKey(name: 'blood_pressure_up') int get bloodPressureUp; - @override @JsonKey(name: 'blood_pressure_down') int get bloodPressureDown; - @override @JsonKey(name: 'has_hypo') int get hasHypo; - @override @JsonKey(name: 'has_hyper') int get hasHyper; - @override @JsonKey(name: 'about_alergy') String get aboutAllergy; - @override @JsonKey(name: 'about_taking_pils') String get aboutTakingPils; - @override @JsonKey(name: 'about_sport_hobbies') String get aboutSportHobbies; - @override @JsonKey(name: 'favorite_foods') String get favoriteFoods; - @override @JsonKey(name: 'unfavorite_foods') String get unfavoriteFoods; - @override @JsonKey(name: 'additional_info') String get additionalInfo; - @override @JsonKey(name: 'activity_coefficient') double get activityCoefficient; @@ -814,5 +802,6 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => throw _privateConstructorUsedError; + _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/models/user_registration_model.g.dart b/lib/features/registration/models/user_registration_model.g.dart index 7690dbb1..9500e915 100644 --- a/lib/features/registration/models/user_registration_model.g.dart +++ b/lib/features/registration/models/user_registration_model.g.dart @@ -6,7 +6,9 @@ part of 'user_registration_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson(Map json) => _$UserRegistrationSheetImpl( +_$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson( + Map json) => + _$UserRegistrationSheetImpl( firstName: json['first_name'] as String, lastName: json['last_name'] as String, email: json['email'] as String, @@ -33,10 +35,13 @@ _$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson(Map _$$UserRegistrationSheetImplToJson(_$UserRegistrationSheetImpl instance) => { +Map _$$UserRegistrationSheetImplToJson( + _$UserRegistrationSheetImpl instance) => + { 'first_name': instance.firstName, 'last_name': instance.lastName, 'email': instance.email, diff --git a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart index eb722a2b..ae0a9706 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart @@ -21,13 +21,15 @@ mixin _$RegistrationState { /// Create a copy of RegistrationState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $RegistrationStateCopyWith get copyWith => throw _privateConstructorUsedError; + $RegistrationStateCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $RegistrationStateCopyWith<$Res> { - factory $RegistrationStateCopyWith(RegistrationState value, $Res Function(RegistrationState) then) = _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; - + factory $RegistrationStateCopyWith( + RegistrationState value, $Res Function(RegistrationState) then) = + _$RegistrationStateCopyWithImpl<$Res, RegistrationState>; @useResult $Res call({UserRegistrationSheet sheet}); @@ -35,12 +37,12 @@ abstract class $RegistrationStateCopyWith<$Res> { } /// @nodoc -class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> implements $RegistrationStateCopyWith<$Res> { +class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> + implements $RegistrationStateCopyWith<$Res> { _$RegistrationStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -71,10 +73,11 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> impl } /// @nodoc -abstract class _$$RegistrationStateImplCopyWith<$Res> implements $RegistrationStateCopyWith<$Res> { - factory _$$RegistrationStateImplCopyWith(_$RegistrationStateImpl value, $Res Function(_$RegistrationStateImpl) then) = +abstract class _$$RegistrationStateImplCopyWith<$Res> + implements $RegistrationStateCopyWith<$Res> { + factory _$$RegistrationStateImplCopyWith(_$RegistrationStateImpl value, + $Res Function(_$RegistrationStateImpl) then) = __$$RegistrationStateImplCopyWithImpl<$Res>; - @override @useResult $Res call({UserRegistrationSheet sheet}); @@ -84,9 +87,12 @@ abstract class _$$RegistrationStateImplCopyWith<$Res> implements $RegistrationSt } /// @nodoc -class __$$RegistrationStateImplCopyWithImpl<$Res> extends _$RegistrationStateCopyWithImpl<$Res, _$RegistrationStateImpl> +class __$$RegistrationStateImplCopyWithImpl<$Res> + extends _$RegistrationStateCopyWithImpl<$Res, _$RegistrationStateImpl> implements _$$RegistrationStateImplCopyWith<$Res> { - __$$RegistrationStateImplCopyWithImpl(_$RegistrationStateImpl _value, $Res Function(_$RegistrationStateImpl) _then) : super(_value, _then); + __$$RegistrationStateImplCopyWithImpl(_$RegistrationStateImpl _value, + $Res Function(_$RegistrationStateImpl) _then) + : super(_value, _then); /// Create a copy of RegistrationState /// with the given fields replaced by the non-null parameter values. @@ -120,7 +126,9 @@ class _$RegistrationStateImpl implements _RegistrationState { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$RegistrationStateImpl && (identical(other.sheet, sheet) || other.sheet == sheet)); + (other.runtimeType == runtimeType && + other is _$RegistrationStateImpl && + (identical(other.sheet, sheet) || other.sheet == sheet)); } @override @@ -131,11 +139,14 @@ class _$RegistrationStateImpl implements _RegistrationState { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => __$$RegistrationStateImplCopyWithImpl<_$RegistrationStateImpl>(this, _$identity); + _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => + __$$RegistrationStateImplCopyWithImpl<_$RegistrationStateImpl>( + this, _$identity); } abstract class _RegistrationState implements RegistrationState { - const factory _RegistrationState({required final UserRegistrationSheet sheet}) = _$RegistrationStateImpl; + const factory _RegistrationState( + {required final UserRegistrationSheet sheet}) = _$RegistrationStateImpl; @override UserRegistrationSheet get sheet; @@ -144,5 +155,6 @@ abstract class _RegistrationState implements RegistrationState { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => throw _privateConstructorUsedError; + _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/registration/presentation/pages/city_of_living_screen.dart b/lib/features/registration/presentation/pages/city_of_living_screen.dart index 46a00fca..9a8491c9 100644 --- a/lib/features/registration/presentation/pages/city_of_living_screen.dart +++ b/lib/features/registration/presentation/pages/city_of_living_screen.dart @@ -3,6 +3,7 @@ import 'package:eatvio_app/features/registration/models/user_registration_model. import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; @@ -153,7 +154,7 @@ class _CityOfLivingScreenState extends State { Icons.near_me_rounded, color: appTheme.blueA400, ) - : CircularProgressIndicator(), + : CupertinoActivityIndicator(), ), ), ], diff --git a/lib/features/registration/presentation/pages/date_of_birth_screen.dart b/lib/features/registration/presentation/pages/date_of_birth_screen.dart index cf5c354b..79a02092 100644 --- a/lib/features/registration/presentation/pages/date_of_birth_screen.dart +++ b/lib/features/registration/presentation/pages/date_of_birth_screen.dart @@ -35,6 +35,7 @@ class _DateOfBirthScreenState extends State { @override Widget build(BuildContext context) { final s = S.of(context); + return SingleChildScrollView( padding: EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16), child: Column( @@ -86,15 +87,11 @@ class _DateOfBirthScreenState extends State { context: context, builder: (BuildContext context) => Container( height: 216, - padding: const EdgeInsets.only(top: 6.0), - // The Bottom margin is provided to align the popup above the system - // navigation bar. + padding: const EdgeInsets.only(top: 6), margin: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom, ), - // Provide a background color for the popup. color: CupertinoColors.systemBackground.resolveFrom(context), - // Use a SafeArea widget to avoid system overlaps. child: SafeArea( top: false, child: child, diff --git a/lib/features/registration/presentation/pages/name_screen.dart b/lib/features/registration/presentation/pages/name_screen.dart index efb81f63..b2211961 100644 --- a/lib/features/registration/presentation/pages/name_screen.dart +++ b/lib/features/registration/presentation/pages/name_screen.dart @@ -58,7 +58,7 @@ class _NameScreenState extends State { final registrationCubit = context.read(); registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(lastName: newValue)); }, - ) + ), ], ), ); diff --git a/lib/features/registration/presentation/pages/registration_screen.dart b/lib/features/registration/presentation/pages/registration_screen.dart index 7f5b33e8..237e92e3 100644 --- a/lib/features/registration/presentation/pages/registration_screen.dart +++ b/lib/features/registration/presentation/pages/registration_screen.dart @@ -100,7 +100,7 @@ class _RegistrationScreenState extends State { }, label: Text( 'Продолжить', - style: theme.textTheme.titleSmall, + style: theme.textTheme.titleSmall!.copyWith(color: Colors.white), ), ), ), diff --git a/lib/features/registration/services/registration_service.g.dart b/lib/features/registration/services/registration_service.g.dart index 50d9fd82..4aaccede 100644 --- a/lib/features/registration/services/registration_service.g.dart +++ b/lib/features/registration/services/registration_service.g.dart @@ -22,7 +22,8 @@ class _RegistrationService implements RegistrationService { final ParseErrorLogger? errorLogger; @override - Future> register({required Map sheet}) async { + Future> register( + {required Map sheet}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; @@ -128,7 +129,9 @@ class _RegistrationService implements RegistrationService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/settings/presentation/pages/general_info_screen.dart b/lib/features/settings/presentation/pages/general_info_screen.dart new file mode 100644 index 00000000..a8dd8d2c --- /dev/null +++ b/lib/features/settings/presentation/pages/general_info_screen.dart @@ -0,0 +1,83 @@ +import 'package:eatvio_app/generated/l10n.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; +import 'package:flutter/material.dart'; + +class GeneralInfoScreen extends StatefulWidget { + const GeneralInfoScreen({super.key}); + + @override + State createState() => _GeneralInfoScreenState(); +} + +class _GeneralInfoScreenState extends State { + final firstNameController = TextEditingController(); + final lastNameController = TextEditingController(); + + @override + Widget build(BuildContext context) { + final s = S.of(context); + + return Scaffold( + appBar: AppBar( + title: Text('Общая информация'), + ), + bottomSheet: _saveButton(), + body: SingleChildScrollView( + physics: const BouncingScrollPhysics(), + padding: EdgeInsets.symmetric(vertical: 16, horizontal: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(s.first_name), + SizedBox(height: 4), + CustomTextFormField( + controller: firstNameController, + textInputAction: TextInputAction.next, + hintText: 'Введите имя', + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text(s.last_name), + SizedBox(height: 4), + CustomTextFormField( + controller: lastNameController, + textInputAction: TextInputAction.done, + hintText: 'Введите фамилию', + onChanged: (newValue) {}, + ), + ], + ), + ), + ); + } + + _saveButton() { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4), + child: InkWell( + onTap: () {}, + borderRadius: BorderRadius.circular(12), + child: Ink( + height: 52, + width: MediaQuery.of(context).size.width - 16, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: appTheme.blueA400, + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + height: 1, + fontWeight: FontWeight.w600, + fontSize: 18, + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/features/settings/presentation/pages/other_info_screen.dart b/lib/features/settings/presentation/pages/other_info_screen.dart new file mode 100644 index 00000000..4c6a33bc --- /dev/null +++ b/lib/features/settings/presentation/pages/other_info_screen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/cupertino.dart'; + +class OtherInfoScreen extends StatefulWidget { + const OtherInfoScreen({super.key}); + + @override + State createState() => _OtherInfoScreenState(); +} + +class _OtherInfoScreenState extends State { + @override + Widget build(BuildContext context) { + return const Placeholder(); + } +} \ No newline at end of file diff --git a/lib/features/settings/presentation/pages/physical_activity_screen.dart b/lib/features/settings/presentation/pages/physical_activity_screen.dart new file mode 100644 index 00000000..b4c3fec2 --- /dev/null +++ b/lib/features/settings/presentation/pages/physical_activity_screen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/cupertino.dart'; + +class PhysicalActivityScreen extends StatefulWidget { + const PhysicalActivityScreen({super.key}); + + @override + State createState() => _PhysicalActivityScreenState(); +} + +class _PhysicalActivityScreenState extends State { + @override + Widget build(BuildContext context) { + return const Placeholder(); + } +} \ No newline at end of file diff --git a/lib/features/settings/presentation/pages/physical_form_screen.dart b/lib/features/settings/presentation/pages/physical_form_screen.dart new file mode 100644 index 00000000..5ff2ea7e --- /dev/null +++ b/lib/features/settings/presentation/pages/physical_form_screen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/cupertino.dart'; + +class PhysicalFormScreen extends StatefulWidget { + const PhysicalFormScreen({super.key}); + + @override + State createState() => _PhysicalFormScreenState(); +} + +class _PhysicalFormScreenState extends State { + @override + Widget build(BuildContext context) { + return const Placeholder(); + } +} \ No newline at end of file diff --git a/lib/features/settings/presentation/pages/pressure_screen.dart b/lib/features/settings/presentation/pages/pressure_screen.dart new file mode 100644 index 00000000..58bdcebd --- /dev/null +++ b/lib/features/settings/presentation/pages/pressure_screen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/cupertino.dart'; + +class PressureScreen extends StatefulWidget { + const PressureScreen({super.key}); + + @override + State createState() => _PressureScreenState(); +} + +class _PressureScreenState extends State { + @override + Widget build(BuildContext context) { + return const Placeholder(); + } +} \ No newline at end of file diff --git a/lib/features/settings/presentation/pages/settings_screen.dart b/lib/features/settings/presentation/pages/settings_screen.dart new file mode 100644 index 00000000..3136ae42 --- /dev/null +++ b/lib/features/settings/presentation/pages/settings_screen.dart @@ -0,0 +1,409 @@ +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:eatvio_app/widgets/custom_drop_down.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; + +class SettingsScreen extends StatefulWidget { + const SettingsScreen({super.key}); + + @override + State createState() => _SettingsScreenState(); +} + +class _SettingsScreenState extends State { + bool updatesNotificationsSwitchState = true; + bool fillDiaryNotificationsSwitchState = true; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Color(0xFFF0F2F5), + appBar: AppBar( + title: Text('Настройки'), + ), + body: SingleChildScrollView( + physics: const BouncingScrollPhysics(), + child: Column( + children: [ + const SizedBox(height: 16), + _selectLanguageDropDown(), + const SizedBox(height: 20), + _additionalInfo(), + const SizedBox(height: 12), + _notifications(), + const SizedBox(height: 12), + _aboutEatvio(), + const SizedBox(height: 16), + _becomeConsultantButton(), + const SizedBox(height: 8), + _deleteAccountButton(), + const SizedBox(height: 16), + ], + ), + ), + ); + } + + _selectLanguageDropDown() { + final items = [SelectionPopupModel(title: 'Русский', id: 0, isSelected: true, value: 'Русский')]; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Text( + 'Язык', + style: TextStyle( + fontSize: 16, + height: 1, + color: Colors.grey, + ), + ), + ), + const SizedBox(height: 8), + _actionsGroup( + CustomDropDown( + items: items, + value: items[0], + autofocus: false, + ), + ), + ], + ); + } + + _additionalInfo() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Text( + 'Дополнительаная информация', + style: TextStyle( + fontSize: 16, + height: 1, + color: Colors.grey, + fontFamily: 'Mulish', + ), + ), + ), + const SizedBox(height: 8), + _actionsGroup( + Column( + children: [ + const SizedBox(height: 8), + GestureDetector( + onTap: () => GoRouter.of(context).pushNamed('generalInfoScreen'), + child: Row( + children: [ + Text( + 'Общая информация', + style: TextStyle( + color: Colors.black, + ), + ), + const Spacer(), + Icon( + Icons.keyboard_arrow_right_rounded, + color: Colors.grey.shade400, + ), + ], + ), + ), + _divider(context), + GestureDetector( + onTap: () => GoRouter.of(context).pushNamed('physicalFormScreen'), + child: Row( + children: [ + Text( + 'Физическая форма', + style: TextStyle( + color: Colors.black, + ), + ), + const Spacer(), + Icon( + Icons.keyboard_arrow_right_rounded, + color: Colors.grey.shade400, + ), + ], + ), + ), + _divider(context), + GestureDetector( + onTap: () => GoRouter.of(context).pushNamed('pressureScreen'), + child: Row( + children: [ + Text( + 'Давление', + style: TextStyle( + color: Colors.black, + ), + ), + const Spacer(), + Icon( + Icons.keyboard_arrow_right_rounded, + color: Colors.grey.shade400, + ), + ], + ), + ), + _divider(context), + GestureDetector( + onTap: () => GoRouter.of(context).pushNamed('otherInfoScreen'), + child: Row( + children: [ + Text( + 'Прочая информация', + style: TextStyle( + color: Colors.black, + ), + ), + const Spacer(), + Icon( + Icons.keyboard_arrow_right_rounded, + color: Colors.grey.shade400, + ), + ], + ), + ), + _divider(context), + GestureDetector( + onTap: () => GoRouter.of(context).pushNamed('physicalActivityScreen'), + child: Row( + children: [ + Text( + 'Физическая нагрузка', + style: TextStyle( + color: Colors.black, + ), + ), + const Spacer(), + Icon( + Icons.keyboard_arrow_right_rounded, + color: Colors.grey.shade400, + ), + ], + ), + ), + const SizedBox(height: 8), + ], + ), + ), + ], + ); + } + + _notifications() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 8), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Text( + 'Уведомления', + style: TextStyle( + fontSize: 16, + height: 1, + color: Colors.grey, + ), + ), + ), + const SizedBox(height: 8), + _actionsGroup( + Column( + children: [ + Row( + children: [ + Text( + 'Уведомление о новых обновлениях', + style: TextStyle( + color: Colors.black, + ), + ), + const Spacer(), + CupertinoSwitch( + value: updatesNotificationsSwitchState, + activeColor: appTheme.blueA400, + onChanged: (newValue) { + setState(() { + updatesNotificationsSwitchState = newValue; + }); + }, + ), + ], + ), + _divider(context), + Row( + children: [ + Text( + 'Напоминание о заполнении дневника', + style: TextStyle( + color: Colors.black, + ), + ), + const Spacer(), + CupertinoSwitch( + value: fillDiaryNotificationsSwitchState, + activeColor: appTheme.blueA400, + onChanged: (newValue) { + setState(() { + fillDiaryNotificationsSwitchState = newValue; + }); + }, + ), + ], + ), + ], + ), + ), + const SizedBox(height: 8), + ], + ); + } + + _aboutEatvio() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Text( + 'О Eatvio', + style: TextStyle( + fontSize: 16, + height: 1, + color: Colors.grey, + ), + ), + ), + const SizedBox(height: 8), + _actionsGroup( + Column( + children: [ + const SizedBox(height: 8), + Row( + children: [ + Text( + 'О компании', + style: TextStyle( + color: Colors.black, + ), + ), + const Spacer(), + Icon( + Icons.keyboard_arrow_right_rounded, + color: Colors.grey.shade400, + ), + ], + ), + _divider(context), + Row( + children: [ + Text( + 'Пользовательское соглашение', + style: TextStyle( + color: Colors.black, + ), + ), + const Spacer(), + Icon( + Icons.keyboard_arrow_right_rounded, + color: Colors.grey.shade400, + ), + ], + ), + const SizedBox(height: 8), + ], + ), + ), + ], + ); + } + + _becomeConsultantButton() { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: InkWell( + onTap: () {}, + borderRadius: BorderRadius.circular(12), + child: Ink( + height: 52, + width: MediaQuery.of(context).size.width - 16, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: appTheme.blueA400, + ), + child: Center( + child: Text( + 'Стать консультантом', + style: TextStyle( + color: Colors.white, + height: 1, + fontWeight: FontWeight.w600, + fontSize: 18, + ), + ), + ), + ), + ), + ); + } + + _deleteAccountButton() { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: InkWell( + onTap: () {}, + borderRadius: BorderRadius.circular(12), + child: Ink( + height: 52, + width: MediaQuery.of(context).size.width - 16, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.black.withOpacity(0.1), + ), + child: Center( + child: Text( + 'Удалить аккаунт', + style: TextStyle( + color: Colors.black, + height: 1, + fontWeight: FontWeight.w600, + fontSize: 18, + ), + ), + ), + ), + ), + ); + } + + _actionsGroup(Widget child) { + return Container( + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: child, + ); + } + + _divider(BuildContext context) { + return Container( + margin: EdgeInsets.symmetric(vertical: 12), + height: 0.4, + width: MediaQuery.of(context).size.width - 16, + decoration: BoxDecoration( + color: Colors.black26, + borderRadius: BorderRadius.circular(16), + ), + ); + } +} diff --git a/lib/generated/intl/messages_all.dart b/lib/generated/intl/messages_all.dart index 8e3e2726..203415cc 100644 --- a/lib/generated/intl/messages_all.dart +++ b/lib/generated/intl/messages_all.dart @@ -19,7 +19,6 @@ import 'package:intl/src/intl_helpers.dart'; import 'messages_en.dart' as messages_en; typedef Future LibraryLoader(); - Map _deferredLibraries = { 'en': () => new SynchronousFuture(null), }; @@ -35,7 +34,9 @@ MessageLookupByLibrary? _findExact(String localeName) { /// User programs should call this before using [localeName] for messages. Future initializeMessages(String localeName) { - var availableLocale = Intl.verifiedLocale(localeName, (locale) => _deferredLibraries[locale] != null, onFailure: (_) => null); + var availableLocale = Intl.verifiedLocale( + localeName, (locale) => _deferredLibraries[locale] != null, + onFailure: (_) => null); if (availableLocale == null) { return new SynchronousFuture(false); } @@ -55,7 +56,8 @@ bool _messagesExistFor(String locale) { } MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { - var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); + var actualLocale = + Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); if (actualLocale == null) return null; return _findExact(actualLocale); } diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 123ac71e..34f0eb48 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -21,101 +21,152 @@ class MessageLookup extends MessageLookupByLibrary { String get localeName => 'en'; final messages = _notInlinedMessages(_notInlinedMessages); - static Map _notInlinedMessages(_) => { "Moscow": MessageLookupByLibrary.simpleMessage("Москва"), "Russia": MessageLookupByLibrary.simpleMessage("Россия"), "active": MessageLookupByLibrary.simpleMessage("Активен"), "add_measure": MessageLookupByLibrary.simpleMessage("Добавить замер"), - "additional_information": MessageLookupByLibrary.simpleMessage("Дополнительная информация"), + "additional_information": + MessageLookupByLibrary.simpleMessage("Дополнительная информация"), "admin": MessageLookupByLibrary.simpleMessage("Админ"), - "allergies_presence": MessageLookupByLibrary.simpleMessage("Наличие аллергии"), + "allergies_presence": + MessageLookupByLibrary.simpleMessage("Наличие аллергии"), "archived": MessageLookupByLibrary.simpleMessage("В архиве"), "authentificate": MessageLookupByLibrary.simpleMessage("Войти"), - "average_pressure": MessageLookupByLibrary.simpleMessage("Средние показатели давления:"), + "average_pressure": MessageLookupByLibrary.simpleMessage( + "Средние показатели давления:"), "bodymass_chart": MessageLookupByLibrary.simpleMessage("График ИМТ"), "chat": MessageLookupByLibrary.simpleMessage("Чат"), "chest": MessageLookupByLibrary.simpleMessage("Грудь"), - "chest_circumference": MessageLookupByLibrary.simpleMessage("Обхват груди"), - "circumference_empty": MessageLookupByLibrary.simpleMessage("Все замеры обязательны к заполнению"), - "circumference_is_not_a_number": MessageLookupByLibrary.simpleMessage("Все замеры должны быть числами"), - "circumferences_chart": MessageLookupByLibrary.simpleMessage("График обхватов"), + "chest_circumference": + MessageLookupByLibrary.simpleMessage("Обхват груди"), + "circumference_empty": MessageLookupByLibrary.simpleMessage( + "Все замеры обязательны к заполнению"), + "circumference_is_not_a_number": MessageLookupByLibrary.simpleMessage( + "Все замеры должны быть числами"), + "circumferences_chart": + MessageLookupByLibrary.simpleMessage("График обхватов"), "city": MessageLookupByLibrary.simpleMessage("Город"), - "city_of_living": MessageLookupByLibrary.simpleMessage("Город проживания"), + "city_of_living": + MessageLookupByLibrary.simpleMessage("Город проживания"), "continueButton": MessageLookupByLibrary.simpleMessage("Продолжить"), "country": MessageLookupByLibrary.simpleMessage("Страна"), "date_of_birth": MessageLookupByLibrary.simpleMessage("Дата рождения"), "diary": MessageLookupByLibrary.simpleMessage("Дневник"), - "do_you_have_hypertension_tendency": MessageLookupByLibrary.simpleMessage("Есть ли у вас гипертония?"), - "do_you_have_hypotension_tendency": MessageLookupByLibrary.simpleMessage("Есть ли у вас гипотония?"), - "do_you_take_pills": MessageLookupByLibrary.simpleMessage("Принимаете ли вы лекарства или бады?"), - "down_pressure": MessageLookupByLibrary.simpleMessage("Нижние показатели давления:"), + "do_you_have_hypertension_tendency": + MessageLookupByLibrary.simpleMessage("Есть ли у вас гипертония?"), + "do_you_have_hypotension_tendency": + MessageLookupByLibrary.simpleMessage("Есть ли у вас гипотония?"), + "do_you_take_pills": MessageLookupByLibrary.simpleMessage( + "Принимаете ли вы лекарства или бады?"), + "down_pressure": + MessageLookupByLibrary.simpleMessage("Нижние показатели давления:"), "draft": MessageLookupByLibrary.simpleMessage("Черновик"), "email": MessageLookupByLibrary.simpleMessage("Элетронная почта"), - "email_empty": MessageLookupByLibrary.simpleMessage("Необходимо ввести адрес электронной почты"), - "email_invalid": MessageLookupByLibrary.simpleMessage("Некорректный адрес электронной почты"), - "enter_additional_information": MessageLookupByLibrary.simpleMessage("Введите любую дополнительную информацию на своё усмотрение:"), - "enter_information": MessageLookupByLibrary.simpleMessage("Введите информацию..."), + "email_empty": MessageLookupByLibrary.simpleMessage( + "Необходимо ввести адрес электронной почты"), + "email_invalid": MessageLookupByLibrary.simpleMessage( + "Некорректный адрес электронной почты"), + "enter_additional_information": MessageLookupByLibrary.simpleMessage( + "Введите любую дополнительную информацию на своё усмотрение:"), + "enter_information": + MessageLookupByLibrary.simpleMessage("Введите информацию..."), "exit": MessageLookupByLibrary.simpleMessage("Выйти"), - "favorite_foods": MessageLookupByLibrary.simpleMessage("Любимые продукты"), - "favorite_unfavorite_foods": MessageLookupByLibrary.simpleMessage("Ваши любимые/нелюбимые продукты питания?"), + "favorite_foods": + MessageLookupByLibrary.simpleMessage("Любимые продукты"), + "favorite_unfavorite_foods": MessageLookupByLibrary.simpleMessage( + "Ваши любимые/нелюбимые продукты питания?"), "female": MessageLookupByLibrary.simpleMessage("Женский"), - "fill_in_information": MessageLookupByLibrary.simpleMessage("Заполните информацию:"), + "fill_in_information": + MessageLookupByLibrary.simpleMessage("Заполните информацию:"), "finish": MessageLookupByLibrary.simpleMessage("Завершить"), "first_name": MessageLookupByLibrary.simpleMessage("Имя"), - "first_name_empty": MessageLookupByLibrary.simpleMessage("Имя обязательно для заполнения"), - "first_name_short": MessageLookupByLibrary.simpleMessage("В имени должен быть минимум 1 символ"), + "first_name_empty": MessageLookupByLibrary.simpleMessage( + "Имя обязательно для заполнения"), + "first_name_short": MessageLookupByLibrary.simpleMessage( + "В имени должен быть минимум 1 символ"), "gr": MessageLookupByLibrary.simpleMessage("гр"), "grams": MessageLookupByLibrary.simpleMessage("гр"), - "height_measurements": MessageLookupByLibrary.simpleMessage("Замер роста"), - "hip_circumference": MessageLookupByLibrary.simpleMessage("Обхват бедер"), + "height_measurements": + MessageLookupByLibrary.simpleMessage("Замер роста"), + "hip_circumference": + MessageLookupByLibrary.simpleMessage("Обхват бедер"), "hips": MessageLookupByLibrary.simpleMessage("Бедра"), "in_progress": MessageLookupByLibrary.simpleMessage("В процессе"), - "initial_measurements": MessageLookupByLibrary.simpleMessage("Первичные замеры"), - "language": MessageLookupByLibrary.simpleMessage("Язык:"), + "initial_measurements": + MessageLookupByLibrary.simpleMessage("Первичные замеры"), + "language": MessageLookupByLibrary.simpleMessage("Язык"), "last_name": MessageLookupByLibrary.simpleMessage("Фамилия"), - "last_name_empty": MessageLookupByLibrary.simpleMessage("Фамилия обязательна для заполнения"), - "last_name_short": MessageLookupByLibrary.simpleMessage("В фамилии должен быть минимум 6 символов"), + "last_name_empty": MessageLookupByLibrary.simpleMessage( + "Фамилия обязательна для заполнения"), + "last_name_short": MessageLookupByLibrary.simpleMessage( + "В фамилии должен быть минимум 6 символов"), "lbl_english": MessageLookupByLibrary.simpleMessage("English"), "loading": MessageLookupByLibrary.simpleMessage("Загрузка..."), "male": MessageLookupByLibrary.simpleMessage("Мужской"), - "msg_network_err": MessageLookupByLibrary.simpleMessage("Сетевая ошибка!"), - "msg_something_went_wrong": MessageLookupByLibrary.simpleMessage("Что то пошло не так!"), + "msg_network_err": + MessageLookupByLibrary.simpleMessage("Сетевая ошибка!"), + "msg_something_went_wrong": + MessageLookupByLibrary.simpleMessage("Что то пошло не так!"), "my_blog": MessageLookupByLibrary.simpleMessage("Мой блог"), "my_settings": MessageLookupByLibrary.simpleMessage("Мои настройки"), - "name_empty": MessageLookupByLibrary.simpleMessage("Имя пользователя обязательно для заполнения"), - "name_short": MessageLookupByLibrary.simpleMessage("В имени пользователя должно быть минимум 6 символов"), + "name_empty": MessageLookupByLibrary.simpleMessage( + "Имя пользователя обязательно для заполнения"), + "name_short": MessageLookupByLibrary.simpleMessage( + "В имени пользователя должно быть минимум 6 символов"), "no": MessageLookupByLibrary.simpleMessage("Нет"), - "no_account": MessageLookupByLibrary.simpleMessage("У меня нет аккаунта"), + "no_account": + MessageLookupByLibrary.simpleMessage("У меня нет аккаунта"), "password": MessageLookupByLibrary.simpleMessage("Пароль"), - "password_confirmation": MessageLookupByLibrary.simpleMessage("Подтвердите пароль"), - "password_confirmation_mismatch": MessageLookupByLibrary.simpleMessage("Пароли не совпадают"), - "password_empty": MessageLookupByLibrary.simpleMessage("Пароль обязателен для заполнения"), - "password_short": MessageLookupByLibrary.simpleMessage("В пароле должно быть минимум 6 символов"), + "password_confirmation": + MessageLookupByLibrary.simpleMessage("Подтвердите пароль"), + "password_confirmation_mismatch": + MessageLookupByLibrary.simpleMessage("Пароли не совпадают"), + "password_empty": MessageLookupByLibrary.simpleMessage( + "Пароль обязателен для заполнения"), + "password_short": MessageLookupByLibrary.simpleMessage( + "В пароле должно быть минимум 6 символов"), "pcs": MessageLookupByLibrary.simpleMessage("шт"), - "place_of_living": MessageLookupByLibrary.simpleMessage("Место проживания"), - "plans_complete": MessageLookupByLibrary.simpleMessage("Пройденные планы"), - "preferred_language": MessageLookupByLibrary.simpleMessage("Предпочитаемый язык общения"), - "pressure_empty": MessageLookupByLibrary.simpleMessage("Все показатели давления обязательны к заполнению"), - "pressure_is_not_a_number": MessageLookupByLibrary.simpleMessage("Все показатели давления должны быть числами"), + "place_of_living": + MessageLookupByLibrary.simpleMessage("Место проживания"), + "plans_complete": + MessageLookupByLibrary.simpleMessage("Пройденные планы"), + "preferred_language": + MessageLookupByLibrary.simpleMessage("Предпочитаемый язык общения"), + "pressure_empty": MessageLookupByLibrary.simpleMessage( + "Все показатели давления обязательны к заполнению"), + "pressure_is_not_a_number": MessageLookupByLibrary.simpleMessage( + "Все показатели давления должны быть числами"), "profile": MessageLookupByLibrary.simpleMessage("Профиль"), "save": MessageLookupByLibrary.simpleMessage("Сохранить"), + "settings": MessageLookupByLibrary.simpleMessage("Настройки"), "skip": MessageLookupByLibrary.simpleMessage("Пропустить"), - "tell_your_schedule": MessageLookupByLibrary.simpleMessage("Расскажите в свободной форме о том как просыпаетесь, когда едите, когда ложитесь спать:"), - "unfavorite_foods": MessageLookupByLibrary.simpleMessage("Нелюбимые продукты"), - "up_pressure": MessageLookupByLibrary.simpleMessage("Верхние показатели давления:"), - "user_authorization": MessageLookupByLibrary.simpleMessage("Аутентификация"), - "user_registration": MessageLookupByLibrary.simpleMessage("Регистрация пользователя"), + "tell_your_schedule": MessageLookupByLibrary.simpleMessage( + "Расскажите в свободной форме о том как просыпаетесь, когда едите, когда ложитесь спать:"), + "unfavorite_foods": + MessageLookupByLibrary.simpleMessage("Нелюбимые продукты"), + "up_pressure": MessageLookupByLibrary.simpleMessage( + "Верхние показатели давления:"), + "user_authorization": + MessageLookupByLibrary.simpleMessage("Аутентификация"), + "user_registration": + MessageLookupByLibrary.simpleMessage("Регистрация пользователя"), "username": MessageLookupByLibrary.simpleMessage("Имя пользователя"), "waist": MessageLookupByLibrary.simpleMessage("Талия"), - "waist_circumference": MessageLookupByLibrary.simpleMessage("Обхват талии"), + "waist_circumference": + MessageLookupByLibrary.simpleMessage("Обхват талии"), "weight": MessageLookupByLibrary.simpleMessage("Вес"), "weight_chart": MessageLookupByLibrary.simpleMessage("График веса"), - "weight_measurements": MessageLookupByLibrary.simpleMessage("Замер веса"), - "what_is_your_name": MessageLookupByLibrary.simpleMessage("Как вас зовут?"), - "wrong_credentials": MessageLookupByLibrary.simpleMessage("Неверные данные пользователя"), - "your_blood_pressure": MessageLookupByLibrary.simpleMessage("Ваше артериальное давление?"), - "your_favorite_sports": MessageLookupByLibrary.simpleMessage("Ваши спортивные увлечения?"), + "weight_measurements": + MessageLookupByLibrary.simpleMessage("Замер веса"), + "what_is_your_name": + MessageLookupByLibrary.simpleMessage("Как вас зовут?"), + "wrong_credentials": MessageLookupByLibrary.simpleMessage( + "Неверные данные пользователя"), + "your_blood_pressure": + MessageLookupByLibrary.simpleMessage("Ваше артериальное давление?"), + "your_favorite_sports": + MessageLookupByLibrary.simpleMessage("Ваши спортивные увлечения?"), "your_gender": MessageLookupByLibrary.simpleMessage("Ваш пол?"), "your_height": MessageLookupByLibrary.simpleMessage("Ваш рост:"), "your_schedule": MessageLookupByLibrary.simpleMessage("Ваш режим дня?"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index a7a8dfc8..b54c60ae 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -18,14 +18,17 @@ class S { static S? _current; static S get current { - assert(_current != null, 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); + assert(_current != null, + 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); return _current!; } static const AppLocalizationDelegate delegate = AppLocalizationDelegate(); static Future load(Locale locale) { - final name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString(); + final name = (locale.countryCode?.isEmpty ?? false) + ? locale.languageCode + : locale.toString(); final localeName = Intl.canonicalizedLocale(name); return initializeMessages(localeName).then((_) { Intl.defaultLocale = localeName; @@ -38,7 +41,8 @@ class S { static S of(BuildContext context) { final instance = S.maybeOf(context); - assert(instance != null, 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); + assert(instance != null, + 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); return instance!; } @@ -876,10 +880,10 @@ class S { ); } - /// `Язык:` + /// `Язык` String get language { return Intl.message( - 'Язык:', + 'Язык', name: 'language', desc: '', args: [], @@ -936,6 +940,16 @@ class S { ); } + /// `Настройки` + String get settings { + return Intl.message( + 'Настройки', + name: 'settings', + desc: '', + args: [], + ); + } + /// `Профиль` String get profile { return Intl.message( @@ -1028,10 +1042,8 @@ class AppLocalizationDelegate extends LocalizationsDelegate { @override bool isSupported(Locale locale) => _isSupported(locale); - @override Future load(Locale locale) => S.load(locale); - @override bool shouldReload(AppLocalizationDelegate old) => false; diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 024f9a59..8d2d512c 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -82,12 +82,13 @@ "archived": "В архиве", "draft": "Черновик", "my_blog": "Мой блог", - "language": "Язык:", + "language": "Язык", "in_progress": "В процессе", "add_measure": "Добавить замер", "weight": "Вес", "plans_complete": "Пройденные планы", "my_settings": "Мои настройки", + "settings": "Настройки", "profile": "Профиль", "chat": "Чат", "admin": "Админ", diff --git a/lib/old/auth/auth_screen/auth_screen.dart b/lib/old/auth/auth_screen/auth_screen.dart index f84875af..be4a8f31 100644 --- a/lib/old/auth/auth_screen/auth_screen.dart +++ b/lib/old/auth/auth_screen/auth_screen.dart @@ -141,7 +141,7 @@ class _AuthScreenState extends State { onPressed: onTapAuth(state, context), label: Text( 'Войти', - style: theme.textTheme.titleSmall, + style: theme.textTheme.titleSmall!.copyWith(color: Colors.white), ), ), ); diff --git a/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart b/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart index c51b8872..7d08ecfe 100644 --- a/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart +++ b/lib/old/profile/my_profile_screen/bloc/my_profile_bloc.dart @@ -26,6 +26,7 @@ class MyProfileBloc extends Bloc { MyProfileInitialEvent event, Emitter emit, ) async { + print('1'); try { if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); @@ -36,6 +37,7 @@ class MyProfileBloc extends Bloc { 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); + print('2'); if (response.statusCode == 200) { final data = jsonDecode(response.body); if (data is Map && diff --git a/lib/theme/theme_helper.dart b/lib/theme/theme_helper.dart index fb09451c..d7c0b255 100644 --- a/lib/theme/theme_helper.dart +++ b/lib/theme/theme_helper.dart @@ -42,49 +42,7 @@ class ThemeHelper { var colorScheme = _supportedColorScheme[_appTheme] ?? ColorSchemes.primaryColorScheme; return ThemeData( - textTheme: GoogleFonts.mulishTextTheme().copyWith( - bodyLarge: TextStyle( - color: appTheme.blueGray400, - fontSize: 18, - fontWeight: FontWeight.w400, - ), - headlineSmall: TextStyle( - color: colorScheme.primary, - fontWeight: FontWeight.w600, - fontSize: 24, - ), - titleMedium: TextStyle( - color: colorScheme.primary, - fontWeight: FontWeight.w700, - fontSize: 18, - ), - titleSmall: TextStyle( - color: colorScheme.onPrimary, - fontWeight: FontWeight.w700, - fontSize: 15, - ), - bodyMedium: TextStyle( - color: appTheme.blueGray400, - fontWeight: FontWeight.w400, - fontSize: 14, - ), - bodySmall: TextStyle( - color: appTheme.gray500, - fontWeight: FontWeight.w400, - fontSize: 10, - ), - labelLarge: TextStyle( - color: appTheme.blueGray800, - fontWeight: FontWeight.w600, - fontSize: 12, - ), - ), - pageTransitionsTheme: PageTransitionsTheme( - builders: { - TargetPlatform.android: CupertinoPageTransitionsBuilder(), - TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), - }, - ), + textTheme: GoogleFonts.mulishTextTheme(), visualDensity: VisualDensity.standard, colorScheme: colorScheme, scaffoldBackgroundColor: colorScheme.onPrimary, @@ -107,7 +65,7 @@ class ThemeHelper { width: 1, ), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(15), + borderRadius: BorderRadius.circular(12), ), visualDensity: const VisualDensity( vertical: -4, diff --git a/pubspec.yaml b/pubspec.yaml index c3a96e3b..91ec8f78 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: badges: ^3.1.2 google_fonts: ^6.2.1 location: ^6.0.2 - syncfusion_flutter_charts: ^26.2.14 + syncfusion_flutter_charts: ^27.1.48 table_calendar: ^3.1.2 flutter_keyboard_visibility: ^6.0.0 share_plus: ^10.0.2 From 346404503edacad06fa45090dd0b6d345dba0cf8 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 27 Sep 2024 11:55:42 +0300 Subject: [PATCH 23/31] feat: add settings --- .../presentation/pages/diary_screen.dart | 8 +- .../pages/city_of_living_screen.dart | 2 +- .../pages/date_of_birth_screen.dart | 1 - .../pages/registration_screen.dart | 4 +- .../bloc/settings_cubit/settings_cubit.dart | 6 + .../bloc/settings_cubit/settings_state.dart | 13 + .../settings_state.freezed.dart | 598 ++++++++++++++++++ .../pages/general_info_screen.dart | 134 +++- .../presentation/pages/other_info_screen.dart | 4 +- .../pages/physical_activity_screen.dart | 80 ++- .../pages/physical_form_screen.dart | 82 ++- .../presentation/pages/pressure_screen.dart | 116 +++- .../presentation/pages/settings_screen.dart | 356 ++++------- lib/old/auth/auth_screen/auth_screen.dart | 2 +- lib/theme/theme_helper.dart | 2 +- lib/widgets/custom_drop_down.dart | 72 +-- lib/widgets/custom_edit_drop_down.dart | 145 ----- lib/widgets/custom_edit_text_form_field.dart | 154 ----- lib/widgets/custom_text_form_field.dart | 32 +- 19 files changed, 1143 insertions(+), 668 deletions(-) create mode 100644 lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart create mode 100644 lib/features/settings/presentation/bloc/settings_cubit/settings_state.dart create mode 100644 lib/features/settings/presentation/bloc/settings_cubit/settings_state.freezed.dart delete mode 100644 lib/widgets/custom_edit_drop_down.dart delete mode 100644 lib/widgets/custom_edit_text_form_field.dart diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index f6825d9c..1a2e3bd3 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -12,9 +12,9 @@ import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/custom_edit_drop_down.dart'; -import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; +import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:eatvio_app/widgets/custom_scale_element.dart'; +import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -430,7 +430,7 @@ class DiaryScreen extends StatelessWidget { horizontal: 12, vertical: 12, ), - defaultValue: state.mealList[0], + // defaultValue: state.mealList[0], onChanged: changeMeal(context, state), ); }, @@ -525,7 +525,7 @@ class DiaryScreen extends StatelessWidget { builder: (context, diary) { return CustomDropDown( items: state.portionList, - defaultValue: state.portionController, + // defaultValue: state.portionController, onChanged: changePortion(context, state), ); }, diff --git a/lib/features/registration/presentation/pages/city_of_living_screen.dart b/lib/features/registration/presentation/pages/city_of_living_screen.dart index 9a8491c9..fffbd19e 100644 --- a/lib/features/registration/presentation/pages/city_of_living_screen.dart +++ b/lib/features/registration/presentation/pages/city_of_living_screen.dart @@ -2,7 +2,7 @@ import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model import 'package:eatvio_app/features/registration/models/user_registration_model.dart'; import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; +import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/features/registration/presentation/pages/date_of_birth_screen.dart b/lib/features/registration/presentation/pages/date_of_birth_screen.dart index 79a02092..0ca4b3b9 100644 --- a/lib/features/registration/presentation/pages/date_of_birth_screen.dart +++ b/lib/features/registration/presentation/pages/date_of_birth_screen.dart @@ -72,7 +72,6 @@ class _DateOfBirthScreenState extends State { onDateTimeChanged: (DateTime newDateTime) { setState(() { selectedDate = newDateTime; - print(selectedDate); final registrationCubit = context.read(); registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(birthdate: selectedDate.toString())); }); diff --git a/lib/features/registration/presentation/pages/registration_screen.dart b/lib/features/registration/presentation/pages/registration_screen.dart index 237e92e3..a2a4f5b3 100644 --- a/lib/features/registration/presentation/pages/registration_screen.dart +++ b/lib/features/registration/presentation/pages/registration_screen.dart @@ -58,7 +58,7 @@ class _RegistrationScreenState extends State { focusElevation: 0, elevation: 0, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), + borderRadius: BorderRadius.circular(20), ), backgroundColor: Color(0xFFEAF2FD), onPressed: () async { @@ -85,7 +85,7 @@ class _RegistrationScreenState extends State { elevation: 0, focusElevation: 0, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), + borderRadius: BorderRadius.circular(20), ), backgroundColor: appTheme.blueA400, onPressed: () async { diff --git a/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart b/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart new file mode 100644 index 00000000..a5b998f2 --- /dev/null +++ b/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart @@ -0,0 +1,6 @@ +import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +class SettingsCubit extends Cubit { + SettingsCubit() : super(SettingsState()); +} \ No newline at end of file diff --git a/lib/features/settings/presentation/bloc/settings_cubit/settings_state.dart b/lib/features/settings/presentation/bloc/settings_cubit/settings_state.dart new file mode 100644 index 00000000..474295d0 --- /dev/null +++ b/lib/features/settings/presentation/bloc/settings_cubit/settings_state.dart @@ -0,0 +1,13 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'settings_state.freezed.dart'; + +@freezed +abstract class SettingsState with _$SettingsState { + const factory SettingsState() = _SettingsState; + const factory SettingsState.loading() = SettingsStateLoading; + const factory SettingsState.loaded() = SettingsStateLoaded; + const factory SettingsState.error({ + required String errorMessage, + }) = SettingsStateError; +} diff --git a/lib/features/settings/presentation/bloc/settings_cubit/settings_state.freezed.dart b/lib/features/settings/presentation/bloc/settings_cubit/settings_state.freezed.dart new file mode 100644 index 00000000..af636b51 --- /dev/null +++ b/lib/features/settings/presentation/bloc/settings_cubit/settings_state.freezed.dart @@ -0,0 +1,598 @@ +// 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 'settings_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 _$SettingsState { + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function() loaded, + required TResult Function(String errorMessage) error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function()? loaded, + TResult? Function(String errorMessage)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function()? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map( + TResult Function(_SettingsState value) $default, { + required TResult Function(SettingsStateLoading value) loading, + required TResult Function(SettingsStateLoaded value) loaded, + required TResult Function(SettingsStateError value) error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_SettingsState value)? $default, { + TResult? Function(SettingsStateLoading value)? loading, + TResult? Function(SettingsStateLoaded value)? loaded, + TResult? Function(SettingsStateError value)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap( + TResult Function(_SettingsState value)? $default, { + TResult Function(SettingsStateLoading value)? loading, + TResult Function(SettingsStateLoaded value)? loaded, + TResult Function(SettingsStateError value)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $SettingsStateCopyWith<$Res> { + factory $SettingsStateCopyWith( + SettingsState value, $Res Function(SettingsState) then) = + _$SettingsStateCopyWithImpl<$Res, SettingsState>; +} + +/// @nodoc +class _$SettingsStateCopyWithImpl<$Res, $Val extends SettingsState> + implements $SettingsStateCopyWith<$Res> { + _$SettingsStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of SettingsState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc +abstract class _$$SettingsStateImplCopyWith<$Res> { + factory _$$SettingsStateImplCopyWith( + _$SettingsStateImpl value, $Res Function(_$SettingsStateImpl) then) = + __$$SettingsStateImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$SettingsStateImplCopyWithImpl<$Res> + extends _$SettingsStateCopyWithImpl<$Res, _$SettingsStateImpl> + implements _$$SettingsStateImplCopyWith<$Res> { + __$$SettingsStateImplCopyWithImpl( + _$SettingsStateImpl _value, $Res Function(_$SettingsStateImpl) _then) + : super(_value, _then); + + /// Create a copy of SettingsState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$SettingsStateImpl implements _SettingsState { + const _$SettingsStateImpl(); + + @override + String toString() { + return 'SettingsState()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$SettingsStateImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function() loaded, + required TResult Function(String errorMessage) error, + }) { + return $default(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function()? loaded, + TResult? Function(String errorMessage)? error, + }) { + return $default?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function()? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if ($default != null) { + return $default(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_SettingsState value) $default, { + required TResult Function(SettingsStateLoading value) loading, + required TResult Function(SettingsStateLoaded value) loaded, + required TResult Function(SettingsStateError value) error, + }) { + return $default(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_SettingsState value)? $default, { + TResult? Function(SettingsStateLoading value)? loading, + TResult? Function(SettingsStateLoaded value)? loaded, + TResult? Function(SettingsStateError value)? error, + }) { + return $default?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_SettingsState value)? $default, { + TResult Function(SettingsStateLoading value)? loading, + TResult Function(SettingsStateLoaded value)? loaded, + TResult Function(SettingsStateError value)? error, + required TResult orElse(), + }) { + if ($default != null) { + return $default(this); + } + return orElse(); + } +} + +abstract class _SettingsState implements SettingsState { + const factory _SettingsState() = _$SettingsStateImpl; +} + +/// @nodoc +abstract class _$$SettingsStateLoadingImplCopyWith<$Res> { + factory _$$SettingsStateLoadingImplCopyWith(_$SettingsStateLoadingImpl value, + $Res Function(_$SettingsStateLoadingImpl) then) = + __$$SettingsStateLoadingImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$SettingsStateLoadingImplCopyWithImpl<$Res> + extends _$SettingsStateCopyWithImpl<$Res, _$SettingsStateLoadingImpl> + implements _$$SettingsStateLoadingImplCopyWith<$Res> { + __$$SettingsStateLoadingImplCopyWithImpl(_$SettingsStateLoadingImpl _value, + $Res Function(_$SettingsStateLoadingImpl) _then) + : super(_value, _then); + + /// Create a copy of SettingsState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$SettingsStateLoadingImpl implements SettingsStateLoading { + const _$SettingsStateLoadingImpl(); + + @override + String toString() { + return 'SettingsState.loading()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SettingsStateLoadingImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function() loaded, + required TResult Function(String errorMessage) error, + }) { + return loading(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function()? loaded, + TResult? Function(String errorMessage)? error, + }) { + return loading?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function()? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_SettingsState value) $default, { + required TResult Function(SettingsStateLoading value) loading, + required TResult Function(SettingsStateLoaded value) loaded, + required TResult Function(SettingsStateError value) error, + }) { + return loading(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_SettingsState value)? $default, { + TResult? Function(SettingsStateLoading value)? loading, + TResult? Function(SettingsStateLoaded value)? loaded, + TResult? Function(SettingsStateError value)? error, + }) { + return loading?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_SettingsState value)? $default, { + TResult Function(SettingsStateLoading value)? loading, + TResult Function(SettingsStateLoaded value)? loaded, + TResult Function(SettingsStateError value)? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(this); + } + return orElse(); + } +} + +abstract class SettingsStateLoading implements SettingsState { + const factory SettingsStateLoading() = _$SettingsStateLoadingImpl; +} + +/// @nodoc +abstract class _$$SettingsStateLoadedImplCopyWith<$Res> { + factory _$$SettingsStateLoadedImplCopyWith(_$SettingsStateLoadedImpl value, + $Res Function(_$SettingsStateLoadedImpl) then) = + __$$SettingsStateLoadedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$SettingsStateLoadedImplCopyWithImpl<$Res> + extends _$SettingsStateCopyWithImpl<$Res, _$SettingsStateLoadedImpl> + implements _$$SettingsStateLoadedImplCopyWith<$Res> { + __$$SettingsStateLoadedImplCopyWithImpl(_$SettingsStateLoadedImpl _value, + $Res Function(_$SettingsStateLoadedImpl) _then) + : super(_value, _then); + + /// Create a copy of SettingsState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$SettingsStateLoadedImpl implements SettingsStateLoaded { + const _$SettingsStateLoadedImpl(); + + @override + String toString() { + return 'SettingsState.loaded()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SettingsStateLoadedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function() loaded, + required TResult Function(String errorMessage) error, + }) { + return loaded(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function()? loaded, + TResult? Function(String errorMessage)? error, + }) { + return loaded?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function()? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (loaded != null) { + return loaded(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_SettingsState value) $default, { + required TResult Function(SettingsStateLoading value) loading, + required TResult Function(SettingsStateLoaded value) loaded, + required TResult Function(SettingsStateError value) error, + }) { + return loaded(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_SettingsState value)? $default, { + TResult? Function(SettingsStateLoading value)? loading, + TResult? Function(SettingsStateLoaded value)? loaded, + TResult? Function(SettingsStateError value)? error, + }) { + return loaded?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_SettingsState value)? $default, { + TResult Function(SettingsStateLoading value)? loading, + TResult Function(SettingsStateLoaded value)? loaded, + TResult Function(SettingsStateError value)? error, + required TResult orElse(), + }) { + if (loaded != null) { + return loaded(this); + } + return orElse(); + } +} + +abstract class SettingsStateLoaded implements SettingsState { + const factory SettingsStateLoaded() = _$SettingsStateLoadedImpl; +} + +/// @nodoc +abstract class _$$SettingsStateErrorImplCopyWith<$Res> { + factory _$$SettingsStateErrorImplCopyWith(_$SettingsStateErrorImpl value, + $Res Function(_$SettingsStateErrorImpl) then) = + __$$SettingsStateErrorImplCopyWithImpl<$Res>; + @useResult + $Res call({String errorMessage}); +} + +/// @nodoc +class __$$SettingsStateErrorImplCopyWithImpl<$Res> + extends _$SettingsStateCopyWithImpl<$Res, _$SettingsStateErrorImpl> + implements _$$SettingsStateErrorImplCopyWith<$Res> { + __$$SettingsStateErrorImplCopyWithImpl(_$SettingsStateErrorImpl _value, + $Res Function(_$SettingsStateErrorImpl) _then) + : super(_value, _then); + + /// Create a copy of SettingsState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? errorMessage = null, + }) { + return _then(_$SettingsStateErrorImpl( + errorMessage: null == errorMessage + ? _value.errorMessage + : errorMessage // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$SettingsStateErrorImpl implements SettingsStateError { + const _$SettingsStateErrorImpl({required this.errorMessage}); + + @override + final String errorMessage; + + @override + String toString() { + return 'SettingsState.error(errorMessage: $errorMessage)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SettingsStateErrorImpl && + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); + } + + @override + int get hashCode => Object.hash(runtimeType, errorMessage); + + /// Create a copy of SettingsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$SettingsStateErrorImplCopyWith<_$SettingsStateErrorImpl> get copyWith => + __$$SettingsStateErrorImplCopyWithImpl<_$SettingsStateErrorImpl>( + this, _$identity); + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function() loaded, + required TResult Function(String errorMessage) error, + }) { + return error(errorMessage); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function()? loaded, + TResult? Function(String errorMessage)? error, + }) { + return error?.call(errorMessage); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function()? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(errorMessage); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_SettingsState value) $default, { + required TResult Function(SettingsStateLoading value) loading, + required TResult Function(SettingsStateLoaded value) loaded, + required TResult Function(SettingsStateError value) error, + }) { + return error(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_SettingsState value)? $default, { + TResult? Function(SettingsStateLoading value)? loading, + TResult? Function(SettingsStateLoaded value)? loaded, + TResult? Function(SettingsStateError value)? error, + }) { + return error?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_SettingsState value)? $default, { + TResult Function(SettingsStateLoading value)? loading, + TResult Function(SettingsStateLoaded value)? loaded, + TResult Function(SettingsStateError value)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(this); + } + return orElse(); + } +} + +abstract class SettingsStateError implements SettingsState { + const factory SettingsStateError({required final String errorMessage}) = + _$SettingsStateErrorImpl; + + String get errorMessage; + + /// Create a copy of SettingsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$SettingsStateErrorImplCopyWith<_$SettingsStateErrorImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/settings/presentation/pages/general_info_screen.dart b/lib/features/settings/presentation/pages/general_info_screen.dart index a8dd8d2c..6e9cb67f 100644 --- a/lib/features/settings/presentation/pages/general_info_screen.dart +++ b/lib/features/settings/presentation/pages/general_info_screen.dart @@ -1,7 +1,10 @@ +import 'package:eatvio_app/core/utils/date_time_utils.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; +import 'package:eatvio_app/widgets/custom_text_form_field.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; class GeneralInfoScreen extends StatefulWidget { const GeneralInfoScreen({super.key}); @@ -13,6 +16,13 @@ class GeneralInfoScreen extends StatefulWidget { class _GeneralInfoScreenState extends State { final firstNameController = TextEditingController(); final lastNameController = TextEditingController(); + late DateTime selectedDate; + + @override + void initState() { + super.initState(); + selectedDate = DateTime.now(); + } @override Widget build(BuildContext context) { @@ -25,7 +35,7 @@ class _GeneralInfoScreenState extends State { bottomSheet: _saveButton(), body: SingleChildScrollView( physics: const BouncingScrollPhysics(), - padding: EdgeInsets.symmetric(vertical: 16, horizontal: 8), + padding: const EdgeInsets.only(top: 16, bottom: 80, left: 8, right: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -33,7 +43,6 @@ class _GeneralInfoScreenState extends State { SizedBox(height: 4), CustomTextFormField( controller: firstNameController, - textInputAction: TextInputAction.next, hintText: 'Введите имя', onChanged: (newValue) {}, ), @@ -42,38 +51,113 @@ class _GeneralInfoScreenState extends State { SizedBox(height: 4), CustomTextFormField( controller: lastNameController, - textInputAction: TextInputAction.done, hintText: 'Введите фамилию', onChanged: (newValue) {}, ), + SizedBox(height: 16), + Text(s.date_of_birth), + SizedBox(height: 4), + CustomTextFormField( + initialValue: selectedDate.format('dd MMMM yyyy', 'ru'), + ), + SizedBox(height: 16), + Text('Пол'), + SizedBox(height: 4), + CustomTextFormField( + initialValue: 'Мужской', + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text('Страна'), + SizedBox(height: 4), + CustomTextFormField( + initialValue: 'Россия', + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text('Город'), + SizedBox(height: 4), + CustomTextFormField( + initialValue: 'Москва', + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text('Предпочтительный язык общения'), + SizedBox(height: 4), + CustomTextFormField( + initialValue: 'Русский', + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text('Показывать анкету'), + SizedBox(height: 4), + CustomTextFormField( + initialValue: 'Всем', + onChanged: (newValue) {}, + ), ], ), ), ); } + onTapCalendar(BuildContext context) { + return () { + _showDialog( + CupertinoDatePicker( + initialDateTime: selectedDate, + maximumDate: DateTime.now(), + minimumDate: DateTime(1900), + mode: CupertinoDatePickerMode.date, + onDateTimeChanged: (DateTime newDateTime) { + setState(() { + selectedDate = newDateTime; + // final registrationCubit = context.read(); + // registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(birthdate: selectedDate.toString())); + }); + }, + ), + ); + }; + } + + void _showDialog(Widget child) { + showCupertinoModalPopup( + context: context, + builder: (BuildContext context) => Container( + height: 216, + padding: const EdgeInsets.only(top: 6), + margin: EdgeInsets.only( + bottom: MediaQuery.of(context).viewInsets.bottom, + ), + color: CupertinoColors.systemBackground.resolveFrom(context), + child: SafeArea( + top: false, + child: child, + ), + ), + ); + } + _saveButton() { - return Padding( - padding: const EdgeInsets.symmetric(vertical: 4), - child: InkWell( - onTap: () {}, - borderRadius: BorderRadius.circular(12), - child: Ink( - height: 52, - width: MediaQuery.of(context).size.width - 16, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: appTheme.blueA400, - ), - child: Center( - child: Text( - 'Сохранить', - style: TextStyle( - color: Colors.white, - height: 1, - fontWeight: FontWeight.w600, - fontSize: 18, - ), + return InkWell( + onTap: () => GoRouter.of(context).pop(), + borderRadius: BorderRadius.circular(20), + child: Ink( + height: 52, + width: MediaQuery.of(context).size.width - 16, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: appTheme.blueA400, + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + height: 1, + fontWeight: FontWeight.w600, + fontSize: 18, ), ), ), diff --git a/lib/features/settings/presentation/pages/other_info_screen.dart b/lib/features/settings/presentation/pages/other_info_screen.dart index 4c6a33bc..99be2543 100644 --- a/lib/features/settings/presentation/pages/other_info_screen.dart +++ b/lib/features/settings/presentation/pages/other_info_screen.dart @@ -1,4 +1,4 @@ -import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; class OtherInfoScreen extends StatefulWidget { const OtherInfoScreen({super.key}); @@ -10,6 +10,6 @@ class OtherInfoScreen extends StatefulWidget { class _OtherInfoScreenState extends State { @override Widget build(BuildContext context) { - return const Placeholder(); + return Scaffold(); } } \ No newline at end of file diff --git a/lib/features/settings/presentation/pages/physical_activity_screen.dart b/lib/features/settings/presentation/pages/physical_activity_screen.dart index b4c3fec2..57496c18 100644 --- a/lib/features/settings/presentation/pages/physical_activity_screen.dart +++ b/lib/features/settings/presentation/pages/physical_activity_screen.dart @@ -1,4 +1,4 @@ -import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; class PhysicalActivityScreen extends StatefulWidget { const PhysicalActivityScreen({super.key}); @@ -7,9 +7,83 @@ class PhysicalActivityScreen extends StatefulWidget { State createState() => _PhysicalActivityScreenState(); } +enum PhysicalActivity { minimum, low, medium, high, extreme, hardWork } + class _PhysicalActivityScreenState extends State { + PhysicalActivity? _physicalActivity = PhysicalActivity.minimum; + @override Widget build(BuildContext context) { - return const Placeholder(); + return Scaffold( + appBar: AppBar( + title: Text('Физическая нагрузка'), + ), + body: SingleChildScrollView( + child: Column( + children: [ + RadioListTile( + title: const Text('1,2 — минимальный (сидячая работа, отсутствие физических нагрузок);'), + value: PhysicalActivity.minimum, + groupValue: _physicalActivity, + onChanged: (PhysicalActivity? value) { + setState(() { + _physicalActivity = value; + }); + }, + ), + RadioListTile( + title: const Text('1,375 — низкий (тренировки не менее 20 мин 1–3 раза в неделю);'), + value: PhysicalActivity.low, + groupValue: _physicalActivity, + onChanged: (PhysicalActivity? value) { + setState(() { + _physicalActivity = value; + }); + }, + ), + RadioListTile( + title: const Text('1,55 — умеренный (тренировки 30–60 мин 3–4 раза в неделю);'), + value: PhysicalActivity.medium, + groupValue: _physicalActivity, + onChanged: (PhysicalActivity? value) { + setState(() { + _physicalActivity = value; + }); + }, + ), + RadioListTile( + title: const Text('1,7 — высокий (тренировки 30–60 мин 5–7 раза в неделю; тяжёлая физическая работа);'), + value: PhysicalActivity.high, + groupValue: _physicalActivity, + onChanged: (PhysicalActivity? value) { + setState(() { + _physicalActivity = value; + }); + }, + ), + RadioListTile( + title: const Text('1,9 — экстремальный (несколько интенсивных тренировок в день'), + value: PhysicalActivity.extreme, + groupValue: _physicalActivity, + onChanged: (PhysicalActivity? value) { + setState(() { + _physicalActivity = value; + }); + }, + ), + RadioListTile( + title: const Text('1,9 6–7 раз в неделю; очень трудоёмкая работа).'), + value: PhysicalActivity.hardWork, + groupValue: _physicalActivity, + onChanged: (PhysicalActivity? value) { + setState(() { + _physicalActivity = value; + }); + }, + ), + ], + ), + ), + ); } -} \ No newline at end of file +} diff --git a/lib/features/settings/presentation/pages/physical_form_screen.dart b/lib/features/settings/presentation/pages/physical_form_screen.dart index 5ff2ea7e..8817d0be 100644 --- a/lib/features/settings/presentation/pages/physical_form_screen.dart +++ b/lib/features/settings/presentation/pages/physical_form_screen.dart @@ -1,4 +1,9 @@ -import 'package:flutter/cupertino.dart'; +import 'package:eatvio_app/generated/l10n.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:eatvio_app/widgets/custom_text_form_field.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:go_router/go_router.dart'; class PhysicalFormScreen extends StatefulWidget { const PhysicalFormScreen({super.key}); @@ -8,8 +13,79 @@ class PhysicalFormScreen extends StatefulWidget { } class _PhysicalFormScreenState extends State { + final digitsOnly = FilteringTextInputFormatter.digitsOnly; + final chestCircumferenceController = TextEditingController(); + final waistCircumferenceController = TextEditingController(); + final hipCircumferenceController = TextEditingController(); + @override Widget build(BuildContext context) { - return const Placeholder(); + final s = S.of(context); + + return Scaffold( + appBar: AppBar( + title: Text('Физическая форма'), + ), + bottomSheet: _saveButton(), + body: SingleChildScrollView( + physics: const BouncingScrollPhysics(), + padding: EdgeInsets.symmetric(vertical: 16, horizontal: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(s.chest_circumference), + SizedBox(height: 4), + CustomTextFormField( + inputFormatters: [digitsOnly], + controller: chestCircumferenceController, + hintText: '90', + ), + SizedBox(height: 16), + Text(s.waist_circumference), + SizedBox(height: 4), + CustomTextFormField( + inputFormatters: [digitsOnly], + controller: waistCircumferenceController, + hintText: "60", + ), + SizedBox(height: 16), + Text(s.hip_circumference), + SizedBox(height: 4), + CustomTextFormField( + inputFormatters: [digitsOnly], + controller: hipCircumferenceController, + hintText: '90', + textInputAction: TextInputAction.done, + ), + ], + ), + ), + ); } -} \ No newline at end of file + + _saveButton() { + return InkWell( + onTap: () => GoRouter.of(context).pop(), + borderRadius: BorderRadius.circular(20), + child: Ink( + height: 52, + width: MediaQuery.of(context).size.width - 16, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: appTheme.blueA400, + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + height: 1, + fontWeight: FontWeight.w600, + fontSize: 18, + ), + ), + ), + ), + ); + } +} diff --git a/lib/features/settings/presentation/pages/pressure_screen.dart b/lib/features/settings/presentation/pages/pressure_screen.dart index 58bdcebd..c92b525a 100644 --- a/lib/features/settings/presentation/pages/pressure_screen.dart +++ b/lib/features/settings/presentation/pages/pressure_screen.dart @@ -1,4 +1,12 @@ -import 'package:flutter/cupertino.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; +import 'package:eatvio_app/generated/l10n.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:eatvio_app/widgets/custom_drop_down.dart'; +import 'package:eatvio_app/widgets/custom_image_view.dart'; +import 'package:eatvio_app/widgets/custom_text_form_field.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:go_router/go_router.dart'; class PressureScreen extends StatefulWidget { const PressureScreen({super.key}); @@ -8,8 +16,110 @@ class PressureScreen extends StatefulWidget { } class _PressureScreenState extends State { + final digitsOnly = FilteringTextInputFormatter.digitsOnly; + final chestCircumferenceController = TextEditingController(); + final waistCircumferenceController = TextEditingController(); + final hipCircumferenceController = TextEditingController(); + @override Widget build(BuildContext context) { - return const Placeholder(); + final s = S.of(context); + + return Scaffold( + appBar: AppBar( + title: Text('Физическая форма'), + ), + bottomSheet: _saveButton(), + body: SingleChildScrollView( + physics: const BouncingScrollPhysics(), + padding: EdgeInsets.symmetric(vertical: 16, horizontal: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(s.up_pressure), + SizedBox(height: 4), + CustomTextFormField( + inputFormatters: [digitsOnly], + hintText: "90", + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text(s.down_pressure), + SizedBox(height: 4), + CustomTextFormField( + inputFormatters: [digitsOnly], + hintText: '90', + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text(s.do_you_have_hypotension_tendency), + SizedBox(height: 4), + CustomDropDown( + icon: Container( + margin: EdgeInsets.all(16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + ), + child: CustomImageView( + imagePath: ImageConstant.imgFavorite, + height: 16, + width: 16, + ), + ), + hintText: "Не выбрано", + onChanged: (newPopup) { + setState(() {}); + }, + ), + SizedBox(height: 16), + Text(s.do_you_have_hypertension_tendency), + SizedBox(height: 4), + CustomDropDown( + icon: Container( + margin: EdgeInsets.all(16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + ), + child: CustomImageView( + imagePath: ImageConstant.imgFavorite, + height: 16, + width: 16, + ), + ), + hintText: "Не выбрано", + onChanged: (newPopup) { + setState(() {}); + }, + ), + ], + ), + ), + ); } -} \ No newline at end of file + + _saveButton() { + return InkWell( + onTap: () => GoRouter.of(context).pop(), + borderRadius: BorderRadius.circular(20), + child: Ink( + height: 52, + width: MediaQuery.of(context).size.width - 16, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: appTheme.blueA400, + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + height: 1, + fontWeight: FontWeight.w600, + fontSize: 18, + ), + ), + ), + ), + ); + } +} diff --git a/lib/features/settings/presentation/pages/settings_screen.dart b/lib/features/settings/presentation/pages/settings_screen.dart index 3136ae42..79b9e291 100644 --- a/lib/features/settings/presentation/pages/settings_screen.dart +++ b/lib/features/settings/presentation/pages/settings_screen.dart @@ -1,9 +1,9 @@ -import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; -import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; +import 'package:url_launcher/url_launcher.dart'; class SettingsScreen extends StatefulWidget { const SettingsScreen({super.key}); @@ -19,68 +19,35 @@ class _SettingsScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color(0xFFF0F2F5), appBar: AppBar( title: Text('Настройки'), ), body: SingleChildScrollView( + padding: EdgeInsets.symmetric(vertical: 16), physics: const BouncingScrollPhysics(), child: Column( children: [ - const SizedBox(height: 16), - _selectLanguageDropDown(), - const SizedBox(height: 20), _additionalInfo(), const SizedBox(height: 12), _notifications(), const SizedBox(height: 12), _aboutEatvio(), - const SizedBox(height: 16), + const SizedBox(height: 12), _becomeConsultantButton(), const SizedBox(height: 8), _deleteAccountButton(), - const SizedBox(height: 16), ], ), ), ); } - _selectLanguageDropDown() { - final items = [SelectionPopupModel(title: 'Русский', id: 0, isSelected: true, value: 'Русский')]; - - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Text( - 'Язык', - style: TextStyle( - fontSize: 16, - height: 1, - color: Colors.grey, - ), - ), - ), - const SizedBox(height: 8), - _actionsGroup( - CustomDropDown( - items: items, - value: items[0], - autofocus: false, - ), - ), - ], - ); - } - _additionalInfo() { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), + padding: const EdgeInsets.symmetric(horizontal: 16), child: Text( 'Дополнительаная информация', style: TextStyle( @@ -91,108 +58,29 @@ class _SettingsScreenState extends State { ), ), ), - const SizedBox(height: 8), - _actionsGroup( - Column( - children: [ - const SizedBox(height: 8), - GestureDetector( - onTap: () => GoRouter.of(context).pushNamed('generalInfoScreen'), - child: Row( - children: [ - Text( - 'Общая информация', - style: TextStyle( - color: Colors.black, - ), - ), - const Spacer(), - Icon( - Icons.keyboard_arrow_right_rounded, - color: Colors.grey.shade400, - ), - ], - ), - ), - _divider(context), - GestureDetector( - onTap: () => GoRouter.of(context).pushNamed('physicalFormScreen'), - child: Row( - children: [ - Text( - 'Физическая форма', - style: TextStyle( - color: Colors.black, - ), - ), - const Spacer(), - Icon( - Icons.keyboard_arrow_right_rounded, - color: Colors.grey.shade400, - ), - ], - ), - ), - _divider(context), - GestureDetector( - onTap: () => GoRouter.of(context).pushNamed('pressureScreen'), - child: Row( - children: [ - Text( - 'Давление', - style: TextStyle( - color: Colors.black, - ), - ), - const Spacer(), - Icon( - Icons.keyboard_arrow_right_rounded, - color: Colors.grey.shade400, - ), - ], - ), - ), - _divider(context), - GestureDetector( - onTap: () => GoRouter.of(context).pushNamed('otherInfoScreen'), - child: Row( - children: [ - Text( - 'Прочая информация', - style: TextStyle( - color: Colors.black, - ), - ), - const Spacer(), - Icon( - Icons.keyboard_arrow_right_rounded, - color: Colors.grey.shade400, - ), - ], - ), - ), - _divider(context), - GestureDetector( - onTap: () => GoRouter.of(context).pushNamed('physicalActivityScreen'), - child: Row( - children: [ - Text( - 'Физическая нагрузка', - style: TextStyle( - color: Colors.black, - ), - ), - const Spacer(), - Icon( - Icons.keyboard_arrow_right_rounded, - color: Colors.grey.shade400, - ), - ], - ), - ), - const SizedBox(height: 8), - ], - ), + _tile( + onTap: () => GoRouter.of(context).pushNamed('generalInfoScreen'), + title: 'Общая информация', + ), + _divider(context), + _tile( + onTap: () => GoRouter.of(context).pushNamed('physicalFormScreen'), + title: 'Физическая форма', + ), + _divider(context), + _tile( + onTap: () => GoRouter.of(context).pushNamed('pressureScreen'), + title: 'Давление', + ), + _divider(context), + _tile( + onTap: () => GoRouter.of(context).pushNamed('otherInfoScreen'), + title: 'Прочая информация', + ), + _divider(context), + _tile( + onTap: () => GoRouter.of(context).pushNamed('physicalActivityScreen'), + title: 'Физическая нагрузка', ), ], ); @@ -202,9 +90,8 @@ class _SettingsScreenState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SizedBox(height: 8), Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), + padding: const EdgeInsets.symmetric(horizontal: 16), child: Text( 'Уведомления', style: TextStyle( @@ -214,55 +101,41 @@ class _SettingsScreenState extends State { ), ), ), - const SizedBox(height: 8), - _actionsGroup( - Column( - children: [ - Row( - children: [ - Text( - 'Уведомление о новых обновлениях', - style: TextStyle( - color: Colors.black, - ), - ), - const Spacer(), - CupertinoSwitch( - value: updatesNotificationsSwitchState, - activeColor: appTheme.blueA400, - onChanged: (newValue) { - setState(() { - updatesNotificationsSwitchState = newValue; - }); - }, - ), - ], - ), - _divider(context), - Row( - children: [ - Text( - 'Напоминание о заполнении дневника', - style: TextStyle( - color: Colors.black, - ), - ), - const Spacer(), - CupertinoSwitch( - value: fillDiaryNotificationsSwitchState, - activeColor: appTheme.blueA400, - onChanged: (newValue) { - setState(() { - fillDiaryNotificationsSwitchState = newValue; - }); - }, - ), - ], - ), - ], + _tile( + onTap: () { + setState(() { + updatesNotificationsSwitchState = !updatesNotificationsSwitchState; + }); + }, + title: 'Уведомление о новых обновлениях', + trailing: CupertinoSwitch( + value: updatesNotificationsSwitchState, + activeColor: appTheme.blueA400, + onChanged: (newValue) { + setState(() { + updatesNotificationsSwitchState = newValue; + }); + }, + ), + ), + _divider(context), + _tile( + onTap: () { + setState(() { + fillDiaryNotificationsSwitchState = !fillDiaryNotificationsSwitchState; + }); + }, + title: 'Напоминание о заполнении дневника', + trailing: CupertinoSwitch( + value: fillDiaryNotificationsSwitchState, + activeColor: appTheme.blueA400, + onChanged: (newValue) { + setState(() { + fillDiaryNotificationsSwitchState = newValue; + }); + }, ), ), - const SizedBox(height: 8), ], ); } @@ -272,7 +145,7 @@ class _SettingsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), + padding: const EdgeInsets.symmetric(horizontal: 16), child: Text( 'О Eatvio', style: TextStyle( @@ -282,45 +155,14 @@ class _SettingsScreenState extends State { ), ), ), - const SizedBox(height: 8), - _actionsGroup( - Column( - children: [ - const SizedBox(height: 8), - Row( - children: [ - Text( - 'О компании', - style: TextStyle( - color: Colors.black, - ), - ), - const Spacer(), - Icon( - Icons.keyboard_arrow_right_rounded, - color: Colors.grey.shade400, - ), - ], - ), - _divider(context), - Row( - children: [ - Text( - 'Пользовательское соглашение', - style: TextStyle( - color: Colors.black, - ), - ), - const Spacer(), - Icon( - Icons.keyboard_arrow_right_rounded, - color: Colors.grey.shade400, - ), - ], - ), - const SizedBox(height: 8), - ], - ), + _tile( + title: 'О компании', + onTap: () async => await launchUrl(Uri.parse(baseUrl + '/ru/company-details')), + ), + _divider(context), + _tile( + title: 'Пользовательское соглашение', + onTap: () async => await launchUrl(Uri.parse(baseUrl + '/oferta_bs.pdf')), ), ], ); @@ -328,15 +170,15 @@ class _SettingsScreenState extends State { _becomeConsultantButton() { return Padding( - padding: EdgeInsets.symmetric(horizontal: 8), + padding: EdgeInsets.symmetric(horizontal: 16), child: InkWell( onTap: () {}, - borderRadius: BorderRadius.circular(12), + borderRadius: BorderRadius.circular(20), child: Ink( height: 52, width: MediaQuery.of(context).size.width - 16, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), + borderRadius: BorderRadius.circular(20), color: appTheme.blueA400, ), child: Center( @@ -357,16 +199,16 @@ class _SettingsScreenState extends State { _deleteAccountButton() { return Padding( - padding: EdgeInsets.symmetric(horizontal: 8), + padding: EdgeInsets.symmetric(horizontal: 16), child: InkWell( onTap: () {}, - borderRadius: BorderRadius.circular(12), + borderRadius: BorderRadius.circular(20), child: Ink( height: 52, width: MediaQuery.of(context).size.width - 16, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.black.withOpacity(0.1), + borderRadius: BorderRadius.circular(20), + color: Color(0xFFEAEAEA), ), child: Center( child: Text( @@ -384,25 +226,39 @@ class _SettingsScreenState extends State { ); } - _actionsGroup(Widget child) { - return Container( - padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12), + _tile({ + required String title, + required Function() onTap, + Widget? trailing, + }) { + return ListTile( + onTap: onTap, + title: Text( + title, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + height: 1, + ), ), - child: child, + trailing: trailing ?? + Icon( + Icons.arrow_forward_ios_rounded, + size: 12, + color: Colors.black38, + ), ); } _divider(BuildContext context) { - return Container( - margin: EdgeInsets.symmetric(vertical: 12), - height: 0.4, - width: MediaQuery.of(context).size.width - 16, - decoration: BoxDecoration( - color: Colors.black26, - borderRadius: BorderRadius.circular(16), + return Center( + child: Container( + height: 0.4, + width: MediaQuery.of(context).size.width - 32, + decoration: BoxDecoration( + color: Colors.black26, + borderRadius: BorderRadius.circular(16), + ), ), ); } diff --git a/lib/old/auth/auth_screen/auth_screen.dart b/lib/old/auth/auth_screen/auth_screen.dart index be4a8f31..fc8cb13f 100644 --- a/lib/old/auth/auth_screen/auth_screen.dart +++ b/lib/old/auth/auth_screen/auth_screen.dart @@ -135,7 +135,7 @@ class _AuthScreenState extends State { elevation: 0, focusElevation: 0, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), + borderRadius: BorderRadius.circular(20), ), backgroundColor: appTheme.blueA400, onPressed: onTapAuth(state, context), diff --git a/lib/theme/theme_helper.dart b/lib/theme/theme_helper.dart index d7c0b255..ab5c1d2d 100644 --- a/lib/theme/theme_helper.dart +++ b/lib/theme/theme_helper.dart @@ -65,7 +65,7 @@ class ThemeHelper { width: 1, ), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), + borderRadius: BorderRadius.circular(20), ), visualDensity: const VisualDensity( vertical: -4, diff --git a/lib/widgets/custom_drop_down.dart b/lib/widgets/custom_drop_down.dart index 9cc045b3..6843b7ba 100644 --- a/lib/widgets/custom_drop_down.dart +++ b/lib/widgets/custom_drop_down.dart @@ -1,10 +1,8 @@ import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; -import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; class CustomDropDown extends StatelessWidget { - CustomDropDown({ - Key? key, + const CustomDropDown({ this.alignment, this.width, this.focusNode, @@ -25,48 +23,27 @@ class CustomDropDown extends StatelessWidget { this.validator, this.onChanged, this.value, - }) : super( - key: key, - ); + }); final Alignment? alignment; - final double? width; - final FocusNode? focusNode; - final Widget? icon; - final bool? autofocus; - final TextStyle? textStyle; - final List? items; - final String? hintText; - final TextStyle? hintStyle; - final Widget? prefix; - final BoxConstraints? prefixConstraints; - final Widget? suffix; - final BoxConstraints? suffixConstraints; - final EdgeInsets? contentPadding; - final InputBorder? borderDecoration; - final Color? fillColor; - final bool? filled; - final SelectionPopupModel? value; - final FormFieldValidator? validator; - final Function(SelectionPopupModel)? onChanged; @override @@ -89,7 +66,7 @@ class CustomDropDown extends StatelessWidget { style: textStyle ?? TextStyle( fontSize: 16, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w500, ), items: items?.map((SelectionPopupModel item) { return DropdownMenuItem( @@ -99,7 +76,7 @@ class CustomDropDown extends StatelessWidget { style: hintStyle ?? TextStyle( fontSize: 16, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w500, color: Colors.black, ), ), @@ -121,41 +98,30 @@ class CustomDropDown extends StatelessWidget { hintStyle: hintStyle ?? TextStyle( fontSize: 16, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w500, color: Colors.grey.shade400, + height: 1, ), prefixIcon: prefix, prefixIconConstraints: prefixConstraints, suffixIcon: suffix, suffixIconConstraints: suffixConstraints, isDense: true, - contentPadding: contentPadding ?? EdgeInsets.all(8), + contentPadding: EdgeInsets.symmetric(vertical: 16, horizontal: 12), fillColor: fillColor ?? Theme.of(context).colorScheme.onPrimary, filled: filled, - border: borderDecoration ?? - OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: BorderSide( - color: Colors.grey.shade400, - width: 1, - ), - ), - enabledBorder: borderDecoration ?? - OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: BorderSide( - color: Colors.grey.shade400, - width: 1, - ), - ), - focusedBorder: borderDecoration ?? - OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: BorderSide( - color: appTheme.blueA400, - width: 1, - ), - ), + border: OutlineInputBorder( + borderRadius: const BorderRadius.all(Radius.circular(20)), + borderSide: BorderSide(color: Colors.grey, width: 0.2), + ), + enabledBorder: OutlineInputBorder( + borderRadius: const BorderRadius.all(Radius.circular(20)), + borderSide: BorderSide(color: Colors.grey, width: 0.2), + ), + focusedBorder: OutlineInputBorder( + borderRadius: const BorderRadius.all(Radius.circular(20)), + borderSide: BorderSide(color: Colors.grey, width: 0.2), + ), ); } } diff --git a/lib/widgets/custom_edit_drop_down.dart b/lib/widgets/custom_edit_drop_down.dart deleted file mode 100644 index bc27e307..00000000 --- a/lib/widgets/custom_edit_drop_down.dart +++ /dev/null @@ -1,145 +0,0 @@ -import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; -import 'package:flutter/material.dart'; - -class CustomDropDown extends StatelessWidget { - CustomDropDown({ - Key? key, - this.alignment, - this.width, - this.focusNode, - this.icon, - this.autofocus = true, - this.textStyle, - this.items, - this.hintText, - this.hintStyle, - this.prefix, - this.prefixConstraints, - this.suffix, - this.suffixConstraints, - this.contentPadding, - this.borderDecoration, - this.fillColor, - this.filled = true, - this.validator, - this.onChanged, - this.defaultValue, - }) : super( - key: key, - ); - - final Alignment? alignment; - - final double? width; - - final FocusNode? focusNode; - - final Widget? icon; - - final bool? autofocus; - - final TextStyle? textStyle; - - final List? items; - - final String? hintText; - - final TextStyle? hintStyle; - - final Widget? prefix; - - final BoxConstraints? prefixConstraints; - - final Widget? suffix; - - final BoxConstraints? suffixConstraints; - - final EdgeInsets? contentPadding; - - final InputBorder? borderDecoration; - - final Color? fillColor; - - final bool? filled; - - final SelectionPopupModel? defaultValue; - - final FormFieldValidator? validator; - - final Function(SelectionPopupModel)? onChanged; - - @override - Widget build(BuildContext context) { - return alignment != null - ? Align( - alignment: alignment ?? Alignment.center, - child: _buildDropDownWidget(context), - ) - : _buildDropDownWidget(context); - } - - _buildDropDownWidget(BuildContext context) { - return SizedBox( - width: width ?? double.maxFinite, - child: DropdownButtonFormField( - focusNode: focusNode ?? FocusNode(), - icon: icon, - autofocus: autofocus!, - 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, - ), - ); - }).toList(), - decoration: _buildInputDecoration(context), - validator: validator, - value: defaultValue, - onChanged: onDropDownChanged, - ), - ); - } - - void onDropDownChanged(value) { - onChanged!(value!); - } - - InputDecoration _buildInputDecoration(BuildContext context) { - return InputDecoration( - hintText: hintText ?? "", - hintStyle: hintStyle ?? Theme.of(context).textTheme.titleMedium, - prefixIcon: prefix, - prefixIconConstraints: prefixConstraints, - suffixIcon: suffix, - suffixIconConstraints: suffixConstraints, - isDense: true, - contentPadding: contentPadding ?? - EdgeInsets.only( - left: 6, - top: 6, - bottom: 6, - ), - fillColor: fillColor ?? Theme.of(context).colorScheme.onPrimary, - filled: filled, - border: borderDecoration ?? - OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(8)), - borderSide: BorderSide(color: Colors.grey, width: 1), - ), - enabledBorder: borderDecoration ?? - OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(8)), - borderSide: BorderSide(color: Colors.grey, width: 1), - ), - focusedBorder: borderDecoration ?? - OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(8)), - borderSide: BorderSide(color: Colors.grey, width: 1), - ), - ); - } -} diff --git a/lib/widgets/custom_edit_text_form_field.dart b/lib/widgets/custom_edit_text_form_field.dart deleted file mode 100644 index 13a3df86..00000000 --- a/lib/widgets/custom_edit_text_form_field.dart +++ /dev/null @@ -1,154 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; - -class CustomTextFormField extends StatelessWidget { - CustomTextFormField({ - Key? key, - this.alignment, - this.width, - this.controller, - this.focusNode, - this.autofocus = false, - this.textStyle, - this.obscureText = false, - this.textInputAction = TextInputAction.next, - this.textInputType = TextInputType.text, - this.maxLines, - this.hintText, - this.hintStyle, - this.prefix, - this.prefixConstraints, - this.suffix, - this.suffixConstraints, - this.onFieldSubmitted, - this.initialValue, - this.contentPadding, - this.inputFormatters, - this.borderDecoration, - this.fillColor, - this.filled = true, - this.validator, - this.keyboardType, - this.onChanged, - this.onSaved, - }) : super( - key: key, - ); - - final Alignment? alignment; - - final double? width; - - final TextEditingController? controller; - - final FocusNode? focusNode; - - final bool? autofocus; - - final TextStyle? textStyle; - - final bool? obscureText; - - final List? inputFormatters; - - final TextInputAction? textInputAction; - - final TextInputType? textInputType; - - final int? maxLines; - - final String? hintText; - - final TextStyle? hintStyle; - - final Widget? prefix; - - final BoxConstraints? prefixConstraints; - - final Widget? suffix; - - final Function(String)? onFieldSubmitted; - - final BoxConstraints? suffixConstraints; - - final EdgeInsets? contentPadding; - - final InputBorder? borderDecoration; - - final Color? fillColor; - - final bool? filled; - - final TextInputType? keyboardType; - - final String? initialValue; - - final FormFieldValidator? validator; - - final void Function(String?)? onSaved; - - final ValueChanged? onChanged; - - @override - Widget build(BuildContext context) { - return alignment != null - ? Align( - alignment: alignment ?? Alignment.center, - child: _buildTextFormFieldWidget(context), - ) - : _buildTextFormFieldWidget(context); - } - - _buildTextFormFieldWidget(BuildContext context) { - return SizedBox( - width: width ?? double.maxFinite, - child: TextFormField( - controller: controller, - focusNode: focusNode ?? FocusNode(), - autofocus: autofocus!, - style: textStyle ?? Theme.of(context).textTheme.titleMedium, - obscureText: obscureText!, - textInputAction: textInputAction, - maxLines: maxLines ?? 1, - decoration: _buildInputDecoration(context), - validator: validator, - keyboardType: keyboardType, - onSaved: onSaved, - onChanged: onChanged, - onFieldSubmitted: onFieldSubmitted, - inputFormatters: inputFormatters, - initialValue: initialValue, - ), - ); - } - - InputDecoration _buildInputDecoration(BuildContext context) { - return InputDecoration( - hintText: hintText ?? "", - hintStyle: hintStyle ?? Theme.of(context).textTheme.bodyLarge, - prefixIcon: prefix, - prefixIconConstraints: prefixConstraints, - suffixIcon: suffix, - suffixIconConstraints: suffixConstraints, - isDense: true, - contentPadding: contentPadding ?? EdgeInsets.all(6), - fillColor: fillColor ?? Theme.of(context).colorScheme.onPrimary, - filled: filled, - border: borderDecoration ?? - OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(8)), - borderSide: BorderSide(color: Colors.grey, width: 1), - ), - enabledBorder: borderDecoration ?? - OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(8)), - borderSide: BorderSide(color: Colors.grey, width: 1), - ), - focusedBorder: borderDecoration ?? - OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(8)), - borderSide: BorderSide(color: Colors.grey, width: 1), - ), - ); - } -} diff --git a/lib/widgets/custom_text_form_field.dart b/lib/widgets/custom_text_form_field.dart index 60260b84..81fb07b5 100644 --- a/lib/widgets/custom_text_form_field.dart +++ b/lib/widgets/custom_text_form_field.dart @@ -79,6 +79,7 @@ class CustomTextFormField extends StatelessWidget { style: TextStyle( fontSize: 16, color: Colors.black, + fontWeight: FontWeight.w500, ), obscureText: obscureText!, textInputAction: textInputAction, @@ -89,40 +90,31 @@ class CustomTextFormField extends StatelessWidget { hintText: hintText ?? "", hintStyle: TextStyle( fontSize: 16, - color: Colors.grey.shade400, - fontWeight: FontWeight.w400, + color: Color(0xFF323F4B), + fontWeight: FontWeight.w500, ), prefixIcon: prefix, prefixIconConstraints: prefixConstraints, suffixIcon: suffix, suffixIconConstraints: suffixConstraints, isDense: false, - contentPadding: EdgeInsets.all(8), - fillColor: fillColor ?? theme.colorScheme.onPrimary, - filled: filled, + contentPadding: EdgeInsets.symmetric(vertical: 16, horizontal: 12), + fillColor: Color(0xFFF6F6F6), + filled: true, border: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(12), - borderSide: BorderSide( - color: Colors.grey.shade400, - width: 1, - ), + borderRadius: BorderRadius.circular(20), + borderSide: BorderSide.none, ), enabledBorder: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(12), - borderSide: BorderSide( - color: Colors.grey.shade400, - width: 1, - ), + borderRadius: BorderRadius.circular(20), + borderSide: BorderSide.none, ), focusedBorder: borderDecoration ?? OutlineInputBorder( - borderRadius: BorderRadius.circular(12), - borderSide: BorderSide( - color: appTheme.blueA400, - width: 1, - ), + borderRadius: BorderRadius.circular(20), + borderSide: BorderSide.none, ), ), keyboardType: keyboardType, From 860036c35fe1dabe3f0848980ad3d99778b346f4 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 30 Sep 2024 12:54:55 +0300 Subject: [PATCH 24/31] feat: add settings --- lib/app_router.dart | 21 +- .../models/profile_settings_model.dart | 18 ++ .../profile_settings_model.freezed.dart | 287 ++++++++++++++++++ .../models/profile_settings_model.g.dart | 27 ++ .../bloc/settings_cubit/settings_cubit.dart | 39 ++- .../bloc/settings_cubit/settings_state.dart | 10 +- .../settings_state.freezed.dart | 151 +++++++-- .../pages/general_info_screen.dart | 15 +- .../presentation/pages/other_info_screen.dart | 117 ++++++- .../pages/physical_activity_screen.dart | 45 ++- .../pages/physical_form_screen.dart | 12 +- .../presentation/pages/pressure_screen.dart | 53 ++-- .../presentation/pages/settings_screen.dart | 122 ++++++-- .../repositories/service_repository.dart | 39 +++ .../settings/services/settings_service.dart | 24 ++ .../settings/services/settings_service.g.dart | 155 ++++++++++ lib/locator_service.dart | 6 + lib/widgets/custom_drop_down.dart | 17 +- 18 files changed, 1052 insertions(+), 106 deletions(-) create mode 100644 lib/features/settings/models/profile_settings_model.dart create mode 100644 lib/features/settings/models/profile_settings_model.freezed.dart create mode 100644 lib/features/settings/models/profile_settings_model.g.dart create mode 100644 lib/features/settings/repositories/service_repository.dart create mode 100644 lib/features/settings/services/settings_service.dart create mode 100644 lib/features/settings/services/settings_service.g.dart diff --git a/lib/app_router.dart b/lib/app_router.dart index 7d6fe865..66bd328e 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -17,6 +17,7 @@ import 'package:eatvio_app/features/menu/presentation/pages/menu_screen.dart'; import 'package:eatvio_app/features/notifications/presentation/pages/notifications_screen.dart'; import 'package:eatvio_app/features/plans/models/plan_pagination_model.dart'; import 'package:eatvio_app/features/plans/presentation/pages/about_plan_screen.dart'; +import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:eatvio_app/features/profile/presentation/pages/profile_screen.dart'; import 'package:eatvio_app/features/recipes/presentation/pages/about_recipes_screen.dart'; import 'package:eatvio_app/features/recipes/presentation/pages/recipe_create_screen.dart'; @@ -173,27 +174,37 @@ class AppRouter { GoRoute( path: 'general-info-screen', name: 'generalInfoScreen', - builder: (context, state) => GeneralInfoScreen(), + builder: (context, state) => GeneralInfoScreen( + profileDetailsModel: state.extra as ProfileDetailsModel, + ), ), GoRoute( path: 'other-info-screen', name: 'otherInfoScreen', - builder: (context, state) => OtherInfoScreen(), + builder: (context, state) => OtherInfoScreen( + profileDetailsModel: state.extra as ProfileDetailsModel, + ), ), GoRoute( path: 'physical-activity-screen', name: 'physicalActivityScreen', - builder: (context, state) => PhysicalActivityScreen(), + builder: (context, state) => PhysicalActivityScreen( + profileDetailsModel: state.extra as ProfileDetailsModel, + ), ), GoRoute( path: 'physical-form-screen', name: 'physicalFormScreen', - builder: (context, state) => PhysicalFormScreen(), + builder: (context, state) => PhysicalFormScreen( + profileDetailsModel: state.extra as ProfileDetailsModel, + ), ), GoRoute( path: 'pressure-screen', name: 'pressureScreen', - builder: (context, state) => PressureScreen(), + builder: (context, state) => PressureScreen( + profileDetailsModel: state.extra as ProfileDetailsModel, + ), ), ], ), diff --git a/lib/features/settings/models/profile_settings_model.dart b/lib/features/settings/models/profile_settings_model.dart new file mode 100644 index 00000000..ebd33e95 --- /dev/null +++ b/lib/features/settings/models/profile_settings_model.dart @@ -0,0 +1,18 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'profile_settings_model.freezed.dart'; + +part 'profile_settings_model.g.dart'; + +@freezed +class ProfileSettingsModel with _$ProfileSettingsModel { + const factory ProfileSettingsModel({ + @JsonKey(name: "new_updates_notifications") required dynamic newUpdatesNotifications, + @JsonKey(name: "diary_reminder_notifications") required dynamic diaryReminderNotifications, + @JsonKey(name: "is_mood_fillable") required bool isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") required bool isBedtimeFillable, + @JsonKey(name: "is_public_profile") required bool isPublicProfile, + }) = _ProfileSettingsModel; + + factory ProfileSettingsModel.fromJson(Map json) => _$ProfileSettingsModelFromJson(json); +} diff --git a/lib/features/settings/models/profile_settings_model.freezed.dart b/lib/features/settings/models/profile_settings_model.freezed.dart new file mode 100644 index 00000000..e6a0ff83 --- /dev/null +++ b/lib/features/settings/models/profile_settings_model.freezed.dart @@ -0,0 +1,287 @@ +// 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_settings_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'); + +ProfileSettingsModel _$ProfileSettingsModelFromJson(Map json) { + return _ProfileSettingsModel.fromJson(json); +} + +/// @nodoc +mixin _$ProfileSettingsModel { + @JsonKey(name: "new_updates_notifications") + dynamic get newUpdatesNotifications => throw _privateConstructorUsedError; + @JsonKey(name: "diary_reminder_notifications") + dynamic get diaryReminderNotifications => throw _privateConstructorUsedError; + @JsonKey(name: "is_mood_fillable") + bool get isMoodFillable => throw _privateConstructorUsedError; + @JsonKey(name: "is_bedtime_fillable") + bool get isBedtimeFillable => throw _privateConstructorUsedError; + @JsonKey(name: "is_public_profile") + bool get isPublicProfile => throw _privateConstructorUsedError; + + /// Serializes this ProfileSettingsModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of ProfileSettingsModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ProfileSettingsModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ProfileSettingsModelCopyWith<$Res> { + factory $ProfileSettingsModelCopyWith(ProfileSettingsModel value, + $Res Function(ProfileSettingsModel) then) = + _$ProfileSettingsModelCopyWithImpl<$Res, ProfileSettingsModel>; + @useResult + $Res call( + {@JsonKey(name: "new_updates_notifications") + dynamic newUpdatesNotifications, + @JsonKey(name: "diary_reminder_notifications") + dynamic diaryReminderNotifications, + @JsonKey(name: "is_mood_fillable") bool isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") bool isBedtimeFillable, + @JsonKey(name: "is_public_profile") bool isPublicProfile}); +} + +/// @nodoc +class _$ProfileSettingsModelCopyWithImpl<$Res, + $Val extends ProfileSettingsModel> + implements $ProfileSettingsModelCopyWith<$Res> { + _$ProfileSettingsModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ProfileSettingsModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? newUpdatesNotifications = freezed, + Object? diaryReminderNotifications = freezed, + Object? isMoodFillable = null, + Object? isBedtimeFillable = null, + Object? isPublicProfile = null, + }) { + return _then(_value.copyWith( + newUpdatesNotifications: freezed == newUpdatesNotifications + ? _value.newUpdatesNotifications + : newUpdatesNotifications // ignore: cast_nullable_to_non_nullable + as dynamic, + diaryReminderNotifications: freezed == diaryReminderNotifications + ? _value.diaryReminderNotifications + : diaryReminderNotifications // ignore: cast_nullable_to_non_nullable + as dynamic, + isMoodFillable: null == isMoodFillable + ? _value.isMoodFillable + : isMoodFillable // ignore: cast_nullable_to_non_nullable + as bool, + isBedtimeFillable: null == isBedtimeFillable + ? _value.isBedtimeFillable + : isBedtimeFillable // ignore: cast_nullable_to_non_nullable + as bool, + isPublicProfile: null == isPublicProfile + ? _value.isPublicProfile + : isPublicProfile // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$ProfileSettingsModelImplCopyWith<$Res> + implements $ProfileSettingsModelCopyWith<$Res> { + factory _$$ProfileSettingsModelImplCopyWith(_$ProfileSettingsModelImpl value, + $Res Function(_$ProfileSettingsModelImpl) then) = + __$$ProfileSettingsModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "new_updates_notifications") + dynamic newUpdatesNotifications, + @JsonKey(name: "diary_reminder_notifications") + dynamic diaryReminderNotifications, + @JsonKey(name: "is_mood_fillable") bool isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") bool isBedtimeFillable, + @JsonKey(name: "is_public_profile") bool isPublicProfile}); +} + +/// @nodoc +class __$$ProfileSettingsModelImplCopyWithImpl<$Res> + extends _$ProfileSettingsModelCopyWithImpl<$Res, _$ProfileSettingsModelImpl> + implements _$$ProfileSettingsModelImplCopyWith<$Res> { + __$$ProfileSettingsModelImplCopyWithImpl(_$ProfileSettingsModelImpl _value, + $Res Function(_$ProfileSettingsModelImpl) _then) + : super(_value, _then); + + /// Create a copy of ProfileSettingsModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? newUpdatesNotifications = freezed, + Object? diaryReminderNotifications = freezed, + Object? isMoodFillable = null, + Object? isBedtimeFillable = null, + Object? isPublicProfile = null, + }) { + return _then(_$ProfileSettingsModelImpl( + newUpdatesNotifications: freezed == newUpdatesNotifications + ? _value.newUpdatesNotifications + : newUpdatesNotifications // ignore: cast_nullable_to_non_nullable + as dynamic, + diaryReminderNotifications: freezed == diaryReminderNotifications + ? _value.diaryReminderNotifications + : diaryReminderNotifications // ignore: cast_nullable_to_non_nullable + as dynamic, + isMoodFillable: null == isMoodFillable + ? _value.isMoodFillable + : isMoodFillable // ignore: cast_nullable_to_non_nullable + as bool, + isBedtimeFillable: null == isBedtimeFillable + ? _value.isBedtimeFillable + : isBedtimeFillable // ignore: cast_nullable_to_non_nullable + as bool, + isPublicProfile: null == isPublicProfile + ? _value.isPublicProfile + : isPublicProfile // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$ProfileSettingsModelImpl implements _ProfileSettingsModel { + const _$ProfileSettingsModelImpl( + {@JsonKey(name: "new_updates_notifications") + required this.newUpdatesNotifications, + @JsonKey(name: "diary_reminder_notifications") + required this.diaryReminderNotifications, + @JsonKey(name: "is_mood_fillable") required this.isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") required this.isBedtimeFillable, + @JsonKey(name: "is_public_profile") required this.isPublicProfile}); + + factory _$ProfileSettingsModelImpl.fromJson(Map json) => + _$$ProfileSettingsModelImplFromJson(json); + + @override + @JsonKey(name: "new_updates_notifications") + final dynamic newUpdatesNotifications; + @override + @JsonKey(name: "diary_reminder_notifications") + final dynamic diaryReminderNotifications; + @override + @JsonKey(name: "is_mood_fillable") + final bool isMoodFillable; + @override + @JsonKey(name: "is_bedtime_fillable") + final bool isBedtimeFillable; + @override + @JsonKey(name: "is_public_profile") + final bool isPublicProfile; + + @override + String toString() { + return 'ProfileSettingsModel(newUpdatesNotifications: $newUpdatesNotifications, diaryReminderNotifications: $diaryReminderNotifications, isMoodFillable: $isMoodFillable, isBedtimeFillable: $isBedtimeFillable, isPublicProfile: $isPublicProfile)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileSettingsModelImpl && + const DeepCollectionEquality().equals( + other.newUpdatesNotifications, newUpdatesNotifications) && + const DeepCollectionEquality().equals( + other.diaryReminderNotifications, diaryReminderNotifications) && + (identical(other.isMoodFillable, isMoodFillable) || + other.isMoodFillable == isMoodFillable) && + (identical(other.isBedtimeFillable, isBedtimeFillable) || + other.isBedtimeFillable == isBedtimeFillable) && + (identical(other.isPublicProfile, isPublicProfile) || + other.isPublicProfile == isPublicProfile)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(newUpdatesNotifications), + const DeepCollectionEquality().hash(diaryReminderNotifications), + isMoodFillable, + isBedtimeFillable, + isPublicProfile); + + /// Create a copy of ProfileSettingsModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ProfileSettingsModelImplCopyWith<_$ProfileSettingsModelImpl> + get copyWith => + __$$ProfileSettingsModelImplCopyWithImpl<_$ProfileSettingsModelImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$ProfileSettingsModelImplToJson( + this, + ); + } +} + +abstract class _ProfileSettingsModel implements ProfileSettingsModel { + const factory _ProfileSettingsModel( + {@JsonKey(name: "new_updates_notifications") + required final dynamic newUpdatesNotifications, + @JsonKey(name: "diary_reminder_notifications") + required final dynamic diaryReminderNotifications, + @JsonKey(name: "is_mood_fillable") required final bool isMoodFillable, + @JsonKey(name: "is_bedtime_fillable") + required final bool isBedtimeFillable, + @JsonKey(name: "is_public_profile") + required final bool isPublicProfile}) = _$ProfileSettingsModelImpl; + + factory _ProfileSettingsModel.fromJson(Map json) = + _$ProfileSettingsModelImpl.fromJson; + + @override + @JsonKey(name: "new_updates_notifications") + dynamic get newUpdatesNotifications; + @override + @JsonKey(name: "diary_reminder_notifications") + dynamic get diaryReminderNotifications; + @override + @JsonKey(name: "is_mood_fillable") + bool get isMoodFillable; + @override + @JsonKey(name: "is_bedtime_fillable") + bool get isBedtimeFillable; + @override + @JsonKey(name: "is_public_profile") + bool get isPublicProfile; + + /// Create a copy of ProfileSettingsModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ProfileSettingsModelImplCopyWith<_$ProfileSettingsModelImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/features/settings/models/profile_settings_model.g.dart b/lib/features/settings/models/profile_settings_model.g.dart new file mode 100644 index 00000000..d7a7e6eb --- /dev/null +++ b/lib/features/settings/models/profile_settings_model.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'profile_settings_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$ProfileSettingsModelImpl _$$ProfileSettingsModelImplFromJson( + Map json) => + _$ProfileSettingsModelImpl( + newUpdatesNotifications: json['new_updates_notifications'], + diaryReminderNotifications: json['diary_reminder_notifications'], + isMoodFillable: json['is_mood_fillable'] as bool, + isBedtimeFillable: json['is_bedtime_fillable'] as bool, + isPublicProfile: json['is_public_profile'] as bool, + ); + +Map _$$ProfileSettingsModelImplToJson( + _$ProfileSettingsModelImpl instance) => + { + 'new_updates_notifications': instance.newUpdatesNotifications, + 'diary_reminder_notifications': instance.diaryReminderNotifications, + 'is_mood_fillable': instance.isMoodFillable, + 'is_bedtime_fillable': instance.isBedtimeFillable, + 'is_public_profile': instance.isPublicProfile, + }; diff --git a/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart b/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart index a5b998f2..0b734d25 100644 --- a/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart +++ b/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart @@ -1,6 +1,39 @@ +import 'package:eatvio_app/features/profile/repositories/profile_repository.dart'; +import 'package:eatvio_app/features/settings/models/profile_settings_model.dart'; import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; +import 'package:eatvio_app/features/settings/repositories/service_repository.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -class SettingsCubit extends Cubit { - SettingsCubit() : super(SettingsState()); -} \ No newline at end of file +class SettingsCubit extends Cubit { + final ProfileRepository profileRepository; + final SettingsRepository settingsRepository; + + SettingsCubit({ + required this.profileRepository, + required this.settingsRepository, + }) : super(SettingsState.loading()); + + init() async { + try { + emit(SettingsState.loaded( + profileSettings: await settingsRepository.getProfileSettings(), + profileDetails: await profileRepository.getMyProfileDetails(), + )); + } catch (e) { + emit(SettingsState.error(errorMessage: e.toString())); + } + } + + updateProfileSettings({ + required ProfileSettingsModel profileSettingsModel + }) async { + try { + await settingsRepository.updateProfileSettings( + profileSettingsModel: profileSettingsModel, + ); + } catch (e) { + print(e); + rethrow; + } + } +} diff --git a/lib/features/settings/presentation/bloc/settings_cubit/settings_state.dart b/lib/features/settings/presentation/bloc/settings_cubit/settings_state.dart index 474295d0..41977b39 100644 --- a/lib/features/settings/presentation/bloc/settings_cubit/settings_state.dart +++ b/lib/features/settings/presentation/bloc/settings_cubit/settings_state.dart @@ -1,3 +1,5 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/settings/models/profile_settings_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'settings_state.freezed.dart'; @@ -5,8 +7,14 @@ part 'settings_state.freezed.dart'; @freezed abstract class SettingsState with _$SettingsState { const factory SettingsState() = _SettingsState; + const factory SettingsState.loading() = SettingsStateLoading; - const factory SettingsState.loaded() = SettingsStateLoaded; + + const factory SettingsState.loaded({ + required ProfileSettingsModel profileSettings, + required ProfileDetailsModel profileDetails, + }) = SettingsStateLoaded; + const factory SettingsState.error({ required String errorMessage, }) = SettingsStateError; diff --git a/lib/features/settings/presentation/bloc/settings_cubit/settings_state.freezed.dart b/lib/features/settings/presentation/bloc/settings_cubit/settings_state.freezed.dart index af636b51..f19981b6 100644 --- a/lib/features/settings/presentation/bloc/settings_cubit/settings_state.freezed.dart +++ b/lib/features/settings/presentation/bloc/settings_cubit/settings_state.freezed.dart @@ -20,7 +20,9 @@ mixin _$SettingsState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function() loaded, + required TResult Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; @@ -28,7 +30,9 @@ mixin _$SettingsState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function()? loaded, + TResult? Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -36,7 +40,9 @@ mixin _$SettingsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function()? loaded, + TResult Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -132,7 +138,9 @@ class _$SettingsStateImpl implements _SettingsState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function() loaded, + required TResult Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -143,7 +151,9 @@ class _$SettingsStateImpl implements _SettingsState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function()? loaded, + TResult? Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -154,7 +164,9 @@ class _$SettingsStateImpl implements _SettingsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function()? loaded, + TResult Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -250,7 +262,9 @@ class _$SettingsStateLoadingImpl implements SettingsStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function() loaded, + required TResult Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails) + loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -261,7 +275,9 @@ class _$SettingsStateLoadingImpl implements SettingsStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function()? loaded, + TResult? Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails)? + loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -272,7 +288,9 @@ class _$SettingsStateLoadingImpl implements SettingsStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function()? loaded, + TResult Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -329,6 +347,13 @@ abstract class _$$SettingsStateLoadedImplCopyWith<$Res> { factory _$$SettingsStateLoadedImplCopyWith(_$SettingsStateLoadedImpl value, $Res Function(_$SettingsStateLoadedImpl) then) = __$$SettingsStateLoadedImplCopyWithImpl<$Res>; + @useResult + $Res call( + {ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails}); + + $ProfileSettingsModelCopyWith<$Res> get profileSettings; + $ProfileDetailsModelCopyWith<$Res> get profileDetails; } /// @nodoc @@ -341,37 +366,95 @@ class __$$SettingsStateLoadedImplCopyWithImpl<$Res> /// Create a copy of SettingsState /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? profileSettings = null, + Object? profileDetails = null, + }) { + return _then(_$SettingsStateLoadedImpl( + profileSettings: null == profileSettings + ? _value.profileSettings + : profileSettings // ignore: cast_nullable_to_non_nullable + as ProfileSettingsModel, + profileDetails: null == profileDetails + ? _value.profileDetails + : profileDetails // ignore: cast_nullable_to_non_nullable + as ProfileDetailsModel, + )); + } + + /// Create a copy of SettingsState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ProfileSettingsModelCopyWith<$Res> get profileSettings { + return $ProfileSettingsModelCopyWith<$Res>(_value.profileSettings, (value) { + return _then(_value.copyWith(profileSettings: value)); + }); + } + + /// Create a copy of SettingsState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ProfileDetailsModelCopyWith<$Res> get profileDetails { + return $ProfileDetailsModelCopyWith<$Res>(_value.profileDetails, (value) { + return _then(_value.copyWith(profileDetails: value)); + }); + } } /// @nodoc class _$SettingsStateLoadedImpl implements SettingsStateLoaded { - const _$SettingsStateLoadedImpl(); + const _$SettingsStateLoadedImpl( + {required this.profileSettings, required this.profileDetails}); + + @override + final ProfileSettingsModel profileSettings; + @override + final ProfileDetailsModel profileDetails; @override String toString() { - return 'SettingsState.loaded()'; + return 'SettingsState.loaded(profileSettings: $profileSettings, profileDetails: $profileDetails)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SettingsStateLoadedImpl); + other is _$SettingsStateLoadedImpl && + (identical(other.profileSettings, profileSettings) || + other.profileSettings == profileSettings) && + (identical(other.profileDetails, profileDetails) || + other.profileDetails == profileDetails)); } @override - int get hashCode => runtimeType.hashCode; + int get hashCode => Object.hash(runtimeType, profileSettings, profileDetails); + + /// Create a copy of SettingsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$SettingsStateLoadedImplCopyWith<_$SettingsStateLoadedImpl> get copyWith => + __$$SettingsStateLoadedImplCopyWithImpl<_$SettingsStateLoadedImpl>( + this, _$identity); @override @optionalTypeArgs TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function() loaded, + required TResult Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails) + loaded, required TResult Function(String errorMessage) error, }) { - return loaded(); + return loaded(profileSettings, profileDetails); } @override @@ -379,10 +462,12 @@ class _$SettingsStateLoadedImpl implements SettingsStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function()? loaded, + TResult? Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails)? + loaded, TResult? Function(String errorMessage)? error, }) { - return loaded?.call(); + return loaded?.call(profileSettings, profileDetails); } @override @@ -390,12 +475,14 @@ class _$SettingsStateLoadedImpl implements SettingsStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function()? loaded, + TResult Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { if (loaded != null) { - return loaded(); + return loaded(profileSettings, profileDetails); } return orElse(); } @@ -439,7 +526,19 @@ class _$SettingsStateLoadedImpl implements SettingsStateLoaded { } abstract class SettingsStateLoaded implements SettingsState { - const factory SettingsStateLoaded() = _$SettingsStateLoadedImpl; + const factory SettingsStateLoaded( + {required final ProfileSettingsModel profileSettings, + required final ProfileDetailsModel profileDetails}) = + _$SettingsStateLoadedImpl; + + ProfileSettingsModel get profileSettings; + ProfileDetailsModel get profileDetails; + + /// Create a copy of SettingsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$SettingsStateLoadedImplCopyWith<_$SettingsStateLoadedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc @@ -514,7 +613,9 @@ class _$SettingsStateErrorImpl implements SettingsStateError { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function() loaded, + required TResult Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -525,7 +626,9 @@ class _$SettingsStateErrorImpl implements SettingsStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function()? loaded, + TResult? Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -536,7 +639,9 @@ class _$SettingsStateErrorImpl implements SettingsStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function()? loaded, + TResult Function(ProfileSettingsModel profileSettings, + ProfileDetailsModel profileDetails)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { diff --git a/lib/features/settings/presentation/pages/general_info_screen.dart b/lib/features/settings/presentation/pages/general_info_screen.dart index 6e9cb67f..dbe7d57e 100644 --- a/lib/features/settings/presentation/pages/general_info_screen.dart +++ b/lib/features/settings/presentation/pages/general_info_screen.dart @@ -1,4 +1,5 @@ import 'package:eatvio_app/core/utils/date_time_utils.dart'; +import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; @@ -7,7 +8,12 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class GeneralInfoScreen extends StatefulWidget { - const GeneralInfoScreen({super.key}); + final ProfileDetailsModel profileDetailsModel; + + const GeneralInfoScreen({ + super.key, + required this.profileDetailsModel, + }); @override State createState() => _GeneralInfoScreenState(); @@ -22,6 +28,9 @@ class _GeneralInfoScreenState extends State { void initState() { super.initState(); selectedDate = DateTime.now(); + firstNameController.text = widget.profileDetailsModel.firstName; + lastNameController.text = widget.profileDetailsModel.lastName; + selectedDate = DateTime.parse(widget.profileDetailsModel.birthdate); } @override @@ -35,7 +44,7 @@ class _GeneralInfoScreenState extends State { bottomSheet: _saveButton(), body: SingleChildScrollView( physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.only(top: 16, bottom: 80, left: 8, right: 8), + padding: EdgeInsets.all(16) + EdgeInsets.only(bottom: 64), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -145,7 +154,7 @@ class _GeneralInfoScreenState extends State { borderRadius: BorderRadius.circular(20), child: Ink( height: 52, - width: MediaQuery.of(context).size.width - 16, + width: MediaQuery.of(context).size.width - 32, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: appTheme.blueA400, diff --git a/lib/features/settings/presentation/pages/other_info_screen.dart b/lib/features/settings/presentation/pages/other_info_screen.dart index 99be2543..1232db7e 100644 --- a/lib/features/settings/presentation/pages/other_info_screen.dart +++ b/lib/features/settings/presentation/pages/other_info_screen.dart @@ -1,7 +1,17 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/generated/l10n.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; class OtherInfoScreen extends StatefulWidget { - const OtherInfoScreen({super.key}); + final ProfileDetailsModel profileDetailsModel; + + const OtherInfoScreen({ + super.key, + required this.profileDetailsModel, + }); @override State createState() => _OtherInfoScreenState(); @@ -10,6 +20,107 @@ class OtherInfoScreen extends StatefulWidget { class _OtherInfoScreenState extends State { @override Widget build(BuildContext context) { - return Scaffold(); + final s = S.of(context); + + return Scaffold( + appBar: AppBar( + title: Text('Прочая информаиця'), + ), + bottomSheet: _saveButton(), + body: SingleChildScrollView( + padding: EdgeInsets.all(16) + EdgeInsets.only(bottom: 64), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(s.allergies_presence), + SizedBox(height: 4), + CustomTextFormField( + hintText: 'Например: орехи, мёд и т.д.', + autofocus: true, + minLines: 2, + maxLines: 8, + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text(s.do_you_take_pills), + SizedBox(height: 4), + CustomTextFormField( + hintText: s.enter_information, + autofocus: true, + minLines: 2, + maxLines: 8, + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text(s.your_favorite_sports), + SizedBox(height: 4), + CustomTextFormField( + hintText: + "Я занимаюсь плаванием , почти каждый вечер прогулки на свежем воздухе, пару раз в месяц играю в волейбол. Стараюсь не сидеть на месте!", + autofocus: true, + maxLines: 8, + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text(s.favorite_foods), + SizedBox(height: 4), + CustomTextFormField( + hintText: s.enter_information, + maxLines: 7, + minLines: 2, + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text(s.unfavorite_foods), + SizedBox(height: 4), + CustomTextFormField( + hintText: s.enter_information, + maxLines: 7, + minLines: 2, + onChanged: (newValue) {}, + ), + SizedBox(height: 16), + Text( + 'Дополнительная информация', + maxLines: 2, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.start, + ), + SizedBox(height: 4), + CustomTextFormField( + hintText: "У меня крепкое здоровье, но последнее время часто утомляюсь, однако, это мне не мешает радоваться жизни", + maxLines: 8, + onChanged: (newValue) {}, + ), + ], + ), + ), + ); } -} \ No newline at end of file + + _saveButton() { + return InkWell( + onTap: () => GoRouter.of(context).pop(), + borderRadius: BorderRadius.circular(20), + child: Ink( + height: 52, + width: MediaQuery.of(context).size.width - 16, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: appTheme.blueA400, + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + height: 1, + fontWeight: FontWeight.w600, + fontSize: 18, + ), + ), + ), + ), + ); + } +} diff --git a/lib/features/settings/presentation/pages/physical_activity_screen.dart b/lib/features/settings/presentation/pages/physical_activity_screen.dart index 57496c18..55878e4a 100644 --- a/lib/features/settings/presentation/pages/physical_activity_screen.dart +++ b/lib/features/settings/presentation/pages/physical_activity_screen.dart @@ -1,7 +1,15 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; class PhysicalActivityScreen extends StatefulWidget { - const PhysicalActivityScreen({super.key}); + final ProfileDetailsModel profileDetailsModel; + + const PhysicalActivityScreen({ + super.key, + required this.profileDetailsModel, + }); @override State createState() => _PhysicalActivityScreenState(); @@ -18,10 +26,14 @@ class _PhysicalActivityScreenState extends State { appBar: AppBar( title: Text('Физическая нагрузка'), ), + bottomSheet: _saveButton(), body: SingleChildScrollView( + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.only(top: 16, bottom: 80, left: 8, right: 16), child: Column( children: [ RadioListTile( + contentPadding: EdgeInsets.zero, title: const Text('1,2 — минимальный (сидячая работа, отсутствие физических нагрузок);'), value: PhysicalActivity.minimum, groupValue: _physicalActivity, @@ -32,6 +44,7 @@ class _PhysicalActivityScreenState extends State { }, ), RadioListTile( + contentPadding: EdgeInsets.zero, title: const Text('1,375 — низкий (тренировки не менее 20 мин 1–3 раза в неделю);'), value: PhysicalActivity.low, groupValue: _physicalActivity, @@ -42,6 +55,7 @@ class _PhysicalActivityScreenState extends State { }, ), RadioListTile( + contentPadding: EdgeInsets.zero, title: const Text('1,55 — умеренный (тренировки 30–60 мин 3–4 раза в неделю);'), value: PhysicalActivity.medium, groupValue: _physicalActivity, @@ -52,6 +66,7 @@ class _PhysicalActivityScreenState extends State { }, ), RadioListTile( + contentPadding: EdgeInsets.zero, title: const Text('1,7 — высокий (тренировки 30–60 мин 5–7 раза в неделю; тяжёлая физическая работа);'), value: PhysicalActivity.high, groupValue: _physicalActivity, @@ -62,6 +77,7 @@ class _PhysicalActivityScreenState extends State { }, ), RadioListTile( + contentPadding: EdgeInsets.zero, title: const Text('1,9 — экстремальный (несколько интенсивных тренировок в день'), value: PhysicalActivity.extreme, groupValue: _physicalActivity, @@ -72,6 +88,7 @@ class _PhysicalActivityScreenState extends State { }, ), RadioListTile( + contentPadding: EdgeInsets.zero, title: const Text('1,9 6–7 раз в неделю; очень трудоёмкая работа).'), value: PhysicalActivity.hardWork, groupValue: _physicalActivity, @@ -86,4 +103,30 @@ class _PhysicalActivityScreenState extends State { ), ); } + + _saveButton() { + return InkWell( + onTap: () => GoRouter.of(context).pop(), + borderRadius: BorderRadius.circular(20), + child: Ink( + height: 52, + width: MediaQuery.of(context).size.width - 32, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: appTheme.blueA400, + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + color: Colors.white, + height: 1, + fontWeight: FontWeight.w600, + fontSize: 18, + ), + ), + ), + ), + ); + } } diff --git a/lib/features/settings/presentation/pages/physical_form_screen.dart b/lib/features/settings/presentation/pages/physical_form_screen.dart index 8817d0be..3b5f7097 100644 --- a/lib/features/settings/presentation/pages/physical_form_screen.dart +++ b/lib/features/settings/presentation/pages/physical_form_screen.dart @@ -1,3 +1,4 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; @@ -6,7 +7,12 @@ import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; class PhysicalFormScreen extends StatefulWidget { - const PhysicalFormScreen({super.key}); + final ProfileDetailsModel profileDetailsModel; + + const PhysicalFormScreen({ + super.key, + required this.profileDetailsModel, + }); @override State createState() => _PhysicalFormScreenState(); @@ -29,7 +35,7 @@ class _PhysicalFormScreenState extends State { bottomSheet: _saveButton(), body: SingleChildScrollView( physics: const BouncingScrollPhysics(), - padding: EdgeInsets.symmetric(vertical: 16, horizontal: 8), + padding: EdgeInsets.all(16) + EdgeInsets.only(bottom: 64), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -69,7 +75,7 @@ class _PhysicalFormScreenState extends State { borderRadius: BorderRadius.circular(20), child: Ink( height: 52, - width: MediaQuery.of(context).size.width - 16, + width: MediaQuery.of(context).size.width - 32, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: appTheme.blueA400, diff --git a/lib/features/settings/presentation/pages/pressure_screen.dart b/lib/features/settings/presentation/pages/pressure_screen.dart index c92b525a..5e8a9d51 100644 --- a/lib/features/settings/presentation/pages/pressure_screen.dart +++ b/lib/features/settings/presentation/pages/pressure_screen.dart @@ -1,15 +1,20 @@ -import 'package:eatvio_app/core/utils/image_constant.dart'; +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; +import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; -import 'package:eatvio_app/widgets/custom_image_view.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; class PressureScreen extends StatefulWidget { - const PressureScreen({super.key}); + final ProfileDetailsModel profileDetailsModel; + + const PressureScreen({ + super.key, + required this.profileDetailsModel, + }); @override State createState() => _PressureScreenState(); @@ -20,6 +25,16 @@ class _PressureScreenState extends State { final chestCircumferenceController = TextEditingController(); final waistCircumferenceController = TextEditingController(); final hipCircumferenceController = TextEditingController(); + final List selectionPopupList = [ + SelectionPopupModel( + id: 1, + title: "Да", + ), + SelectionPopupModel( + id: 0, + title: "Нет", + ), + ]; @override Widget build(BuildContext context) { @@ -27,12 +42,12 @@ class _PressureScreenState extends State { return Scaffold( appBar: AppBar( - title: Text('Физическая форма'), + title: Text('Давление'), ), bottomSheet: _saveButton(), body: SingleChildScrollView( physics: const BouncingScrollPhysics(), - padding: EdgeInsets.symmetric(vertical: 16, horizontal: 8), + padding: EdgeInsets.all(16) + EdgeInsets.only(bottom: 64), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -55,17 +70,8 @@ class _PressureScreenState extends State { Text(s.do_you_have_hypotension_tendency), SizedBox(height: 4), CustomDropDown( - icon: Container( - margin: EdgeInsets.all(16), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), - ), - child: CustomImageView( - imagePath: ImageConstant.imgFavorite, - height: 16, - width: 16, - ), - ), + items: selectionPopupList, + value: selectionPopupList[0], hintText: "Не выбрано", onChanged: (newPopup) { setState(() {}); @@ -75,17 +81,8 @@ class _PressureScreenState extends State { Text(s.do_you_have_hypertension_tendency), SizedBox(height: 4), CustomDropDown( - icon: Container( - margin: EdgeInsets.all(16), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), - ), - child: CustomImageView( - imagePath: ImageConstant.imgFavorite, - height: 16, - width: 16, - ), - ), + items: selectionPopupList, + value: selectionPopupList[0], hintText: "Не выбрано", onChanged: (newPopup) { setState(() {}); @@ -103,7 +100,7 @@ class _PressureScreenState extends State { borderRadius: BorderRadius.circular(20), child: Ink( height: 52, - width: MediaQuery.of(context).size.width - 16, + width: MediaQuery.of(context).size.width - 32, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: appTheme.blueA400, diff --git a/lib/features/settings/presentation/pages/settings_screen.dart b/lib/features/settings/presentation/pages/settings_screen.dart index 79b9e291..76456714 100644 --- a/lib/features/settings/presentation/pages/settings_screen.dart +++ b/lib/features/settings/presentation/pages/settings_screen.dart @@ -1,7 +1,11 @@ import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart'; +import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; +import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -13,32 +17,59 @@ class SettingsScreen extends StatefulWidget { } class _SettingsScreenState extends State { - bool updatesNotificationsSwitchState = true; - bool fillDiaryNotificationsSwitchState = true; + final SettingsCubit settingsCubit = sl()..init(); + late bool updatesNotificationsSwitchState; + late bool fillDiaryNotificationsSwitchState; @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Настройки'), - ), - body: SingleChildScrollView( - padding: EdgeInsets.symmetric(vertical: 16), - physics: const BouncingScrollPhysics(), - child: Column( - children: [ - _additionalInfo(), - const SizedBox(height: 12), - _notifications(), - const SizedBox(height: 12), - _aboutEatvio(), - const SizedBox(height: 12), - _becomeConsultantButton(), - const SizedBox(height: 8), - _deleteAccountButton(), - ], - ), - ), + return BlocConsumer( + bloc: settingsCubit, + listener: (BuildContext context, SettingsState state) { + if (state is SettingsStateLoaded) { + updatesNotificationsSwitchState = state.profileSettings.newUpdatesNotifications == 1 ? true : false; + fillDiaryNotificationsSwitchState = state.profileSettings.diaryReminderNotifications == 1 ? true : false; + } + }, + builder: (BuildContext context, SettingsState state) { + if (state is SettingsStateLoaded) { + return Scaffold( + appBar: AppBar( + title: Text('Настройки'), + ), + body: SingleChildScrollView( + padding: EdgeInsets.symmetric(vertical: 16), + physics: const BouncingScrollPhysics(), + child: Column( + children: [ + _additionalInfo(), + const SizedBox(height: 12), + _notifications(), + const SizedBox(height: 12), + _aboutEatvio(), + const SizedBox(height: 12), + _becomeConsultantButton(), + const SizedBox(height: 8), + _deleteAccountButton(), + ], + ), + ), + ); + } + if (state is SettingsStateError) { + return Scaffold( + body: Padding( + padding: const EdgeInsets.all(16), + child: Center(child: Text(state.errorMessage)), + ), + ); + } + return Scaffold( + body: Center( + child: CircularProgressIndicator(), + ), + ); + }, ); } @@ -59,27 +90,42 @@ class _SettingsScreenState extends State { ), ), _tile( - onTap: () => GoRouter.of(context).pushNamed('generalInfoScreen'), + onTap: () => GoRouter.of(context).pushNamed( + 'generalInfoScreen', + extra: (settingsCubit.state as SettingsStateLoaded).profileDetails, + ), title: 'Общая информация', ), _divider(context), _tile( - onTap: () => GoRouter.of(context).pushNamed('physicalFormScreen'), + onTap: () => GoRouter.of(context).pushNamed( + 'physicalFormScreen', + extra: (settingsCubit.state as SettingsStateLoaded).profileDetails, + ), title: 'Физическая форма', ), _divider(context), _tile( - onTap: () => GoRouter.of(context).pushNamed('pressureScreen'), + onTap: () => GoRouter.of(context).pushNamed( + 'pressureScreen', + extra: (settingsCubit.state as SettingsStateLoaded).profileDetails, + ), title: 'Давление', ), _divider(context), _tile( - onTap: () => GoRouter.of(context).pushNamed('otherInfoScreen'), + onTap: () => GoRouter.of(context).pushNamed( + 'otherInfoScreen', + extra: (settingsCubit.state as SettingsStateLoaded).profileDetails, + ), title: 'Прочая информация', ), _divider(context), _tile( - onTap: () => GoRouter.of(context).pushNamed('physicalActivityScreen'), + onTap: () => GoRouter.of(context).pushNamed( + 'physicalActivityScreen', + extra: (settingsCubit.state as SettingsStateLoaded).profileDetails, + ), title: 'Физическая нагрузка', ), ], @@ -106,6 +152,11 @@ class _SettingsScreenState extends State { setState(() { updatesNotificationsSwitchState = !updatesNotificationsSwitchState; }); + settingsCubit.updateProfileSettings( + profileSettingsModel: (settingsCubit.state as SettingsStateLoaded).profileSettings.copyWith( + newUpdatesNotifications: updatesNotificationsSwitchState, + ), + ); }, title: 'Уведомление о новых обновлениях', trailing: CupertinoSwitch( @@ -115,6 +166,11 @@ class _SettingsScreenState extends State { setState(() { updatesNotificationsSwitchState = newValue; }); + settingsCubit.updateProfileSettings( + profileSettingsModel: (settingsCubit.state as SettingsStateLoaded).profileSettings.copyWith( + newUpdatesNotifications: updatesNotificationsSwitchState, + ), + ); }, ), ), @@ -124,6 +180,11 @@ class _SettingsScreenState extends State { setState(() { fillDiaryNotificationsSwitchState = !fillDiaryNotificationsSwitchState; }); + settingsCubit.updateProfileSettings( + profileSettingsModel: (settingsCubit.state as SettingsStateLoaded).profileSettings.copyWith( + diaryReminderNotifications: fillDiaryNotificationsSwitchState, + ), + ); }, title: 'Напоминание о заполнении дневника', trailing: CupertinoSwitch( @@ -133,6 +194,11 @@ class _SettingsScreenState extends State { setState(() { fillDiaryNotificationsSwitchState = newValue; }); + settingsCubit.updateProfileSettings( + profileSettingsModel: (settingsCubit.state as SettingsStateLoaded).profileSettings.copyWith( + diaryReminderNotifications: fillDiaryNotificationsSwitchState, + ), + ); }, ), ), diff --git a/lib/features/settings/repositories/service_repository.dart b/lib/features/settings/repositories/service_repository.dart new file mode 100644 index 00000000..fe7d6492 --- /dev/null +++ b/lib/features/settings/repositories/service_repository.dart @@ -0,0 +1,39 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/settings/models/profile_settings_model.dart'; +import 'package:eatvio_app/features/settings/services/settings_service.dart'; + +class SettingsRepository { + final SettingsService settingsService; + + const SettingsRepository({required this.settingsService}); + + Future getProfileSettings() async { + try { + return await settingsService.getProfileSettings(); + } catch (e) { + rethrow; + } + } + + Future updateProfileSettings({ + required ProfileSettingsModel profileSettingsModel, + }) async { + try { + return await settingsService.updateProfileSettings( + data: profileSettingsModel.toJson(), + ); + } catch (e) { + rethrow; + } + } + + Future updateProfileDetails({ + required ProfileDetailsModel profileDetailsModel, + }) async { + try { + return await settingsService.updateProfileDetails(profileDetailsModel: profileDetailsModel); + } catch (e) { + rethrow; + } + } +} diff --git a/lib/features/settings/services/settings_service.dart b/lib/features/settings/services/settings_service.dart new file mode 100644 index 00000000..8af3badc --- /dev/null +++ b/lib/features/settings/services/settings_service.dart @@ -0,0 +1,24 @@ +import 'package:dio/dio.dart'; +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/settings/models/profile_settings_model.dart'; +import 'package:retrofit/retrofit.dart'; + +part 'settings_service.g.dart'; + +@RestApi() +abstract class SettingsService { + factory SettingsService(Dio dio, {String baseUrl}) = _SettingsService; + + @GET('/api/profile/settings') + Future getProfileSettings(); + + @POST('/api/profile/settings/update') + Future updateProfileSettings({ + @Body() required Map data, + }); + + @POST('/api/profile/update') + Future updateProfileDetails({ + @MultiPart() required ProfileDetailsModel profileDetailsModel, + }); +} diff --git a/lib/features/settings/services/settings_service.g.dart b/lib/features/settings/services/settings_service.g.dart new file mode 100644 index 00000000..8fc04b6a --- /dev/null +++ b/lib/features/settings/services/settings_service.g.dart @@ -0,0 +1,155 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'settings_service.dart'; + +// ************************************************************************** +// RetrofitGenerator +// ************************************************************************** + +// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element + +class _SettingsService implements SettingsService { + _SettingsService( + this._dio, { + this.baseUrl, + this.errorLogger, + }); + + final Dio _dio; + + String? baseUrl; + + final ParseErrorLogger? errorLogger; + + @override + Future getProfileSettings() async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/settings', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late ProfileSettingsModel _value; + try { + _value = ProfileSettingsModel.fromJson(_result.data!); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + + @override + Future updateProfileSettings( + {required Map data}) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(data); + final _options = _setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/settings/update', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late ProfileSettingsModel _value; + try { + _value = ProfileSettingsModel.fromJson(_result.data!); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + + @override + Future updateProfileDetails( + {required ProfileDetailsModel profileDetailsModel}) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/update', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late ProfileDetailsModel _value; + try { + _value = ProfileDetailsModel.fromJson(_result.data!); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + + RequestOptions _setStreamType(RequestOptions requestOptions) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { + if (T == String) { + requestOptions.responseType = ResponseType.plain; + } else { + requestOptions.responseType = ResponseType.json; + } + } + return requestOptions; + } + + String _combineBaseUrls( + String dioBaseUrl, + String? baseUrl, + ) { + if (baseUrl == null || baseUrl.trim().isEmpty) { + return dioBaseUrl; + } + + final url = Uri.parse(baseUrl); + + if (url.isAbsolute) { + return url.toString(); + } + + return Uri.parse(dioBaseUrl).resolveUri(url).toString(); + } +} diff --git a/lib/locator_service.dart b/lib/locator_service.dart index 37c53064..e51ccc7c 100644 --- a/lib/locator_service.dart +++ b/lib/locator_service.dart @@ -32,6 +32,9 @@ import 'package:eatvio_app/features/recipes/services/recipe_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'; +import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart'; +import 'package:eatvio_app/features/settings/repositories/service_repository.dart'; +import 'package:eatvio_app/features/settings/services/settings_service.dart'; import 'package:get_it/get_it.dart'; final sl = GetIt.instance; @@ -56,6 +59,7 @@ Future init() async { sl.registerFactory(() => CommentsCubit(feedRepository: sl())); sl.registerFactory(() => ChatSelectCubit(chatRepository: sl())); sl.registerFactory(() => PlansCubit(plansRepository: sl())); + sl.registerFactory(() => SettingsCubit(profileRepository: sl(), settingsRepository: sl())); // Repository sl.registerLazySingleton(() => ChatRepository(chatService: sl())); @@ -66,6 +70,7 @@ Future init() async { sl.registerLazySingleton(() => ProfileRepository(profileService: sl())); sl.registerLazySingleton(() => RecipeRepository(recipeService: sl())); sl.registerLazySingleton(() => PlansRepository(plansService: sl())); + sl.registerLazySingleton(() => SettingsRepository(settingsService: sl())); // Services sl.registerLazySingleton(() => ChatService(sl())); @@ -76,6 +81,7 @@ Future init() async { sl.registerLazySingleton(() => ProfileService(sl())); sl.registerLazySingleton(() => RecipeService(sl())); sl.registerLazySingleton(() => PlansService(sl())); + sl.registerLazySingleton(() => SettingsService(sl())); // External sl.registerLazySingleton( diff --git a/lib/widgets/custom_drop_down.dart b/lib/widgets/custom_drop_down.dart index 6843b7ba..a68a696f 100644 --- a/lib/widgets/custom_drop_down.dart +++ b/lib/widgets/custom_drop_down.dart @@ -62,11 +62,12 @@ class CustomDropDown extends StatelessWidget { icon: Icon(Icons.keyboard_arrow_down_rounded), autofocus: autofocus!, value: value, + isDense: true, isExpanded: true, style: textStyle ?? TextStyle( fontSize: 16, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w400, ), items: items?.map((SelectionPopupModel item) { return DropdownMenuItem( @@ -76,7 +77,7 @@ class CustomDropDown extends StatelessWidget { style: hintStyle ?? TextStyle( fontSize: 16, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w400, color: Colors.black, ), ), @@ -98,29 +99,29 @@ class CustomDropDown extends StatelessWidget { hintStyle: hintStyle ?? TextStyle( fontSize: 16, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w400, color: Colors.grey.shade400, height: 1, ), prefixIcon: prefix, prefixIconConstraints: prefixConstraints, suffixIcon: suffix, - suffixIconConstraints: suffixConstraints, isDense: true, + suffixIconConstraints: suffixConstraints, contentPadding: EdgeInsets.symmetric(vertical: 16, horizontal: 12), - fillColor: fillColor ?? Theme.of(context).colorScheme.onPrimary, + fillColor: Color(0xFFF6F6F6), filled: filled, border: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: Colors.grey, width: 0.2), + borderSide: BorderSide.none, ), enabledBorder: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: Colors.grey, width: 0.2), + borderSide: BorderSide.none, ), focusedBorder: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: Colors.grey, width: 0.2), + borderSide: BorderSide.none, ), ); } From 3225ff9a014135566c3f30927e47b7d1b4d087bc Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 30 Sep 2024 13:40:32 +0300 Subject: [PATCH 25/31] feat: add rive loading animation in profile page --- android/app/build.gradle | 2 +- assets/rive_animations/loading.riv | Bin 0 -> 881 bytes .../bloc/profile_cubit/profile_cubit.dart | 1 + .../presentation/pages/profile_screen.dart | 14 +++++++++++++- pubspec.yaml | 2 ++ 5 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 assets/rive_animations/loading.riv diff --git a/android/app/build.gradle b/android/app/build.gradle index 7652369e..bc059244 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ if (flutterVersionName == null) { android { namespace = "com.eatvioapp.app" compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion + ndkVersion = "25.1.8937393" compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/assets/rive_animations/loading.riv b/assets/rive_animations/loading.riv new file mode 100644 index 0000000000000000000000000000000000000000..9453df007eabcc5f635f8cafd436e8526d82b9fb GIT binary patch literal 881 zcmZ9LT}YEr7{{Npouv%&W5)7brXvzWD4ix^&F$=U1xvfB_k9l$1glob(qJvbx~MKH z^hQD|MXWAFNGPNahzPg6%#TqZRuX9!LisUWl7p!5tMl$yMCamM9DdLLJpbo^&S8(T zKMm9`d!uLyCD5XN8qeTaJcr|W9xvboUcyNX|F5lpHUnhWWB{y*Q3PoKuf%kKK5 zxRl9E521ZaLnL+Xj<-dGna4kf6uvU-kfX1oM6pbiglW<`$cc~DSQYXXEMe*0&042C zeNZJz`!jQx_GFiF;=W(63Xkf|5$VISK;*SuHln!w_7H82mUE(`@l8ZHCgwz>B33D1 z&MG6yYJ07dc3bXnqPOdKM0n8BACg*1O2hI>ZU<35jmI36Hgs?z<>2Uzey5~4kfqO^ zMA1e^Z++b$n1+jM6pWV;S*ui})u918oVP)+K3u$yu3|HhjqG+Mc-j-9Zu5qh>wdk+ zy}bP{gyo+@?O|*{ zez|jyD8KSc2~9?$|9H{TkTeJK>@u6R$*`?(oh>awmSwui(le#f%i-w(6sz1jog8&> z?@zi%T`b3(Ts?K z8X>BwvHtQ3lf5Urj219TV6=o$5+lZLFSOZg09y>YBE)u6 zY6mE&G)naizH{}BKC5jX0-@XlmWoWscO%HJvAfZMsjDLdDk?LN1ie9@^^o`E*%S*^ htthR|+w2QiZ9u>YuDeJF)!=|YD`KBu3L&@vzX1XV6p8=< literal 0 HcmV?d00001 diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index f6052a4b..85d18e1e 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -29,6 +29,7 @@ class ProfileCubit extends Cubit { _currentPeriod = period; try { final profile = await profileRepository.getMyProfile(); + await Future.delayed(Duration(seconds: 1)); emit(ProfileState.loaded( profile: profile, profileDetails: await profileRepository.getMyProfileDetails(), diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index 39a64846..b0643e63 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -14,6 +14,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; import 'package:share_plus/share_plus.dart'; class ProfileScreen extends StatefulWidget { @@ -287,7 +288,18 @@ class _ProfileScreenState extends State { return Scaffold( appBar: AppBar(), body: Center( - child: CircularProgressIndicator(), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), + ], + ) ), ); } diff --git a/pubspec.yaml b/pubspec.yaml index 91ec8f78..0b30677b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -47,6 +47,7 @@ dependencies: file_picker: ^8.1.2 audioplayers: ^6.1.0 intl: ^0.19.0 + rive: ^0.13.14 dev_dependencies: build_runner: ^2.4.12 @@ -64,6 +65,7 @@ flutter: - assets/images/ - assets/audio/ - assets/icons/ + - assets/rive_animations/ flutter_intl: enabled: true From c7f1af7c6f15073dddad34397d724b428778b973 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 30 Sep 2024 13:42:42 +0300 Subject: [PATCH 26/31] feat: change loading animation --- assets/rive_animations/loading.riv | Bin 881 -> 965 bytes .../bloc/profile_cubit/profile_cubit.dart | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/rive_animations/loading.riv b/assets/rive_animations/loading.riv index 9453df007eabcc5f635f8cafd436e8526d82b9fb..d1b89c4383f51869510889d047cdfe7d9e2763ed 100644 GIT binary patch delta 99 zcmey!c9eaC5Hq99WI<+)Kq*rJ200fdS2;HZh6Z~EIcEqbEo~WyV}p>9G8H6B;baSD FO91sU6ZilC delta 15 WcmX@g{*i5i5c6aaX7$Ov%oYGE3Iw$P diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index 85d18e1e..02cf5214 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -29,7 +29,7 @@ class ProfileCubit extends Cubit { _currentPeriod = period; try { final profile = await profileRepository.getMyProfile(); - await Future.delayed(Duration(seconds: 1)); + await Future.delayed(Duration(seconds: 2)); emit(ProfileState.loaded( profile: profile, profileDetails: await profileRepository.getMyProfileDetails(), From 5442a3f2e2fff150048f1118d1991b521c452aad Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 30 Sep 2024 17:44:25 +0300 Subject: [PATCH 27/31] feat: settings --- assets/rive_animations/loading.riv | Bin 965 -> 969 bytes lib/app_router.dart | 3 +- .../presentation/pages/blog_post_screen.dart | 9 +- .../presentation/pages/calendar_screen.dart | 9 +- .../chat/presentation/pages/chat_screen.dart | 19 ++- .../pages/chat_select_screen.dart | 17 ++- .../pages/diary_recommendations_scree.dart | 9 +- .../presentation/pages/diary_screen.dart | 17 ++- .../presentation/pages/about_diet_screen.dart | 9 +- .../feed/presentation/pages/feed_screen.dart | 41 +++++- .../bloc/profile_cubit/profile_cubit.dart | 1 - .../presentation/pages/profile_screen.dart | 19 +-- .../widgets/circumference_chart_widget.dart | 8 +- .../pages/about_recipes_screen.dart | 9 +- .../pages/recipe_create_screen.dart | 9 +- .../pages/recipe_edit_screen.dart | 9 +- .../pages/registration_screen.dart | 9 +- .../bloc/settings_cubit/settings_cubit.dart | 14 ++ .../pages/general_info_screen.dart | 22 ++- .../presentation/pages/other_info_screen.dart | 26 +++- .../pages/physical_activity_screen.dart | 69 +++++++-- .../pages/physical_form_screen.dart | 25 +++- .../presentation/pages/pressure_screen.dart | 31 +++- .../presentation/pages/settings_screen.dart | 135 ++++++++++-------- .../repositories/service_repository.dart | 4 +- .../settings/services/settings_service.dart | 2 +- .../settings/services/settings_service.g.dart | 5 +- .../diet_edit_screen/diet_edit_screen.dart | 9 +- .../diet_select_screen.dart | 25 +++- .../diet_show_screen/diet_show_screen.dart | 9 +- .../blog_post_edit_screen.dart | 25 +++- .../widgets/comment_widget.dart | 9 +- .../glossary_screen/glossary_screen.dart | 25 +++- .../plan_edit_screen/plan_edit_screen.dart | 9 +- .../plan_select_screen.dart | 25 +++- .../plan_show_screen/plan_show_screen.dart | 9 +- .../my_profile_screen/my_settings_screen.dart | 17 ++- .../recipe_edit_screen.dart | 17 ++- .../recipe_select_screen.dart | 25 +++- .../subscribers_screen.dart | 19 ++- lib/widgets/custom_expandable_list.dart | 11 +- lib/widgets/custom_text_form_field.dart | 2 +- 42 files changed, 600 insertions(+), 166 deletions(-) diff --git a/assets/rive_animations/loading.riv b/assets/rive_animations/loading.riv index d1b89c4383f51869510889d047cdfe7d9e2763ed..d328f26d4951ef0b71a5d1e83ba1f03527d176f6 100644 GIT binary patch delta 92 zcmX@gev*BIBD1YUg=K{`BZH)|5QCH{KZBeLBZHiCg$twGgN73hKp_F35R;@C`%W0vMa6KZF60su8b6H@>H diff --git a/lib/app_router.dart b/lib/app_router.dart index 66bd328e..7d97c634 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -172,10 +172,11 @@ class AppRouter { builder: (context, state) => SettingsScreen(), routes: [ GoRoute( - path: 'general-info-screen', + path: 'general-info-screen/:isPublicProfile', name: 'generalInfoScreen', builder: (context, state) => GeneralInfoScreen( profileDetailsModel: state.extra as ProfileDetailsModel, + isPublicProfile: bool.parse(state.pathParameters['isPublicProfile']!), ), ), GoRoute( 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 3f6004fd..7c27ab09 100644 --- a/lib/features/blog_post/presentation/pages/blog_post_screen.dart +++ b/lib/features/blog_post/presentation/pages/blog_post_screen.dart @@ -13,6 +13,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; import 'package:share_plus/share_plus.dart'; class BlogPostScreen extends StatefulWidget { @@ -320,7 +321,13 @@ class _BlogPostScreenState extends State { if (state is CommentsStateLoading) Padding( padding: const EdgeInsets.all(32), - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), if (state is CommentsStateLoaded) CommentsWidget( diff --git a/lib/features/calendar/presentation/pages/calendar_screen.dart b/lib/features/calendar/presentation/pages/calendar_screen.dart index 7bc7c3fa..be3f22ed 100644 --- a/lib/features/calendar/presentation/pages/calendar_screen.dart +++ b/lib/features/calendar/presentation/pages/calendar_screen.dart @@ -9,6 +9,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:go_router/go_router.dart'; import 'package:intl/intl.dart'; +import 'package:rive/rive.dart'; class CalendarScreen extends StatelessWidget { CalendarScreen({Key? key}) : super(key: key); @@ -23,7 +24,13 @@ class CalendarScreen extends StatelessWidget { } else if (state is CalendarStateLoading) { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is CalendarStateError) { diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index 58c1b70c..2e96d007 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -10,6 +10,7 @@ import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:intl/intl.dart'; +import 'package:rive/rive.dart'; class ChatScreen extends StatefulWidget { final String chatId; @@ -62,7 +63,13 @@ class _ChatScreenState extends State { } else { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } @@ -165,7 +172,15 @@ class _ChatScreenState extends State { } else { return Padding( padding: const EdgeInsets.all(8), - child: Center(child: CircularProgressIndicator()), + child: Center( + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), + ), ); } }, diff --git a/lib/features/chat/presentation/pages/chat_select_screen.dart b/lib/features/chat/presentation/pages/chat_select_screen.dart index b683eb39..b4660cf2 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen.dart @@ -6,6 +6,7 @@ import 'package:eatvio_app/features/chat/presentation/widgets/chat_search_bar_wi import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:rive/rive.dart'; class ChatSelectScreen extends StatefulWidget { const ChatSelectScreen({Key? key}) : super(key: key); @@ -78,7 +79,13 @@ class _ChatSelectScreenState extends State { if (state is ChatSelectStateLoading) { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is ChatSelectStateLoaded) { @@ -91,7 +98,13 @@ class _ChatSelectScreenState extends State { } else { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } diff --git a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart index e76b33ab..53b20dee 100644 --- a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart +++ b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart @@ -6,6 +6,7 @@ import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; +import 'package:rive/rive.dart'; // ignore: must_be_immutable class DiaryRecommendationsScreen extends StatelessWidget { @@ -27,7 +28,13 @@ class DiaryRecommendationsScreen extends StatelessWidget { } else if (state is DiaryStateLoading) { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is DiaryStateError) { diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 1a2e3bd3..aaa06ad8 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -20,6 +20,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:image_picker/image_picker.dart'; +import 'package:rive/rive.dart' as rive; import 'package:syncfusion_flutter_charts/charts.dart'; class DiaryScreen extends StatelessWidget { @@ -43,7 +44,13 @@ class DiaryScreen extends StatelessWidget { } else if (state is DiaryStateLoading) { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: rive.RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is DiaryStateError) { @@ -342,7 +349,13 @@ class DiaryScreen extends StatelessWidget { borderRadius: BorderRadiusStyle.roundedBorder5, ), child: Center( - child: CircularProgressIndicator(color: appTheme.blueGray300), // Замените на свой прелоадер при необходимости + child: SizedBox( + height: 32, + width: 32, + child: rive.RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ), ], diff --git a/lib/features/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart index 1847689d..7dd66a37 100644 --- a/lib/features/diets/presentation/pages/about_diet_screen.dart +++ b/lib/features/diets/presentation/pages/about_diet_screen.dart @@ -12,6 +12,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; class AboutDietScreen extends StatefulWidget { final Diet diet; @@ -329,7 +330,13 @@ class _AboutDietScreenState extends State { if (state is CommentsStateLoading) Padding( padding: const EdgeInsets.all(32), - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), if (state is CommentsStateLoaded) CommentsWidget( diff --git a/lib/features/feed/presentation/pages/feed_screen.dart b/lib/features/feed/presentation/pages/feed_screen.dart index e74a9cf3..ab1c9768 100644 --- a/lib/features/feed/presentation/pages/feed_screen.dart +++ b/lib/features/feed/presentation/pages/feed_screen.dart @@ -17,6 +17,7 @@ import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; final bucket = PageStorageBucket(); @@ -164,7 +165,13 @@ class _FeedScreenState extends State { if (index == state.feedBlogPostList.length) { return Container( alignment: Alignment.center, - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ); } return BlogPostWidget(feedBlogPostModel: state.feedBlogPostList[index]); @@ -188,7 +195,13 @@ class _FeedScreenState extends State { return Scaffold( backgroundColor: Colors.grey.shade200, body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } @@ -232,7 +245,13 @@ class _FeedScreenState extends State { return Scaffold( backgroundColor: Colors.grey.shade200, body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } @@ -276,7 +295,13 @@ class _FeedScreenState extends State { return Scaffold( backgroundColor: Colors.grey.shade200, body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } @@ -320,7 +345,13 @@ class _FeedScreenState extends State { return Scaffold( backgroundColor: Colors.grey.shade200, body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index 02cf5214..f6052a4b 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -29,7 +29,6 @@ class ProfileCubit extends Cubit { _currentPeriod = period; try { final profile = await profileRepository.getMyProfile(); - await Future.delayed(Duration(seconds: 2)); emit(ProfileState.loaded( profile: profile, profileDetails: await profileRepository.getMyProfileDetails(), diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index b0643e63..b62c2ec4 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -288,18 +288,13 @@ class _ProfileScreenState extends State { return Scaffold( appBar: AppBar(), body: Center( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox( - height: 32, - width: 32, - child: RiveAnimation.asset( - 'assets/rive_animations/loading.riv', - ), - ), - ], - ) + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart index 21fef10c..eb37ec13 100644 --- a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -246,9 +246,9 @@ class _CircumferenceChartWidgetState extends State { InkWell( onTap: () { widget.profileCubit.addCircumference( - chestCircumference: chest, - waistCircumference: waist, - hipCircumference: hip, + chestCircumference: chest + 20, + waistCircumference: waist + 20, + hipCircumference: hip + 20, ); Navigator.of(context).pop(); }, @@ -275,7 +275,7 @@ class _CircumferenceChartWidgetState extends State { }, ); }, - backgroundColor: Colors.red, + backgroundColor: appTheme.blueA400, shape: CircleBorder(), child: Icon( Icons.add, diff --git a/lib/features/recipes/presentation/pages/about_recipes_screen.dart b/lib/features/recipes/presentation/pages/about_recipes_screen.dart index 130317e2..b54fed1f 100644 --- a/lib/features/recipes/presentation/pages/about_recipes_screen.dart +++ b/lib/features/recipes/presentation/pages/about_recipes_screen.dart @@ -13,6 +13,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; class AboutRecipesScreen extends StatefulWidget { final Recipes recipes; @@ -347,7 +348,13 @@ class _AboutRecipesScreenState extends State { if (state is CommentsStateLoading) Padding( padding: const EdgeInsets.all(32), - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), if (state is CommentsStateLoaded) CommentsWidget( diff --git a/lib/features/recipes/presentation/pages/recipe_create_screen.dart b/lib/features/recipes/presentation/pages/recipe_create_screen.dart index 947b2784..eb1339b4 100644 --- a/lib/features/recipes/presentation/pages/recipe_create_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_create_screen.dart @@ -17,6 +17,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:image_picker/image_picker.dart'; +import 'package:rive/rive.dart' as rive; class RecipeCreateScreen extends StatelessWidget { RecipeCreateScreen({Key? key}) : super(key: key); @@ -31,7 +32,13 @@ class RecipeCreateScreen extends StatelessWidget { } else if (state is RecipeCreateStateLoading) { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: rive.RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is RecipeCreateStateError) { diff --git a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart index a5abe676..dc435059 100644 --- a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart @@ -14,6 +14,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:image_picker/image_picker.dart'; +import 'package:rive/rive.dart' as rive; // ignore: must_be_immutable class RecipeEditScreen extends StatelessWidget { @@ -35,7 +36,13 @@ class RecipeEditScreen extends StatelessWidget { } else if (state is RecipeCreateStateLoading) { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: rive.RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is RecipeCreateStateError) { diff --git a/lib/features/registration/presentation/pages/registration_screen.dart b/lib/features/registration/presentation/pages/registration_screen.dart index a2a4f5b3..7694582c 100644 --- a/lib/features/registration/presentation/pages/registration_screen.dart +++ b/lib/features/registration/presentation/pages/registration_screen.dart @@ -23,6 +23,7 @@ import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; import 'package:validators/validators.dart'; class RegistrationScreen extends StatefulWidget { @@ -318,7 +319,13 @@ class _RegistrationScreenState extends State { builder: (context) => PopScope( canPop: false, child: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ), ); diff --git a/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart b/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart index 0b734d25..c4c0287b 100644 --- a/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart +++ b/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart @@ -1,3 +1,4 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:eatvio_app/features/profile/repositories/profile_repository.dart'; import 'package:eatvio_app/features/settings/models/profile_settings_model.dart'; import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; @@ -24,6 +25,19 @@ class SettingsCubit extends Cubit { } } + updateProfileDetails({ + required ProfileDetailsModel profileDetailsModel + }) async { + try { + await settingsRepository.updateProfileDetails( + profileDetailsModel: profileDetailsModel, + ); + } catch (e) { + print(e); + rethrow; + } + } + updateProfileSettings({ required ProfileSettingsModel profileSettingsModel }) async { diff --git a/lib/features/settings/presentation/pages/general_info_screen.dart b/lib/features/settings/presentation/pages/general_info_screen.dart index dbe7d57e..109e584c 100644 --- a/lib/features/settings/presentation/pages/general_info_screen.dart +++ b/lib/features/settings/presentation/pages/general_info_screen.dart @@ -9,10 +9,12 @@ import 'package:go_router/go_router.dart'; class GeneralInfoScreen extends StatefulWidget { final ProfileDetailsModel profileDetailsModel; + final bool isPublicProfile; const GeneralInfoScreen({ super.key, required this.profileDetailsModel, + required this.isPublicProfile, }); @override @@ -22,7 +24,12 @@ class GeneralInfoScreen extends StatefulWidget { class _GeneralInfoScreenState extends State { final firstNameController = TextEditingController(); final lastNameController = TextEditingController(); + final genderController = TextEditingController(); + final countryController = TextEditingController(); + final cityController = TextEditingController(); + final languageController = TextEditingController(); late DateTime selectedDate; + late bool isPublicProfile; @override void initState() { @@ -31,6 +38,11 @@ class _GeneralInfoScreenState extends State { firstNameController.text = widget.profileDetailsModel.firstName; lastNameController.text = widget.profileDetailsModel.lastName; selectedDate = DateTime.parse(widget.profileDetailsModel.birthdate); + genderController.text = widget.profileDetailsModel.gender; + countryController.text = widget.profileDetailsModel.country; + cityController.text = widget.profileDetailsModel.city; + languageController.text = widget.profileDetailsModel.lang; + isPublicProfile = widget.isPublicProfile; } @override @@ -73,35 +85,35 @@ class _GeneralInfoScreenState extends State { Text('Пол'), SizedBox(height: 4), CustomTextFormField( - initialValue: 'Мужской', + controller: genderController, onChanged: (newValue) {}, ), SizedBox(height: 16), Text('Страна'), SizedBox(height: 4), CustomTextFormField( - initialValue: 'Россия', + controller: countryController, onChanged: (newValue) {}, ), SizedBox(height: 16), Text('Город'), SizedBox(height: 4), CustomTextFormField( - initialValue: 'Москва', + controller: cityController, onChanged: (newValue) {}, ), SizedBox(height: 16), Text('Предпочтительный язык общения'), SizedBox(height: 4), CustomTextFormField( - initialValue: 'Русский', + controller: languageController, onChanged: (newValue) {}, ), SizedBox(height: 16), Text('Показывать анкету'), SizedBox(height: 4), CustomTextFormField( - initialValue: 'Всем', + initialValue: isPublicProfile ? 'Всем' : 'Только зарегистрированным', onChanged: (newValue) {}, ), ], diff --git a/lib/features/settings/presentation/pages/other_info_screen.dart b/lib/features/settings/presentation/pages/other_info_screen.dart index 1232db7e..4501a9f6 100644 --- a/lib/features/settings/presentation/pages/other_info_screen.dart +++ b/lib/features/settings/presentation/pages/other_info_screen.dart @@ -18,6 +18,24 @@ class OtherInfoScreen extends StatefulWidget { } class _OtherInfoScreenState extends State { + final aboutAllergyController = TextEditingController(); + final aboutTakingPillsController = TextEditingController(); + final aboutSportHobbiesController = TextEditingController(); + final favoriteFoodsController = TextEditingController(); + final unfavouriteFoodsController = TextEditingController(); + final additionalInfoController = TextEditingController(); + + @override + void initState() { + super.initState(); + aboutAllergyController.text = widget.profileDetailsModel.aboutAlergy; + aboutTakingPillsController.text = widget.profileDetailsModel.aboutTakingPils; + aboutSportHobbiesController.text = widget.profileDetailsModel.aboutSportHobbies; + favoriteFoodsController.text = widget.profileDetailsModel.favoriteFoods; + unfavouriteFoodsController.text = widget.profileDetailsModel.unfavoriteFoods; + additionalInfoController.text = widget.profileDetailsModel.additionalInfo; + } + @override Widget build(BuildContext context) { final s = S.of(context); @@ -35,6 +53,7 @@ class _OtherInfoScreenState extends State { Text(s.allergies_presence), SizedBox(height: 4), CustomTextFormField( + controller: aboutAllergyController, hintText: 'Например: орехи, мёд и т.д.', autofocus: true, minLines: 2, @@ -45,6 +64,7 @@ class _OtherInfoScreenState extends State { Text(s.do_you_take_pills), SizedBox(height: 4), CustomTextFormField( + controller: aboutTakingPillsController, hintText: s.enter_information, autofocus: true, minLines: 2, @@ -55,6 +75,7 @@ class _OtherInfoScreenState extends State { Text(s.your_favorite_sports), SizedBox(height: 4), CustomTextFormField( + controller: aboutSportHobbiesController, hintText: "Я занимаюсь плаванием , почти каждый вечер прогулки на свежем воздухе, пару раз в месяц играю в волейбол. Стараюсь не сидеть на месте!", autofocus: true, @@ -65,6 +86,7 @@ class _OtherInfoScreenState extends State { Text(s.favorite_foods), SizedBox(height: 4), CustomTextFormField( + controller: favoriteFoodsController, hintText: s.enter_information, maxLines: 7, minLines: 2, @@ -74,6 +96,7 @@ class _OtherInfoScreenState extends State { Text(s.unfavorite_foods), SizedBox(height: 4), CustomTextFormField( + controller: unfavouriteFoodsController, hintText: s.enter_information, maxLines: 7, minLines: 2, @@ -88,6 +111,7 @@ class _OtherInfoScreenState extends State { ), SizedBox(height: 4), CustomTextFormField( + controller: additionalInfoController, hintText: "У меня крепкое здоровье, но последнее время часто утомляюсь, однако, это мне не мешает радоваться жизни", maxLines: 8, onChanged: (newValue) {}, @@ -104,7 +128,7 @@ class _OtherInfoScreenState extends State { borderRadius: BorderRadius.circular(20), child: Ink( height: 52, - width: MediaQuery.of(context).size.width - 16, + width: MediaQuery.of(context).size.width - 32, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: appTheme.blueA400, diff --git a/lib/features/settings/presentation/pages/physical_activity_screen.dart b/lib/features/settings/presentation/pages/physical_activity_screen.dart index 55878e4a..536009c2 100644 --- a/lib/features/settings/presentation/pages/physical_activity_screen.dart +++ b/lib/features/settings/presentation/pages/physical_activity_screen.dart @@ -1,4 +1,7 @@ import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart'; +import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; +import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; @@ -15,10 +18,32 @@ class PhysicalActivityScreen extends StatefulWidget { State createState() => _PhysicalActivityScreenState(); } -enum PhysicalActivity { minimum, low, medium, high, extreme, hardWork } +enum PhysicalActivity { minimum, low, medium, high, extreme } class _PhysicalActivityScreenState extends State { - PhysicalActivity? _physicalActivity = PhysicalActivity.minimum; + late PhysicalActivity? _physicalActivity; + + @override + void initState() { + super.initState(); + switch (widget.profileDetailsModel.activityCoefficient) { + case 1.2: + _physicalActivity = PhysicalActivity.minimum; + break; + case 1.375: + _physicalActivity = PhysicalActivity.low; + break; + case 1.55: + _physicalActivity = PhysicalActivity.medium; + break; + case 1.7: + _physicalActivity = PhysicalActivity.high; + break; + case 1.9: + _physicalActivity = PhysicalActivity.extreme; + break; + } + } @override Widget build(BuildContext context) { @@ -87,17 +112,6 @@ class _PhysicalActivityScreenState extends State { }); }, ), - RadioListTile( - contentPadding: EdgeInsets.zero, - title: const Text('1,9 6–7 раз в неделю; очень трудоёмкая работа).'), - value: PhysicalActivity.hardWork, - groupValue: _physicalActivity, - onChanged: (PhysicalActivity? value) { - setState(() { - _physicalActivity = value; - }); - }, - ), ], ), ), @@ -106,7 +120,34 @@ class _PhysicalActivityScreenState extends State { _saveButton() { return InkWell( - onTap: () => GoRouter.of(context).pop(), + onTap: () { + late final double activityCoefficient; + switch (_physicalActivity) { + case PhysicalActivity.minimum: + activityCoefficient = 1.2; + break; + case PhysicalActivity.low: + activityCoefficient = 1.375; + break; + case PhysicalActivity.medium: + activityCoefficient = 1.55; + break; + case PhysicalActivity.high: + activityCoefficient = 1.7; + break; + case PhysicalActivity.extreme: + activityCoefficient = 1.9; + break; + default: + break; + } + sl().updateProfileDetails( + profileDetailsModel: (sl().state as SettingsStateLoaded).profileDetails.copyWith( + activityCoefficient: activityCoefficient, + ), + ); + GoRouter.of(context).pop(); + }, borderRadius: BorderRadius.circular(20), child: Ink( height: 52, diff --git a/lib/features/settings/presentation/pages/physical_form_screen.dart b/lib/features/settings/presentation/pages/physical_form_screen.dart index 3b5f7097..d45a8367 100644 --- a/lib/features/settings/presentation/pages/physical_form_screen.dart +++ b/lib/features/settings/presentation/pages/physical_form_screen.dart @@ -23,6 +23,16 @@ class _PhysicalFormScreenState extends State { final chestCircumferenceController = TextEditingController(); final waistCircumferenceController = TextEditingController(); final hipCircumferenceController = TextEditingController(); + final heightController = TextEditingController(); + + @override + void initState() { + super.initState(); + chestCircumferenceController.text = widget.profileDetailsModel.chestCircumference.toString(); + waistCircumferenceController.text = widget.profileDetailsModel.waistCircumference.toString(); + hipCircumferenceController.text = widget.profileDetailsModel.hipCircumference.toString(); + heightController.text = widget.profileDetailsModel.height.toString(); + } @override Widget build(BuildContext context) { @@ -44,7 +54,7 @@ class _PhysicalFormScreenState extends State { CustomTextFormField( inputFormatters: [digitsOnly], controller: chestCircumferenceController, - hintText: '90', + hintText: 'см', ), SizedBox(height: 16), Text(s.waist_circumference), @@ -52,7 +62,7 @@ class _PhysicalFormScreenState extends State { CustomTextFormField( inputFormatters: [digitsOnly], controller: waistCircumferenceController, - hintText: "60", + hintText: 'см', ), SizedBox(height: 16), Text(s.hip_circumference), @@ -60,7 +70,16 @@ class _PhysicalFormScreenState extends State { CustomTextFormField( inputFormatters: [digitsOnly], controller: hipCircumferenceController, - hintText: '90', + hintText: 'см', + textInputAction: TextInputAction.done, + ), + SizedBox(height: 16), + Text('Рост'), + SizedBox(height: 4), + CustomTextFormField( + inputFormatters: [digitsOnly], + controller: heightController, + hintText: 'см', textInputAction: TextInputAction.done, ), ], diff --git a/lib/features/settings/presentation/pages/pressure_screen.dart b/lib/features/settings/presentation/pages/pressure_screen.dart index 5e8a9d51..62d4ce8a 100644 --- a/lib/features/settings/presentation/pages/pressure_screen.dart +++ b/lib/features/settings/presentation/pages/pressure_screen.dart @@ -22,9 +22,20 @@ class PressureScreen extends StatefulWidget { class _PressureScreenState extends State { final digitsOnly = FilteringTextInputFormatter.digitsOnly; - final chestCircumferenceController = TextEditingController(); - final waistCircumferenceController = TextEditingController(); - final hipCircumferenceController = TextEditingController(); + final bloodPressureUpController = TextEditingController(); + final bloodPressureDownController = TextEditingController(); + late SelectionPopupModel hypo; + late SelectionPopupModel hyper; + + @override + void initState() { + super.initState(); + bloodPressureUpController.text = widget.profileDetailsModel.bloodPressureUp.toString(); + bloodPressureDownController.text = widget.profileDetailsModel.bloodPressureDown.toString(); + hypo = widget.profileDetailsModel.hasHypo ? selectionPopupList[0] : selectionPopupList[1]; + hyper = widget.profileDetailsModel.hasHyper ? selectionPopupList[0] : selectionPopupList[1]; + } + final List selectionPopupList = [ SelectionPopupModel( id: 1, @@ -54,6 +65,7 @@ class _PressureScreenState extends State { Text(s.up_pressure), SizedBox(height: 4), CustomTextFormField( + controller: bloodPressureUpController, inputFormatters: [digitsOnly], hintText: "90", onChanged: (newValue) {}, @@ -62,6 +74,7 @@ class _PressureScreenState extends State { Text(s.down_pressure), SizedBox(height: 4), CustomTextFormField( + controller: bloodPressureDownController, inputFormatters: [digitsOnly], hintText: '90', onChanged: (newValue) {}, @@ -71,10 +84,12 @@ class _PressureScreenState extends State { SizedBox(height: 4), CustomDropDown( items: selectionPopupList, - value: selectionPopupList[0], + value: hypo, hintText: "Не выбрано", onChanged: (newPopup) { - setState(() {}); + setState(() { + hypo = newPopup; + }); }, ), SizedBox(height: 16), @@ -82,10 +97,12 @@ class _PressureScreenState extends State { SizedBox(height: 4), CustomDropDown( items: selectionPopupList, - value: selectionPopupList[0], + value: hyper, hintText: "Не выбрано", onChanged: (newPopup) { - setState(() {}); + setState(() { + hyper = newPopup; + }); }, ), ], diff --git a/lib/features/settings/presentation/pages/settings_screen.dart b/lib/features/settings/presentation/pages/settings_screen.dart index 76456714..1072c270 100644 --- a/lib/features/settings/presentation/pages/settings_screen.dart +++ b/lib/features/settings/presentation/pages/settings_screen.dart @@ -7,6 +7,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; import 'package:url_launcher/url_launcher.dart'; class SettingsScreen extends StatefulWidget { @@ -17,63 +18,70 @@ class SettingsScreen extends StatefulWidget { } class _SettingsScreenState extends State { - final SettingsCubit settingsCubit = sl()..init(); late bool updatesNotificationsSwitchState; late bool fillDiaryNotificationsSwitchState; @override Widget build(BuildContext context) { - return BlocConsumer( - bloc: settingsCubit, - listener: (BuildContext context, SettingsState state) { - if (state is SettingsStateLoaded) { - updatesNotificationsSwitchState = state.profileSettings.newUpdatesNotifications == 1 ? true : false; - fillDiaryNotificationsSwitchState = state.profileSettings.diaryReminderNotifications == 1 ? true : false; - } - }, - builder: (BuildContext context, SettingsState state) { - if (state is SettingsStateLoaded) { + return BlocProvider( + create: (BuildContext context) => sl()..init(), + child: BlocConsumer( + listener: (BuildContext context, SettingsState state) { + if (state is SettingsStateLoaded) { + updatesNotificationsSwitchState = state.profileSettings.newUpdatesNotifications == 1 ? true : false; + fillDiaryNotificationsSwitchState = state.profileSettings.diaryReminderNotifications == 1 ? true : false; + } + }, + builder: (BuildContext context, SettingsState state) { + if (state is SettingsStateLoaded) { + return Scaffold( + appBar: AppBar( + title: Text('Настройки'), + ), + body: SingleChildScrollView( + padding: EdgeInsets.symmetric(vertical: 16), + physics: const BouncingScrollPhysics(), + child: Column( + children: [ + _additionalInfo(state), + const SizedBox(height: 12), + _notifications(state), + const SizedBox(height: 12), + _aboutEatvio(state), + const SizedBox(height: 12), + _becomeConsultantButton(state), + const SizedBox(height: 8), + _deleteAccountButton(state), + ], + ), + ), + ); + } + if (state is SettingsStateError) { + return Scaffold( + body: Padding( + padding: const EdgeInsets.all(16), + child: Center(child: Text(state.errorMessage)), + ), + ); + } return Scaffold( - appBar: AppBar( - title: Text('Настройки'), - ), - body: SingleChildScrollView( - padding: EdgeInsets.symmetric(vertical: 16), - physics: const BouncingScrollPhysics(), - child: Column( - children: [ - _additionalInfo(), - const SizedBox(height: 12), - _notifications(), - const SizedBox(height: 12), - _aboutEatvio(), - const SizedBox(height: 12), - _becomeConsultantButton(), - const SizedBox(height: 8), - _deleteAccountButton(), - ], + body: Center( + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), ), ), ); - } - if (state is SettingsStateError) { - return Scaffold( - body: Padding( - padding: const EdgeInsets.all(16), - child: Center(child: Text(state.errorMessage)), - ), - ); - } - return Scaffold( - body: Center( - child: CircularProgressIndicator(), - ), - ); - }, + }, + ), ); } - _additionalInfo() { + _additionalInfo(SettingsStateLoaded state) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -92,7 +100,10 @@ class _SettingsScreenState extends State { _tile( onTap: () => GoRouter.of(context).pushNamed( 'generalInfoScreen', - extra: (settingsCubit.state as SettingsStateLoaded).profileDetails, + extra: state.profileDetails, + pathParameters: { + 'isPublicProfile': state.profileSettings.isPublicProfile.toString(), + }, ), title: 'Общая информация', ), @@ -100,7 +111,7 @@ class _SettingsScreenState extends State { _tile( onTap: () => GoRouter.of(context).pushNamed( 'physicalFormScreen', - extra: (settingsCubit.state as SettingsStateLoaded).profileDetails, + extra: state.profileDetails, ), title: 'Физическая форма', ), @@ -108,7 +119,7 @@ class _SettingsScreenState extends State { _tile( onTap: () => GoRouter.of(context).pushNamed( 'pressureScreen', - extra: (settingsCubit.state as SettingsStateLoaded).profileDetails, + extra: state.profileDetails, ), title: 'Давление', ), @@ -116,7 +127,7 @@ class _SettingsScreenState extends State { _tile( onTap: () => GoRouter.of(context).pushNamed( 'otherInfoScreen', - extra: (settingsCubit.state as SettingsStateLoaded).profileDetails, + extra: state.profileDetails, ), title: 'Прочая информация', ), @@ -124,7 +135,7 @@ class _SettingsScreenState extends State { _tile( onTap: () => GoRouter.of(context).pushNamed( 'physicalActivityScreen', - extra: (settingsCubit.state as SettingsStateLoaded).profileDetails, + extra: state.profileDetails, ), title: 'Физическая нагрузка', ), @@ -132,7 +143,7 @@ class _SettingsScreenState extends State { ); } - _notifications() { + _notifications(SettingsStateLoaded state) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -152,8 +163,8 @@ class _SettingsScreenState extends State { setState(() { updatesNotificationsSwitchState = !updatesNotificationsSwitchState; }); - settingsCubit.updateProfileSettings( - profileSettingsModel: (settingsCubit.state as SettingsStateLoaded).profileSettings.copyWith( + context.read().updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( newUpdatesNotifications: updatesNotificationsSwitchState, ), ); @@ -166,8 +177,8 @@ class _SettingsScreenState extends State { setState(() { updatesNotificationsSwitchState = newValue; }); - settingsCubit.updateProfileSettings( - profileSettingsModel: (settingsCubit.state as SettingsStateLoaded).profileSettings.copyWith( + context.read().updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( newUpdatesNotifications: updatesNotificationsSwitchState, ), ); @@ -180,8 +191,8 @@ class _SettingsScreenState extends State { setState(() { fillDiaryNotificationsSwitchState = !fillDiaryNotificationsSwitchState; }); - settingsCubit.updateProfileSettings( - profileSettingsModel: (settingsCubit.state as SettingsStateLoaded).profileSettings.copyWith( + context.read().updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( diaryReminderNotifications: fillDiaryNotificationsSwitchState, ), ); @@ -194,8 +205,8 @@ class _SettingsScreenState extends State { setState(() { fillDiaryNotificationsSwitchState = newValue; }); - settingsCubit.updateProfileSettings( - profileSettingsModel: (settingsCubit.state as SettingsStateLoaded).profileSettings.copyWith( + context.read().updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( diaryReminderNotifications: fillDiaryNotificationsSwitchState, ), ); @@ -206,7 +217,7 @@ class _SettingsScreenState extends State { ); } - _aboutEatvio() { + _aboutEatvio(SettingsStateLoaded state) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -234,7 +245,7 @@ class _SettingsScreenState extends State { ); } - _becomeConsultantButton() { + _becomeConsultantButton(SettingsStateLoaded state) { return Padding( padding: EdgeInsets.symmetric(horizontal: 16), child: InkWell( @@ -263,7 +274,7 @@ class _SettingsScreenState extends State { ); } - _deleteAccountButton() { + _deleteAccountButton(SettingsStateLoaded state) { return Padding( padding: EdgeInsets.symmetric(horizontal: 16), child: InkWell( diff --git a/lib/features/settings/repositories/service_repository.dart b/lib/features/settings/repositories/service_repository.dart index fe7d6492..eb462de3 100644 --- a/lib/features/settings/repositories/service_repository.dart +++ b/lib/features/settings/repositories/service_repository.dart @@ -31,7 +31,9 @@ class SettingsRepository { required ProfileDetailsModel profileDetailsModel, }) async { try { - return await settingsService.updateProfileDetails(profileDetailsModel: profileDetailsModel); + return await settingsService.updateProfileDetails( + data: profileDetailsModel.toJson(), + ); } catch (e) { rethrow; } diff --git a/lib/features/settings/services/settings_service.dart b/lib/features/settings/services/settings_service.dart index 8af3badc..71d5de73 100644 --- a/lib/features/settings/services/settings_service.dart +++ b/lib/features/settings/services/settings_service.dart @@ -19,6 +19,6 @@ abstract class SettingsService { @POST('/api/profile/update') Future updateProfileDetails({ - @MultiPart() required ProfileDetailsModel profileDetailsModel, + @Body() required Map data, }); } diff --git a/lib/features/settings/services/settings_service.g.dart b/lib/features/settings/services/settings_service.g.dart index 8fc04b6a..f1d38de5 100644 --- a/lib/features/settings/services/settings_service.g.dart +++ b/lib/features/settings/services/settings_service.g.dart @@ -91,11 +91,12 @@ class _SettingsService implements SettingsService { @override Future updateProfileDetails( - {required ProfileDetailsModel profileDetailsModel}) async { + {required Map data}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; - const Map? _data = null; + final _data = {}; + _data.addAll(data); final _options = _setStreamType(Options( method: 'POST', headers: _headers, diff --git a/lib/old/diets/diet_edit_screen/diet_edit_screen.dart b/lib/old/diets/diet_edit_screen/diet_edit_screen.dart index 14888fcd..57b857b0 100644 --- a/lib/old/diets/diet_edit_screen/diet_edit_screen.dart +++ b/lib/old/diets/diet_edit_screen/diet_edit_screen.dart @@ -3,6 +3,7 @@ import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:rive/rive.dart'; import 'bloc/diet_edit_bloc.dart'; import 'models/diet_edit_model.dart'; @@ -78,7 +79,13 @@ class DietEditScreen extends StatelessWidget { backgroundImage: imageProvider, radius: 25, ), - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => CircleAvatar( child: Icon(Icons.person), backgroundColor: Colors.white, diff --git a/lib/old/diets/diet_select_screen/diet_select_screen.dart b/lib/old/diets/diet_select_screen/diet_select_screen.dart index 9f49dd52..b4e517c2 100644 --- a/lib/old/diets/diet_select_screen/diet_select_screen.dart +++ b/lib/old/diets/diet_select_screen/diet_select_screen.dart @@ -8,6 +8,7 @@ import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; import 'bloc/diet_select_bloc.dart'; import 'models/diet_select_model.dart'; @@ -27,7 +28,13 @@ class DietSelectScreen extends StatelessWidget { // Это начальное состояние, данные ещё не загружены. return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is DietSelectLoadedState) { @@ -37,7 +44,13 @@ class DietSelectScreen extends StatelessWidget { // Другие состояния, если они есть. return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } @@ -142,7 +155,13 @@ class DietSelectScreen extends StatelessWidget { backgroundImage: imageProvider, radius: 25, ), - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => CircleAvatar( child: Icon(Icons.person), backgroundColor: Colors.white, diff --git a/lib/old/diets/diet_show_screen/diet_show_screen.dart b/lib/old/diets/diet_show_screen/diet_show_screen.dart index d7132890..4339ccbc 100644 --- a/lib/old/diets/diet_show_screen/diet_show_screen.dart +++ b/lib/old/diets/diet_show_screen/diet_show_screen.dart @@ -5,6 +5,7 @@ import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; import 'bloc/diet_show_bloc.dart'; import 'models/diet_show_model.dart'; @@ -80,7 +81,13 @@ class DietScreen extends StatelessWidget { backgroundImage: imageProvider, radius: 25, ), - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => CircleAvatar( child: Icon(Icons.person), backgroundColor: Colors.white, diff --git a/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart b/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart index 694df40c..7669284a 100644 --- a/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart +++ b/lib/old/feed/blog_post_edit_screen/blog_post_edit_screen.dart @@ -3,6 +3,7 @@ import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:rive/rive.dart'; import 'bloc/blog_post_edit_bloc.dart'; import 'models/blog_post_edit_model.dart'; @@ -24,7 +25,13 @@ class BlogPostEditScreen extends StatelessWidget { if (state is BlogPostEditInitialState) { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is BlogPostEditLoadedState) { @@ -36,7 +43,13 @@ class BlogPostEditScreen extends StatelessWidget { } else { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } @@ -81,7 +94,13 @@ class BlogPostEditScreen extends StatelessWidget { backgroundImage: imageProvider, radius: 25, ), - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => CircleAvatar( child: Icon(Icons.person), backgroundColor: Colors.white, diff --git a/lib/old/feed/blog_post_screen/widgets/comment_widget.dart b/lib/old/feed/blog_post_screen/widgets/comment_widget.dart index 78db0293..da9f5dfb 100644 --- a/lib/old/feed/blog_post_screen/widgets/comment_widget.dart +++ b/lib/old/feed/blog_post_screen/widgets/comment_widget.dart @@ -8,6 +8,7 @@ import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_image_view.dart'; import 'package:flutter/material.dart'; +import 'package:rive/rive.dart'; class CommentWidget extends StatelessWidget { CommentWidget(this.commentModelObj, {Key? key}) @@ -48,7 +49,13 @@ class CommentWidget extends StatelessWidget { backgroundImage: imageProvider, radius: 25, ), - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => CircleAvatar( child: Icon(Icons.person), backgroundColor: Colors.white, diff --git a/lib/old/glossary/glossary_screen/glossary_screen.dart b/lib/old/glossary/glossary_screen/glossary_screen.dart index 25122ff5..aa07d867 100644 --- a/lib/old/glossary/glossary_screen/glossary_screen.dart +++ b/lib/old/glossary/glossary_screen/glossary_screen.dart @@ -9,6 +9,7 @@ import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:eatvio_app/widgets/custom_outlined_button.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:rive/rive.dart'; import 'bloc/glossary_screen_bloc.dart'; import 'models/glossary_screen_model.dart'; @@ -30,7 +31,13 @@ class GlossaryScreen extends StatelessWidget { // Это начальное состояние, данные ещё не загружены. return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is GlossaryLoadedState) { @@ -43,7 +50,13 @@ class GlossaryScreen extends StatelessWidget { // Другие состояния, если они есть. return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } @@ -250,7 +263,13 @@ class GlossaryScreen extends StatelessWidget { backgroundImage: imageProvider, radius: 25, ), - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => CircleAvatar( child: Icon(Icons.person), backgroundColor: Colors.white, diff --git a/lib/old/plans/plan_edit_screen/plan_edit_screen.dart b/lib/old/plans/plan_edit_screen/plan_edit_screen.dart index 40e2fd0c..31fbd435 100644 --- a/lib/old/plans/plan_edit_screen/plan_edit_screen.dart +++ b/lib/old/plans/plan_edit_screen/plan_edit_screen.dart @@ -3,6 +3,7 @@ import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:rive/rive.dart'; import 'bloc/plan_edit_bloc.dart'; import 'models/plan_edit_model.dart'; @@ -78,7 +79,13 @@ class PlanEditScreen extends StatelessWidget { backgroundImage: imageProvider, radius: 25, ), - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => CircleAvatar( child: Icon(Icons.person), backgroundColor: Colors.white, diff --git a/lib/old/plans/plan_select_screen/plan_select_screen.dart b/lib/old/plans/plan_select_screen/plan_select_screen.dart index 1e7decc6..991ffe24 100644 --- a/lib/old/plans/plan_select_screen/plan_select_screen.dart +++ b/lib/old/plans/plan_select_screen/plan_select_screen.dart @@ -8,6 +8,7 @@ import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; import 'bloc/plan_select_bloc.dart'; import 'models/plan_select_model.dart'; @@ -27,7 +28,13 @@ class PlanSelectScreen extends StatelessWidget { // Это начальное состояние, данные ещё не загружены. return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is PlanSelectLoadedState) { @@ -37,7 +44,13 @@ class PlanSelectScreen extends StatelessWidget { // Другие состояния, если они есть. return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } @@ -142,7 +155,13 @@ class PlanSelectScreen extends StatelessWidget { backgroundImage: imageProvider, radius: 25, ), - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => CircleAvatar( child: Icon(Icons.person), backgroundColor: Colors.white, diff --git a/lib/old/plans/plan_show_screen/plan_show_screen.dart b/lib/old/plans/plan_show_screen/plan_show_screen.dart index a2c9649a..f2467d2b 100644 --- a/lib/old/plans/plan_show_screen/plan_show_screen.dart +++ b/lib/old/plans/plan_show_screen/plan_show_screen.dart @@ -5,6 +5,7 @@ import 'package:eatvio_app/theme/custom_text_style.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; import 'bloc/plan_show_bloc.dart'; import 'models/plan_show_model.dart'; @@ -80,7 +81,13 @@ class PlanScreen extends StatelessWidget { backgroundImage: imageProvider, radius: 25, ), - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => CircleAvatar( child: Icon(Icons.person), backgroundColor: Colors.white, diff --git a/lib/old/profile/my_profile_screen/my_settings_screen.dart b/lib/old/profile/my_profile_screen/my_settings_screen.dart index 4b7a7740..9f3df67e 100644 --- a/lib/old/profile/my_profile_screen/my_settings_screen.dart +++ b/lib/old/profile/my_profile_screen/my_settings_screen.dart @@ -10,6 +10,7 @@ import 'package:eatvio_app/widgets/custom_section_title.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; import 'bloc/my_profile_bloc.dart'; import 'models/my_profile_model.dart'; @@ -29,7 +30,13 @@ class MySettingsScreen extends StatelessWidget { // Это начальное состояние, данные ещё не загружены. return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is MyProfileLoadedState) { @@ -39,7 +46,13 @@ class MySettingsScreen extends StatelessWidget { // Другие состояния, если они есть. return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } diff --git a/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart b/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart index 2677c64f..1318211a 100644 --- a/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart +++ b/lib/old/recipe/recipe_edit_screen/recipe_edit_screen.dart @@ -13,6 +13,7 @@ import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; import 'bloc/recipe_edit_bloc.dart'; import 'models/recipe_edit_model.dart'; @@ -155,7 +156,13 @@ class RecipeEditScreen extends StatelessWidget { // Установите ширину равной ширине родительского элемента height: 200.0, fit: BoxFit.cover, - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => Icon(Icons.error), ) else @@ -314,7 +321,13 @@ class RecipeEditScreen extends StatelessWidget { height: 200.0, // Задайте постоянную высоту элемента fit: BoxFit.cover, - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => Icon(Icons.error), ) else diff --git a/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart b/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart index 10c2f8ca..2d181146 100644 --- a/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart +++ b/lib/old/recipe/recipe_select_screen/recipe_select_screen.dart @@ -8,6 +8,7 @@ import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart'; import 'bloc/recipe_select_bloc.dart'; import 'models/recipe_select_model.dart'; @@ -26,7 +27,13 @@ class RecipeSelectScreen extends StatelessWidget { if (state is RecipeSelectInitialState) { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } else if (state is RecipeSelectLoadedState) { @@ -35,7 +42,13 @@ class RecipeSelectScreen extends StatelessWidget { } else { return Scaffold( body: Center( - child: CircularProgressIndicator(), + child: SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), ), ); } @@ -141,7 +154,13 @@ class RecipeSelectScreen extends StatelessWidget { backgroundImage: imageProvider, radius: 25, ), - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => CircleAvatar( child: Icon(Icons.person), backgroundColor: Colors.white, diff --git a/lib/old/users/subscribers_screen/subscribers_screen.dart b/lib/old/users/subscribers_screen/subscribers_screen.dart index 55cccb9b..adef5d67 100644 --- a/lib/old/users/subscribers_screen/subscribers_screen.dart +++ b/lib/old/users/subscribers_screen/subscribers_screen.dart @@ -10,6 +10,8 @@ import 'package:eatvio_app/widgets/custom_outlined_button.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:rive/rive.dart' as rive; +import 'package:rive/rive.dart'; import 'bloc/subscribers_bloc.dart'; import 'models/subscribers_model.dart'; @@ -26,9 +28,12 @@ class SubscribersScreen extends StatelessWidget { builder: (context, state) { if (state is SubscribersInitialState) { // Это начальное состояние, данные ещё не загружены. - return CircularProgressIndicator( - color: Colors.white, - backgroundColor: Colors.white, + return SizedBox( + height: 32, + width: 32, + child: rive.RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), ); } else if (state is SubscribersLoadedState) { // Данные загружены, можно строить экран. @@ -188,7 +193,13 @@ class SubscribersScreen extends StatelessWidget { backgroundImage: imageProvider, radius: 25, ), - placeholder: (context, url) => CircularProgressIndicator(), + placeholder: (context, url) => SizedBox( + height: 32, + width: 32, + child: RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), + ), errorWidget: (context, url, error) => CircleAvatar( child: Icon(Icons.person), backgroundColor: Colors.white, diff --git a/lib/widgets/custom_expandable_list.dart b/lib/widgets/custom_expandable_list.dart index 872a8fd5..dfda23f9 100644 --- a/lib/widgets/custom_expandable_list.dart +++ b/lib/widgets/custom_expandable_list.dart @@ -1,5 +1,5 @@ import 'dart:convert'; - +import 'package:rive/rive.dart' as rive; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/generated/l10n.dart'; @@ -56,9 +56,12 @@ class _ExpandableListState extends State { builder: (context, state) { if (state is MyProfileInitialState) { // Это начальное состояние, данные ещё не загружены. - return CircularProgressIndicator( - color: Colors.white, - backgroundColor: Colors.white, + return SizedBox( + height: 32, + width: 32, + child: rive.RiveAnimation.asset( + 'assets/rive_animations/loading.riv', + ), ); } else if (state is MyProfileLoadedState) { // Данные загружены, можно строить форму. diff --git a/lib/widgets/custom_text_form_field.dart b/lib/widgets/custom_text_form_field.dart index 81fb07b5..4c0b0005 100644 --- a/lib/widgets/custom_text_form_field.dart +++ b/lib/widgets/custom_text_form_field.dart @@ -90,7 +90,7 @@ class CustomTextFormField extends StatelessWidget { hintText: hintText ?? "", hintStyle: TextStyle( fontSize: 16, - color: Color(0xFF323F4B), + color: Colors.grey.shade400, fontWeight: FontWeight.w500, ), prefixIcon: prefix, From de30b93fa6e321b6f39ba1faab034fb5a3ab09f6 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 2 Oct 2024 13:10:21 +0300 Subject: [PATCH 28/31] feat: settings (data save) + new fields --- lib/app_router.dart | 23 +-- .../settings/entities/settings_entity.dart | 15 ++ .../bloc/settings_cubit/settings_cubit.dart | 12 +- .../pages/change_password_screen.dart | 28 ++++ .../pages/general_info_screen.dart | 105 ++++++++++---- .../presentation/pages/other_info_screen.dart | 37 +++-- .../pages/physical_activity_screen.dart | 20 ++- .../pages/physical_form_screen.dart | 27 ++-- .../presentation/pages/pressure_screen.dart | 37 ++--- .../presentation/pages/settings_screen.dart | 136 +++++++++++++++--- lib/widgets/custom_drop_down.dart | 15 +- 11 files changed, 338 insertions(+), 117 deletions(-) create mode 100644 lib/features/settings/entities/settings_entity.dart create mode 100644 lib/features/settings/presentation/pages/change_password_screen.dart diff --git a/lib/app_router.dart b/lib/app_router.dart index 7d97c634..e54fe2da 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -17,12 +17,13 @@ import 'package:eatvio_app/features/menu/presentation/pages/menu_screen.dart'; import 'package:eatvio_app/features/notifications/presentation/pages/notifications_screen.dart'; import 'package:eatvio_app/features/plans/models/plan_pagination_model.dart'; import 'package:eatvio_app/features/plans/presentation/pages/about_plan_screen.dart'; -import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:eatvio_app/features/profile/presentation/pages/profile_screen.dart'; import 'package:eatvio_app/features/recipes/presentation/pages/about_recipes_screen.dart'; import 'package:eatvio_app/features/recipes/presentation/pages/recipe_create_screen.dart'; import 'package:eatvio_app/features/recipes/presentation/pages/recipe_edit_screen.dart'; import 'package:eatvio_app/features/registration/presentation/pages/registration_screen.dart'; +import 'package:eatvio_app/features/settings/entities/settings_entity.dart'; +import 'package:eatvio_app/features/settings/presentation/pages/change_password_screen.dart'; import 'package:eatvio_app/features/settings/presentation/pages/general_info_screen.dart'; import 'package:eatvio_app/features/settings/presentation/pages/other_info_screen.dart'; import 'package:eatvio_app/features/settings/presentation/pages/physical_activity_screen.dart'; @@ -172,39 +173,45 @@ class AppRouter { builder: (context, state) => SettingsScreen(), routes: [ GoRoute( - path: 'general-info-screen/:isPublicProfile', + path: 'general-info-screen', name: 'generalInfoScreen', builder: (context, state) => GeneralInfoScreen( - profileDetailsModel: state.extra as ProfileDetailsModel, - isPublicProfile: bool.parse(state.pathParameters['isPublicProfile']!), + settingsEntity: state.extra as SettingsEntity, ), ), GoRoute( path: 'other-info-screen', name: 'otherInfoScreen', builder: (context, state) => OtherInfoScreen( - profileDetailsModel: state.extra as ProfileDetailsModel, + settingsEntity: state.extra as SettingsEntity, ), ), GoRoute( path: 'physical-activity-screen', name: 'physicalActivityScreen', builder: (context, state) => PhysicalActivityScreen( - profileDetailsModel: state.extra as ProfileDetailsModel, + settingsEntity: state.extra as SettingsEntity, ), ), GoRoute( path: 'physical-form-screen', name: 'physicalFormScreen', builder: (context, state) => PhysicalFormScreen( - profileDetailsModel: state.extra as ProfileDetailsModel, + settingsEntity: state.extra as SettingsEntity, ), ), GoRoute( path: 'pressure-screen', name: 'pressureScreen', builder: (context, state) => PressureScreen( - profileDetailsModel: state.extra as ProfileDetailsModel, + settingsEntity: state.extra as SettingsEntity, + ), + ), + GoRoute( + path: 'change-password-screen', + name: 'changePasswordScreen', + builder: (context, state) => ChangePasswordScreen( + settingsEntity: state.extra as SettingsEntity, ), ), ], diff --git a/lib/features/settings/entities/settings_entity.dart b/lib/features/settings/entities/settings_entity.dart new file mode 100644 index 00000000..4bd31ef3 --- /dev/null +++ b/lib/features/settings/entities/settings_entity.dart @@ -0,0 +1,15 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/settings/models/profile_settings_model.dart'; +import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart'; + +class SettingsEntity { + final ProfileSettingsModel profileSettingsModel; + final ProfileDetailsModel profileDetailsModel; + final SettingsCubit settingsCubit; + + SettingsEntity({ + required this.profileSettingsModel, + required this.profileDetailsModel, + required this.settingsCubit, + }); +} diff --git a/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart b/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart index c4c0287b..ce448c88 100644 --- a/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart +++ b/lib/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart @@ -12,9 +12,9 @@ class SettingsCubit extends Cubit { SettingsCubit({ required this.profileRepository, required this.settingsRepository, - }) : super(SettingsState.loading()); + }) : super(const SettingsState.loading()); - init() async { + Future init() async { try { emit(SettingsState.loaded( profileSettings: await settingsRepository.getProfileSettings(), @@ -26,7 +26,7 @@ class SettingsCubit extends Cubit { } updateProfileDetails({ - required ProfileDetailsModel profileDetailsModel + required ProfileDetailsModel profileDetailsModel, }) async { try { await settingsRepository.updateProfileDetails( @@ -35,11 +35,13 @@ class SettingsCubit extends Cubit { } catch (e) { print(e); rethrow; + } finally { + await init(); } } updateProfileSettings({ - required ProfileSettingsModel profileSettingsModel + required ProfileSettingsModel profileSettingsModel, }) async { try { await settingsRepository.updateProfileSettings( @@ -48,6 +50,8 @@ class SettingsCubit extends Cubit { } catch (e) { print(e); rethrow; + } finally { + await init(); } } } diff --git a/lib/features/settings/presentation/pages/change_password_screen.dart b/lib/features/settings/presentation/pages/change_password_screen.dart new file mode 100644 index 00000000..b67df070 --- /dev/null +++ b/lib/features/settings/presentation/pages/change_password_screen.dart @@ -0,0 +1,28 @@ +import 'package:eatvio_app/features/settings/entities/settings_entity.dart'; +import 'package:flutter/material.dart'; + +class ChangePasswordScreen extends StatefulWidget { + final SettingsEntity settingsEntity; + + const ChangePasswordScreen({ + super.key, + required this.settingsEntity, + }); + + @override + State createState() => _ChangePasswordScreenState(); +} + +class _ChangePasswordScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Смена пароля'), + ), + body: Center( + child: Text('Coming soon...'), + ), + ); + } +} diff --git a/lib/features/settings/presentation/pages/general_info_screen.dart b/lib/features/settings/presentation/pages/general_info_screen.dart index 109e584c..4ad9e084 100644 --- a/lib/features/settings/presentation/pages/general_info_screen.dart +++ b/lib/features/settings/presentation/pages/general_info_screen.dart @@ -1,20 +1,21 @@ import 'package:eatvio_app/core/utils/date_time_utils.dart'; -import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; +import 'package:eatvio_app/features/settings/entities/settings_entity.dart'; +import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; +import 'package:eatvio_app/widgets/custom_drop_down.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class GeneralInfoScreen extends StatefulWidget { - final ProfileDetailsModel profileDetailsModel; - final bool isPublicProfile; + final SettingsEntity settingsEntity; const GeneralInfoScreen({ super.key, - required this.profileDetailsModel, - required this.isPublicProfile, + required this.settingsEntity, }); @override @@ -24,25 +25,36 @@ class GeneralInfoScreen extends StatefulWidget { class _GeneralInfoScreenState extends State { final firstNameController = TextEditingController(); final lastNameController = TextEditingController(); - final genderController = TextEditingController(); + late DateTime selectedDate; + late SelectionPopupModel gender; final countryController = TextEditingController(); final cityController = TextEditingController(); final languageController = TextEditingController(); - late DateTime selectedDate; - late bool isPublicProfile; + late SelectionPopupModel isPublicProfile; + + final List genderSelectionPopupList = [ + SelectionPopupModel(id: 0, title: 'Женский', value: 'female'), + SelectionPopupModel(id: 1, title: 'Мужской', value: 'male'), + ]; + + final List isPublicProfileSelectionPopupList = [ + SelectionPopupModel(id: 0, title: 'Только зарегистрированным', value: false), + SelectionPopupModel(id: 1, title: 'Всем', value: true), + ]; @override void initState() { super.initState(); selectedDate = DateTime.now(); - firstNameController.text = widget.profileDetailsModel.firstName; - lastNameController.text = widget.profileDetailsModel.lastName; - selectedDate = DateTime.parse(widget.profileDetailsModel.birthdate); - genderController.text = widget.profileDetailsModel.gender; - countryController.text = widget.profileDetailsModel.country; - cityController.text = widget.profileDetailsModel.city; - languageController.text = widget.profileDetailsModel.lang; - isPublicProfile = widget.isPublicProfile; + firstNameController.text = widget.settingsEntity.profileDetailsModel.firstName; + lastNameController.text = widget.settingsEntity.profileDetailsModel.lastName; + selectedDate = DateTime.parse(widget.settingsEntity.profileDetailsModel.birthdate); + gender = widget.settingsEntity.profileDetailsModel.gender == 'male' ? genderSelectionPopupList[1] : genderSelectionPopupList[0]; + countryController.text = widget.settingsEntity.profileDetailsModel.country; + cityController.text = widget.settingsEntity.profileDetailsModel.city; + languageController.text = widget.settingsEntity.profileDetailsModel.lang; + isPublicProfile = + widget.settingsEntity.profileSettingsModel.isPublicProfile == true ? isPublicProfileSelectionPopupList[1] : isPublicProfileSelectionPopupList[0]; } @override @@ -78,43 +90,60 @@ class _GeneralInfoScreenState extends State { SizedBox(height: 16), Text(s.date_of_birth), SizedBox(height: 4), - CustomTextFormField( - initialValue: selectedDate.format('dd MMMM yyyy', 'ru'), + ListTile( + onTap: onTapCalendar(context), + trailing: Icon( + Icons.keyboard_arrow_down_rounded, + color: Colors.grey.shade700, + ), + contentPadding: EdgeInsets.symmetric(horizontal: 12), + title: Text(selectedDate.format('dd MMMM yyyy', 'ru')), + tileColor: Color(0xFFF6F6F6), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20), + ), ), SizedBox(height: 16), Text('Пол'), SizedBox(height: 4), - CustomTextFormField( - controller: genderController, - onChanged: (newValue) {}, + CustomDropDown( + items: genderSelectionPopupList, + value: gender, + onChanged: (newValue) { + setState(() { + gender = newValue; + }); + }, ), SizedBox(height: 16), Text('Страна'), SizedBox(height: 4), CustomTextFormField( controller: countryController, - onChanged: (newValue) {}, ), SizedBox(height: 16), Text('Город'), SizedBox(height: 4), CustomTextFormField( controller: cityController, - onChanged: (newValue) {}, ), SizedBox(height: 16), Text('Предпочтительный язык общения'), SizedBox(height: 4), CustomTextFormField( controller: languageController, - onChanged: (newValue) {}, ), SizedBox(height: 16), Text('Показывать анкету'), SizedBox(height: 4), - CustomTextFormField( - initialValue: isPublicProfile ? 'Всем' : 'Только зарегистрированным', - onChanged: (newValue) {}, + CustomDropDown( + items: isPublicProfileSelectionPopupList, + value: isPublicProfile, + onChanged: (newValue) { + setState(() { + isPublicProfile = newValue; + }); + }, ), ], ), @@ -133,8 +162,6 @@ class _GeneralInfoScreenState extends State { onDateTimeChanged: (DateTime newDateTime) { setState(() { selectedDate = newDateTime; - // final registrationCubit = context.read(); - // registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(birthdate: selectedDate.toString())); }); }, ), @@ -162,7 +189,25 @@ class _GeneralInfoScreenState extends State { _saveButton() { return InkWell( - onTap: () => GoRouter.of(context).pop(), + onTap: () { + widget.settingsEntity.settingsCubit.updateProfileDetails( + profileDetailsModel: (widget.settingsEntity.settingsCubit.state as SettingsStateLoaded).profileDetails.copyWith( + firstName: firstNameController.text, + lastName: lastNameController.text, + birthdate: selectedDate.toString(), + gender: gender.value, + country: countryController.text, + city: cityController.text, + lang: languageController.text, + ), + ); + widget.settingsEntity.settingsCubit.updateProfileSettings( + profileSettingsModel: (widget.settingsEntity.settingsCubit.state as SettingsStateLoaded).profileSettings.copyWith( + isPublicProfile: isPublicProfile.value, + ), + ); + GoRouter.of(context).pop(); + }, borderRadius: BorderRadius.circular(20), child: Ink( height: 52, diff --git a/lib/features/settings/presentation/pages/other_info_screen.dart b/lib/features/settings/presentation/pages/other_info_screen.dart index 4501a9f6..2799b853 100644 --- a/lib/features/settings/presentation/pages/other_info_screen.dart +++ b/lib/features/settings/presentation/pages/other_info_screen.dart @@ -1,4 +1,5 @@ -import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/settings/entities/settings_entity.dart'; +import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; @@ -6,11 +7,11 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class OtherInfoScreen extends StatefulWidget { - final ProfileDetailsModel profileDetailsModel; + final SettingsEntity settingsEntity; const OtherInfoScreen({ super.key, - required this.profileDetailsModel, + required this.settingsEntity, }); @override @@ -22,18 +23,18 @@ class _OtherInfoScreenState extends State { final aboutTakingPillsController = TextEditingController(); final aboutSportHobbiesController = TextEditingController(); final favoriteFoodsController = TextEditingController(); - final unfavouriteFoodsController = TextEditingController(); + final unFavouriteFoodsController = TextEditingController(); final additionalInfoController = TextEditingController(); @override void initState() { super.initState(); - aboutAllergyController.text = widget.profileDetailsModel.aboutAlergy; - aboutTakingPillsController.text = widget.profileDetailsModel.aboutTakingPils; - aboutSportHobbiesController.text = widget.profileDetailsModel.aboutSportHobbies; - favoriteFoodsController.text = widget.profileDetailsModel.favoriteFoods; - unfavouriteFoodsController.text = widget.profileDetailsModel.unfavoriteFoods; - additionalInfoController.text = widget.profileDetailsModel.additionalInfo; + aboutAllergyController.text = widget.settingsEntity.profileDetailsModel.aboutAlergy; + aboutTakingPillsController.text = widget.settingsEntity.profileDetailsModel.aboutTakingPils; + aboutSportHobbiesController.text = widget.settingsEntity.profileDetailsModel.aboutSportHobbies; + favoriteFoodsController.text = widget.settingsEntity.profileDetailsModel.favoriteFoods; + unFavouriteFoodsController.text = widget.settingsEntity.profileDetailsModel.unfavoriteFoods; + additionalInfoController.text = widget.settingsEntity.profileDetailsModel.additionalInfo; } @override @@ -96,7 +97,7 @@ class _OtherInfoScreenState extends State { Text(s.unfavorite_foods), SizedBox(height: 4), CustomTextFormField( - controller: unfavouriteFoodsController, + controller: unFavouriteFoodsController, hintText: s.enter_information, maxLines: 7, minLines: 2, @@ -124,7 +125,19 @@ class _OtherInfoScreenState extends State { _saveButton() { return InkWell( - onTap: () => GoRouter.of(context).pop(), + onTap: () { + widget.settingsEntity.settingsCubit.updateProfileDetails( + profileDetailsModel: (widget.settingsEntity.settingsCubit.state as SettingsStateLoaded).profileDetails.copyWith( + aboutAlergy: aboutAllergyController.text, + aboutTakingPils: aboutTakingPillsController.text, + aboutSportHobbies: aboutSportHobbiesController.text, + favoriteFoods: favoriteFoodsController.text, + unfavoriteFoods: unFavouriteFoodsController.text, + additionalInfo: additionalInfoController.text, + ), + ); + GoRouter.of(context).pop(); + }, borderRadius: BorderRadius.circular(20), child: Ink( height: 52, diff --git a/lib/features/settings/presentation/pages/physical_activity_screen.dart b/lib/features/settings/presentation/pages/physical_activity_screen.dart index 536009c2..22781421 100644 --- a/lib/features/settings/presentation/pages/physical_activity_screen.dart +++ b/lib/features/settings/presentation/pages/physical_activity_screen.dart @@ -1,17 +1,15 @@ -import 'package:eatvio_app/features/profile/models/profile_model.dart'; -import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart'; +import 'package:eatvio_app/features/settings/entities/settings_entity.dart'; import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; -import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class PhysicalActivityScreen extends StatefulWidget { - final ProfileDetailsModel profileDetailsModel; + final SettingsEntity settingsEntity; const PhysicalActivityScreen({ super.key, - required this.profileDetailsModel, + required this.settingsEntity, }); @override @@ -26,7 +24,7 @@ class _PhysicalActivityScreenState extends State { @override void initState() { super.initState(); - switch (widget.profileDetailsModel.activityCoefficient) { + switch (widget.settingsEntity.profileDetailsModel.activityCoefficient) { case 1.2: _physicalActivity = PhysicalActivity.minimum; break; @@ -141,11 +139,11 @@ class _PhysicalActivityScreenState extends State { default: break; } - sl().updateProfileDetails( - profileDetailsModel: (sl().state as SettingsStateLoaded).profileDetails.copyWith( - activityCoefficient: activityCoefficient, - ), - ); + widget.settingsEntity.settingsCubit.updateProfileDetails( + profileDetailsModel: (widget.settingsEntity.settingsCubit.state as SettingsStateLoaded).profileDetails.copyWith( + activityCoefficient: activityCoefficient, + ), + ); GoRouter.of(context).pop(); }, borderRadius: BorderRadius.circular(20), diff --git a/lib/features/settings/presentation/pages/physical_form_screen.dart b/lib/features/settings/presentation/pages/physical_form_screen.dart index d45a8367..4bd34b94 100644 --- a/lib/features/settings/presentation/pages/physical_form_screen.dart +++ b/lib/features/settings/presentation/pages/physical_form_screen.dart @@ -1,4 +1,5 @@ -import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/settings/entities/settings_entity.dart'; +import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; @@ -7,11 +8,11 @@ import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; class PhysicalFormScreen extends StatefulWidget { - final ProfileDetailsModel profileDetailsModel; + final SettingsEntity settingsEntity; const PhysicalFormScreen({ super.key, - required this.profileDetailsModel, + required this.settingsEntity, }); @override @@ -28,10 +29,10 @@ class _PhysicalFormScreenState extends State { @override void initState() { super.initState(); - chestCircumferenceController.text = widget.profileDetailsModel.chestCircumference.toString(); - waistCircumferenceController.text = widget.profileDetailsModel.waistCircumference.toString(); - hipCircumferenceController.text = widget.profileDetailsModel.hipCircumference.toString(); - heightController.text = widget.profileDetailsModel.height.toString(); + chestCircumferenceController.text = widget.settingsEntity.profileDetailsModel.chestCircumference.toString(); + waistCircumferenceController.text = widget.settingsEntity.profileDetailsModel.waistCircumference.toString(); + hipCircumferenceController.text = widget.settingsEntity.profileDetailsModel.hipCircumference.toString(); + heightController.text = widget.settingsEntity.profileDetailsModel.height.toString(); } @override @@ -90,7 +91,17 @@ class _PhysicalFormScreenState extends State { _saveButton() { return InkWell( - onTap: () => GoRouter.of(context).pop(), + onTap: () { + widget.settingsEntity.settingsCubit.updateProfileDetails( + profileDetailsModel: (widget.settingsEntity.settingsCubit.state as SettingsStateLoaded).profileDetails.copyWith( + chestCircumference: int.parse(chestCircumferenceController.text), + waistCircumference: int.parse(waistCircumferenceController.text), + hipCircumference: int.parse(hipCircumferenceController.text), + height: int.parse(heightController.text), + ), + ); + GoRouter.of(context).pop(); + }, borderRadius: BorderRadius.circular(20), child: Ink( height: 52, diff --git a/lib/features/settings/presentation/pages/pressure_screen.dart b/lib/features/settings/presentation/pages/pressure_screen.dart index 62d4ce8a..7c1ee72a 100644 --- a/lib/features/settings/presentation/pages/pressure_screen.dart +++ b/lib/features/settings/presentation/pages/pressure_screen.dart @@ -1,5 +1,6 @@ import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart'; -import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:eatvio_app/features/settings/entities/settings_entity.dart'; +import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:eatvio_app/widgets/custom_drop_down.dart'; @@ -9,11 +10,11 @@ import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; class PressureScreen extends StatefulWidget { - final ProfileDetailsModel profileDetailsModel; + final SettingsEntity settingsEntity; const PressureScreen({ super.key, - required this.profileDetailsModel, + required this.settingsEntity, }); @override @@ -30,21 +31,15 @@ class _PressureScreenState extends State { @override void initState() { super.initState(); - bloodPressureUpController.text = widget.profileDetailsModel.bloodPressureUp.toString(); - bloodPressureDownController.text = widget.profileDetailsModel.bloodPressureDown.toString(); - hypo = widget.profileDetailsModel.hasHypo ? selectionPopupList[0] : selectionPopupList[1]; - hyper = widget.profileDetailsModel.hasHyper ? selectionPopupList[0] : selectionPopupList[1]; + bloodPressureUpController.text = widget.settingsEntity.profileDetailsModel.bloodPressureUp.toString(); + bloodPressureDownController.text = widget.settingsEntity.profileDetailsModel.bloodPressureDown.toString(); + hypo = widget.settingsEntity.profileDetailsModel.hasHypo ? selectionPopupList[1] : selectionPopupList[0]; + hyper = widget.settingsEntity.profileDetailsModel.hasHyper ? selectionPopupList[1] : selectionPopupList[0]; } final List selectionPopupList = [ - SelectionPopupModel( - id: 1, - title: "Да", - ), - SelectionPopupModel( - id: 0, - title: "Нет", - ), + SelectionPopupModel(id: 0, title: 'Нет', value: false), + SelectionPopupModel(id: 1, title: 'Да', value: true), ]; @override @@ -113,7 +108,17 @@ class _PressureScreenState extends State { _saveButton() { return InkWell( - onTap: () => GoRouter.of(context).pop(), + onTap: () { + widget.settingsEntity.settingsCubit.updateProfileDetails( + profileDetailsModel: (widget.settingsEntity.settingsCubit.state as SettingsStateLoaded).profileDetails.copyWith( + bloodPressureUp: int.parse(bloodPressureUpController.text), + bloodPressureDown: int.parse(bloodPressureDownController.text), + hasHyper: hyper.value, + hasHypo: hypo.value, + ), + ); + GoRouter.of(context).pop(); + }, borderRadius: BorderRadius.circular(20), child: Ink( height: 52, diff --git a/lib/features/settings/presentation/pages/settings_screen.dart b/lib/features/settings/presentation/pages/settings_screen.dart index 1072c270..9c1e7b34 100644 --- a/lib/features/settings/presentation/pages/settings_screen.dart +++ b/lib/features/settings/presentation/pages/settings_screen.dart @@ -1,4 +1,5 @@ import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/features/settings/entities/settings_entity.dart'; import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart'; import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_state.dart'; import 'package:eatvio_app/locator_service.dart'; @@ -18,18 +19,24 @@ class SettingsScreen extends StatefulWidget { } class _SettingsScreenState extends State { + final SettingsCubit settingsCubit = sl()..init(); late bool updatesNotificationsSwitchState; late bool fillDiaryNotificationsSwitchState; + late bool bedTimeSwitchState; + late bool moodSwitchState; @override Widget build(BuildContext context) { return BlocProvider( - create: (BuildContext context) => sl()..init(), + create: (BuildContext context) => settingsCubit, child: BlocConsumer( + bloc: settingsCubit, listener: (BuildContext context, SettingsState state) { if (state is SettingsStateLoaded) { updatesNotificationsSwitchState = state.profileSettings.newUpdatesNotifications == 1 ? true : false; fillDiaryNotificationsSwitchState = state.profileSettings.diaryReminderNotifications == 1 ? true : false; + bedTimeSwitchState = state.profileSettings.isBedtimeFillable == 1 ? true : false; + moodSwitchState = state.profileSettings.isMoodFillable == 1 ? true : false; } }, builder: (BuildContext context, SettingsState state) { @@ -100,10 +107,11 @@ class _SettingsScreenState extends State { _tile( onTap: () => GoRouter.of(context).pushNamed( 'generalInfoScreen', - extra: state.profileDetails, - pathParameters: { - 'isPublicProfile': state.profileSettings.isPublicProfile.toString(), - }, + extra: SettingsEntity( + profileSettingsModel: state.profileSettings, + profileDetailsModel: state.profileDetails, + settingsCubit: settingsCubit, + ), ), title: 'Общая информация', ), @@ -111,7 +119,11 @@ class _SettingsScreenState extends State { _tile( onTap: () => GoRouter.of(context).pushNamed( 'physicalFormScreen', - extra: state.profileDetails, + extra: SettingsEntity( + profileSettingsModel: state.profileSettings, + profileDetailsModel: state.profileDetails, + settingsCubit: settingsCubit, + ), ), title: 'Физическая форма', ), @@ -119,7 +131,11 @@ class _SettingsScreenState extends State { _tile( onTap: () => GoRouter.of(context).pushNamed( 'pressureScreen', - extra: state.profileDetails, + extra: SettingsEntity( + profileSettingsModel: state.profileSettings, + profileDetailsModel: state.profileDetails, + settingsCubit: settingsCubit, + ), ), title: 'Давление', ), @@ -127,7 +143,11 @@ class _SettingsScreenState extends State { _tile( onTap: () => GoRouter.of(context).pushNamed( 'otherInfoScreen', - extra: state.profileDetails, + extra: SettingsEntity( + profileSettingsModel: state.profileSettings, + profileDetailsModel: state.profileDetails, + settingsCubit: settingsCubit, + ), ), title: 'Прочая информация', ), @@ -135,10 +155,26 @@ class _SettingsScreenState extends State { _tile( onTap: () => GoRouter.of(context).pushNamed( 'physicalActivityScreen', - extra: state.profileDetails, + extra: SettingsEntity( + profileSettingsModel: state.profileSettings, + profileDetailsModel: state.profileDetails, + settingsCubit: settingsCubit, + ), ), title: 'Физическая нагрузка', ), + _divider(context), + _tile( + onTap: () => GoRouter.of(context).pushNamed( + 'changePasswordScreen', + extra: SettingsEntity( + profileSettingsModel: state.profileSettings, + profileDetailsModel: state.profileDetails, + settingsCubit: settingsCubit, + ), + ), + title: 'Сменить пароль', + ), ], ); } @@ -163,11 +199,11 @@ class _SettingsScreenState extends State { setState(() { updatesNotificationsSwitchState = !updatesNotificationsSwitchState; }); - context.read().updateProfileSettings( - profileSettingsModel: state.profileSettings.copyWith( + settingsCubit.updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( newUpdatesNotifications: updatesNotificationsSwitchState, ), - ); + ); }, title: 'Уведомление о новых обновлениях', trailing: CupertinoSwitch( @@ -177,11 +213,11 @@ class _SettingsScreenState extends State { setState(() { updatesNotificationsSwitchState = newValue; }); - context.read().updateProfileSettings( - profileSettingsModel: state.profileSettings.copyWith( + settingsCubit.updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( newUpdatesNotifications: updatesNotificationsSwitchState, ), - ); + ); }, ), ), @@ -191,11 +227,11 @@ class _SettingsScreenState extends State { setState(() { fillDiaryNotificationsSwitchState = !fillDiaryNotificationsSwitchState; }); - context.read().updateProfileSettings( - profileSettingsModel: state.profileSettings.copyWith( + settingsCubit.updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( diaryReminderNotifications: fillDiaryNotificationsSwitchState, ), - ); + ); }, title: 'Напоминание о заполнении дневника', trailing: CupertinoSwitch( @@ -205,11 +241,67 @@ class _SettingsScreenState extends State { setState(() { fillDiaryNotificationsSwitchState = newValue; }); - context.read().updateProfileSettings( - profileSettingsModel: state.profileSettings.copyWith( + settingsCubit.updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( diaryReminderNotifications: fillDiaryNotificationsSwitchState, ), - ); + ); + }, + ), + ), + _divider(context), + _tile( + onTap: () { + setState(() { + moodSwitchState = !moodSwitchState; + }); + settingsCubit.updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( + isMoodFillable: moodSwitchState, + ), + ); + }, + title: 'Указывать “настроение” в заполнение дневника', + trailing: CupertinoSwitch( + value: moodSwitchState, + activeColor: appTheme.blueA400, + onChanged: (newValue) { + setState(() { + moodSwitchState = newValue; + }); + settingsCubit.updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( + isMoodFillable: moodSwitchState, + ), + ); + }, + ), + ), + _divider(context), + _tile( + onTap: () { + setState(() { + bedTimeSwitchState = !bedTimeSwitchState; + }); + settingsCubit.updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( + isBedtimeFillable: bedTimeSwitchState, + ), + ); + }, + title: 'Указывать “отход ко сну” в заполнение дневника', + trailing: CupertinoSwitch( + value: bedTimeSwitchState, + activeColor: appTheme.blueA400, + onChanged: (newValue) { + setState(() { + bedTimeSwitchState = newValue; + }); + settingsCubit.updateProfileSettings( + profileSettingsModel: state.profileSettings.copyWith( + isBedtimeFillable: bedTimeSwitchState, + ), + ); }, ), ), @@ -264,7 +356,6 @@ class _SettingsScreenState extends State { style: TextStyle( color: Colors.white, height: 1, - fontWeight: FontWeight.w600, fontSize: 18, ), ), @@ -293,7 +384,6 @@ class _SettingsScreenState extends State { style: TextStyle( color: Colors.black, height: 1, - fontWeight: FontWeight.w600, fontSize: 18, ), ), diff --git a/lib/widgets/custom_drop_down.dart b/lib/widgets/custom_drop_down.dart index a68a696f..7522893a 100644 --- a/lib/widgets/custom_drop_down.dart +++ b/lib/widgets/custom_drop_down.dart @@ -64,11 +64,11 @@ class CustomDropDown extends StatelessWidget { value: value, isDense: true, isExpanded: true, - style: textStyle ?? - TextStyle( - fontSize: 16, - fontWeight: FontWeight.w400, - ), + style: TextStyle( + fontSize: 16, + color: Colors.black, + fontWeight: FontWeight.w400, + ), items: items?.map((SelectionPopupModel item) { return DropdownMenuItem( value: item, @@ -95,6 +95,11 @@ class CustomDropDown extends StatelessWidget { InputDecoration _buildInputDecoration(BuildContext context) { return InputDecoration( + labelStyle: TextStyle( + fontSize: 16, + color: Colors.black, + fontWeight: FontWeight.w400, + ), hintText: hintText ?? "", hintStyle: hintStyle ?? TextStyle( From 344c3b6598075db3e01d52980a02f49104d12de8 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 2 Oct 2024 13:14:48 +0300 Subject: [PATCH 29/31] fix: settings fields --- lib/features/settings/presentation/pages/settings_screen.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/features/settings/presentation/pages/settings_screen.dart b/lib/features/settings/presentation/pages/settings_screen.dart index 9c1e7b34..dee57f62 100644 --- a/lib/features/settings/presentation/pages/settings_screen.dart +++ b/lib/features/settings/presentation/pages/settings_screen.dart @@ -35,8 +35,8 @@ class _SettingsScreenState extends State { if (state is SettingsStateLoaded) { updatesNotificationsSwitchState = state.profileSettings.newUpdatesNotifications == 1 ? true : false; fillDiaryNotificationsSwitchState = state.profileSettings.diaryReminderNotifications == 1 ? true : false; - bedTimeSwitchState = state.profileSettings.isBedtimeFillable == 1 ? true : false; - moodSwitchState = state.profileSettings.isMoodFillable == 1 ? true : false; + bedTimeSwitchState = state.profileSettings.isBedtimeFillable; + moodSwitchState = state.profileSettings.isMoodFillable; } }, builder: (BuildContext context, SettingsState state) { From 09d9811153cab185b06f5aa94f5705103223d248 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 2 Oct 2024 13:17:44 +0300 Subject: [PATCH 30/31] fix: settings physical activity padding --- .../pages/physical_activity_screen.dart | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/features/settings/presentation/pages/physical_activity_screen.dart b/lib/features/settings/presentation/pages/physical_activity_screen.dart index 22781421..7718403d 100644 --- a/lib/features/settings/presentation/pages/physical_activity_screen.dart +++ b/lib/features/settings/presentation/pages/physical_activity_screen.dart @@ -52,11 +52,11 @@ class _PhysicalActivityScreenState extends State { bottomSheet: _saveButton(), body: SingleChildScrollView( physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.only(top: 16, bottom: 80, left: 8, right: 16), + padding: const EdgeInsets.only(top: 16, bottom: 80), child: Column( children: [ RadioListTile( - contentPadding: EdgeInsets.zero, + contentPadding: EdgeInsets.only(left: 8, right: 16), title: const Text('1,2 — минимальный (сидячая работа, отсутствие физических нагрузок);'), value: PhysicalActivity.minimum, groupValue: _physicalActivity, @@ -67,7 +67,7 @@ class _PhysicalActivityScreenState extends State { }, ), RadioListTile( - contentPadding: EdgeInsets.zero, + contentPadding: EdgeInsets.only(left: 8, right: 16), title: const Text('1,375 — низкий (тренировки не менее 20 мин 1–3 раза в неделю);'), value: PhysicalActivity.low, groupValue: _physicalActivity, @@ -78,7 +78,7 @@ class _PhysicalActivityScreenState extends State { }, ), RadioListTile( - contentPadding: EdgeInsets.zero, + contentPadding: EdgeInsets.only(left: 8, right: 16), title: const Text('1,55 — умеренный (тренировки 30–60 мин 3–4 раза в неделю);'), value: PhysicalActivity.medium, groupValue: _physicalActivity, @@ -89,7 +89,7 @@ class _PhysicalActivityScreenState extends State { }, ), RadioListTile( - contentPadding: EdgeInsets.zero, + contentPadding: EdgeInsets.only(left: 8, right: 16), title: const Text('1,7 — высокий (тренировки 30–60 мин 5–7 раза в неделю; тяжёлая физическая работа);'), value: PhysicalActivity.high, groupValue: _physicalActivity, @@ -100,7 +100,7 @@ class _PhysicalActivityScreenState extends State { }, ), RadioListTile( - contentPadding: EdgeInsets.zero, + contentPadding: EdgeInsets.only(left: 8, right: 16), title: const Text('1,9 — экстремальный (несколько интенсивных тренировок в день'), value: PhysicalActivity.extreme, groupValue: _physicalActivity, @@ -140,10 +140,10 @@ class _PhysicalActivityScreenState extends State { break; } widget.settingsEntity.settingsCubit.updateProfileDetails( - profileDetailsModel: (widget.settingsEntity.settingsCubit.state as SettingsStateLoaded).profileDetails.copyWith( - activityCoefficient: activityCoefficient, - ), - ); + profileDetailsModel: (widget.settingsEntity.settingsCubit.state as SettingsStateLoaded).profileDetails.copyWith( + activityCoefficient: activityCoefficient, + ), + ); GoRouter.of(context).pop(); }, borderRadius: BorderRadius.circular(20), From f12bdc84020b795cf39d58d943575652027ba67e Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 2 Oct 2024 13:20:20 +0300 Subject: [PATCH 31/31] fix: settings switches padding --- .../settings/presentation/pages/settings_screen.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/features/settings/presentation/pages/settings_screen.dart b/lib/features/settings/presentation/pages/settings_screen.dart index dee57f62..0a18843f 100644 --- a/lib/features/settings/presentation/pages/settings_screen.dart +++ b/lib/features/settings/presentation/pages/settings_screen.dart @@ -195,6 +195,7 @@ class _SettingsScreenState extends State { ), ), _tile( + padding: EdgeInsets.symmetric(horizontal: 16), onTap: () { setState(() { updatesNotificationsSwitchState = !updatesNotificationsSwitchState; @@ -223,6 +224,7 @@ class _SettingsScreenState extends State { ), _divider(context), _tile( + padding: EdgeInsets.symmetric(horizontal: 16), onTap: () { setState(() { fillDiaryNotificationsSwitchState = !fillDiaryNotificationsSwitchState; @@ -251,6 +253,7 @@ class _SettingsScreenState extends State { ), _divider(context), _tile( + padding: EdgeInsets.symmetric(horizontal: 16), onTap: () { setState(() { moodSwitchState = !moodSwitchState; @@ -279,6 +282,7 @@ class _SettingsScreenState extends State { ), _divider(context), _tile( + padding: EdgeInsets.symmetric(horizontal: 16), onTap: () { setState(() { bedTimeSwitchState = !bedTimeSwitchState; @@ -397,8 +401,10 @@ class _SettingsScreenState extends State { required String title, required Function() onTap, Widget? trailing, + EdgeInsets? padding, }) { return ListTile( + contentPadding: padding, onTap: onTap, title: Text( title,