feat: delivery type
This commit is contained in:
@@ -307,16 +307,19 @@ class _HomePageState extends State<HomePage> {
|
||||
orElse: () => const Center(
|
||||
child: Text('No Items'),
|
||||
),
|
||||
loaded: (products,
|
||||
discountModel,
|
||||
discount,
|
||||
discountAmount,
|
||||
tax,
|
||||
serviceCharge,
|
||||
totalQuantity,
|
||||
totalPrice,
|
||||
draftName,
|
||||
orderType) {
|
||||
loaded: (
|
||||
products,
|
||||
discountModel,
|
||||
discount,
|
||||
discountAmount,
|
||||
tax,
|
||||
serviceCharge,
|
||||
totalQuantity,
|
||||
totalPrice,
|
||||
draftName,
|
||||
orderType,
|
||||
deliveryType,
|
||||
) {
|
||||
if (products.isEmpty) {
|
||||
return const Center(
|
||||
child: Text('No Items'),
|
||||
@@ -358,16 +361,19 @@ class _HomePageState extends State<HomePage> {
|
||||
builder: (context, state) {
|
||||
final tax = state.maybeWhen(
|
||||
orElse: () => 0,
|
||||
loaded: (products,
|
||||
discountModel,
|
||||
discount,
|
||||
discountAmount,
|
||||
tax,
|
||||
serviceCharge,
|
||||
totalQuantity,
|
||||
totalPrice,
|
||||
draftName,
|
||||
orderType) {
|
||||
loaded: (
|
||||
products,
|
||||
discountModel,
|
||||
discount,
|
||||
discountAmount,
|
||||
tax,
|
||||
serviceCharge,
|
||||
totalQuantity,
|
||||
totalPrice,
|
||||
draftName,
|
||||
orderType,
|
||||
deliveryType,
|
||||
) {
|
||||
if (products.isEmpty) {
|
||||
return 0;
|
||||
}
|
||||
@@ -409,7 +415,8 @@ class _HomePageState extends State<HomePage> {
|
||||
totalQuantity,
|
||||
totalPrice,
|
||||
draftName,
|
||||
orderType) {
|
||||
orderType,
|
||||
deliveryType) {
|
||||
if (products.isEmpty) {
|
||||
return 0;
|
||||
}
|
||||
@@ -462,7 +469,8 @@ class _HomePageState extends State<HomePage> {
|
||||
totalQuantity,
|
||||
totalPrice,
|
||||
draftName,
|
||||
orderType) =>
|
||||
orderType,
|
||||
deliveryType) =>
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Button.filled(
|
||||
@@ -476,6 +484,14 @@ class _HomePageState extends State<HomePage> {
|
||||
'Mohon pilih meja terlebih dahulu');
|
||||
return;
|
||||
}
|
||||
|
||||
if (orderType.name == 'delivery' &&
|
||||
deliveryType == null) {
|
||||
AppFlushbar.showError(context,
|
||||
'Mohon pilih pengiriman terlebih dahulu');
|
||||
return;
|
||||
}
|
||||
|
||||
context.push(ConfirmPaymentPage(
|
||||
isTable: widget.table == null
|
||||
? false
|
||||
|
||||
Reference in New Issue
Block a user