Compare commits
2 Commits
8fec9c8cd0
...
e8fd683077
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8fd683077 | ||
|
|
08bbfc393b |
@ -7,6 +7,7 @@ import 'package:injectable/injectable.dart';
|
|||||||
import '../../../common/types/order_type.dart';
|
import '../../../common/types/order_type.dart';
|
||||||
import '../../../domain/delivery/delivery.dart';
|
import '../../../domain/delivery/delivery.dart';
|
||||||
import '../../../domain/product/product.dart';
|
import '../../../domain/product/product.dart';
|
||||||
|
import '../../../domain/table/table.dart';
|
||||||
|
|
||||||
part 'checkout_form_event.dart';
|
part 'checkout_form_event.dart';
|
||||||
part 'checkout_form_state.dart';
|
part 'checkout_form_state.dart';
|
||||||
@ -169,6 +170,12 @@ class CheckoutFormBloc extends Bloc<CheckoutFormEvent, CheckoutFormState> {
|
|||||||
updateOrderType: (e) async {
|
updateOrderType: (e) async {
|
||||||
emit(state.copyWith(orderType: e.orderType));
|
emit(state.copyWith(orderType: e.orderType));
|
||||||
},
|
},
|
||||||
|
updateDelivery: (e) async {
|
||||||
|
emit(state.copyWith(delivery: e.delivery));
|
||||||
|
},
|
||||||
|
updateTable: (e) async {
|
||||||
|
emit(state.copyWith(table: e.table));
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,8 @@ mixin _$CheckoutFormEvent {
|
|||||||
removeItem,
|
removeItem,
|
||||||
required TResult Function(Product product, String notes) updateItemNotes,
|
required TResult Function(Product product, String notes) updateItemNotes,
|
||||||
required TResult Function(OrderType orderType) updateOrderType,
|
required TResult Function(OrderType orderType) updateOrderType,
|
||||||
|
required TResult Function(Delivery delivery) updateDelivery,
|
||||||
|
required TResult Function(Table? table) updateTable,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
@ -33,6 +35,8 @@ mixin _$CheckoutFormEvent {
|
|||||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product, String notes)? updateItemNotes,
|
TResult? Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult? Function(OrderType orderType)? updateOrderType,
|
TResult? Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult? Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult? Function(Table? table)? updateTable,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
@ -41,6 +45,8 @@ mixin _$CheckoutFormEvent {
|
|||||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product, String notes)? updateItemNotes,
|
TResult Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult Function(OrderType orderType)? updateOrderType,
|
TResult Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult Function(Table? table)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -50,6 +56,8 @@ mixin _$CheckoutFormEvent {
|
|||||||
required TResult Function(_RemoveItem value) removeItem,
|
required TResult Function(_RemoveItem value) removeItem,
|
||||||
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
||||||
required TResult Function(_UpdateOrderType value) updateOrderType,
|
required TResult Function(_UpdateOrderType value) updateOrderType,
|
||||||
|
required TResult Function(_UpdateDelivery value) updateDelivery,
|
||||||
|
required TResult Function(_UpdateTable value) updateTable,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? mapOrNull<TResult extends Object?>({
|
TResult? mapOrNull<TResult extends Object?>({
|
||||||
@ -58,6 +66,8 @@ mixin _$CheckoutFormEvent {
|
|||||||
TResult? Function(_RemoveItem value)? removeItem,
|
TResult? Function(_RemoveItem value)? removeItem,
|
||||||
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult? Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult? Function(_UpdateTable value)? updateTable,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeMap<TResult extends Object?>({
|
TResult maybeMap<TResult extends Object?>({
|
||||||
@ -66,6 +76,8 @@ mixin _$CheckoutFormEvent {
|
|||||||
TResult Function(_RemoveItem value)? removeItem,
|
TResult Function(_RemoveItem value)? removeItem,
|
||||||
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult Function(_UpdateOrderType value)? updateOrderType,
|
TResult Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult Function(_UpdateTable value)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
}
|
}
|
||||||
@ -174,6 +186,8 @@ class _$StartedImpl implements _Started {
|
|||||||
removeItem,
|
removeItem,
|
||||||
required TResult Function(Product product, String notes) updateItemNotes,
|
required TResult Function(Product product, String notes) updateItemNotes,
|
||||||
required TResult Function(OrderType orderType) updateOrderType,
|
required TResult Function(OrderType orderType) updateOrderType,
|
||||||
|
required TResult Function(Delivery delivery) updateDelivery,
|
||||||
|
required TResult Function(Table? table) updateTable,
|
||||||
}) {
|
}) {
|
||||||
return started(items);
|
return started(items);
|
||||||
}
|
}
|
||||||
@ -186,6 +200,8 @@ class _$StartedImpl implements _Started {
|
|||||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product, String notes)? updateItemNotes,
|
TResult? Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult? Function(OrderType orderType)? updateOrderType,
|
TResult? Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult? Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult? Function(Table? table)? updateTable,
|
||||||
}) {
|
}) {
|
||||||
return started?.call(items);
|
return started?.call(items);
|
||||||
}
|
}
|
||||||
@ -198,6 +214,8 @@ class _$StartedImpl implements _Started {
|
|||||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product, String notes)? updateItemNotes,
|
TResult Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult Function(OrderType orderType)? updateOrderType,
|
TResult Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult Function(Table? table)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (started != null) {
|
if (started != null) {
|
||||||
@ -214,6 +232,8 @@ class _$StartedImpl implements _Started {
|
|||||||
required TResult Function(_RemoveItem value) removeItem,
|
required TResult Function(_RemoveItem value) removeItem,
|
||||||
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
||||||
required TResult Function(_UpdateOrderType value) updateOrderType,
|
required TResult Function(_UpdateOrderType value) updateOrderType,
|
||||||
|
required TResult Function(_UpdateDelivery value) updateDelivery,
|
||||||
|
required TResult Function(_UpdateTable value) updateTable,
|
||||||
}) {
|
}) {
|
||||||
return started(this);
|
return started(this);
|
||||||
}
|
}
|
||||||
@ -226,6 +246,8 @@ class _$StartedImpl implements _Started {
|
|||||||
TResult? Function(_RemoveItem value)? removeItem,
|
TResult? Function(_RemoveItem value)? removeItem,
|
||||||
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult? Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult? Function(_UpdateTable value)? updateTable,
|
||||||
}) {
|
}) {
|
||||||
return started?.call(this);
|
return started?.call(this);
|
||||||
}
|
}
|
||||||
@ -238,6 +260,8 @@ class _$StartedImpl implements _Started {
|
|||||||
TResult Function(_RemoveItem value)? removeItem,
|
TResult Function(_RemoveItem value)? removeItem,
|
||||||
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult Function(_UpdateOrderType value)? updateOrderType,
|
TResult Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult Function(_UpdateTable value)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (started != null) {
|
if (started != null) {
|
||||||
@ -369,6 +393,8 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
removeItem,
|
removeItem,
|
||||||
required TResult Function(Product product, String notes) updateItemNotes,
|
required TResult Function(Product product, String notes) updateItemNotes,
|
||||||
required TResult Function(OrderType orderType) updateOrderType,
|
required TResult Function(OrderType orderType) updateOrderType,
|
||||||
|
required TResult Function(Delivery delivery) updateDelivery,
|
||||||
|
required TResult Function(Table? table) updateTable,
|
||||||
}) {
|
}) {
|
||||||
return addItem(product, variant);
|
return addItem(product, variant);
|
||||||
}
|
}
|
||||||
@ -381,6 +407,8 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product, String notes)? updateItemNotes,
|
TResult? Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult? Function(OrderType orderType)? updateOrderType,
|
TResult? Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult? Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult? Function(Table? table)? updateTable,
|
||||||
}) {
|
}) {
|
||||||
return addItem?.call(product, variant);
|
return addItem?.call(product, variant);
|
||||||
}
|
}
|
||||||
@ -393,6 +421,8 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product, String notes)? updateItemNotes,
|
TResult Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult Function(OrderType orderType)? updateOrderType,
|
TResult Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult Function(Table? table)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (addItem != null) {
|
if (addItem != null) {
|
||||||
@ -409,6 +439,8 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
required TResult Function(_RemoveItem value) removeItem,
|
required TResult Function(_RemoveItem value) removeItem,
|
||||||
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
||||||
required TResult Function(_UpdateOrderType value) updateOrderType,
|
required TResult Function(_UpdateOrderType value) updateOrderType,
|
||||||
|
required TResult Function(_UpdateDelivery value) updateDelivery,
|
||||||
|
required TResult Function(_UpdateTable value) updateTable,
|
||||||
}) {
|
}) {
|
||||||
return addItem(this);
|
return addItem(this);
|
||||||
}
|
}
|
||||||
@ -421,6 +453,8 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
TResult? Function(_RemoveItem value)? removeItem,
|
TResult? Function(_RemoveItem value)? removeItem,
|
||||||
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult? Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult? Function(_UpdateTable value)? updateTable,
|
||||||
}) {
|
}) {
|
||||||
return addItem?.call(this);
|
return addItem?.call(this);
|
||||||
}
|
}
|
||||||
@ -433,6 +467,8 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
TResult Function(_RemoveItem value)? removeItem,
|
TResult Function(_RemoveItem value)? removeItem,
|
||||||
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult Function(_UpdateOrderType value)? updateOrderType,
|
TResult Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult Function(_UpdateTable value)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (addItem != null) {
|
if (addItem != null) {
|
||||||
@ -566,6 +602,8 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
removeItem,
|
removeItem,
|
||||||
required TResult Function(Product product, String notes) updateItemNotes,
|
required TResult Function(Product product, String notes) updateItemNotes,
|
||||||
required TResult Function(OrderType orderType) updateOrderType,
|
required TResult Function(OrderType orderType) updateOrderType,
|
||||||
|
required TResult Function(Delivery delivery) updateDelivery,
|
||||||
|
required TResult Function(Table? table) updateTable,
|
||||||
}) {
|
}) {
|
||||||
return removeItem(product, variant);
|
return removeItem(product, variant);
|
||||||
}
|
}
|
||||||
@ -578,6 +616,8 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product, String notes)? updateItemNotes,
|
TResult? Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult? Function(OrderType orderType)? updateOrderType,
|
TResult? Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult? Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult? Function(Table? table)? updateTable,
|
||||||
}) {
|
}) {
|
||||||
return removeItem?.call(product, variant);
|
return removeItem?.call(product, variant);
|
||||||
}
|
}
|
||||||
@ -590,6 +630,8 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product, String notes)? updateItemNotes,
|
TResult Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult Function(OrderType orderType)? updateOrderType,
|
TResult Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult Function(Table? table)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (removeItem != null) {
|
if (removeItem != null) {
|
||||||
@ -606,6 +648,8 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
required TResult Function(_RemoveItem value) removeItem,
|
required TResult Function(_RemoveItem value) removeItem,
|
||||||
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
||||||
required TResult Function(_UpdateOrderType value) updateOrderType,
|
required TResult Function(_UpdateOrderType value) updateOrderType,
|
||||||
|
required TResult Function(_UpdateDelivery value) updateDelivery,
|
||||||
|
required TResult Function(_UpdateTable value) updateTable,
|
||||||
}) {
|
}) {
|
||||||
return removeItem(this);
|
return removeItem(this);
|
||||||
}
|
}
|
||||||
@ -618,6 +662,8 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
TResult? Function(_RemoveItem value)? removeItem,
|
TResult? Function(_RemoveItem value)? removeItem,
|
||||||
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult? Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult? Function(_UpdateTable value)? updateTable,
|
||||||
}) {
|
}) {
|
||||||
return removeItem?.call(this);
|
return removeItem?.call(this);
|
||||||
}
|
}
|
||||||
@ -630,6 +676,8 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
TResult Function(_RemoveItem value)? removeItem,
|
TResult Function(_RemoveItem value)? removeItem,
|
||||||
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult Function(_UpdateOrderType value)? updateOrderType,
|
TResult Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult Function(_UpdateTable value)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (removeItem != null) {
|
if (removeItem != null) {
|
||||||
@ -753,6 +801,8 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
|||||||
removeItem,
|
removeItem,
|
||||||
required TResult Function(Product product, String notes) updateItemNotes,
|
required TResult Function(Product product, String notes) updateItemNotes,
|
||||||
required TResult Function(OrderType orderType) updateOrderType,
|
required TResult Function(OrderType orderType) updateOrderType,
|
||||||
|
required TResult Function(Delivery delivery) updateDelivery,
|
||||||
|
required TResult Function(Table? table) updateTable,
|
||||||
}) {
|
}) {
|
||||||
return updateItemNotes(product, notes);
|
return updateItemNotes(product, notes);
|
||||||
}
|
}
|
||||||
@ -765,6 +815,8 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
|||||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product, String notes)? updateItemNotes,
|
TResult? Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult? Function(OrderType orderType)? updateOrderType,
|
TResult? Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult? Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult? Function(Table? table)? updateTable,
|
||||||
}) {
|
}) {
|
||||||
return updateItemNotes?.call(product, notes);
|
return updateItemNotes?.call(product, notes);
|
||||||
}
|
}
|
||||||
@ -777,6 +829,8 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
|||||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product, String notes)? updateItemNotes,
|
TResult Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult Function(OrderType orderType)? updateOrderType,
|
TResult Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult Function(Table? table)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (updateItemNotes != null) {
|
if (updateItemNotes != null) {
|
||||||
@ -793,6 +847,8 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
|||||||
required TResult Function(_RemoveItem value) removeItem,
|
required TResult Function(_RemoveItem value) removeItem,
|
||||||
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
||||||
required TResult Function(_UpdateOrderType value) updateOrderType,
|
required TResult Function(_UpdateOrderType value) updateOrderType,
|
||||||
|
required TResult Function(_UpdateDelivery value) updateDelivery,
|
||||||
|
required TResult Function(_UpdateTable value) updateTable,
|
||||||
}) {
|
}) {
|
||||||
return updateItemNotes(this);
|
return updateItemNotes(this);
|
||||||
}
|
}
|
||||||
@ -805,6 +861,8 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
|||||||
TResult? Function(_RemoveItem value)? removeItem,
|
TResult? Function(_RemoveItem value)? removeItem,
|
||||||
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult? Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult? Function(_UpdateTable value)? updateTable,
|
||||||
}) {
|
}) {
|
||||||
return updateItemNotes?.call(this);
|
return updateItemNotes?.call(this);
|
||||||
}
|
}
|
||||||
@ -817,6 +875,8 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
|||||||
TResult Function(_RemoveItem value)? removeItem,
|
TResult Function(_RemoveItem value)? removeItem,
|
||||||
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult Function(_UpdateOrderType value)? updateOrderType,
|
TResult Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult Function(_UpdateTable value)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (updateItemNotes != null) {
|
if (updateItemNotes != null) {
|
||||||
@ -920,6 +980,8 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
|||||||
removeItem,
|
removeItem,
|
||||||
required TResult Function(Product product, String notes) updateItemNotes,
|
required TResult Function(Product product, String notes) updateItemNotes,
|
||||||
required TResult Function(OrderType orderType) updateOrderType,
|
required TResult Function(OrderType orderType) updateOrderType,
|
||||||
|
required TResult Function(Delivery delivery) updateDelivery,
|
||||||
|
required TResult Function(Table? table) updateTable,
|
||||||
}) {
|
}) {
|
||||||
return updateOrderType(orderType);
|
return updateOrderType(orderType);
|
||||||
}
|
}
|
||||||
@ -932,6 +994,8 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
|||||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product, String notes)? updateItemNotes,
|
TResult? Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult? Function(OrderType orderType)? updateOrderType,
|
TResult? Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult? Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult? Function(Table? table)? updateTable,
|
||||||
}) {
|
}) {
|
||||||
return updateOrderType?.call(orderType);
|
return updateOrderType?.call(orderType);
|
||||||
}
|
}
|
||||||
@ -944,6 +1008,8 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
|||||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product, String notes)? updateItemNotes,
|
TResult Function(Product product, String notes)? updateItemNotes,
|
||||||
TResult Function(OrderType orderType)? updateOrderType,
|
TResult Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult Function(Table? table)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (updateOrderType != null) {
|
if (updateOrderType != null) {
|
||||||
@ -960,6 +1026,8 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
|||||||
required TResult Function(_RemoveItem value) removeItem,
|
required TResult Function(_RemoveItem value) removeItem,
|
||||||
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
||||||
required TResult Function(_UpdateOrderType value) updateOrderType,
|
required TResult Function(_UpdateOrderType value) updateOrderType,
|
||||||
|
required TResult Function(_UpdateDelivery value) updateDelivery,
|
||||||
|
required TResult Function(_UpdateTable value) updateTable,
|
||||||
}) {
|
}) {
|
||||||
return updateOrderType(this);
|
return updateOrderType(this);
|
||||||
}
|
}
|
||||||
@ -972,6 +1040,8 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
|||||||
TResult? Function(_RemoveItem value)? removeItem,
|
TResult? Function(_RemoveItem value)? removeItem,
|
||||||
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult? Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult? Function(_UpdateTable value)? updateTable,
|
||||||
}) {
|
}) {
|
||||||
return updateOrderType?.call(this);
|
return updateOrderType?.call(this);
|
||||||
}
|
}
|
||||||
@ -984,6 +1054,8 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
|||||||
TResult Function(_RemoveItem value)? removeItem,
|
TResult Function(_RemoveItem value)? removeItem,
|
||||||
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
TResult Function(_UpdateOrderType value)? updateOrderType,
|
TResult Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult Function(_UpdateTable value)? updateTable,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (updateOrderType != null) {
|
if (updateOrderType != null) {
|
||||||
@ -1006,6 +1078,372 @@ abstract class _UpdateOrderType implements CheckoutFormEvent {
|
|||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class _$$UpdateDeliveryImplCopyWith<$Res> {
|
||||||
|
factory _$$UpdateDeliveryImplCopyWith(
|
||||||
|
_$UpdateDeliveryImpl value,
|
||||||
|
$Res Function(_$UpdateDeliveryImpl) then,
|
||||||
|
) = __$$UpdateDeliveryImplCopyWithImpl<$Res>;
|
||||||
|
@useResult
|
||||||
|
$Res call({Delivery delivery});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class __$$UpdateDeliveryImplCopyWithImpl<$Res>
|
||||||
|
extends _$CheckoutFormEventCopyWithImpl<$Res, _$UpdateDeliveryImpl>
|
||||||
|
implements _$$UpdateDeliveryImplCopyWith<$Res> {
|
||||||
|
__$$UpdateDeliveryImplCopyWithImpl(
|
||||||
|
_$UpdateDeliveryImpl _value,
|
||||||
|
$Res Function(_$UpdateDeliveryImpl) _then,
|
||||||
|
) : super(_value, _then);
|
||||||
|
|
||||||
|
/// Create a copy of CheckoutFormEvent
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
@override
|
||||||
|
$Res call({Object? delivery = null}) {
|
||||||
|
return _then(
|
||||||
|
_$UpdateDeliveryImpl(
|
||||||
|
null == delivery
|
||||||
|
? _value.delivery
|
||||||
|
: delivery // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Delivery,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
|
||||||
|
class _$UpdateDeliveryImpl implements _UpdateDelivery {
|
||||||
|
const _$UpdateDeliveryImpl(this.delivery);
|
||||||
|
|
||||||
|
@override
|
||||||
|
final Delivery delivery;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'CheckoutFormEvent.updateDelivery(delivery: $delivery)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) ||
|
||||||
|
(other.runtimeType == runtimeType &&
|
||||||
|
other is _$UpdateDeliveryImpl &&
|
||||||
|
(identical(other.delivery, delivery) ||
|
||||||
|
other.delivery == delivery));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType, delivery);
|
||||||
|
|
||||||
|
/// Create a copy of CheckoutFormEvent
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$$UpdateDeliveryImplCopyWith<_$UpdateDeliveryImpl> get copyWith =>
|
||||||
|
__$$UpdateDeliveryImplCopyWithImpl<_$UpdateDeliveryImpl>(
|
||||||
|
this,
|
||||||
|
_$identity,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult when<TResult extends Object?>({
|
||||||
|
required TResult Function(List<ProductQuantity> items) started,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
removeItem,
|
||||||
|
required TResult Function(Product product, String notes) updateItemNotes,
|
||||||
|
required TResult Function(OrderType orderType) updateOrderType,
|
||||||
|
required TResult Function(Delivery delivery) updateDelivery,
|
||||||
|
required TResult Function(Table? table) updateTable,
|
||||||
|
}) {
|
||||||
|
return updateDelivery(delivery);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
|
TResult? Function(List<ProductQuantity> items)? started,
|
||||||
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
|
TResult? Function(Product product, String notes)? updateItemNotes,
|
||||||
|
TResult? Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult? Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult? Function(Table? table)? updateTable,
|
||||||
|
}) {
|
||||||
|
return updateDelivery?.call(delivery);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
|
TResult Function(List<ProductQuantity> items)? started,
|
||||||
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
|
TResult Function(Product product, String notes)? updateItemNotes,
|
||||||
|
TResult Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult Function(Table? table)? updateTable,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (updateDelivery != null) {
|
||||||
|
return updateDelivery(delivery);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult map<TResult extends Object?>({
|
||||||
|
required TResult Function(_Started value) started,
|
||||||
|
required TResult Function(_AddItem value) addItem,
|
||||||
|
required TResult Function(_RemoveItem value) removeItem,
|
||||||
|
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
||||||
|
required TResult Function(_UpdateOrderType value) updateOrderType,
|
||||||
|
required TResult Function(_UpdateDelivery value) updateDelivery,
|
||||||
|
required TResult Function(_UpdateTable value) updateTable,
|
||||||
|
}) {
|
||||||
|
return updateDelivery(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? mapOrNull<TResult extends Object?>({
|
||||||
|
TResult? Function(_Started value)? started,
|
||||||
|
TResult? Function(_AddItem value)? addItem,
|
||||||
|
TResult? Function(_RemoveItem value)? removeItem,
|
||||||
|
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
|
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult? Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult? Function(_UpdateTable value)? updateTable,
|
||||||
|
}) {
|
||||||
|
return updateDelivery?.call(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeMap<TResult extends Object?>({
|
||||||
|
TResult Function(_Started value)? started,
|
||||||
|
TResult Function(_AddItem value)? addItem,
|
||||||
|
TResult Function(_RemoveItem value)? removeItem,
|
||||||
|
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
|
TResult Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult Function(_UpdateTable value)? updateTable,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (updateDelivery != null) {
|
||||||
|
return updateDelivery(this);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class _UpdateDelivery implements CheckoutFormEvent {
|
||||||
|
const factory _UpdateDelivery(final Delivery delivery) = _$UpdateDeliveryImpl;
|
||||||
|
|
||||||
|
Delivery get delivery;
|
||||||
|
|
||||||
|
/// Create a copy of CheckoutFormEvent
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
_$$UpdateDeliveryImplCopyWith<_$UpdateDeliveryImpl> get copyWith =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class _$$UpdateTableImplCopyWith<$Res> {
|
||||||
|
factory _$$UpdateTableImplCopyWith(
|
||||||
|
_$UpdateTableImpl value,
|
||||||
|
$Res Function(_$UpdateTableImpl) then,
|
||||||
|
) = __$$UpdateTableImplCopyWithImpl<$Res>;
|
||||||
|
@useResult
|
||||||
|
$Res call({Table? table});
|
||||||
|
|
||||||
|
$TableCopyWith<$Res>? get table;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class __$$UpdateTableImplCopyWithImpl<$Res>
|
||||||
|
extends _$CheckoutFormEventCopyWithImpl<$Res, _$UpdateTableImpl>
|
||||||
|
implements _$$UpdateTableImplCopyWith<$Res> {
|
||||||
|
__$$UpdateTableImplCopyWithImpl(
|
||||||
|
_$UpdateTableImpl _value,
|
||||||
|
$Res Function(_$UpdateTableImpl) _then,
|
||||||
|
) : super(_value, _then);
|
||||||
|
|
||||||
|
/// Create a copy of CheckoutFormEvent
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
@override
|
||||||
|
$Res call({Object? table = freezed}) {
|
||||||
|
return _then(
|
||||||
|
_$UpdateTableImpl(
|
||||||
|
freezed == table
|
||||||
|
? _value.table
|
||||||
|
: table // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Table?,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create a copy of CheckoutFormEvent
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$TableCopyWith<$Res>? get table {
|
||||||
|
if (_value.table == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $TableCopyWith<$Res>(_value.table!, (value) {
|
||||||
|
return _then(_value.copyWith(table: value));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
|
||||||
|
class _$UpdateTableImpl implements _UpdateTable {
|
||||||
|
const _$UpdateTableImpl(this.table);
|
||||||
|
|
||||||
|
@override
|
||||||
|
final Table? table;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'CheckoutFormEvent.updateTable(table: $table)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) ||
|
||||||
|
(other.runtimeType == runtimeType &&
|
||||||
|
other is _$UpdateTableImpl &&
|
||||||
|
(identical(other.table, table) || other.table == table));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType, table);
|
||||||
|
|
||||||
|
/// Create a copy of CheckoutFormEvent
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$$UpdateTableImplCopyWith<_$UpdateTableImpl> get copyWith =>
|
||||||
|
__$$UpdateTableImplCopyWithImpl<_$UpdateTableImpl>(this, _$identity);
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult when<TResult extends Object?>({
|
||||||
|
required TResult Function(List<ProductQuantity> items) started,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
removeItem,
|
||||||
|
required TResult Function(Product product, String notes) updateItemNotes,
|
||||||
|
required TResult Function(OrderType orderType) updateOrderType,
|
||||||
|
required TResult Function(Delivery delivery) updateDelivery,
|
||||||
|
required TResult Function(Table? table) updateTable,
|
||||||
|
}) {
|
||||||
|
return updateTable(table);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
|
TResult? Function(List<ProductQuantity> items)? started,
|
||||||
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
|
TResult? Function(Product product, String notes)? updateItemNotes,
|
||||||
|
TResult? Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult? Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult? Function(Table? table)? updateTable,
|
||||||
|
}) {
|
||||||
|
return updateTable?.call(table);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
|
TResult Function(List<ProductQuantity> items)? started,
|
||||||
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
|
TResult Function(Product product, String notes)? updateItemNotes,
|
||||||
|
TResult Function(OrderType orderType)? updateOrderType,
|
||||||
|
TResult Function(Delivery delivery)? updateDelivery,
|
||||||
|
TResult Function(Table? table)? updateTable,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (updateTable != null) {
|
||||||
|
return updateTable(table);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult map<TResult extends Object?>({
|
||||||
|
required TResult Function(_Started value) started,
|
||||||
|
required TResult Function(_AddItem value) addItem,
|
||||||
|
required TResult Function(_RemoveItem value) removeItem,
|
||||||
|
required TResult Function(_UpdateItemNotes value) updateItemNotes,
|
||||||
|
required TResult Function(_UpdateOrderType value) updateOrderType,
|
||||||
|
required TResult Function(_UpdateDelivery value) updateDelivery,
|
||||||
|
required TResult Function(_UpdateTable value) updateTable,
|
||||||
|
}) {
|
||||||
|
return updateTable(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? mapOrNull<TResult extends Object?>({
|
||||||
|
TResult? Function(_Started value)? started,
|
||||||
|
TResult? Function(_AddItem value)? addItem,
|
||||||
|
TResult? Function(_RemoveItem value)? removeItem,
|
||||||
|
TResult? Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
|
TResult? Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult? Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult? Function(_UpdateTable value)? updateTable,
|
||||||
|
}) {
|
||||||
|
return updateTable?.call(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeMap<TResult extends Object?>({
|
||||||
|
TResult Function(_Started value)? started,
|
||||||
|
TResult Function(_AddItem value)? addItem,
|
||||||
|
TResult Function(_RemoveItem value)? removeItem,
|
||||||
|
TResult Function(_UpdateItemNotes value)? updateItemNotes,
|
||||||
|
TResult Function(_UpdateOrderType value)? updateOrderType,
|
||||||
|
TResult Function(_UpdateDelivery value)? updateDelivery,
|
||||||
|
TResult Function(_UpdateTable value)? updateTable,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (updateTable != null) {
|
||||||
|
return updateTable(this);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class _UpdateTable implements CheckoutFormEvent {
|
||||||
|
const factory _UpdateTable(final Table? table) = _$UpdateTableImpl;
|
||||||
|
|
||||||
|
Table? get table;
|
||||||
|
|
||||||
|
/// Create a copy of CheckoutFormEvent
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
_$$UpdateTableImplCopyWith<_$UpdateTableImpl> get copyWith =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$CheckoutFormState {
|
mixin _$CheckoutFormState {
|
||||||
List<ProductQuantity> get items => throw _privateConstructorUsedError;
|
List<ProductQuantity> get items => throw _privateConstructorUsedError;
|
||||||
@ -1018,6 +1456,7 @@ mixin _$CheckoutFormState {
|
|||||||
String get draftName => throw _privateConstructorUsedError;
|
String get draftName => throw _privateConstructorUsedError;
|
||||||
OrderType get orderType => throw _privateConstructorUsedError;
|
OrderType get orderType => throw _privateConstructorUsedError;
|
||||||
Delivery? get delivery => throw _privateConstructorUsedError;
|
Delivery? get delivery => throw _privateConstructorUsedError;
|
||||||
|
Table? get table => throw _privateConstructorUsedError;
|
||||||
bool get isLoading => throw _privateConstructorUsedError;
|
bool get isLoading => throw _privateConstructorUsedError;
|
||||||
|
|
||||||
/// Create a copy of CheckoutFormState
|
/// Create a copy of CheckoutFormState
|
||||||
@ -1045,8 +1484,11 @@ abstract class $CheckoutFormStateCopyWith<$Res> {
|
|||||||
String draftName,
|
String draftName,
|
||||||
OrderType orderType,
|
OrderType orderType,
|
||||||
Delivery? delivery,
|
Delivery? delivery,
|
||||||
|
Table? table,
|
||||||
bool isLoading,
|
bool isLoading,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$TableCopyWith<$Res>? get table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@ -1074,6 +1516,7 @@ class _$CheckoutFormStateCopyWithImpl<$Res, $Val extends CheckoutFormState>
|
|||||||
Object? draftName = null,
|
Object? draftName = null,
|
||||||
Object? orderType = null,
|
Object? orderType = null,
|
||||||
Object? delivery = freezed,
|
Object? delivery = freezed,
|
||||||
|
Object? table = freezed,
|
||||||
Object? isLoading = null,
|
Object? isLoading = null,
|
||||||
}) {
|
}) {
|
||||||
return _then(
|
return _then(
|
||||||
@ -1118,6 +1561,10 @@ class _$CheckoutFormStateCopyWithImpl<$Res, $Val extends CheckoutFormState>
|
|||||||
? _value.delivery
|
? _value.delivery
|
||||||
: delivery // ignore: cast_nullable_to_non_nullable
|
: delivery // ignore: cast_nullable_to_non_nullable
|
||||||
as Delivery?,
|
as Delivery?,
|
||||||
|
table: freezed == table
|
||||||
|
? _value.table
|
||||||
|
: table // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Table?,
|
||||||
isLoading: null == isLoading
|
isLoading: null == isLoading
|
||||||
? _value.isLoading
|
? _value.isLoading
|
||||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||||
@ -1126,6 +1573,20 @@ class _$CheckoutFormStateCopyWithImpl<$Res, $Val extends CheckoutFormState>
|
|||||||
as $Val,
|
as $Val,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Create a copy of CheckoutFormState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$TableCopyWith<$Res>? get table {
|
||||||
|
if (_value.table == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $TableCopyWith<$Res>(_value.table!, (value) {
|
||||||
|
return _then(_value.copyWith(table: value) as $Val);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@ -1148,8 +1609,12 @@ abstract class _$$CheckoutFormStateImplCopyWith<$Res>
|
|||||||
String draftName,
|
String draftName,
|
||||||
OrderType orderType,
|
OrderType orderType,
|
||||||
Delivery? delivery,
|
Delivery? delivery,
|
||||||
|
Table? table,
|
||||||
bool isLoading,
|
bool isLoading,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
$TableCopyWith<$Res>? get table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@ -1176,6 +1641,7 @@ class __$$CheckoutFormStateImplCopyWithImpl<$Res>
|
|||||||
Object? draftName = null,
|
Object? draftName = null,
|
||||||
Object? orderType = null,
|
Object? orderType = null,
|
||||||
Object? delivery = freezed,
|
Object? delivery = freezed,
|
||||||
|
Object? table = freezed,
|
||||||
Object? isLoading = null,
|
Object? isLoading = null,
|
||||||
}) {
|
}) {
|
||||||
return _then(
|
return _then(
|
||||||
@ -1220,6 +1686,10 @@ class __$$CheckoutFormStateImplCopyWithImpl<$Res>
|
|||||||
? _value.delivery
|
? _value.delivery
|
||||||
: delivery // ignore: cast_nullable_to_non_nullable
|
: delivery // ignore: cast_nullable_to_non_nullable
|
||||||
as Delivery?,
|
as Delivery?,
|
||||||
|
table: freezed == table
|
||||||
|
? _value.table
|
||||||
|
: table // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Table?,
|
||||||
isLoading: null == isLoading
|
isLoading: null == isLoading
|
||||||
? _value.isLoading
|
? _value.isLoading
|
||||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||||
@ -1243,6 +1713,7 @@ class _$CheckoutFormStateImpl implements _CheckoutFormState {
|
|||||||
required this.draftName,
|
required this.draftName,
|
||||||
required this.orderType,
|
required this.orderType,
|
||||||
this.delivery,
|
this.delivery,
|
||||||
|
this.table,
|
||||||
this.isLoading = false,
|
this.isLoading = false,
|
||||||
}) : _items = items;
|
}) : _items = items;
|
||||||
|
|
||||||
@ -1273,12 +1744,14 @@ class _$CheckoutFormStateImpl implements _CheckoutFormState {
|
|||||||
@override
|
@override
|
||||||
final Delivery? delivery;
|
final Delivery? delivery;
|
||||||
@override
|
@override
|
||||||
|
final Table? table;
|
||||||
|
@override
|
||||||
@JsonKey()
|
@JsonKey()
|
||||||
final bool isLoading;
|
final bool isLoading;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'CheckoutFormState(items: $items, discount: $discount, discountAmount: $discountAmount, tax: $tax, serviceCharge: $serviceCharge, totalQuantity: $totalQuantity, totalPrice: $totalPrice, draftName: $draftName, orderType: $orderType, delivery: $delivery, isLoading: $isLoading)';
|
return 'CheckoutFormState(items: $items, discount: $discount, discountAmount: $discountAmount, tax: $tax, serviceCharge: $serviceCharge, totalQuantity: $totalQuantity, totalPrice: $totalPrice, draftName: $draftName, orderType: $orderType, delivery: $delivery, table: $table, isLoading: $isLoading)';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -1304,6 +1777,7 @@ class _$CheckoutFormStateImpl implements _CheckoutFormState {
|
|||||||
other.orderType == orderType) &&
|
other.orderType == orderType) &&
|
||||||
(identical(other.delivery, delivery) ||
|
(identical(other.delivery, delivery) ||
|
||||||
other.delivery == delivery) &&
|
other.delivery == delivery) &&
|
||||||
|
(identical(other.table, table) || other.table == table) &&
|
||||||
(identical(other.isLoading, isLoading) ||
|
(identical(other.isLoading, isLoading) ||
|
||||||
other.isLoading == isLoading));
|
other.isLoading == isLoading));
|
||||||
}
|
}
|
||||||
@ -1321,6 +1795,7 @@ class _$CheckoutFormStateImpl implements _CheckoutFormState {
|
|||||||
draftName,
|
draftName,
|
||||||
orderType,
|
orderType,
|
||||||
delivery,
|
delivery,
|
||||||
|
table,
|
||||||
isLoading,
|
isLoading,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1348,6 +1823,7 @@ abstract class _CheckoutFormState implements CheckoutFormState {
|
|||||||
required final String draftName,
|
required final String draftName,
|
||||||
required final OrderType orderType,
|
required final OrderType orderType,
|
||||||
final Delivery? delivery,
|
final Delivery? delivery,
|
||||||
|
final Table? table,
|
||||||
final bool isLoading,
|
final bool isLoading,
|
||||||
}) = _$CheckoutFormStateImpl;
|
}) = _$CheckoutFormStateImpl;
|
||||||
|
|
||||||
@ -1372,6 +1848,8 @@ abstract class _CheckoutFormState implements CheckoutFormState {
|
|||||||
@override
|
@override
|
||||||
Delivery? get delivery;
|
Delivery? get delivery;
|
||||||
@override
|
@override
|
||||||
|
Table? get table;
|
||||||
|
@override
|
||||||
bool get isLoading;
|
bool get isLoading;
|
||||||
|
|
||||||
/// Create a copy of CheckoutFormState
|
/// Create a copy of CheckoutFormState
|
||||||
|
|||||||
@ -22,4 +22,9 @@ class CheckoutFormEvent with _$CheckoutFormEvent {
|
|||||||
|
|
||||||
const factory CheckoutFormEvent.updateOrderType(OrderType orderType) =
|
const factory CheckoutFormEvent.updateOrderType(OrderType orderType) =
|
||||||
_UpdateOrderType;
|
_UpdateOrderType;
|
||||||
|
|
||||||
|
const factory CheckoutFormEvent.updateDelivery(Delivery delivery) =
|
||||||
|
_UpdateDelivery;
|
||||||
|
|
||||||
|
const factory CheckoutFormEvent.updateTable(Table? table) = _UpdateTable;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ class CheckoutFormState with _$CheckoutFormState {
|
|||||||
required String draftName,
|
required String draftName,
|
||||||
required OrderType orderType,
|
required OrderType orderType,
|
||||||
Delivery? delivery,
|
Delivery? delivery,
|
||||||
|
Table? table,
|
||||||
@Default(false) bool isLoading,
|
@Default(false) bool isLoading,
|
||||||
}) = _CheckoutFormState;
|
}) = _CheckoutFormState;
|
||||||
|
|
||||||
|
|||||||
98
lib/presentation/components/dialog/delivery_dialog.dart
Normal file
98
lib/presentation/components/dialog/delivery_dialog.dart
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
part of 'dialog.dart';
|
||||||
|
|
||||||
|
class DeliveryDialog extends StatefulWidget {
|
||||||
|
const DeliveryDialog({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<DeliveryDialog> createState() => _DeliveryDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DeliveryDialogState extends State<DeliveryDialog> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return CustomModalDialog(
|
||||||
|
title: 'Pilih Pengiriman',
|
||||||
|
subtitle: 'Silahkan pilih pengiriman yang sesuai',
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.0,
|
||||||
|
vertical: 24.0,
|
||||||
|
),
|
||||||
|
child: BlocBuilder<CheckoutFormBloc, CheckoutFormState>(
|
||||||
|
builder: (context, state) {
|
||||||
|
return Column(
|
||||||
|
children: List.generate(deliveries.length, (index) {
|
||||||
|
return _buildItem(
|
||||||
|
context,
|
||||||
|
deliveries[index],
|
||||||
|
selectedType: state.delivery,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildItem(
|
||||||
|
BuildContext context,
|
||||||
|
Delivery delivery, {
|
||||||
|
Delivery? selectedType,
|
||||||
|
}) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
context.read<CheckoutFormBloc>().add(
|
||||||
|
CheckoutFormEvent.updateDelivery(delivery),
|
||||||
|
);
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0),
|
||||||
|
margin: const EdgeInsets.only(bottom: 8.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: selectedType?.id == delivery.id
|
||||||
|
? AppColor.primary
|
||||||
|
: AppColor.white,
|
||||||
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
border: Border.all(
|
||||||
|
color: selectedType?.id == delivery.id
|
||||||
|
? AppColor.primary
|
||||||
|
: AppColor.textSecondary,
|
||||||
|
width: 1.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
delivery.imageUrl,
|
||||||
|
width: 40.0,
|
||||||
|
height: 40.0,
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
),
|
||||||
|
SpaceWidth(12.0),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
delivery.name,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: selectedType?.id == delivery.id
|
||||||
|
? AppColor.white
|
||||||
|
: AppColor.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SpaceWidth(12.0),
|
||||||
|
Icon(
|
||||||
|
Icons.check_circle,
|
||||||
|
color: selectedType?.id == delivery.id
|
||||||
|
? AppColor.success
|
||||||
|
: Colors.transparent,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,6 +6,8 @@ import '../../../application/checkout/checkout_form/checkout_form_bloc.dart';
|
|||||||
import '../../../application/outlet/outlet_loader/outlet_loader_bloc.dart';
|
import '../../../application/outlet/outlet_loader/outlet_loader_bloc.dart';
|
||||||
import '../../../common/extension/extension.dart';
|
import '../../../common/extension/extension.dart';
|
||||||
import '../../../common/theme/theme.dart';
|
import '../../../common/theme/theme.dart';
|
||||||
|
import '../../../common/types/order_type.dart';
|
||||||
|
import '../../../domain/delivery/delivery.dart';
|
||||||
import '../../../domain/product/product.dart';
|
import '../../../domain/product/product.dart';
|
||||||
import '../button/button.dart';
|
import '../button/button.dart';
|
||||||
import '../card/outlet_card.dart';
|
import '../card/outlet_card.dart';
|
||||||
@ -15,3 +17,5 @@ import '../spaces/space.dart';
|
|||||||
part 'custom_modal_dialog.dart';
|
part 'custom_modal_dialog.dart';
|
||||||
part 'outlet_dialog.dart';
|
part 'outlet_dialog.dart';
|
||||||
part 'variant_dialog.dart';
|
part 'variant_dialog.dart';
|
||||||
|
part 'delivery_dialog.dart';
|
||||||
|
part 'order_type_dialog.dart';
|
||||||
|
|||||||
@ -1,12 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
part of 'dialog.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
||||||
|
|
||||||
import '../../../application/checkout/checkout_form/checkout_form_bloc.dart';
|
|
||||||
import '../../../common/theme/theme.dart';
|
|
||||||
import '../../../common/types/order_type.dart';
|
|
||||||
import '../spaces/space.dart';
|
|
||||||
import 'dialog.dart';
|
|
||||||
|
|
||||||
class OrderTypeDialog extends StatelessWidget {
|
class OrderTypeDialog extends StatelessWidget {
|
||||||
const OrderTypeDialog({super.key});
|
const OrderTypeDialog({super.key});
|
||||||
|
|||||||
@ -1,11 +1,14 @@
|
|||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
import '../../../../../../application/checkout/checkout_form/checkout_form_bloc.dart';
|
import '../../../../../../application/checkout/checkout_form/checkout_form_bloc.dart';
|
||||||
import '../../../../../../common/extension/extension.dart';
|
import '../../../../../../common/extension/extension.dart';
|
||||||
import '../../../../../../common/theme/theme.dart';
|
import '../../../../../../common/theme/theme.dart';
|
||||||
|
import '../../../../../../common/types/order_type.dart';
|
||||||
import '../../../../../components/button/button.dart';
|
import '../../../../../components/button/button.dart';
|
||||||
import '../../../../../components/dialog/order_type_dialog.dart';
|
import '../../../../../components/dialog/dialog.dart';
|
||||||
|
import '../../../../../router/app_router.gr.dart';
|
||||||
|
|
||||||
class HomeRightTitle extends StatelessWidget {
|
class HomeRightTitle extends StatelessWidget {
|
||||||
// final TableModel? table;
|
// final TableModel? table;
|
||||||
@ -27,71 +30,55 @@ class HomeRightTitle extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [_buildButton('Daftar Pesanan', Icons.list, () {})],
|
||||||
Expanded(
|
|
||||||
child: AppElevatedButton.filled(
|
|
||||||
width: 180.0,
|
|
||||||
height: 40,
|
|
||||||
elevation: 0,
|
|
||||||
onPressed: () {},
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
icon: Icon(Icons.list, color: Colors.white, size: 24),
|
|
||||||
label: 'Daftar Pesanan',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
_buildButton(
|
||||||
child: AppElevatedButton.filled(
|
state.orderType.value.toTitleCase(),
|
||||||
width: 180.0,
|
state.orderType.icon,
|
||||||
height: 40,
|
() {
|
||||||
elevation: 0,
|
showDialog(
|
||||||
onPressed: () {
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return OrderTypeDialog();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
switch (state.orderType) {
|
||||||
|
OrderType.dineIn => _buildButton(
|
||||||
|
state.table == null
|
||||||
|
? 'Pilih Meja'
|
||||||
|
: (state.table?.tableName ?? '-'),
|
||||||
|
Icons.table_restaurant_outlined,
|
||||||
|
() {
|
||||||
|
if (state.table != null) return;
|
||||||
|
|
||||||
|
context.router.navigate(
|
||||||
|
const MainRoute(children: [TableRoute()]),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
OrderType.takeAway => SizedBox.shrink(),
|
||||||
|
OrderType.delivery => _buildButton(
|
||||||
|
state.delivery == null
|
||||||
|
? 'Pilih Pengiriman'
|
||||||
|
: (state.delivery?.name ?? "-"),
|
||||||
|
Icons.motorcycle_outlined,
|
||||||
|
() {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return OrderTypeDialog();
|
return DeliveryDialog();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
icon: Icon(
|
|
||||||
state.orderType.icon,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 24,
|
|
||||||
),
|
|
||||||
label: state.orderType.value.toTitleCase(),
|
|
||||||
),
|
),
|
||||||
),
|
OrderType.freeTable => SizedBox.shrink(),
|
||||||
Expanded(
|
},
|
||||||
child: AppElevatedButton.filled(
|
|
||||||
width: 180.0,
|
|
||||||
height: 40,
|
|
||||||
elevation: 0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.motorcycle_outlined,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 24,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
// showDialog(
|
|
||||||
// context: context,
|
|
||||||
// builder: (context) {
|
|
||||||
// return DeliveryDialog();
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
},
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
label: 'Pilih Pengiriman',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -101,4 +88,19 @@ class HomeRightTitle extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Expanded _buildButton(String label, IconData icon, Function() onPressed) {
|
||||||
|
return Expanded(
|
||||||
|
child: AppElevatedButton.filled(
|
||||||
|
width: 180.0,
|
||||||
|
height: 40,
|
||||||
|
elevation: 0,
|
||||||
|
onPressed: onPressed,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
icon: Icon(icon, color: Colors.white, size: 24),
|
||||||
|
label: label,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import '../../../../../../application/checkout/checkout_form/checkout_form_bloc.dart';
|
||||||
import '../../../../../../application/table/table_loader/table_loader_bloc.dart';
|
import '../../../../../../application/table/table_loader/table_loader_bloc.dart';
|
||||||
import '../../../../../../common/theme/theme.dart';
|
import '../../../../../../common/theme/theme.dart';
|
||||||
import '../../../../../../domain/table/table.dart' as t;
|
import '../../../../../../domain/table/table.dart' as t;
|
||||||
|
import '../../../../../router/app_router.gr.dart';
|
||||||
|
|
||||||
class TableFloatingBottomNavbar extends StatelessWidget {
|
class TableFloatingBottomNavbar extends StatelessWidget {
|
||||||
final t.Table? selectedTable;
|
final t.Table? selectedTable;
|
||||||
@ -115,13 +118,16 @@ class TableFloatingBottomNavbar extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (selectedTable?.status.isAvailable ?? false) {
|
if (selectedTable?.status.isAvailable ?? true) {
|
||||||
// context.pushReplacement(
|
context.read<CheckoutFormBloc>().add(
|
||||||
// DashboardPage(
|
CheckoutFormEvent.updateTable(selectedTable),
|
||||||
// table: selectedTable!,
|
);
|
||||||
// items: widget.items,
|
context.read<TableLoaderBloc>().add(
|
||||||
// ),
|
TableLoaderEvent.setSelectedTable(null),
|
||||||
// );
|
);
|
||||||
|
context.router.navigate(
|
||||||
|
const MainRoute(children: [HomeRoute()]),
|
||||||
|
);
|
||||||
} else {}
|
} else {}
|
||||||
},
|
},
|
||||||
child: const Text(
|
child: const Text(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user