refactor: profile model

This commit is contained in:
mso7nueh
2024-09-09 18:18:35 +03:00
parent 3ccf5b6d92
commit 8ea819c5bc
77 changed files with 2735 additions and 2950 deletions

View File

@@ -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;
}

View File

@@ -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<Link> 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<String, Object?> json) => _$LinkFromJson(json);

View File

@@ -29,8 +29,12 @@ mixin _$Links {
@JsonKey(name: "next")
dynamic get next => throw _privateConstructorUsedError;
/// Serializes this Links to a JSON map.
Map<String, dynamic> 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<Links> 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<Link> 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<String, dynamic> 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<Meta> 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<Link> 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<Link>,
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<Link> 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<Link>,
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<Link> 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<Link> 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<Link> 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<String, dynamic> 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<Link> 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<String, dynamic> 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<String, dynamic> 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;
}

View File

@@ -28,7 +28,7 @@ _$MetaImpl _$$MetaImplFromJson(Map<String, dynamic> json) => _$MetaImpl(
links: (json['links'] as List<dynamic>)
.map((e) => Link.fromJson(e as Map<String, dynamic>))
.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<String, dynamic> _$$MetaImplToJson(_$MetaImpl instance) =>
_$LinkImpl _$$LinkImplFromJson(Map<String, dynamic> 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<String, dynamic> _$$LinkImplToJson(_$LinkImpl instance) =>

View File

@@ -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<SelectionPopupModel> 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;
}

View File

@@ -68,8 +68,12 @@ mixin _$UserRegistrationSheet {
@JsonKey(name: 'activity_coefficient')
double get activityCoefficient => throw _privateConstructorUsedError;
/// Serializes this UserRegistrationSheet to a JSON map.
Map<String, dynamic> 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<UserRegistrationSheet> 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;
}

View File

@@ -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<BlogPostScreen> {
if (state is CommentsStateLoading)
Padding(
padding: const EdgeInsets.all(32),
child: CupertinoActivityIndicator(),
child: CircularProgressIndicator(),
),
if (state is CommentsStateLoaded)
CommentsWidget(

View File

@@ -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;
}

View File

@@ -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<String> 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;
}

View File

@@ -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;
}

View File

@@ -190,9 +190,9 @@ class _BottomNavigationBarWidgetState extends State<BottomNavigationBarWidget> {
label: '',
icon: BlocBuilder<ProfileAvatarCubit, ProfileAvatarState>(
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,
);
}

View File

@@ -25,8 +25,12 @@ mixin _$CalendarModel {
throw _privateConstructorUsedError;
Object? get diary => throw _privateConstructorUsedError;
/// Serializes this CalendarModel to a JSON map.
Map<String, dynamic> 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<CalendarModel> 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;
}

View File

@@ -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<CalendarModel> 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;
}

View File

@@ -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) {

View File

@@ -29,8 +29,12 @@ mixin _$ChatMessageModel {
@JsonKey(name: 'updated_at')
String get updatedAt => throw _privateConstructorUsedError;
/// Serializes this ChatMessageModel to a JSON map.
Map<String, dynamic> 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<ChatMessageModel> 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;
}

View File

@@ -24,8 +24,12 @@ mixin _$ChatMessagesModel {
List<ChatMessageModel> get messagesList => throw _privateConstructorUsedError;
ChatMetaModel get meta => throw _privateConstructorUsedError;
/// Serializes this ChatMessagesModel to a JSON map.
Map<String, dynamic> 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<ChatMessagesModel> 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<ChatMessageModel> 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;
}

View File

@@ -23,8 +23,12 @@ mixin _$ChatMetaModel {
@JsonKey(name: "last_page")
int get lastPage => throw _privateConstructorUsedError;
/// Serializes this ChatMetaModel to a JSON map.
Map<String, dynamic> 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<ChatMetaModel> 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;
}

View File

@@ -26,8 +26,12 @@ mixin _$ChatRoomModel {
throw _privateConstructorUsedError;
Map<String, ChatUserModel> get users => throw _privateConstructorUsedError;
/// Serializes this ChatRoomModel to a JSON map.
Map<String, dynamic> 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<ChatRoomModel> 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<String, ChatUserModel> 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;
}

View File

@@ -23,8 +23,12 @@ mixin _$ChatRoomPreviewModel {
@JsonKey(name: "chatRooms")
List<ChatRoom> get chatRooms => throw _privateConstructorUsedError;
/// Serializes this ChatRoomPreviewModel to a JSON map.
Map<String, dynamic> 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<ChatRoomPreviewModel> 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<ChatRoom> 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<String, dynamic> 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<ChatRoom> 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<String, dynamic> 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<LastMessageClass> 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<String, dynamic> 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<Users> 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<String, dynamic> 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<ChatUser> 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;
}

View File

@@ -30,8 +30,12 @@ mixin _$ChatRoomSettingsModel {
@JsonKey(name: 'updated_at')
String get updatedAt => throw _privateConstructorUsedError;
/// Serializes this ChatRoomSettingsModel to a JSON map.
Map<String, dynamic> 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<ChatRoomSettingsModel> 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;
}

View File

@@ -27,8 +27,12 @@ mixin _$ChatUserModel {
@JsonKey(name: 'profile_photo_url')
String? get profilePhotoUrl => throw _privateConstructorUsedError;
/// Serializes this ChatUserModel to a JSON map.
Map<String, dynamic> 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<ChatUserModel> 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;
}

View File

@@ -27,8 +27,12 @@ mixin _$WebsocketInfoModel {
@JsonKey(name: 'user_id')
int get userId => throw _privateConstructorUsedError;
/// Serializes this WebsocketInfoModel to a JSON map.
Map<String, dynamic> 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<WebsocketInfoModel> 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;
}

View File

@@ -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<ChatMessageModel> 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;
}

