forked from eatvio/eatvio_app
feat(order info): added order info screen
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user