diff --git a/lib/core/initialization_cubit/initialization_state.freezed.dart b/lib/core/initialization_cubit/initialization_state.freezed.dart index 3364e440..b0535c68 100644 --- a/lib/core/initialization_cubit/initialization_state.freezed.dart +++ b/lib/core/initialization_cubit/initialization_state.freezed.dart @@ -84,6 +84,9 @@ class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + /// Create a copy of InitializationState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -100,6 +103,9 @@ class __$$InitializationStateImplCopyWithImpl<$Res> __$$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. } /// @nodoc @@ -218,6 +224,9 @@ class __$$InitializationStateLoadingImplCopyWithImpl<$Res> _$InitializationStateLoadingImpl _value, $Res Function(_$InitializationStateLoadingImpl) _then) : super(_value, _then); + + /// Create a copy of InitializationState + /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -339,6 +348,8 @@ class __$$InitializationStateSuccessImplCopyWithImpl<$Res> $Res Function(_$InitializationStateSuccessImpl) _then) : super(_value, _then); + /// Create a copy of InitializationState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -377,7 +388,9 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @override int get hashCode => Object.hash(runtimeType, client); - @JsonKey(ignore: true) + /// Create a copy of InitializationState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> @@ -465,7 +478,10 @@ abstract class InitializationStateSuccess implements InitializationState { _$InitializationStateSuccessImpl; PusherChannelsClient get client; - @JsonKey(ignore: true) + + /// 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; } @@ -490,6 +506,8 @@ class __$$InitializationStateErrorImplCopyWithImpl<$Res> $Res Function(_$InitializationStateErrorImpl) _then) : super(_value, _then); + /// Create a copy of InitializationState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -529,7 +547,9 @@ class _$InitializationStateErrorImpl implements InitializationStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - @JsonKey(ignore: true) + /// Create a copy of InitializationState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> @@ -616,7 +636,10 @@ abstract class InitializationStateError implements InitializationState { _$InitializationStateErrorImpl; String get errorMessage; - @JsonKey(ignore: true) + + /// 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; } diff --git a/lib/core/models/base_models.dart b/lib/core/models/base_models.dart index 2293cb9f..1f6e04d5 100644 --- a/lib/core/models/base_models.dart +++ b/lib/core/models/base_models.dart @@ -22,7 +22,7 @@ class Meta with _$Meta { @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: "path") String? path, @JsonKey(name: "per_page") required int perPage, @JsonKey(name: "to") required dynamic to, @JsonKey(name: "total") required int total, @@ -34,9 +34,9 @@ class Meta with _$Meta { @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, + @JsonKey(name: "url") String? url, + @JsonKey(name: "label") String? label, + @JsonKey(name: "active") 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 index 6571812b..8abf29f4 100644 --- a/lib/core/models/base_models.freezed.dart +++ b/lib/core/models/base_models.freezed.dart @@ -29,8 +29,12 @@ mixin _$Links { @JsonKey(name: "next") dynamic get next => throw _privateConstructorUsedError; + /// Serializes this Links to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Links + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $LinksCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -56,6 +60,8 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Links + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -107,6 +113,8 @@ class __$$LinksImplCopyWithImpl<$Res> _$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. @pragma('vm:prefer-inline') @override $Res call({ @@ -177,7 +185,7 @@ class _$LinksImpl implements _Links { const DeepCollectionEquality().equals(other.next, next)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -186,7 +194,9 @@ class _$LinksImpl implements _Links { const DeepCollectionEquality().hash(prev), const DeepCollectionEquality().hash(next)); - @JsonKey(ignore: true) + /// 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 => @@ -221,8 +231,11 @@ abstract class _Links implements Links { @override @JsonKey(name: "next") dynamic get next; + + /// Create a copy of Links + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$LinksImplCopyWith<_$LinksImpl> get copyWith => throw _privateConstructorUsedError; } @@ -242,7 +255,7 @@ mixin _$Meta { @JsonKey(name: "links") List get links => throw _privateConstructorUsedError; @JsonKey(name: "path") - String get path => throw _privateConstructorUsedError; + String? get path => throw _privateConstructorUsedError; @JsonKey(name: "per_page") int get perPage => throw _privateConstructorUsedError; @JsonKey(name: "to") @@ -250,8 +263,12 @@ mixin _$Meta { @JsonKey(name: "total") int get total => throw _privateConstructorUsedError; + /// Serializes this Meta to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Meta + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $MetaCopyWith 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: [