success void
This commit is contained in:
parent
8d9e622121
commit
7961c9d8c5
@ -115,6 +115,9 @@ class VoidFormBloc extends Bloc<VoidFormEvent, VoidFormState> {
|
||||
),
|
||||
);
|
||||
},
|
||||
clearState: (e) async {
|
||||
emit(VoidFormState.initial());
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ mixin _$VoidFormEvent {
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
required TResult Function() clearSelectedItem,
|
||||
required TResult Function() submitted,
|
||||
required TResult Function() clearState,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
@ -34,6 +35,7 @@ mixin _$VoidFormEvent {
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult? Function()? clearSelectedItem,
|
||||
TResult? Function()? submitted,
|
||||
TResult? Function()? clearState,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
@ -43,6 +45,7 @@ mixin _$VoidFormEvent {
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult Function()? clearSelectedItem,
|
||||
TResult Function()? submitted,
|
||||
TResult Function()? clearState,
|
||||
required TResult orElse(),
|
||||
}) => throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
@ -53,6 +56,7 @@ mixin _$VoidFormEvent {
|
||||
required TResult Function(_ItemQuantityChanged value) itemQuantityChanged,
|
||||
required TResult Function(_ClearSelectedItem value) clearSelectedItem,
|
||||
required TResult Function(_Submitted value) submitted,
|
||||
required TResult Function(_ClearState value) clearState,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>({
|
||||
@ -62,6 +66,7 @@ mixin _$VoidFormEvent {
|
||||
TResult? Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult? Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult? Function(_Submitted value)? submitted,
|
||||
TResult? Function(_ClearState value)? clearState,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>({
|
||||
@ -71,6 +76,7 @@ mixin _$VoidFormEvent {
|
||||
TResult Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult Function(_Submitted value)? submitted,
|
||||
TResult Function(_ClearState value)? clearState,
|
||||
required TResult orElse(),
|
||||
}) => throw _privateConstructorUsedError;
|
||||
}
|
||||
@ -185,6 +191,7 @@ class _$SetOrderImpl implements _SetOrder {
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
required TResult Function() clearSelectedItem,
|
||||
required TResult Function() submitted,
|
||||
required TResult Function() clearState,
|
||||
}) {
|
||||
return setOrder(order);
|
||||
}
|
||||
@ -198,6 +205,7 @@ class _$SetOrderImpl implements _SetOrder {
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult? Function()? clearSelectedItem,
|
||||
TResult? Function()? submitted,
|
||||
TResult? Function()? clearState,
|
||||
}) {
|
||||
return setOrder?.call(order);
|
||||
}
|
||||
@ -211,6 +219,7 @@ class _$SetOrderImpl implements _SetOrder {
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult Function()? clearSelectedItem,
|
||||
TResult Function()? submitted,
|
||||
TResult Function()? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (setOrder != null) {
|
||||
@ -228,6 +237,7 @@ class _$SetOrderImpl implements _SetOrder {
|
||||
required TResult Function(_ItemQuantityChanged value) itemQuantityChanged,
|
||||
required TResult Function(_ClearSelectedItem value) clearSelectedItem,
|
||||
required TResult Function(_Submitted value) submitted,
|
||||
required TResult Function(_ClearState value) clearState,
|
||||
}) {
|
||||
return setOrder(this);
|
||||
}
|
||||
@ -241,6 +251,7 @@ class _$SetOrderImpl implements _SetOrder {
|
||||
TResult? Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult? Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult? Function(_Submitted value)? submitted,
|
||||
TResult? Function(_ClearState value)? clearState,
|
||||
}) {
|
||||
return setOrder?.call(this);
|
||||
}
|
||||
@ -254,6 +265,7 @@ class _$SetOrderImpl implements _SetOrder {
|
||||
TResult Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult Function(_Submitted value)? submitted,
|
||||
TResult Function(_ClearState value)? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (setOrder != null) {
|
||||
@ -355,6 +367,7 @@ class _$VoidTypeChangedImpl implements _VoidTypeChanged {
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
required TResult Function() clearSelectedItem,
|
||||
required TResult Function() submitted,
|
||||
required TResult Function() clearState,
|
||||
}) {
|
||||
return voidTypeChanged(voidType);
|
||||
}
|
||||
@ -368,6 +381,7 @@ class _$VoidTypeChangedImpl implements _VoidTypeChanged {
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult? Function()? clearSelectedItem,
|
||||
TResult? Function()? submitted,
|
||||
TResult? Function()? clearState,
|
||||
}) {
|
||||
return voidTypeChanged?.call(voidType);
|
||||
}
|
||||
@ -381,6 +395,7 @@ class _$VoidTypeChangedImpl implements _VoidTypeChanged {
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult Function()? clearSelectedItem,
|
||||
TResult Function()? submitted,
|
||||
TResult Function()? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (voidTypeChanged != null) {
|
||||
@ -398,6 +413,7 @@ class _$VoidTypeChangedImpl implements _VoidTypeChanged {
|
||||
required TResult Function(_ItemQuantityChanged value) itemQuantityChanged,
|
||||
required TResult Function(_ClearSelectedItem value) clearSelectedItem,
|
||||
required TResult Function(_Submitted value) submitted,
|
||||
required TResult Function(_ClearState value) clearState,
|
||||
}) {
|
||||
return voidTypeChanged(this);
|
||||
}
|
||||
@ -411,6 +427,7 @@ class _$VoidTypeChangedImpl implements _VoidTypeChanged {
|
||||
TResult? Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult? Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult? Function(_Submitted value)? submitted,
|
||||
TResult? Function(_ClearState value)? clearState,
|
||||
}) {
|
||||
return voidTypeChanged?.call(this);
|
||||
}
|
||||
@ -424,6 +441,7 @@ class _$VoidTypeChangedImpl implements _VoidTypeChanged {
|
||||
TResult Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult Function(_Submitted value)? submitted,
|
||||
TResult Function(_ClearState value)? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (voidTypeChanged != null) {
|
||||
@ -526,6 +544,7 @@ class _$VoidReasonChangedImpl implements _VoidReasonChanged {
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
required TResult Function() clearSelectedItem,
|
||||
required TResult Function() submitted,
|
||||
required TResult Function() clearState,
|
||||
}) {
|
||||
return voidReasonChanged(voidReason);
|
||||
}
|
||||
@ -539,6 +558,7 @@ class _$VoidReasonChangedImpl implements _VoidReasonChanged {
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult? Function()? clearSelectedItem,
|
||||
TResult? Function()? submitted,
|
||||
TResult? Function()? clearState,
|
||||
}) {
|
||||
return voidReasonChanged?.call(voidReason);
|
||||
}
|
||||
@ -552,6 +572,7 @@ class _$VoidReasonChangedImpl implements _VoidReasonChanged {
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult Function()? clearSelectedItem,
|
||||
TResult Function()? submitted,
|
||||
TResult Function()? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (voidReasonChanged != null) {
|
||||
@ -569,6 +590,7 @@ class _$VoidReasonChangedImpl implements _VoidReasonChanged {
|
||||
required TResult Function(_ItemQuantityChanged value) itemQuantityChanged,
|
||||
required TResult Function(_ClearSelectedItem value) clearSelectedItem,
|
||||
required TResult Function(_Submitted value) submitted,
|
||||
required TResult Function(_ClearState value) clearState,
|
||||
}) {
|
||||
return voidReasonChanged(this);
|
||||
}
|
||||
@ -582,6 +604,7 @@ class _$VoidReasonChangedImpl implements _VoidReasonChanged {
|
||||
TResult? Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult? Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult? Function(_Submitted value)? submitted,
|
||||
TResult? Function(_ClearState value)? clearState,
|
||||
}) {
|
||||
return voidReasonChanged?.call(this);
|
||||
}
|
||||
@ -595,6 +618,7 @@ class _$VoidReasonChangedImpl implements _VoidReasonChanged {
|
||||
TResult Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult Function(_Submitted value)? submitted,
|
||||
TResult Function(_ClearState value)? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (voidReasonChanged != null) {
|
||||
@ -707,6 +731,7 @@ class _$ItemQuantityChangedImpl implements _ItemQuantityChanged {
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
required TResult Function() clearSelectedItem,
|
||||
required TResult Function() submitted,
|
||||
required TResult Function() clearState,
|
||||
}) {
|
||||
return itemQuantityChanged(itemId, quantity);
|
||||
}
|
||||
@ -720,6 +745,7 @@ class _$ItemQuantityChangedImpl implements _ItemQuantityChanged {
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult? Function()? clearSelectedItem,
|
||||
TResult? Function()? submitted,
|
||||
TResult? Function()? clearState,
|
||||
}) {
|
||||
return itemQuantityChanged?.call(itemId, quantity);
|
||||
}
|
||||
@ -733,6 +759,7 @@ class _$ItemQuantityChangedImpl implements _ItemQuantityChanged {
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult Function()? clearSelectedItem,
|
||||
TResult Function()? submitted,
|
||||
TResult Function()? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (itemQuantityChanged != null) {
|
||||
@ -750,6 +777,7 @@ class _$ItemQuantityChangedImpl implements _ItemQuantityChanged {
|
||||
required TResult Function(_ItemQuantityChanged value) itemQuantityChanged,
|
||||
required TResult Function(_ClearSelectedItem value) clearSelectedItem,
|
||||
required TResult Function(_Submitted value) submitted,
|
||||
required TResult Function(_ClearState value) clearState,
|
||||
}) {
|
||||
return itemQuantityChanged(this);
|
||||
}
|
||||
@ -763,6 +791,7 @@ class _$ItemQuantityChangedImpl implements _ItemQuantityChanged {
|
||||
TResult? Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult? Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult? Function(_Submitted value)? submitted,
|
||||
TResult? Function(_ClearState value)? clearState,
|
||||
}) {
|
||||
return itemQuantityChanged?.call(this);
|
||||
}
|
||||
@ -776,6 +805,7 @@ class _$ItemQuantityChangedImpl implements _ItemQuantityChanged {
|
||||
TResult Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult Function(_Submitted value)? submitted,
|
||||
TResult Function(_ClearState value)? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (itemQuantityChanged != null) {
|
||||
@ -850,6 +880,7 @@ class _$ClearSelectedItemImpl implements _ClearSelectedItem {
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
required TResult Function() clearSelectedItem,
|
||||
required TResult Function() submitted,
|
||||
required TResult Function() clearState,
|
||||
}) {
|
||||
return clearSelectedItem();
|
||||
}
|
||||
@ -863,6 +894,7 @@ class _$ClearSelectedItemImpl implements _ClearSelectedItem {
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult? Function()? clearSelectedItem,
|
||||
TResult? Function()? submitted,
|
||||
TResult? Function()? clearState,
|
||||
}) {
|
||||
return clearSelectedItem?.call();
|
||||
}
|
||||
@ -876,6 +908,7 @@ class _$ClearSelectedItemImpl implements _ClearSelectedItem {
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult Function()? clearSelectedItem,
|
||||
TResult Function()? submitted,
|
||||
TResult Function()? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (clearSelectedItem != null) {
|
||||
@ -893,6 +926,7 @@ class _$ClearSelectedItemImpl implements _ClearSelectedItem {
|
||||
required TResult Function(_ItemQuantityChanged value) itemQuantityChanged,
|
||||
required TResult Function(_ClearSelectedItem value) clearSelectedItem,
|
||||
required TResult Function(_Submitted value) submitted,
|
||||
required TResult Function(_ClearState value) clearState,
|
||||
}) {
|
||||
return clearSelectedItem(this);
|
||||
}
|
||||
@ -906,6 +940,7 @@ class _$ClearSelectedItemImpl implements _ClearSelectedItem {
|
||||
TResult? Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult? Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult? Function(_Submitted value)? submitted,
|
||||
TResult? Function(_ClearState value)? clearState,
|
||||
}) {
|
||||
return clearSelectedItem?.call(this);
|
||||
}
|
||||
@ -919,6 +954,7 @@ class _$ClearSelectedItemImpl implements _ClearSelectedItem {
|
||||
TResult Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult Function(_Submitted value)? submitted,
|
||||
TResult Function(_ClearState value)? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (clearSelectedItem != null) {
|
||||
@ -981,6 +1017,7 @@ class _$SubmittedImpl implements _Submitted {
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
required TResult Function() clearSelectedItem,
|
||||
required TResult Function() submitted,
|
||||
required TResult Function() clearState,
|
||||
}) {
|
||||
return submitted();
|
||||
}
|
||||
@ -994,6 +1031,7 @@ class _$SubmittedImpl implements _Submitted {
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult? Function()? clearSelectedItem,
|
||||
TResult? Function()? submitted,
|
||||
TResult? Function()? clearState,
|
||||
}) {
|
||||
return submitted?.call();
|
||||
}
|
||||
@ -1007,6 +1045,7 @@ class _$SubmittedImpl implements _Submitted {
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult Function()? clearSelectedItem,
|
||||
TResult Function()? submitted,
|
||||
TResult Function()? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (submitted != null) {
|
||||
@ -1024,6 +1063,7 @@ class _$SubmittedImpl implements _Submitted {
|
||||
required TResult Function(_ItemQuantityChanged value) itemQuantityChanged,
|
||||
required TResult Function(_ClearSelectedItem value) clearSelectedItem,
|
||||
required TResult Function(_Submitted value) submitted,
|
||||
required TResult Function(_ClearState value) clearState,
|
||||
}) {
|
||||
return submitted(this);
|
||||
}
|
||||
@ -1037,6 +1077,7 @@ class _$SubmittedImpl implements _Submitted {
|
||||
TResult? Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult? Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult? Function(_Submitted value)? submitted,
|
||||
TResult? Function(_ClearState value)? clearState,
|
||||
}) {
|
||||
return submitted?.call(this);
|
||||
}
|
||||
@ -1050,6 +1091,7 @@ class _$SubmittedImpl implements _Submitted {
|
||||
TResult Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult Function(_Submitted value)? submitted,
|
||||
TResult Function(_ClearState value)? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (submitted != null) {
|
||||
@ -1063,6 +1105,143 @@ abstract class _Submitted implements VoidFormEvent {
|
||||
const factory _Submitted() = _$SubmittedImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ClearStateImplCopyWith<$Res> {
|
||||
factory _$$ClearStateImplCopyWith(
|
||||
_$ClearStateImpl value,
|
||||
$Res Function(_$ClearStateImpl) then,
|
||||
) = __$$ClearStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ClearStateImplCopyWithImpl<$Res>
|
||||
extends _$VoidFormEventCopyWithImpl<$Res, _$ClearStateImpl>
|
||||
implements _$$ClearStateImplCopyWith<$Res> {
|
||||
__$$ClearStateImplCopyWithImpl(
|
||||
_$ClearStateImpl _value,
|
||||
$Res Function(_$ClearStateImpl) _then,
|
||||
) : super(_value, _then);
|
||||
|
||||
/// Create a copy of VoidFormEvent
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ClearStateImpl implements _ClearState {
|
||||
const _$ClearStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'VoidFormEvent.clearState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$ClearStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) setOrder,
|
||||
required TResult Function(VoidType voidType) voidTypeChanged,
|
||||
required TResult Function(String voidReason) voidReasonChanged,
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
required TResult Function() clearSelectedItem,
|
||||
required TResult Function() submitted,
|
||||
required TResult Function() clearState,
|
||||
}) {
|
||||
return clearState();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? setOrder,
|
||||
TResult? Function(VoidType voidType)? voidTypeChanged,
|
||||
TResult? Function(String voidReason)? voidReasonChanged,
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult? Function()? clearSelectedItem,
|
||||
TResult? Function()? submitted,
|
||||
TResult? Function()? clearState,
|
||||
}) {
|
||||
return clearState?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? setOrder,
|
||||
TResult Function(VoidType voidType)? voidTypeChanged,
|
||||
TResult Function(String voidReason)? voidReasonChanged,
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
TResult Function()? clearSelectedItem,
|
||||
TResult Function()? submitted,
|
||||
TResult Function()? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (clearState != null) {
|
||||
return clearState();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>({
|
||||
required TResult Function(_SetOrder value) setOrder,
|
||||
required TResult Function(_VoidTypeChanged value) voidTypeChanged,
|
||||
required TResult Function(_VoidReasonChanged value) voidReasonChanged,
|
||||
required TResult Function(_ItemQuantityChanged value) itemQuantityChanged,
|
||||
required TResult Function(_ClearSelectedItem value) clearSelectedItem,
|
||||
required TResult Function(_Submitted value) submitted,
|
||||
required TResult Function(_ClearState value) clearState,
|
||||
}) {
|
||||
return clearState(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>({
|
||||
TResult? Function(_SetOrder value)? setOrder,
|
||||
TResult? Function(_VoidTypeChanged value)? voidTypeChanged,
|
||||
TResult? Function(_VoidReasonChanged value)? voidReasonChanged,
|
||||
TResult? Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult? Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult? Function(_Submitted value)? submitted,
|
||||
TResult? Function(_ClearState value)? clearState,
|
||||
}) {
|
||||
return clearState?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>({
|
||||
TResult Function(_SetOrder value)? setOrder,
|
||||
TResult Function(_VoidTypeChanged value)? voidTypeChanged,
|
||||
TResult Function(_VoidReasonChanged value)? voidReasonChanged,
|
||||
TResult Function(_ItemQuantityChanged value)? itemQuantityChanged,
|
||||
TResult Function(_ClearSelectedItem value)? clearSelectedItem,
|
||||
TResult Function(_Submitted value)? submitted,
|
||||
TResult Function(_ClearState value)? clearState,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (clearState != null) {
|
||||
return clearState(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ClearState implements VoidFormEvent {
|
||||
const factory _ClearState() = _$ClearStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$VoidFormState {
|
||||
Order get order => throw _privateConstructorUsedError;
|
||||
|
||||
@ -13,4 +13,5 @@ class VoidFormEvent with _$VoidFormEvent {
|
||||
}) = _ItemQuantityChanged;
|
||||
const factory VoidFormEvent.clearSelectedItem() = _ClearSelectedItem;
|
||||
const factory VoidFormEvent.submitted() = _Submitted;
|
||||
const factory VoidFormEvent.clearState() = _ClearState;
|
||||
}
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../../../../application/void/void_form/void_form_bloc.dart';
|
||||
import '../../../../../common/theme/theme.dart';
|
||||
import '../../../../components/spaces/space.dart';
|
||||
import 'widgets/void_success_left_panel.dart';
|
||||
import 'widgets/void_success_right_panel.dart';
|
||||
|
||||
@RoutePage()
|
||||
class VoidSuccessPage extends StatelessWidget {
|
||||
const VoidSuccessPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.background,
|
||||
body: BlocBuilder<VoidFormBloc, VoidFormState>(
|
||||
builder: (context, state) {
|
||||
return SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(flex: 35, child: VoidSuccessLeftPanel(state: state)),
|
||||
SpaceWidth(16),
|
||||
Expanded(
|
||||
flex: 65,
|
||||
child: VoidSuccessRightPanel(state: state),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,228 @@
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../../../../../application/void/void_form/void_form_bloc.dart';
|
||||
import '../../../../../../common/extension/extension.dart';
|
||||
import '../../../../../../common/theme/theme.dart';
|
||||
import '../../../../../../common/types/void_type.dart';
|
||||
import '../../../../../components/button/button.dart';
|
||||
import '../../../../../components/spaces/space.dart';
|
||||
import '../../../../../router/app_router.gr.dart';
|
||||
|
||||
class VoidSuccessLeftPanel extends StatelessWidget {
|
||||
final VoidFormState state;
|
||||
const VoidSuccessLeftPanel({super.key, required this.state});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 120,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [AppColor.secondaryLight, AppColor.secondaryDark],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.secondaryDark.withOpacity(0.2),
|
||||
blurRadius: 20,
|
||||
offset: Offset(0, 10),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Icon(Icons.check_rounded, color: Colors.white, size: 60),
|
||||
),
|
||||
|
||||
SpaceHeight(16),
|
||||
Text(
|
||||
'Void Berhasil!',
|
||||
style: AppStyle.h1.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColor.success,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SpaceHeight(8),
|
||||
Text(
|
||||
state.voidType.isAll
|
||||
? 'Seluruh pesanan telah dibatalkan dengan sukses'
|
||||
: 'Item terpilih telah dibatalkan dengan sukses',
|
||||
style: AppStyle.lg.copyWith(
|
||||
fontSize: 16,
|
||||
color: AppColor.textSecondary,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SpaceHeight(16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Informasi Pesanan',
|
||||
style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
SpaceHeight(24),
|
||||
_buildInfoRow(
|
||||
icon: Icons.receipt_long,
|
||||
label: 'Order ID',
|
||||
value: state.order.orderNumber,
|
||||
),
|
||||
const SpaceHeight(12),
|
||||
_buildInfoRow(
|
||||
icon: Icons.person,
|
||||
label: 'Pemesan',
|
||||
value: state.order.metadata['customer_name'] ?? "-",
|
||||
),
|
||||
if (state.order.tableNumber != "") ...[
|
||||
const SpaceHeight(12),
|
||||
_buildInfoRow(
|
||||
icon: Icons.table_restaurant_outlined,
|
||||
label: 'No. Meja',
|
||||
value: state.order.tableNumber,
|
||||
),
|
||||
],
|
||||
const SpaceHeight(12),
|
||||
_buildInfoRow(
|
||||
icon: Icons.category_outlined,
|
||||
label: 'Tipe Void',
|
||||
value: state.voidType.isAll
|
||||
? 'Seluruh Pesanan'
|
||||
: 'Item Tertentu',
|
||||
),
|
||||
const SpaceHeight(12),
|
||||
_buildInfoRow(
|
||||
icon: Icons.access_time_rounded,
|
||||
label: 'Waktu',
|
||||
value: (DateTime.now()).toFormattedDateTime(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
_buildBottomSection(context),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomSection(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(16.0).copyWith(bottom: 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.read<VoidFormBloc>().add(
|
||||
VoidFormEvent.clearState(),
|
||||
);
|
||||
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),
|
||||
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
|
||||
Expanded(
|
||||
child: Text(
|
||||
value,
|
||||
style: AppStyle.md.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: valueColor ?? AppColor.primary,
|
||||
),
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,354 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../../../application/void/void_form/void_form_bloc.dart';
|
||||
import '../../../../../../common/extension/extension.dart';
|
||||
import '../../../../../../common/theme/theme.dart';
|
||||
import '../../../../../../common/types/void_type.dart';
|
||||
import '../../../../../components/spaces/space.dart';
|
||||
|
||||
class VoidSuccessRightPanel extends StatelessWidget {
|
||||
final VoidFormState state;
|
||||
const VoidSuccessRightPanel({super.key, required this.state});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.white,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
_header(),
|
||||
Expanded(
|
||||
child: ListView.separated(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
itemCount: state.voidItems.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(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'Alasan Void: ',
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.textSecondary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SpaceWidth(6),
|
||||
Expanded(
|
||||
child: Text(
|
||||
state.voidReason ?? '',
|
||||
style: AppStyle.md.copyWith(fontWeight: FontWeight.w600),
|
||||
textAlign: TextAlign.end,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
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 Void',
|
||||
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(
|
||||
state.voidType.isAll
|
||||
? state.order.totalAmount.currencyFormatRpV2
|
||||
: (state.totalPriceVoid).toString().currencyFormatRpV2,
|
||||
style: AppStyle.xl.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildProductCard(int index) {
|
||||
final item = state.voidItems[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(16.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.info_outline_rounded,
|
||||
color: AppColor.primary,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
SpaceWidth(16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Detail Void',
|
||||
style: AppStyle.xxl.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
SpaceHeight(4),
|
||||
Text(
|
||||
'Ringkasan item yang divoid',
|
||||
style: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
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(
|
||||
state.voidType.isAll
|
||||
? 'Semua Item'
|
||||
: '${state.voidItems.length} Items',
|
||||
style: AppStyle.sm.copyWith(
|
||||
fontSize: 13,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,7 @@ import '../../../common/theme/theme.dart';
|
||||
import '../../../domain/order/order.dart';
|
||||
import '../../components/spaces/space.dart';
|
||||
import '../../components/toast/flushbar.dart';
|
||||
import '../../router/app_router.gr.dart';
|
||||
import 'widgets/void_left_panel.dart';
|
||||
import 'widgets/void_right_panel.dart';
|
||||
|
||||
@ -26,7 +27,9 @@ class VoidPage extends StatelessWidget implements AutoRouteWrapper {
|
||||
(either) => either.fold(
|
||||
(f) => AppFlushbar.showOrderFailureToast(context, f),
|
||||
(success) {
|
||||
if (context.mounted) {}
|
||||
if (context.mounted) {
|
||||
context.router.replace(VoidSuccessRoute());
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@ -40,5 +40,6 @@ class AppRouter extends RootStackRouter {
|
||||
|
||||
// Void
|
||||
AutoRoute(page: VoidRoute.page),
|
||||
AutoRoute(page: VoidSuccessRoute.page),
|
||||
];
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
// coverage:ignore-file
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:apskel_pos_flutter_v2/domain/order/order.dart' as _i19;
|
||||
import 'package:apskel_pos_flutter_v2/domain/order/order.dart' as _i20;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/auth/login/login_page.dart'
|
||||
as _i4;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/checkout/checkout_page.dart'
|
||||
@ -40,84 +40,86 @@ import 'package:apskel_pos_flutter_v2/presentation/pages/splash/splash_page.dart
|
||||
as _i11;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/sync/sync_page.dart'
|
||||
as _i14;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/void/pages/void_success/void_success_page.dart'
|
||||
as _i17;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/void/void_page.dart'
|
||||
as _i16;
|
||||
import 'package:auto_route/auto_route.dart' as _i17;
|
||||
import 'package:flutter/material.dart' as _i18;
|
||||
import 'package:auto_route/auto_route.dart' as _i18;
|
||||
import 'package:flutter/material.dart' as _i19;
|
||||
|
||||
/// generated route for
|
||||
/// [_i1.CheckoutPage]
|
||||
class CheckoutRoute extends _i17.PageRouteInfo<void> {
|
||||
const CheckoutRoute({List<_i17.PageRouteInfo>? children})
|
||||
class CheckoutRoute extends _i18.PageRouteInfo<void> {
|
||||
const CheckoutRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(CheckoutRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'CheckoutRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i17.WrappedRoute(child: const _i1.CheckoutPage());
|
||||
return _i18.WrappedRoute(child: const _i1.CheckoutPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i2.CustomerPage]
|
||||
class CustomerRoute extends _i17.PageRouteInfo<void> {
|
||||
const CustomerRoute({List<_i17.PageRouteInfo>? children})
|
||||
class CustomerRoute extends _i18.PageRouteInfo<void> {
|
||||
const CustomerRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(CustomerRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'CustomerRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i17.WrappedRoute(child: const _i2.CustomerPage());
|
||||
return _i18.WrappedRoute(child: const _i2.CustomerPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i3.HomePage]
|
||||
class HomeRoute extends _i17.PageRouteInfo<void> {
|
||||
const HomeRoute({List<_i17.PageRouteInfo>? children})
|
||||
class HomeRoute extends _i18.PageRouteInfo<void> {
|
||||
const HomeRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(HomeRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'HomeRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i17.WrappedRoute(child: const _i3.HomePage());
|
||||
return _i18.WrappedRoute(child: const _i3.HomePage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i4.LoginPage]
|
||||
class LoginRoute extends _i17.PageRouteInfo<void> {
|
||||
const LoginRoute({List<_i17.PageRouteInfo>? children})
|
||||
class LoginRoute extends _i18.PageRouteInfo<void> {
|
||||
const LoginRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(LoginRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'LoginRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i17.WrappedRoute(child: const _i4.LoginPage());
|
||||
return _i18.WrappedRoute(child: const _i4.LoginPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i5.MainPage]
|
||||
class MainRoute extends _i17.PageRouteInfo<void> {
|
||||
const MainRoute({List<_i17.PageRouteInfo>? children})
|
||||
class MainRoute extends _i18.PageRouteInfo<void> {
|
||||
const MainRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(MainRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'MainRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i5.MainPage();
|
||||
@ -127,11 +129,11 @@ class MainRoute extends _i17.PageRouteInfo<void> {
|
||||
|
||||
/// generated route for
|
||||
/// [_i6.OrderPage]
|
||||
class OrderRoute extends _i17.PageRouteInfo<OrderRouteArgs> {
|
||||
class OrderRoute extends _i18.PageRouteInfo<OrderRouteArgs> {
|
||||
OrderRoute({
|
||||
_i18.Key? key,
|
||||
_i19.Key? key,
|
||||
required String status,
|
||||
List<_i17.PageRouteInfo>? children,
|
||||
List<_i18.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
OrderRoute.name,
|
||||
args: OrderRouteArgs(key: key, status: status),
|
||||
@ -140,11 +142,11 @@ class OrderRoute extends _i17.PageRouteInfo<OrderRouteArgs> {
|
||||
|
||||
static const String name = 'OrderRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<OrderRouteArgs>();
|
||||
return _i17.WrappedRoute(
|
||||
return _i18.WrappedRoute(
|
||||
child: _i6.OrderPage(key: args.key, status: args.status),
|
||||
);
|
||||
},
|
||||
@ -154,7 +156,7 @@ class OrderRoute extends _i17.PageRouteInfo<OrderRouteArgs> {
|
||||
class OrderRouteArgs {
|
||||
const OrderRouteArgs({this.key, required this.status});
|
||||
|
||||
final _i18.Key? key;
|
||||
final _i19.Key? key;
|
||||
|
||||
final String status;
|
||||
|
||||
@ -166,11 +168,11 @@ class OrderRouteArgs {
|
||||
|
||||
/// generated route for
|
||||
/// [_i7.PaymentPage]
|
||||
class PaymentRoute extends _i17.PageRouteInfo<PaymentRouteArgs> {
|
||||
class PaymentRoute extends _i18.PageRouteInfo<PaymentRouteArgs> {
|
||||
PaymentRoute({
|
||||
_i18.Key? key,
|
||||
required _i19.Order order,
|
||||
List<_i17.PageRouteInfo>? children,
|
||||
_i19.Key? key,
|
||||
required _i20.Order order,
|
||||
List<_i18.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
PaymentRoute.name,
|
||||
args: PaymentRouteArgs(key: key, order: order),
|
||||
@ -179,11 +181,11 @@ class PaymentRoute extends _i17.PageRouteInfo<PaymentRouteArgs> {
|
||||
|
||||
static const String name = 'PaymentRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<PaymentRouteArgs>();
|
||||
return _i17.WrappedRoute(
|
||||
return _i18.WrappedRoute(
|
||||
child: _i7.PaymentPage(key: args.key, order: args.order),
|
||||
);
|
||||
},
|
||||
@ -193,9 +195,9 @@ class PaymentRoute extends _i17.PageRouteInfo<PaymentRouteArgs> {
|
||||
class PaymentRouteArgs {
|
||||
const PaymentRouteArgs({this.key, required this.order});
|
||||
|
||||
final _i18.Key? key;
|
||||
final _i19.Key? key;
|
||||
|
||||
final _i19.Order order;
|
||||
final _i20.Order order;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@ -205,11 +207,11 @@ class PaymentRouteArgs {
|
||||
|
||||
/// generated route for
|
||||
/// [_i8.PaymentSuccessPage]
|
||||
class PaymentSuccessRoute extends _i17.PageRouteInfo<PaymentSuccessRouteArgs> {
|
||||
class PaymentSuccessRoute extends _i18.PageRouteInfo<PaymentSuccessRouteArgs> {
|
||||
PaymentSuccessRoute({
|
||||
_i18.Key? key,
|
||||
_i19.Key? key,
|
||||
required String orderId,
|
||||
List<_i17.PageRouteInfo>? children,
|
||||
List<_i18.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
PaymentSuccessRoute.name,
|
||||
args: PaymentSuccessRouteArgs(key: key, orderId: orderId),
|
||||
@ -218,11 +220,11 @@ class PaymentSuccessRoute extends _i17.PageRouteInfo<PaymentSuccessRouteArgs> {
|
||||
|
||||
static const String name = 'PaymentSuccessRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<PaymentSuccessRouteArgs>();
|
||||
return _i17.WrappedRoute(
|
||||
return _i18.WrappedRoute(
|
||||
child: _i8.PaymentSuccessPage(key: args.key, orderId: args.orderId),
|
||||
);
|
||||
},
|
||||
@ -232,7 +234,7 @@ class PaymentSuccessRoute extends _i17.PageRouteInfo<PaymentSuccessRouteArgs> {
|
||||
class PaymentSuccessRouteArgs {
|
||||
const PaymentSuccessRouteArgs({this.key, required this.orderId});
|
||||
|
||||
final _i18.Key? key;
|
||||
final _i19.Key? key;
|
||||
|
||||
final String orderId;
|
||||
|
||||
@ -244,13 +246,13 @@ class PaymentSuccessRouteArgs {
|
||||
|
||||
/// generated route for
|
||||
/// [_i9.ReportPage]
|
||||
class ReportRoute extends _i17.PageRouteInfo<void> {
|
||||
const ReportRoute({List<_i17.PageRouteInfo>? children})
|
||||
class ReportRoute extends _i18.PageRouteInfo<void> {
|
||||
const ReportRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(ReportRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'ReportRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i9.ReportPage();
|
||||
@ -260,13 +262,13 @@ class ReportRoute extends _i17.PageRouteInfo<void> {
|
||||
|
||||
/// generated route for
|
||||
/// [_i10.SettingPage]
|
||||
class SettingRoute extends _i17.PageRouteInfo<void> {
|
||||
const SettingRoute({List<_i17.PageRouteInfo>? children})
|
||||
class SettingRoute extends _i18.PageRouteInfo<void> {
|
||||
const SettingRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(SettingRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'SettingRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i10.SettingPage();
|
||||
@ -276,13 +278,13 @@ class SettingRoute extends _i17.PageRouteInfo<void> {
|
||||
|
||||
/// generated route for
|
||||
/// [_i11.SplashPage]
|
||||
class SplashRoute extends _i17.PageRouteInfo<void> {
|
||||
const SplashRoute({List<_i17.PageRouteInfo>? children})
|
||||
class SplashRoute extends _i18.PageRouteInfo<void> {
|
||||
const SplashRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(SplashRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'SplashRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i11.SplashPage();
|
||||
@ -292,13 +294,13 @@ class SplashRoute extends _i17.PageRouteInfo<void> {
|
||||
|
||||
/// generated route for
|
||||
/// [_i12.SuccessAddItemOrderPage]
|
||||
class SuccessAddItemOrderRoute extends _i17.PageRouteInfo<void> {
|
||||
const SuccessAddItemOrderRoute({List<_i17.PageRouteInfo>? children})
|
||||
class SuccessAddItemOrderRoute extends _i18.PageRouteInfo<void> {
|
||||
const SuccessAddItemOrderRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(SuccessAddItemOrderRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'SuccessAddItemOrderRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i12.SuccessAddItemOrderPage();
|
||||
@ -308,11 +310,11 @@ class SuccessAddItemOrderRoute extends _i17.PageRouteInfo<void> {
|
||||
|
||||
/// generated route for
|
||||
/// [_i13.SuccessOrderPage]
|
||||
class SuccessOrderRoute extends _i17.PageRouteInfo<SuccessOrderRouteArgs> {
|
||||
class SuccessOrderRoute extends _i18.PageRouteInfo<SuccessOrderRouteArgs> {
|
||||
SuccessOrderRoute({
|
||||
_i18.Key? key,
|
||||
required _i19.Order order,
|
||||
List<_i17.PageRouteInfo>? children,
|
||||
_i19.Key? key,
|
||||
required _i20.Order order,
|
||||
List<_i18.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
SuccessOrderRoute.name,
|
||||
args: SuccessOrderRouteArgs(key: key, order: order),
|
||||
@ -321,11 +323,11 @@ class SuccessOrderRoute extends _i17.PageRouteInfo<SuccessOrderRouteArgs> {
|
||||
|
||||
static const String name = 'SuccessOrderRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<SuccessOrderRouteArgs>();
|
||||
return _i17.WrappedRoute(
|
||||
return _i18.WrappedRoute(
|
||||
child: _i13.SuccessOrderPage(key: args.key, order: args.order),
|
||||
);
|
||||
},
|
||||
@ -335,9 +337,9 @@ class SuccessOrderRoute extends _i17.PageRouteInfo<SuccessOrderRouteArgs> {
|
||||
class SuccessOrderRouteArgs {
|
||||
const SuccessOrderRouteArgs({this.key, required this.order});
|
||||
|
||||
final _i18.Key? key;
|
||||
final _i19.Key? key;
|
||||
|
||||
final _i19.Order order;
|
||||
final _i20.Order order;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@ -347,43 +349,43 @@ class SuccessOrderRouteArgs {
|
||||
|
||||
/// generated route for
|
||||
/// [_i14.SyncPage]
|
||||
class SyncRoute extends _i17.PageRouteInfo<void> {
|
||||
const SyncRoute({List<_i17.PageRouteInfo>? children})
|
||||
class SyncRoute extends _i18.PageRouteInfo<void> {
|
||||
const SyncRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(SyncRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'SyncRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i17.WrappedRoute(child: const _i14.SyncPage());
|
||||
return _i18.WrappedRoute(child: const _i14.SyncPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i15.TablePage]
|
||||
class TableRoute extends _i17.PageRouteInfo<void> {
|
||||
const TableRoute({List<_i17.PageRouteInfo>? children})
|
||||
class TableRoute extends _i18.PageRouteInfo<void> {
|
||||
const TableRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(TableRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'TableRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i17.WrappedRoute(child: const _i15.TablePage());
|
||||
return _i18.WrappedRoute(child: const _i15.TablePage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i16.VoidPage]
|
||||
class VoidRoute extends _i17.PageRouteInfo<VoidRouteArgs> {
|
||||
class VoidRoute extends _i18.PageRouteInfo<VoidRouteArgs> {
|
||||
VoidRoute({
|
||||
_i18.Key? key,
|
||||
required _i19.Order order,
|
||||
List<_i17.PageRouteInfo>? children,
|
||||
_i19.Key? key,
|
||||
required _i20.Order order,
|
||||
List<_i18.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
VoidRoute.name,
|
||||
args: VoidRouteArgs(key: key, order: order),
|
||||
@ -392,11 +394,11 @@ class VoidRoute extends _i17.PageRouteInfo<VoidRouteArgs> {
|
||||
|
||||
static const String name = 'VoidRoute';
|
||||
|
||||
static _i17.PageInfo page = _i17.PageInfo(
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<VoidRouteArgs>();
|
||||
return _i17.WrappedRoute(
|
||||
return _i18.WrappedRoute(
|
||||
child: _i16.VoidPage(key: args.key, order: args.order),
|
||||
);
|
||||
},
|
||||
@ -406,12 +408,28 @@ class VoidRoute extends _i17.PageRouteInfo<VoidRouteArgs> {
|
||||
class VoidRouteArgs {
|
||||
const VoidRouteArgs({this.key, required this.order});
|
||||
|
||||
final _i18.Key? key;
|
||||
final _i19.Key? key;
|
||||
|
||||
final _i19.Order order;
|
||||
final _i20.Order order;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'VoidRouteArgs{key: $key, order: $order}';
|
||||
}
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i17.VoidSuccessPage]
|
||||
class VoidSuccessRoute extends _i18.PageRouteInfo<void> {
|
||||
const VoidSuccessRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(VoidSuccessRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'VoidSuccessRoute';
|
||||
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i17.VoidSuccessPage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user