success order page
This commit is contained in:
parent
137f3d9636
commit
59d4d4c0e5
@ -45,6 +45,25 @@ class OrderLoaderBloc extends Bloc<OrderLoaderEvent, OrderLoaderState> {
|
|||||||
);
|
);
|
||||||
emit(newState);
|
emit(newState);
|
||||||
},
|
},
|
||||||
|
getById: (e) async {
|
||||||
|
emit(state.copyWith(isFetchingById: true, failureOption: none()));
|
||||||
|
|
||||||
|
final failureOrOrder = await _repository.getOrderById(e.id);
|
||||||
|
failureOrOrder.fold(
|
||||||
|
(f) => emit(
|
||||||
|
state.copyWith(failureOption: optionOf(f), isFetching: false),
|
||||||
|
),
|
||||||
|
(order) => emit(
|
||||||
|
state.copyWith(
|
||||||
|
order: order,
|
||||||
|
isFetching: false,
|
||||||
|
failureOption: none(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
emit(state.copyWith(isFetchingById: false));
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,7 @@ mixin _$OrderLoaderEvent {
|
|||||||
dateTimeRangeChange,
|
dateTimeRangeChange,
|
||||||
required TResult Function(String search) searchChange,
|
required TResult Function(String search) searchChange,
|
||||||
required TResult Function(Order order) setSelectedOrder,
|
required TResult Function(Order order) setSelectedOrder,
|
||||||
|
required TResult Function(String id) getById,
|
||||||
required TResult Function(bool isRefresh, String status) fetched,
|
required TResult Function(bool isRefresh, String status) fetched,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -31,6 +32,7 @@ mixin _$OrderLoaderEvent {
|
|||||||
dateTimeRangeChange,
|
dateTimeRangeChange,
|
||||||
TResult? Function(String search)? searchChange,
|
TResult? Function(String search)? searchChange,
|
||||||
TResult? Function(Order order)? setSelectedOrder,
|
TResult? Function(Order order)? setSelectedOrder,
|
||||||
|
TResult? Function(String id)? getById,
|
||||||
TResult? Function(bool isRefresh, String status)? fetched,
|
TResult? Function(bool isRefresh, String status)? fetched,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -38,6 +40,7 @@ mixin _$OrderLoaderEvent {
|
|||||||
TResult Function(DateTime startDate, DateTime endDate)? dateTimeRangeChange,
|
TResult Function(DateTime startDate, DateTime endDate)? dateTimeRangeChange,
|
||||||
TResult Function(String search)? searchChange,
|
TResult Function(String search)? searchChange,
|
||||||
TResult Function(Order order)? setSelectedOrder,
|
TResult Function(Order order)? setSelectedOrder,
|
||||||
|
TResult Function(String id)? getById,
|
||||||
TResult Function(bool isRefresh, String status)? fetched,
|
TResult Function(bool isRefresh, String status)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@ -46,6 +49,7 @@ mixin _$OrderLoaderEvent {
|
|||||||
required TResult Function(_DateTimeRangeChange value) dateTimeRangeChange,
|
required TResult Function(_DateTimeRangeChange value) dateTimeRangeChange,
|
||||||
required TResult Function(_SearchChange value) searchChange,
|
required TResult Function(_SearchChange value) searchChange,
|
||||||
required TResult Function(_SetSelectedOrder value) setSelectedOrder,
|
required TResult Function(_SetSelectedOrder value) setSelectedOrder,
|
||||||
|
required TResult Function(_GetById value) getById,
|
||||||
required TResult Function(_Fetched value) fetched,
|
required TResult Function(_Fetched value) fetched,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -53,6 +57,7 @@ mixin _$OrderLoaderEvent {
|
|||||||
TResult? Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
TResult? Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
TResult? Function(_SearchChange value)? searchChange,
|
TResult? Function(_SearchChange value)? searchChange,
|
||||||
TResult? Function(_SetSelectedOrder value)? setSelectedOrder,
|
TResult? Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult? Function(_GetById value)? getById,
|
||||||
TResult? Function(_Fetched value)? fetched,
|
TResult? Function(_Fetched value)? fetched,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -60,6 +65,7 @@ mixin _$OrderLoaderEvent {
|
|||||||
TResult Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
TResult Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
TResult Function(_SearchChange value)? searchChange,
|
TResult Function(_SearchChange value)? searchChange,
|
||||||
TResult Function(_SetSelectedOrder value)? setSelectedOrder,
|
TResult Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult Function(_GetById value)? getById,
|
||||||
TResult Function(_Fetched value)? fetched,
|
TResult Function(_Fetched value)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@ -172,6 +178,7 @@ class _$DateTimeRangeChangeImpl implements _DateTimeRangeChange {
|
|||||||
dateTimeRangeChange,
|
dateTimeRangeChange,
|
||||||
required TResult Function(String search) searchChange,
|
required TResult Function(String search) searchChange,
|
||||||
required TResult Function(Order order) setSelectedOrder,
|
required TResult Function(Order order) setSelectedOrder,
|
||||||
|
required TResult Function(String id) getById,
|
||||||
required TResult Function(bool isRefresh, String status) fetched,
|
required TResult Function(bool isRefresh, String status) fetched,
|
||||||
}) {
|
}) {
|
||||||
return dateTimeRangeChange(startDate, endDate);
|
return dateTimeRangeChange(startDate, endDate);
|
||||||
@ -184,6 +191,7 @@ class _$DateTimeRangeChangeImpl implements _DateTimeRangeChange {
|
|||||||
dateTimeRangeChange,
|
dateTimeRangeChange,
|
||||||
TResult? Function(String search)? searchChange,
|
TResult? Function(String search)? searchChange,
|
||||||
TResult? Function(Order order)? setSelectedOrder,
|
TResult? Function(Order order)? setSelectedOrder,
|
||||||
|
TResult? Function(String id)? getById,
|
||||||
TResult? Function(bool isRefresh, String status)? fetched,
|
TResult? Function(bool isRefresh, String status)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return dateTimeRangeChange?.call(startDate, endDate);
|
return dateTimeRangeChange?.call(startDate, endDate);
|
||||||
@ -195,6 +203,7 @@ class _$DateTimeRangeChangeImpl implements _DateTimeRangeChange {
|
|||||||
TResult Function(DateTime startDate, DateTime endDate)? dateTimeRangeChange,
|
TResult Function(DateTime startDate, DateTime endDate)? dateTimeRangeChange,
|
||||||
TResult Function(String search)? searchChange,
|
TResult Function(String search)? searchChange,
|
||||||
TResult Function(Order order)? setSelectedOrder,
|
TResult Function(Order order)? setSelectedOrder,
|
||||||
|
TResult Function(String id)? getById,
|
||||||
TResult Function(bool isRefresh, String status)? fetched,
|
TResult Function(bool isRefresh, String status)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -210,6 +219,7 @@ class _$DateTimeRangeChangeImpl implements _DateTimeRangeChange {
|
|||||||
required TResult Function(_DateTimeRangeChange value) dateTimeRangeChange,
|
required TResult Function(_DateTimeRangeChange value) dateTimeRangeChange,
|
||||||
required TResult Function(_SearchChange value) searchChange,
|
required TResult Function(_SearchChange value) searchChange,
|
||||||
required TResult Function(_SetSelectedOrder value) setSelectedOrder,
|
required TResult Function(_SetSelectedOrder value) setSelectedOrder,
|
||||||
|
required TResult Function(_GetById value) getById,
|
||||||
required TResult Function(_Fetched value) fetched,
|
required TResult Function(_Fetched value) fetched,
|
||||||
}) {
|
}) {
|
||||||
return dateTimeRangeChange(this);
|
return dateTimeRangeChange(this);
|
||||||
@ -221,6 +231,7 @@ class _$DateTimeRangeChangeImpl implements _DateTimeRangeChange {
|
|||||||
TResult? Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
TResult? Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
TResult? Function(_SearchChange value)? searchChange,
|
TResult? Function(_SearchChange value)? searchChange,
|
||||||
TResult? Function(_SetSelectedOrder value)? setSelectedOrder,
|
TResult? Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult? Function(_GetById value)? getById,
|
||||||
TResult? Function(_Fetched value)? fetched,
|
TResult? Function(_Fetched value)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return dateTimeRangeChange?.call(this);
|
return dateTimeRangeChange?.call(this);
|
||||||
@ -232,6 +243,7 @@ class _$DateTimeRangeChangeImpl implements _DateTimeRangeChange {
|
|||||||
TResult Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
TResult Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
TResult Function(_SearchChange value)? searchChange,
|
TResult Function(_SearchChange value)? searchChange,
|
||||||
TResult Function(_SetSelectedOrder value)? setSelectedOrder,
|
TResult Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult Function(_GetById value)? getById,
|
||||||
TResult Function(_Fetched value)? fetched,
|
TResult Function(_Fetched value)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -332,6 +344,7 @@ class _$SearchChangeImpl implements _SearchChange {
|
|||||||
dateTimeRangeChange,
|
dateTimeRangeChange,
|
||||||
required TResult Function(String search) searchChange,
|
required TResult Function(String search) searchChange,
|
||||||
required TResult Function(Order order) setSelectedOrder,
|
required TResult Function(Order order) setSelectedOrder,
|
||||||
|
required TResult Function(String id) getById,
|
||||||
required TResult Function(bool isRefresh, String status) fetched,
|
required TResult Function(bool isRefresh, String status) fetched,
|
||||||
}) {
|
}) {
|
||||||
return searchChange(search);
|
return searchChange(search);
|
||||||
@ -344,6 +357,7 @@ class _$SearchChangeImpl implements _SearchChange {
|
|||||||
dateTimeRangeChange,
|
dateTimeRangeChange,
|
||||||
TResult? Function(String search)? searchChange,
|
TResult? Function(String search)? searchChange,
|
||||||
TResult? Function(Order order)? setSelectedOrder,
|
TResult? Function(Order order)? setSelectedOrder,
|
||||||
|
TResult? Function(String id)? getById,
|
||||||
TResult? Function(bool isRefresh, String status)? fetched,
|
TResult? Function(bool isRefresh, String status)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return searchChange?.call(search);
|
return searchChange?.call(search);
|
||||||
@ -355,6 +369,7 @@ class _$SearchChangeImpl implements _SearchChange {
|
|||||||
TResult Function(DateTime startDate, DateTime endDate)? dateTimeRangeChange,
|
TResult Function(DateTime startDate, DateTime endDate)? dateTimeRangeChange,
|
||||||
TResult Function(String search)? searchChange,
|
TResult Function(String search)? searchChange,
|
||||||
TResult Function(Order order)? setSelectedOrder,
|
TResult Function(Order order)? setSelectedOrder,
|
||||||
|
TResult Function(String id)? getById,
|
||||||
TResult Function(bool isRefresh, String status)? fetched,
|
TResult Function(bool isRefresh, String status)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -370,6 +385,7 @@ class _$SearchChangeImpl implements _SearchChange {
|
|||||||
required TResult Function(_DateTimeRangeChange value) dateTimeRangeChange,
|
required TResult Function(_DateTimeRangeChange value) dateTimeRangeChange,
|
||||||
required TResult Function(_SearchChange value) searchChange,
|
required TResult Function(_SearchChange value) searchChange,
|
||||||
required TResult Function(_SetSelectedOrder value) setSelectedOrder,
|
required TResult Function(_SetSelectedOrder value) setSelectedOrder,
|
||||||
|
required TResult Function(_GetById value) getById,
|
||||||
required TResult Function(_Fetched value) fetched,
|
required TResult Function(_Fetched value) fetched,
|
||||||
}) {
|
}) {
|
||||||
return searchChange(this);
|
return searchChange(this);
|
||||||
@ -381,6 +397,7 @@ class _$SearchChangeImpl implements _SearchChange {
|
|||||||
TResult? Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
TResult? Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
TResult? Function(_SearchChange value)? searchChange,
|
TResult? Function(_SearchChange value)? searchChange,
|
||||||
TResult? Function(_SetSelectedOrder value)? setSelectedOrder,
|
TResult? Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult? Function(_GetById value)? getById,
|
||||||
TResult? Function(_Fetched value)? fetched,
|
TResult? Function(_Fetched value)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return searchChange?.call(this);
|
return searchChange?.call(this);
|
||||||
@ -392,6 +409,7 @@ class _$SearchChangeImpl implements _SearchChange {
|
|||||||
TResult Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
TResult Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
TResult Function(_SearchChange value)? searchChange,
|
TResult Function(_SearchChange value)? searchChange,
|
||||||
TResult Function(_SetSelectedOrder value)? setSelectedOrder,
|
TResult Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult Function(_GetById value)? getById,
|
||||||
TResult Function(_Fetched value)? fetched,
|
TResult Function(_Fetched value)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -503,6 +521,7 @@ class _$SetSelectedOrderImpl implements _SetSelectedOrder {
|
|||||||
dateTimeRangeChange,
|
dateTimeRangeChange,
|
||||||
required TResult Function(String search) searchChange,
|
required TResult Function(String search) searchChange,
|
||||||
required TResult Function(Order order) setSelectedOrder,
|
required TResult Function(Order order) setSelectedOrder,
|
||||||
|
required TResult Function(String id) getById,
|
||||||
required TResult Function(bool isRefresh, String status) fetched,
|
required TResult Function(bool isRefresh, String status) fetched,
|
||||||
}) {
|
}) {
|
||||||
return setSelectedOrder(order);
|
return setSelectedOrder(order);
|
||||||
@ -515,6 +534,7 @@ class _$SetSelectedOrderImpl implements _SetSelectedOrder {
|
|||||||
dateTimeRangeChange,
|
dateTimeRangeChange,
|
||||||
TResult? Function(String search)? searchChange,
|
TResult? Function(String search)? searchChange,
|
||||||
TResult? Function(Order order)? setSelectedOrder,
|
TResult? Function(Order order)? setSelectedOrder,
|
||||||
|
TResult? Function(String id)? getById,
|
||||||
TResult? Function(bool isRefresh, String status)? fetched,
|
TResult? Function(bool isRefresh, String status)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return setSelectedOrder?.call(order);
|
return setSelectedOrder?.call(order);
|
||||||
@ -526,6 +546,7 @@ class _$SetSelectedOrderImpl implements _SetSelectedOrder {
|
|||||||
TResult Function(DateTime startDate, DateTime endDate)? dateTimeRangeChange,
|
TResult Function(DateTime startDate, DateTime endDate)? dateTimeRangeChange,
|
||||||
TResult Function(String search)? searchChange,
|
TResult Function(String search)? searchChange,
|
||||||
TResult Function(Order order)? setSelectedOrder,
|
TResult Function(Order order)? setSelectedOrder,
|
||||||
|
TResult Function(String id)? getById,
|
||||||
TResult Function(bool isRefresh, String status)? fetched,
|
TResult Function(bool isRefresh, String status)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -541,6 +562,7 @@ class _$SetSelectedOrderImpl implements _SetSelectedOrder {
|
|||||||
required TResult Function(_DateTimeRangeChange value) dateTimeRangeChange,
|
required TResult Function(_DateTimeRangeChange value) dateTimeRangeChange,
|
||||||
required TResult Function(_SearchChange value) searchChange,
|
required TResult Function(_SearchChange value) searchChange,
|
||||||
required TResult Function(_SetSelectedOrder value) setSelectedOrder,
|
required TResult Function(_SetSelectedOrder value) setSelectedOrder,
|
||||||
|
required TResult Function(_GetById value) getById,
|
||||||
required TResult Function(_Fetched value) fetched,
|
required TResult Function(_Fetched value) fetched,
|
||||||
}) {
|
}) {
|
||||||
return setSelectedOrder(this);
|
return setSelectedOrder(this);
|
||||||
@ -552,6 +574,7 @@ class _$SetSelectedOrderImpl implements _SetSelectedOrder {
|
|||||||
TResult? Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
TResult? Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
TResult? Function(_SearchChange value)? searchChange,
|
TResult? Function(_SearchChange value)? searchChange,
|
||||||
TResult? Function(_SetSelectedOrder value)? setSelectedOrder,
|
TResult? Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult? Function(_GetById value)? getById,
|
||||||
TResult? Function(_Fetched value)? fetched,
|
TResult? Function(_Fetched value)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return setSelectedOrder?.call(this);
|
return setSelectedOrder?.call(this);
|
||||||
@ -563,6 +586,7 @@ class _$SetSelectedOrderImpl implements _SetSelectedOrder {
|
|||||||
TResult Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
TResult Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
TResult Function(_SearchChange value)? searchChange,
|
TResult Function(_SearchChange value)? searchChange,
|
||||||
TResult Function(_SetSelectedOrder value)? setSelectedOrder,
|
TResult Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult Function(_GetById value)? getById,
|
||||||
TResult Function(_Fetched value)? fetched,
|
TResult Function(_Fetched value)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -585,6 +609,168 @@ abstract class _SetSelectedOrder implements OrderLoaderEvent {
|
|||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class _$$GetByIdImplCopyWith<$Res> {
|
||||||
|
factory _$$GetByIdImplCopyWith(
|
||||||
|
_$GetByIdImpl value,
|
||||||
|
$Res Function(_$GetByIdImpl) then,
|
||||||
|
) = __$$GetByIdImplCopyWithImpl<$Res>;
|
||||||
|
@useResult
|
||||||
|
$Res call({String id});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class __$$GetByIdImplCopyWithImpl<$Res>
|
||||||
|
extends _$OrderLoaderEventCopyWithImpl<$Res, _$GetByIdImpl>
|
||||||
|
implements _$$GetByIdImplCopyWith<$Res> {
|
||||||
|
__$$GetByIdImplCopyWithImpl(
|
||||||
|
_$GetByIdImpl _value,
|
||||||
|
$Res Function(_$GetByIdImpl) _then,
|
||||||
|
) : super(_value, _then);
|
||||||
|
|
||||||
|
/// Create a copy of OrderLoaderEvent
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
@override
|
||||||
|
$Res call({Object? id = null}) {
|
||||||
|
return _then(
|
||||||
|
_$GetByIdImpl(
|
||||||
|
null == id
|
||||||
|
? _value.id
|
||||||
|
: id // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
|
||||||
|
class _$GetByIdImpl implements _GetById {
|
||||||
|
const _$GetByIdImpl(this.id);
|
||||||
|
|
||||||
|
@override
|
||||||
|
final String id;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'OrderLoaderEvent.getById(id: $id)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) ||
|
||||||
|
(other.runtimeType == runtimeType &&
|
||||||
|
other is _$GetByIdImpl &&
|
||||||
|
(identical(other.id, id) || other.id == id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType, id);
|
||||||
|
|
||||||
|
/// Create a copy of OrderLoaderEvent
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$$GetByIdImplCopyWith<_$GetByIdImpl> get copyWith =>
|
||||||
|
__$$GetByIdImplCopyWithImpl<_$GetByIdImpl>(this, _$identity);
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult when<TResult extends Object?>({
|
||||||
|
required TResult Function(DateTime startDate, DateTime endDate)
|
||||||
|
dateTimeRangeChange,
|
||||||
|
required TResult Function(String search) searchChange,
|
||||||
|
required TResult Function(Order order) setSelectedOrder,
|
||||||
|
required TResult Function(String id) getById,
|
||||||
|
required TResult Function(bool isRefresh, String status) fetched,
|
||||||
|
}) {
|
||||||
|
return getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
|
TResult? Function(DateTime startDate, DateTime endDate)?
|
||||||
|
dateTimeRangeChange,
|
||||||
|
TResult? Function(String search)? searchChange,
|
||||||
|
TResult? Function(Order order)? setSelectedOrder,
|
||||||
|
TResult? Function(String id)? getById,
|
||||||
|
TResult? Function(bool isRefresh, String status)? fetched,
|
||||||
|
}) {
|
||||||
|
return getById?.call(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
|
TResult Function(DateTime startDate, DateTime endDate)? dateTimeRangeChange,
|
||||||
|
TResult Function(String search)? searchChange,
|
||||||
|
TResult Function(Order order)? setSelectedOrder,
|
||||||
|
TResult Function(String id)? getById,
|
||||||
|
TResult Function(bool isRefresh, String status)? fetched,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (getById != null) {
|
||||||
|
return getById(id);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult map<TResult extends Object?>({
|
||||||
|
required TResult Function(_DateTimeRangeChange value) dateTimeRangeChange,
|
||||||
|
required TResult Function(_SearchChange value) searchChange,
|
||||||
|
required TResult Function(_SetSelectedOrder value) setSelectedOrder,
|
||||||
|
required TResult Function(_GetById value) getById,
|
||||||
|
required TResult Function(_Fetched value) fetched,
|
||||||
|
}) {
|
||||||
|
return getById(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? mapOrNull<TResult extends Object?>({
|
||||||
|
TResult? Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
|
TResult? Function(_SearchChange value)? searchChange,
|
||||||
|
TResult? Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult? Function(_GetById value)? getById,
|
||||||
|
TResult? Function(_Fetched value)? fetched,
|
||||||
|
}) {
|
||||||
|
return getById?.call(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeMap<TResult extends Object?>({
|
||||||
|
TResult Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
|
TResult Function(_SearchChange value)? searchChange,
|
||||||
|
TResult Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult Function(_GetById value)? getById,
|
||||||
|
TResult Function(_Fetched value)? fetched,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (getById != null) {
|
||||||
|
return getById(this);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class _GetById implements OrderLoaderEvent {
|
||||||
|
const factory _GetById(final String id) = _$GetByIdImpl;
|
||||||
|
|
||||||
|
String get id;
|
||||||
|
|
||||||
|
/// Create a copy of OrderLoaderEvent
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
_$$GetByIdImplCopyWith<_$GetByIdImpl> get copyWith =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
abstract class _$$FetchedImplCopyWith<$Res> {
|
abstract class _$$FetchedImplCopyWith<$Res> {
|
||||||
factory _$$FetchedImplCopyWith(
|
factory _$$FetchedImplCopyWith(
|
||||||
@ -668,6 +854,7 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
dateTimeRangeChange,
|
dateTimeRangeChange,
|
||||||
required TResult Function(String search) searchChange,
|
required TResult Function(String search) searchChange,
|
||||||
required TResult Function(Order order) setSelectedOrder,
|
required TResult Function(Order order) setSelectedOrder,
|
||||||
|
required TResult Function(String id) getById,
|
||||||
required TResult Function(bool isRefresh, String status) fetched,
|
required TResult Function(bool isRefresh, String status) fetched,
|
||||||
}) {
|
}) {
|
||||||
return fetched(isRefresh, status);
|
return fetched(isRefresh, status);
|
||||||
@ -680,6 +867,7 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
dateTimeRangeChange,
|
dateTimeRangeChange,
|
||||||
TResult? Function(String search)? searchChange,
|
TResult? Function(String search)? searchChange,
|
||||||
TResult? Function(Order order)? setSelectedOrder,
|
TResult? Function(Order order)? setSelectedOrder,
|
||||||
|
TResult? Function(String id)? getById,
|
||||||
TResult? Function(bool isRefresh, String status)? fetched,
|
TResult? Function(bool isRefresh, String status)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return fetched?.call(isRefresh, status);
|
return fetched?.call(isRefresh, status);
|
||||||
@ -691,6 +879,7 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
TResult Function(DateTime startDate, DateTime endDate)? dateTimeRangeChange,
|
TResult Function(DateTime startDate, DateTime endDate)? dateTimeRangeChange,
|
||||||
TResult Function(String search)? searchChange,
|
TResult Function(String search)? searchChange,
|
||||||
TResult Function(Order order)? setSelectedOrder,
|
TResult Function(Order order)? setSelectedOrder,
|
||||||
|
TResult Function(String id)? getById,
|
||||||
TResult Function(bool isRefresh, String status)? fetched,
|
TResult Function(bool isRefresh, String status)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -706,6 +895,7 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
required TResult Function(_DateTimeRangeChange value) dateTimeRangeChange,
|
required TResult Function(_DateTimeRangeChange value) dateTimeRangeChange,
|
||||||
required TResult Function(_SearchChange value) searchChange,
|
required TResult Function(_SearchChange value) searchChange,
|
||||||
required TResult Function(_SetSelectedOrder value) setSelectedOrder,
|
required TResult Function(_SetSelectedOrder value) setSelectedOrder,
|
||||||
|
required TResult Function(_GetById value) getById,
|
||||||
required TResult Function(_Fetched value) fetched,
|
required TResult Function(_Fetched value) fetched,
|
||||||
}) {
|
}) {
|
||||||
return fetched(this);
|
return fetched(this);
|
||||||
@ -717,6 +907,7 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
TResult? Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
TResult? Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
TResult? Function(_SearchChange value)? searchChange,
|
TResult? Function(_SearchChange value)? searchChange,
|
||||||
TResult? Function(_SetSelectedOrder value)? setSelectedOrder,
|
TResult? Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult? Function(_GetById value)? getById,
|
||||||
TResult? Function(_Fetched value)? fetched,
|
TResult? Function(_Fetched value)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return fetched?.call(this);
|
return fetched?.call(this);
|
||||||
@ -728,6 +919,7 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
TResult Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
TResult Function(_DateTimeRangeChange value)? dateTimeRangeChange,
|
||||||
TResult Function(_SearchChange value)? searchChange,
|
TResult Function(_SearchChange value)? searchChange,
|
||||||
TResult Function(_SetSelectedOrder value)? setSelectedOrder,
|
TResult Function(_SetSelectedOrder value)? setSelectedOrder,
|
||||||
|
TResult Function(_GetById value)? getById,
|
||||||
TResult Function(_Fetched value)? fetched,
|
TResult Function(_Fetched value)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -756,11 +948,15 @@ abstract class _Fetched implements OrderLoaderEvent {
|
|||||||
mixin _$OrderLoaderState {
|
mixin _$OrderLoaderState {
|
||||||
List<Order> get orders => throw _privateConstructorUsedError;
|
List<Order> get orders => throw _privateConstructorUsedError;
|
||||||
Option<OrderFailure> get failureOption => throw _privateConstructorUsedError;
|
Option<OrderFailure> get failureOption => throw _privateConstructorUsedError;
|
||||||
|
Option<OrderFailure> get failureOptionGetById =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
Order get order => throw _privateConstructorUsedError;
|
||||||
Order? get selectedOrder => throw _privateConstructorUsedError;
|
Order? get selectedOrder => throw _privateConstructorUsedError;
|
||||||
String? get search => throw _privateConstructorUsedError;
|
String? get search => throw _privateConstructorUsedError;
|
||||||
DateTime get startDate => throw _privateConstructorUsedError;
|
DateTime get startDate => throw _privateConstructorUsedError;
|
||||||
DateTime get endDate => throw _privateConstructorUsedError;
|
DateTime get endDate => throw _privateConstructorUsedError;
|
||||||
bool get isFetching => throw _privateConstructorUsedError;
|
bool get isFetching => throw _privateConstructorUsedError;
|
||||||
|
bool get isFetchingById => throw _privateConstructorUsedError;
|
||||||
bool get hasReachedMax => throw _privateConstructorUsedError;
|
bool get hasReachedMax => throw _privateConstructorUsedError;
|
||||||
int get page => throw _privateConstructorUsedError;
|
int get page => throw _privateConstructorUsedError;
|
||||||
|
|
||||||
@ -781,15 +977,19 @@ abstract class $OrderLoaderStateCopyWith<$Res> {
|
|||||||
$Res call({
|
$Res call({
|
||||||
List<Order> orders,
|
List<Order> orders,
|
||||||
Option<OrderFailure> failureOption,
|
Option<OrderFailure> failureOption,
|
||||||
|
Option<OrderFailure> failureOptionGetById,
|
||||||
|
Order order,
|
||||||
Order? selectedOrder,
|
Order? selectedOrder,
|
||||||
String? search,
|
String? search,
|
||||||
DateTime startDate,
|
DateTime startDate,
|
||||||
DateTime endDate,
|
DateTime endDate,
|
||||||
bool isFetching,
|
bool isFetching,
|
||||||
|
bool isFetchingById,
|
||||||
bool hasReachedMax,
|
bool hasReachedMax,
|
||||||
int page,
|
int page,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$OrderCopyWith<$Res> get order;
|
||||||
$OrderCopyWith<$Res>? get selectedOrder;
|
$OrderCopyWith<$Res>? get selectedOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -810,11 +1010,14 @@ class _$OrderLoaderStateCopyWithImpl<$Res, $Val extends OrderLoaderState>
|
|||||||
$Res call({
|
$Res call({
|
||||||
Object? orders = null,
|
Object? orders = null,
|
||||||
Object? failureOption = null,
|
Object? failureOption = null,
|
||||||
|
Object? failureOptionGetById = null,
|
||||||
|
Object? order = null,
|
||||||
Object? selectedOrder = freezed,
|
Object? selectedOrder = freezed,
|
||||||
Object? search = freezed,
|
Object? search = freezed,
|
||||||
Object? startDate = null,
|
Object? startDate = null,
|
||||||
Object? endDate = null,
|
Object? endDate = null,
|
||||||
Object? isFetching = null,
|
Object? isFetching = null,
|
||||||
|
Object? isFetchingById = null,
|
||||||
Object? hasReachedMax = null,
|
Object? hasReachedMax = null,
|
||||||
Object? page = null,
|
Object? page = null,
|
||||||
}) {
|
}) {
|
||||||
@ -828,6 +1031,14 @@ class _$OrderLoaderStateCopyWithImpl<$Res, $Val extends OrderLoaderState>
|
|||||||
? _value.failureOption
|
? _value.failureOption
|
||||||
: failureOption // ignore: cast_nullable_to_non_nullable
|
: failureOption // ignore: cast_nullable_to_non_nullable
|
||||||
as Option<OrderFailure>,
|
as Option<OrderFailure>,
|
||||||
|
failureOptionGetById: null == failureOptionGetById
|
||||||
|
? _value.failureOptionGetById
|
||||||
|
: failureOptionGetById // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Option<OrderFailure>,
|
||||||
|
order: null == order
|
||||||
|
? _value.order
|
||||||
|
: order // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Order,
|
||||||
selectedOrder: freezed == selectedOrder
|
selectedOrder: freezed == selectedOrder
|
||||||
? _value.selectedOrder
|
? _value.selectedOrder
|
||||||
: selectedOrder // ignore: cast_nullable_to_non_nullable
|
: selectedOrder // ignore: cast_nullable_to_non_nullable
|
||||||
@ -848,6 +1059,10 @@ class _$OrderLoaderStateCopyWithImpl<$Res, $Val extends OrderLoaderState>
|
|||||||
? _value.isFetching
|
? _value.isFetching
|
||||||
: isFetching // ignore: cast_nullable_to_non_nullable
|
: isFetching // ignore: cast_nullable_to_non_nullable
|
||||||
as bool,
|
as bool,
|
||||||
|
isFetchingById: null == isFetchingById
|
||||||
|
? _value.isFetchingById
|
||||||
|
: isFetchingById // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,
|
||||||
hasReachedMax: null == hasReachedMax
|
hasReachedMax: null == hasReachedMax
|
||||||
? _value.hasReachedMax
|
? _value.hasReachedMax
|
||||||
: hasReachedMax // ignore: cast_nullable_to_non_nullable
|
: hasReachedMax // ignore: cast_nullable_to_non_nullable
|
||||||
@ -861,6 +1076,16 @@ class _$OrderLoaderStateCopyWithImpl<$Res, $Val extends OrderLoaderState>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Create a copy of OrderLoaderState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$OrderCopyWith<$Res> get order {
|
||||||
|
return $OrderCopyWith<$Res>(_value.order, (value) {
|
||||||
|
return _then(_value.copyWith(order: value) as $Val);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/// Create a copy of OrderLoaderState
|
/// Create a copy of OrderLoaderState
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override
|
@override
|
||||||
@ -888,15 +1113,20 @@ abstract class _$$OrderLoaderStateImplCopyWith<$Res>
|
|||||||
$Res call({
|
$Res call({
|
||||||
List<Order> orders,
|
List<Order> orders,
|
||||||
Option<OrderFailure> failureOption,
|
Option<OrderFailure> failureOption,
|
||||||
|
Option<OrderFailure> failureOptionGetById,
|
||||||
|
Order order,
|
||||||
Order? selectedOrder,
|
Order? selectedOrder,
|
||||||
String? search,
|
String? search,
|
||||||
DateTime startDate,
|
DateTime startDate,
|
||||||
DateTime endDate,
|
DateTime endDate,
|
||||||
bool isFetching,
|
bool isFetching,
|
||||||
|
bool isFetchingById,
|
||||||
bool hasReachedMax,
|
bool hasReachedMax,
|
||||||
int page,
|
int page,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
$OrderCopyWith<$Res> get order;
|
||||||
@override
|
@override
|
||||||
$OrderCopyWith<$Res>? get selectedOrder;
|
$OrderCopyWith<$Res>? get selectedOrder;
|
||||||
}
|
}
|
||||||
@ -917,11 +1147,14 @@ class __$$OrderLoaderStateImplCopyWithImpl<$Res>
|
|||||||
$Res call({
|
$Res call({
|
||||||
Object? orders = null,
|
Object? orders = null,
|
||||||
Object? failureOption = null,
|
Object? failureOption = null,
|
||||||
|
Object? failureOptionGetById = null,
|
||||||
|
Object? order = null,
|
||||||
Object? selectedOrder = freezed,
|
Object? selectedOrder = freezed,
|
||||||
Object? search = freezed,
|
Object? search = freezed,
|
||||||
Object? startDate = null,
|
Object? startDate = null,
|
||||||
Object? endDate = null,
|
Object? endDate = null,
|
||||||
Object? isFetching = null,
|
Object? isFetching = null,
|
||||||
|
Object? isFetchingById = null,
|
||||||
Object? hasReachedMax = null,
|
Object? hasReachedMax = null,
|
||||||
Object? page = null,
|
Object? page = null,
|
||||||
}) {
|
}) {
|
||||||
@ -935,6 +1168,14 @@ class __$$OrderLoaderStateImplCopyWithImpl<$Res>
|
|||||||
? _value.failureOption
|
? _value.failureOption
|
||||||
: failureOption // ignore: cast_nullable_to_non_nullable
|
: failureOption // ignore: cast_nullable_to_non_nullable
|
||||||
as Option<OrderFailure>,
|
as Option<OrderFailure>,
|
||||||
|
failureOptionGetById: null == failureOptionGetById
|
||||||
|
? _value.failureOptionGetById
|
||||||
|
: failureOptionGetById // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Option<OrderFailure>,
|
||||||
|
order: null == order
|
||||||
|
? _value.order
|
||||||
|
: order // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Order,
|
||||||
selectedOrder: freezed == selectedOrder
|
selectedOrder: freezed == selectedOrder
|
||||||
? _value.selectedOrder
|
? _value.selectedOrder
|
||||||
: selectedOrder // ignore: cast_nullable_to_non_nullable
|
: selectedOrder // ignore: cast_nullable_to_non_nullable
|
||||||
@ -955,6 +1196,10 @@ class __$$OrderLoaderStateImplCopyWithImpl<$Res>
|
|||||||
? _value.isFetching
|
? _value.isFetching
|
||||||
: isFetching // ignore: cast_nullable_to_non_nullable
|
: isFetching // ignore: cast_nullable_to_non_nullable
|
||||||
as bool,
|
as bool,
|
||||||
|
isFetchingById: null == isFetchingById
|
||||||
|
? _value.isFetchingById
|
||||||
|
: isFetchingById // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,
|
||||||
hasReachedMax: null == hasReachedMax
|
hasReachedMax: null == hasReachedMax
|
||||||
? _value.hasReachedMax
|
? _value.hasReachedMax
|
||||||
: hasReachedMax // ignore: cast_nullable_to_non_nullable
|
: hasReachedMax // ignore: cast_nullable_to_non_nullable
|
||||||
@ -974,11 +1219,14 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
_$OrderLoaderStateImpl({
|
_$OrderLoaderStateImpl({
|
||||||
required final List<Order> orders,
|
required final List<Order> orders,
|
||||||
required this.failureOption,
|
required this.failureOption,
|
||||||
|
required this.failureOptionGetById,
|
||||||
|
required this.order,
|
||||||
this.selectedOrder,
|
this.selectedOrder,
|
||||||
this.search,
|
this.search,
|
||||||
required this.startDate,
|
required this.startDate,
|
||||||
required this.endDate,
|
required this.endDate,
|
||||||
this.isFetching = false,
|
this.isFetching = false,
|
||||||
|
this.isFetchingById = false,
|
||||||
this.hasReachedMax = false,
|
this.hasReachedMax = false,
|
||||||
this.page = 1,
|
this.page = 1,
|
||||||
}) : _orders = orders;
|
}) : _orders = orders;
|
||||||
@ -994,6 +1242,10 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
@override
|
@override
|
||||||
final Option<OrderFailure> failureOption;
|
final Option<OrderFailure> failureOption;
|
||||||
@override
|
@override
|
||||||
|
final Option<OrderFailure> failureOptionGetById;
|
||||||
|
@override
|
||||||
|
final Order order;
|
||||||
|
@override
|
||||||
final Order? selectedOrder;
|
final Order? selectedOrder;
|
||||||
@override
|
@override
|
||||||
final String? search;
|
final String? search;
|
||||||
@ -1006,6 +1258,9 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
final bool isFetching;
|
final bool isFetching;
|
||||||
@override
|
@override
|
||||||
@JsonKey()
|
@JsonKey()
|
||||||
|
final bool isFetchingById;
|
||||||
|
@override
|
||||||
|
@JsonKey()
|
||||||
final bool hasReachedMax;
|
final bool hasReachedMax;
|
||||||
@override
|
@override
|
||||||
@JsonKey()
|
@JsonKey()
|
||||||
@ -1013,7 +1268,7 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'OrderLoaderState(orders: $orders, failureOption: $failureOption, selectedOrder: $selectedOrder, search: $search, startDate: $startDate, endDate: $endDate, isFetching: $isFetching, hasReachedMax: $hasReachedMax, page: $page)';
|
return 'OrderLoaderState(orders: $orders, failureOption: $failureOption, failureOptionGetById: $failureOptionGetById, order: $order, selectedOrder: $selectedOrder, search: $search, startDate: $startDate, endDate: $endDate, isFetching: $isFetching, isFetchingById: $isFetchingById, hasReachedMax: $hasReachedMax, page: $page)';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -1024,6 +1279,9 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
const DeepCollectionEquality().equals(other._orders, _orders) &&
|
const DeepCollectionEquality().equals(other._orders, _orders) &&
|
||||||
(identical(other.failureOption, failureOption) ||
|
(identical(other.failureOption, failureOption) ||
|
||||||
other.failureOption == failureOption) &&
|
other.failureOption == failureOption) &&
|
||||||
|
(identical(other.failureOptionGetById, failureOptionGetById) ||
|
||||||
|
other.failureOptionGetById == failureOptionGetById) &&
|
||||||
|
(identical(other.order, order) || other.order == order) &&
|
||||||
(identical(other.selectedOrder, selectedOrder) ||
|
(identical(other.selectedOrder, selectedOrder) ||
|
||||||
other.selectedOrder == selectedOrder) &&
|
other.selectedOrder == selectedOrder) &&
|
||||||
(identical(other.search, search) || other.search == search) &&
|
(identical(other.search, search) || other.search == search) &&
|
||||||
@ -1032,6 +1290,8 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
(identical(other.endDate, endDate) || other.endDate == endDate) &&
|
(identical(other.endDate, endDate) || other.endDate == endDate) &&
|
||||||
(identical(other.isFetching, isFetching) ||
|
(identical(other.isFetching, isFetching) ||
|
||||||
other.isFetching == isFetching) &&
|
other.isFetching == isFetching) &&
|
||||||
|
(identical(other.isFetchingById, isFetchingById) ||
|
||||||
|
other.isFetchingById == isFetchingById) &&
|
||||||
(identical(other.hasReachedMax, hasReachedMax) ||
|
(identical(other.hasReachedMax, hasReachedMax) ||
|
||||||
other.hasReachedMax == hasReachedMax) &&
|
other.hasReachedMax == hasReachedMax) &&
|
||||||
(identical(other.page, page) || other.page == page));
|
(identical(other.page, page) || other.page == page));
|
||||||
@ -1042,11 +1302,14 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
runtimeType,
|
runtimeType,
|
||||||
const DeepCollectionEquality().hash(_orders),
|
const DeepCollectionEquality().hash(_orders),
|
||||||
failureOption,
|
failureOption,
|
||||||
|
failureOptionGetById,
|
||||||
|
order,
|
||||||
selectedOrder,
|
selectedOrder,
|
||||||
search,
|
search,
|
||||||
startDate,
|
startDate,
|
||||||
endDate,
|
endDate,
|
||||||
isFetching,
|
isFetching,
|
||||||
|
isFetchingById,
|
||||||
hasReachedMax,
|
hasReachedMax,
|
||||||
page,
|
page,
|
||||||
);
|
);
|
||||||
@ -1067,11 +1330,14 @@ abstract class _OrderLoaderState implements OrderLoaderState {
|
|||||||
factory _OrderLoaderState({
|
factory _OrderLoaderState({
|
||||||
required final List<Order> orders,
|
required final List<Order> orders,
|
||||||
required final Option<OrderFailure> failureOption,
|
required final Option<OrderFailure> failureOption,
|
||||||
|
required final Option<OrderFailure> failureOptionGetById,
|
||||||
|
required final Order order,
|
||||||
final Order? selectedOrder,
|
final Order? selectedOrder,
|
||||||
final String? search,
|
final String? search,
|
||||||
required final DateTime startDate,
|
required final DateTime startDate,
|
||||||
required final DateTime endDate,
|
required final DateTime endDate,
|
||||||
final bool isFetching,
|
final bool isFetching,
|
||||||
|
final bool isFetchingById,
|
||||||
final bool hasReachedMax,
|
final bool hasReachedMax,
|
||||||
final int page,
|
final int page,
|
||||||
}) = _$OrderLoaderStateImpl;
|
}) = _$OrderLoaderStateImpl;
|
||||||
@ -1081,6 +1347,10 @@ abstract class _OrderLoaderState implements OrderLoaderState {
|
|||||||
@override
|
@override
|
||||||
Option<OrderFailure> get failureOption;
|
Option<OrderFailure> get failureOption;
|
||||||
@override
|
@override
|
||||||
|
Option<OrderFailure> get failureOptionGetById;
|
||||||
|
@override
|
||||||
|
Order get order;
|
||||||
|
@override
|
||||||
Order? get selectedOrder;
|
Order? get selectedOrder;
|
||||||
@override
|
@override
|
||||||
String? get search;
|
String? get search;
|
||||||
@ -1091,6 +1361,8 @@ abstract class _OrderLoaderState implements OrderLoaderState {
|
|||||||
@override
|
@override
|
||||||
bool get isFetching;
|
bool get isFetching;
|
||||||
@override
|
@override
|
||||||
|
bool get isFetchingById;
|
||||||
|
@override
|
||||||
bool get hasReachedMax;
|
bool get hasReachedMax;
|
||||||
@override
|
@override
|
||||||
int get page;
|
int get page;
|
||||||
|
|||||||
@ -9,6 +9,7 @@ class OrderLoaderEvent with _$OrderLoaderEvent {
|
|||||||
const factory OrderLoaderEvent.searchChange(String search) = _SearchChange;
|
const factory OrderLoaderEvent.searchChange(String search) = _SearchChange;
|
||||||
const factory OrderLoaderEvent.setSelectedOrder(Order order) =
|
const factory OrderLoaderEvent.setSelectedOrder(Order order) =
|
||||||
_SetSelectedOrder;
|
_SetSelectedOrder;
|
||||||
|
const factory OrderLoaderEvent.getById(String id) = _GetById;
|
||||||
const factory OrderLoaderEvent.fetched({
|
const factory OrderLoaderEvent.fetched({
|
||||||
@Default(false) bool isRefresh,
|
@Default(false) bool isRefresh,
|
||||||
required String status,
|
required String status,
|
||||||
|
|||||||
@ -5,11 +5,14 @@ class OrderLoaderState with _$OrderLoaderState {
|
|||||||
factory OrderLoaderState({
|
factory OrderLoaderState({
|
||||||
required List<Order> orders,
|
required List<Order> orders,
|
||||||
required Option<OrderFailure> failureOption,
|
required Option<OrderFailure> failureOption,
|
||||||
|
required Option<OrderFailure> failureOptionGetById,
|
||||||
|
required Order order,
|
||||||
Order? selectedOrder,
|
Order? selectedOrder,
|
||||||
String? search,
|
String? search,
|
||||||
required DateTime startDate,
|
required DateTime startDate,
|
||||||
required DateTime endDate,
|
required DateTime endDate,
|
||||||
@Default(false) bool isFetching,
|
@Default(false) bool isFetching,
|
||||||
|
@Default(false) bool isFetchingById,
|
||||||
@Default(false) bool hasReachedMax,
|
@Default(false) bool hasReachedMax,
|
||||||
@Default(1) int page,
|
@Default(1) int page,
|
||||||
}) = _OrderLoaderState;
|
}) = _OrderLoaderState;
|
||||||
@ -19,5 +22,7 @@ class OrderLoaderState with _$OrderLoaderState {
|
|||||||
failureOption: none(),
|
failureOption: none(),
|
||||||
startDate: DateTime.now(),
|
startDate: DateTime.now(),
|
||||||
endDate: DateTime.now(),
|
endDate: DateTime.now(),
|
||||||
|
failureOptionGetById: none(),
|
||||||
|
order: Order.empty(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,8 @@ abstract class IOrderRepository {
|
|||||||
String? search,
|
String? search,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Future<Either<OrderFailure, Order>> getOrderById(String id);
|
||||||
|
|
||||||
Future<Either<OrderFailure, Order>> createOrder({
|
Future<Either<OrderFailure, Order>> createOrder({
|
||||||
required OrderRequest request,
|
required OrderRequest request,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -59,6 +59,28 @@ class OrderRemoteDataProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<DC<OrderFailure, OrderDto>> fetchOrderById(String id) async {
|
||||||
|
try {
|
||||||
|
final response = await _apiClient.get(
|
||||||
|
'${ApiPath.orders}/$id',
|
||||||
|
headers: getAuthorizationHeader(),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.data['success'] == false) {
|
||||||
|
return DC.error(OrderFailure.unexpectedError());
|
||||||
|
}
|
||||||
|
|
||||||
|
final order = OrderDto.fromJson(
|
||||||
|
response.data['data'] as Map<String, dynamic>,
|
||||||
|
);
|
||||||
|
|
||||||
|
return DC.data(order);
|
||||||
|
} on ApiFailure catch (e, s) {
|
||||||
|
log('fetchOrderByIdError', name: _logName, error: e, stackTrace: s);
|
||||||
|
return DC.error(OrderFailure.serverError(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<DC<OrderFailure, OrderDto>> storeOrder({
|
Future<DC<OrderFailure, OrderDto>> storeOrder({
|
||||||
required OrderRequestDto request,
|
required OrderRequestDto request,
|
||||||
}) async {
|
}) async {
|
||||||
|
|||||||
@ -88,4 +88,21 @@ class OrderRepository implements IOrderRepository {
|
|||||||
return left(const OrderFailure.unexpectedError());
|
return left(const OrderFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Either<OrderFailure, Order>> getOrderById(String id) async {
|
||||||
|
try {
|
||||||
|
final result = await _dataProvider.fetchOrderById(id);
|
||||||
|
|
||||||
|
if (result.hasError) {
|
||||||
|
return left(result.error!);
|
||||||
|
}
|
||||||
|
|
||||||
|
final order = result.data!.toDomain();
|
||||||
|
return right(order);
|
||||||
|
} catch (e) {
|
||||||
|
log('getOrderByIdError', name: _logName, error: e);
|
||||||
|
return left(const OrderFailure.unexpectedError());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import '../../../common/theme/theme.dart';
|
|||||||
import '../../../injection.dart';
|
import '../../../injection.dart';
|
||||||
import '../../components/spaces/space.dart';
|
import '../../components/spaces/space.dart';
|
||||||
import '../../components/toast/flushbar.dart';
|
import '../../components/toast/flushbar.dart';
|
||||||
|
import '../../router/app_router.gr.dart';
|
||||||
import 'widgets/checkout_left_panel.dart';
|
import 'widgets/checkout_left_panel.dart';
|
||||||
import 'widgets/checkout_right_panel.dart';
|
import 'widgets/checkout_right_panel.dart';
|
||||||
|
|
||||||
@ -26,7 +27,9 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
either.fold((f) => AppFlushbar.showOrderFailureToast(context, f), (
|
either.fold((f) => AppFlushbar.showOrderFailureToast(context, f), (
|
||||||
order,
|
order,
|
||||||
) {
|
) {
|
||||||
if (context.mounted) {}
|
if (context.mounted) {
|
||||||
|
context.router.replace(SuccessOrderRoute(order: order));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -0,0 +1,58 @@
|
|||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
|
import '../../../../../application/order/order_loader/order_loader_bloc.dart';
|
||||||
|
import '../../../../../common/theme/theme.dart';
|
||||||
|
import '../../../../../domain/order/order.dart';
|
||||||
|
import '../../../../../injection.dart';
|
||||||
|
import '../../../../components/loader/loader_with_text.dart';
|
||||||
|
import '../../../../components/spaces/space.dart';
|
||||||
|
import 'widgets/success_order_left_panel.dart';
|
||||||
|
import 'widgets/success_order_right_panel.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
|
class SuccessOrderPage extends StatelessWidget implements AutoRouteWrapper {
|
||||||
|
final Order order;
|
||||||
|
const SuccessOrderPage({super.key, required this.order});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColor.background,
|
||||||
|
body: SafeArea(
|
||||||
|
child: BlocBuilder<OrderLoaderBloc, OrderLoaderState>(
|
||||||
|
builder: (context, state) {
|
||||||
|
if (state.isFetchingById) {
|
||||||
|
return const Center(child: LoaderWithText());
|
||||||
|
}
|
||||||
|
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(24.0),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 35,
|
||||||
|
child: SuccessOrderLeftPanel(order: state.order),
|
||||||
|
),
|
||||||
|
SpaceWidth(16),
|
||||||
|
Expanded(
|
||||||
|
flex: 65,
|
||||||
|
child: SuccessOrderRightPanel(order: state.order),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget wrappedRoute(BuildContext context) => BlocProvider(
|
||||||
|
create: (context) =>
|
||||||
|
getIt<OrderLoaderBloc>()..add(OrderLoaderEvent.getById(order.id)),
|
||||||
|
child: this,
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -0,0 +1,250 @@
|
|||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../../../../common/extension/extension.dart';
|
||||||
|
import '../../../../../../common/theme/theme.dart';
|
||||||
|
import '../../../../../../domain/order/order.dart';
|
||||||
|
import '../../../../../components/button/button.dart';
|
||||||
|
import '../../../../../components/spaces/space.dart';
|
||||||
|
import '../../../../../router/app_router.gr.dart';
|
||||||
|
|
||||||
|
class SuccessOrderLeftPanel extends StatelessWidget {
|
||||||
|
final Order order;
|
||||||
|
const SuccessOrderLeftPanel({super.key, required this.order});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(24),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.all(32.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: [
|
||||||
|
AppColor.primary.withOpacity(0.1),
|
||||||
|
AppColor.primary.withOpacity(0.05),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
borderRadius: const BorderRadius.vertical(
|
||||||
|
top: Radius.circular(24),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(20.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: [
|
||||||
|
AppColor.primary,
|
||||||
|
AppColor.primary.withOpacity(0.8),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.primary.withOpacity(0.3),
|
||||||
|
blurRadius: 20,
|
||||||
|
offset: const Offset(0, 10),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: const Icon(
|
||||||
|
Icons.check_rounded,
|
||||||
|
size: 48,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SpaceWidth(24),
|
||||||
|
Text(
|
||||||
|
'Pesanan Berhasil!',
|
||||||
|
style: AppStyle.h4.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: AppColor.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SpaceWidth(12),
|
||||||
|
Text(
|
||||||
|
'Pesanan telah diterima dan\nsedang diproses',
|
||||||
|
style: AppStyle.md.copyWith(
|
||||||
|
color: AppColor.primary,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(24.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Informasi Pesanan',
|
||||||
|
style: AppStyle.lg.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SpaceHeight(24),
|
||||||
|
_buildInfoRow(
|
||||||
|
icon: Icons.person,
|
||||||
|
label: 'Pemesan',
|
||||||
|
value: order.metadata['customer_name'] ?? "-",
|
||||||
|
),
|
||||||
|
if (order.payments.isNotEmpty) ...[
|
||||||
|
const SpaceHeight(12),
|
||||||
|
_buildInfoRow(
|
||||||
|
icon: Icons.wallet_outlined,
|
||||||
|
label: 'Metode Pembayaran',
|
||||||
|
value: order.payments.first.paymentMethodName,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
if (order.tableNumber != "") ...[
|
||||||
|
const SpaceHeight(12),
|
||||||
|
_buildInfoRow(
|
||||||
|
icon: Icons.table_restaurant_outlined,
|
||||||
|
label: 'No. Meja',
|
||||||
|
value: order.tableNumber,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
const SpaceHeight(12),
|
||||||
|
_buildInfoRow(
|
||||||
|
icon: Icons.access_time_rounded,
|
||||||
|
label: 'Waktu',
|
||||||
|
value: (order.createdAt).toFormattedDateTime(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
_buildBottomSection(context),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildBottomSection(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.all(24.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
colors: [Colors.grey.shade50, Colors.white],
|
||||||
|
),
|
||||||
|
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(24)),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
// Action Buttons with Modern Design
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: AppElevatedButton.outlined(
|
||||||
|
onPressed: () =>
|
||||||
|
context.router.replaceAll([const MainRoute()]),
|
||||||
|
label: "Kembali",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SpaceWidth(16),
|
||||||
|
Expanded(
|
||||||
|
child: AppElevatedButton.filled(
|
||||||
|
onPressed: () {
|
||||||
|
// onPrintRecipt(
|
||||||
|
// context,
|
||||||
|
// order: widget.order,
|
||||||
|
// paymentMethod: widget.paymentMethod,
|
||||||
|
// nominalBayar: widget.paymentMethod == "Cash"
|
||||||
|
// ? widget.nominalBayar
|
||||||
|
// : widget.order.totalAmount ?? 0,
|
||||||
|
// kembalian: widget.nominalBayar -
|
||||||
|
// (widget.order.totalAmount ?? 0),
|
||||||
|
// productQuantity: widget.productQuantity,
|
||||||
|
// );
|
||||||
|
// onPrint(
|
||||||
|
// context,
|
||||||
|
// productQuantity: widget.productQuantity,
|
||||||
|
// order: widget.order,
|
||||||
|
// );
|
||||||
|
},
|
||||||
|
label: 'Cetak Struk',
|
||||||
|
icon: Icon(Icons.print_rounded, color: AppColor.white),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildInfoRow({
|
||||||
|
required IconData icon,
|
||||||
|
required String label,
|
||||||
|
required String value,
|
||||||
|
Color? valueColor,
|
||||||
|
bool showBadge = false,
|
||||||
|
}) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
Icon(icon, size: 18, color: AppColor.primary),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
label,
|
||||||
|
style: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (showBadge && valueColor != null)
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: valueColor.withOpacity(0.1),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(Icons.check_circle, size: 14, color: valueColor),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Text(
|
||||||
|
value,
|
||||||
|
style: AppStyle.sm.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: valueColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else
|
||||||
|
Text(
|
||||||
|
value,
|
||||||
|
style: AppStyle.md.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: valueColor ?? AppColor.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,352 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../../../../common/extension/extension.dart';
|
||||||
|
import '../../../../../../common/theme/theme.dart';
|
||||||
|
import '../../../../../../domain/order/order.dart';
|
||||||
|
import '../../../../../components/spaces/space.dart';
|
||||||
|
|
||||||
|
class SuccessOrderRightPanel extends StatelessWidget {
|
||||||
|
final Order order;
|
||||||
|
const SuccessOrderRightPanel({super.key, required this.order});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(24),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
_header(),
|
||||||
|
Expanded(
|
||||||
|
child: ListView.separated(
|
||||||
|
padding: const EdgeInsets.all(24.0),
|
||||||
|
itemCount: order.orderItems.length,
|
||||||
|
separatorBuilder: (context, index) => const SizedBox(height: 12),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return _buildProductCard(index);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
_buildSummaryFooter(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildSummaryFooter() {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.all(24.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
colors: [Colors.grey.shade50, Colors.white],
|
||||||
|
),
|
||||||
|
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(24)),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
// Decorative Divider
|
||||||
|
Container(
|
||||||
|
height: 1,
|
||||||
|
margin: const EdgeInsets.only(bottom: 20),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Colors.transparent,
|
||||||
|
AppColor.primary.withOpacity(0.3),
|
||||||
|
Colors.transparent,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Subtotal Row
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.shopping_cart_outlined,
|
||||||
|
size: 16,
|
||||||
|
color: AppColor.textSecondary,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
'Subtotal (${order.orderItems.length} items)',
|
||||||
|
style: AppStyle.md.copyWith(
|
||||||
|
color: AppColor.textSecondary,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
(order.totalAmount).toString().currencyFormatRpV2,
|
||||||
|
style: AppStyle.md.copyWith(fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
const SpaceHeight(16),
|
||||||
|
|
||||||
|
// Total Payment Row with Enhanced Styling
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: [
|
||||||
|
AppColor.primary.withOpacity(0.1),
|
||||||
|
AppColor.primary.withOpacity(0.05),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColor.primary.withOpacity(0.2),
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(6),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.primary.withOpacity(0.2),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
Icons.payments_rounded,
|
||||||
|
size: 16,
|
||||||
|
color: AppColor.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SpaceWidth(12),
|
||||||
|
Text(
|
||||||
|
'Total Pembayaran',
|
||||||
|
style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 12,
|
||||||
|
vertical: 6,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
AppColor.primary,
|
||||||
|
AppColor.primary.withOpacity(0.8),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.primary.withOpacity(0.3),
|
||||||
|
blurRadius: 4,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
(order.totalAmount).toString().currencyFormatRpV2,
|
||||||
|
style: AppStyle.xl.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildProductCard(int index) {
|
||||||
|
final item = order.orderItems[index];
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
|
border: Border.all(color: AppColor.border, width: 1),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
// Enhanced Product Image
|
||||||
|
Container(
|
||||||
|
width: 70,
|
||||||
|
height: 70,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.primaryWithOpacity(0.1),
|
||||||
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
Icons.restaurant_rounded,
|
||||||
|
color: AppColor.primary,
|
||||||
|
size: 28,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
const SpaceWidth(16),
|
||||||
|
|
||||||
|
// Product Details
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item.productName,
|
||||||
|
style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
const SpaceHeight(6),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 8,
|
||||||
|
vertical: 4,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.grey.shade100,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
item.unitPrice.currencyFormatRpV2,
|
||||||
|
style: AppStyle.md.copyWith(
|
||||||
|
color: AppColor.textSecondary,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
const SpaceWidth(16),
|
||||||
|
|
||||||
|
// Quantity and Total
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 12,
|
||||||
|
vertical: 8,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
AppColor.primary,
|
||||||
|
AppColor.primary.withOpacity(0.8),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'${item.quantity}x',
|
||||||
|
style: AppStyle.md.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SpaceHeight(8),
|
||||||
|
Text(
|
||||||
|
item.totalPrice.toString().currencyFormatRpV2,
|
||||||
|
style: AppStyle.lg.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: AppColor.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Container _header() {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.all(24.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border(bottom: BorderSide(color: AppColor.border)),
|
||||||
|
borderRadius: const BorderRadius.vertical(top: Radius.circular(24)),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(12.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
AppColor.primary.withOpacity(0.2),
|
||||||
|
AppColor.primary.withOpacity(0.1),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
Icons.receipt_long_rounded,
|
||||||
|
color: AppColor.primary,
|
||||||
|
size: 28,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SpaceWidth(16),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Detail Pesanan',
|
||||||
|
style: AppStyle.xxl.copyWith(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
SpaceHeight(4),
|
||||||
|
Text(
|
||||||
|
'Ringkasan item yang dipesan',
|
||||||
|
style: AppStyle.md.copyWith(color: Colors.grey.shade600),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [AppColor.primary, AppColor.primary.withOpacity(0.8)],
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.primary.withOpacity(0.3),
|
||||||
|
blurRadius: 8,
|
||||||
|
offset: const Offset(0, 4),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'${order.orderItems.length} Items',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -31,5 +31,6 @@ class AppRouter extends RootStackRouter {
|
|||||||
|
|
||||||
// Order
|
// Order
|
||||||
AutoRoute(page: OrderRoute.page),
|
AutoRoute(page: OrderRoute.page),
|
||||||
|
AutoRoute(page: SuccessOrderRoute.page),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
// coverage:ignore-file
|
// coverage:ignore-file
|
||||||
|
|
||||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||||
|
import 'package:apskel_pos_flutter_v2/domain/order/order.dart' as _i15;
|
||||||
import 'package:apskel_pos_flutter_v2/presentation/pages/auth/login/login_page.dart'
|
import 'package:apskel_pos_flutter_v2/presentation/pages/auth/login/login_page.dart'
|
||||||
as _i4;
|
as _i4;
|
||||||
import 'package:apskel_pos_flutter_v2/presentation/pages/checkout/checkout_page.dart'
|
import 'package:apskel_pos_flutter_v2/presentation/pages/checkout/checkout_page.dart'
|
||||||
@ -24,89 +25,91 @@ import 'package:apskel_pos_flutter_v2/presentation/pages/main/pages/report/repor
|
|||||||
import 'package:apskel_pos_flutter_v2/presentation/pages/main/pages/setting/setting_page.dart'
|
import 'package:apskel_pos_flutter_v2/presentation/pages/main/pages/setting/setting_page.dart'
|
||||||
as _i8;
|
as _i8;
|
||||||
import 'package:apskel_pos_flutter_v2/presentation/pages/main/pages/table/table_page.dart'
|
import 'package:apskel_pos_flutter_v2/presentation/pages/main/pages/table/table_page.dart'
|
||||||
as _i11;
|
as _i12;
|
||||||
import 'package:apskel_pos_flutter_v2/presentation/pages/order/order_page.dart'
|
import 'package:apskel_pos_flutter_v2/presentation/pages/order/order_page.dart'
|
||||||
as _i6;
|
as _i6;
|
||||||
|
import 'package:apskel_pos_flutter_v2/presentation/pages/order/pages/success_order/success_order_page.dart'
|
||||||
|
as _i10;
|
||||||
import 'package:apskel_pos_flutter_v2/presentation/pages/splash/splash_page.dart'
|
import 'package:apskel_pos_flutter_v2/presentation/pages/splash/splash_page.dart'
|
||||||
as _i9;
|
as _i9;
|
||||||
import 'package:apskel_pos_flutter_v2/presentation/pages/sync/sync_page.dart'
|
import 'package:apskel_pos_flutter_v2/presentation/pages/sync/sync_page.dart'
|
||||||
as _i10;
|
as _i11;
|
||||||
import 'package:auto_route/auto_route.dart' as _i12;
|
import 'package:auto_route/auto_route.dart' as _i13;
|
||||||
import 'package:flutter/material.dart' as _i13;
|
import 'package:flutter/material.dart' as _i14;
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [_i1.CheckoutPage]
|
/// [_i1.CheckoutPage]
|
||||||
class CheckoutRoute extends _i12.PageRouteInfo<void> {
|
class CheckoutRoute extends _i13.PageRouteInfo<void> {
|
||||||
const CheckoutRoute({List<_i12.PageRouteInfo>? children})
|
const CheckoutRoute({List<_i13.PageRouteInfo>? children})
|
||||||
: super(CheckoutRoute.name, initialChildren: children);
|
: super(CheckoutRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'CheckoutRoute';
|
static const String name = 'CheckoutRoute';
|
||||||
|
|
||||||
static _i12.PageInfo page = _i12.PageInfo(
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
name,
|
name,
|
||||||
builder: (data) {
|
builder: (data) {
|
||||||
return _i12.WrappedRoute(child: const _i1.CheckoutPage());
|
return _i13.WrappedRoute(child: const _i1.CheckoutPage());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [_i2.CustomerPage]
|
/// [_i2.CustomerPage]
|
||||||
class CustomerRoute extends _i12.PageRouteInfo<void> {
|
class CustomerRoute extends _i13.PageRouteInfo<void> {
|
||||||
const CustomerRoute({List<_i12.PageRouteInfo>? children})
|
const CustomerRoute({List<_i13.PageRouteInfo>? children})
|
||||||
: super(CustomerRoute.name, initialChildren: children);
|
: super(CustomerRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'CustomerRoute';
|
static const String name = 'CustomerRoute';
|
||||||
|
|
||||||
static _i12.PageInfo page = _i12.PageInfo(
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
name,
|
name,
|
||||||
builder: (data) {
|
builder: (data) {
|
||||||
return _i12.WrappedRoute(child: const _i2.CustomerPage());
|
return _i13.WrappedRoute(child: const _i2.CustomerPage());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [_i3.HomePage]
|
/// [_i3.HomePage]
|
||||||
class HomeRoute extends _i12.PageRouteInfo<void> {
|
class HomeRoute extends _i13.PageRouteInfo<void> {
|
||||||
const HomeRoute({List<_i12.PageRouteInfo>? children})
|
const HomeRoute({List<_i13.PageRouteInfo>? children})
|
||||||
: super(HomeRoute.name, initialChildren: children);
|
: super(HomeRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'HomeRoute';
|
static const String name = 'HomeRoute';
|
||||||
|
|
||||||
static _i12.PageInfo page = _i12.PageInfo(
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
name,
|
name,
|
||||||
builder: (data) {
|
builder: (data) {
|
||||||
return _i12.WrappedRoute(child: const _i3.HomePage());
|
return _i13.WrappedRoute(child: const _i3.HomePage());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [_i4.LoginPage]
|
/// [_i4.LoginPage]
|
||||||
class LoginRoute extends _i12.PageRouteInfo<void> {
|
class LoginRoute extends _i13.PageRouteInfo<void> {
|
||||||
const LoginRoute({List<_i12.PageRouteInfo>? children})
|
const LoginRoute({List<_i13.PageRouteInfo>? children})
|
||||||
: super(LoginRoute.name, initialChildren: children);
|
: super(LoginRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'LoginRoute';
|
static const String name = 'LoginRoute';
|
||||||
|
|
||||||
static _i12.PageInfo page = _i12.PageInfo(
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
name,
|
name,
|
||||||
builder: (data) {
|
builder: (data) {
|
||||||
return _i12.WrappedRoute(child: const _i4.LoginPage());
|
return _i13.WrappedRoute(child: const _i4.LoginPage());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [_i5.MainPage]
|
/// [_i5.MainPage]
|
||||||
class MainRoute extends _i12.PageRouteInfo<void> {
|
class MainRoute extends _i13.PageRouteInfo<void> {
|
||||||
const MainRoute({List<_i12.PageRouteInfo>? children})
|
const MainRoute({List<_i13.PageRouteInfo>? children})
|
||||||
: super(MainRoute.name, initialChildren: children);
|
: super(MainRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'MainRoute';
|
static const String name = 'MainRoute';
|
||||||
|
|
||||||
static _i12.PageInfo page = _i12.PageInfo(
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
name,
|
name,
|
||||||
builder: (data) {
|
builder: (data) {
|
||||||
return const _i5.MainPage();
|
return const _i5.MainPage();
|
||||||
@ -116,11 +119,11 @@ class MainRoute extends _i12.PageRouteInfo<void> {
|
|||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [_i6.OrderPage]
|
/// [_i6.OrderPage]
|
||||||
class OrderRoute extends _i12.PageRouteInfo<OrderRouteArgs> {
|
class OrderRoute extends _i13.PageRouteInfo<OrderRouteArgs> {
|
||||||
OrderRoute({
|
OrderRoute({
|
||||||
_i13.Key? key,
|
_i14.Key? key,
|
||||||
required String status,
|
required String status,
|
||||||
List<_i12.PageRouteInfo>? children,
|
List<_i13.PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
OrderRoute.name,
|
OrderRoute.name,
|
||||||
args: OrderRouteArgs(key: key, status: status),
|
args: OrderRouteArgs(key: key, status: status),
|
||||||
@ -129,11 +132,11 @@ class OrderRoute extends _i12.PageRouteInfo<OrderRouteArgs> {
|
|||||||
|
|
||||||
static const String name = 'OrderRoute';
|
static const String name = 'OrderRoute';
|
||||||
|
|
||||||
static _i12.PageInfo page = _i12.PageInfo(
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
name,
|
name,
|
||||||
builder: (data) {
|
builder: (data) {
|
||||||
final args = data.argsAs<OrderRouteArgs>();
|
final args = data.argsAs<OrderRouteArgs>();
|
||||||
return _i12.WrappedRoute(
|
return _i13.WrappedRoute(
|
||||||
child: _i6.OrderPage(key: args.key, status: args.status),
|
child: _i6.OrderPage(key: args.key, status: args.status),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -143,7 +146,7 @@ class OrderRoute extends _i12.PageRouteInfo<OrderRouteArgs> {
|
|||||||
class OrderRouteArgs {
|
class OrderRouteArgs {
|
||||||
const OrderRouteArgs({this.key, required this.status});
|
const OrderRouteArgs({this.key, required this.status});
|
||||||
|
|
||||||
final _i13.Key? key;
|
final _i14.Key? key;
|
||||||
|
|
||||||
final String status;
|
final String status;
|
||||||
|
|
||||||
@ -155,13 +158,13 @@ class OrderRouteArgs {
|
|||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [_i7.ReportPage]
|
/// [_i7.ReportPage]
|
||||||
class ReportRoute extends _i12.PageRouteInfo<void> {
|
class ReportRoute extends _i13.PageRouteInfo<void> {
|
||||||
const ReportRoute({List<_i12.PageRouteInfo>? children})
|
const ReportRoute({List<_i13.PageRouteInfo>? children})
|
||||||
: super(ReportRoute.name, initialChildren: children);
|
: super(ReportRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'ReportRoute';
|
static const String name = 'ReportRoute';
|
||||||
|
|
||||||
static _i12.PageInfo page = _i12.PageInfo(
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
name,
|
name,
|
||||||
builder: (data) {
|
builder: (data) {
|
||||||
return const _i7.ReportPage();
|
return const _i7.ReportPage();
|
||||||
@ -171,13 +174,13 @@ class ReportRoute extends _i12.PageRouteInfo<void> {
|
|||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [_i8.SettingPage]
|
/// [_i8.SettingPage]
|
||||||
class SettingRoute extends _i12.PageRouteInfo<void> {
|
class SettingRoute extends _i13.PageRouteInfo<void> {
|
||||||
const SettingRoute({List<_i12.PageRouteInfo>? children})
|
const SettingRoute({List<_i13.PageRouteInfo>? children})
|
||||||
: super(SettingRoute.name, initialChildren: children);
|
: super(SettingRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'SettingRoute';
|
static const String name = 'SettingRoute';
|
||||||
|
|
||||||
static _i12.PageInfo page = _i12.PageInfo(
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
name,
|
name,
|
||||||
builder: (data) {
|
builder: (data) {
|
||||||
return const _i8.SettingPage();
|
return const _i8.SettingPage();
|
||||||
@ -187,13 +190,13 @@ class SettingRoute extends _i12.PageRouteInfo<void> {
|
|||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [_i9.SplashPage]
|
/// [_i9.SplashPage]
|
||||||
class SplashRoute extends _i12.PageRouteInfo<void> {
|
class SplashRoute extends _i13.PageRouteInfo<void> {
|
||||||
const SplashRoute({List<_i12.PageRouteInfo>? children})
|
const SplashRoute({List<_i13.PageRouteInfo>? children})
|
||||||
: super(SplashRoute.name, initialChildren: children);
|
: super(SplashRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'SplashRoute';
|
static const String name = 'SplashRoute';
|
||||||
|
|
||||||
static _i12.PageInfo page = _i12.PageInfo(
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
name,
|
name,
|
||||||
builder: (data) {
|
builder: (data) {
|
||||||
return const _i9.SplashPage();
|
return const _i9.SplashPage();
|
||||||
@ -202,33 +205,72 @@ class SplashRoute extends _i12.PageRouteInfo<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [_i10.SyncPage]
|
/// [_i10.SuccessOrderPage]
|
||||||
class SyncRoute extends _i12.PageRouteInfo<void> {
|
class SuccessOrderRoute extends _i13.PageRouteInfo<SuccessOrderRouteArgs> {
|
||||||
const SyncRoute({List<_i12.PageRouteInfo>? children})
|
SuccessOrderRoute({
|
||||||
|
_i14.Key? key,
|
||||||
|
required _i15.Order order,
|
||||||
|
List<_i13.PageRouteInfo>? children,
|
||||||
|
}) : super(
|
||||||
|
SuccessOrderRoute.name,
|
||||||
|
args: SuccessOrderRouteArgs(key: key, order: order),
|
||||||
|
initialChildren: children,
|
||||||
|
);
|
||||||
|
|
||||||
|
static const String name = 'SuccessOrderRoute';
|
||||||
|
|
||||||
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
|
name,
|
||||||
|
builder: (data) {
|
||||||
|
final args = data.argsAs<SuccessOrderRouteArgs>();
|
||||||
|
return _i13.WrappedRoute(
|
||||||
|
child: _i10.SuccessOrderPage(key: args.key, order: args.order),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class SuccessOrderRouteArgs {
|
||||||
|
const SuccessOrderRouteArgs({this.key, required this.order});
|
||||||
|
|
||||||
|
final _i14.Key? key;
|
||||||
|
|
||||||
|
final _i15.Order order;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'SuccessOrderRouteArgs{key: $key, order: $order}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// generated route for
|
||||||
|
/// [_i11.SyncPage]
|
||||||
|
class SyncRoute extends _i13.PageRouteInfo<void> {
|
||||||
|
const SyncRoute({List<_i13.PageRouteInfo>? children})
|
||||||
: super(SyncRoute.name, initialChildren: children);
|
: super(SyncRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'SyncRoute';
|
static const String name = 'SyncRoute';
|
||||||
|
|
||||||
static _i12.PageInfo page = _i12.PageInfo(
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
name,
|
name,
|
||||||
builder: (data) {
|
builder: (data) {
|
||||||
return _i12.WrappedRoute(child: const _i10.SyncPage());
|
return _i13.WrappedRoute(child: const _i11.SyncPage());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [_i11.TablePage]
|
/// [_i12.TablePage]
|
||||||
class TableRoute extends _i12.PageRouteInfo<void> {
|
class TableRoute extends _i13.PageRouteInfo<void> {
|
||||||
const TableRoute({List<_i12.PageRouteInfo>? children})
|
const TableRoute({List<_i13.PageRouteInfo>? children})
|
||||||
: super(TableRoute.name, initialChildren: children);
|
: super(TableRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'TableRoute';
|
static const String name = 'TableRoute';
|
||||||
|
|
||||||
static _i12.PageInfo page = _i12.PageInfo(
|
static _i13.PageInfo page = _i13.PageInfo(
|
||||||
name,
|
name,
|
||||||
builder: (data) {
|
builder: (data) {
|
||||||
return _i12.WrappedRoute(child: const _i11.TablePage());
|
return _i13.WrappedRoute(child: const _i12.TablePage());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user