dev #1
@ -3255,10 +3255,10 @@ class __$$UpdateDeliveryTypeImplCopyWithImpl<$Res>
|
|||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline')
|
||||||
@override
|
@override
|
||||||
$Res call({
|
$Res call({
|
||||||
Object? delivery = freezed,
|
Object? delivery = null,
|
||||||
}) {
|
}) {
|
||||||
return _then(_$UpdateDeliveryTypeImpl(
|
return _then(_$UpdateDeliveryTypeImpl(
|
||||||
freezed == delivery
|
null == delivery
|
||||||
? _value.delivery
|
? _value.delivery
|
||||||
: delivery // ignore: cast_nullable_to_non_nullable
|
: delivery // ignore: cast_nullable_to_non_nullable
|
||||||
as DeliveryModel,
|
as DeliveryModel,
|
||||||
@ -3284,12 +3284,12 @@ class _$UpdateDeliveryTypeImpl implements _UpdateDeliveryType {
|
|||||||
return identical(this, other) ||
|
return identical(this, other) ||
|
||||||
(other.runtimeType == runtimeType &&
|
(other.runtimeType == runtimeType &&
|
||||||
other is _$UpdateDeliveryTypeImpl &&
|
other is _$UpdateDeliveryTypeImpl &&
|
||||||
const DeepCollectionEquality().equals(other.delivery, delivery));
|
(identical(other.delivery, delivery) ||
|
||||||
|
other.delivery == delivery));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode => Object.hash(runtimeType, delivery);
|
||||||
Object.hash(runtimeType, const DeepCollectionEquality().hash(delivery));
|
|
||||||
|
|
||||||
/// Create a copy of CheckoutEvent
|
/// Create a copy of CheckoutEvent
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@ -4063,8 +4063,8 @@ class _$LoadedImpl implements _Loaded {
|
|||||||
other.draftName == draftName) &&
|
other.draftName == draftName) &&
|
||||||
(identical(other.orderType, orderType) ||
|
(identical(other.orderType, orderType) ||
|
||||||
other.orderType == orderType) &&
|
other.orderType == orderType) &&
|
||||||
const DeepCollectionEquality()
|
(identical(other.deliveryType, deliveryType) ||
|
||||||
.equals(other.deliveryType, deliveryType));
|
other.deliveryType == deliveryType));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -4080,7 +4080,7 @@ class _$LoadedImpl implements _Loaded {
|
|||||||
totalPrice,
|
totalPrice,
|
||||||
draftName,
|
draftName,
|
||||||
orderType,
|
orderType,
|
||||||
const DeepCollectionEquality().hash(deliveryType));
|
deliveryType);
|
||||||
|
|
||||||
/// Create a copy of CheckoutState
|
/// Create a copy of CheckoutState
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:dropdown_search/dropdown_search.dart';
|
||||||
import 'package:enaklo_pos/core/components/buttons.dart';
|
import 'package:enaklo_pos/core/components/buttons.dart';
|
||||||
import 'package:enaklo_pos/core/components/custom_modal_dialog.dart';
|
import 'package:enaklo_pos/core/components/custom_modal_dialog.dart';
|
||||||
import 'package:enaklo_pos/core/components/flushbar.dart';
|
import 'package:enaklo_pos/core/components/flushbar.dart';
|
||||||
@ -31,6 +34,7 @@ class _PaymentAddOrderDialogState extends State<PaymentAddOrderDialog> {
|
|||||||
'pending',
|
'pending',
|
||||||
dateFrom: DateTime.now(),
|
dateFrom: DateTime.now(),
|
||||||
dateTo: DateTime.now(),
|
dateTo: DateTime.now(),
|
||||||
|
limit: 20,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -97,40 +101,183 @@ class _PaymentAddOrderDialogState extends State<PaymentAddOrderDialog> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return DropdownSearch<Order>(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
items: orders,
|
||||||
decoration: BoxDecoration(
|
selectedItem: selectOrder,
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
// Dropdown properties
|
||||||
border: Border.all(
|
dropdownDecoratorProps: DropDownDecoratorProps(
|
||||||
color: Theme.of(context).primaryColor,
|
dropdownSearchDecoration: InputDecoration(
|
||||||
width: 2,
|
hintText: "Pilih Meja",
|
||||||
|
hintStyle: TextStyle(
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
prefixIcon: Icon(
|
||||||
|
Icons.category_outlined,
|
||||||
|
color: Colors.grey.shade500,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.blue.shade400,
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 16,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: DropdownButtonHideUnderline(
|
|
||||||
child: DropdownButton<Order>(
|
// Popup properties
|
||||||
isExpanded: true,
|
popupProps: PopupProps.menu(
|
||||||
value: availableOrders.firstWhere(
|
showSearchBox: true,
|
||||||
(t) => t.id == selectOrder?.id,
|
searchFieldProps: TextFieldProps(
|
||||||
orElse: () => availableOrders.first,
|
decoration: InputDecoration(
|
||||||
|
hintText: "Cari meja...",
|
||||||
|
prefixIcon: const Icon(Icons.search),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 12,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
onChanged: (Order? newValue) {
|
),
|
||||||
setState(() {
|
menuProps: MenuProps(
|
||||||
selectOrder = newValue;
|
backgroundColor: Colors.white,
|
||||||
});
|
elevation: 8,
|
||||||
},
|
shape: RoundedRectangleBorder(
|
||||||
items: availableOrders
|
borderRadius: BorderRadius.circular(12),
|
||||||
.map<DropdownMenuItem<Order>>(
|
),
|
||||||
(Order value) => DropdownMenuItem<Order>(
|
),
|
||||||
value: value,
|
itemBuilder: (context, order, isSelected) {
|
||||||
child: Text(
|
return Container(
|
||||||
"${value.tableNumber ?? ""} - ${value.metadata?['customer_name'] ?? ""}",
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 12,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isSelected
|
||||||
|
? Colors.blue.shade50
|
||||||
|
: Colors.transparent,
|
||||||
|
border: Border(
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Colors.grey.shade100,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 8,
|
||||||
|
height: 8,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isSelected
|
||||||
|
? Colors.blue.shade600
|
||||||
|
: Colors.grey.shade400,
|
||||||
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
const SizedBox(width: 12),
|
||||||
.toList(),
|
Expanded(
|
||||||
),
|
child: Text(
|
||||||
|
"${order.tableNumber ?? ""} - ${order.metadata?['customer_name']}",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: isSelected
|
||||||
|
? FontWeight.w600
|
||||||
|
: FontWeight.w500,
|
||||||
|
color: isSelected
|
||||||
|
? Colors.blue.shade700
|
||||||
|
: Colors.black87,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (isSelected)
|
||||||
|
Icon(
|
||||||
|
Icons.check,
|
||||||
|
color: Colors.blue.shade600,
|
||||||
|
size: 18,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
emptyBuilder: (context, searchEntry) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.all(20),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.search_off,
|
||||||
|
color: Colors.grey.shade400,
|
||||||
|
size: 48,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Text(
|
||||||
|
searchEntry.isEmpty
|
||||||
|
? "Tidak ada meja tersedia"
|
||||||
|
: "Tidak ditemukan meja dengan '${searchEntry}'",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// Item as string (for search functionality)
|
||||||
|
itemAsString: (Order order) => order.tableNumber ?? "",
|
||||||
|
|
||||||
|
// Comparison function
|
||||||
|
compareFn: (Order? item1, Order? item2) {
|
||||||
|
return item1?.id == item2?.id;
|
||||||
|
},
|
||||||
|
|
||||||
|
// On changed callback
|
||||||
|
onChanged: (Order? selectedOrder) {
|
||||||
|
if (selectedOrder != null) {
|
||||||
|
setState(() {
|
||||||
|
selectOrder = selectedOrder;
|
||||||
|
});
|
||||||
|
log("selectOrder: ${selectOrder!.tableNumber}");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Validator (optional)
|
||||||
|
validator: (Order? value) {
|
||||||
|
if (value == null) {
|
||||||
|
return "Meja harus dipilih";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:dropdown_search/dropdown_search.dart';
|
||||||
import 'package:enaklo_pos/core/components/buttons.dart';
|
import 'package:enaklo_pos/core/components/buttons.dart';
|
||||||
import 'package:enaklo_pos/core/components/custom_modal_dialog.dart';
|
import 'package:enaklo_pos/core/components/custom_modal_dialog.dart';
|
||||||
import 'package:enaklo_pos/core/components/flushbar.dart';
|
import 'package:enaklo_pos/core/components/flushbar.dart';
|
||||||
@ -103,39 +106,183 @@ class _PaymentSaveDialogState extends State<PaymentSaveDialog> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return DropdownSearch<TableModel>(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
items: tables,
|
||||||
decoration: BoxDecoration(
|
selectedItem: selectTable,
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
// Dropdown properties
|
||||||
border: Border.all(
|
dropdownDecoratorProps: DropDownDecoratorProps(
|
||||||
color: Theme.of(context).primaryColor,
|
dropdownSearchDecoration: InputDecoration(
|
||||||
width: 2,
|
hintText: "Pilih meja",
|
||||||
),
|
hintStyle: TextStyle(
|
||||||
),
|
color: Colors.grey.shade600,
|
||||||
child: DropdownButtonHideUnderline(
|
fontSize: 14,
|
||||||
child: DropdownButton<TableModel>(
|
),
|
||||||
isExpanded: true,
|
prefixIcon: Icon(
|
||||||
value: availableTables.firstWhere(
|
Icons.category_outlined,
|
||||||
(t) => t.id == selectTable?.id,
|
color: Colors.grey.shade500,
|
||||||
orElse: () => availableTables.first,
|
size: 20,
|
||||||
|
),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.blue.shade400,
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 16,
|
||||||
),
|
),
|
||||||
onChanged: (TableModel? newValue) {
|
|
||||||
setState(() {
|
|
||||||
selectTable = newValue;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
items: availableTables
|
|
||||||
.map<DropdownMenuItem<TableModel>>(
|
|
||||||
(TableModel value) =>
|
|
||||||
DropdownMenuItem<TableModel>(
|
|
||||||
value: value,
|
|
||||||
child: Text(value.tableName ?? ""),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.toList(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// Popup properties
|
||||||
|
popupProps: PopupProps.menu(
|
||||||
|
showSearchBox: true,
|
||||||
|
searchFieldProps: TextFieldProps(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: "Cari meja...",
|
||||||
|
prefixIcon: const Icon(Icons.search),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
menuProps: MenuProps(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
elevation: 8,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
itemBuilder: (context, category, isSelected) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 12,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isSelected
|
||||||
|
? Colors.blue.shade50
|
||||||
|
: Colors.transparent,
|
||||||
|
border: Border(
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Colors.grey.shade100,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 8,
|
||||||
|
height: 8,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isSelected
|
||||||
|
? Colors.blue.shade600
|
||||||
|
: Colors.grey.shade400,
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
category.tableName ?? "",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: isSelected
|
||||||
|
? FontWeight.w600
|
||||||
|
: FontWeight.w500,
|
||||||
|
color: isSelected
|
||||||
|
? Colors.blue.shade700
|
||||||
|
: Colors.black87,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (isSelected)
|
||||||
|
Icon(
|
||||||
|
Icons.check,
|
||||||
|
color: Colors.blue.shade600,
|
||||||
|
size: 18,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
emptyBuilder: (context, searchEntry) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.all(20),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.search_off,
|
||||||
|
color: Colors.grey.shade400,
|
||||||
|
size: 48,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Text(
|
||||||
|
searchEntry.isEmpty
|
||||||
|
? "Tidak ada meja tersedia"
|
||||||
|
: "Tidak ditemukan meja dengan '${searchEntry}'",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
|
// Item as string (for search functionality)
|
||||||
|
itemAsString: (TableModel table) => table.tableName ?? "",
|
||||||
|
|
||||||
|
// Comparison function
|
||||||
|
compareFn: (TableModel? item1, TableModel? item2) {
|
||||||
|
return item1?.id == item2?.id;
|
||||||
|
},
|
||||||
|
|
||||||
|
// On changed callback
|
||||||
|
onChanged: (TableModel? selectedTable) {
|
||||||
|
if (selectedTable != null) {
|
||||||
|
setState(() {
|
||||||
|
selectTable = selectedTable;
|
||||||
|
});
|
||||||
|
log("selectTable: ${selectTable!.tableName}");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Validator (optional)
|
||||||
|
validator: (TableModel? value) {
|
||||||
|
if (value == null) {
|
||||||
|
return "Meja harus dipilih";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class OrderLoaderBloc extends Bloc<OrderLoaderEvent, OrderLoaderState> {
|
|||||||
|
|
||||||
final result = await _orderRemoteDatasource.getOrder(
|
final result = await _orderRemoteDatasource.getOrder(
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 10,
|
limit: event.limit ?? 10,
|
||||||
status: event.status,
|
status: event.status,
|
||||||
dateFrom: event.dateFrom,
|
dateFrom: event.dateFrom,
|
||||||
dateTo: event.dateTo,
|
dateTo: event.dateTo,
|
||||||
|
|||||||
@ -18,7 +18,8 @@ final _privateConstructorUsedError = UnsupportedError(
|
|||||||
mixin _$OrderLoaderEvent {
|
mixin _$OrderLoaderEvent {
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
required TResult Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)
|
||||||
getByStatus,
|
getByStatus,
|
||||||
required TResult Function(String id) getById,
|
required TResult Function(String id) getById,
|
||||||
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
||||||
@ -28,7 +29,8 @@ mixin _$OrderLoaderEvent {
|
|||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult? Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)?
|
||||||
getByStatus,
|
getByStatus,
|
||||||
TResult? Function(String id)? getById,
|
TResult? Function(String id)? getById,
|
||||||
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
||||||
@ -38,7 +40,8 @@ mixin _$OrderLoaderEvent {
|
|||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)?
|
||||||
getByStatus,
|
getByStatus,
|
||||||
TResult Function(String id)? getById,
|
TResult Function(String id)? getById,
|
||||||
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
||||||
@ -101,7 +104,7 @@ abstract class _$$GetByStatusImplCopyWith<$Res> {
|
|||||||
_$GetByStatusImpl value, $Res Function(_$GetByStatusImpl) then) =
|
_$GetByStatusImpl value, $Res Function(_$GetByStatusImpl) then) =
|
||||||
__$$GetByStatusImplCopyWithImpl<$Res>;
|
__$$GetByStatusImplCopyWithImpl<$Res>;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({String status, DateTime dateFrom, DateTime dateTo});
|
$Res call({String status, DateTime dateFrom, DateTime dateTo, int? limit});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@ -120,6 +123,7 @@ class __$$GetByStatusImplCopyWithImpl<$Res>
|
|||||||
Object? status = null,
|
Object? status = null,
|
||||||
Object? dateFrom = null,
|
Object? dateFrom = null,
|
||||||
Object? dateTo = null,
|
Object? dateTo = null,
|
||||||
|
Object? limit = freezed,
|
||||||
}) {
|
}) {
|
||||||
return _then(_$GetByStatusImpl(
|
return _then(_$GetByStatusImpl(
|
||||||
null == status
|
null == status
|
||||||
@ -134,6 +138,10 @@ class __$$GetByStatusImplCopyWithImpl<$Res>
|
|||||||
? _value.dateTo
|
? _value.dateTo
|
||||||
: dateTo // ignore: cast_nullable_to_non_nullable
|
: dateTo // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,
|
as DateTime,
|
||||||
|
limit: freezed == limit
|
||||||
|
? _value.limit
|
||||||
|
: limit // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int?,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -142,7 +150,7 @@ class __$$GetByStatusImplCopyWithImpl<$Res>
|
|||||||
|
|
||||||
class _$GetByStatusImpl implements _GetByStatus {
|
class _$GetByStatusImpl implements _GetByStatus {
|
||||||
const _$GetByStatusImpl(this.status,
|
const _$GetByStatusImpl(this.status,
|
||||||
{required this.dateFrom, required this.dateTo});
|
{required this.dateFrom, required this.dateTo, this.limit});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final String status;
|
final String status;
|
||||||
@ -150,10 +158,12 @@ class _$GetByStatusImpl implements _GetByStatus {
|
|||||||
final DateTime dateFrom;
|
final DateTime dateFrom;
|
||||||
@override
|
@override
|
||||||
final DateTime dateTo;
|
final DateTime dateTo;
|
||||||
|
@override
|
||||||
|
final int? limit;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'OrderLoaderEvent.getByStatus(status: $status, dateFrom: $dateFrom, dateTo: $dateTo)';
|
return 'OrderLoaderEvent.getByStatus(status: $status, dateFrom: $dateFrom, dateTo: $dateTo, limit: $limit)';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -164,11 +174,12 @@ class _$GetByStatusImpl implements _GetByStatus {
|
|||||||
(identical(other.status, status) || other.status == status) &&
|
(identical(other.status, status) || other.status == status) &&
|
||||||
(identical(other.dateFrom, dateFrom) ||
|
(identical(other.dateFrom, dateFrom) ||
|
||||||
other.dateFrom == dateFrom) &&
|
other.dateFrom == dateFrom) &&
|
||||||
(identical(other.dateTo, dateTo) || other.dateTo == dateTo));
|
(identical(other.dateTo, dateTo) || other.dateTo == dateTo) &&
|
||||||
|
(identical(other.limit, limit) || other.limit == limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType, status, dateFrom, dateTo);
|
int get hashCode => Object.hash(runtimeType, status, dateFrom, dateTo, limit);
|
||||||
|
|
||||||
/// Create a copy of OrderLoaderEvent
|
/// Create a copy of OrderLoaderEvent
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@ -181,33 +192,36 @@ class _$GetByStatusImpl implements _GetByStatus {
|
|||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
required TResult Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)
|
||||||
getByStatus,
|
getByStatus,
|
||||||
required TResult Function(String id) getById,
|
required TResult Function(String id) getById,
|
||||||
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
||||||
loadMore,
|
loadMore,
|
||||||
required TResult Function(String status) refresh,
|
required TResult Function(String status) refresh,
|
||||||
}) {
|
}) {
|
||||||
return getByStatus(status, dateFrom, dateTo);
|
return getByStatus(status, dateFrom, dateTo, limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult? Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)?
|
||||||
getByStatus,
|
getByStatus,
|
||||||
TResult? Function(String id)? getById,
|
TResult? Function(String id)? getById,
|
||||||
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
||||||
loadMore,
|
loadMore,
|
||||||
TResult? Function(String status)? refresh,
|
TResult? Function(String status)? refresh,
|
||||||
}) {
|
}) {
|
||||||
return getByStatus?.call(status, dateFrom, dateTo);
|
return getByStatus?.call(status, dateFrom, dateTo, limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)?
|
||||||
getByStatus,
|
getByStatus,
|
||||||
TResult Function(String id)? getById,
|
TResult Function(String id)? getById,
|
||||||
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
||||||
@ -216,7 +230,7 @@ class _$GetByStatusImpl implements _GetByStatus {
|
|||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
if (getByStatus != null) {
|
if (getByStatus != null) {
|
||||||
return getByStatus(status, dateFrom, dateTo);
|
return getByStatus(status, dateFrom, dateTo, limit);
|
||||||
}
|
}
|
||||||
return orElse();
|
return orElse();
|
||||||
}
|
}
|
||||||
@ -262,11 +276,13 @@ class _$GetByStatusImpl implements _GetByStatus {
|
|||||||
abstract class _GetByStatus implements OrderLoaderEvent {
|
abstract class _GetByStatus implements OrderLoaderEvent {
|
||||||
const factory _GetByStatus(final String status,
|
const factory _GetByStatus(final String status,
|
||||||
{required final DateTime dateFrom,
|
{required final DateTime dateFrom,
|
||||||
required final DateTime dateTo}) = _$GetByStatusImpl;
|
required final DateTime dateTo,
|
||||||
|
final int? limit}) = _$GetByStatusImpl;
|
||||||
|
|
||||||
String get status;
|
String get status;
|
||||||
DateTime get dateFrom;
|
DateTime get dateFrom;
|
||||||
DateTime get dateTo;
|
DateTime get dateTo;
|
||||||
|
int? get limit;
|
||||||
|
|
||||||
/// Create a copy of OrderLoaderEvent
|
/// Create a copy of OrderLoaderEvent
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@ -343,7 +359,8 @@ class _$GetByIdImpl implements _GetById {
|
|||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
required TResult Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)
|
||||||
getByStatus,
|
getByStatus,
|
||||||
required TResult Function(String id) getById,
|
required TResult Function(String id) getById,
|
||||||
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
||||||
@ -356,7 +373,8 @@ class _$GetByIdImpl implements _GetById {
|
|||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult? Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)?
|
||||||
getByStatus,
|
getByStatus,
|
||||||
TResult? Function(String id)? getById,
|
TResult? Function(String id)? getById,
|
||||||
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
||||||
@ -369,7 +387,8 @@ class _$GetByIdImpl implements _GetById {
|
|||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)?
|
||||||
getByStatus,
|
getByStatus,
|
||||||
TResult Function(String id)? getById,
|
TResult Function(String id)? getById,
|
||||||
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
||||||
@ -519,7 +538,8 @@ class _$LoadMoreImpl implements _LoadMore {
|
|||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
required TResult Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)
|
||||||
getByStatus,
|
getByStatus,
|
||||||
required TResult Function(String id) getById,
|
required TResult Function(String id) getById,
|
||||||
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
||||||
@ -532,7 +552,8 @@ class _$LoadMoreImpl implements _LoadMore {
|
|||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult? Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)?
|
||||||
getByStatus,
|
getByStatus,
|
||||||
TResult? Function(String id)? getById,
|
TResult? Function(String id)? getById,
|
||||||
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
||||||
@ -545,7 +566,8 @@ class _$LoadMoreImpl implements _LoadMore {
|
|||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)?
|
||||||
getByStatus,
|
getByStatus,
|
||||||
TResult Function(String id)? getById,
|
TResult Function(String id)? getById,
|
||||||
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
||||||
@ -681,7 +703,8 @@ class _$RefreshImpl implements _Refresh {
|
|||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult when<TResult extends Object?>({
|
TResult when<TResult extends Object?>({
|
||||||
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
required TResult Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)
|
||||||
getByStatus,
|
getByStatus,
|
||||||
required TResult Function(String id) getById,
|
required TResult Function(String id) getById,
|
||||||
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
required TResult Function(String status, DateTime dateFrom, DateTime dateTo)
|
||||||
@ -694,7 +717,8 @@ class _$RefreshImpl implements _Refresh {
|
|||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
TResult? whenOrNull<TResult extends Object?>({
|
||||||
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult? Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)?
|
||||||
getByStatus,
|
getByStatus,
|
||||||
TResult? Function(String id)? getById,
|
TResult? Function(String id)? getById,
|
||||||
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult? Function(String status, DateTime dateFrom, DateTime dateTo)?
|
||||||
@ -707,7 +731,8 @@ class _$RefreshImpl implements _Refresh {
|
|||||||
@override
|
@override
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
TResult maybeWhen<TResult extends Object?>({
|
||||||
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult Function(
|
||||||
|
String status, DateTime dateFrom, DateTime dateTo, int? limit)?
|
||||||
getByStatus,
|
getByStatus,
|
||||||
TResult Function(String id)? getById,
|
TResult Function(String id)? getById,
|
||||||
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
TResult Function(String status, DateTime dateFrom, DateTime dateTo)?
|
||||||
|
|||||||
@ -2,11 +2,10 @@ part of 'order_loader_bloc.dart';
|
|||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class OrderLoaderEvent with _$OrderLoaderEvent {
|
class OrderLoaderEvent with _$OrderLoaderEvent {
|
||||||
const factory OrderLoaderEvent.getByStatus(
|
const factory OrderLoaderEvent.getByStatus(String status,
|
||||||
String status, {
|
{required DateTime dateFrom,
|
||||||
required DateTime dateFrom,
|
required DateTime dateTo,
|
||||||
required DateTime dateTo,
|
int? limit}) = _GetByStatus;
|
||||||
}) = _GetByStatus;
|
|
||||||
const factory OrderLoaderEvent.getById(String id) = _GetById;
|
const factory OrderLoaderEvent.getById(String id) = _GetById;
|
||||||
const factory OrderLoaderEvent.loadMore(
|
const factory OrderLoaderEvent.loadMore(
|
||||||
String status, {
|
String status, {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user