feat: product variant
This commit is contained in:
parent
04e1edbe79
commit
835c834ce1
@ -187,6 +187,7 @@ class OrderItem {
|
|||||||
final String? productId;
|
final String? productId;
|
||||||
final String? productName;
|
final String? productName;
|
||||||
final String? productVariantId;
|
final String? productVariantId;
|
||||||
|
final String? productVariantName;
|
||||||
final int? quantity;
|
final int? quantity;
|
||||||
final int? unitPrice;
|
final int? unitPrice;
|
||||||
final int? totalPrice;
|
final int? totalPrice;
|
||||||
@ -202,6 +203,7 @@ class OrderItem {
|
|||||||
this.productId,
|
this.productId,
|
||||||
this.productName,
|
this.productName,
|
||||||
this.productVariantId,
|
this.productVariantId,
|
||||||
|
this.productVariantName,
|
||||||
this.quantity,
|
this.quantity,
|
||||||
this.unitPrice,
|
this.unitPrice,
|
||||||
this.totalPrice,
|
this.totalPrice,
|
||||||
@ -218,6 +220,7 @@ class OrderItem {
|
|||||||
productId: json["product_id"],
|
productId: json["product_id"],
|
||||||
productName: json["product_name"],
|
productName: json["product_name"],
|
||||||
productVariantId: json["product_variant_id"],
|
productVariantId: json["product_variant_id"],
|
||||||
|
productVariantName: json["product_variant_name"],
|
||||||
quantity: json["quantity"],
|
quantity: json["quantity"],
|
||||||
unitPrice: json["unit_price"],
|
unitPrice: json["unit_price"],
|
||||||
totalPrice: json["total_price"],
|
totalPrice: json["total_price"],
|
||||||
@ -238,6 +241,7 @@ class OrderItem {
|
|||||||
"product_id": productId,
|
"product_id": productId,
|
||||||
"product_name": productName,
|
"product_name": productName,
|
||||||
"product_variant_id": productVariantId,
|
"product_variant_id": productVariantId,
|
||||||
|
"product_variant_name": productVariantName,
|
||||||
"quantity": quantity,
|
"quantity": quantity,
|
||||||
"unit_price": unitPrice,
|
"unit_price": unitPrice,
|
||||||
"total_price": totalPrice,
|
"total_price": totalPrice,
|
||||||
|
|||||||
@ -25,15 +25,29 @@ class CheckoutBloc extends Bloc<CheckoutEvent, CheckoutState> {
|
|||||||
on<_AddItem>((event, emit) {
|
on<_AddItem>((event, emit) {
|
||||||
var currentState = state as _Loaded;
|
var currentState = state as _Loaded;
|
||||||
List<ProductQuantity> items = [...currentState.items];
|
List<ProductQuantity> items = [...currentState.items];
|
||||||
var index =
|
var index = items.indexWhere(
|
||||||
items.indexWhere((element) => element.product.id == event.product.id);
|
(element) =>
|
||||||
|
element.product.id == event.product.id &&
|
||||||
|
element.variant?.id == event.variant?.id,
|
||||||
|
);
|
||||||
emit(const _Loading());
|
emit(const _Loading());
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
items[index] = ProductQuantity(
|
items[index] = ProductQuantity(
|
||||||
product: event.product, quantity: items[index].quantity + 1);
|
product: event.product,
|
||||||
|
quantity: items[index].quantity + 1,
|
||||||
|
variant: event.variant,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
items.add(ProductQuantity(product: event.product, quantity: 1));
|
items.add(
|
||||||
|
ProductQuantity(
|
||||||
|
product: event.product,
|
||||||
|
quantity: 1,
|
||||||
|
variant: event.variant,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log("Items: $items");
|
||||||
emit(_Loaded(
|
emit(_Loaded(
|
||||||
items,
|
items,
|
||||||
currentState.discountModel,
|
currentState.discountModel,
|
||||||
@ -50,13 +64,19 @@ class CheckoutBloc extends Bloc<CheckoutEvent, CheckoutState> {
|
|||||||
on<_RemoveItem>((event, emit) {
|
on<_RemoveItem>((event, emit) {
|
||||||
var currentState = state as _Loaded;
|
var currentState = state as _Loaded;
|
||||||
List<ProductQuantity> items = [...currentState.items];
|
List<ProductQuantity> items = [...currentState.items];
|
||||||
var index =
|
var index = items.indexWhere(
|
||||||
items.indexWhere((element) => element.product.id == event.product.id);
|
(element) =>
|
||||||
|
element.product.id == event.product.id &&
|
||||||
|
element.variant?.id == event.variant?.id,
|
||||||
|
);
|
||||||
emit(const _Loading());
|
emit(const _Loading());
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
if (items[index].quantity > 1) {
|
if (items[index].quantity > 1) {
|
||||||
items[index] = ProductQuantity(
|
items[index] = ProductQuantity(
|
||||||
product: event.product, quantity: items[index].quantity - 1);
|
product: event.product,
|
||||||
|
quantity: items[index].quantity - 1,
|
||||||
|
variant: event.variant);
|
||||||
|
;
|
||||||
} else {
|
} else {
|
||||||
items.removeAt(index);
|
items.removeAt(index);
|
||||||
}
|
}
|
||||||
@ -77,8 +97,11 @@ class CheckoutBloc extends Bloc<CheckoutEvent, CheckoutState> {
|
|||||||
on<_DeleteItem>((event, emit) {
|
on<_DeleteItem>((event, emit) {
|
||||||
var currentState = state as _Loaded;
|
var currentState = state as _Loaded;
|
||||||
List<ProductQuantity> items = [...currentState.items];
|
List<ProductQuantity> items = [...currentState.items];
|
||||||
var index =
|
var index = items.indexWhere(
|
||||||
items.indexWhere((element) => element.product.id == event.product.id);
|
(element) =>
|
||||||
|
element.product.id == event.product.id &&
|
||||||
|
element.variant?.id == event.variant?.id,
|
||||||
|
);
|
||||||
emit(const _Loading());
|
emit(const _Loading());
|
||||||
|
|
||||||
items.removeAt(index);
|
items.removeAt(index);
|
||||||
|
|||||||
@ -19,9 +19,11 @@ mixin _$CheckoutEvent {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -39,9 +41,9 @@ mixin _$CheckoutEvent {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -58,9 +60,9 @@ mixin _$CheckoutEvent {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -195,9 +197,11 @@ class _$StartedImpl implements _Started {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -218,9 +222,9 @@ class _$StartedImpl implements _Started {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -240,9 +244,9 @@ class _$StartedImpl implements _Started {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -340,7 +344,7 @@ abstract class _$$AddItemImplCopyWith<$Res> {
|
|||||||
_$AddItemImpl value, $Res Function(_$AddItemImpl) then) =
|
_$AddItemImpl value, $Res Function(_$AddItemImpl) then) =
|
||||||
__$$AddItemImplCopyWithImpl<$Res>;
|
__$$AddItemImplCopyWithImpl<$Res>;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({Product product});
|
$Res call({Product product, ProductVariant? variant});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@ -357,12 +361,17 @@ class __$$AddItemImplCopyWithImpl<$Res>
|
|||||||
@override
|
@override
|
||||||
$Res call({
|
$Res call({
|
||||||
Object? product = null,
|
Object? product = null,
|
||||||
|
Object? variant = freezed,
|
||||||
}) {
|
}) {
|
||||||
return _then(_$AddItemImpl(
|
return _then(_$AddItemImpl(
|
||||||
null == product
|
null == product
|
||||||
? _value.product
|
? _value.product
|
||||||
: product // ignore: cast_nullable_to_non_nullable
|
: product // ignore: cast_nullable_to_non_nullable
|
||||||
as Product,
|
as Product,
|
||||||
|
freezed == variant
|
||||||
|
? _value.variant
|
||||||
|
: variant // ignore: cast_nullable_to_non_nullable
|
||||||
|
as ProductVariant?,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -370,14 +379,16 @@ class __$$AddItemImplCopyWithImpl<$Res>
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
|
|
||||||
class _$AddItemImpl implements _AddItem {
|
class _$AddItemImpl implements _AddItem {
|
||||||
const _$AddItemImpl(this.product);
|
const _$AddItemImpl(this.product, this.variant);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final Product product;
|
final Product product;
|
||||||
|
@override
|
||||||
|
final ProductVariant? variant;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'CheckoutEvent.addItem(product: $product)';
|
return 'CheckoutEvent.addItem(product: $product, variant: $variant)';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -385,11 +396,12 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
return identical(this, other) ||
|
return identical(this, other) ||
|
||||||
(other.runtimeType == runtimeType &&
|
(other.runtimeType == runtimeType &&
|
||||||
other is _$AddItemImpl &&
|
other is _$AddItemImpl &&
|
||||||
(identical(other.product, product) || other.product == product));
|
(identical(other.product, product) || other.product == product) &&
|
||||||
|
(identical(other.variant, variant) || other.variant == variant));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType, product);
|
int get hashCode => Object.hash(runtimeType, product, variant);
|
||||||
|
|
||||||
/// Create a copy of CheckoutEvent
|
/// Create a copy of CheckoutEvent
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@ -403,9 +415,11 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -419,16 +433,16 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
saveDraftOrder,
|
saveDraftOrder,
|
||||||
required TResult Function(DraftOrderModel data) loadDraftOrder,
|
required TResult Function(DraftOrderModel data) loadDraftOrder,
|
||||||
}) {
|
}) {
|
||||||
return addItem(product);
|
return addItem(product, variant);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -441,16 +455,16 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
saveDraftOrder,
|
saveDraftOrder,
|
||||||
TResult? Function(DraftOrderModel data)? loadDraftOrder,
|
TResult? Function(DraftOrderModel data)? loadDraftOrder,
|
||||||
}) {
|
}) {
|
||||||
return addItem?.call(product);
|
return addItem?.call(product, variant);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -465,7 +479,7 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (addItem != null) {
|
if (addItem != null) {
|
||||||
return addItem(product);
|
return addItem(product, variant);
|
||||||
}
|
}
|
||||||
return orElse();
|
return orElse();
|
||||||
}
|
}
|
||||||
@ -539,9 +553,11 @@ class _$AddItemImpl implements _AddItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abstract class _AddItem implements CheckoutEvent {
|
abstract class _AddItem implements CheckoutEvent {
|
||||||
const factory _AddItem(final Product product) = _$AddItemImpl;
|
const factory _AddItem(final Product product, final ProductVariant? variant) =
|
||||||
|
_$AddItemImpl;
|
||||||
|
|
||||||
Product get product;
|
Product get product;
|
||||||
|
ProductVariant? get variant;
|
||||||
|
|
||||||
/// Create a copy of CheckoutEvent
|
/// Create a copy of CheckoutEvent
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@ -556,7 +572,7 @@ abstract class _$$RemoveItemImplCopyWith<$Res> {
|
|||||||
_$RemoveItemImpl value, $Res Function(_$RemoveItemImpl) then) =
|
_$RemoveItemImpl value, $Res Function(_$RemoveItemImpl) then) =
|
||||||
__$$RemoveItemImplCopyWithImpl<$Res>;
|
__$$RemoveItemImplCopyWithImpl<$Res>;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({Product product});
|
$Res call({Product product, ProductVariant? variant});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@ -573,12 +589,17 @@ class __$$RemoveItemImplCopyWithImpl<$Res>
|
|||||||
@override
|
@override
|
||||||
$Res call({
|
$Res call({
|
||||||
Object? product = null,
|
Object? product = null,
|
||||||
|
Object? variant = freezed,
|
||||||
}) {
|
}) {
|
||||||
return _then(_$RemoveItemImpl(
|
return _then(_$RemoveItemImpl(
|
||||||
null == product
|
null == product
|
||||||
? _value.product
|
? _value.product
|
||||||
: product // ignore: cast_nullable_to_non_nullable
|
: product // ignore: cast_nullable_to_non_nullable
|
||||||
as Product,
|
as Product,
|
||||||
|
freezed == variant
|
||||||
|
? _value.variant
|
||||||
|
: variant // ignore: cast_nullable_to_non_nullable
|
||||||
|
as ProductVariant?,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -586,14 +607,16 @@ class __$$RemoveItemImplCopyWithImpl<$Res>
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
|
|
||||||
class _$RemoveItemImpl implements _RemoveItem {
|
class _$RemoveItemImpl implements _RemoveItem {
|
||||||
const _$RemoveItemImpl(this.product);
|
const _$RemoveItemImpl(this.product, this.variant);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final Product product;
|
final Product product;
|
||||||
|
@override
|
||||||
|
final ProductVariant? variant;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'CheckoutEvent.removeItem(product: $product)';
|
return 'CheckoutEvent.removeItem(product: $product, variant: $variant)';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -601,11 +624,12 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
return identical(this, other) ||
|
return identical(this, other) ||
|
||||||
(other.runtimeType == runtimeType &&
|
(other.runtimeType == runtimeType &&
|
||||||
other is _$RemoveItemImpl &&
|
other is _$RemoveItemImpl &&
|
||||||
(identical(other.product, product) || other.product == product));
|
(identical(other.product, product) || other.product == product) &&
|
||||||
|
(identical(other.variant, variant) || other.variant == variant));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType, product);
|
int get hashCode => Object.hash(runtimeType, product, variant);
|
||||||
|
|
||||||
/// Create a copy of CheckoutEvent
|
/// Create a copy of CheckoutEvent
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@ -619,9 +643,11 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -635,16 +661,16 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
saveDraftOrder,
|
saveDraftOrder,
|
||||||
required TResult Function(DraftOrderModel data) loadDraftOrder,
|
required TResult Function(DraftOrderModel data) loadDraftOrder,
|
||||||
}) {
|
}) {
|
||||||
return removeItem(product);
|
return removeItem(product, variant);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -657,16 +683,16 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
saveDraftOrder,
|
saveDraftOrder,
|
||||||
TResult? Function(DraftOrderModel data)? loadDraftOrder,
|
TResult? Function(DraftOrderModel data)? loadDraftOrder,
|
||||||
}) {
|
}) {
|
||||||
return removeItem?.call(product);
|
return removeItem?.call(product, variant);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -681,7 +707,7 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (removeItem != null) {
|
if (removeItem != null) {
|
||||||
return removeItem(product);
|
return removeItem(product, variant);
|
||||||
}
|
}
|
||||||
return orElse();
|
return orElse();
|
||||||
}
|
}
|
||||||
@ -755,9 +781,11 @@ class _$RemoveItemImpl implements _RemoveItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abstract class _RemoveItem implements CheckoutEvent {
|
abstract class _RemoveItem implements CheckoutEvent {
|
||||||
const factory _RemoveItem(final Product product) = _$RemoveItemImpl;
|
const factory _RemoveItem(
|
||||||
|
final Product product, final ProductVariant? variant) = _$RemoveItemImpl;
|
||||||
|
|
||||||
Product get product;
|
Product get product;
|
||||||
|
ProductVariant? get variant;
|
||||||
|
|
||||||
/// Create a copy of CheckoutEvent
|
/// Create a copy of CheckoutEvent
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@ -772,7 +800,7 @@ abstract class _$$DeleteItemImplCopyWith<$Res> {
|
|||||||
_$DeleteItemImpl value, $Res Function(_$DeleteItemImpl) then) =
|
_$DeleteItemImpl value, $Res Function(_$DeleteItemImpl) then) =
|
||||||
__$$DeleteItemImplCopyWithImpl<$Res>;
|
__$$DeleteItemImplCopyWithImpl<$Res>;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({Product product});
|
$Res call({Product product, ProductVariant? variant});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@ -789,12 +817,17 @@ class __$$DeleteItemImplCopyWithImpl<$Res>
|
|||||||
@override
|
@override
|
||||||
$Res call({
|
$Res call({
|
||||||
Object? product = null,
|
Object? product = null,
|
||||||
|
Object? variant = freezed,
|
||||||
}) {
|
}) {
|
||||||
return _then(_$DeleteItemImpl(
|
return _then(_$DeleteItemImpl(
|
||||||
null == product
|
null == product
|
||||||
? _value.product
|
? _value.product
|
||||||
: product // ignore: cast_nullable_to_non_nullable
|
: product // ignore: cast_nullable_to_non_nullable
|
||||||
as Product,
|
as Product,
|
||||||
|
freezed == variant
|
||||||
|
? _value.variant
|
||||||
|
: variant // ignore: cast_nullable_to_non_nullable
|
||||||
|
as ProductVariant?,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -802,14 +835,16 @@ class __$$DeleteItemImplCopyWithImpl<$Res>
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
|
|
||||||
class _$DeleteItemImpl implements _DeleteItem {
|
class _$DeleteItemImpl implements _DeleteItem {
|
||||||
const _$DeleteItemImpl(this.product);
|
const _$DeleteItemImpl(this.product, this.variant);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final Product product;
|
final Product product;
|
||||||
|
@override
|
||||||
|
final ProductVariant? variant;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'CheckoutEvent.deleteItem(product: $product)';
|
return 'CheckoutEvent.deleteItem(product: $product, variant: $variant)';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -817,11 +852,12 @@ class _$DeleteItemImpl implements _DeleteItem {
|
|||||||
return identical(this, other) ||
|
return identical(this, other) ||
|
||||||
(other.runtimeType == runtimeType &&
|
(other.runtimeType == runtimeType &&
|
||||||
other is _$DeleteItemImpl &&
|
other is _$DeleteItemImpl &&
|
||||||
(identical(other.product, product) || other.product == product));
|
(identical(other.product, product) || other.product == product) &&
|
||||||
|
(identical(other.variant, variant) || other.variant == variant));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType, product);
|
int get hashCode => Object.hash(runtimeType, product, variant);
|
||||||
|
|
||||||
/// Create a copy of CheckoutEvent
|
/// Create a copy of CheckoutEvent
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@ -835,9 +871,11 @@ class _$DeleteItemImpl implements _DeleteItem {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -851,16 +889,16 @@ class _$DeleteItemImpl implements _DeleteItem {
|
|||||||
saveDraftOrder,
|
saveDraftOrder,
|
||||||
required TResult Function(DraftOrderModel data) loadDraftOrder,
|
required TResult Function(DraftOrderModel data) loadDraftOrder,
|
||||||
}) {
|
}) {
|
||||||
return deleteItem(product);
|
return deleteItem(product, variant);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -873,16 +911,16 @@ class _$DeleteItemImpl implements _DeleteItem {
|
|||||||
saveDraftOrder,
|
saveDraftOrder,
|
||||||
TResult? Function(DraftOrderModel data)? loadDraftOrder,
|
TResult? Function(DraftOrderModel data)? loadDraftOrder,
|
||||||
}) {
|
}) {
|
||||||
return deleteItem?.call(product);
|
return deleteItem?.call(product, variant);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -897,7 +935,7 @@ class _$DeleteItemImpl implements _DeleteItem {
|
|||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (deleteItem != null) {
|
if (deleteItem != null) {
|
||||||
return deleteItem(product);
|
return deleteItem(product, variant);
|
||||||
}
|
}
|
||||||
return orElse();
|
return orElse();
|
||||||
}
|
}
|
||||||
@ -971,9 +1009,11 @@ class _$DeleteItemImpl implements _DeleteItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abstract class _DeleteItem implements CheckoutEvent {
|
abstract class _DeleteItem implements CheckoutEvent {
|
||||||
const factory _DeleteItem(final Product product) = _$DeleteItemImpl;
|
const factory _DeleteItem(
|
||||||
|
final Product product, final ProductVariant? variant) = _$DeleteItemImpl;
|
||||||
|
|
||||||
Product get product;
|
Product get product;
|
||||||
|
ProductVariant? get variant;
|
||||||
|
|
||||||
/// Create a copy of CheckoutEvent
|
/// Create a copy of CheckoutEvent
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@ -1052,9 +1092,11 @@ class _$AddDiscountImpl implements _AddDiscount {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -1075,9 +1117,9 @@ class _$AddDiscountImpl implements _AddDiscount {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -1097,9 +1139,9 @@ class _$AddDiscountImpl implements _AddDiscount {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -1241,9 +1283,11 @@ class _$RemoveDiscountImpl implements _RemoveDiscount {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -1264,9 +1308,9 @@ class _$RemoveDiscountImpl implements _RemoveDiscount {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -1286,9 +1330,9 @@ class _$RemoveDiscountImpl implements _RemoveDiscount {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -1449,9 +1493,11 @@ class _$AddTaxImpl implements _AddTax {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -1472,9 +1518,9 @@ class _$AddTaxImpl implements _AddTax {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -1494,9 +1540,9 @@ class _$AddTaxImpl implements _AddTax {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -1667,9 +1713,11 @@ class _$AddServiceChargeImpl implements _AddServiceCharge {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -1690,9 +1738,9 @@ class _$AddServiceChargeImpl implements _AddServiceCharge {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -1712,9 +1760,9 @@ class _$AddServiceChargeImpl implements _AddServiceCharge {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -1857,9 +1905,11 @@ class _$RemoveTaxImpl implements _RemoveTax {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -1880,9 +1930,9 @@ class _$RemoveTaxImpl implements _RemoveTax {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -1902,9 +1952,9 @@ class _$RemoveTaxImpl implements _RemoveTax {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -2039,9 +2089,11 @@ class _$RemoveServiceChargeImpl implements _RemoveServiceCharge {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -2062,9 +2114,9 @@ class _$RemoveServiceChargeImpl implements _RemoveServiceCharge {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -2084,9 +2136,9 @@ class _$RemoveServiceChargeImpl implements _RemoveServiceCharge {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -2249,9 +2301,11 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -2272,9 +2326,9 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -2294,9 +2348,9 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -2475,9 +2529,11 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -2498,9 +2554,9 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -2520,9 +2576,9 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -2715,9 +2771,11 @@ class _$SaveDraftOrderImpl implements _SaveDraftOrder {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -2738,9 +2796,9 @@ class _$SaveDraftOrderImpl implements _SaveDraftOrder {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -2760,9 +2818,9 @@ class _$SaveDraftOrderImpl implements _SaveDraftOrder {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
@ -2935,9 +2993,11 @@ class _$LoadDraftOrderImpl implements _LoadDraftOrder {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() started,
|
required TResult Function() started,
|
||||||
required TResult Function(Product product) addItem,
|
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||||
required TResult Function(Product product) removeItem,
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
required TResult Function(Product product) deleteItem,
|
removeItem,
|
||||||
|
required TResult Function(Product product, ProductVariant? variant)
|
||||||
|
deleteItem,
|
||||||
required TResult Function(Discount discount) addDiscount,
|
required TResult Function(Discount discount) addDiscount,
|
||||||
required TResult Function() removeDiscount,
|
required TResult Function() removeDiscount,
|
||||||
required TResult Function(int tax) addTax,
|
required TResult Function(int tax) addTax,
|
||||||
@ -2958,9 +3018,9 @@ class _$LoadDraftOrderImpl implements _LoadDraftOrder {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? started,
|
TResult? Function()? started,
|
||||||
TResult? Function(Product product)? addItem,
|
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult? Function(Product product)? removeItem,
|
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult? Function(Product product)? deleteItem,
|
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult? Function(Discount discount)? addDiscount,
|
TResult? Function(Discount discount)? addDiscount,
|
||||||
TResult? Function()? removeDiscount,
|
TResult? Function()? removeDiscount,
|
||||||
TResult? Function(int tax)? addTax,
|
TResult? Function(int tax)? addTax,
|
||||||
@ -2980,9 +3040,9 @@ class _$LoadDraftOrderImpl implements _LoadDraftOrder {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? started,
|
TResult Function()? started,
|
||||||
TResult Function(Product product)? addItem,
|
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||||
TResult Function(Product product)? removeItem,
|
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||||
TResult Function(Product product)? deleteItem,
|
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||||
TResult Function(Discount discount)? addDiscount,
|
TResult Function(Discount discount)? addDiscount,
|
||||||
TResult Function()? removeDiscount,
|
TResult Function()? removeDiscount,
|
||||||
TResult Function(int tax)? addTax,
|
TResult Function(int tax)? addTax,
|
||||||
|
|||||||
@ -4,11 +4,14 @@ part of 'checkout_bloc.dart';
|
|||||||
class CheckoutEvent with _$CheckoutEvent {
|
class CheckoutEvent with _$CheckoutEvent {
|
||||||
const factory CheckoutEvent.started() = _Started;
|
const factory CheckoutEvent.started() = _Started;
|
||||||
//add item
|
//add item
|
||||||
const factory CheckoutEvent.addItem(Product product) = _AddItem;
|
const factory CheckoutEvent.addItem(
|
||||||
|
Product product, ProductVariant? variant) = _AddItem;
|
||||||
//remove item
|
//remove item
|
||||||
const factory CheckoutEvent.removeItem(Product product) = _RemoveItem;
|
const factory CheckoutEvent.removeItem(
|
||||||
|
Product product, ProductVariant? variant) = _RemoveItem;
|
||||||
// Delete Item
|
// Delete Item
|
||||||
const factory CheckoutEvent.deleteItem(Product product) = _DeleteItem;
|
const factory CheckoutEvent.deleteItem(
|
||||||
|
Product product, ProductVariant? variant) = _DeleteItem;
|
||||||
|
|
||||||
//add discount
|
//add discount
|
||||||
const factory CheckoutEvent.addDiscount(Discount discount) = _AddDiscount;
|
const factory CheckoutEvent.addDiscount(Discount discount) = _AddDiscount;
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'dart:developer';
|
|||||||
import 'package:bloc/bloc.dart';
|
import 'package:bloc/bloc.dart';
|
||||||
import 'package:enaklo_pos/data/datasources/auth_local_datasource.dart';
|
import 'package:enaklo_pos/data/datasources/auth_local_datasource.dart';
|
||||||
import 'package:enaklo_pos/data/datasources/order_remote_datasource.dart';
|
import 'package:enaklo_pos/data/datasources/order_remote_datasource.dart';
|
||||||
|
import 'package:enaklo_pos/data/models/response/customer_response_model.dart';
|
||||||
import 'package:enaklo_pos/data/models/response/order_response_model.dart';
|
import 'package:enaklo_pos/data/models/response/order_response_model.dart';
|
||||||
import 'package:enaklo_pos/data/models/response/payment_methods_response_model.dart';
|
import 'package:enaklo_pos/data/models/response/payment_methods_response_model.dart';
|
||||||
import 'package:enaklo_pos/data/models/response/table_model.dart';
|
import 'package:enaklo_pos/data/models/response/table_model.dart';
|
||||||
@ -37,7 +38,7 @@ class OrderFormBloc extends Bloc<OrderFormEvent, OrderFormState> {
|
|||||||
tableId: event.table.id,
|
tableId: event.table.id,
|
||||||
tableNumber: event.table.tableName,
|
tableNumber: event.table.tableName,
|
||||||
outletId: userData.user?.outletId,
|
outletId: userData.user?.outletId,
|
||||||
userId: userData.user?.id,
|
customerId: event.customer?.id ?? '',
|
||||||
orderItems: event.items
|
orderItems: event.items
|
||||||
.map(
|
.map(
|
||||||
(productQuantity) => OrderItemRequest(
|
(productQuantity) => OrderItemRequest(
|
||||||
@ -45,6 +46,7 @@ class OrderFormBloc extends Bloc<OrderFormEvent, OrderFormState> {
|
|||||||
quantity: productQuantity.quantity,
|
quantity: productQuantity.quantity,
|
||||||
notes: productQuantity.notes,
|
notes: productQuantity.notes,
|
||||||
unitPrice: productQuantity.product.price,
|
unitPrice: productQuantity.product.price,
|
||||||
|
productVariantId: productQuantity.variant?.id,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
@ -78,7 +80,7 @@ class OrderFormBloc extends Bloc<OrderFormEvent, OrderFormState> {
|
|||||||
tableId: event.table.id,
|
tableId: event.table.id,
|
||||||
tableNumber: event.table.tableName,
|
tableNumber: event.table.tableName,
|
||||||
outletId: userData.user?.outletId,
|
outletId: userData.user?.outletId,
|
||||||
userId: userData.user?.id,
|
customerId: event.customer?.id ?? '',
|
||||||
orderItems: event.items
|
orderItems: event.items
|
||||||
.map(
|
.map(
|
||||||
(productQuantity) => OrderItemRequest(
|
(productQuantity) => OrderItemRequest(
|
||||||
@ -86,6 +88,7 @@ class OrderFormBloc extends Bloc<OrderFormEvent, OrderFormState> {
|
|||||||
quantity: productQuantity.quantity,
|
quantity: productQuantity.quantity,
|
||||||
notes: productQuantity.notes,
|
notes: productQuantity.notes,
|
||||||
unitPrice: productQuantity.product.price,
|
unitPrice: productQuantity.product.price,
|
||||||
|
productVariantId: productQuantity.variant?.id,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
@ -114,11 +117,15 @@ class OrderFormBloc extends Bloc<OrderFormEvent, OrderFormState> {
|
|||||||
final result = await _orderRemoteDatasource.addToOrder(
|
final result = await _orderRemoteDatasource.addToOrder(
|
||||||
orderId: event.orderId,
|
orderId: event.orderId,
|
||||||
orderItems: event.items
|
orderItems: event.items
|
||||||
.map((item) => OrderItemRequest(
|
.map(
|
||||||
|
(item) => OrderItemRequest(
|
||||||
productId: item.product.id,
|
productId: item.product.id,
|
||||||
quantity: item.quantity,
|
quantity: item.quantity,
|
||||||
unitPrice: item.product.price,
|
unitPrice: item.product.price,
|
||||||
notes: item.notes))
|
notes: item.notes,
|
||||||
|
productVariantId: item.variant?.id,
|
||||||
|
),
|
||||||
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -20,10 +20,15 @@ mixin _$OrderFormEvent {
|
|||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(Order order) started,
|
required TResult Function(Order order) started,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)
|
Customer? customer, OrderType orderType, TableModel table)
|
||||||
create,
|
create,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||||
addToOrder,
|
addToOrder,
|
||||||
@ -41,10 +46,15 @@ mixin _$OrderFormEvent {
|
|||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(Order order)? started,
|
TResult? Function(Order order)? started,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -59,10 +69,15 @@ mixin _$OrderFormEvent {
|
|||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(Order order)? started,
|
TResult Function(Order order)? started,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -204,10 +219,15 @@ class _$StartedImpl implements _Started {
|
|||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(Order order) started,
|
required TResult Function(Order order) started,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)
|
Customer? customer, OrderType orderType, TableModel table)
|
||||||
create,
|
create,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||||
addToOrder,
|
addToOrder,
|
||||||
@ -228,10 +248,15 @@ class _$StartedImpl implements _Started {
|
|||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(Order order)? started,
|
TResult? Function(Order order)? started,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -249,10 +274,15 @@ class _$StartedImpl implements _Started {
|
|||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(Order order)? started,
|
TResult Function(Order order)? started,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -340,6 +370,7 @@ abstract class _$$CreateImplCopyWith<$Res> {
|
|||||||
$Res call(
|
$Res call(
|
||||||
{List<ProductQuantity> items,
|
{List<ProductQuantity> items,
|
||||||
String customerName,
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
OrderType orderType,
|
OrderType orderType,
|
||||||
TableModel table});
|
TableModel table});
|
||||||
}
|
}
|
||||||
@ -359,6 +390,7 @@ class __$$CreateImplCopyWithImpl<$Res>
|
|||||||
$Res call({
|
$Res call({
|
||||||
Object? items = null,
|
Object? items = null,
|
||||||
Object? customerName = null,
|
Object? customerName = null,
|
||||||
|
Object? customer = freezed,
|
||||||
Object? orderType = null,
|
Object? orderType = null,
|
||||||
Object? table = null,
|
Object? table = null,
|
||||||
}) {
|
}) {
|
||||||
@ -371,6 +403,10 @@ class __$$CreateImplCopyWithImpl<$Res>
|
|||||||
? _value.customerName
|
? _value.customerName
|
||||||
: customerName // ignore: cast_nullable_to_non_nullable
|
: customerName // ignore: cast_nullable_to_non_nullable
|
||||||
as String,
|
as String,
|
||||||
|
customer: freezed == customer
|
||||||
|
? _value.customer
|
||||||
|
: customer // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Customer?,
|
||||||
orderType: null == orderType
|
orderType: null == orderType
|
||||||
? _value.orderType
|
? _value.orderType
|
||||||
: orderType // ignore: cast_nullable_to_non_nullable
|
: orderType // ignore: cast_nullable_to_non_nullable
|
||||||
@ -389,6 +425,7 @@ class _$CreateImpl implements _Create {
|
|||||||
const _$CreateImpl(
|
const _$CreateImpl(
|
||||||
{required final List<ProductQuantity> items,
|
{required final List<ProductQuantity> items,
|
||||||
required this.customerName,
|
required this.customerName,
|
||||||
|
required this.customer,
|
||||||
required this.orderType,
|
required this.orderType,
|
||||||
required this.table})
|
required this.table})
|
||||||
: _items = items;
|
: _items = items;
|
||||||
@ -404,13 +441,15 @@ class _$CreateImpl implements _Create {
|
|||||||
@override
|
@override
|
||||||
final String customerName;
|
final String customerName;
|
||||||
@override
|
@override
|
||||||
|
final Customer? customer;
|
||||||
|
@override
|
||||||
final OrderType orderType;
|
final OrderType orderType;
|
||||||
@override
|
@override
|
||||||
final TableModel table;
|
final TableModel table;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'OrderFormEvent.create(items: $items, customerName: $customerName, orderType: $orderType, table: $table)';
|
return 'OrderFormEvent.create(items: $items, customerName: $customerName, customer: $customer, orderType: $orderType, table: $table)';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -421,6 +460,8 @@ class _$CreateImpl implements _Create {
|
|||||||
const DeepCollectionEquality().equals(other._items, _items) &&
|
const DeepCollectionEquality().equals(other._items, _items) &&
|
||||||
(identical(other.customerName, customerName) ||
|
(identical(other.customerName, customerName) ||
|
||||||
other.customerName == customerName) &&
|
other.customerName == customerName) &&
|
||||||
|
(identical(other.customer, customer) ||
|
||||||
|
other.customer == customer) &&
|
||||||
(identical(other.orderType, orderType) ||
|
(identical(other.orderType, orderType) ||
|
||||||
other.orderType == orderType) &&
|
other.orderType == orderType) &&
|
||||||
(identical(other.table, table) || other.table == table));
|
(identical(other.table, table) || other.table == table));
|
||||||
@ -431,6 +472,7 @@ class _$CreateImpl implements _Create {
|
|||||||
runtimeType,
|
runtimeType,
|
||||||
const DeepCollectionEquality().hash(_items),
|
const DeepCollectionEquality().hash(_items),
|
||||||
customerName,
|
customerName,
|
||||||
|
customer,
|
||||||
orderType,
|
orderType,
|
||||||
table);
|
table);
|
||||||
|
|
||||||
@ -447,10 +489,15 @@ class _$CreateImpl implements _Create {
|
|||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(Order order) started,
|
required TResult Function(Order order) started,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)
|
Customer? customer, OrderType orderType, TableModel table)
|
||||||
create,
|
create,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||||
addToOrder,
|
addToOrder,
|
||||||
@ -463,7 +510,7 @@ class _$CreateImpl implements _Create {
|
|||||||
required TResult Function(OrderItem item) toggleItem,
|
required TResult Function(OrderItem item) toggleItem,
|
||||||
required TResult Function(bool selectAll) toggleSelectAll,
|
required TResult Function(bool selectAll) toggleSelectAll,
|
||||||
}) {
|
}) {
|
||||||
return create(items, customerName, orderType, table);
|
return create(items, customerName, customer, orderType, table);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -471,10 +518,15 @@ class _$CreateImpl implements _Create {
|
|||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(Order order)? started,
|
TResult? Function(Order order)? started,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -484,7 +536,7 @@ class _$CreateImpl implements _Create {
|
|||||||
TResult? Function(OrderItem item)? toggleItem,
|
TResult? Function(OrderItem item)? toggleItem,
|
||||||
TResult? Function(bool selectAll)? toggleSelectAll,
|
TResult? Function(bool selectAll)? toggleSelectAll,
|
||||||
}) {
|
}) {
|
||||||
return create?.call(items, customerName, orderType, table);
|
return create?.call(items, customerName, customer, orderType, table);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -492,10 +544,15 @@ class _$CreateImpl implements _Create {
|
|||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(Order order)? started,
|
TResult Function(Order order)? started,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -507,7 +564,7 @@ class _$CreateImpl implements _Create {
|
|||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (create != null) {
|
if (create != null) {
|
||||||
return create(items, customerName, orderType, table);
|
return create(items, customerName, customer, orderType, table);
|
||||||
}
|
}
|
||||||
return orElse();
|
return orElse();
|
||||||
}
|
}
|
||||||
@ -566,11 +623,13 @@ abstract class _Create implements OrderFormEvent {
|
|||||||
const factory _Create(
|
const factory _Create(
|
||||||
{required final List<ProductQuantity> items,
|
{required final List<ProductQuantity> items,
|
||||||
required final String customerName,
|
required final String customerName,
|
||||||
|
required final Customer? customer,
|
||||||
required final OrderType orderType,
|
required final OrderType orderType,
|
||||||
required final TableModel table}) = _$CreateImpl;
|
required final TableModel table}) = _$CreateImpl;
|
||||||
|
|
||||||
List<ProductQuantity> get items;
|
List<ProductQuantity> get items;
|
||||||
String get customerName;
|
String get customerName;
|
||||||
|
Customer? get customer;
|
||||||
OrderType get orderType;
|
OrderType get orderType;
|
||||||
TableModel get table;
|
TableModel get table;
|
||||||
|
|
||||||
@ -591,6 +650,7 @@ abstract class _$$CreateWithPaymentMethodImplCopyWith<$Res> {
|
|||||||
$Res call(
|
$Res call(
|
||||||
{List<ProductQuantity> items,
|
{List<ProductQuantity> items,
|
||||||
String customerName,
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
OrderType orderType,
|
OrderType orderType,
|
||||||
TableModel table,
|
TableModel table,
|
||||||
PaymentMethod paymentMethod});
|
PaymentMethod paymentMethod});
|
||||||
@ -612,6 +672,7 @@ class __$$CreateWithPaymentMethodImplCopyWithImpl<$Res>
|
|||||||
$Res call({
|
$Res call({
|
||||||
Object? items = null,
|
Object? items = null,
|
||||||
Object? customerName = null,
|
Object? customerName = null,
|
||||||
|
Object? customer = freezed,
|
||||||
Object? orderType = null,
|
Object? orderType = null,
|
||||||
Object? table = null,
|
Object? table = null,
|
||||||
Object? paymentMethod = null,
|
Object? paymentMethod = null,
|
||||||
@ -625,6 +686,10 @@ class __$$CreateWithPaymentMethodImplCopyWithImpl<$Res>
|
|||||||
? _value.customerName
|
? _value.customerName
|
||||||
: customerName // ignore: cast_nullable_to_non_nullable
|
: customerName // ignore: cast_nullable_to_non_nullable
|
||||||
as String,
|
as String,
|
||||||
|
customer: freezed == customer
|
||||||
|
? _value.customer
|
||||||
|
: customer // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Customer?,
|
||||||
orderType: null == orderType
|
orderType: null == orderType
|
||||||
? _value.orderType
|
? _value.orderType
|
||||||
: orderType // ignore: cast_nullable_to_non_nullable
|
: orderType // ignore: cast_nullable_to_non_nullable
|
||||||
@ -647,6 +712,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
|||||||
const _$CreateWithPaymentMethodImpl(
|
const _$CreateWithPaymentMethodImpl(
|
||||||
{required final List<ProductQuantity> items,
|
{required final List<ProductQuantity> items,
|
||||||
required this.customerName,
|
required this.customerName,
|
||||||
|
required this.customer,
|
||||||
required this.orderType,
|
required this.orderType,
|
||||||
required this.table,
|
required this.table,
|
||||||
required this.paymentMethod})
|
required this.paymentMethod})
|
||||||
@ -663,6 +729,8 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
|||||||
@override
|
@override
|
||||||
final String customerName;
|
final String customerName;
|
||||||
@override
|
@override
|
||||||
|
final Customer? customer;
|
||||||
|
@override
|
||||||
final OrderType orderType;
|
final OrderType orderType;
|
||||||
@override
|
@override
|
||||||
final TableModel table;
|
final TableModel table;
|
||||||
@ -671,7 +739,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'OrderFormEvent.createWithPayment(items: $items, customerName: $customerName, orderType: $orderType, table: $table, paymentMethod: $paymentMethod)';
|
return 'OrderFormEvent.createWithPayment(items: $items, customerName: $customerName, customer: $customer, orderType: $orderType, table: $table, paymentMethod: $paymentMethod)';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -682,6 +750,8 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
|||||||
const DeepCollectionEquality().equals(other._items, _items) &&
|
const DeepCollectionEquality().equals(other._items, _items) &&
|
||||||
(identical(other.customerName, customerName) ||
|
(identical(other.customerName, customerName) ||
|
||||||
other.customerName == customerName) &&
|
other.customerName == customerName) &&
|
||||||
|
(identical(other.customer, customer) ||
|
||||||
|
other.customer == customer) &&
|
||||||
(identical(other.orderType, orderType) ||
|
(identical(other.orderType, orderType) ||
|
||||||
other.orderType == orderType) &&
|
other.orderType == orderType) &&
|
||||||
(identical(other.table, table) || other.table == table) &&
|
(identical(other.table, table) || other.table == table) &&
|
||||||
@ -694,6 +764,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
|||||||
runtimeType,
|
runtimeType,
|
||||||
const DeepCollectionEquality().hash(_items),
|
const DeepCollectionEquality().hash(_items),
|
||||||
customerName,
|
customerName,
|
||||||
|
customer,
|
||||||
orderType,
|
orderType,
|
||||||
table,
|
table,
|
||||||
paymentMethod);
|
paymentMethod);
|
||||||
@ -712,10 +783,15 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
|||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(Order order) started,
|
required TResult Function(Order order) started,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)
|
Customer? customer, OrderType orderType, TableModel table)
|
||||||
create,
|
create,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||||
addToOrder,
|
addToOrder,
|
||||||
@ -729,7 +805,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
|||||||
required TResult Function(bool selectAll) toggleSelectAll,
|
required TResult Function(bool selectAll) toggleSelectAll,
|
||||||
}) {
|
}) {
|
||||||
return createWithPayment(
|
return createWithPayment(
|
||||||
items, customerName, orderType, table, paymentMethod);
|
items, customerName, customer, orderType, table, paymentMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -737,10 +813,15 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
|||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(Order order)? started,
|
TResult? Function(Order order)? started,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -751,7 +832,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
|||||||
TResult? Function(bool selectAll)? toggleSelectAll,
|
TResult? Function(bool selectAll)? toggleSelectAll,
|
||||||
}) {
|
}) {
|
||||||
return createWithPayment?.call(
|
return createWithPayment?.call(
|
||||||
items, customerName, orderType, table, paymentMethod);
|
items, customerName, customer, orderType, table, paymentMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -759,10 +840,15 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
|||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(Order order)? started,
|
TResult Function(Order order)? started,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -775,7 +861,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
|||||||
}) {
|
}) {
|
||||||
if (createWithPayment != null) {
|
if (createWithPayment != null) {
|
||||||
return createWithPayment(
|
return createWithPayment(
|
||||||
items, customerName, orderType, table, paymentMethod);
|
items, customerName, customer, orderType, table, paymentMethod);
|
||||||
}
|
}
|
||||||
return orElse();
|
return orElse();
|
||||||
}
|
}
|
||||||
@ -834,6 +920,7 @@ abstract class _CreateWithPaymentMethod implements OrderFormEvent {
|
|||||||
const factory _CreateWithPaymentMethod(
|
const factory _CreateWithPaymentMethod(
|
||||||
{required final List<ProductQuantity> items,
|
{required final List<ProductQuantity> items,
|
||||||
required final String customerName,
|
required final String customerName,
|
||||||
|
required final Customer? customer,
|
||||||
required final OrderType orderType,
|
required final OrderType orderType,
|
||||||
required final TableModel table,
|
required final TableModel table,
|
||||||
required final PaymentMethod paymentMethod}) =
|
required final PaymentMethod paymentMethod}) =
|
||||||
@ -841,6 +928,7 @@ abstract class _CreateWithPaymentMethod implements OrderFormEvent {
|
|||||||
|
|
||||||
List<ProductQuantity> get items;
|
List<ProductQuantity> get items;
|
||||||
String get customerName;
|
String get customerName;
|
||||||
|
Customer? get customer;
|
||||||
OrderType get orderType;
|
OrderType get orderType;
|
||||||
TableModel get table;
|
TableModel get table;
|
||||||
PaymentMethod get paymentMethod;
|
PaymentMethod get paymentMethod;
|
||||||
@ -939,10 +1027,15 @@ class _$AddToOrderImpl implements _AddToOrder {
|
|||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(Order order) started,
|
required TResult Function(Order order) started,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)
|
Customer? customer, OrderType orderType, TableModel table)
|
||||||
create,
|
create,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||||
addToOrder,
|
addToOrder,
|
||||||
@ -963,10 +1056,15 @@ class _$AddToOrderImpl implements _AddToOrder {
|
|||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(Order order)? started,
|
TResult? Function(Order order)? started,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -984,10 +1082,15 @@ class _$AddToOrderImpl implements _AddToOrder {
|
|||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(Order order)? started,
|
TResult Function(Order order)? started,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -1166,10 +1269,15 @@ class _$RefundImpl implements _Refund {
|
|||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(Order order) started,
|
required TResult Function(Order order) started,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)
|
Customer? customer, OrderType orderType, TableModel table)
|
||||||
create,
|
create,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||||
addToOrder,
|
addToOrder,
|
||||||
@ -1190,10 +1298,15 @@ class _$RefundImpl implements _Refund {
|
|||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(Order order)? started,
|
TResult? Function(Order order)? started,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -1211,10 +1324,15 @@ class _$RefundImpl implements _Refund {
|
|||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(Order order)? started,
|
TResult Function(Order order)? started,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -1395,10 +1513,15 @@ class _$VoidOrderImpl implements _VoidOrder {
|
|||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(Order order) started,
|
required TResult Function(Order order) started,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)
|
Customer? customer, OrderType orderType, TableModel table)
|
||||||
create,
|
create,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||||
addToOrder,
|
addToOrder,
|
||||||
@ -1419,10 +1542,15 @@ class _$VoidOrderImpl implements _VoidOrder {
|
|||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(Order order)? started,
|
TResult? Function(Order order)? started,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -1440,10 +1568,15 @@ class _$VoidOrderImpl implements _VoidOrder {
|
|||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(Order order)? started,
|
TResult Function(Order order)? started,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -1597,10 +1730,15 @@ class _$ToggleItemImpl implements _ToggleItem {
|
|||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(Order order) started,
|
required TResult Function(Order order) started,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)
|
Customer? customer, OrderType orderType, TableModel table)
|
||||||
create,
|
create,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||||
addToOrder,
|
addToOrder,
|
||||||
@ -1621,10 +1759,15 @@ class _$ToggleItemImpl implements _ToggleItem {
|
|||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(Order order)? started,
|
TResult? Function(Order order)? started,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -1642,10 +1785,15 @@ class _$ToggleItemImpl implements _ToggleItem {
|
|||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(Order order)? started,
|
TResult Function(Order order)? started,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -1796,10 +1944,15 @@ class _$ToggleSelectAllImpl implements _ToggleSelectAll {
|
|||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(Order order) started,
|
required TResult Function(Order order) started,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)
|
Customer? customer, OrderType orderType, TableModel table)
|
||||||
create,
|
create,
|
||||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
required TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||||
addToOrder,
|
addToOrder,
|
||||||
@ -1820,10 +1973,15 @@ class _$ToggleSelectAllImpl implements _ToggleSelectAll {
|
|||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(Order order)? started,
|
TResult? Function(Order order)? started,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
TResult? Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
@ -1841,10 +1999,15 @@ class _$ToggleSelectAllImpl implements _ToggleSelectAll {
|
|||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(Order order)? started,
|
TResult Function(Order order)? started,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(List<ProductQuantity> items, String customerName,
|
||||||
OrderType orderType, TableModel table)?
|
Customer? customer, OrderType orderType, TableModel table)?
|
||||||
create,
|
create,
|
||||||
TResult Function(List<ProductQuantity> items, String customerName,
|
TResult Function(
|
||||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
List<ProductQuantity> items,
|
||||||
|
String customerName,
|
||||||
|
Customer? customer,
|
||||||
|
OrderType orderType,
|
||||||
|
TableModel table,
|
||||||
|
PaymentMethod paymentMethod)?
|
||||||
createWithPayment,
|
createWithPayment,
|
||||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||||
|
|||||||
@ -6,12 +6,14 @@ class OrderFormEvent with _$OrderFormEvent {
|
|||||||
const factory OrderFormEvent.create({
|
const factory OrderFormEvent.create({
|
||||||
required List<ProductQuantity> items,
|
required List<ProductQuantity> items,
|
||||||
required String customerName,
|
required String customerName,
|
||||||
|
required Customer? customer,
|
||||||
required OrderType orderType,
|
required OrderType orderType,
|
||||||
required TableModel table,
|
required TableModel table,
|
||||||
}) = _Create;
|
}) = _Create;
|
||||||
const factory OrderFormEvent.createWithPayment({
|
const factory OrderFormEvent.createWithPayment({
|
||||||
required List<ProductQuantity> items,
|
required List<ProductQuantity> items,
|
||||||
required String customerName,
|
required String customerName,
|
||||||
|
required Customer? customer,
|
||||||
required OrderType orderType,
|
required OrderType orderType,
|
||||||
required TableModel table,
|
required TableModel table,
|
||||||
required PaymentMethod paymentMethod,
|
required PaymentMethod paymentMethod,
|
||||||
|
|||||||
@ -19,13 +19,5 @@ class OutletLoaderBloc extends Bloc<OutletLoaderEvent, OutletLoaderState> {
|
|||||||
(r) => emit(_Loaded(r.data?.outlets ?? [])),
|
(r) => emit(_Loaded(r.data?.outlets ?? [])),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
on<_CurrentOutlet>((event, emit) async {
|
|
||||||
emit(const _LoadingDetail());
|
|
||||||
final result = await _outletRemoteDataSource.currentOutlet();
|
|
||||||
result.fold(
|
|
||||||
(l) => emit(_ErrorDetail(l)),
|
|
||||||
(r) => emit(_LoadedDetail(r.data!)),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,38 +19,32 @@ mixin _$OutletLoaderEvent {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() getOutlet,
|
required TResult Function() getOutlet,
|
||||||
required TResult Function() currentOutlet,
|
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? getOutlet,
|
TResult? Function()? getOutlet,
|
||||||
TResult? Function()? currentOutlet,
|
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? getOutlet,
|
TResult Function()? getOutlet,
|
||||||
TResult Function()? currentOutlet,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult map<TResult extends Object?>({
|
TResult map<TResult extends Object?>({
|
||||||
required TResult Function(_GetOutlet value) getOutlet,
|
required TResult Function(_GetOutlet value) getOutlet,
|
||||||
required TResult Function(_CurrentOutlet value) currentOutlet,
|
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? mapOrNull<TResult extends Object?>({
|
TResult? mapOrNull<TResult extends Object?>({
|
||||||
TResult? Function(_GetOutlet value)? getOutlet,
|
TResult? Function(_GetOutlet value)? getOutlet,
|
||||||
TResult? Function(_CurrentOutlet value)? currentOutlet,
|
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeMap<TResult extends Object?>({
|
TResult maybeMap<TResult extends Object?>({
|
||||||
TResult Function(_GetOutlet value)? getOutlet,
|
TResult Function(_GetOutlet value)? getOutlet,
|
||||||
TResult Function(_CurrentOutlet value)? currentOutlet,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@ -119,7 +113,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function() getOutlet,
|
required TResult Function() getOutlet,
|
||||||
required TResult Function() currentOutlet,
|
|
||||||
}) {
|
}) {
|
||||||
return getOutlet();
|
return getOutlet();
|
||||||
}
|
}
|
||||||
@ -128,7 +121,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function()? getOutlet,
|
TResult? Function()? getOutlet,
|
||||||
TResult? Function()? currentOutlet,
|
|
||||||
}) {
|
}) {
|
||||||
return getOutlet?.call();
|
return getOutlet?.call();
|
||||||
}
|
}
|
||||||
@ -137,7 +129,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function()? getOutlet,
|
TResult Function()? getOutlet,
|
||||||
TResult Function()? currentOutlet,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (getOutlet != null) {
|
if (getOutlet != null) {
|
||||||
@ -150,7 +141,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult map<TResult extends Object?>({
|
TResult map<TResult extends Object?>({
|
||||||
required TResult Function(_GetOutlet value) getOutlet,
|
required TResult Function(_GetOutlet value) getOutlet,
|
||||||
required TResult Function(_CurrentOutlet value) currentOutlet,
|
|
||||||
}) {
|
}) {
|
||||||
return getOutlet(this);
|
return getOutlet(this);
|
||||||
}
|
}
|
||||||
@ -159,7 +149,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? mapOrNull<TResult extends Object?>({
|
TResult? mapOrNull<TResult extends Object?>({
|
||||||
TResult? Function(_GetOutlet value)? getOutlet,
|
TResult? Function(_GetOutlet value)? getOutlet,
|
||||||
TResult? Function(_CurrentOutlet value)? currentOutlet,
|
|
||||||
}) {
|
}) {
|
||||||
return getOutlet?.call(this);
|
return getOutlet?.call(this);
|
||||||
}
|
}
|
||||||
@ -168,7 +157,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
|||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeMap<TResult extends Object?>({
|
TResult maybeMap<TResult extends Object?>({
|
||||||
TResult Function(_GetOutlet value)? getOutlet,
|
TResult Function(_GetOutlet value)? getOutlet,
|
||||||
TResult Function(_CurrentOutlet value)? currentOutlet,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (getOutlet != null) {
|
if (getOutlet != null) {
|
||||||
@ -182,111 +170,6 @@ abstract class _GetOutlet implements OutletLoaderEvent {
|
|||||||
const factory _GetOutlet() = _$GetOutletImpl;
|
const factory _GetOutlet() = _$GetOutletImpl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$CurrentOutletImplCopyWith<$Res> {
|
|
||||||
factory _$$CurrentOutletImplCopyWith(
|
|
||||||
_$CurrentOutletImpl value, $Res Function(_$CurrentOutletImpl) then) =
|
|
||||||
__$$CurrentOutletImplCopyWithImpl<$Res>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$CurrentOutletImplCopyWithImpl<$Res>
|
|
||||||
extends _$OutletLoaderEventCopyWithImpl<$Res, _$CurrentOutletImpl>
|
|
||||||
implements _$$CurrentOutletImplCopyWith<$Res> {
|
|
||||||
__$$CurrentOutletImplCopyWithImpl(
|
|
||||||
_$CurrentOutletImpl _value, $Res Function(_$CurrentOutletImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of OutletLoaderEvent
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
|
|
||||||
class _$CurrentOutletImpl implements _CurrentOutlet {
|
|
||||||
const _$CurrentOutletImpl();
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'OutletLoaderEvent.currentOutlet()';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType && other is _$CurrentOutletImpl);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode => runtimeType.hashCode;
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult when<TResult extends Object?>({
|
|
||||||
required TResult Function() getOutlet,
|
|
||||||
required TResult Function() currentOutlet,
|
|
||||||
}) {
|
|
||||||
return currentOutlet();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
|
||||||
TResult? Function()? getOutlet,
|
|
||||||
TResult? Function()? currentOutlet,
|
|
||||||
}) {
|
|
||||||
return currentOutlet?.call();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
|
||||||
TResult Function()? getOutlet,
|
|
||||||
TResult Function()? currentOutlet,
|
|
||||||
required TResult orElse(),
|
|
||||||
}) {
|
|
||||||
if (currentOutlet != null) {
|
|
||||||
return currentOutlet();
|
|
||||||
}
|
|
||||||
return orElse();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult map<TResult extends Object?>({
|
|
||||||
required TResult Function(_GetOutlet value) getOutlet,
|
|
||||||
required TResult Function(_CurrentOutlet value) currentOutlet,
|
|
||||||
}) {
|
|
||||||
return currentOutlet(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult? mapOrNull<TResult extends Object?>({
|
|
||||||
TResult? Function(_GetOutlet value)? getOutlet,
|
|
||||||
TResult? Function(_CurrentOutlet value)? currentOutlet,
|
|
||||||
}) {
|
|
||||||
return currentOutlet?.call(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult maybeMap<TResult extends Object?>({
|
|
||||||
TResult Function(_GetOutlet value)? getOutlet,
|
|
||||||
TResult Function(_CurrentOutlet value)? currentOutlet,
|
|
||||||
required TResult orElse(),
|
|
||||||
}) {
|
|
||||||
if (currentOutlet != null) {
|
|
||||||
return currentOutlet(this);
|
|
||||||
}
|
|
||||||
return orElse();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _CurrentOutlet implements OutletLoaderEvent {
|
|
||||||
const factory _CurrentOutlet() = _$CurrentOutletImpl;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$OutletLoaderState {
|
mixin _$OutletLoaderState {
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -295,9 +178,6 @@ mixin _$OutletLoaderState {
|
|||||||
required TResult Function() loading,
|
required TResult Function() loading,
|
||||||
required TResult Function(List<Outlet> outlets) loaded,
|
required TResult Function(List<Outlet> outlets) loaded,
|
||||||
required TResult Function(String message) error,
|
required TResult Function(String message) error,
|
||||||
required TResult Function() loadingDetail,
|
|
||||||
required TResult Function(Outlet outlet) loadedDetail,
|
|
||||||
required TResult Function(String message) errorDetail,
|
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -306,9 +186,6 @@ mixin _$OutletLoaderState {
|
|||||||
TResult? Function()? loading,
|
TResult? Function()? loading,
|
||||||
TResult? Function(List<Outlet> outlets)? loaded,
|
TResult? Function(List<Outlet> outlets)? loaded,
|
||||||
TResult? Function(String message)? error,
|
TResult? Function(String message)? error,
|
||||||
TResult? Function()? loadingDetail,
|
|
||||||
TResult? Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult? Function(String message)? errorDetail,
|
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -317,9 +194,6 @@ mixin _$OutletLoaderState {
|
|||||||
TResult Function()? loading,
|
TResult Function()? loading,
|
||||||
TResult Function(List<Outlet> outlets)? loaded,
|
TResult Function(List<Outlet> outlets)? loaded,
|
||||||
TResult Function(String message)? error,
|
TResult Function(String message)? error,
|
||||||
TResult Function()? loadingDetail,
|
|
||||||
TResult Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult Function(String message)? errorDetail,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@ -329,9 +203,6 @@ mixin _$OutletLoaderState {
|
|||||||
required TResult Function(_Loading value) loading,
|
required TResult Function(_Loading value) loading,
|
||||||
required TResult Function(_Loaded value) loaded,
|
required TResult Function(_Loaded value) loaded,
|
||||||
required TResult Function(_Error value) error,
|
required TResult Function(_Error value) error,
|
||||||
required TResult Function(_LoadingDetail value) loadingDetail,
|
|
||||||
required TResult Function(_LoadedDetail value) loadedDetail,
|
|
||||||
required TResult Function(_ErrorDetail value) errorDetail,
|
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -340,9 +211,6 @@ mixin _$OutletLoaderState {
|
|||||||
TResult? Function(_Loading value)? loading,
|
TResult? Function(_Loading value)? loading,
|
||||||
TResult? Function(_Loaded value)? loaded,
|
TResult? Function(_Loaded value)? loaded,
|
||||||
TResult? Function(_Error value)? error,
|
TResult? Function(_Error value)? error,
|
||||||
TResult? Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult? Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult? Function(_ErrorDetail value)? errorDetail,
|
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -351,9 +219,6 @@ mixin _$OutletLoaderState {
|
|||||||
TResult Function(_Loading value)? loading,
|
TResult Function(_Loading value)? loading,
|
||||||
TResult Function(_Loaded value)? loaded,
|
TResult Function(_Loaded value)? loaded,
|
||||||
TResult Function(_Error value)? error,
|
TResult Function(_Error value)? error,
|
||||||
TResult Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult Function(_ErrorDetail value)? errorDetail,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) =>
|
}) =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@ -425,9 +290,6 @@ class _$InitialImpl implements _Initial {
|
|||||||
required TResult Function() loading,
|
required TResult Function() loading,
|
||||||
required TResult Function(List<Outlet> outlets) loaded,
|
required TResult Function(List<Outlet> outlets) loaded,
|
||||||
required TResult Function(String message) error,
|
required TResult Function(String message) error,
|
||||||
required TResult Function() loadingDetail,
|
|
||||||
required TResult Function(Outlet outlet) loadedDetail,
|
|
||||||
required TResult Function(String message) errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return initial();
|
return initial();
|
||||||
}
|
}
|
||||||
@ -439,9 +301,6 @@ class _$InitialImpl implements _Initial {
|
|||||||
TResult? Function()? loading,
|
TResult? Function()? loading,
|
||||||
TResult? Function(List<Outlet> outlets)? loaded,
|
TResult? Function(List<Outlet> outlets)? loaded,
|
||||||
TResult? Function(String message)? error,
|
TResult? Function(String message)? error,
|
||||||
TResult? Function()? loadingDetail,
|
|
||||||
TResult? Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult? Function(String message)? errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return initial?.call();
|
return initial?.call();
|
||||||
}
|
}
|
||||||
@ -453,9 +312,6 @@ class _$InitialImpl implements _Initial {
|
|||||||
TResult Function()? loading,
|
TResult Function()? loading,
|
||||||
TResult Function(List<Outlet> outlets)? loaded,
|
TResult Function(List<Outlet> outlets)? loaded,
|
||||||
TResult Function(String message)? error,
|
TResult Function(String message)? error,
|
||||||
TResult Function()? loadingDetail,
|
|
||||||
TResult Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult Function(String message)? errorDetail,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (initial != null) {
|
if (initial != null) {
|
||||||
@ -471,9 +327,6 @@ class _$InitialImpl implements _Initial {
|
|||||||
required TResult Function(_Loading value) loading,
|
required TResult Function(_Loading value) loading,
|
||||||
required TResult Function(_Loaded value) loaded,
|
required TResult Function(_Loaded value) loaded,
|
||||||
required TResult Function(_Error value) error,
|
required TResult Function(_Error value) error,
|
||||||
required TResult Function(_LoadingDetail value) loadingDetail,
|
|
||||||
required TResult Function(_LoadedDetail value) loadedDetail,
|
|
||||||
required TResult Function(_ErrorDetail value) errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return initial(this);
|
return initial(this);
|
||||||
}
|
}
|
||||||
@ -485,9 +338,6 @@ class _$InitialImpl implements _Initial {
|
|||||||
TResult? Function(_Loading value)? loading,
|
TResult? Function(_Loading value)? loading,
|
||||||
TResult? Function(_Loaded value)? loaded,
|
TResult? Function(_Loaded value)? loaded,
|
||||||
TResult? Function(_Error value)? error,
|
TResult? Function(_Error value)? error,
|
||||||
TResult? Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult? Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult? Function(_ErrorDetail value)? errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return initial?.call(this);
|
return initial?.call(this);
|
||||||
}
|
}
|
||||||
@ -499,9 +349,6 @@ class _$InitialImpl implements _Initial {
|
|||||||
TResult Function(_Loading value)? loading,
|
TResult Function(_Loading value)? loading,
|
||||||
TResult Function(_Loaded value)? loaded,
|
TResult Function(_Loaded value)? loaded,
|
||||||
TResult Function(_Error value)? error,
|
TResult Function(_Error value)? error,
|
||||||
TResult Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult Function(_ErrorDetail value)? errorDetail,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (initial != null) {
|
if (initial != null) {
|
||||||
@ -560,9 +407,6 @@ class _$LoadingImpl implements _Loading {
|
|||||||
required TResult Function() loading,
|
required TResult Function() loading,
|
||||||
required TResult Function(List<Outlet> outlets) loaded,
|
required TResult Function(List<Outlet> outlets) loaded,
|
||||||
required TResult Function(String message) error,
|
required TResult Function(String message) error,
|
||||||
required TResult Function() loadingDetail,
|
|
||||||
required TResult Function(Outlet outlet) loadedDetail,
|
|
||||||
required TResult Function(String message) errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return loading();
|
return loading();
|
||||||
}
|
}
|
||||||
@ -574,9 +418,6 @@ class _$LoadingImpl implements _Loading {
|
|||||||
TResult? Function()? loading,
|
TResult? Function()? loading,
|
||||||
TResult? Function(List<Outlet> outlets)? loaded,
|
TResult? Function(List<Outlet> outlets)? loaded,
|
||||||
TResult? Function(String message)? error,
|
TResult? Function(String message)? error,
|
||||||
TResult? Function()? loadingDetail,
|
|
||||||
TResult? Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult? Function(String message)? errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return loading?.call();
|
return loading?.call();
|
||||||
}
|
}
|
||||||
@ -588,9 +429,6 @@ class _$LoadingImpl implements _Loading {
|
|||||||
TResult Function()? loading,
|
TResult Function()? loading,
|
||||||
TResult Function(List<Outlet> outlets)? loaded,
|
TResult Function(List<Outlet> outlets)? loaded,
|
||||||
TResult Function(String message)? error,
|
TResult Function(String message)? error,
|
||||||
TResult Function()? loadingDetail,
|
|
||||||
TResult Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult Function(String message)? errorDetail,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (loading != null) {
|
if (loading != null) {
|
||||||
@ -606,9 +444,6 @@ class _$LoadingImpl implements _Loading {
|
|||||||
required TResult Function(_Loading value) loading,
|
required TResult Function(_Loading value) loading,
|
||||||
required TResult Function(_Loaded value) loaded,
|
required TResult Function(_Loaded value) loaded,
|
||||||
required TResult Function(_Error value) error,
|
required TResult Function(_Error value) error,
|
||||||
required TResult Function(_LoadingDetail value) loadingDetail,
|
|
||||||
required TResult Function(_LoadedDetail value) loadedDetail,
|
|
||||||
required TResult Function(_ErrorDetail value) errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return loading(this);
|
return loading(this);
|
||||||
}
|
}
|
||||||
@ -620,9 +455,6 @@ class _$LoadingImpl implements _Loading {
|
|||||||
TResult? Function(_Loading value)? loading,
|
TResult? Function(_Loading value)? loading,
|
||||||
TResult? Function(_Loaded value)? loaded,
|
TResult? Function(_Loaded value)? loaded,
|
||||||
TResult? Function(_Error value)? error,
|
TResult? Function(_Error value)? error,
|
||||||
TResult? Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult? Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult? Function(_ErrorDetail value)? errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return loading?.call(this);
|
return loading?.call(this);
|
||||||
}
|
}
|
||||||
@ -634,9 +466,6 @@ class _$LoadingImpl implements _Loading {
|
|||||||
TResult Function(_Loading value)? loading,
|
TResult Function(_Loading value)? loading,
|
||||||
TResult Function(_Loaded value)? loaded,
|
TResult Function(_Loaded value)? loaded,
|
||||||
TResult Function(_Error value)? error,
|
TResult Function(_Error value)? error,
|
||||||
TResult Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult Function(_ErrorDetail value)? errorDetail,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (loading != null) {
|
if (loading != null) {
|
||||||
@ -728,9 +557,6 @@ class _$LoadedImpl implements _Loaded {
|
|||||||
required TResult Function() loading,
|
required TResult Function() loading,
|
||||||
required TResult Function(List<Outlet> outlets) loaded,
|
required TResult Function(List<Outlet> outlets) loaded,
|
||||||
required TResult Function(String message) error,
|
required TResult Function(String message) error,
|
||||||
required TResult Function() loadingDetail,
|
|
||||||
required TResult Function(Outlet outlet) loadedDetail,
|
|
||||||
required TResult Function(String message) errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return loaded(outlets);
|
return loaded(outlets);
|
||||||
}
|
}
|
||||||
@ -742,9 +568,6 @@ class _$LoadedImpl implements _Loaded {
|
|||||||
TResult? Function()? loading,
|
TResult? Function()? loading,
|
||||||
TResult? Function(List<Outlet> outlets)? loaded,
|
TResult? Function(List<Outlet> outlets)? loaded,
|
||||||
TResult? Function(String message)? error,
|
TResult? Function(String message)? error,
|
||||||
TResult? Function()? loadingDetail,
|
|
||||||
TResult? Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult? Function(String message)? errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return loaded?.call(outlets);
|
return loaded?.call(outlets);
|
||||||
}
|
}
|
||||||
@ -756,9 +579,6 @@ class _$LoadedImpl implements _Loaded {
|
|||||||
TResult Function()? loading,
|
TResult Function()? loading,
|
||||||
TResult Function(List<Outlet> outlets)? loaded,
|
TResult Function(List<Outlet> outlets)? loaded,
|
||||||
TResult Function(String message)? error,
|
TResult Function(String message)? error,
|
||||||
TResult Function()? loadingDetail,
|
|
||||||
TResult Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult Function(String message)? errorDetail,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (loaded != null) {
|
if (loaded != null) {
|
||||||
@ -774,9 +594,6 @@ class _$LoadedImpl implements _Loaded {
|
|||||||
required TResult Function(_Loading value) loading,
|
required TResult Function(_Loading value) loading,
|
||||||
required TResult Function(_Loaded value) loaded,
|
required TResult Function(_Loaded value) loaded,
|
||||||
required TResult Function(_Error value) error,
|
required TResult Function(_Error value) error,
|
||||||
required TResult Function(_LoadingDetail value) loadingDetail,
|
|
||||||
required TResult Function(_LoadedDetail value) loadedDetail,
|
|
||||||
required TResult Function(_ErrorDetail value) errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return loaded(this);
|
return loaded(this);
|
||||||
}
|
}
|
||||||
@ -788,9 +605,6 @@ class _$LoadedImpl implements _Loaded {
|
|||||||
TResult? Function(_Loading value)? loading,
|
TResult? Function(_Loading value)? loading,
|
||||||
TResult? Function(_Loaded value)? loaded,
|
TResult? Function(_Loaded value)? loaded,
|
||||||
TResult? Function(_Error value)? error,
|
TResult? Function(_Error value)? error,
|
||||||
TResult? Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult? Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult? Function(_ErrorDetail value)? errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return loaded?.call(this);
|
return loaded?.call(this);
|
||||||
}
|
}
|
||||||
@ -802,9 +616,6 @@ class _$LoadedImpl implements _Loaded {
|
|||||||
TResult Function(_Loading value)? loading,
|
TResult Function(_Loading value)? loading,
|
||||||
TResult Function(_Loaded value)? loaded,
|
TResult Function(_Loaded value)? loaded,
|
||||||
TResult Function(_Error value)? error,
|
TResult Function(_Error value)? error,
|
||||||
TResult Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult Function(_ErrorDetail value)? errorDetail,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (loaded != null) {
|
if (loaded != null) {
|
||||||
@ -898,9 +709,6 @@ class _$ErrorImpl implements _Error {
|
|||||||
required TResult Function() loading,
|
required TResult Function() loading,
|
||||||
required TResult Function(List<Outlet> outlets) loaded,
|
required TResult Function(List<Outlet> outlets) loaded,
|
||||||
required TResult Function(String message) error,
|
required TResult Function(String message) error,
|
||||||
required TResult Function() loadingDetail,
|
|
||||||
required TResult Function(Outlet outlet) loadedDetail,
|
|
||||||
required TResult Function(String message) errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return error(message);
|
return error(message);
|
||||||
}
|
}
|
||||||
@ -912,9 +720,6 @@ class _$ErrorImpl implements _Error {
|
|||||||
TResult? Function()? loading,
|
TResult? Function()? loading,
|
||||||
TResult? Function(List<Outlet> outlets)? loaded,
|
TResult? Function(List<Outlet> outlets)? loaded,
|
||||||
TResult? Function(String message)? error,
|
TResult? Function(String message)? error,
|
||||||
TResult? Function()? loadingDetail,
|
|
||||||
TResult? Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult? Function(String message)? errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return error?.call(message);
|
return error?.call(message);
|
||||||
}
|
}
|
||||||
@ -926,9 +731,6 @@ class _$ErrorImpl implements _Error {
|
|||||||
TResult Function()? loading,
|
TResult Function()? loading,
|
||||||
TResult Function(List<Outlet> outlets)? loaded,
|
TResult Function(List<Outlet> outlets)? loaded,
|
||||||
TResult Function(String message)? error,
|
TResult Function(String message)? error,
|
||||||
TResult Function()? loadingDetail,
|
|
||||||
TResult Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult Function(String message)? errorDetail,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
@ -944,9 +746,6 @@ class _$ErrorImpl implements _Error {
|
|||||||
required TResult Function(_Loading value) loading,
|
required TResult Function(_Loading value) loading,
|
||||||
required TResult Function(_Loaded value) loaded,
|
required TResult Function(_Loaded value) loaded,
|
||||||
required TResult Function(_Error value) error,
|
required TResult Function(_Error value) error,
|
||||||
required TResult Function(_LoadingDetail value) loadingDetail,
|
|
||||||
required TResult Function(_LoadedDetail value) loadedDetail,
|
|
||||||
required TResult Function(_ErrorDetail value) errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return error(this);
|
return error(this);
|
||||||
}
|
}
|
||||||
@ -958,9 +757,6 @@ class _$ErrorImpl implements _Error {
|
|||||||
TResult? Function(_Loading value)? loading,
|
TResult? Function(_Loading value)? loading,
|
||||||
TResult? Function(_Loaded value)? loaded,
|
TResult? Function(_Loaded value)? loaded,
|
||||||
TResult? Function(_Error value)? error,
|
TResult? Function(_Error value)? error,
|
||||||
TResult? Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult? Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult? Function(_ErrorDetail value)? errorDetail,
|
|
||||||
}) {
|
}) {
|
||||||
return error?.call(this);
|
return error?.call(this);
|
||||||
}
|
}
|
||||||
@ -972,9 +768,6 @@ class _$ErrorImpl implements _Error {
|
|||||||
TResult Function(_Loading value)? loading,
|
TResult Function(_Loading value)? loading,
|
||||||
TResult Function(_Loaded value)? loaded,
|
TResult Function(_Loaded value)? loaded,
|
||||||
TResult Function(_Error value)? error,
|
TResult Function(_Error value)? error,
|
||||||
TResult Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult Function(_ErrorDetail value)? errorDetail,
|
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
@ -995,478 +788,3 @@ abstract class _Error implements OutletLoaderState {
|
|||||||
_$$ErrorImplCopyWith<_$ErrorImpl> get copyWith =>
|
_$$ErrorImplCopyWith<_$ErrorImpl> get copyWith =>
|
||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$LoadingDetailImplCopyWith<$Res> {
|
|
||||||
factory _$$LoadingDetailImplCopyWith(
|
|
||||||
_$LoadingDetailImpl value, $Res Function(_$LoadingDetailImpl) then) =
|
|
||||||
__$$LoadingDetailImplCopyWithImpl<$Res>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$LoadingDetailImplCopyWithImpl<$Res>
|
|
||||||
extends _$OutletLoaderStateCopyWithImpl<$Res, _$LoadingDetailImpl>
|
|
||||||
implements _$$LoadingDetailImplCopyWith<$Res> {
|
|
||||||
__$$LoadingDetailImplCopyWithImpl(
|
|
||||||
_$LoadingDetailImpl _value, $Res Function(_$LoadingDetailImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of OutletLoaderState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
|
|
||||||
class _$LoadingDetailImpl implements _LoadingDetail {
|
|
||||||
const _$LoadingDetailImpl();
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'OutletLoaderState.loadingDetail()';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType && other is _$LoadingDetailImpl);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode => runtimeType.hashCode;
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult when<TResult extends Object?>({
|
|
||||||
required TResult Function() initial,
|
|
||||||
required TResult Function() loading,
|
|
||||||
required TResult Function(List<Outlet> outlets) loaded,
|
|
||||||
required TResult Function(String message) error,
|
|
||||||
required TResult Function() loadingDetail,
|
|
||||||
required TResult Function(Outlet outlet) loadedDetail,
|
|
||||||
required TResult Function(String message) errorDetail,
|
|
||||||
}) {
|
|
||||||
return loadingDetail();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
|
||||||
TResult? Function()? initial,
|
|
||||||
TResult? Function()? loading,
|
|
||||||
TResult? Function(List<Outlet> outlets)? loaded,
|
|
||||||
TResult? Function(String message)? error,
|
|
||||||
TResult? Function()? loadingDetail,
|
|
||||||
TResult? Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult? Function(String message)? errorDetail,
|
|
||||||
}) {
|
|
||||||
return loadingDetail?.call();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
|
||||||
TResult Function()? initial,
|
|
||||||
TResult Function()? loading,
|
|
||||||
TResult Function(List<Outlet> outlets)? loaded,
|
|
||||||
TResult Function(String message)? error,
|
|
||||||
TResult Function()? loadingDetail,
|
|
||||||
TResult Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult Function(String message)? errorDetail,
|
|
||||||
required TResult orElse(),
|
|
||||||
}) {
|
|
||||||
if (loadingDetail != null) {
|
|
||||||
return loadingDetail();
|
|
||||||
}
|
|
||||||
return orElse();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult map<TResult extends Object?>({
|
|
||||||
required TResult Function(_Initial value) initial,
|
|
||||||
required TResult Function(_Loading value) loading,
|
|
||||||
required TResult Function(_Loaded value) loaded,
|
|
||||||
required TResult Function(_Error value) error,
|
|
||||||
required TResult Function(_LoadingDetail value) loadingDetail,
|
|
||||||
required TResult Function(_LoadedDetail value) loadedDetail,
|
|
||||||
required TResult Function(_ErrorDetail value) errorDetail,
|
|
||||||
}) {
|
|
||||||
return loadingDetail(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult? mapOrNull<TResult extends Object?>({
|
|
||||||
TResult? Function(_Initial value)? initial,
|
|
||||||
TResult? Function(_Loading value)? loading,
|
|
||||||
TResult? Function(_Loaded value)? loaded,
|
|
||||||
TResult? Function(_Error value)? error,
|
|
||||||
TResult? Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult? Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult? Function(_ErrorDetail value)? errorDetail,
|
|
||||||
}) {
|
|
||||||
return loadingDetail?.call(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult maybeMap<TResult extends Object?>({
|
|
||||||
TResult Function(_Initial value)? initial,
|
|
||||||
TResult Function(_Loading value)? loading,
|
|
||||||
TResult Function(_Loaded value)? loaded,
|
|
||||||
TResult Function(_Error value)? error,
|
|
||||||
TResult Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult Function(_ErrorDetail value)? errorDetail,
|
|
||||||
required TResult orElse(),
|
|
||||||
}) {
|
|
||||||
if (loadingDetail != null) {
|
|
||||||
return loadingDetail(this);
|
|
||||||
}
|
|
||||||
return orElse();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _LoadingDetail implements OutletLoaderState {
|
|
||||||
const factory _LoadingDetail() = _$LoadingDetailImpl;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$LoadedDetailImplCopyWith<$Res> {
|
|
||||||
factory _$$LoadedDetailImplCopyWith(
|
|
||||||
_$LoadedDetailImpl value, $Res Function(_$LoadedDetailImpl) then) =
|
|
||||||
__$$LoadedDetailImplCopyWithImpl<$Res>;
|
|
||||||
@useResult
|
|
||||||
$Res call({Outlet outlet});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$LoadedDetailImplCopyWithImpl<$Res>
|
|
||||||
extends _$OutletLoaderStateCopyWithImpl<$Res, _$LoadedDetailImpl>
|
|
||||||
implements _$$LoadedDetailImplCopyWith<$Res> {
|
|
||||||
__$$LoadedDetailImplCopyWithImpl(
|
|
||||||
_$LoadedDetailImpl _value, $Res Function(_$LoadedDetailImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of OutletLoaderState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? outlet = null,
|
|
||||||
}) {
|
|
||||||
return _then(_$LoadedDetailImpl(
|
|
||||||
null == outlet
|
|
||||||
? _value.outlet
|
|
||||||
: outlet // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Outlet,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
|
|
||||||
class _$LoadedDetailImpl implements _LoadedDetail {
|
|
||||||
const _$LoadedDetailImpl(this.outlet);
|
|
||||||
|
|
||||||
@override
|
|
||||||
final Outlet outlet;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'OutletLoaderState.loadedDetail(outlet: $outlet)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$LoadedDetailImpl &&
|
|
||||||
(identical(other.outlet, outlet) || other.outlet == outlet));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(runtimeType, outlet);
|
|
||||||
|
|
||||||
/// Create a copy of OutletLoaderState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$LoadedDetailImplCopyWith<_$LoadedDetailImpl> get copyWith =>
|
|
||||||
__$$LoadedDetailImplCopyWithImpl<_$LoadedDetailImpl>(this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult when<TResult extends Object?>({
|
|
||||||
required TResult Function() initial,
|
|
||||||
required TResult Function() loading,
|
|
||||||
required TResult Function(List<Outlet> outlets) loaded,
|
|
||||||
required TResult Function(String message) error,
|
|
||||||
required TResult Function() loadingDetail,
|
|
||||||
required TResult Function(Outlet outlet) loadedDetail,
|
|
||||||
required TResult Function(String message) errorDetail,
|
|
||||||
}) {
|
|
||||||
return loadedDetail(outlet);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
|
||||||
TResult? Function()? initial,
|
|
||||||
TResult? Function()? loading,
|
|
||||||
TResult? Function(List<Outlet> outlets)? loaded,
|
|
||||||
TResult? Function(String message)? error,
|
|
||||||
TResult? Function()? loadingDetail,
|
|
||||||
TResult? Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult? Function(String message)? errorDetail,
|
|
||||||
}) {
|
|
||||||
return loadedDetail?.call(outlet);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
|
||||||
TResult Function()? initial,
|
|
||||||
TResult Function()? loading,
|
|
||||||
TResult Function(List<Outlet> outlets)? loaded,
|
|
||||||
TResult Function(String message)? error,
|
|
||||||
TResult Function()? loadingDetail,
|
|
||||||
TResult Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult Function(String message)? errorDetail,
|
|
||||||
required TResult orElse(),
|
|
||||||
}) {
|
|
||||||
if (loadedDetail != null) {
|
|
||||||
return loadedDetail(outlet);
|
|
||||||
}
|
|
||||||
return orElse();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult map<TResult extends Object?>({
|
|
||||||
required TResult Function(_Initial value) initial,
|
|
||||||
required TResult Function(_Loading value) loading,
|
|
||||||
required TResult Function(_Loaded value) loaded,
|
|
||||||
required TResult Function(_Error value) error,
|
|
||||||
required TResult Function(_LoadingDetail value) loadingDetail,
|
|
||||||
required TResult Function(_LoadedDetail value) loadedDetail,
|
|
||||||
required TResult Function(_ErrorDetail value) errorDetail,
|
|
||||||
}) {
|
|
||||||
return loadedDetail(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult? mapOrNull<TResult extends Object?>({
|
|
||||||
TResult? Function(_Initial value)? initial,
|
|
||||||
TResult? Function(_Loading value)? loading,
|
|
||||||
TResult? Function(_Loaded value)? loaded,
|
|
||||||
TResult? Function(_Error value)? error,
|
|
||||||
TResult? Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult? Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult? Function(_ErrorDetail value)? errorDetail,
|
|
||||||
}) {
|
|
||||||
return loadedDetail?.call(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult maybeMap<TResult extends Object?>({
|
|
||||||
TResult Function(_Initial value)? initial,
|
|
||||||
TResult Function(_Loading value)? loading,
|
|
||||||
TResult Function(_Loaded value)? loaded,
|
|
||||||
TResult Function(_Error value)? error,
|
|
||||||
TResult Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult Function(_ErrorDetail value)? errorDetail,
|
|
||||||
required TResult orElse(),
|
|
||||||
}) {
|
|
||||||
if (loadedDetail != null) {
|
|
||||||
return loadedDetail(this);
|
|
||||||
}
|
|
||||||
return orElse();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _LoadedDetail implements OutletLoaderState {
|
|
||||||
const factory _LoadedDetail(final Outlet outlet) = _$LoadedDetailImpl;
|
|
||||||
|
|
||||||
Outlet get outlet;
|
|
||||||
|
|
||||||
/// Create a copy of OutletLoaderState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$LoadedDetailImplCopyWith<_$LoadedDetailImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$ErrorDetailImplCopyWith<$Res> {
|
|
||||||
factory _$$ErrorDetailImplCopyWith(
|
|
||||||
_$ErrorDetailImpl value, $Res Function(_$ErrorDetailImpl) then) =
|
|
||||||
__$$ErrorDetailImplCopyWithImpl<$Res>;
|
|
||||||
@useResult
|
|
||||||
$Res call({String message});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$ErrorDetailImplCopyWithImpl<$Res>
|
|
||||||
extends _$OutletLoaderStateCopyWithImpl<$Res, _$ErrorDetailImpl>
|
|
||||||
implements _$$ErrorDetailImplCopyWith<$Res> {
|
|
||||||
__$$ErrorDetailImplCopyWithImpl(
|
|
||||||
_$ErrorDetailImpl _value, $Res Function(_$ErrorDetailImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of OutletLoaderState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? message = null,
|
|
||||||
}) {
|
|
||||||
return _then(_$ErrorDetailImpl(
|
|
||||||
null == message
|
|
||||||
? _value.message
|
|
||||||
: message // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
|
|
||||||
class _$ErrorDetailImpl implements _ErrorDetail {
|
|
||||||
const _$ErrorDetailImpl(this.message);
|
|
||||||
|
|
||||||
@override
|
|
||||||
final String message;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'OutletLoaderState.errorDetail(message: $message)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$ErrorDetailImpl &&
|
|
||||||
(identical(other.message, message) || other.message == message));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(runtimeType, message);
|
|
||||||
|
|
||||||
/// Create a copy of OutletLoaderState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$ErrorDetailImplCopyWith<_$ErrorDetailImpl> get copyWith =>
|
|
||||||
__$$ErrorDetailImplCopyWithImpl<_$ErrorDetailImpl>(this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult when<TResult extends Object?>({
|
|
||||||
required TResult Function() initial,
|
|
||||||
required TResult Function() loading,
|
|
||||||
required TResult Function(List<Outlet> outlets) loaded,
|
|
||||||
required TResult Function(String message) error,
|
|
||||||
required TResult Function() loadingDetail,
|
|
||||||
required TResult Function(Outlet outlet) loadedDetail,
|
|
||||||
required TResult Function(String message) errorDetail,
|
|
||||||
}) {
|
|
||||||
return errorDetail(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
|
||||||
TResult? Function()? initial,
|
|
||||||
TResult? Function()? loading,
|
|
||||||
TResult? Function(List<Outlet> outlets)? loaded,
|
|
||||||
TResult? Function(String message)? error,
|
|
||||||
TResult? Function()? loadingDetail,
|
|
||||||
TResult? Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult? Function(String message)? errorDetail,
|
|
||||||
}) {
|
|
||||||
return errorDetail?.call(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
|
||||||
TResult Function()? initial,
|
|
||||||
TResult Function()? loading,
|
|
||||||
TResult Function(List<Outlet> outlets)? loaded,
|
|
||||||
TResult Function(String message)? error,
|
|
||||||
TResult Function()? loadingDetail,
|
|
||||||
TResult Function(Outlet outlet)? loadedDetail,
|
|
||||||
TResult Function(String message)? errorDetail,
|
|
||||||
required TResult orElse(),
|
|
||||||
}) {
|
|
||||||
if (errorDetail != null) {
|
|
||||||
return errorDetail(message);
|
|
||||||
}
|
|
||||||
return orElse();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult map<TResult extends Object?>({
|
|
||||||
required TResult Function(_Initial value) initial,
|
|
||||||
required TResult Function(_Loading value) loading,
|
|
||||||
required TResult Function(_Loaded value) loaded,
|
|
||||||
required TResult Function(_Error value) error,
|
|
||||||
required TResult Function(_LoadingDetail value) loadingDetail,
|
|
||||||
required TResult Function(_LoadedDetail value) loadedDetail,
|
|
||||||
required TResult Function(_ErrorDetail value) errorDetail,
|
|
||||||
}) {
|
|
||||||
return errorDetail(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult? mapOrNull<TResult extends Object?>({
|
|
||||||
TResult? Function(_Initial value)? initial,
|
|
||||||
TResult? Function(_Loading value)? loading,
|
|
||||||
TResult? Function(_Loaded value)? loaded,
|
|
||||||
TResult? Function(_Error value)? error,
|
|
||||||
TResult? Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult? Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult? Function(_ErrorDetail value)? errorDetail,
|
|
||||||
}) {
|
|
||||||
return errorDetail?.call(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult maybeMap<TResult extends Object?>({
|
|
||||||
TResult Function(_Initial value)? initial,
|
|
||||||
TResult Function(_Loading value)? loading,
|
|
||||||
TResult Function(_Loaded value)? loaded,
|
|
||||||
TResult Function(_Error value)? error,
|
|
||||||
TResult Function(_LoadingDetail value)? loadingDetail,
|
|
||||||
TResult Function(_LoadedDetail value)? loadedDetail,
|
|
||||||
TResult Function(_ErrorDetail value)? errorDetail,
|
|
||||||
required TResult orElse(),
|
|
||||||
}) {
|
|
||||||
if (errorDetail != null) {
|
|
||||||
return errorDetail(this);
|
|
||||||
}
|
|
||||||
return orElse();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _ErrorDetail implements OutletLoaderState {
|
|
||||||
const factory _ErrorDetail(final String message) = _$ErrorDetailImpl;
|
|
||||||
|
|
||||||
String get message;
|
|
||||||
|
|
||||||
/// Create a copy of OutletLoaderState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$ErrorDetailImplCopyWith<_$ErrorDetailImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:enaklo_pos/core/components/flushbar.dart';
|
|||||||
import 'package:enaklo_pos/core/components/spaces.dart';
|
import 'package:enaklo_pos/core/components/spaces.dart';
|
||||||
import 'package:enaklo_pos/core/constants/colors.dart';
|
import 'package:enaklo_pos/core/constants/colors.dart';
|
||||||
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
|
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
|
||||||
|
import 'package:enaklo_pos/data/models/response/customer_response_model.dart';
|
||||||
import 'package:enaklo_pos/data/models/response/table_model.dart';
|
import 'package:enaklo_pos/data/models/response/table_model.dart';
|
||||||
import 'package:enaklo_pos/presentation/home/bloc/get_table_status/get_table_status_bloc.dart';
|
import 'package:enaklo_pos/presentation/home/bloc/get_table_status/get_table_status_bloc.dart';
|
||||||
import 'package:enaklo_pos/presentation/home/bloc/order_form/order_form_bloc.dart';
|
import 'package:enaklo_pos/presentation/home/bloc/order_form/order_form_bloc.dart';
|
||||||
@ -18,12 +19,15 @@ class PaymentSaveDialog extends StatefulWidget {
|
|||||||
final String customerName;
|
final String customerName;
|
||||||
final OrderType orderType;
|
final OrderType orderType;
|
||||||
final List<ProductQuantity> items;
|
final List<ProductQuantity> items;
|
||||||
const PaymentSaveDialog(
|
final Customer? customer;
|
||||||
{super.key,
|
const PaymentSaveDialog({
|
||||||
|
super.key,
|
||||||
required this.selectedTable,
|
required this.selectedTable,
|
||||||
required this.customerName,
|
required this.customerName,
|
||||||
required this.orderType,
|
required this.orderType,
|
||||||
required this.items});
|
required this.items,
|
||||||
|
required this.customer,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<PaymentSaveDialog> createState() => _PaymentSaveDialogState();
|
State<PaymentSaveDialog> createState() => _PaymentSaveDialogState();
|
||||||
@ -163,6 +167,7 @@ class _PaymentSaveDialogState extends State<PaymentSaveDialog> {
|
|||||||
customerName: widget.customerName,
|
customerName: widget.customerName,
|
||||||
orderType: widget.orderType,
|
orderType: widget.orderType,
|
||||||
table: selectTable!,
|
table: selectTable!,
|
||||||
|
customer: widget.customer,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:enaklo_pos/core/components/custom_modal_dialog.dart';
|
|||||||
import 'package:enaklo_pos/core/components/spaces.dart';
|
import 'package:enaklo_pos/core/components/spaces.dart';
|
||||||
import 'package:enaklo_pos/core/constants/colors.dart';
|
import 'package:enaklo_pos/core/constants/colors.dart';
|
||||||
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
|
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
|
||||||
|
import 'package:enaklo_pos/data/models/response/customer_response_model.dart';
|
||||||
import 'package:enaklo_pos/data/models/response/table_model.dart';
|
import 'package:enaklo_pos/data/models/response/table_model.dart';
|
||||||
import 'package:enaklo_pos/presentation/home/dialog/payment_add_order_dialog.dart';
|
import 'package:enaklo_pos/presentation/home/dialog/payment_add_order_dialog.dart';
|
||||||
import 'package:enaklo_pos/presentation/home/dialog/payment_save_dialog.dart';
|
import 'package:enaklo_pos/presentation/home/dialog/payment_save_dialog.dart';
|
||||||
@ -14,13 +15,16 @@ class SaveDialog extends StatefulWidget {
|
|||||||
final String customerName;
|
final String customerName;
|
||||||
final OrderType orderType;
|
final OrderType orderType;
|
||||||
final List<ProductQuantity> items;
|
final List<ProductQuantity> items;
|
||||||
|
final Customer? customer;
|
||||||
|
|
||||||
const SaveDialog(
|
const SaveDialog({
|
||||||
{super.key,
|
super.key,
|
||||||
required this.selectedTable,
|
required this.selectedTable,
|
||||||
required this.customerName,
|
required this.customerName,
|
||||||
required this.orderType,
|
required this.orderType,
|
||||||
required this.items});
|
required this.items,
|
||||||
|
required this.customer,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<SaveDialog> createState() => _SaveDialogState();
|
State<SaveDialog> createState() => _SaveDialogState();
|
||||||
@ -48,7 +52,9 @@ class _SaveDialogState extends State<SaveDialog> {
|
|||||||
selectedTable: widget.selectedTable,
|
selectedTable: widget.selectedTable,
|
||||||
customerName: widget.customerName,
|
customerName: widget.customerName,
|
||||||
orderType: widget.orderType,
|
orderType: widget.orderType,
|
||||||
items: widget.items),
|
items: widget.items,
|
||||||
|
customer: widget.customer,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
SpaceHeight(16.0),
|
SpaceHeight(16.0),
|
||||||
|
|||||||
65
lib/presentation/home/dialog/variant_dialog.dart
Normal file
65
lib/presentation/home/dialog/variant_dialog.dart
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
import 'package:enaklo_pos/core/components/custom_modal_dialog.dart';
|
||||||
|
import 'package:enaklo_pos/core/constants/colors.dart';
|
||||||
|
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
|
||||||
|
import 'package:enaklo_pos/core/extensions/int_ext.dart';
|
||||||
|
import 'package:enaklo_pos/data/models/response/product_response_model.dart';
|
||||||
|
import 'package:enaklo_pos/presentation/home/bloc/checkout/checkout_bloc.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
|
class VariantDialog extends StatelessWidget {
|
||||||
|
final Product product;
|
||||||
|
const VariantDialog({super.key, required this.product});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return CustomModalDialog(
|
||||||
|
title: 'Pilih Varian',
|
||||||
|
subtitle: 'Silahkan pilih varian yang sesuai',
|
||||||
|
minWidth: context.deviceWidth * 0.4,
|
||||||
|
contentPadding: EdgeInsets.all(16),
|
||||||
|
child: Wrap(
|
||||||
|
spacing: 12,
|
||||||
|
runSpacing: 12,
|
||||||
|
children: product.variants!.map((variant) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
// Aksi saat varian dipilih
|
||||||
|
context.pop();
|
||||||
|
context.read<CheckoutBloc>().add(
|
||||||
|
CheckoutEvent.addItem(product, variant),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: (context.deviceWidth * 0.4 - 12 - 32) / 2 - 6, // 2 per row
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.grey.shade300),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
variant.name ?? "",
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
(variant.priceModifier ?? 0).currencyFormatRpV2,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,7 +2,7 @@ import 'dart:convert';
|
|||||||
|
|
||||||
class OrderRequestModel {
|
class OrderRequestModel {
|
||||||
final String? outletId;
|
final String? outletId;
|
||||||
final String? userId;
|
final String? customerId;
|
||||||
final String? tableNumber;
|
final String? tableNumber;
|
||||||
final String? tableId;
|
final String? tableId;
|
||||||
final String? orderType;
|
final String? orderType;
|
||||||
@ -12,7 +12,7 @@ class OrderRequestModel {
|
|||||||
|
|
||||||
OrderRequestModel({
|
OrderRequestModel({
|
||||||
this.outletId,
|
this.outletId,
|
||||||
this.userId,
|
this.customerId,
|
||||||
this.tableNumber,
|
this.tableNumber,
|
||||||
this.tableId,
|
this.tableId,
|
||||||
this.orderType,
|
this.orderType,
|
||||||
@ -29,7 +29,7 @@ class OrderRequestModel {
|
|||||||
factory OrderRequestModel.fromMap(Map<String, dynamic> json) =>
|
factory OrderRequestModel.fromMap(Map<String, dynamic> json) =>
|
||||||
OrderRequestModel(
|
OrderRequestModel(
|
||||||
outletId: json["outlet_id"],
|
outletId: json["outlet_id"],
|
||||||
userId: json["user_id"],
|
customerId: json["customer_id"],
|
||||||
tableNumber: json["table_number"],
|
tableNumber: json["table_number"],
|
||||||
tableId: json["table_id"],
|
tableId: json["table_id"],
|
||||||
orderType: json["order_type"],
|
orderType: json["order_type"],
|
||||||
@ -43,7 +43,7 @@ class OrderRequestModel {
|
|||||||
|
|
||||||
Map<String, dynamic> toMap() => {
|
Map<String, dynamic> toMap() => {
|
||||||
"outlet_id": outletId,
|
"outlet_id": outletId,
|
||||||
"user_id": userId,
|
"customer_id": customerId,
|
||||||
"table_number": tableNumber,
|
"table_number": tableNumber,
|
||||||
"table_id": tableId,
|
"table_id": tableId,
|
||||||
"order_type": orderType,
|
"order_type": orderType,
|
||||||
@ -57,12 +57,14 @@ class OrderRequestModel {
|
|||||||
|
|
||||||
class OrderItemRequest {
|
class OrderItemRequest {
|
||||||
final String? productId;
|
final String? productId;
|
||||||
|
final String? productVariantId;
|
||||||
final int? quantity;
|
final int? quantity;
|
||||||
final int? unitPrice;
|
final int? unitPrice;
|
||||||
final String? notes;
|
final String? notes;
|
||||||
|
|
||||||
OrderItemRequest({
|
OrderItemRequest({
|
||||||
this.productId,
|
this.productId,
|
||||||
|
this.productVariantId,
|
||||||
this.quantity,
|
this.quantity,
|
||||||
this.unitPrice,
|
this.unitPrice,
|
||||||
this.notes,
|
this.notes,
|
||||||
@ -74,6 +76,7 @@ class OrderItemRequest {
|
|||||||
factory OrderItemRequest.fromMap(Map<String, dynamic> json) =>
|
factory OrderItemRequest.fromMap(Map<String, dynamic> json) =>
|
||||||
OrderItemRequest(
|
OrderItemRequest(
|
||||||
productId: json["product_id"],
|
productId: json["product_id"],
|
||||||
|
productVariantId: json["product_variant_id"],
|
||||||
quantity: json["quantity"],
|
quantity: json["quantity"],
|
||||||
unitPrice: json["unit_price"]?.toDouble(),
|
unitPrice: json["unit_price"]?.toDouble(),
|
||||||
notes: json["notes"],
|
notes: json["notes"],
|
||||||
@ -81,6 +84,7 @@ class OrderItemRequest {
|
|||||||
|
|
||||||
Map<String, dynamic> toMap() => {
|
Map<String, dynamic> toMap() => {
|
||||||
"product_id": productId,
|
"product_id": productId,
|
||||||
|
"product_variant_id": productVariantId,
|
||||||
"quantity": quantity,
|
"quantity": quantity,
|
||||||
"unit_price": unitPrice,
|
"unit_price": unitPrice,
|
||||||
"notes": notes,
|
"notes": notes,
|
||||||
|
|||||||
@ -5,12 +5,14 @@ import 'package:enaklo_pos/data/models/response/product_response_model.dart';
|
|||||||
|
|
||||||
class ProductQuantity {
|
class ProductQuantity {
|
||||||
final Product product;
|
final Product product;
|
||||||
|
ProductVariant? variant;
|
||||||
int quantity;
|
int quantity;
|
||||||
String notes;
|
String notes;
|
||||||
ProductQuantity({
|
ProductQuantity({
|
||||||
required this.product,
|
required this.product,
|
||||||
required this.quantity,
|
required this.quantity,
|
||||||
this.notes = '',
|
this.notes = '',
|
||||||
|
this.variant,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -20,17 +22,20 @@ class ProductQuantity {
|
|||||||
return other is ProductQuantity &&
|
return other is ProductQuantity &&
|
||||||
other.product == product &&
|
other.product == product &&
|
||||||
other.quantity == quantity &&
|
other.quantity == quantity &&
|
||||||
|
other.variant == variant &&
|
||||||
other.notes == notes;
|
other.notes == notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => product.hashCode ^ quantity.hashCode ^ notes.hashCode;
|
int get hashCode =>
|
||||||
|
product.hashCode ^ quantity.hashCode ^ variant.hashCode ^ notes.hashCode;
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
'product': product.toMap(),
|
'product': product.toMap(),
|
||||||
'quantity': quantity,
|
'quantity': quantity,
|
||||||
'notes': notes,
|
'notes': notes,
|
||||||
|
'variant': variant?.toMap(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,6 +48,7 @@ class ProductQuantity {
|
|||||||
'quantity': quantity,
|
'quantity': quantity,
|
||||||
'price': product.price,
|
'price': product.price,
|
||||||
'notes': notes,
|
'notes': notes,
|
||||||
|
'variant': variant?.toMap(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,6 +61,7 @@ class ProductQuantity {
|
|||||||
'quantity': quantity,
|
'quantity': quantity,
|
||||||
'price': product.price,
|
'price': product.price,
|
||||||
'notes': notes,
|
'notes': notes,
|
||||||
|
'variant': variant?.toMap(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,6 +70,9 @@ class ProductQuantity {
|
|||||||
product: Product.fromMap(map['product']),
|
product: Product.fromMap(map['product']),
|
||||||
quantity: map['quantity']?.toInt() ?? 0,
|
quantity: map['quantity']?.toInt() ?? 0,
|
||||||
notes: map['notes'] ?? '',
|
notes: map['notes'] ?? '',
|
||||||
|
variant: map['variant'] != null
|
||||||
|
? ProductVariant.fromMap(map['variant'])
|
||||||
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,6 +82,9 @@ class ProductQuantity {
|
|||||||
product: Product.fromOrderMap(map),
|
product: Product.fromOrderMap(map),
|
||||||
quantity: map['quantity']?.toInt() ?? 0,
|
quantity: map['quantity']?.toInt() ?? 0,
|
||||||
notes: map['notes'] ?? '',
|
notes: map['notes'] ?? '',
|
||||||
|
variant: map['variant'] != null
|
||||||
|
? ProductVariant.fromMap(map['variant'])
|
||||||
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,6 +102,7 @@ class ProductQuantity {
|
|||||||
product: product ?? this.product,
|
product: product ?? this.product,
|
||||||
quantity: quantity ?? this.quantity,
|
quantity: quantity ?? this.quantity,
|
||||||
notes: notes ?? this.notes,
|
notes: notes ?? this.notes,
|
||||||
|
variant: variant,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -883,6 +883,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
|
|||||||
customerName: customerController.text,
|
customerName: customerController.text,
|
||||||
items: items,
|
items: items,
|
||||||
orderType: orderType,
|
orderType: orderType,
|
||||||
|
customer: selectedCustomer,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
label: 'Simpan',
|
label: 'Simpan',
|
||||||
@ -921,6 +922,8 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
|
|||||||
.text,
|
.text,
|
||||||
orderType: orderType,
|
orderType: orderType,
|
||||||
table: widget.table!,
|
table: widget.table!,
|
||||||
|
customer:
|
||||||
|
selectedCustomer,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -95,7 +95,11 @@ class _OrderMenuState extends State<OrderMenu> {
|
|||||||
subtitle: Column(
|
subtitle: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(widget.data.product.price!.currencyFormatRp),
|
Text((widget.data.product.price! +
|
||||||
|
(widget.data.variant?.priceModifier ?? 0))
|
||||||
|
.currencyFormatRp),
|
||||||
|
if (widget.data.variant != null)
|
||||||
|
Text(widget.data.variant?.name ?? ""),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -104,9 +108,8 @@ class _OrderMenuState extends State<OrderMenu> {
|
|||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context
|
context.read<CheckoutBloc>().add(CheckoutEvent.removeItem(
|
||||||
.read<CheckoutBloc>()
|
widget.data.product, widget.data.variant));
|
||||||
.add(CheckoutEvent.removeItem(widget.data.product));
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 30,
|
width: 30,
|
||||||
@ -127,9 +130,12 @@ class _OrderMenuState extends State<OrderMenu> {
|
|||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context
|
context.read<CheckoutBloc>().add(
|
||||||
.read<CheckoutBloc>()
|
CheckoutEvent.addItem(
|
||||||
.add(CheckoutEvent.addItem(widget.data.product));
|
widget.data.product,
|
||||||
|
widget.data.variant,
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 30,
|
width: 30,
|
||||||
@ -147,7 +153,8 @@ class _OrderMenuState extends State<OrderMenu> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: 80.0,
|
width: 80.0,
|
||||||
child: Text(
|
child: Text(
|
||||||
(widget.data.product.price! * widget.data.quantity)
|
(widget.data.product.price! * widget.data.quantity +
|
||||||
|
(widget.data.variant?.priceModifier ?? 0))
|
||||||
.currencyFormatRp,
|
.currencyFormatRp,
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
@ -179,9 +186,12 @@ class _OrderMenuState extends State<OrderMenu> {
|
|||||||
const SpaceWidth(16.0),
|
const SpaceWidth(16.0),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context
|
context.read<CheckoutBloc>().add(
|
||||||
.read<CheckoutBloc>()
|
CheckoutEvent.deleteItem(
|
||||||
.add(CheckoutEvent.deleteItem(widget.data.product));
|
widget.data.product,
|
||||||
|
widget.data.variant,
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 40,
|
height: 40,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:enaklo_pos/core/extensions/int_ext.dart';
|
import 'package:enaklo_pos/core/extensions/int_ext.dart';
|
||||||
|
import 'package:enaklo_pos/presentation/home/dialog/variant_dialog.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 'package:enaklo_pos/core/constants/variables.dart';
|
import 'package:enaklo_pos/core/constants/variables.dart';
|
||||||
@ -22,7 +23,16 @@ class ProductCard extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<CheckoutBloc>().add(CheckoutEvent.addItem(data));
|
if (data.variants!.isEmpty) {
|
||||||
|
context.read<CheckoutBloc>().add(
|
||||||
|
CheckoutEvent.addItem(data, null),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => VariantDialog(product: data),
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -114,30 +124,28 @@ class ProductCard extends StatelessWidget {
|
|||||||
totalPrice,
|
totalPrice,
|
||||||
draftName,
|
draftName,
|
||||||
orderType) {
|
orderType) {
|
||||||
return products.any((element) => element.product == data)
|
final totalQuantity = products
|
||||||
? products
|
.where((item) => item.product.id == data.id)
|
||||||
.firstWhere(
|
.map((item) => item.quantity)
|
||||||
(element) => element.product == data)
|
.fold(0, (sum, qty) => sum + qty);
|
||||||
.quantity >
|
|
||||||
0
|
if (totalQuantity == 0) {
|
||||||
? Align(
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Align(
|
||||||
alignment: Alignment.topRight,
|
alignment: Alignment.topRight,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
padding: const EdgeInsets.all(6),
|
padding: const EdgeInsets.all(6),
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
borderRadius:
|
borderRadius: BorderRadius.all(Radius.circular(9.0)),
|
||||||
BorderRadius.all(Radius.circular(9.0)),
|
|
||||||
color: AppColors.primary,
|
color: AppColors.primary,
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
products
|
totalQuantity.toString(),
|
||||||
.firstWhere((element) =>
|
|
||||||
element.product == data)
|
|
||||||
.quantity
|
|
||||||
.toString(),
|
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
@ -145,9 +153,7 @@ class ProductCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
);
|
||||||
: SizedBox.shrink()
|
|
||||||
: SizedBox.shrink();
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -135,12 +135,21 @@ class SalesListOrder extends StatelessWidget {
|
|||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (product.productVariantName != null)
|
||||||
|
Text(
|
||||||
|
product.productVariantName ?? '',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
(product.unitPrice ?? 0)
|
(product.unitPrice ?? 0)
|
||||||
.toString()
|
.toString()
|
||||||
.currencyFormatRpV2,
|
.currencyFormatRpV2,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user