This commit is contained in:
efrilm
2025-10-30 16:35:47 +07:00
parent adc90a90a0
commit b335102677
20 changed files with 1591 additions and 79 deletions
@@ -108,6 +108,7 @@ class OrderLoaderBloc extends Bloc<OrderLoaderEvent, OrderLoaderState> {
failureOption: none(),
page: state.page + 1,
hasReachedMax: orders.orders.length < 10,
totalOrder: orders.totalCount,
);
},
);
@@ -955,6 +955,7 @@ mixin _$OrderLoaderState {
String? get search => throw _privateConstructorUsedError;
DateTime get startDate => throw _privateConstructorUsedError;
DateTime get endDate => throw _privateConstructorUsedError;
int get totalOrder => throw _privateConstructorUsedError;
bool get isFetching => throw _privateConstructorUsedError;
bool get isFetchingById => throw _privateConstructorUsedError;
bool get hasReachedMax => throw _privateConstructorUsedError;
@@ -983,6 +984,7 @@ abstract class $OrderLoaderStateCopyWith<$Res> {
String? search,
DateTime startDate,
DateTime endDate,
int totalOrder,
bool isFetching,
bool isFetchingById,
bool hasReachedMax,
@@ -1016,6 +1018,7 @@ class _$OrderLoaderStateCopyWithImpl<$Res, $Val extends OrderLoaderState>
Object? search = freezed,
Object? startDate = null,
Object? endDate = null,
Object? totalOrder = null,
Object? isFetching = null,
Object? isFetchingById = null,
Object? hasReachedMax = null,
@@ -1055,6 +1058,10 @@ class _$OrderLoaderStateCopyWithImpl<$Res, $Val extends OrderLoaderState>
? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable
as DateTime,
totalOrder: null == totalOrder
? _value.totalOrder
: totalOrder // ignore: cast_nullable_to_non_nullable
as int,
isFetching: null == isFetching
? _value.isFetching
: isFetching // ignore: cast_nullable_to_non_nullable
@@ -1119,6 +1126,7 @@ abstract class _$$OrderLoaderStateImplCopyWith<$Res>
String? search,
DateTime startDate,
DateTime endDate,
int totalOrder,
bool isFetching,
bool isFetchingById,
bool hasReachedMax,
@@ -1153,6 +1161,7 @@ class __$$OrderLoaderStateImplCopyWithImpl<$Res>
Object? search = freezed,
Object? startDate = null,
Object? endDate = null,
Object? totalOrder = null,
Object? isFetching = null,
Object? isFetchingById = null,
Object? hasReachedMax = null,
@@ -1192,6 +1201,10 @@ class __$$OrderLoaderStateImplCopyWithImpl<$Res>
? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable
as DateTime,
totalOrder: null == totalOrder
? _value.totalOrder
: totalOrder // ignore: cast_nullable_to_non_nullable
as int,
isFetching: null == isFetching
? _value.isFetching
: isFetching // ignore: cast_nullable_to_non_nullable
@@ -1225,6 +1238,7 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
this.search,
required this.startDate,
required this.endDate,
this.totalOrder = 0,
this.isFetching = false,
this.isFetchingById = false,
this.hasReachedMax = false,
@@ -1255,6 +1269,9 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
final DateTime endDate;
@override
@JsonKey()
final int totalOrder;
@override
@JsonKey()
final bool isFetching;
@override
@JsonKey()
@@ -1268,7 +1285,7 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
@override
String toString() {
return 'OrderLoaderState(orders: $orders, failureOption: $failureOption, failureOptionGetById: $failureOptionGetById, order: $order, selectedOrder: $selectedOrder, search: $search, startDate: $startDate, endDate: $endDate, isFetching: $isFetching, isFetchingById: $isFetchingById, hasReachedMax: $hasReachedMax, page: $page)';
return 'OrderLoaderState(orders: $orders, failureOption: $failureOption, failureOptionGetById: $failureOptionGetById, order: $order, selectedOrder: $selectedOrder, search: $search, startDate: $startDate, endDate: $endDate, totalOrder: $totalOrder, isFetching: $isFetching, isFetchingById: $isFetchingById, hasReachedMax: $hasReachedMax, page: $page)';
}
@override
@@ -1288,6 +1305,8 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
(identical(other.startDate, startDate) ||
other.startDate == startDate) &&
(identical(other.endDate, endDate) || other.endDate == endDate) &&
(identical(other.totalOrder, totalOrder) ||
other.totalOrder == totalOrder) &&
(identical(other.isFetching, isFetching) ||
other.isFetching == isFetching) &&
(identical(other.isFetchingById, isFetchingById) ||
@@ -1308,6 +1327,7 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
search,
startDate,
endDate,
totalOrder,
isFetching,
isFetchingById,
hasReachedMax,
@@ -1336,6 +1356,7 @@ abstract class _OrderLoaderState implements OrderLoaderState {
final String? search,
required final DateTime startDate,
required final DateTime endDate,
final int totalOrder,
final bool isFetching,
final bool isFetchingById,
final bool hasReachedMax,
@@ -1359,6 +1380,8 @@ abstract class _OrderLoaderState implements OrderLoaderState {
@override
DateTime get endDate;
@override
int get totalOrder;
@override
bool get isFetching;
@override
bool get isFetchingById;
@@ -11,6 +11,7 @@ class OrderLoaderState with _$OrderLoaderState {
String? search,
required DateTime startDate,
required DateTime endDate,
@Default(0) int totalOrder,
@Default(false) bool isFetching,
@Default(false) bool isFetchingById,
@Default(false) bool hasReachedMax,