feat: product variant
This commit is contained in:
@@ -25,15 +25,29 @@ class CheckoutBloc extends Bloc<CheckoutEvent, CheckoutState> {
|
||||
on<_AddItem>((event, emit) {
|
||||
var currentState = state as _Loaded;
|
||||
List<ProductQuantity> items = [...currentState.items];
|
||||
var index =
|
||||
items.indexWhere((element) => element.product.id == event.product.id);
|
||||
var index = items.indexWhere(
|
||||
(element) =>
|
||||
element.product.id == event.product.id &&
|
||||
element.variant?.id == event.variant?.id,
|
||||
);
|
||||
emit(const _Loading());
|
||||
if (index != -1) {
|
||||
items[index] = ProductQuantity(
|
||||
product: event.product, quantity: items[index].quantity + 1);
|
||||
product: event.product,
|
||||
quantity: items[index].quantity + 1,
|
||||
variant: event.variant,
|
||||
);
|
||||
} 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(
|
||||
items,
|
||||
currentState.discountModel,
|
||||
@@ -50,13 +64,19 @@ class CheckoutBloc extends Bloc<CheckoutEvent, CheckoutState> {
|
||||
on<_RemoveItem>((event, emit) {
|
||||
var currentState = state as _Loaded;
|
||||
List<ProductQuantity> items = [...currentState.items];
|
||||
var index =
|
||||
items.indexWhere((element) => element.product.id == event.product.id);
|
||||
var index = items.indexWhere(
|
||||
(element) =>
|
||||
element.product.id == event.product.id &&
|
||||
element.variant?.id == event.variant?.id,
|
||||
);
|
||||
emit(const _Loading());
|
||||
if (index != -1) {
|
||||
if (items[index].quantity > 1) {
|
||||
items[index] = ProductQuantity(
|
||||
product: event.product, quantity: items[index].quantity - 1);
|
||||
product: event.product,
|
||||
quantity: items[index].quantity - 1,
|
||||
variant: event.variant);
|
||||
;
|
||||
} else {
|
||||
items.removeAt(index);
|
||||
}
|
||||
@@ -77,8 +97,11 @@ class CheckoutBloc extends Bloc<CheckoutEvent, CheckoutState> {
|
||||
on<_DeleteItem>((event, emit) {
|
||||
var currentState = state as _Loaded;
|
||||
List<ProductQuantity> items = [...currentState.items];
|
||||
var index =
|
||||
items.indexWhere((element) => element.product.id == event.product.id);
|
||||
var index = items.indexWhere(
|
||||
(element) =>
|
||||
element.product.id == event.product.id &&
|
||||
element.variant?.id == event.variant?.id,
|
||||
);
|
||||
emit(const _Loading());
|
||||
|
||||
items.removeAt(index);
|
||||
|
||||
@@ -19,9 +19,11 @@ mixin _$CheckoutEvent {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -39,9 +41,9 @@ mixin _$CheckoutEvent {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -58,9 +60,9 @@ mixin _$CheckoutEvent {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -195,9 +197,11 @@ class _$StartedImpl implements _Started {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -218,9 +222,9 @@ class _$StartedImpl implements _Started {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -240,9 +244,9 @@ class _$StartedImpl implements _Started {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -340,7 +344,7 @@ abstract class _$$AddItemImplCopyWith<$Res> {
|
||||
_$AddItemImpl value, $Res Function(_$AddItemImpl) then) =
|
||||
__$$AddItemImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({Product product});
|
||||
$Res call({Product product, ProductVariant? variant});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -357,12 +361,17 @@ class __$$AddItemImplCopyWithImpl<$Res>
|
||||
@override
|
||||
$Res call({
|
||||
Object? product = null,
|
||||
Object? variant = freezed,
|
||||
}) {
|
||||
return _then(_$AddItemImpl(
|
||||
null == product
|
||||
? _value.product
|
||||
: product // ignore: cast_nullable_to_non_nullable
|
||||
as Product,
|
||||
freezed == variant
|
||||
? _value.variant
|
||||
: variant // ignore: cast_nullable_to_non_nullable
|
||||
as ProductVariant?,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -370,14 +379,16 @@ class __$$AddItemImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
|
||||
class _$AddItemImpl implements _AddItem {
|
||||
const _$AddItemImpl(this.product);
|
||||
const _$AddItemImpl(this.product, this.variant);
|
||||
|
||||
@override
|
||||
final Product product;
|
||||
@override
|
||||
final ProductVariant? variant;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CheckoutEvent.addItem(product: $product)';
|
||||
return 'CheckoutEvent.addItem(product: $product, variant: $variant)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -385,11 +396,12 @@ class _$AddItemImpl implements _AddItem {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
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
|
||||
int get hashCode => Object.hash(runtimeType, product);
|
||||
int get hashCode => Object.hash(runtimeType, product, variant);
|
||||
|
||||
/// Create a copy of CheckoutEvent
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -403,9 +415,11 @@ class _$AddItemImpl implements _AddItem {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -419,16 +433,16 @@ class _$AddItemImpl implements _AddItem {
|
||||
saveDraftOrder,
|
||||
required TResult Function(DraftOrderModel data) loadDraftOrder,
|
||||
}) {
|
||||
return addItem(product);
|
||||
return addItem(product, variant);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -441,16 +455,16 @@ class _$AddItemImpl implements _AddItem {
|
||||
saveDraftOrder,
|
||||
TResult? Function(DraftOrderModel data)? loadDraftOrder,
|
||||
}) {
|
||||
return addItem?.call(product);
|
||||
return addItem?.call(product, variant);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -465,7 +479,7 @@ class _$AddItemImpl implements _AddItem {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (addItem != null) {
|
||||
return addItem(product);
|
||||
return addItem(product, variant);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
@@ -539,9 +553,11 @@ class _$AddItemImpl implements _AddItem {
|
||||
}
|
||||
|
||||
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;
|
||||
ProductVariant? get variant;
|
||||
|
||||
/// Create a copy of CheckoutEvent
|
||||
/// 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) =
|
||||
__$$RemoveItemImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({Product product});
|
||||
$Res call({Product product, ProductVariant? variant});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -573,12 +589,17 @@ class __$$RemoveItemImplCopyWithImpl<$Res>
|
||||
@override
|
||||
$Res call({
|
||||
Object? product = null,
|
||||
Object? variant = freezed,
|
||||
}) {
|
||||
return _then(_$RemoveItemImpl(
|
||||
null == product
|
||||
? _value.product
|
||||
: product // ignore: cast_nullable_to_non_nullable
|
||||
as Product,
|
||||
freezed == variant
|
||||
? _value.variant
|
||||
: variant // ignore: cast_nullable_to_non_nullable
|
||||
as ProductVariant?,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -586,14 +607,16 @@ class __$$RemoveItemImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
|
||||
class _$RemoveItemImpl implements _RemoveItem {
|
||||
const _$RemoveItemImpl(this.product);
|
||||
const _$RemoveItemImpl(this.product, this.variant);
|
||||
|
||||
@override
|
||||
final Product product;
|
||||
@override
|
||||
final ProductVariant? variant;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CheckoutEvent.removeItem(product: $product)';
|
||||
return 'CheckoutEvent.removeItem(product: $product, variant: $variant)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -601,11 +624,12 @@ class _$RemoveItemImpl implements _RemoveItem {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
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
|
||||
int get hashCode => Object.hash(runtimeType, product);
|
||||
int get hashCode => Object.hash(runtimeType, product, variant);
|
||||
|
||||
/// Create a copy of CheckoutEvent
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -619,9 +643,11 @@ class _$RemoveItemImpl implements _RemoveItem {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -635,16 +661,16 @@ class _$RemoveItemImpl implements _RemoveItem {
|
||||
saveDraftOrder,
|
||||
required TResult Function(DraftOrderModel data) loadDraftOrder,
|
||||
}) {
|
||||
return removeItem(product);
|
||||
return removeItem(product, variant);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -657,16 +683,16 @@ class _$RemoveItemImpl implements _RemoveItem {
|
||||
saveDraftOrder,
|
||||
TResult? Function(DraftOrderModel data)? loadDraftOrder,
|
||||
}) {
|
||||
return removeItem?.call(product);
|
||||
return removeItem?.call(product, variant);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -681,7 +707,7 @@ class _$RemoveItemImpl implements _RemoveItem {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (removeItem != null) {
|
||||
return removeItem(product);
|
||||
return removeItem(product, variant);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
@@ -755,9 +781,11 @@ class _$RemoveItemImpl implements _RemoveItem {
|
||||
}
|
||||
|
||||
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;
|
||||
ProductVariant? get variant;
|
||||
|
||||
/// Create a copy of CheckoutEvent
|
||||
/// 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) =
|
||||
__$$DeleteItemImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({Product product});
|
||||
$Res call({Product product, ProductVariant? variant});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -789,12 +817,17 @@ class __$$DeleteItemImplCopyWithImpl<$Res>
|
||||
@override
|
||||
$Res call({
|
||||
Object? product = null,
|
||||
Object? variant = freezed,
|
||||
}) {
|
||||
return _then(_$DeleteItemImpl(
|
||||
null == product
|
||||
? _value.product
|
||||
: product // ignore: cast_nullable_to_non_nullable
|
||||
as Product,
|
||||
freezed == variant
|
||||
? _value.variant
|
||||
: variant // ignore: cast_nullable_to_non_nullable
|
||||
as ProductVariant?,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -802,14 +835,16 @@ class __$$DeleteItemImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
|
||||
class _$DeleteItemImpl implements _DeleteItem {
|
||||
const _$DeleteItemImpl(this.product);
|
||||
const _$DeleteItemImpl(this.product, this.variant);
|
||||
|
||||
@override
|
||||
final Product product;
|
||||
@override
|
||||
final ProductVariant? variant;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CheckoutEvent.deleteItem(product: $product)';
|
||||
return 'CheckoutEvent.deleteItem(product: $product, variant: $variant)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -817,11 +852,12 @@ class _$DeleteItemImpl implements _DeleteItem {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
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
|
||||
int get hashCode => Object.hash(runtimeType, product);
|
||||
int get hashCode => Object.hash(runtimeType, product, variant);
|
||||
|
||||
/// Create a copy of CheckoutEvent
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -835,9 +871,11 @@ class _$DeleteItemImpl implements _DeleteItem {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -851,16 +889,16 @@ class _$DeleteItemImpl implements _DeleteItem {
|
||||
saveDraftOrder,
|
||||
required TResult Function(DraftOrderModel data) loadDraftOrder,
|
||||
}) {
|
||||
return deleteItem(product);
|
||||
return deleteItem(product, variant);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -873,16 +911,16 @@ class _$DeleteItemImpl implements _DeleteItem {
|
||||
saveDraftOrder,
|
||||
TResult? Function(DraftOrderModel data)? loadDraftOrder,
|
||||
}) {
|
||||
return deleteItem?.call(product);
|
||||
return deleteItem?.call(product, variant);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -897,7 +935,7 @@ class _$DeleteItemImpl implements _DeleteItem {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (deleteItem != null) {
|
||||
return deleteItem(product);
|
||||
return deleteItem(product, variant);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
@@ -971,9 +1009,11 @@ class _$DeleteItemImpl implements _DeleteItem {
|
||||
}
|
||||
|
||||
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;
|
||||
ProductVariant? get variant;
|
||||
|
||||
/// Create a copy of CheckoutEvent
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -1052,9 +1092,11 @@ class _$AddDiscountImpl implements _AddDiscount {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -1075,9 +1117,9 @@ class _$AddDiscountImpl implements _AddDiscount {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -1097,9 +1139,9 @@ class _$AddDiscountImpl implements _AddDiscount {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -1241,9 +1283,11 @@ class _$RemoveDiscountImpl implements _RemoveDiscount {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -1264,9 +1308,9 @@ class _$RemoveDiscountImpl implements _RemoveDiscount {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -1286,9 +1330,9 @@ class _$RemoveDiscountImpl implements _RemoveDiscount {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -1449,9 +1493,11 @@ class _$AddTaxImpl implements _AddTax {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -1472,9 +1518,9 @@ class _$AddTaxImpl implements _AddTax {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -1494,9 +1540,9 @@ class _$AddTaxImpl implements _AddTax {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -1667,9 +1713,11 @@ class _$AddServiceChargeImpl implements _AddServiceCharge {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -1690,9 +1738,9 @@ class _$AddServiceChargeImpl implements _AddServiceCharge {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -1712,9 +1760,9 @@ class _$AddServiceChargeImpl implements _AddServiceCharge {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -1857,9 +1905,11 @@ class _$RemoveTaxImpl implements _RemoveTax {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -1880,9 +1930,9 @@ class _$RemoveTaxImpl implements _RemoveTax {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -1902,9 +1952,9 @@ class _$RemoveTaxImpl implements _RemoveTax {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -2039,9 +2089,11 @@ class _$RemoveServiceChargeImpl implements _RemoveServiceCharge {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -2062,9 +2114,9 @@ class _$RemoveServiceChargeImpl implements _RemoveServiceCharge {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -2084,9 +2136,9 @@ class _$RemoveServiceChargeImpl implements _RemoveServiceCharge {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -2249,9 +2301,11 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -2272,9 +2326,9 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -2294,9 +2348,9 @@ class _$UpdateOrderTypeImpl implements _UpdateOrderType {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -2475,9 +2529,11 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -2498,9 +2554,9 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -2520,9 +2576,9 @@ class _$UpdateItemNotesImpl implements _UpdateItemNotes {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -2715,9 +2771,11 @@ class _$SaveDraftOrderImpl implements _SaveDraftOrder {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -2738,9 +2796,9 @@ class _$SaveDraftOrderImpl implements _SaveDraftOrder {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -2760,9 +2818,9 @@ class _$SaveDraftOrderImpl implements _SaveDraftOrder {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
@@ -2935,9 +2993,11 @@ class _$LoadDraftOrderImpl implements _LoadDraftOrder {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() started,
|
||||
required TResult Function(Product product) addItem,
|
||||
required TResult Function(Product product) removeItem,
|
||||
required TResult Function(Product product) deleteItem,
|
||||
required TResult Function(Product product, ProductVariant? variant) addItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
removeItem,
|
||||
required TResult Function(Product product, ProductVariant? variant)
|
||||
deleteItem,
|
||||
required TResult Function(Discount discount) addDiscount,
|
||||
required TResult Function() removeDiscount,
|
||||
required TResult Function(int tax) addTax,
|
||||
@@ -2958,9 +3018,9 @@ class _$LoadDraftOrderImpl implements _LoadDraftOrder {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? started,
|
||||
TResult? Function(Product product)? addItem,
|
||||
TResult? Function(Product product)? removeItem,
|
||||
TResult? Function(Product product)? deleteItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult? Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult? Function(Discount discount)? addDiscount,
|
||||
TResult? Function()? removeDiscount,
|
||||
TResult? Function(int tax)? addTax,
|
||||
@@ -2980,9 +3040,9 @@ class _$LoadDraftOrderImpl implements _LoadDraftOrder {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? started,
|
||||
TResult Function(Product product)? addItem,
|
||||
TResult Function(Product product)? removeItem,
|
||||
TResult Function(Product product)? deleteItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? addItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? removeItem,
|
||||
TResult Function(Product product, ProductVariant? variant)? deleteItem,
|
||||
TResult Function(Discount discount)? addDiscount,
|
||||
TResult Function()? removeDiscount,
|
||||
TResult Function(int tax)? addTax,
|
||||
|
||||
@@ -4,11 +4,14 @@ part of 'checkout_bloc.dart';
|
||||
class CheckoutEvent with _$CheckoutEvent {
|
||||
const factory CheckoutEvent.started() = _Started;
|
||||
//add item
|
||||
const factory CheckoutEvent.addItem(Product product) = _AddItem;
|
||||
const factory CheckoutEvent.addItem(
|
||||
Product product, ProductVariant? variant) = _AddItem;
|
||||
//remove item
|
||||
const factory CheckoutEvent.removeItem(Product product) = _RemoveItem;
|
||||
const factory CheckoutEvent.removeItem(
|
||||
Product product, ProductVariant? variant) = _RemoveItem;
|
||||
// Delete Item
|
||||
const factory CheckoutEvent.deleteItem(Product product) = _DeleteItem;
|
||||
const factory CheckoutEvent.deleteItem(
|
||||
Product product, ProductVariant? variant) = _DeleteItem;
|
||||
|
||||
//add discount
|
||||
const factory CheckoutEvent.addDiscount(Discount discount) = _AddDiscount;
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:developer';
|
||||
import 'package:bloc/bloc.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/models/response/customer_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/table_model.dart';
|
||||
@@ -37,7 +38,7 @@ class OrderFormBloc extends Bloc<OrderFormEvent, OrderFormState> {
|
||||
tableId: event.table.id,
|
||||
tableNumber: event.table.tableName,
|
||||
outletId: userData.user?.outletId,
|
||||
userId: userData.user?.id,
|
||||
customerId: event.customer?.id ?? '',
|
||||
orderItems: event.items
|
||||
.map(
|
||||
(productQuantity) => OrderItemRequest(
|
||||
@@ -45,6 +46,7 @@ class OrderFormBloc extends Bloc<OrderFormEvent, OrderFormState> {
|
||||
quantity: productQuantity.quantity,
|
||||
notes: productQuantity.notes,
|
||||
unitPrice: productQuantity.product.price,
|
||||
productVariantId: productQuantity.variant?.id,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
@@ -78,7 +80,7 @@ class OrderFormBloc extends Bloc<OrderFormEvent, OrderFormState> {
|
||||
tableId: event.table.id,
|
||||
tableNumber: event.table.tableName,
|
||||
outletId: userData.user?.outletId,
|
||||
userId: userData.user?.id,
|
||||
customerId: event.customer?.id ?? '',
|
||||
orderItems: event.items
|
||||
.map(
|
||||
(productQuantity) => OrderItemRequest(
|
||||
@@ -86,6 +88,7 @@ class OrderFormBloc extends Bloc<OrderFormEvent, OrderFormState> {
|
||||
quantity: productQuantity.quantity,
|
||||
notes: productQuantity.notes,
|
||||
unitPrice: productQuantity.product.price,
|
||||
productVariantId: productQuantity.variant?.id,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
@@ -114,11 +117,15 @@ class OrderFormBloc extends Bloc<OrderFormEvent, OrderFormState> {
|
||||
final result = await _orderRemoteDatasource.addToOrder(
|
||||
orderId: event.orderId,
|
||||
orderItems: event.items
|
||||
.map((item) => OrderItemRequest(
|
||||
.map(
|
||||
(item) => OrderItemRequest(
|
||||
productId: item.product.id,
|
||||
quantity: item.quantity,
|
||||
unitPrice: item.product.price,
|
||||
notes: item.notes))
|
||||
notes: item.notes,
|
||||
productVariantId: item.variant?.id,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
|
||||
|
||||
@@ -20,10 +20,15 @@ mixin _$OrderFormEvent {
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) started,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)
|
||||
Customer? customer, OrderType orderType, TableModel table)
|
||||
create,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
||||
required TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)
|
||||
createWithPayment,
|
||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||
addToOrder,
|
||||
@@ -41,10 +46,15 @@ mixin _$OrderFormEvent {
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? started,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult? Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -59,10 +69,15 @@ mixin _$OrderFormEvent {
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? started,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -204,10 +219,15 @@ class _$StartedImpl implements _Started {
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) started,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)
|
||||
Customer? customer, OrderType orderType, TableModel table)
|
||||
create,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
||||
required TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)
|
||||
createWithPayment,
|
||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||
addToOrder,
|
||||
@@ -228,10 +248,15 @@ class _$StartedImpl implements _Started {
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? started,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult? Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -249,10 +274,15 @@ class _$StartedImpl implements _Started {
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? started,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -340,6 +370,7 @@ abstract class _$$CreateImplCopyWith<$Res> {
|
||||
$Res call(
|
||||
{List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table});
|
||||
}
|
||||
@@ -359,6 +390,7 @@ class __$$CreateImplCopyWithImpl<$Res>
|
||||
$Res call({
|
||||
Object? items = null,
|
||||
Object? customerName = null,
|
||||
Object? customer = freezed,
|
||||
Object? orderType = null,
|
||||
Object? table = null,
|
||||
}) {
|
||||
@@ -371,6 +403,10 @@ class __$$CreateImplCopyWithImpl<$Res>
|
||||
? _value.customerName
|
||||
: customerName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
customer: freezed == customer
|
||||
? _value.customer
|
||||
: customer // ignore: cast_nullable_to_non_nullable
|
||||
as Customer?,
|
||||
orderType: null == orderType
|
||||
? _value.orderType
|
||||
: orderType // ignore: cast_nullable_to_non_nullable
|
||||
@@ -389,6 +425,7 @@ class _$CreateImpl implements _Create {
|
||||
const _$CreateImpl(
|
||||
{required final List<ProductQuantity> items,
|
||||
required this.customerName,
|
||||
required this.customer,
|
||||
required this.orderType,
|
||||
required this.table})
|
||||
: _items = items;
|
||||
@@ -404,13 +441,15 @@ class _$CreateImpl implements _Create {
|
||||
@override
|
||||
final String customerName;
|
||||
@override
|
||||
final Customer? customer;
|
||||
@override
|
||||
final OrderType orderType;
|
||||
@override
|
||||
final TableModel table;
|
||||
|
||||
@override
|
||||
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
|
||||
@@ -421,6 +460,8 @@ class _$CreateImpl implements _Create {
|
||||
const DeepCollectionEquality().equals(other._items, _items) &&
|
||||
(identical(other.customerName, customerName) ||
|
||||
other.customerName == customerName) &&
|
||||
(identical(other.customer, customer) ||
|
||||
other.customer == customer) &&
|
||||
(identical(other.orderType, orderType) ||
|
||||
other.orderType == orderType) &&
|
||||
(identical(other.table, table) || other.table == table));
|
||||
@@ -431,6 +472,7 @@ class _$CreateImpl implements _Create {
|
||||
runtimeType,
|
||||
const DeepCollectionEquality().hash(_items),
|
||||
customerName,
|
||||
customer,
|
||||
orderType,
|
||||
table);
|
||||
|
||||
@@ -447,10 +489,15 @@ class _$CreateImpl implements _Create {
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) started,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)
|
||||
Customer? customer, OrderType orderType, TableModel table)
|
||||
create,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
||||
required TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)
|
||||
createWithPayment,
|
||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||
addToOrder,
|
||||
@@ -463,7 +510,7 @@ class _$CreateImpl implements _Create {
|
||||
required TResult Function(OrderItem item) toggleItem,
|
||||
required TResult Function(bool selectAll) toggleSelectAll,
|
||||
}) {
|
||||
return create(items, customerName, orderType, table);
|
||||
return create(items, customerName, customer, orderType, table);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -471,10 +518,15 @@ class _$CreateImpl implements _Create {
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? started,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult? Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -484,7 +536,7 @@ class _$CreateImpl implements _Create {
|
||||
TResult? Function(OrderItem item)? toggleItem,
|
||||
TResult? Function(bool selectAll)? toggleSelectAll,
|
||||
}) {
|
||||
return create?.call(items, customerName, orderType, table);
|
||||
return create?.call(items, customerName, customer, orderType, table);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -492,10 +544,15 @@ class _$CreateImpl implements _Create {
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? started,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -507,7 +564,7 @@ class _$CreateImpl implements _Create {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (create != null) {
|
||||
return create(items, customerName, orderType, table);
|
||||
return create(items, customerName, customer, orderType, table);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
@@ -566,11 +623,13 @@ abstract class _Create implements OrderFormEvent {
|
||||
const factory _Create(
|
||||
{required final List<ProductQuantity> items,
|
||||
required final String customerName,
|
||||
required final Customer? customer,
|
||||
required final OrderType orderType,
|
||||
required final TableModel table}) = _$CreateImpl;
|
||||
|
||||
List<ProductQuantity> get items;
|
||||
String get customerName;
|
||||
Customer? get customer;
|
||||
OrderType get orderType;
|
||||
TableModel get table;
|
||||
|
||||
@@ -591,6 +650,7 @@ abstract class _$$CreateWithPaymentMethodImplCopyWith<$Res> {
|
||||
$Res call(
|
||||
{List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod});
|
||||
@@ -612,6 +672,7 @@ class __$$CreateWithPaymentMethodImplCopyWithImpl<$Res>
|
||||
$Res call({
|
||||
Object? items = null,
|
||||
Object? customerName = null,
|
||||
Object? customer = freezed,
|
||||
Object? orderType = null,
|
||||
Object? table = null,
|
||||
Object? paymentMethod = null,
|
||||
@@ -625,6 +686,10 @@ class __$$CreateWithPaymentMethodImplCopyWithImpl<$Res>
|
||||
? _value.customerName
|
||||
: customerName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
customer: freezed == customer
|
||||
? _value.customer
|
||||
: customer // ignore: cast_nullable_to_non_nullable
|
||||
as Customer?,
|
||||
orderType: null == orderType
|
||||
? _value.orderType
|
||||
: orderType // ignore: cast_nullable_to_non_nullable
|
||||
@@ -647,6 +712,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
||||
const _$CreateWithPaymentMethodImpl(
|
||||
{required final List<ProductQuantity> items,
|
||||
required this.customerName,
|
||||
required this.customer,
|
||||
required this.orderType,
|
||||
required this.table,
|
||||
required this.paymentMethod})
|
||||
@@ -663,6 +729,8 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
||||
@override
|
||||
final String customerName;
|
||||
@override
|
||||
final Customer? customer;
|
||||
@override
|
||||
final OrderType orderType;
|
||||
@override
|
||||
final TableModel table;
|
||||
@@ -671,7 +739,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
||||
|
||||
@override
|
||||
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
|
||||
@@ -682,6 +750,8 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
||||
const DeepCollectionEquality().equals(other._items, _items) &&
|
||||
(identical(other.customerName, customerName) ||
|
||||
other.customerName == customerName) &&
|
||||
(identical(other.customer, customer) ||
|
||||
other.customer == customer) &&
|
||||
(identical(other.orderType, orderType) ||
|
||||
other.orderType == orderType) &&
|
||||
(identical(other.table, table) || other.table == table) &&
|
||||
@@ -694,6 +764,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
||||
runtimeType,
|
||||
const DeepCollectionEquality().hash(_items),
|
||||
customerName,
|
||||
customer,
|
||||
orderType,
|
||||
table,
|
||||
paymentMethod);
|
||||
@@ -712,10 +783,15 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) started,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)
|
||||
Customer? customer, OrderType orderType, TableModel table)
|
||||
create,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
||||
required TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)
|
||||
createWithPayment,
|
||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||
addToOrder,
|
||||
@@ -729,7 +805,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
||||
required TResult Function(bool selectAll) toggleSelectAll,
|
||||
}) {
|
||||
return createWithPayment(
|
||||
items, customerName, orderType, table, paymentMethod);
|
||||
items, customerName, customer, orderType, table, paymentMethod);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -737,10 +813,15 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? started,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult? Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -751,7 +832,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
||||
TResult? Function(bool selectAll)? toggleSelectAll,
|
||||
}) {
|
||||
return createWithPayment?.call(
|
||||
items, customerName, orderType, table, paymentMethod);
|
||||
items, customerName, customer, orderType, table, paymentMethod);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -759,10 +840,15 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? started,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -775,7 +861,7 @@ class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
|
||||
}) {
|
||||
if (createWithPayment != null) {
|
||||
return createWithPayment(
|
||||
items, customerName, orderType, table, paymentMethod);
|
||||
items, customerName, customer, orderType, table, paymentMethod);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
@@ -834,6 +920,7 @@ abstract class _CreateWithPaymentMethod implements OrderFormEvent {
|
||||
const factory _CreateWithPaymentMethod(
|
||||
{required final List<ProductQuantity> items,
|
||||
required final String customerName,
|
||||
required final Customer? customer,
|
||||
required final OrderType orderType,
|
||||
required final TableModel table,
|
||||
required final PaymentMethod paymentMethod}) =
|
||||
@@ -841,6 +928,7 @@ abstract class _CreateWithPaymentMethod implements OrderFormEvent {
|
||||
|
||||
List<ProductQuantity> get items;
|
||||
String get customerName;
|
||||
Customer? get customer;
|
||||
OrderType get orderType;
|
||||
TableModel get table;
|
||||
PaymentMethod get paymentMethod;
|
||||
@@ -939,10 +1027,15 @@ class _$AddToOrderImpl implements _AddToOrder {
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) started,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)
|
||||
Customer? customer, OrderType orderType, TableModel table)
|
||||
create,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
||||
required TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)
|
||||
createWithPayment,
|
||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||
addToOrder,
|
||||
@@ -963,10 +1056,15 @@ class _$AddToOrderImpl implements _AddToOrder {
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? started,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult? Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -984,10 +1082,15 @@ class _$AddToOrderImpl implements _AddToOrder {
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? started,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -1166,10 +1269,15 @@ class _$RefundImpl implements _Refund {
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) started,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)
|
||||
Customer? customer, OrderType orderType, TableModel table)
|
||||
create,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
||||
required TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)
|
||||
createWithPayment,
|
||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||
addToOrder,
|
||||
@@ -1190,10 +1298,15 @@ class _$RefundImpl implements _Refund {
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? started,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult? Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -1211,10 +1324,15 @@ class _$RefundImpl implements _Refund {
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? started,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -1395,10 +1513,15 @@ class _$VoidOrderImpl implements _VoidOrder {
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) started,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)
|
||||
Customer? customer, OrderType orderType, TableModel table)
|
||||
create,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
||||
required TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)
|
||||
createWithPayment,
|
||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||
addToOrder,
|
||||
@@ -1419,10 +1542,15 @@ class _$VoidOrderImpl implements _VoidOrder {
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? started,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult? Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -1440,10 +1568,15 @@ class _$VoidOrderImpl implements _VoidOrder {
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? started,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -1597,10 +1730,15 @@ class _$ToggleItemImpl implements _ToggleItem {
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) started,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)
|
||||
Customer? customer, OrderType orderType, TableModel table)
|
||||
create,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
||||
required TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)
|
||||
createWithPayment,
|
||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||
addToOrder,
|
||||
@@ -1621,10 +1759,15 @@ class _$ToggleItemImpl implements _ToggleItem {
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? started,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult? Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -1642,10 +1785,15 @@ class _$ToggleItemImpl implements _ToggleItem {
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? started,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -1796,10 +1944,15 @@ class _$ToggleSelectAllImpl implements _ToggleSelectAll {
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) started,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)
|
||||
Customer? customer, OrderType orderType, TableModel table)
|
||||
create,
|
||||
required TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)
|
||||
required TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)
|
||||
createWithPayment,
|
||||
required TResult Function(List<ProductQuantity> items, String orderId)
|
||||
addToOrder,
|
||||
@@ -1820,10 +1973,15 @@ class _$ToggleSelectAllImpl implements _ToggleSelectAll {
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? started,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult? Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult? Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult? Function(List<OrderItem> items, String orderId, String reason)?
|
||||
@@ -1841,10 +1999,15 @@ class _$ToggleSelectAllImpl implements _ToggleSelectAll {
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? started,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table)?
|
||||
Customer? customer, OrderType orderType, TableModel table)?
|
||||
create,
|
||||
TResult Function(List<ProductQuantity> items, String customerName,
|
||||
OrderType orderType, TableModel table, PaymentMethod paymentMethod)?
|
||||
TResult Function(
|
||||
List<ProductQuantity> items,
|
||||
String customerName,
|
||||
Customer? customer,
|
||||
OrderType orderType,
|
||||
TableModel table,
|
||||
PaymentMethod paymentMethod)?
|
||||
createWithPayment,
|
||||
TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
|
||||
TResult Function(List<OrderItem> items, String orderId, String reason)?
|
||||
|
||||
@@ -6,12 +6,14 @@ class OrderFormEvent with _$OrderFormEvent {
|
||||
const factory OrderFormEvent.create({
|
||||
required List<ProductQuantity> items,
|
||||
required String customerName,
|
||||
required Customer? customer,
|
||||
required OrderType orderType,
|
||||
required TableModel table,
|
||||
}) = _Create;
|
||||
const factory OrderFormEvent.createWithPayment({
|
||||
required List<ProductQuantity> items,
|
||||
required String customerName,
|
||||
required Customer? customer,
|
||||
required OrderType orderType,
|
||||
required TableModel table,
|
||||
required PaymentMethod paymentMethod,
|
||||
|
||||
@@ -19,13 +19,5 @@ class OutletLoaderBloc extends Bloc<OutletLoaderEvent, OutletLoaderState> {
|
||||
(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
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() getOutlet,
|
||||
required TResult Function() currentOutlet,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? getOutlet,
|
||||
TResult? Function()? currentOutlet,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? getOutlet,
|
||||
TResult Function()? currentOutlet,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>({
|
||||
required TResult Function(_GetOutlet value) getOutlet,
|
||||
required TResult Function(_CurrentOutlet value) currentOutlet,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>({
|
||||
TResult? Function(_GetOutlet value)? getOutlet,
|
||||
TResult? Function(_CurrentOutlet value)? currentOutlet,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>({
|
||||
TResult Function(_GetOutlet value)? getOutlet,
|
||||
TResult Function(_CurrentOutlet value)? currentOutlet,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@@ -119,7 +113,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function() getOutlet,
|
||||
required TResult Function() currentOutlet,
|
||||
}) {
|
||||
return getOutlet();
|
||||
}
|
||||
@@ -128,7 +121,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function()? getOutlet,
|
||||
TResult? Function()? currentOutlet,
|
||||
}) {
|
||||
return getOutlet?.call();
|
||||
}
|
||||
@@ -137,7 +129,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function()? getOutlet,
|
||||
TResult Function()? currentOutlet,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (getOutlet != null) {
|
||||
@@ -150,7 +141,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>({
|
||||
required TResult Function(_GetOutlet value) getOutlet,
|
||||
required TResult Function(_CurrentOutlet value) currentOutlet,
|
||||
}) {
|
||||
return getOutlet(this);
|
||||
}
|
||||
@@ -159,7 +149,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>({
|
||||
TResult? Function(_GetOutlet value)? getOutlet,
|
||||
TResult? Function(_CurrentOutlet value)? currentOutlet,
|
||||
}) {
|
||||
return getOutlet?.call(this);
|
||||
}
|
||||
@@ -168,7 +157,6 @@ class _$GetOutletImpl implements _GetOutlet {
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>({
|
||||
TResult Function(_GetOutlet value)? getOutlet,
|
||||
TResult Function(_CurrentOutlet value)? currentOutlet,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (getOutlet != null) {
|
||||
@@ -182,111 +170,6 @@ abstract class _GetOutlet implements OutletLoaderEvent {
|
||||
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
|
||||
mixin _$OutletLoaderState {
|
||||
@optionalTypeArgs
|
||||
@@ -295,9 +178,6 @@ mixin _$OutletLoaderState {
|
||||
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,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
@@ -306,9 +186,6 @@ mixin _$OutletLoaderState {
|
||||
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,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
@@ -317,9 +194,6 @@ mixin _$OutletLoaderState {
|
||||
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(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@@ -329,9 +203,6 @@ mixin _$OutletLoaderState {
|
||||
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,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
@@ -340,9 +211,6 @@ mixin _$OutletLoaderState {
|
||||
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,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
@@ -351,9 +219,6 @@ mixin _$OutletLoaderState {
|
||||
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(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@@ -425,9 +290,6 @@ class _$InitialImpl implements _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 initial();
|
||||
}
|
||||
@@ -439,9 +301,6 @@ class _$InitialImpl implements _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 initial?.call();
|
||||
}
|
||||
@@ -453,9 +312,6 @@ class _$InitialImpl implements _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 (initial != null) {
|
||||
@@ -471,9 +327,6 @@ class _$InitialImpl implements _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 initial(this);
|
||||
}
|
||||
@@ -485,9 +338,6 @@ class _$InitialImpl implements _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 initial?.call(this);
|
||||
}
|
||||
@@ -499,9 +349,6 @@ class _$InitialImpl implements _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 (initial != null) {
|
||||
@@ -560,9 +407,6 @@ class _$LoadingImpl implements _Loading {
|
||||
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 loading();
|
||||
}
|
||||
@@ -574,9 +418,6 @@ class _$LoadingImpl implements _Loading {
|
||||
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 loading?.call();
|
||||
}
|
||||
@@ -588,9 +429,6 @@ class _$LoadingImpl implements _Loading {
|
||||
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 (loading != null) {
|
||||
@@ -606,9 +444,6 @@ class _$LoadingImpl implements _Loading {
|
||||
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 loading(this);
|
||||
}
|
||||
@@ -620,9 +455,6 @@ class _$LoadingImpl implements _Loading {
|
||||
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 loading?.call(this);
|
||||
}
|
||||
@@ -634,9 +466,6 @@ class _$LoadingImpl implements _Loading {
|
||||
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 (loading != null) {
|
||||
@@ -728,9 +557,6 @@ class _$LoadedImpl implements _Loaded {
|
||||
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 loaded(outlets);
|
||||
}
|
||||
@@ -742,9 +568,6 @@ class _$LoadedImpl implements _Loaded {
|
||||
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 loaded?.call(outlets);
|
||||
}
|
||||
@@ -756,9 +579,6 @@ class _$LoadedImpl implements _Loaded {
|
||||
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 (loaded != null) {
|
||||
@@ -774,9 +594,6 @@ class _$LoadedImpl implements _Loaded {
|
||||
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 loaded(this);
|
||||
}
|
||||
@@ -788,9 +605,6 @@ class _$LoadedImpl implements _Loaded {
|
||||
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 loaded?.call(this);
|
||||
}
|
||||
@@ -802,9 +616,6 @@ class _$LoadedImpl implements _Loaded {
|
||||
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 (loaded != null) {
|
||||
@@ -898,9 +709,6 @@ class _$ErrorImpl implements _Error {
|
||||
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 error(message);
|
||||
}
|
||||
@@ -912,9 +720,6 @@ class _$ErrorImpl implements _Error {
|
||||
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 error?.call(message);
|
||||
}
|
||||
@@ -926,9 +731,6 @@ class _$ErrorImpl implements _Error {
|
||||
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 (error != null) {
|
||||
@@ -944,9 +746,6 @@ class _$ErrorImpl implements _Error {
|
||||
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 error(this);
|
||||
}
|
||||
@@ -958,9 +757,6 @@ class _$ErrorImpl implements _Error {
|
||||
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 error?.call(this);
|
||||
}
|
||||
@@ -972,9 +768,6 @@ class _$ErrorImpl implements _Error {
|
||||
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 (error != null) {
|
||||
@@ -995,478 +788,3 @@ abstract class _Error implements OutletLoaderState {
|
||||
_$$ErrorImplCopyWith<_$ErrorImpl> get copyWith =>
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user