View File

@@ -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<ChatRoom> chatRooms}) = _$ChatSelectStateLoadedImpl;
List<ChatRoom> 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;
}

View File

@@ -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<ChatScreen> {
} else {
return Scaffold(
body: Center(
child: CupertinoActivityIndicator(),
child: CircularProgressIndicator(),
),
);
}
@@ -145,16 +144,25 @@ class _ChatScreenState extends State<ChatScreen> {
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<ChatScreen> {
),
);
}
_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,
),
),
);
}
}

View File

@@ -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<ChatSelectScreen> {
final ChatSelectCubit chatSelectCubit = sl<ChatSelectCubit>();
final searchController = TextEditingController();
Widget build(BuildContext context) {
return BlocBuilder<ChatSelectCubit, ChatSelectState>(
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<ChatSelectCubit>().getChatRooms(),
onChanged: (query) {
if (query.length > 2) {
EasyDebounce.debounce(
'searchChatRoom',
Duration(milliseconds: 300),
() => context.read<ChatSelectCubit>().getChatRooms(query: query),
);
} else {
context.read<ChatSelectCubit>().getChatRooms();
}
},
controller: searchController,
fillColor: Color(0xFFF0F2F5),
hintText: "Поиск",
hintStyle: TextStyle(
color: Color(0xFF7B8794),
return BlocProvider<ChatSelectCubit>(
create: (context) => chatSelectCubit..getChatRooms(),
child: BlocBuilder<ChatSelectCubit, ChatSelectState>(
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<ChatSelectCubit>().getChatRooms(),
onChanged: (query) {
if (query.length > 2) {
EasyDebounce.debounce(
'searchChatRoom',
Duration(milliseconds: 300),
() => context.read<ChatSelectCubit>().getChatRooms(query: query),
);
} else {
context.read<ChatSelectCubit>().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<ChatSelectScreen> {
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<ChatSelectScreen> {
} else {
return Scaffold(
body: Center(
child: CupertinoActivityIndicator(),
child: CircularProgressIndicator(),
),
);
}

View File

@@ -29,8 +29,12 @@ mixin _$DiaryModel {
DateTime? get wakeup => throw _privateConstructorUsedError;
DateTime? get retire => throw _privateConstructorUsedError;
/// Serializes this DiaryModel to a JSON map.
Map<String, dynamic> 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<DiaryModel> 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;
}

View File

@@ -28,8 +28,12 @@ mixin _$Meal {
List<Portion> get portions => throw _privateConstructorUsedError;
List<Photo> get photos => throw _privateConstructorUsedError;
/// Serializes this Meal to a JSON map.
Map<String, dynamic> 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<Meal> 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<Portion> get portions;
@override
List<Photo> 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;
}

View File

@@ -25,8 +25,12 @@ mixin _$Photo {
String get originalName => throw _privateConstructorUsedError;
String get path => throw _privateConstructorUsedError;
/// Serializes this Photo to a JSON map.
Map<String, dynamic> 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<Photo> 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;
}

View File

@@ -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<String, dynamic> 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<Portion> 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;
}

View File

@@ -23,8 +23,12 @@ mixin _$Product {
int get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
/// Serializes this Product to a JSON map.
Map<String, dynamic> 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<Product> 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;
}

View File

@@ -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<String, dynamic> 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<State> 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;
}

View File

@@ -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<NutritionData>? 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;
}

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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<AboutDietScreen> {
if (state is CommentsStateLoading)
Padding(
padding: const EdgeInsets.all(32),
child: CupertinoActivityIndicator(),
child: CircularProgressIndicator(),
),
if (state is CommentsStateLoaded)
CommentsWidget(

View File

@@ -27,8 +27,12 @@ mixin _$CommentModel {
@JsonKey(name: "meta")
Meta get meta => throw _privateConstructorUsedError;
/// Serializes this CommentModel to a JSON map.
Map<String, dynamic> 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<CommentModel> 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<String, dynamic> 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<Comment> 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;
}

View File

@@ -27,8 +27,12 @@ mixin _$DietsPagination {
@JsonKey(name: "meta")
Meta get meta => throw _privateConstructorUsedError;
/// Serializes this DietsPagination to a JSON map.
Map<String, dynamic> 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<DietsPagination> 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<String, dynamic> 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<Diet> 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<String, dynamic> 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<Author> 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<String, dynamic> 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<DailySchedule> 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<String, dynamic> 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<DietType> 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;
}

View File

@@ -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<String, dynamic> 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<FeedBlogPostModel> 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;
}

View File

@@ -26,8 +26,12 @@ mixin _$FeedBlogPostSettingsModel {
throw _privateConstructorUsedError;
Meta get meta => throw _privateConstructorUsedError;
/// Serializes this FeedBlogPostSettingsModel to a JSON map.
Map<String, dynamic> 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<FeedBlogPostSettingsModel> 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<FeedBlogPostModel> 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;
}

View File

@@ -45,8 +45,12 @@ mixin _$Recipes {
int get viewsCount => throw _privateConstructorUsedError;
Author get author => throw _privateConstructorUsedError;
/// Serializes this Recipes to a JSON map.
Map<String, dynamic> 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<Recipes> 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<String, dynamic> 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<Ingredient> 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<String, dynamic> 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<Step> 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;
}

View File

@@ -23,8 +23,12 @@ mixin _$RecipesPagination {
@JsonKey(name: 'data')
List<Recipes> get recipesList => throw _privateConstructorUsedError;
/// Serializes this RecipesPagination to a JSON map.
Map<String, dynamic> 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<RecipesPagination> 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<Recipes> 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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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<FeedBlogPostModel> 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;
}

View File

@@ -8,6 +8,10 @@ class RecipesCubit extends Cubit<RecipesState> {
final FeedRepository feedRepository;
final RecipeRepository recipeRepository;
Set<int> _selectedTags = {};
int currentPage = 1;
late int lastPage;
bool isLoading = false;
String? _query;
RecipesCubit({
required this.feedRepository,
@@ -18,6 +22,7 @@ class RecipesCubit extends Cubit<RecipesState> {
String? query,
}) async {
try {
_query = query;
final recipesList = await feedRepository.getRecipes(
tags: _selectedTags.toList(),
query: query,
@@ -28,12 +33,42 @@ class RecipesCubit extends Cubit<RecipesState> {
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(

View File

@@ -15,6 +15,7 @@ abstract class RecipesState with _$RecipesState {
required List<RecipeTag> recipesTags,
required Set<int> selectedTags,
required int selectedTagsCounter,
required bool isLoading,
}) = RecipesStateLoaded;
const factory RecipesState.error({

View File

@@ -24,7 +24,8 @@ mixin _$RecipesState {
List<Recipes> recipesList,
List<RecipeTag> recipesTags,
Set<int> 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<Recipes> recipesList, List<RecipeTag> recipesTags,
Set<int> selectedTags, int selectedTagsCounter)?
Set<int> 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<Recipes> recipesList, List<RecipeTag> recipesTags,
Set<int> selectedTags, int selectedTagsCounter)?
Set<int> 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<Recipes> recipesList,
List<RecipeTag> recipesTags,
Set<int> 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<Recipes> recipesList, List<RecipeTag> recipesTags,
Set<int> selectedTags, int selectedTagsCounter)?
Set<int> 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<Recipes> recipesList, List<RecipeTag> recipesTags,
Set<int> selectedTags, int selectedTagsCounter)?
Set<int> 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<Recipes> recipesList,
List<RecipeTag> recipesTags,
Set<int> 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<Recipes> recipesList, List<RecipeTag> recipesTags,
Set<int> selectedTags, int selectedTagsCounter)?
Set<int> 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<Recipes> recipesList, List<RecipeTag> recipesTags,
Set<int> selectedTags, int selectedTagsCounter)?
Set<int> selectedTags, int selectedTagsCounter, bool isLoading)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
@@ -352,7 +364,8 @@ abstract class _$$RecipesStateLoadedImplCopyWith<$Res> {
{List<Recipes> recipesList,
List<RecipeTag> recipesTags,
Set<int> 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<Recipes> recipesList,
required final List<RecipeTag> recipesTags,
required final Set<int> 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<Recipes> recipesList,
List<RecipeTag> recipesTags,
Set<int> 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<Recipes> recipesList, List<RecipeTag> recipesTags,
Set<int> selectedTags, int selectedTagsCounter)?
Set<int> 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<Recipes> recipesList, List<RecipeTag> recipesTags,
Set<int> selectedTags, int selectedTagsCounter)?
Set<int> 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<Recipes> recipesList,
required final List<RecipeTag> recipesTags,
required final Set<int> selectedTags,
required final int selectedTagsCounter}) = _$RecipesStateLoadedImpl;
required final int selectedTagsCounter,
required final bool isLoading}) = _$RecipesStateLoadedImpl;
List<Recipes> get recipesList;
List<RecipeTag> get recipesTags;
Set<int> 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<Recipes> recipesList,
List<RecipeTag> recipesTags,
Set<int> 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<Recipes> recipesList, List<RecipeTag> recipesTags,
Set<int> selectedTags, int selectedTagsCounter)?
Set<int> 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<Recipes> recipesList, List<RecipeTag> recipesTags,
Set<int> selectedTags, int selectedTagsCounter)?
Set<int> 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;
}

View File

@@ -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<FeedScreen> {
@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<FeedCubit>().loadNextPage();
}
}
_onScrollBlogRecipes() {
if (blogPostsScrollController.offset >= blogPostsScrollController.position.maxScrollExtent && !blogPostsScrollController.position.outOfRange) {
context.read<FeedCubit>().loadNextPage();
}
}
_onScrollBlogDiets() {
if (blogPostsScrollController.offset >= blogPostsScrollController.position.maxScrollExtent && !blogPostsScrollController.position.outOfRange) {
context.read<FeedCubit>().loadNextPage();
}
@@ -45,6 +60,8 @@ class _FeedScreenState extends State<FeedScreen> {
@override
void dispose() {
blogPostsScrollController.dispose();
recipesScrollController.dispose();
dietsScrollController.dispose();
super.dispose();
}
@@ -89,7 +106,11 @@ class _FeedScreenState extends State<FeedScreen> {
),
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<FeedScreen> {
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<FeedScreen> {
return Scaffold(
backgroundColor: Colors.grey.shade200,
body: Center(
child: CupertinoActivityIndicator(),
child: CircularProgressIndicator(),
),
);
}
@@ -206,7 +227,7 @@ class _FeedScreenState extends State<FeedScreen> {
return Scaffold(
backgroundColor: Colors.grey.shade200,
body: Center(
child: CupertinoActivityIndicator(),
child: CircularProgressIndicator(),
),
);
}
@@ -247,7 +268,7 @@ class _FeedScreenState extends State<FeedScreen> {
return Scaffold(
backgroundColor: Colors.grey.shade200,
body: Center(
child: CupertinoActivityIndicator(),
child: CircularProgressIndicator(),
),
);
}
@@ -319,6 +340,7 @@ class _FeedScreenState extends State<FeedScreen> {
switch (_selectedChipIndex) {
case 1:
context.read<RecipesCubit>().loadRecipesList(query: query);
break;
}
},
);

View File

@@ -11,7 +11,7 @@ class FeedRepository {
Future<FeedBlogPostSettingsModel> 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<List<Recipes>> getRecipes({
String? query,
List<int>? 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<DietsPagination> getDiets() async {
Future<DietsPagination> getDiets({int page = 1}) async {
try {
return (await feedService.getDiets());
return (await feedService.getDiets(page: page));
} catch (e) {
rethrow;
}

View File

@@ -12,18 +12,21 @@ abstract class FeedService {
factory FeedService(Dio dio, {String baseUrl}) = _FeedService;
@GET('/api/blogPosts/index?page={page}')
Future<FeedBlogPostSettingsModel> getBlocPostList({
Future<FeedBlogPostSettingsModel> getBlogPostList({
@Path() required int page,
});
@GET('/api/recipes/index')
Future<RecipesPagination> getRecipes({
@Path() required int page,
@Query('filters[tags][tags.id][\$in][]') required List<int>? tags,
@Query('filters[title][\$contains]') required String? query,
});
@GET('/api/diets/index')
Future<DietsPagination> getDiets();
Future<DietsPagination> getDiets({
@Path() required int page,
});
@GET('/api/blogPosts/{id}/comments/show')
Future<CommentModel> getBlogPostComments({

View File

@@ -22,7 +22,7 @@ class _FeedService implements FeedService {
final ParseErrorLogger? errorLogger;
@override
Future<FeedBlogPostSettingsModel> getBlocPostList({required int page}) async {
Future<FeedBlogPostSettingsModel> getBlogPostList({required int page}) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
@@ -56,6 +56,7 @@ class _FeedService implements FeedService {
@override
Future<RecipesPagination> getRecipes({
required int page,
List<int>? tags,
String? query,
}) async {
@@ -95,7 +96,7 @@ class _FeedService implements FeedService {
}
@override
Future<DietsPagination> getDiets() async {
Future<DietsPagination> getDiets({required int page}) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};

View File

@@ -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<ChartPointModel> chartPoints,
@JsonKey(name: "userDetails") required UserDetails userDetails,
@JsonKey(name: "circumferences") required List<Circumference> circumferences,
@JsonKey(name: "finishedPlans") required List<dynamic> finishedPlans,
@JsonKey(name: "rejectedPlans") required List<dynamic> rejectedPlans,
@JsonKey(name: "startedPlan") required List<dynamic> startedPlan,
@JsonKey(name: "paidPlan") required List<dynamic> paidPlan,
@JsonKey(name: "requestedPlan") required List<dynamic> requestedPlan,
@JsonKey(name: "initedPlan") required List<dynamic> 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<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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<String, dynamic> json) => _$ChartPointModelFromJson(json);
factory ProfileDetailsModel.fromJson(Map<String, dynamic> json) => _$ProfileDetailsModelFromJson(json);
}

File diff suppressed because it is too large Load Diff

View File

@@ -8,136 +8,78 @@ part of 'profile_model.dart';
_$ProfileModelImpl _$$ProfileModelImplFromJson(Map<String, dynamic> json) =>
_$ProfileModelImpl(
user: User.fromJson(json['user'] as Map<String, dynamic>),
chartPoints: (json['chartPoints'] as List<dynamic>)
.map((e) => ChartPointModel.fromJson(e as Map<String, dynamic>))
.toList(),
userDetails:
UserDetails.fromJson(json['userDetails'] as Map<String, dynamic>),
circumferences: (json['circumferences'] as List<dynamic>)
.map((e) => Circumference.fromJson(e as Map<String, dynamic>))
.toList(),
finishedPlans: json['finishedPlans'] as List<dynamic>,
rejectedPlans: json['rejectedPlans'] as List<dynamic>,
startedPlan: json['startedPlan'] as List<dynamic>,
paidPlan: json['paidPlan'] as List<dynamic>,
requestedPlan: json['requestedPlan'] as List<dynamic>,
initedPlan: json['initedPlan'] as List<dynamic>,
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<String, dynamic> _$$ProfileModelImplToJson(_$ProfileModelImpl instance) =>
<String, dynamic>{
'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<String, dynamic> 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<String, dynamic> _$$CircumferenceImplToJson(_$CircumferenceImpl instance) =>
<String, dynamic>{
'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<String, dynamic> 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<String, dynamic>),
);
Map<String, dynamic> _$$UserImplToJson(_$UserImpl instance) =>
<String, dynamic>{
'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<String, dynamic> json) =>
_$UserDetailsImpl(
id: (json['id'] as num).toInt(),
userId: (json['user_id'] as num).toInt(),
_$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson(
Map<String, dynamic> 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<String, dynamic> _$$UserDetailsImplToJson(_$UserDetailsImpl instance) =>
Map<String, dynamic> _$$ProfileDetailsModelImplToJson(
_$ProfileDetailsModelImpl instance) =>
<String, dynamic>{
'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<String, dynamic> _$$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<String, dynamic> 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<String, dynamic> _$$ChartPointModelImplToJson(
_$ChartPointModelImpl instance) =>
<String, dynamic>{
'id': instance.id,
'user_id': instance.userId,
'weight': instance.weight,
'bmi': instance.bmi,
'created_at': instance.createdAt.toIso8601String(),
'updated_at': instance.updatedAt.toIso8601String(),
};

View File

@@ -13,6 +13,7 @@ class ProfileCubit extends Cubit<ProfileState> {
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<ProfileState> {
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<ProfileState> {
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<ProfileState> {
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);

View File

@@ -12,6 +12,7 @@ abstract class ProfileState with _$ProfileState {
const factory ProfileState.loaded({
required ProfileModel profile,
required ProfileDetailsModel profileDetails,
required List<FeedBlogPostModel> blogPosts,
}) = ProfileStateLoaded;

View File

@@ -21,7 +21,9 @@ mixin _$ProfileState {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ProfileModel profile, List<FeedBlogPostModel> blogPosts)
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts)
loaded,
required TResult Function(String errorMessage) error,
}) =>
@@ -30,7 +32,8 @@ mixin _$ProfileState {
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(ProfileModel profile, List<FeedBlogPostModel> blogPosts)?
TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts)?
loaded,
TResult? Function(String errorMessage)? error,
}) =>
@@ -39,7 +42,8 @@ mixin _$ProfileState {
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(ProfileModel profile, List<FeedBlogPostModel> blogPosts)?
TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> 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<FeedBlogPostModel> blogPosts)
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts)
loaded,
required TResult Function(String errorMessage) error,
}) {
@@ -143,7 +155,8 @@ class _$ProfileStateImpl implements _ProfileState {
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(ProfileModel profile, List<FeedBlogPostModel> blogPosts)?
TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
@@ -155,7 +168,8 @@ class _$ProfileStateImpl implements _ProfileState {
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(ProfileModel profile, List<FeedBlogPostModel> blogPosts)?
TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> 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<FeedBlogPostModel> blogPosts)
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts)
loaded,
required TResult Function(String errorMessage) error,
}) {
@@ -262,7 +281,8 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading {
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(ProfileModel profile, List<FeedBlogPostModel> blogPosts)?
TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
@@ -274,7 +294,8 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading {
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(ProfileModel profile, List<FeedBlogPostModel> blogPosts)?
TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> 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<FeedBlogPostModel> blogPosts});
$Res call(
{ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> 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<FeedBlogPostModel> blogPosts})
{required this.profile,
required this.profileDetails,
required final List<FeedBlogPostModel> blogPosts})
: _blogPosts = blogPosts;
@override
final ProfileModel profile;
@override
final ProfileDetailsModel profileDetails;
final List<FeedBlogPostModel> _blogPosts;
@override
List<FeedBlogPostModel> 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<FeedBlogPostModel> blogPosts)
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> 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 extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(ProfileModel profile, List<FeedBlogPostModel> blogPosts)?
TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> 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 extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(ProfileModel profile, List<FeedBlogPostModel> blogPosts)?
TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> 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<FeedBlogPostModel> blogPosts}) =
_$ProfileStateLoadedImpl;
ProfileModel get profile;
ProfileDetailsModel get profileDetails;
List<FeedBlogPostModel> 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<FeedBlogPostModel> blogPosts)
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts)
loaded,
required TResult Function(String errorMessage) error,
}) {
@@ -589,7 +656,8 @@ class _$ProfileStateErrorImpl implements ProfileStateError {
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(ProfileModel profile, List<FeedBlogPostModel> blogPosts)?
TResult? Function(ProfileModel profile, ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
@@ -601,7 +669,8 @@ class _$ProfileStateErrorImpl implements ProfileStateError {
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(ProfileModel profile, List<FeedBlogPostModel> blogPosts)?
TResult Function(ProfileModel profile, ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> 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;
}

View File

@@ -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<ProfileScreen> {
List<Circumference> chartData = [];
List<ChartPointModel> chartPoints = [];
// List<Circumference> chartData = [];
// List<ChartPointModel> chartPoints = [];
final List<String> chipsLabelList = ['Вес', 'Замеры', 'ИМТ'];
final List<String> chipsIntervalLabelList = ['1М', '3М', '6М', '1Г', 'ВСЁ ВРЕМЯ'];
int _selectedChipIndex = 0;
@@ -42,8 +38,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: BlocBuilder<ProfileCubit, ProfileState>(
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<ProfileScreen> {
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<ProfileScreen> {
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<ProfileScreen> {
],
),
),
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<ProfileScreen> {
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<ProfileScreen> {
],
),
),
Builder(
builder: (context) {
switch (_selectedChipIndex) {
case 0:
return WeightChartWidget(
chartPoints: chartPoints,
profileCubit: context.read<ProfileCubit>(),
);
case 1:
return CircumferenceChartWidget(
chartData: chartData,
profileCubit: context.read<ProfileCubit>(),
);
case 2:
return ImtChartWidget(chartPoints: chartPoints);
}
return SizedBox.shrink();
},
),
// Builder(
// builder: (context) {
// switch (_selectedChipIndex) {
// case 0:
// return WeightChartWidget(
// chartPoints: chartPoints,
// profileCubit: context.read<ProfileCubit>(),
// );
// case 1:
// return CircumferenceChartWidget(
// chartData: chartData,
// profileCubit: context.read<ProfileCubit>(),
// );
// case 2:
// return ImtChartWidget(chartPoints: chartPoints);
// }
// return SizedBox.shrink();
// },
// ),
SizedBox(height: 8),
Row(
children: [

View File

@@ -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<Circumference> chartData;
final ProfileCubit profileCubit;
const CircumferenceChartWidget({
super.key,
required this.chartData,
required this.profileCubit,
});
@override
State<CircumferenceChartWidget> createState() => _CircumferenceChartWidgetState();
}
class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
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<CartesianSeries<Circumference, DateTime>> _getSplineSeries() {
final Color seriesColor1 = Colors.red;
final Color seriesColor2 = appTheme.blueA400;
final Color seriesColor3 = Colors.green;
return <CartesianSeries<Circumference, DateTime>>[
SplineAreaSeries<Circumference, DateTime>(
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<Circumference, DateTime>(
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<Circumference, DateTime>(
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<Circumference> chartData;
// final ProfileCubit profileCubit;
//
// const CircumferenceChartWidget({
// super.key,
// required this.chartData,
// required this.profileCubit,
// });
//
// @override
// State<CircumferenceChartWidget> createState() => _CircumferenceChartWidgetState();
// }
//
// class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
// 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<CartesianSeries<Circumference, DateTime>> _getSplineSeries() {
// final Color seriesColor1 = Colors.red;
// final Color seriesColor2 = appTheme.blueA400;
// final Color seriesColor3 = Colors.green;
//
// return <CartesianSeries<Circumference, DateTime>>[
// SplineAreaSeries<Circumference, DateTime>(
// 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<Circumference, DateTime>(
// 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<Circumference, DateTime>(
// 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,
// ),
// ];
// }
// }

View File

@@ -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<ChartPointModel> 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<CartesianSeries<ChartPointModel, DateTime>> _getSplineSeries() {
return <CartesianSeries<ChartPointModel, DateTime>>[
SplineAreaSeries<ChartPointModel, DateTime>(
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<ChartPointModel> 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<CartesianSeries<ChartPointModel, DateTime>> _getSplineSeries() {
// return <CartesianSeries<ChartPointModel, DateTime>>[
// SplineAreaSeries<ChartPointModel, DateTime>(
// 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)),
// ),
// ];
// }
// }

View File

@@ -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<ChartPointModel> chartPoints;
final ProfileCubit profileCubit;
const WeightChartWidget({
super.key,
required this.chartPoints,
required this.profileCubit,
});
@override
State<WeightChartWidget> createState() => _WeightChartWidgetState();
}
class _WeightChartWidgetState extends State<WeightChartWidget> {
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<CartesianSeries<ChartPointModel, DateTime>> _getSplineSeries() {
return <CartesianSeries<ChartPointModel, DateTime>>[
SplineAreaSeries<ChartPointModel, DateTime>(
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<ChartPointModel> chartPoints;
// final ProfileCubit profileCubit;
//
// const WeightChartWidget({
// super.key,
// required this.chartPoints,
// required this.profileCubit,
// });
//
// @override
// State<WeightChartWidget> createState() => _WeightChartWidgetState();
// }
//
// class _WeightChartWidgetState extends State<WeightChartWidget> {
// 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<CartesianSeries<ChartPointModel, DateTime>> _getSplineSeries() {
// return <CartesianSeries<ChartPointModel, DateTime>>[
// SplineAreaSeries<ChartPointModel, DateTime>(
// 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,
// ),
// ];
// }
// }

View File

@@ -23,6 +23,14 @@ class ProfileRepository {
}
}
Future<ProfileDetailsModel> getMyProfileDetails() async {
try {
return await profileService.getMyProfileDetails();
} catch (e) {
rethrow;
}
}
Future<void> addCircumference({
required int chestCircumference,
required int waistCircumference,

View File

@@ -17,6 +17,9 @@ abstract class ProfileService {
@GET('/api/profile/index')
Future<ProfileModel> getMyProfile();
@GET('/api/profile/detailz')
Future<ProfileDetailsModel> getMyProfileDetails();
@POST('/api/profile/addCircumference')
Future<void> addCircumference({
@Part(name: 'chest_circumference') required int chestCircumference,

View File

@@ -87,6 +87,39 @@ class _ProfileService implements ProfileService {
return _value;
}
@override
Future<ProfileDetailsModel> getMyProfileDetails() async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
const Map<String, dynamic>? _data = null;
final _options = _setStreamType<ProfileDetailsModel>(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<Map<String, dynamic>>(_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<void> addCircumference({
required int chestCircumference,

View File

@@ -24,8 +24,12 @@ mixin _$Ingredient {
String get unit => throw _privateConstructorUsedError;
String get portion => throw _privateConstructorUsedError;
/// Serializes this Ingredient to a JSON map.
Map<String, dynamic> 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<Ingredient> 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;
}

View File

@@ -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<String, dynamic> 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<RecipeModel> 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;
}

View File

@@ -27,8 +27,12 @@ mixin _$RecipeTagModel {
@JsonKey(name: "meta")
Meta get meta => throw _privateConstructorUsedError;
/// Serializes this RecipeTagModel to a JSON map.
Map<String, dynamic> 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<RecipeTagModel> 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<String, dynamic> 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<RecipeTag> 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;
}

View File

@@ -23,8 +23,12 @@ mixin _$Step {
String? get image => throw _privateConstructorUsedError;
String? get description => throw _privateConstructorUsedError;
/// Serializes this Step to a JSON map.
Map<String, dynamic> 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<Step> 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;
}

View File

@@ -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;
}

View File

@@ -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<AboutRecipesScreen> {
if (state is CommentsStateLoading)
Padding(
padding: const EdgeInsets.all(32),
child: CupertinoActivityIndicator(),
child: CircularProgressIndicator(),
),
if (state is CommentsStateLoaded)
CommentsWidget(

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -24,8 +24,12 @@ mixin _$LocationModel {
@JsonKey(name: 'response_body')
String get responseBody => throw _privateConstructorUsedError;
/// Serializes this LocationModel to a JSON map.
Map<String, dynamic> 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<LocationModel> 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;
}

View File

@@ -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<RegistrationState> 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;
}

View File

@@ -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<CityOfLivingScreen> {
Icons.near_me_rounded,
color: appTheme.blueA400,
)
: CupertinoActivityIndicator(),
: CircularProgressIndicator(),
),
),
],

View File

@@ -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<ScaffoldMessengerState>();
void main() async {
Future<void> 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<DietsCubit>(create: (context) => sl<DietsCubit>()..loadDiets()),
BlocProvider<MyProfileBloc>(create: (context) => MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel()))..add(MyProfileInitialEvent())),
BlocProvider<DiaryBloc>(create: (context) => sl<DiaryBloc>()..add(LoadDiary())),
BlocProvider<ChatSelectCubit>(create: (context) => sl<ChatSelectCubit>()..getChatRooms()),
BlocProvider<CalendarCubit>(create: (context) => sl<CalendarCubit>()..loadCalendarList()),
BlocProvider<RecipeCreateCubit>(create: (context) => sl<RecipeCreateCubit>()..loadRecipeCreate()),
],
child: KeyboardDismisser(
gestures: [
GestureType.onTap,
GestureType.onPanUpdateDownDirection,
],
child: MaterialApp.router(
theme: theme,
themeMode: ThemeMode.light,
routerConfig: AppRouter.appRouter,
debugShowCheckedModeBanner: false,
localizationsDelegates: [