feat(order info): added order info screen

This commit is contained in:
Username1548
2025-04-04 20:21:31 +07:00
parent 9715f4cac9
commit 748484cf8f
387 changed files with 16171 additions and 18199 deletions

View File

@@ -8,14 +8,14 @@ class CommentsCubit extends Cubit<CommentsState> {
CommentsCubit({
required this.feedRepository,
}) : super(CommentsState());
}) : super(const CommentsState());
setReplyId(int? replyId) {
emit((state as CommentsStateLoaded).copyWith(replyId: replyId));
}
getComments(String id, CommentSourceType commentSourceType, [bool isFirstFetch = false]) async {
if (isFirstFetch) emit(CommentsState.loading());
if (isFirstFetch) emit(const CommentsState.loading());
try {
switch (commentSourceType) {
case CommentSourceType.blogPost:

View File

@@ -12,8 +12,7 @@ part of 'comments_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$CommentsState {
@@ -23,14 +22,16 @@ mixin _$CommentsState {
required TResult Function() loading,
required TResult Function(CommentModel comment, int? replyId) loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(CommentModel comment, int? replyId)? loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
@@ -38,21 +39,24 @@ mixin _$CommentsState {
TResult Function(CommentModel comment, int? replyId)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_CommentsState value) $default, {
required TResult Function(CommentsStateLoading value) loading,
required TResult Function(CommentsStateLoaded value) loaded,
required TResult Function(CommentsStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_CommentsState value)? $default, {
TResult? Function(CommentsStateLoading value)? loading,
TResult? Function(CommentsStateLoaded value)? loaded,
TResult? Function(CommentsStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_CommentsState value)? $default, {
@@ -60,15 +64,15 @@ mixin _$CommentsState {
TResult Function(CommentsStateLoaded value)? loaded,
TResult Function(CommentsStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $CommentsStateCopyWith<$Res> {
factory $CommentsStateCopyWith(
CommentsState value,
$Res Function(CommentsState) then,
) = _$CommentsStateCopyWithImpl<$Res, CommentsState>;
CommentsState value, $Res Function(CommentsState) then) =
_$CommentsStateCopyWithImpl<$Res, CommentsState>;
}
/// @nodoc
@@ -88,9 +92,8 @@ class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState>
/// @nodoc
abstract class _$$CommentsStateImplCopyWith<$Res> {
factory _$$CommentsStateImplCopyWith(
_$CommentsStateImpl value,
$Res Function(_$CommentsStateImpl) then,
) = __$$CommentsStateImplCopyWithImpl<$Res>;
_$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) =
__$$CommentsStateImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -98,9 +101,8 @@ class __$$CommentsStateImplCopyWithImpl<$Res>
extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl>
implements _$$CommentsStateImplCopyWith<$Res> {
__$$CommentsStateImplCopyWithImpl(
_$CommentsStateImpl _value,
$Res Function(_$CommentsStateImpl) _then,
) : super(_value, _then);
_$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.
@@ -206,20 +208,18 @@ abstract class _CommentsState implements CommentsState {
/// @nodoc
abstract class _$$CommentsStateLoadingImplCopyWith<$Res> {
factory _$$CommentsStateLoadingImplCopyWith(
_$CommentsStateLoadingImpl value,
$Res Function(_$CommentsStateLoadingImpl) then,
) = __$$CommentsStateLoadingImplCopyWithImpl<$Res>;
factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value,
$Res Function(_$CommentsStateLoadingImpl) then) =
__$$CommentsStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$CommentsStateLoadingImplCopyWithImpl<$Res>
extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl>
implements _$$CommentsStateLoadingImplCopyWith<$Res> {
__$$CommentsStateLoadingImplCopyWithImpl(
_$CommentsStateLoadingImpl _value,
$Res Function(_$CommentsStateLoadingImpl) _then,
) : super(_value, _then);
__$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value,
$Res Function(_$CommentsStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of CommentsState
/// with the given fields replaced by the non-null parameter values.
@@ -326,10 +326,9 @@ abstract class CommentsStateLoading implements CommentsState {
/// @nodoc
abstract class _$$CommentsStateLoadedImplCopyWith<$Res> {
factory _$$CommentsStateLoadedImplCopyWith(
_$CommentsStateLoadedImpl value,
$Res Function(_$CommentsStateLoadedImpl) then,
) = __$$CommentsStateLoadedImplCopyWithImpl<$Res>;
factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value,
$Res Function(_$CommentsStateLoadedImpl) then) =
__$$CommentsStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({CommentModel comment, int? replyId});
@@ -340,30 +339,28 @@ abstract class _$$CommentsStateLoadedImplCopyWith<$Res> {
class __$$CommentsStateLoadedImplCopyWithImpl<$Res>
extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl>
implements _$$CommentsStateLoadedImplCopyWith<$Res> {
__$$CommentsStateLoadedImplCopyWithImpl(
_$CommentsStateLoadedImpl _value,
$Res Function(_$CommentsStateLoadedImpl) _then,
) : super(_value, _then);
__$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value,
$Res Function(_$CommentsStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of CommentsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? comment = null, Object? replyId = freezed}) {
return _then(
_$CommentsStateLoadedImpl(
comment:
null == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as CommentModel,
replyId:
freezed == replyId
? _value.replyId
: replyId // ignore: cast_nullable_to_non_nullable
as int?,
),
);
$Res call({
Object? comment = null,
Object? replyId = freezed,
}) {
return _then(_$CommentsStateLoadedImpl(
comment: null == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as CommentModel,
replyId: freezed == replyId
? _value.replyId
: replyId // ignore: cast_nullable_to_non_nullable
as int?,
));
}
/// Create a copy of CommentsState
@@ -411,9 +408,7 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded {
@pragma('vm:prefer-inline')
_$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith =>
__$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -491,10 +486,9 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded {
}
abstract class CommentsStateLoaded implements CommentsState {
const factory CommentsStateLoaded({
required final CommentModel comment,
final int? replyId,
}) = _$CommentsStateLoadedImpl;
const factory CommentsStateLoaded(
{required final CommentModel comment,
final int? replyId}) = _$CommentsStateLoadedImpl;
CommentModel get comment;
int? get replyId;
@@ -508,10 +502,9 @@ abstract class CommentsStateLoaded implements CommentsState {
/// @nodoc
abstract class _$$CommentsStateErrorImplCopyWith<$Res> {
factory _$$CommentsStateErrorImplCopyWith(
_$CommentsStateErrorImpl value,
$Res Function(_$CommentsStateErrorImpl) then,
) = __$$CommentsStateErrorImplCopyWithImpl<$Res>;
factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value,
$Res Function(_$CommentsStateErrorImpl) then) =
__$$CommentsStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -520,25 +513,23 @@ abstract class _$$CommentsStateErrorImplCopyWith<$Res> {
class __$$CommentsStateErrorImplCopyWithImpl<$Res>
extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl>
implements _$$CommentsStateErrorImplCopyWith<$Res> {
__$$CommentsStateErrorImplCopyWithImpl(
_$CommentsStateErrorImpl _value,
$Res Function(_$CommentsStateErrorImpl) _then,
) : super(_value, _then);
__$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value,
$Res Function(_$CommentsStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of CommentsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$CommentsStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$CommentsStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -574,9 +565,7 @@ class _$CommentsStateErrorImpl implements CommentsStateError {
@pragma('vm:prefer-inline')
_$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith =>
__$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs

View File

@@ -9,10 +9,10 @@ class ConsultantsCubit extends Cubit<ConsultantsState> {
ConsultantsCubit({
required this.feedRepository,
}) : super(ConsultantsState());
}) : super(const ConsultantsState());
getConsultants() async {
emit(ConsultantsState.loading());
emit(const ConsultantsState.loading());
try {
emit(
ConsultantsState.loaded(

View File

@@ -12,8 +12,7 @@ part of 'consultants_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$ConsultantsState {
@@ -22,46 +21,47 @@ mixin _$ConsultantsState {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
List<FeedConsultantModel> consultantsList,
bool isLoading,
)
loaded,
List<FeedConsultantModel> consultantsList, bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
List<FeedConsultantModel> consultantsList,
bool isLoading,
)?
loaded,
List<FeedConsultantModel> consultantsList, bool isLoading)?
loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<FeedConsultantModel> consultantsList, bool isLoading)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_ConsultantsState value) $default, {
required TResult Function(ConsultantsStateLoading value) loading,
required TResult Function(ConsultantsStateLoaded value) loaded,
required TResult Function(ConsultantsStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_ConsultantsState value)? $default, {
TResult? Function(ConsultantsStateLoading value)? loading,
TResult? Function(ConsultantsStateLoaded value)? loaded,
TResult? Function(ConsultantsStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_ConsultantsState value)? $default, {
@@ -69,15 +69,15 @@ mixin _$ConsultantsState {
TResult Function(ConsultantsStateLoaded value)? loaded,
TResult Function(ConsultantsStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ConsultantsStateCopyWith<$Res> {
factory $ConsultantsStateCopyWith(
ConsultantsState value,
$Res Function(ConsultantsState) then,
) = _$ConsultantsStateCopyWithImpl<$Res, ConsultantsState>;
ConsultantsState value, $Res Function(ConsultantsState) then) =
_$ConsultantsStateCopyWithImpl<$Res, ConsultantsState>;
}
/// @nodoc
@@ -96,20 +96,18 @@ class _$ConsultantsStateCopyWithImpl<$Res, $Val extends ConsultantsState>
/// @nodoc
abstract class _$$ConsultantsStateImplCopyWith<$Res> {
factory _$$ConsultantsStateImplCopyWith(
_$ConsultantsStateImpl value,
$Res Function(_$ConsultantsStateImpl) then,
) = __$$ConsultantsStateImplCopyWithImpl<$Res>;
factory _$$ConsultantsStateImplCopyWith(_$ConsultantsStateImpl value,
$Res Function(_$ConsultantsStateImpl) then) =
__$$ConsultantsStateImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$ConsultantsStateImplCopyWithImpl<$Res>
extends _$ConsultantsStateCopyWithImpl<$Res, _$ConsultantsStateImpl>
implements _$$ConsultantsStateImplCopyWith<$Res> {
__$$ConsultantsStateImplCopyWithImpl(
_$ConsultantsStateImpl _value,
$Res Function(_$ConsultantsStateImpl) _then,
) : super(_value, _then);
__$$ConsultantsStateImplCopyWithImpl(_$ConsultantsStateImpl _value,
$Res Function(_$ConsultantsStateImpl) _then)
: super(_value, _then);
/// Create a copy of ConsultantsState
/// with the given fields replaced by the non-null parameter values.
@@ -140,10 +138,8 @@ class _$ConsultantsStateImpl implements _ConsultantsState {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
List<FeedConsultantModel> consultantsList,
bool isLoading,
)
loaded,
List<FeedConsultantModel> consultantsList, bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return $default();
@@ -155,10 +151,8 @@ class _$ConsultantsStateImpl implements _ConsultantsState {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
List<FeedConsultantModel> consultantsList,
bool isLoading,
)?
loaded,
List<FeedConsultantModel> consultantsList, bool isLoading)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return $default?.call();
@@ -170,7 +164,7 @@ class _$ConsultantsStateImpl implements _ConsultantsState {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<FeedConsultantModel> consultantsList, bool isLoading)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -225,9 +219,9 @@ abstract class _ConsultantsState implements ConsultantsState {
/// @nodoc
abstract class _$$ConsultantsStateLoadingImplCopyWith<$Res> {
factory _$$ConsultantsStateLoadingImplCopyWith(
_$ConsultantsStateLoadingImpl value,
$Res Function(_$ConsultantsStateLoadingImpl) then,
) = __$$ConsultantsStateLoadingImplCopyWithImpl<$Res>;
_$ConsultantsStateLoadingImpl value,
$Res Function(_$ConsultantsStateLoadingImpl) then) =
__$$ConsultantsStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -235,9 +229,9 @@ class __$$ConsultantsStateLoadingImplCopyWithImpl<$Res>
extends _$ConsultantsStateCopyWithImpl<$Res, _$ConsultantsStateLoadingImpl>
implements _$$ConsultantsStateLoadingImplCopyWith<$Res> {
__$$ConsultantsStateLoadingImplCopyWithImpl(
_$ConsultantsStateLoadingImpl _value,
$Res Function(_$ConsultantsStateLoadingImpl) _then,
) : super(_value, _then);
_$ConsultantsStateLoadingImpl _value,
$Res Function(_$ConsultantsStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of ConsultantsState
/// with the given fields replaced by the non-null parameter values.
@@ -269,10 +263,8 @@ class _$ConsultantsStateLoadingImpl implements ConsultantsStateLoading {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
List<FeedConsultantModel> consultantsList,
bool isLoading,
)
loaded,
List<FeedConsultantModel> consultantsList, bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return loading();
@@ -284,10 +276,8 @@ class _$ConsultantsStateLoadingImpl implements ConsultantsStateLoading {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
List<FeedConsultantModel> consultantsList,
bool isLoading,
)?
loaded,
List<FeedConsultantModel> consultantsList, bool isLoading)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return loading?.call();
@@ -299,7 +289,7 @@ class _$ConsultantsStateLoadingImpl implements ConsultantsStateLoading {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<FeedConsultantModel> consultantsList, bool isLoading)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -354,9 +344,9 @@ abstract class ConsultantsStateLoading implements ConsultantsState {
/// @nodoc
abstract class _$$ConsultantsStateLoadedImplCopyWith<$Res> {
factory _$$ConsultantsStateLoadedImplCopyWith(
_$ConsultantsStateLoadedImpl value,
$Res Function(_$ConsultantsStateLoadedImpl) then,
) = __$$ConsultantsStateLoadedImplCopyWithImpl<$Res>;
_$ConsultantsStateLoadedImpl value,
$Res Function(_$ConsultantsStateLoadedImpl) then) =
__$$ConsultantsStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({List<FeedConsultantModel> consultantsList, bool isLoading});
}
@@ -366,39 +356,38 @@ class __$$ConsultantsStateLoadedImplCopyWithImpl<$Res>
extends _$ConsultantsStateCopyWithImpl<$Res, _$ConsultantsStateLoadedImpl>
implements _$$ConsultantsStateLoadedImplCopyWith<$Res> {
__$$ConsultantsStateLoadedImplCopyWithImpl(
_$ConsultantsStateLoadedImpl _value,
$Res Function(_$ConsultantsStateLoadedImpl) _then,
) : super(_value, _then);
_$ConsultantsStateLoadedImpl _value,
$Res Function(_$ConsultantsStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of ConsultantsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? consultantsList = null, Object? isLoading = null}) {
return _then(
_$ConsultantsStateLoadedImpl(
consultantsList:
null == consultantsList
? _value._consultantsList
: consultantsList // ignore: cast_nullable_to_non_nullable
as List<FeedConsultantModel>,
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
),
);
$Res call({
Object? consultantsList = null,
Object? isLoading = null,
}) {
return _then(_$ConsultantsStateLoadedImpl(
consultantsList: null == consultantsList
? _value._consultantsList
: consultantsList // ignore: cast_nullable_to_non_nullable
as List<FeedConsultantModel>,
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// @nodoc
class _$ConsultantsStateLoadedImpl implements ConsultantsStateLoaded {
const _$ConsultantsStateLoadedImpl({
required final List<FeedConsultantModel> consultantsList,
required this.isLoading,
}) : _consultantsList = consultantsList;
const _$ConsultantsStateLoadedImpl(
{required final List<FeedConsultantModel> consultantsList,
required this.isLoading})
: _consultantsList = consultantsList;
final List<FeedConsultantModel> _consultantsList;
@override
@@ -421,20 +410,15 @@ class _$ConsultantsStateLoadedImpl implements ConsultantsStateLoaded {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ConsultantsStateLoadedImpl &&
const DeepCollectionEquality().equals(
other._consultantsList,
_consultantsList,
) &&
const DeepCollectionEquality()
.equals(other._consultantsList, _consultantsList) &&
(identical(other.isLoading, isLoading) ||
other.isLoading == isLoading));
}
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_consultantsList),
isLoading,
);
int get hashCode => Object.hash(runtimeType,
const DeepCollectionEquality().hash(_consultantsList), isLoading);
/// Create a copy of ConsultantsState
/// with the given fields replaced by the non-null parameter values.
@@ -442,11 +426,8 @@ class _$ConsultantsStateLoadedImpl implements ConsultantsStateLoaded {
@override
@pragma('vm:prefer-inline')
_$$ConsultantsStateLoadedImplCopyWith<_$ConsultantsStateLoadedImpl>
get copyWith =>
__$$ConsultantsStateLoadedImplCopyWithImpl<_$ConsultantsStateLoadedImpl>(
this,
_$identity,
);
get copyWith => __$$ConsultantsStateLoadedImplCopyWithImpl<
_$ConsultantsStateLoadedImpl>(this, _$identity);
@override
@optionalTypeArgs
@@ -454,10 +435,8 @@ class _$ConsultantsStateLoadedImpl implements ConsultantsStateLoaded {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
List<FeedConsultantModel> consultantsList,
bool isLoading,
)
loaded,
List<FeedConsultantModel> consultantsList, bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return loaded(consultantsList, isLoading);
@@ -469,10 +448,8 @@ class _$ConsultantsStateLoadedImpl implements ConsultantsStateLoaded {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
List<FeedConsultantModel> consultantsList,
bool isLoading,
)?
loaded,
List<FeedConsultantModel> consultantsList, bool isLoading)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return loaded?.call(consultantsList, isLoading);
@@ -484,7 +461,7 @@ class _$ConsultantsStateLoadedImpl implements ConsultantsStateLoaded {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<FeedConsultantModel> consultantsList, bool isLoading)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -533,10 +510,9 @@ class _$ConsultantsStateLoadedImpl implements ConsultantsStateLoaded {
}
abstract class ConsultantsStateLoaded implements ConsultantsState {
const factory ConsultantsStateLoaded({
required final List<FeedConsultantModel> consultantsList,
required final bool isLoading,
}) = _$ConsultantsStateLoadedImpl;
const factory ConsultantsStateLoaded(
{required final List<FeedConsultantModel> consultantsList,
required final bool isLoading}) = _$ConsultantsStateLoadedImpl;
List<FeedConsultantModel> get consultantsList;
bool get isLoading;
@@ -545,15 +521,15 @@ abstract class ConsultantsStateLoaded implements ConsultantsState {
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ConsultantsStateLoadedImplCopyWith<_$ConsultantsStateLoadedImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class _$$ConsultantsStateErrorImplCopyWith<$Res> {
factory _$$ConsultantsStateErrorImplCopyWith(
_$ConsultantsStateErrorImpl value,
$Res Function(_$ConsultantsStateErrorImpl) then,
) = __$$ConsultantsStateErrorImplCopyWithImpl<$Res>;
_$ConsultantsStateErrorImpl value,
$Res Function(_$ConsultantsStateErrorImpl) then) =
__$$ConsultantsStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -562,25 +538,23 @@ abstract class _$$ConsultantsStateErrorImplCopyWith<$Res> {
class __$$ConsultantsStateErrorImplCopyWithImpl<$Res>
extends _$ConsultantsStateCopyWithImpl<$Res, _$ConsultantsStateErrorImpl>
implements _$$ConsultantsStateErrorImplCopyWith<$Res> {
__$$ConsultantsStateErrorImplCopyWithImpl(
_$ConsultantsStateErrorImpl _value,
$Res Function(_$ConsultantsStateErrorImpl) _then,
) : super(_value, _then);
__$$ConsultantsStateErrorImplCopyWithImpl(_$ConsultantsStateErrorImpl _value,
$Res Function(_$ConsultantsStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of ConsultantsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$ConsultantsStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$ConsultantsStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -615,11 +589,8 @@ class _$ConsultantsStateErrorImpl implements ConsultantsStateError {
@override
@pragma('vm:prefer-inline')
_$$ConsultantsStateErrorImplCopyWith<_$ConsultantsStateErrorImpl>
get copyWith =>
__$$ConsultantsStateErrorImplCopyWithImpl<_$ConsultantsStateErrorImpl>(
this,
_$identity,
);
get copyWith => __$$ConsultantsStateErrorImplCopyWithImpl<
_$ConsultantsStateErrorImpl>(this, _$identity);
@override
@optionalTypeArgs
@@ -627,10 +598,8 @@ class _$ConsultantsStateErrorImpl implements ConsultantsStateError {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
List<FeedConsultantModel> consultantsList,
bool isLoading,
)
loaded,
List<FeedConsultantModel> consultantsList, bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return error(errorMessage);
@@ -642,10 +611,8 @@ class _$ConsultantsStateErrorImpl implements ConsultantsStateError {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
List<FeedConsultantModel> consultantsList,
bool isLoading,
)?
loaded,
List<FeedConsultantModel> consultantsList, bool isLoading)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return error?.call(errorMessage);
@@ -657,7 +624,7 @@ class _$ConsultantsStateErrorImpl implements ConsultantsStateError {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<FeedConsultantModel> consultantsList, bool isLoading)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -715,5 +682,5 @@ abstract class ConsultantsStateError implements ConsultantsState {
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ConsultantsStateErrorImplCopyWith<_$ConsultantsStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -56,7 +56,7 @@ class DietsCubit extends Cubit<DietsState> {
emit(state.copyWith(filterState: state.filterState.copyWith(typeIndex: index), errorMessage: null));
EasyDebounce.debounce(
'loadDiets',
Duration(seconds: 1),
const Duration(seconds: 1),
() => loadDiets(
query: _query,
),
@@ -67,7 +67,7 @@ class DietsCubit extends Cubit<DietsState> {
emit(state.copyWith(filterState: state.filterState.copyWith(sortingIndex: index), errorMessage: null));
EasyDebounce.debounce(
'loadDiets',
Duration(seconds: 1),
const Duration(seconds: 1),
() => loadDiets(
query: _query,
),
@@ -78,7 +78,7 @@ class DietsCubit extends Cubit<DietsState> {
emit(state.copyWith(filterState: state.filterState.copyWith(durationIndex: index), errorMessage: null));
EasyDebounce.debounce(
'loadDiets',
Duration(seconds: 1),
const Duration(seconds: 1),
() => loadDiets(
query: _query,
),
@@ -186,7 +186,7 @@ class DietsCubit extends Cubit<DietsState> {
}
EasyDebounce.debounce(
'like_diet',
Duration(milliseconds: 200),
const Duration(milliseconds: 200),
() async {
try {
await dietsRepository.likeDiet(id);
@@ -282,7 +282,7 @@ class DietsCubit extends Cubit<DietsState> {
);
EasyDebounce.debounce(
'add_or_remove_diet_from_favorite',
Duration(milliseconds: 200),
const Duration(milliseconds: 200),
() async {
try {
await dietsRepository.addToFavorite(id);
@@ -322,7 +322,7 @@ class DietsCubit extends Cubit<DietsState> {
);
EasyDebounce.debounce(
'add_or_remove_diet_from_favorite',
Duration(milliseconds: 200),
const Duration(milliseconds: 200),
() async {
try {
await dietsRepository.removeFromFavorite(id);

View File

@@ -12,7 +12,7 @@ class DietsState with _$DietsState {
required String? errorMessage,
}) = _DietsState;
factory DietsState.initial() => DietsState(
factory DietsState.initial() => const DietsState(
filterState: DietsFilterState(
durationIndex: 0,
sortingIndex: 0,

View File

@@ -12,8 +12,7 @@ part of 'diets_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$DietsState {
@@ -32,16 +31,14 @@ mixin _$DietsState {
/// @nodoc
abstract class $DietsStateCopyWith<$Res> {
factory $DietsStateCopyWith(
DietsState value,
$Res Function(DietsState) then,
) = _$DietsStateCopyWithImpl<$Res, DietsState>;
DietsState value, $Res Function(DietsState) then) =
_$DietsStateCopyWithImpl<$Res, DietsState>;
@useResult
$Res call({
DietsFilterState filterState,
List<Diet> dietsList,
bool isLoading,
String? errorMessage,
});
$Res call(
{DietsFilterState filterState,
List<Diet> dietsList,
bool isLoading,
String? errorMessage});
$DietsFilterStateCopyWith<$Res> get filterState;
}
@@ -66,31 +63,24 @@ class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState>
Object? isLoading = null,
Object? errorMessage = freezed,
}) {
return _then(
_value.copyWith(
filterState:
null == filterState
? _value.filterState
: filterState // ignore: cast_nullable_to_non_nullable
as DietsFilterState,
dietsList:
null == dietsList
? _value.dietsList
: dietsList // ignore: cast_nullable_to_non_nullable
as List<Diet>,
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage:
freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
)
as $Val,
);
return _then(_value.copyWith(
filterState: null == filterState
? _value.filterState
: filterState // ignore: cast_nullable_to_non_nullable
as DietsFilterState,
dietsList: null == dietsList
? _value.dietsList
: dietsList // ignore: cast_nullable_to_non_nullable
as List<Diet>,
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage: freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
/// Create a copy of DietsState
@@ -108,17 +98,15 @@ class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState>
abstract class _$$DietsStateImplCopyWith<$Res>
implements $DietsStateCopyWith<$Res> {
factory _$$DietsStateImplCopyWith(
_$DietsStateImpl value,
$Res Function(_$DietsStateImpl) then,
) = __$$DietsStateImplCopyWithImpl<$Res>;
_$DietsStateImpl value, $Res Function(_$DietsStateImpl) then) =
__$$DietsStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
DietsFilterState filterState,
List<Diet> dietsList,
bool isLoading,
String? errorMessage,
});
$Res call(
{DietsFilterState filterState,
List<Diet> dietsList,
bool isLoading,
String? errorMessage});
@override
$DietsFilterStateCopyWith<$Res> get filterState;
@@ -129,9 +117,8 @@ class __$$DietsStateImplCopyWithImpl<$Res>
extends _$DietsStateCopyWithImpl<$Res, _$DietsStateImpl>
implements _$$DietsStateImplCopyWith<$Res> {
__$$DietsStateImplCopyWithImpl(
_$DietsStateImpl _value,
$Res Function(_$DietsStateImpl) _then,
) : super(_value, _then);
_$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.
@@ -143,42 +130,36 @@ class __$$DietsStateImplCopyWithImpl<$Res>
Object? isLoading = null,
Object? errorMessage = freezed,
}) {
return _then(
_$DietsStateImpl(
filterState:
null == filterState
? _value.filterState
: filterState // ignore: cast_nullable_to_non_nullable
as DietsFilterState,
dietsList:
null == dietsList
? _value._dietsList
: dietsList // ignore: cast_nullable_to_non_nullable
as List<Diet>,
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage:
freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
),
);
return _then(_$DietsStateImpl(
filterState: null == filterState
? _value.filterState
: filterState // ignore: cast_nullable_to_non_nullable
as DietsFilterState,
dietsList: null == dietsList
? _value._dietsList
: dietsList // ignore: cast_nullable_to_non_nullable
as List<Diet>,
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage: freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
class _$DietsStateImpl implements _DietsState {
const _$DietsStateImpl({
required this.filterState,
required final List<Diet> dietsList,
required this.isLoading,
required this.errorMessage,
}) : _dietsList = dietsList;
const _$DietsStateImpl(
{required this.filterState,
required final List<Diet> dietsList,
required this.isLoading,
required this.errorMessage})
: _dietsList = dietsList;
@override
final DietsFilterState filterState;
@@ -207,10 +188,8 @@ class _$DietsStateImpl implements _DietsState {
other is _$DietsStateImpl &&
(identical(other.filterState, filterState) ||
other.filterState == filterState) &&
const DeepCollectionEquality().equals(
other._dietsList,
_dietsList,
) &&
const DeepCollectionEquality()
.equals(other._dietsList, _dietsList) &&
(identical(other.isLoading, isLoading) ||
other.isLoading == isLoading) &&
(identical(other.errorMessage, errorMessage) ||
@@ -218,13 +197,8 @@ class _$DietsStateImpl implements _DietsState {
}
@override
int get hashCode => Object.hash(
runtimeType,
filterState,
const DeepCollectionEquality().hash(_dietsList),
isLoading,
errorMessage,
);
int get hashCode => Object.hash(runtimeType, filterState,
const DeepCollectionEquality().hash(_dietsList), isLoading, errorMessage);
/// Create a copy of DietsState
/// with the given fields replaced by the non-null parameter values.
@@ -236,12 +210,11 @@ class _$DietsStateImpl implements _DietsState {
}
abstract class _DietsState implements DietsState {
const factory _DietsState({
required final DietsFilterState filterState,
required final List<Diet> dietsList,
required final bool isLoading,
required final String? errorMessage,
}) = _$DietsStateImpl;
const factory _DietsState(
{required final DietsFilterState filterState,
required final List<Diet> dietsList,
required final bool isLoading,
required final String? errorMessage}) = _$DietsStateImpl;
@override
DietsFilterState get filterState;
@@ -276,9 +249,8 @@ mixin _$DietsFilterState {
/// @nodoc
abstract class $DietsFilterStateCopyWith<$Res> {
factory $DietsFilterStateCopyWith(
DietsFilterState value,
$Res Function(DietsFilterState) then,
) = _$DietsFilterStateCopyWithImpl<$Res, DietsFilterState>;
DietsFilterState value, $Res Function(DietsFilterState) then) =
_$DietsFilterStateCopyWithImpl<$Res, DietsFilterState>;
@useResult
$Res call({int sortingIndex, int durationIndex, int typeIndex});
}
@@ -302,36 +274,29 @@ class _$DietsFilterStateCopyWithImpl<$Res, $Val extends DietsFilterState>
Object? durationIndex = null,
Object? typeIndex = null,
}) {
return _then(
_value.copyWith(
sortingIndex:
null == sortingIndex
? _value.sortingIndex
: sortingIndex // ignore: cast_nullable_to_non_nullable
as int,
durationIndex:
null == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int,
typeIndex:
null == typeIndex
? _value.typeIndex
: typeIndex // ignore: cast_nullable_to_non_nullable
as int,
)
as $Val,
);
return _then(_value.copyWith(
sortingIndex: null == sortingIndex
? _value.sortingIndex
: sortingIndex // ignore: cast_nullable_to_non_nullable
as int,
durationIndex: null == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int,
typeIndex: null == typeIndex
? _value.typeIndex
: typeIndex // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
/// @nodoc
abstract class _$$DietsFilterStateImplCopyWith<$Res>
implements $DietsFilterStateCopyWith<$Res> {
factory _$$DietsFilterStateImplCopyWith(
_$DietsFilterStateImpl value,
$Res Function(_$DietsFilterStateImpl) then,
) = __$$DietsFilterStateImplCopyWithImpl<$Res>;
factory _$$DietsFilterStateImplCopyWith(_$DietsFilterStateImpl value,
$Res Function(_$DietsFilterStateImpl) then) =
__$$DietsFilterStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int sortingIndex, int durationIndex, int typeIndex});
@@ -341,10 +306,9 @@ abstract class _$$DietsFilterStateImplCopyWith<$Res>
class __$$DietsFilterStateImplCopyWithImpl<$Res>
extends _$DietsFilterStateCopyWithImpl<$Res, _$DietsFilterStateImpl>
implements _$$DietsFilterStateImplCopyWith<$Res> {
__$$DietsFilterStateImplCopyWithImpl(
_$DietsFilterStateImpl _value,
$Res Function(_$DietsFilterStateImpl) _then,
) : super(_value, _then);
__$$DietsFilterStateImplCopyWithImpl(_$DietsFilterStateImpl _value,
$Res Function(_$DietsFilterStateImpl) _then)
: super(_value, _then);
/// Create a copy of DietsFilterState
/// with the given fields replaced by the non-null parameter values.
@@ -355,36 +319,30 @@ class __$$DietsFilterStateImplCopyWithImpl<$Res>
Object? durationIndex = null,
Object? typeIndex = null,
}) {
return _then(
_$DietsFilterStateImpl(
sortingIndex:
null == sortingIndex
? _value.sortingIndex
: sortingIndex // ignore: cast_nullable_to_non_nullable
as int,
durationIndex:
null == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int,
typeIndex:
null == typeIndex
? _value.typeIndex
: typeIndex // ignore: cast_nullable_to_non_nullable
as int,
),
);
return _then(_$DietsFilterStateImpl(
sortingIndex: null == sortingIndex
? _value.sortingIndex
: sortingIndex // ignore: cast_nullable_to_non_nullable
as int,
durationIndex: null == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int,
typeIndex: null == typeIndex
? _value.typeIndex
: typeIndex // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// @nodoc
class _$DietsFilterStateImpl implements _DietsFilterState {
const _$DietsFilterStateImpl({
required this.sortingIndex,
required this.durationIndex,
required this.typeIndex,
});
const _$DietsFilterStateImpl(
{required this.sortingIndex,
required this.durationIndex,
required this.typeIndex});
@override
final int sortingIndex;
@@ -422,17 +380,14 @@ class _$DietsFilterStateImpl implements _DietsFilterState {
@pragma('vm:prefer-inline')
_$$DietsFilterStateImplCopyWith<_$DietsFilterStateImpl> get copyWith =>
__$$DietsFilterStateImplCopyWithImpl<_$DietsFilterStateImpl>(
this,
_$identity,
);
this, _$identity);
}
abstract class _DietsFilterState implements DietsFilterState {
const factory _DietsFilterState({
required final int sortingIndex,
required final int durationIndex,
required final int typeIndex,
}) = _$DietsFilterStateImpl;
const factory _DietsFilterState(
{required final int sortingIndex,
required final int durationIndex,
required final int typeIndex}) = _$DietsFilterStateImpl;
@override
int get sortingIndex;

View File

@@ -12,8 +12,7 @@ part of 'feed_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$FeedState {
@@ -22,43 +21,46 @@ mixin _$FeedState {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
List<FeedBlogPostModel> feedBlogPostList,
bool isLoading,
)
loaded,
List<FeedBlogPostModel> feedBlogPostList, bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<FeedBlogPostModel> feedBlogPostList, bool isLoading)?
loaded,
loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<FeedBlogPostModel> feedBlogPostList, bool isLoading)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_FeedState value) $default, {
required TResult Function(FeedStateLoading value) loading,
required TResult Function(FeedStateLoaded value) loaded,
required TResult Function(FeedStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_FeedState value)? $default, {
TResult? Function(FeedStateLoading value)? loading,
TResult? Function(FeedStateLoaded value)? loaded,
TResult? Function(FeedStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_FeedState value)? $default, {
@@ -66,7 +68,8 @@ mixin _$FeedState {
TResult Function(FeedStateLoaded value)? loaded,
TResult Function(FeedStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
@@ -92,9 +95,8 @@ class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState>
/// @nodoc
abstract class _$$FeedStateImplCopyWith<$Res> {
factory _$$FeedStateImplCopyWith(
_$FeedStateImpl value,
$Res Function(_$FeedStateImpl) then,
) = __$$FeedStateImplCopyWithImpl<$Res>;
_$FeedStateImpl value, $Res Function(_$FeedStateImpl) then) =
__$$FeedStateImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -102,9 +104,8 @@ class __$$FeedStateImplCopyWithImpl<$Res>
extends _$FeedStateCopyWithImpl<$Res, _$FeedStateImpl>
implements _$$FeedStateImplCopyWith<$Res> {
__$$FeedStateImplCopyWithImpl(
_$FeedStateImpl _value,
$Res Function(_$FeedStateImpl) _then,
) : super(_value, _then);
_$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.
@@ -135,10 +136,8 @@ class _$FeedStateImpl implements _FeedState {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
List<FeedBlogPostModel> feedBlogPostList,
bool isLoading,
)
loaded,
List<FeedBlogPostModel> feedBlogPostList, bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return $default();
@@ -150,7 +149,7 @@ class _$FeedStateImpl implements _FeedState {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<FeedBlogPostModel> feedBlogPostList, bool isLoading)?
loaded,
loaded,
TResult? Function(String errorMessage)? error,
}) {
return $default?.call();
@@ -162,7 +161,7 @@ class _$FeedStateImpl implements _FeedState {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<FeedBlogPostModel> feedBlogPostList, bool isLoading)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -216,20 +215,18 @@ abstract class _FeedState implements FeedState {
/// @nodoc
abstract class _$$FeedStateLoadingImplCopyWith<$Res> {
factory _$$FeedStateLoadingImplCopyWith(
_$FeedStateLoadingImpl value,
$Res Function(_$FeedStateLoadingImpl) then,
) = __$$FeedStateLoadingImplCopyWithImpl<$Res>;
factory _$$FeedStateLoadingImplCopyWith(_$FeedStateLoadingImpl value,
$Res Function(_$FeedStateLoadingImpl) then) =
__$$FeedStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$FeedStateLoadingImplCopyWithImpl<$Res>
extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadingImpl>
implements _$$FeedStateLoadingImplCopyWith<$Res> {
__$$FeedStateLoadingImplCopyWithImpl(
_$FeedStateLoadingImpl _value,
$Res Function(_$FeedStateLoadingImpl) _then,
) : super(_value, _then);
__$$FeedStateLoadingImplCopyWithImpl(_$FeedStateLoadingImpl _value,
$Res Function(_$FeedStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of FeedState
/// with the given fields replaced by the non-null parameter values.
@@ -260,10 +257,8 @@ class _$FeedStateLoadingImpl implements FeedStateLoading {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
List<FeedBlogPostModel> feedBlogPostList,
bool isLoading,
)
loaded,
List<FeedBlogPostModel> feedBlogPostList, bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return loading();
@@ -275,7 +270,7 @@ class _$FeedStateLoadingImpl implements FeedStateLoading {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<FeedBlogPostModel> feedBlogPostList, bool isLoading)?
loaded,
loaded,
TResult? Function(String errorMessage)? error,
}) {
return loading?.call();
@@ -287,7 +282,7 @@ class _$FeedStateLoadingImpl implements FeedStateLoading {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<FeedBlogPostModel> feedBlogPostList, bool isLoading)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -341,10 +336,9 @@ abstract class FeedStateLoading implements FeedState {
/// @nodoc
abstract class _$$FeedStateLoadedImplCopyWith<$Res> {
factory _$$FeedStateLoadedImplCopyWith(
_$FeedStateLoadedImpl value,
$Res Function(_$FeedStateLoadedImpl) then,
) = __$$FeedStateLoadedImplCopyWithImpl<$Res>;
factory _$$FeedStateLoadedImplCopyWith(_$FeedStateLoadedImpl value,
$Res Function(_$FeedStateLoadedImpl) then) =
__$$FeedStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({List<FeedBlogPostModel> feedBlogPostList, bool isLoading});
}
@@ -354,39 +348,37 @@ class __$$FeedStateLoadedImplCopyWithImpl<$Res>
extends _$FeedStateCopyWithImpl<$Res, _$FeedStateLoadedImpl>
implements _$$FeedStateLoadedImplCopyWith<$Res> {
__$$FeedStateLoadedImplCopyWithImpl(
_$FeedStateLoadedImpl _value,
$Res Function(_$FeedStateLoadedImpl) _then,
) : super(_value, _then);
_$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({Object? feedBlogPostList = null, Object? isLoading = null}) {
return _then(
_$FeedStateLoadedImpl(
feedBlogPostList:
null == feedBlogPostList
? _value._feedBlogPostList
: feedBlogPostList // ignore: cast_nullable_to_non_nullable
as List<FeedBlogPostModel>,
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
),
);
$Res call({
Object? feedBlogPostList = null,
Object? isLoading = null,
}) {
return _then(_$FeedStateLoadedImpl(
feedBlogPostList: null == feedBlogPostList
? _value._feedBlogPostList
: feedBlogPostList // ignore: cast_nullable_to_non_nullable
as List<FeedBlogPostModel>,
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// @nodoc
class _$FeedStateLoadedImpl implements FeedStateLoaded {
const _$FeedStateLoadedImpl({
required final List<FeedBlogPostModel> feedBlogPostList,
required this.isLoading,
}) : _feedBlogPostList = feedBlogPostList;
const _$FeedStateLoadedImpl(
{required final List<FeedBlogPostModel> feedBlogPostList,
required this.isLoading})
: _feedBlogPostList = feedBlogPostList;
final List<FeedBlogPostModel> _feedBlogPostList;
@override
@@ -410,20 +402,15 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$FeedStateLoadedImpl &&
const DeepCollectionEquality().equals(
other._feedBlogPostList,
_feedBlogPostList,
) &&
const DeepCollectionEquality()
.equals(other._feedBlogPostList, _feedBlogPostList) &&
(identical(other.isLoading, isLoading) ||
other.isLoading == isLoading));
}
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_feedBlogPostList),
isLoading,
);
int get hashCode => Object.hash(runtimeType,
const DeepCollectionEquality().hash(_feedBlogPostList), isLoading);
/// Create a copy of FeedState
/// with the given fields replaced by the non-null parameter values.
@@ -432,9 +419,7 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded {
@pragma('vm:prefer-inline')
_$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith =>
__$$FeedStateLoadedImplCopyWithImpl<_$FeedStateLoadedImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -442,10 +427,8 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
List<FeedBlogPostModel> feedBlogPostList,
bool isLoading,
)
loaded,
List<FeedBlogPostModel> feedBlogPostList, bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return loaded(feedBlogPostList, isLoading);
@@ -457,7 +440,7 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<FeedBlogPostModel> feedBlogPostList, bool isLoading)?
loaded,
loaded,
TResult? Function(String errorMessage)? error,
}) {
return loaded?.call(feedBlogPostList, isLoading);
@@ -469,7 +452,7 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<FeedBlogPostModel> feedBlogPostList, bool isLoading)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -518,10 +501,9 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded {
}
abstract class FeedStateLoaded implements FeedState {
const factory FeedStateLoaded({
required final List<FeedBlogPostModel> feedBlogPostList,
required final bool isLoading,
}) = _$FeedStateLoadedImpl;
const factory FeedStateLoaded(
{required final List<FeedBlogPostModel> feedBlogPostList,
required final bool isLoading}) = _$FeedStateLoadedImpl;
List<FeedBlogPostModel> get feedBlogPostList;
bool get isLoading;
@@ -535,10 +517,9 @@ abstract class FeedStateLoaded implements FeedState {
/// @nodoc
abstract class _$$FeedStateErrorImplCopyWith<$Res> {
factory _$$FeedStateErrorImplCopyWith(
_$FeedStateErrorImpl value,
$Res Function(_$FeedStateErrorImpl) then,
) = __$$FeedStateErrorImplCopyWithImpl<$Res>;
factory _$$FeedStateErrorImplCopyWith(_$FeedStateErrorImpl value,
$Res Function(_$FeedStateErrorImpl) then) =
__$$FeedStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -548,24 +529,22 @@ class __$$FeedStateErrorImplCopyWithImpl<$Res>
extends _$FeedStateCopyWithImpl<$Res, _$FeedStateErrorImpl>
implements _$$FeedStateErrorImplCopyWith<$Res> {
__$$FeedStateErrorImplCopyWithImpl(
_$FeedStateErrorImpl _value,
$Res Function(_$FeedStateErrorImpl) _then,
) : super(_value, _then);
_$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({Object? errorMessage = null}) {
return _then(
_$FeedStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$FeedStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -601,9 +580,7 @@ class _$FeedStateErrorImpl implements FeedStateError {
@pragma('vm:prefer-inline')
_$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith =>
__$$FeedStateErrorImplCopyWithImpl<_$FeedStateErrorImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -611,10 +588,8 @@ class _$FeedStateErrorImpl implements FeedStateError {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
List<FeedBlogPostModel> feedBlogPostList,
bool isLoading,
)
loaded,
List<FeedBlogPostModel> feedBlogPostList, bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return error(errorMessage);
@@ -626,7 +601,7 @@ class _$FeedStateErrorImpl implements FeedStateError {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<FeedBlogPostModel> feedBlogPostList, bool isLoading)?
loaded,
loaded,
TResult? Function(String errorMessage)? error,
}) {
return error?.call(errorMessage);
@@ -638,7 +613,7 @@ class _$FeedStateErrorImpl implements FeedStateError {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<FeedBlogPostModel> feedBlogPostList, bool isLoading)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {

View File

@@ -45,7 +45,7 @@ class PlansCubit extends Cubit<PlansState> {
emit(state.copyWith(filterState: state.filterState.copyWith(durationIndex: index), errorMessage: null));
EasyDebounce.debounce(
'loadPlans',
Duration(seconds: 1),
const Duration(seconds: 1),
() => loadPlans(
query: _query,
),
@@ -56,7 +56,7 @@ class PlansCubit extends Cubit<PlansState> {
emit(state.copyWith(filterState: state.filterState.copyWith(typeIndex: index), errorMessage: null));
EasyDebounce.debounce(
'loadPlans',
Duration(seconds: 1),
const Duration(seconds: 1),
() => loadPlans(
query: _query,
),
@@ -224,7 +224,7 @@ class PlansCubit extends Cubit<PlansState> {
);
EasyDebounce.debounce(
'add_or_remove_plan_from_favorite',
Duration(milliseconds: 200),
const Duration(milliseconds: 200),
() async {
try {
await planRepository.addToFavorite(slug);
@@ -264,7 +264,7 @@ class PlansCubit extends Cubit<PlansState> {
);
EasyDebounce.debounce(
'add_or_remove_plan_from_favorite',
Duration(milliseconds: 200),
const Duration(milliseconds: 200),
() async {
try {
await planRepository.removeFromFavorite(slug);
@@ -320,7 +320,7 @@ class PlansCubit extends Cubit<PlansState> {
}
EasyDebounce.debounce(
'like_plan',
Duration(milliseconds: 200),
const Duration(milliseconds: 200),
() async {
try {
await planRepository.likePlan(slug);

View File

@@ -12,8 +12,7 @@ part of 'plans_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$PlansState {
@@ -34,18 +33,16 @@ mixin _$PlansState {
/// @nodoc
abstract class $PlansStateCopyWith<$Res> {
factory $PlansStateCopyWith(
PlansState value,
$Res Function(PlansState) then,
) = _$PlansStateCopyWithImpl<$Res, PlansState>;
PlansState value, $Res Function(PlansState) then) =
_$PlansStateCopyWithImpl<$Res, PlansState>;
@useResult
$Res call({
bool isLoading,
List<PlanModel> plans,
String? errorMessage,
PlansFilterState filterState,
int minPlanPrice,
int maxPlanPrice,
});
$Res call(
{bool isLoading,
List<PlanModel> plans,
String? errorMessage,
PlansFilterState filterState,
int minPlanPrice,
int maxPlanPrice});
$PlansFilterStateCopyWith<$Res> get filterState;
}
@@ -72,41 +69,32 @@ class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState>
Object? minPlanPrice = null,
Object? maxPlanPrice = null,
}) {
return _then(
_value.copyWith(
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
plans:
null == plans
? _value.plans
: plans // ignore: cast_nullable_to_non_nullable
as List<PlanModel>,
errorMessage:
freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
filterState:
null == filterState
? _value.filterState
: filterState // ignore: cast_nullable_to_non_nullable
as PlansFilterState,
minPlanPrice:
null == minPlanPrice
? _value.minPlanPrice
: minPlanPrice // ignore: cast_nullable_to_non_nullable
as int,
maxPlanPrice:
null == maxPlanPrice
? _value.maxPlanPrice
: maxPlanPrice // ignore: cast_nullable_to_non_nullable
as int,
)
as $Val,
);
return _then(_value.copyWith(
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
plans: null == plans
? _value.plans
: plans // ignore: cast_nullable_to_non_nullable
as List<PlanModel>,
errorMessage: freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
filterState: null == filterState
? _value.filterState
: filterState // ignore: cast_nullable_to_non_nullable
as PlansFilterState,
minPlanPrice: null == minPlanPrice
? _value.minPlanPrice
: minPlanPrice // ignore: cast_nullable_to_non_nullable
as int,
maxPlanPrice: null == maxPlanPrice
? _value.maxPlanPrice
: maxPlanPrice // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
/// Create a copy of PlansState
@@ -124,19 +112,17 @@ class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState>
abstract class _$$PlansStateImplCopyWith<$Res>
implements $PlansStateCopyWith<$Res> {
factory _$$PlansStateImplCopyWith(
_$PlansStateImpl value,
$Res Function(_$PlansStateImpl) then,
) = __$$PlansStateImplCopyWithImpl<$Res>;
_$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) =
__$$PlansStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
bool isLoading,
List<PlanModel> plans,
String? errorMessage,
PlansFilterState filterState,
int minPlanPrice,
int maxPlanPrice,
});
$Res call(
{bool isLoading,
List<PlanModel> plans,
String? errorMessage,
PlansFilterState filterState,
int minPlanPrice,
int maxPlanPrice});
@override
$PlansFilterStateCopyWith<$Res> get filterState;
@@ -147,9 +133,8 @@ class __$$PlansStateImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl>
implements _$$PlansStateImplCopyWith<$Res> {
__$$PlansStateImplCopyWithImpl(
_$PlansStateImpl _value,
$Res Function(_$PlansStateImpl) _then,
) : super(_value, _then);
_$PlansStateImpl _value, $Res Function(_$PlansStateImpl) _then)
: super(_value, _then);
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@@ -163,54 +148,46 @@ class __$$PlansStateImplCopyWithImpl<$Res>
Object? minPlanPrice = null,
Object? maxPlanPrice = null,
}) {
return _then(
_$PlansStateImpl(
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
plans:
null == plans
? _value._plans
: plans // ignore: cast_nullable_to_non_nullable
as List<PlanModel>,
errorMessage:
freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
filterState:
null == filterState
? _value.filterState
: filterState // ignore: cast_nullable_to_non_nullable
as PlansFilterState,
minPlanPrice:
null == minPlanPrice
? _value.minPlanPrice
: minPlanPrice // ignore: cast_nullable_to_non_nullable
as int,
maxPlanPrice:
null == maxPlanPrice
? _value.maxPlanPrice
: maxPlanPrice // ignore: cast_nullable_to_non_nullable
as int,
),
);
return _then(_$PlansStateImpl(
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
plans: null == plans
? _value._plans
: plans // ignore: cast_nullable_to_non_nullable
as List<PlanModel>,
errorMessage: freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
filterState: null == filterState
? _value.filterState
: filterState // ignore: cast_nullable_to_non_nullable
as PlansFilterState,
minPlanPrice: null == minPlanPrice
? _value.minPlanPrice
: minPlanPrice // ignore: cast_nullable_to_non_nullable
as int,
maxPlanPrice: null == maxPlanPrice
? _value.maxPlanPrice
: maxPlanPrice // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// @nodoc
class _$PlansStateImpl implements _PlansState {
const _$PlansStateImpl({
required this.isLoading,
required final List<PlanModel> plans,
required this.errorMessage,
required this.filterState,
this.minPlanPrice = 0,
this.maxPlanPrice = 0,
}) : _plans = plans;
const _$PlansStateImpl(
{required this.isLoading,
required final List<PlanModel> plans,
required this.errorMessage,
required this.filterState,
this.minPlanPrice = 0,
this.maxPlanPrice = 0})
: _plans = plans;
@override
final bool isLoading;
@@ -258,14 +235,13 @@ class _$PlansStateImpl implements _PlansState {
@override
int get hashCode => Object.hash(
runtimeType,
isLoading,
const DeepCollectionEquality().hash(_plans),
errorMessage,
filterState,
minPlanPrice,
maxPlanPrice,
);
runtimeType,
isLoading,
const DeepCollectionEquality().hash(_plans),
errorMessage,
filterState,
minPlanPrice,
maxPlanPrice);
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@@ -277,14 +253,13 @@ class _$PlansStateImpl implements _PlansState {
}
abstract class _PlansState implements PlansState {
const factory _PlansState({
required final bool isLoading,
required final List<PlanModel> plans,
required final String? errorMessage,
required final PlansFilterState filterState,
final int minPlanPrice,
final int maxPlanPrice,
}) = _$PlansStateImpl;
const factory _PlansState(
{required final bool isLoading,
required final List<PlanModel> plans,
required final String? errorMessage,
required final PlansFilterState filterState,
final int minPlanPrice,
final int maxPlanPrice}) = _$PlansStateImpl;
@override
bool get isLoading;
@@ -323,9 +298,8 @@ mixin _$PlansFilterState {
/// @nodoc
abstract class $PlansFilterStateCopyWith<$Res> {
factory $PlansFilterStateCopyWith(
PlansFilterState value,
$Res Function(PlansFilterState) then,
) = _$PlansFilterStateCopyWithImpl<$Res, PlansFilterState>;
PlansFilterState value, $Res Function(PlansFilterState) then) =
_$PlansFilterStateCopyWithImpl<$Res, PlansFilterState>;
@useResult
$Res call({(int?, int?) priceFilter, int durationIndex, int typeIndex});
}
@@ -349,36 +323,29 @@ class _$PlansFilterStateCopyWithImpl<$Res, $Val extends PlansFilterState>
Object? durationIndex = null,
Object? typeIndex = null,
}) {
return _then(
_value.copyWith(
priceFilter:
null == priceFilter
? _value.priceFilter
: priceFilter // ignore: cast_nullable_to_non_nullable
as (int?, int?),
durationIndex:
null == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int,
typeIndex:
null == typeIndex
? _value.typeIndex
: typeIndex // ignore: cast_nullable_to_non_nullable
as int,
)
as $Val,
);
return _then(_value.copyWith(
priceFilter: null == priceFilter
? _value.priceFilter
: priceFilter // ignore: cast_nullable_to_non_nullable
as (int?, int?),
durationIndex: null == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int,
typeIndex: null == typeIndex
? _value.typeIndex
: typeIndex // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
/// @nodoc
abstract class _$$PlansFilterStateImplCopyWith<$Res>
implements $PlansFilterStateCopyWith<$Res> {
factory _$$PlansFilterStateImplCopyWith(
_$PlansFilterStateImpl value,
$Res Function(_$PlansFilterStateImpl) then,
) = __$$PlansFilterStateImplCopyWithImpl<$Res>;
factory _$$PlansFilterStateImplCopyWith(_$PlansFilterStateImpl value,
$Res Function(_$PlansFilterStateImpl) then) =
__$$PlansFilterStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({(int?, int?) priceFilter, int durationIndex, int typeIndex});
@@ -388,10 +355,9 @@ abstract class _$$PlansFilterStateImplCopyWith<$Res>
class __$$PlansFilterStateImplCopyWithImpl<$Res>
extends _$PlansFilterStateCopyWithImpl<$Res, _$PlansFilterStateImpl>
implements _$$PlansFilterStateImplCopyWith<$Res> {
__$$PlansFilterStateImplCopyWithImpl(
_$PlansFilterStateImpl _value,
$Res Function(_$PlansFilterStateImpl) _then,
) : super(_value, _then);
__$$PlansFilterStateImplCopyWithImpl(_$PlansFilterStateImpl _value,
$Res Function(_$PlansFilterStateImpl) _then)
: super(_value, _then);
/// Create a copy of PlansFilterState
/// with the given fields replaced by the non-null parameter values.
@@ -402,36 +368,30 @@ class __$$PlansFilterStateImplCopyWithImpl<$Res>
Object? durationIndex = null,
Object? typeIndex = null,
}) {
return _then(
_$PlansFilterStateImpl(
priceFilter:
null == priceFilter
? _value.priceFilter
: priceFilter // ignore: cast_nullable_to_non_nullable
as (int?, int?),
durationIndex:
null == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int,
typeIndex:
null == typeIndex
? _value.typeIndex
: typeIndex // ignore: cast_nullable_to_non_nullable
as int,
),
);
return _then(_$PlansFilterStateImpl(
priceFilter: null == priceFilter
? _value.priceFilter
: priceFilter // ignore: cast_nullable_to_non_nullable
as (int?, int?),
durationIndex: null == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int,
typeIndex: null == typeIndex
? _value.typeIndex
: typeIndex // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// @nodoc
class _$PlansFilterStateImpl implements _PlansFilterState {
const _$PlansFilterStateImpl({
required this.priceFilter,
required this.durationIndex,
required this.typeIndex,
});
const _$PlansFilterStateImpl(
{required this.priceFilter,
required this.durationIndex,
required this.typeIndex});
@override
final (int?, int?) priceFilter;
@@ -469,17 +429,14 @@ class _$PlansFilterStateImpl implements _PlansFilterState {
@pragma('vm:prefer-inline')
_$$PlansFilterStateImplCopyWith<_$PlansFilterStateImpl> get copyWith =>
__$$PlansFilterStateImplCopyWithImpl<_$PlansFilterStateImpl>(
this,
_$identity,
);
this, _$identity);
}
abstract class _PlansFilterState implements PlansFilterState {
const factory _PlansFilterState({
required final (int?, int?) priceFilter,
required final int durationIndex,
required final int typeIndex,
}) = _$PlansFilterStateImpl;
const factory _PlansFilterState(
{required final (int?, int?) priceFilter,
required final int durationIndex,
required final int typeIndex}) = _$PlansFilterStateImpl;
@override
(int?, int?) get priceFilter;

View File

@@ -12,8 +12,7 @@ part of 'profile_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$ProfileState {
@@ -29,9 +28,8 @@ mixin _$ProfileState {
/// @nodoc
abstract class $ProfileStateCopyWith<$Res> {
factory $ProfileStateCopyWith(
ProfileState value,
$Res Function(ProfileState) then,
) = _$ProfileStateCopyWithImpl<$Res, ProfileState>;
ProfileState value, $Res Function(ProfileState) then) =
_$ProfileStateCopyWithImpl<$Res, ProfileState>;
@useResult
$Res call({ProfileModel? profile});
@@ -52,17 +50,15 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? profile = freezed}) {
return _then(
_value.copyWith(
profile:
freezed == profile
? _value.profile
: profile // ignore: cast_nullable_to_non_nullable
as ProfileModel?,
)
as $Val,
);
$Res call({
Object? profile = freezed,
}) {
return _then(_value.copyWith(
profile: freezed == profile
? _value.profile
: profile // ignore: cast_nullable_to_non_nullable
as ProfileModel?,
) as $Val);
}
/// Create a copy of ProfileState
@@ -84,9 +80,8 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState>
abstract class _$$ProfileStateImplCopyWith<$Res>
implements $ProfileStateCopyWith<$Res> {
factory _$$ProfileStateImplCopyWith(
_$ProfileStateImpl value,
$Res Function(_$ProfileStateImpl) then,
) = __$$ProfileStateImplCopyWithImpl<$Res>;
_$ProfileStateImpl value, $Res Function(_$ProfileStateImpl) then) =
__$$ProfileStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({ProfileModel? profile});
@@ -100,24 +95,22 @@ class __$$ProfileStateImplCopyWithImpl<$Res>
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateImpl>
implements _$$ProfileStateImplCopyWith<$Res> {
__$$ProfileStateImplCopyWithImpl(
_$ProfileStateImpl _value,
$Res Function(_$ProfileStateImpl) _then,
) : super(_value, _then);
_$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.
@pragma('vm:prefer-inline')
@override
$Res call({Object? profile = freezed}) {
return _then(
_$ProfileStateImpl(
profile:
freezed == profile
? _value.profile
: profile // ignore: cast_nullable_to_non_nullable
as ProfileModel?,
),
);
$Res call({
Object? profile = freezed,
}) {
return _then(_$ProfileStateImpl(
profile: freezed == profile
? _value.profile
: profile // ignore: cast_nullable_to_non_nullable
as ProfileModel?,
));
}
}

View File

@@ -15,7 +15,7 @@ class RecipesCubit extends Cubit<RecipesState> {
final FeedRepository feedRepository;
final RecipeRepository recipeRepository;
final AboutRecipeRepository aboutRecipeRepository;
Set<int> _selectedTags = {};
final Set<int> _selectedTags = {};
int currentPage = 1;
late int lastPage;
bool isLoading = false;
@@ -128,7 +128,7 @@ class RecipesCubit extends Cubit<RecipesState> {
);
EasyDebounce.debounce(
'add_or_remove_plan_from_favorite',
Duration(milliseconds: 200),
const Duration(milliseconds: 200),
() async {
try {
await aboutRecipeRepository.addToFavorite(slug);
@@ -168,7 +168,7 @@ class RecipesCubit extends Cubit<RecipesState> {
);
EasyDebounce.debounce(
'add_or_remove_plan_from_favorite',
Duration(milliseconds: 200),
const Duration(milliseconds: 200),
() async {
try {
await aboutRecipeRepository.removeFromFavorite(slug);
@@ -224,7 +224,7 @@ class RecipesCubit extends Cubit<RecipesState> {
}
EasyDebounce.debounce(
'like_plan',
Duration(milliseconds: 200),
const Duration(milliseconds: 200),
() async {
try {
await aboutRecipeRepository.likeRecipe(slug);

View File

@@ -15,7 +15,7 @@ abstract class RecipesState with _$RecipesState {
String? errorMessage,
}) = _RecipesState;
factory RecipesState.initial() => RecipesState(
factory RecipesState.initial() => const RecipesState(
recipesList: [],
recipesTags: [],
selectedTags: {},

View File

@@ -12,8 +12,7 @@ part of 'recipes_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$RecipesState {
@@ -34,18 +33,16 @@ mixin _$RecipesState {
/// @nodoc
abstract class $RecipesStateCopyWith<$Res> {
factory $RecipesStateCopyWith(
RecipesState value,
$Res Function(RecipesState) then,
) = _$RecipesStateCopyWithImpl<$Res, RecipesState>;
RecipesState value, $Res Function(RecipesState) then) =
_$RecipesStateCopyWithImpl<$Res, RecipesState>;
@useResult
$Res call({
List<Recipe> recipesList,
List<RecipeTag> recipesTags,
Set<int> selectedTags,
int selectedTagsCounter,
bool isLoading,
String? errorMessage,
});
$Res call(
{List<Recipe> recipesList,
List<RecipeTag> recipesTags,
Set<int> selectedTags,
int selectedTagsCounter,
bool isLoading,
String? errorMessage});
}
/// @nodoc
@@ -70,41 +67,32 @@ class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState>
Object? isLoading = null,
Object? errorMessage = freezed,
}) {
return _then(
_value.copyWith(
recipesList:
null == recipesList
? _value.recipesList
: recipesList // ignore: cast_nullable_to_non_nullable
as List<Recipe>,
recipesTags:
null == recipesTags
? _value.recipesTags
: recipesTags // ignore: cast_nullable_to_non_nullable
as List<RecipeTag>,
selectedTags:
null == selectedTags
? _value.selectedTags
: selectedTags // ignore: cast_nullable_to_non_nullable
as Set<int>,
selectedTagsCounter:
null == selectedTagsCounter
? _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,
errorMessage:
freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
)
as $Val,
);
return _then(_value.copyWith(
recipesList: null == recipesList
? _value.recipesList
: recipesList // ignore: cast_nullable_to_non_nullable
as List<Recipe>,
recipesTags: null == recipesTags
? _value.recipesTags
: recipesTags // ignore: cast_nullable_to_non_nullable
as List<RecipeTag>,
selectedTags: null == selectedTags
? _value.selectedTags
: selectedTags // ignore: cast_nullable_to_non_nullable
as Set<int>,
selectedTagsCounter: null == selectedTagsCounter
? _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,
errorMessage: freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
}
@@ -112,19 +100,17 @@ class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState>
abstract class _$$RecipesStateImplCopyWith<$Res>
implements $RecipesStateCopyWith<$Res> {
factory _$$RecipesStateImplCopyWith(
_$RecipesStateImpl value,
$Res Function(_$RecipesStateImpl) then,
) = __$$RecipesStateImplCopyWithImpl<$Res>;
_$RecipesStateImpl value, $Res Function(_$RecipesStateImpl) then) =
__$$RecipesStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
List<Recipe> recipesList,
List<RecipeTag> recipesTags,
Set<int> selectedTags,
int selectedTagsCounter,
bool isLoading,
String? errorMessage,
});
$Res call(
{List<Recipe> recipesList,
List<RecipeTag> recipesTags,
Set<int> selectedTags,
int selectedTagsCounter,
bool isLoading,
String? errorMessage});
}
/// @nodoc
@@ -132,9 +118,8 @@ class __$$RecipesStateImplCopyWithImpl<$Res>
extends _$RecipesStateCopyWithImpl<$Res, _$RecipesStateImpl>
implements _$$RecipesStateImplCopyWith<$Res> {
__$$RecipesStateImplCopyWithImpl(
_$RecipesStateImpl _value,
$Res Function(_$RecipesStateImpl) _then,
) : super(_value, _then);
_$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.
@@ -148,56 +133,48 @@ class __$$RecipesStateImplCopyWithImpl<$Res>
Object? isLoading = null,
Object? errorMessage = freezed,
}) {
return _then(
_$RecipesStateImpl(
recipesList:
null == recipesList
? _value._recipesList
: recipesList // ignore: cast_nullable_to_non_nullable
as List<Recipe>,
recipesTags:
null == recipesTags
? _value._recipesTags
: recipesTags // ignore: cast_nullable_to_non_nullable
as List<RecipeTag>,
selectedTags:
null == selectedTags
? _value._selectedTags
: selectedTags // ignore: cast_nullable_to_non_nullable
as Set<int>,
selectedTagsCounter:
null == selectedTagsCounter
? _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,
errorMessage:
freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
),
);
return _then(_$RecipesStateImpl(
recipesList: null == recipesList
? _value._recipesList
: recipesList // ignore: cast_nullable_to_non_nullable
as List<Recipe>,
recipesTags: null == recipesTags
? _value._recipesTags
: recipesTags // ignore: cast_nullable_to_non_nullable
as List<RecipeTag>,
selectedTags: null == selectedTags
? _value._selectedTags
: selectedTags // ignore: cast_nullable_to_non_nullable
as Set<int>,
selectedTagsCounter: null == selectedTagsCounter
? _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,
errorMessage: freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
class _$RecipesStateImpl implements _RecipesState {
const _$RecipesStateImpl({
required final List<Recipe> recipesList,
required final List<RecipeTag> recipesTags,
required final Set<int> selectedTags,
required this.selectedTagsCounter,
required this.isLoading,
this.errorMessage,
}) : _recipesList = recipesList,
_recipesTags = recipesTags,
_selectedTags = selectedTags;
const _$RecipesStateImpl(
{required final List<Recipe> recipesList,
required final List<RecipeTag> recipesTags,
required final Set<int> selectedTags,
required this.selectedTagsCounter,
required this.isLoading,
this.errorMessage})
: _recipesList = recipesList,
_recipesTags = recipesTags,
_selectedTags = selectedTags;
final List<Recipe> _recipesList;
@override
@@ -240,18 +217,12 @@ class _$RecipesStateImpl implements _RecipesState {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$RecipesStateImpl &&
const DeepCollectionEquality().equals(
other._recipesList,
_recipesList,
) &&
const DeepCollectionEquality().equals(
other._recipesTags,
_recipesTags,
) &&
const DeepCollectionEquality().equals(
other._selectedTags,
_selectedTags,
) &&
const DeepCollectionEquality()
.equals(other._recipesList, _recipesList) &&
const DeepCollectionEquality()
.equals(other._recipesTags, _recipesTags) &&
const DeepCollectionEquality()
.equals(other._selectedTags, _selectedTags) &&
(identical(other.selectedTagsCounter, selectedTagsCounter) ||
other.selectedTagsCounter == selectedTagsCounter) &&
(identical(other.isLoading, isLoading) ||
@@ -262,14 +233,13 @@ class _$RecipesStateImpl implements _RecipesState {
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_recipesList),
const DeepCollectionEquality().hash(_recipesTags),
const DeepCollectionEquality().hash(_selectedTags),
selectedTagsCounter,
isLoading,
errorMessage,
);
runtimeType,
const DeepCollectionEquality().hash(_recipesList),
const DeepCollectionEquality().hash(_recipesTags),
const DeepCollectionEquality().hash(_selectedTags),
selectedTagsCounter,
isLoading,
errorMessage);
/// Create a copy of RecipesState
/// with the given fields replaced by the non-null parameter values.
@@ -281,14 +251,13 @@ class _$RecipesStateImpl implements _RecipesState {
}
abstract class _RecipesState implements RecipesState {
const factory _RecipesState({
required final List<Recipe> recipesList,
required final List<RecipeTag> recipesTags,
required final Set<int> selectedTags,
required final int selectedTagsCounter,
required final bool isLoading,
final String? errorMessage,
}) = _$RecipesStateImpl;
const factory _RecipesState(
{required final List<Recipe> recipesList,
required final List<RecipeTag> recipesTags,
required final Set<int> selectedTags,
required final int selectedTagsCounter,
required final bool isLoading,
final String? errorMessage}) = _$RecipesStateImpl;
@override
List<Recipe> get recipesList;