Compare commits
No commits in common. "96526c1972e2cd45f7e5bf82befcfd30dfd806a9" and "9f2097a26850b18abe753138c370e1fc034d4ad8" have entirely different histories.
96526c1972
...
9f2097a268
@ -14,7 +14,7 @@ class DashboardAnalyticLoaderState with _$DashboardAnalyticLoaderState {
|
|||||||
DashboardAnalyticLoaderState(
|
DashboardAnalyticLoaderState(
|
||||||
dashboardAnalytic: DashboardAnalytic.empty(),
|
dashboardAnalytic: DashboardAnalytic.empty(),
|
||||||
failureOptionDashboardAnalytic: none(),
|
failureOptionDashboardAnalytic: none(),
|
||||||
dateFrom: DateTime.now(),
|
dateFrom: DateTime.now().subtract(const Duration(days: 30)),
|
||||||
dateTo: DateTime.now(),
|
dateTo: DateTime.now(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,9 +30,6 @@ class OrderLoaderBloc extends Bloc<OrderLoaderEvent, OrderLoaderState> {
|
|||||||
searchChanged: (e) async {
|
searchChanged: (e) async {
|
||||||
emit(state.copyWith(search: e.search));
|
emit(state.copyWith(search: e.search));
|
||||||
},
|
},
|
||||||
outletChanged: (e) async {
|
|
||||||
emit(state.copyWith(outletId: e.outletId));
|
|
||||||
},
|
|
||||||
fetched: (e) async {
|
fetched: (e) async {
|
||||||
var newState = state;
|
var newState = state;
|
||||||
|
|
||||||
@ -72,7 +69,6 @@ class OrderLoaderBloc extends Bloc<OrderLoaderEvent, OrderLoaderState> {
|
|||||||
status: state.status == 'all' ? null : state.status,
|
status: state.status == 'all' ? null : state.status,
|
||||||
page: state.page,
|
page: state.page,
|
||||||
search: state.search,
|
search: state.search,
|
||||||
outletId: state.outletId,
|
|
||||||
dateFrom: state.dateFrom,
|
dateFrom: state.dateFrom,
|
||||||
dateTo: state.dateTo,
|
dateTo: state.dateTo,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -23,7 +23,6 @@ mixin _$OrderLoaderEvent {
|
|||||||
rangeDateChanged,
|
rangeDateChanged,
|
||||||
required TResult Function(String status) statusChanged,
|
required TResult Function(String status) statusChanged,
|
||||||
required TResult Function(String search) searchChanged,
|
required TResult Function(String search) searchChanged,
|
||||||
required TResult Function(String? outletId) outletChanged,
|
|
||||||
required TResult Function(bool isRefresh) fetched,
|
required TResult Function(bool isRefresh) fetched,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -31,7 +30,6 @@ mixin _$OrderLoaderEvent {
|
|||||||
TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
||||||
TResult? Function(String status)? statusChanged,
|
TResult? Function(String status)? statusChanged,
|
||||||
TResult? Function(String search)? searchChanged,
|
TResult? Function(String search)? searchChanged,
|
||||||
TResult? Function(String? outletId)? outletChanged,
|
|
||||||
TResult? Function(bool isRefresh)? fetched,
|
TResult? Function(bool isRefresh)? fetched,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -39,7 +37,6 @@ mixin _$OrderLoaderEvent {
|
|||||||
TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
||||||
TResult Function(String status)? statusChanged,
|
TResult Function(String status)? statusChanged,
|
||||||
TResult Function(String search)? searchChanged,
|
TResult Function(String search)? searchChanged,
|
||||||
TResult Function(String? outletId)? outletChanged,
|
|
||||||
TResult Function(bool isRefresh)? fetched,
|
TResult Function(bool isRefresh)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@ -48,7 +45,6 @@ mixin _$OrderLoaderEvent {
|
|||||||
required TResult Function(_RangeDateChanged value) rangeDateChanged,
|
required TResult Function(_RangeDateChanged value) rangeDateChanged,
|
||||||
required TResult Function(_StatusChanged value) statusChanged,
|
required TResult Function(_StatusChanged value) statusChanged,
|
||||||
required TResult Function(_SearchChanged value) searchChanged,
|
required TResult Function(_SearchChanged value) searchChanged,
|
||||||
required TResult Function(_OutletChanged value) outletChanged,
|
|
||||||
required TResult Function(_Fetched value) fetched,
|
required TResult Function(_Fetched value) fetched,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -56,7 +52,6 @@ mixin _$OrderLoaderEvent {
|
|||||||
TResult? Function(_RangeDateChanged value)? rangeDateChanged,
|
TResult? Function(_RangeDateChanged value)? rangeDateChanged,
|
||||||
TResult? Function(_StatusChanged value)? statusChanged,
|
TResult? Function(_StatusChanged value)? statusChanged,
|
||||||
TResult? Function(_SearchChanged value)? searchChanged,
|
TResult? Function(_SearchChanged value)? searchChanged,
|
||||||
TResult? Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult? Function(_Fetched value)? fetched,
|
TResult? Function(_Fetched value)? fetched,
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
@ -64,7 +59,6 @@ mixin _$OrderLoaderEvent {
|
|||||||
TResult Function(_RangeDateChanged value)? rangeDateChanged,
|
TResult Function(_RangeDateChanged value)? rangeDateChanged,
|
||||||
TResult Function(_StatusChanged value)? statusChanged,
|
TResult Function(_StatusChanged value)? statusChanged,
|
||||||
TResult Function(_SearchChanged value)? searchChanged,
|
TResult Function(_SearchChanged value)? searchChanged,
|
||||||
TResult Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult Function(_Fetched value)? fetched,
|
TResult Function(_Fetched value)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) => throw _privateConstructorUsedError;
|
}) => throw _privateConstructorUsedError;
|
||||||
@ -177,7 +171,6 @@ class _$RangeDateChangedImpl implements _RangeDateChanged {
|
|||||||
rangeDateChanged,
|
rangeDateChanged,
|
||||||
required TResult Function(String status) statusChanged,
|
required TResult Function(String status) statusChanged,
|
||||||
required TResult Function(String search) searchChanged,
|
required TResult Function(String search) searchChanged,
|
||||||
required TResult Function(String? outletId) outletChanged,
|
|
||||||
required TResult Function(bool isRefresh) fetched,
|
required TResult Function(bool isRefresh) fetched,
|
||||||
}) {
|
}) {
|
||||||
return rangeDateChanged(dateFrom, dateTo);
|
return rangeDateChanged(dateFrom, dateTo);
|
||||||
@ -189,7 +182,6 @@ class _$RangeDateChangedImpl implements _RangeDateChanged {
|
|||||||
TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
||||||
TResult? Function(String status)? statusChanged,
|
TResult? Function(String status)? statusChanged,
|
||||||
TResult? Function(String search)? searchChanged,
|
TResult? Function(String search)? searchChanged,
|
||||||
TResult? Function(String? outletId)? outletChanged,
|
|
||||||
TResult? Function(bool isRefresh)? fetched,
|
TResult? Function(bool isRefresh)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return rangeDateChanged?.call(dateFrom, dateTo);
|
return rangeDateChanged?.call(dateFrom, dateTo);
|
||||||
@ -201,7 +193,6 @@ class _$RangeDateChangedImpl implements _RangeDateChanged {
|
|||||||
TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
||||||
TResult Function(String status)? statusChanged,
|
TResult Function(String status)? statusChanged,
|
||||||
TResult Function(String search)? searchChanged,
|
TResult Function(String search)? searchChanged,
|
||||||
TResult Function(String? outletId)? outletChanged,
|
|
||||||
TResult Function(bool isRefresh)? fetched,
|
TResult Function(bool isRefresh)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -217,7 +208,6 @@ class _$RangeDateChangedImpl implements _RangeDateChanged {
|
|||||||
required TResult Function(_RangeDateChanged value) rangeDateChanged,
|
required TResult Function(_RangeDateChanged value) rangeDateChanged,
|
||||||
required TResult Function(_StatusChanged value) statusChanged,
|
required TResult Function(_StatusChanged value) statusChanged,
|
||||||
required TResult Function(_SearchChanged value) searchChanged,
|
required TResult Function(_SearchChanged value) searchChanged,
|
||||||
required TResult Function(_OutletChanged value) outletChanged,
|
|
||||||
required TResult Function(_Fetched value) fetched,
|
required TResult Function(_Fetched value) fetched,
|
||||||
}) {
|
}) {
|
||||||
return rangeDateChanged(this);
|
return rangeDateChanged(this);
|
||||||
@ -229,7 +219,6 @@ class _$RangeDateChangedImpl implements _RangeDateChanged {
|
|||||||
TResult? Function(_RangeDateChanged value)? rangeDateChanged,
|
TResult? Function(_RangeDateChanged value)? rangeDateChanged,
|
||||||
TResult? Function(_StatusChanged value)? statusChanged,
|
TResult? Function(_StatusChanged value)? statusChanged,
|
||||||
TResult? Function(_SearchChanged value)? searchChanged,
|
TResult? Function(_SearchChanged value)? searchChanged,
|
||||||
TResult? Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult? Function(_Fetched value)? fetched,
|
TResult? Function(_Fetched value)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return rangeDateChanged?.call(this);
|
return rangeDateChanged?.call(this);
|
||||||
@ -241,7 +230,6 @@ class _$RangeDateChangedImpl implements _RangeDateChanged {
|
|||||||
TResult Function(_RangeDateChanged value)? rangeDateChanged,
|
TResult Function(_RangeDateChanged value)? rangeDateChanged,
|
||||||
TResult Function(_StatusChanged value)? statusChanged,
|
TResult Function(_StatusChanged value)? statusChanged,
|
||||||
TResult Function(_SearchChanged value)? searchChanged,
|
TResult Function(_SearchChanged value)? searchChanged,
|
||||||
TResult Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult Function(_Fetched value)? fetched,
|
TResult Function(_Fetched value)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -342,7 +330,6 @@ class _$StatusChangedImpl implements _StatusChanged {
|
|||||||
rangeDateChanged,
|
rangeDateChanged,
|
||||||
required TResult Function(String status) statusChanged,
|
required TResult Function(String status) statusChanged,
|
||||||
required TResult Function(String search) searchChanged,
|
required TResult Function(String search) searchChanged,
|
||||||
required TResult Function(String? outletId) outletChanged,
|
|
||||||
required TResult Function(bool isRefresh) fetched,
|
required TResult Function(bool isRefresh) fetched,
|
||||||
}) {
|
}) {
|
||||||
return statusChanged(status);
|
return statusChanged(status);
|
||||||
@ -354,7 +341,6 @@ class _$StatusChangedImpl implements _StatusChanged {
|
|||||||
TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
||||||
TResult? Function(String status)? statusChanged,
|
TResult? Function(String status)? statusChanged,
|
||||||
TResult? Function(String search)? searchChanged,
|
TResult? Function(String search)? searchChanged,
|
||||||
TResult? Function(String? outletId)? outletChanged,
|
|
||||||
TResult? Function(bool isRefresh)? fetched,
|
TResult? Function(bool isRefresh)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return statusChanged?.call(status);
|
return statusChanged?.call(status);
|
||||||
@ -366,7 +352,6 @@ class _$StatusChangedImpl implements _StatusChanged {
|
|||||||
TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
||||||
TResult Function(String status)? statusChanged,
|
TResult Function(String status)? statusChanged,
|
||||||
TResult Function(String search)? searchChanged,
|
TResult Function(String search)? searchChanged,
|
||||||
TResult Function(String? outletId)? outletChanged,
|
|
||||||
TResult Function(bool isRefresh)? fetched,
|
TResult Function(bool isRefresh)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -382,7 +367,6 @@ class _$StatusChangedImpl implements _StatusChanged {
|
|||||||
required TResult Function(_RangeDateChanged value) rangeDateChanged,
|
required TResult Function(_RangeDateChanged value) rangeDateChanged,
|
||||||
required TResult Function(_StatusChanged value) statusChanged,
|
required TResult Function(_StatusChanged value) statusChanged,
|
||||||
required TResult Function(_SearchChanged value) searchChanged,
|
required TResult Function(_SearchChanged value) searchChanged,
|
||||||
required TResult Function(_OutletChanged value) outletChanged,
|
|
||||||
required TResult Function(_Fetched value) fetched,
|
required TResult Function(_Fetched value) fetched,
|
||||||
}) {
|
}) {
|
||||||
return statusChanged(this);
|
return statusChanged(this);
|
||||||
@ -394,7 +378,6 @@ class _$StatusChangedImpl implements _StatusChanged {
|
|||||||
TResult? Function(_RangeDateChanged value)? rangeDateChanged,
|
TResult? Function(_RangeDateChanged value)? rangeDateChanged,
|
||||||
TResult? Function(_StatusChanged value)? statusChanged,
|
TResult? Function(_StatusChanged value)? statusChanged,
|
||||||
TResult? Function(_SearchChanged value)? searchChanged,
|
TResult? Function(_SearchChanged value)? searchChanged,
|
||||||
TResult? Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult? Function(_Fetched value)? fetched,
|
TResult? Function(_Fetched value)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return statusChanged?.call(this);
|
return statusChanged?.call(this);
|
||||||
@ -406,7 +389,6 @@ class _$StatusChangedImpl implements _StatusChanged {
|
|||||||
TResult Function(_RangeDateChanged value)? rangeDateChanged,
|
TResult Function(_RangeDateChanged value)? rangeDateChanged,
|
||||||
TResult Function(_StatusChanged value)? statusChanged,
|
TResult Function(_StatusChanged value)? statusChanged,
|
||||||
TResult Function(_SearchChanged value)? searchChanged,
|
TResult Function(_SearchChanged value)? searchChanged,
|
||||||
TResult Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult Function(_Fetched value)? fetched,
|
TResult Function(_Fetched value)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -503,7 +485,6 @@ class _$SearchChangedImpl implements _SearchChanged {
|
|||||||
rangeDateChanged,
|
rangeDateChanged,
|
||||||
required TResult Function(String status) statusChanged,
|
required TResult Function(String status) statusChanged,
|
||||||
required TResult Function(String search) searchChanged,
|
required TResult Function(String search) searchChanged,
|
||||||
required TResult Function(String? outletId) outletChanged,
|
|
||||||
required TResult Function(bool isRefresh) fetched,
|
required TResult Function(bool isRefresh) fetched,
|
||||||
}) {
|
}) {
|
||||||
return searchChanged(search);
|
return searchChanged(search);
|
||||||
@ -515,7 +496,6 @@ class _$SearchChangedImpl implements _SearchChanged {
|
|||||||
TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
||||||
TResult? Function(String status)? statusChanged,
|
TResult? Function(String status)? statusChanged,
|
||||||
TResult? Function(String search)? searchChanged,
|
TResult? Function(String search)? searchChanged,
|
||||||
TResult? Function(String? outletId)? outletChanged,
|
|
||||||
TResult? Function(bool isRefresh)? fetched,
|
TResult? Function(bool isRefresh)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return searchChanged?.call(search);
|
return searchChanged?.call(search);
|
||||||
@ -527,7 +507,6 @@ class _$SearchChangedImpl implements _SearchChanged {
|
|||||||
TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
||||||
TResult Function(String status)? statusChanged,
|
TResult Function(String status)? statusChanged,
|
||||||
TResult Function(String search)? searchChanged,
|
TResult Function(String search)? searchChanged,
|
||||||
TResult Function(String? outletId)? outletChanged,
|
|
||||||
TResult Function(bool isRefresh)? fetched,
|
TResult Function(bool isRefresh)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -543,7 +522,6 @@ class _$SearchChangedImpl implements _SearchChanged {
|
|||||||
required TResult Function(_RangeDateChanged value) rangeDateChanged,
|
required TResult Function(_RangeDateChanged value) rangeDateChanged,
|
||||||
required TResult Function(_StatusChanged value) statusChanged,
|
required TResult Function(_StatusChanged value) statusChanged,
|
||||||
required TResult Function(_SearchChanged value) searchChanged,
|
required TResult Function(_SearchChanged value) searchChanged,
|
||||||
required TResult Function(_OutletChanged value) outletChanged,
|
|
||||||
required TResult Function(_Fetched value) fetched,
|
required TResult Function(_Fetched value) fetched,
|
||||||
}) {
|
}) {
|
||||||
return searchChanged(this);
|
return searchChanged(this);
|
||||||
@ -555,7 +533,6 @@ class _$SearchChangedImpl implements _SearchChanged {
|
|||||||
TResult? Function(_RangeDateChanged value)? rangeDateChanged,
|
TResult? Function(_RangeDateChanged value)? rangeDateChanged,
|
||||||
TResult? Function(_StatusChanged value)? statusChanged,
|
TResult? Function(_StatusChanged value)? statusChanged,
|
||||||
TResult? Function(_SearchChanged value)? searchChanged,
|
TResult? Function(_SearchChanged value)? searchChanged,
|
||||||
TResult? Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult? Function(_Fetched value)? fetched,
|
TResult? Function(_Fetched value)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return searchChanged?.call(this);
|
return searchChanged?.call(this);
|
||||||
@ -567,7 +544,6 @@ class _$SearchChangedImpl implements _SearchChanged {
|
|||||||
TResult Function(_RangeDateChanged value)? rangeDateChanged,
|
TResult Function(_RangeDateChanged value)? rangeDateChanged,
|
||||||
TResult Function(_StatusChanged value)? statusChanged,
|
TResult Function(_StatusChanged value)? statusChanged,
|
||||||
TResult Function(_SearchChanged value)? searchChanged,
|
TResult Function(_SearchChanged value)? searchChanged,
|
||||||
TResult Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult Function(_Fetched value)? fetched,
|
TResult Function(_Fetched value)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -590,168 +566,6 @@ abstract class _SearchChanged implements OrderLoaderEvent {
|
|||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$OutletChangedImplCopyWith<$Res> {
|
|
||||||
factory _$$OutletChangedImplCopyWith(
|
|
||||||
_$OutletChangedImpl value,
|
|
||||||
$Res Function(_$OutletChangedImpl) then,
|
|
||||||
) = __$$OutletChangedImplCopyWithImpl<$Res>;
|
|
||||||
@useResult
|
|
||||||
$Res call({String? outletId});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$OutletChangedImplCopyWithImpl<$Res>
|
|
||||||
extends _$OrderLoaderEventCopyWithImpl<$Res, _$OutletChangedImpl>
|
|
||||||
implements _$$OutletChangedImplCopyWith<$Res> {
|
|
||||||
__$$OutletChangedImplCopyWithImpl(
|
|
||||||
_$OutletChangedImpl _value,
|
|
||||||
$Res Function(_$OutletChangedImpl) _then,
|
|
||||||
) : super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of OrderLoaderEvent
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({Object? outletId = freezed}) {
|
|
||||||
return _then(
|
|
||||||
_$OutletChangedImpl(
|
|
||||||
freezed == outletId
|
|
||||||
? _value.outletId
|
|
||||||
: outletId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
|
|
||||||
class _$OutletChangedImpl implements _OutletChanged {
|
|
||||||
const _$OutletChangedImpl(this.outletId);
|
|
||||||
|
|
||||||
@override
|
|
||||||
final String? outletId;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'OrderLoaderEvent.outletChanged(outletId: $outletId)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$OutletChangedImpl &&
|
|
||||||
(identical(other.outletId, outletId) ||
|
|
||||||
other.outletId == outletId));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(runtimeType, outletId);
|
|
||||||
|
|
||||||
/// Create a copy of OrderLoaderEvent
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$OutletChangedImplCopyWith<_$OutletChangedImpl> get copyWith =>
|
|
||||||
__$$OutletChangedImplCopyWithImpl<_$OutletChangedImpl>(this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult when<TResult extends Object?>({
|
|
||||||
required TResult Function(DateTime dateFrom, DateTime dateTo)
|
|
||||||
rangeDateChanged,
|
|
||||||
required TResult Function(String status) statusChanged,
|
|
||||||
required TResult Function(String search) searchChanged,
|
|
||||||
required TResult Function(String? outletId) outletChanged,
|
|
||||||
required TResult Function(bool isRefresh) fetched,
|
|
||||||
}) {
|
|
||||||
return outletChanged(outletId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult? whenOrNull<TResult extends Object?>({
|
|
||||||
TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
|
||||||
TResult? Function(String status)? statusChanged,
|
|
||||||
TResult? Function(String search)? searchChanged,
|
|
||||||
TResult? Function(String? outletId)? outletChanged,
|
|
||||||
TResult? Function(bool isRefresh)? fetched,
|
|
||||||
}) {
|
|
||||||
return outletChanged?.call(outletId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult maybeWhen<TResult extends Object?>({
|
|
||||||
TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
|
||||||
TResult Function(String status)? statusChanged,
|
|
||||||
TResult Function(String search)? searchChanged,
|
|
||||||
TResult Function(String? outletId)? outletChanged,
|
|
||||||
TResult Function(bool isRefresh)? fetched,
|
|
||||||
required TResult orElse(),
|
|
||||||
}) {
|
|
||||||
if (outletChanged != null) {
|
|
||||||
return outletChanged(outletId);
|
|
||||||
}
|
|
||||||
return orElse();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult map<TResult extends Object?>({
|
|
||||||
required TResult Function(_RangeDateChanged value) rangeDateChanged,
|
|
||||||
required TResult Function(_StatusChanged value) statusChanged,
|
|
||||||
required TResult Function(_SearchChanged value) searchChanged,
|
|
||||||
required TResult Function(_OutletChanged value) outletChanged,
|
|
||||||
required TResult Function(_Fetched value) fetched,
|
|
||||||
}) {
|
|
||||||
return outletChanged(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult? mapOrNull<TResult extends Object?>({
|
|
||||||
TResult? Function(_RangeDateChanged value)? rangeDateChanged,
|
|
||||||
TResult? Function(_StatusChanged value)? statusChanged,
|
|
||||||
TResult? Function(_SearchChanged value)? searchChanged,
|
|
||||||
TResult? Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult? Function(_Fetched value)? fetched,
|
|
||||||
}) {
|
|
||||||
return outletChanged?.call(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@optionalTypeArgs
|
|
||||||
TResult maybeMap<TResult extends Object?>({
|
|
||||||
TResult Function(_RangeDateChanged value)? rangeDateChanged,
|
|
||||||
TResult Function(_StatusChanged value)? statusChanged,
|
|
||||||
TResult Function(_SearchChanged value)? searchChanged,
|
|
||||||
TResult Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult Function(_Fetched value)? fetched,
|
|
||||||
required TResult orElse(),
|
|
||||||
}) {
|
|
||||||
if (outletChanged != null) {
|
|
||||||
return outletChanged(this);
|
|
||||||
}
|
|
||||||
return orElse();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _OutletChanged implements OrderLoaderEvent {
|
|
||||||
const factory _OutletChanged(final String? outletId) = _$OutletChangedImpl;
|
|
||||||
|
|
||||||
String? get outletId;
|
|
||||||
|
|
||||||
/// Create a copy of OrderLoaderEvent
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$OutletChangedImplCopyWith<_$OutletChangedImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
abstract class _$$FetchedImplCopyWith<$Res> {
|
abstract class _$$FetchedImplCopyWith<$Res> {
|
||||||
factory _$$FetchedImplCopyWith(
|
factory _$$FetchedImplCopyWith(
|
||||||
@ -828,7 +642,6 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
rangeDateChanged,
|
rangeDateChanged,
|
||||||
required TResult Function(String status) statusChanged,
|
required TResult Function(String status) statusChanged,
|
||||||
required TResult Function(String search) searchChanged,
|
required TResult Function(String search) searchChanged,
|
||||||
required TResult Function(String? outletId) outletChanged,
|
|
||||||
required TResult Function(bool isRefresh) fetched,
|
required TResult Function(bool isRefresh) fetched,
|
||||||
}) {
|
}) {
|
||||||
return fetched(isRefresh);
|
return fetched(isRefresh);
|
||||||
@ -840,7 +653,6 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
TResult? Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
||||||
TResult? Function(String status)? statusChanged,
|
TResult? Function(String status)? statusChanged,
|
||||||
TResult? Function(String search)? searchChanged,
|
TResult? Function(String search)? searchChanged,
|
||||||
TResult? Function(String? outletId)? outletChanged,
|
|
||||||
TResult? Function(bool isRefresh)? fetched,
|
TResult? Function(bool isRefresh)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return fetched?.call(isRefresh);
|
return fetched?.call(isRefresh);
|
||||||
@ -852,7 +664,6 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
TResult Function(DateTime dateFrom, DateTime dateTo)? rangeDateChanged,
|
||||||
TResult Function(String status)? statusChanged,
|
TResult Function(String status)? statusChanged,
|
||||||
TResult Function(String search)? searchChanged,
|
TResult Function(String search)? searchChanged,
|
||||||
TResult Function(String? outletId)? outletChanged,
|
|
||||||
TResult Function(bool isRefresh)? fetched,
|
TResult Function(bool isRefresh)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -868,7 +679,6 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
required TResult Function(_RangeDateChanged value) rangeDateChanged,
|
required TResult Function(_RangeDateChanged value) rangeDateChanged,
|
||||||
required TResult Function(_StatusChanged value) statusChanged,
|
required TResult Function(_StatusChanged value) statusChanged,
|
||||||
required TResult Function(_SearchChanged value) searchChanged,
|
required TResult Function(_SearchChanged value) searchChanged,
|
||||||
required TResult Function(_OutletChanged value) outletChanged,
|
|
||||||
required TResult Function(_Fetched value) fetched,
|
required TResult Function(_Fetched value) fetched,
|
||||||
}) {
|
}) {
|
||||||
return fetched(this);
|
return fetched(this);
|
||||||
@ -880,7 +690,6 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
TResult? Function(_RangeDateChanged value)? rangeDateChanged,
|
TResult? Function(_RangeDateChanged value)? rangeDateChanged,
|
||||||
TResult? Function(_StatusChanged value)? statusChanged,
|
TResult? Function(_StatusChanged value)? statusChanged,
|
||||||
TResult? Function(_SearchChanged value)? searchChanged,
|
TResult? Function(_SearchChanged value)? searchChanged,
|
||||||
TResult? Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult? Function(_Fetched value)? fetched,
|
TResult? Function(_Fetched value)? fetched,
|
||||||
}) {
|
}) {
|
||||||
return fetched?.call(this);
|
return fetched?.call(this);
|
||||||
@ -892,7 +701,6 @@ class _$FetchedImpl implements _Fetched {
|
|||||||
TResult Function(_RangeDateChanged value)? rangeDateChanged,
|
TResult Function(_RangeDateChanged value)? rangeDateChanged,
|
||||||
TResult Function(_StatusChanged value)? statusChanged,
|
TResult Function(_StatusChanged value)? statusChanged,
|
||||||
TResult Function(_SearchChanged value)? searchChanged,
|
TResult Function(_SearchChanged value)? searchChanged,
|
||||||
TResult Function(_OutletChanged value)? outletChanged,
|
|
||||||
TResult Function(_Fetched value)? fetched,
|
TResult Function(_Fetched value)? fetched,
|
||||||
required TResult orElse(),
|
required TResult orElse(),
|
||||||
}) {
|
}) {
|
||||||
@ -922,7 +730,6 @@ mixin _$OrderLoaderState {
|
|||||||
throw _privateConstructorUsedError;
|
throw _privateConstructorUsedError;
|
||||||
String get status => throw _privateConstructorUsedError;
|
String get status => throw _privateConstructorUsedError;
|
||||||
String? get search => throw _privateConstructorUsedError;
|
String? get search => throw _privateConstructorUsedError;
|
||||||
String? get outletId => throw _privateConstructorUsedError;
|
|
||||||
bool get isFetching => throw _privateConstructorUsedError;
|
bool get isFetching => throw _privateConstructorUsedError;
|
||||||
bool get hasReachedMax => throw _privateConstructorUsedError;
|
bool get hasReachedMax => throw _privateConstructorUsedError;
|
||||||
int get page => throw _privateConstructorUsedError;
|
int get page => throw _privateConstructorUsedError;
|
||||||
@ -948,7 +755,6 @@ abstract class $OrderLoaderStateCopyWith<$Res> {
|
|||||||
Option<OrderFailure> failureOptionOrder,
|
Option<OrderFailure> failureOptionOrder,
|
||||||
String status,
|
String status,
|
||||||
String? search,
|
String? search,
|
||||||
String? outletId,
|
|
||||||
bool isFetching,
|
bool isFetching,
|
||||||
bool hasReachedMax,
|
bool hasReachedMax,
|
||||||
int page,
|
int page,
|
||||||
@ -976,7 +782,6 @@ class _$OrderLoaderStateCopyWithImpl<$Res, $Val extends OrderLoaderState>
|
|||||||
Object? failureOptionOrder = null,
|
Object? failureOptionOrder = null,
|
||||||
Object? status = null,
|
Object? status = null,
|
||||||
Object? search = freezed,
|
Object? search = freezed,
|
||||||
Object? outletId = freezed,
|
|
||||||
Object? isFetching = null,
|
Object? isFetching = null,
|
||||||
Object? hasReachedMax = null,
|
Object? hasReachedMax = null,
|
||||||
Object? page = null,
|
Object? page = null,
|
||||||
@ -1001,10 +806,6 @@ class _$OrderLoaderStateCopyWithImpl<$Res, $Val extends OrderLoaderState>
|
|||||||
? _value.search
|
? _value.search
|
||||||
: search // ignore: cast_nullable_to_non_nullable
|
: search // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,
|
as String?,
|
||||||
outletId: freezed == outletId
|
|
||||||
? _value.outletId
|
|
||||||
: outletId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
isFetching: null == isFetching
|
isFetching: null == isFetching
|
||||||
? _value.isFetching
|
? _value.isFetching
|
||||||
: isFetching // ignore: cast_nullable_to_non_nullable
|
: isFetching // ignore: cast_nullable_to_non_nullable
|
||||||
@ -1045,7 +846,6 @@ abstract class _$$OrderLoaderStateImplCopyWith<$Res>
|
|||||||
Option<OrderFailure> failureOptionOrder,
|
Option<OrderFailure> failureOptionOrder,
|
||||||
String status,
|
String status,
|
||||||
String? search,
|
String? search,
|
||||||
String? outletId,
|
|
||||||
bool isFetching,
|
bool isFetching,
|
||||||
bool hasReachedMax,
|
bool hasReachedMax,
|
||||||
int page,
|
int page,
|
||||||
@ -1072,7 +872,6 @@ class __$$OrderLoaderStateImplCopyWithImpl<$Res>
|
|||||||
Object? failureOptionOrder = null,
|
Object? failureOptionOrder = null,
|
||||||
Object? status = null,
|
Object? status = null,
|
||||||
Object? search = freezed,
|
Object? search = freezed,
|
||||||
Object? outletId = freezed,
|
|
||||||
Object? isFetching = null,
|
Object? isFetching = null,
|
||||||
Object? hasReachedMax = null,
|
Object? hasReachedMax = null,
|
||||||
Object? page = null,
|
Object? page = null,
|
||||||
@ -1097,10 +896,6 @@ class __$$OrderLoaderStateImplCopyWithImpl<$Res>
|
|||||||
? _value.search
|
? _value.search
|
||||||
: search // ignore: cast_nullable_to_non_nullable
|
: search // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,
|
as String?,
|
||||||
outletId: freezed == outletId
|
|
||||||
? _value.outletId
|
|
||||||
: outletId // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
isFetching: null == isFetching
|
isFetching: null == isFetching
|
||||||
? _value.isFetching
|
? _value.isFetching
|
||||||
: isFetching // ignore: cast_nullable_to_non_nullable
|
: isFetching // ignore: cast_nullable_to_non_nullable
|
||||||
@ -1134,7 +929,6 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
required this.failureOptionOrder,
|
required this.failureOptionOrder,
|
||||||
required this.status,
|
required this.status,
|
||||||
this.search,
|
this.search,
|
||||||
this.outletId,
|
|
||||||
this.isFetching = false,
|
this.isFetching = false,
|
||||||
this.hasReachedMax = false,
|
this.hasReachedMax = false,
|
||||||
this.page = 1,
|
this.page = 1,
|
||||||
@ -1157,8 +951,6 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
@override
|
@override
|
||||||
final String? search;
|
final String? search;
|
||||||
@override
|
@override
|
||||||
final String? outletId;
|
|
||||||
@override
|
|
||||||
@JsonKey()
|
@JsonKey()
|
||||||
final bool isFetching;
|
final bool isFetching;
|
||||||
@override
|
@override
|
||||||
@ -1174,7 +966,7 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'OrderLoaderState(orders: $orders, failureOptionOrder: $failureOptionOrder, status: $status, search: $search, outletId: $outletId, isFetching: $isFetching, hasReachedMax: $hasReachedMax, page: $page, dateFrom: $dateFrom, dateTo: $dateTo)';
|
return 'OrderLoaderState(orders: $orders, failureOptionOrder: $failureOptionOrder, status: $status, search: $search, isFetching: $isFetching, hasReachedMax: $hasReachedMax, page: $page, dateFrom: $dateFrom, dateTo: $dateTo)';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -1187,8 +979,6 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
other.failureOptionOrder == failureOptionOrder) &&
|
other.failureOptionOrder == failureOptionOrder) &&
|
||||||
(identical(other.status, status) || other.status == status) &&
|
(identical(other.status, status) || other.status == status) &&
|
||||||
(identical(other.search, search) || other.search == search) &&
|
(identical(other.search, search) || other.search == search) &&
|
||||||
(identical(other.outletId, outletId) ||
|
|
||||||
other.outletId == outletId) &&
|
|
||||||
(identical(other.isFetching, isFetching) ||
|
(identical(other.isFetching, isFetching) ||
|
||||||
other.isFetching == isFetching) &&
|
other.isFetching == isFetching) &&
|
||||||
(identical(other.hasReachedMax, hasReachedMax) ||
|
(identical(other.hasReachedMax, hasReachedMax) ||
|
||||||
@ -1206,7 +996,6 @@ class _$OrderLoaderStateImpl implements _OrderLoaderState {
|
|||||||
failureOptionOrder,
|
failureOptionOrder,
|
||||||
status,
|
status,
|
||||||
search,
|
search,
|
||||||
outletId,
|
|
||||||
isFetching,
|
isFetching,
|
||||||
hasReachedMax,
|
hasReachedMax,
|
||||||
page,
|
page,
|
||||||
@ -1232,7 +1021,6 @@ abstract class _OrderLoaderState implements OrderLoaderState {
|
|||||||
required final Option<OrderFailure> failureOptionOrder,
|
required final Option<OrderFailure> failureOptionOrder,
|
||||||
required final String status,
|
required final String status,
|
||||||
final String? search,
|
final String? search,
|
||||||
final String? outletId,
|
|
||||||
final bool isFetching,
|
final bool isFetching,
|
||||||
final bool hasReachedMax,
|
final bool hasReachedMax,
|
||||||
final int page,
|
final int page,
|
||||||
@ -1249,8 +1037,6 @@ abstract class _OrderLoaderState implements OrderLoaderState {
|
|||||||
@override
|
@override
|
||||||
String? get search;
|
String? get search;
|
||||||
@override
|
@override
|
||||||
String? get outletId;
|
|
||||||
@override
|
|
||||||
bool get isFetching;
|
bool get isFetching;
|
||||||
@override
|
@override
|
||||||
bool get hasReachedMax;
|
bool get hasReachedMax;
|
||||||
|
|||||||
@ -8,8 +8,6 @@ class OrderLoaderEvent with _$OrderLoaderEvent {
|
|||||||
) = _RangeDateChanged;
|
) = _RangeDateChanged;
|
||||||
const factory OrderLoaderEvent.statusChanged(String status) = _StatusChanged;
|
const factory OrderLoaderEvent.statusChanged(String status) = _StatusChanged;
|
||||||
const factory OrderLoaderEvent.searchChanged(String search) = _SearchChanged;
|
const factory OrderLoaderEvent.searchChanged(String search) = _SearchChanged;
|
||||||
const factory OrderLoaderEvent.outletChanged(String? outletId) =
|
|
||||||
_OutletChanged;
|
|
||||||
const factory OrderLoaderEvent.fetched({@Default(false) bool isRefresh}) =
|
const factory OrderLoaderEvent.fetched({@Default(false) bool isRefresh}) =
|
||||||
_Fetched;
|
_Fetched;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,6 @@ class OrderLoaderState with _$OrderLoaderState {
|
|||||||
required Option<OrderFailure> failureOptionOrder,
|
required Option<OrderFailure> failureOptionOrder,
|
||||||
required String status,
|
required String status,
|
||||||
String? search,
|
String? search,
|
||||||
String? outletId,
|
|
||||||
@Default(false) bool isFetching,
|
@Default(false) bool isFetching,
|
||||||
@Default(false) bool hasReachedMax,
|
@Default(false) bool hasReachedMax,
|
||||||
@Default(1) int page,
|
@Default(1) int page,
|
||||||
@ -18,7 +17,7 @@ class OrderLoaderState with _$OrderLoaderState {
|
|||||||
factory OrderLoaderState.initial() => OrderLoaderState(
|
factory OrderLoaderState.initial() => OrderLoaderState(
|
||||||
orders: [],
|
orders: [],
|
||||||
failureOptionOrder: none(),
|
failureOptionOrder: none(),
|
||||||
dateFrom: DateTime.now(),
|
dateFrom: DateTime.now().subtract(const Duration(days: 30)),
|
||||||
dateTo: DateTime.now(),
|
dateTo: DateTime.now(),
|
||||||
status: 'all',
|
status: 'all',
|
||||||
);
|
);
|
||||||
|
|||||||
@ -134,9 +134,9 @@ extension GetItInjectableX on _i174.GetIt {
|
|||||||
final gh = _i526.GetItHelper(this, environment, environmentFilter);
|
final gh = _i526.GetItHelper(this, environment, environmentFilter);
|
||||||
final firebaseDi = _$FirebaseDi();
|
final firebaseDi = _$FirebaseDi();
|
||||||
final sharedPreferencesDi = _$SharedPreferencesDi();
|
final sharedPreferencesDi = _$SharedPreferencesDi();
|
||||||
|
final dioDi = _$DioDi();
|
||||||
final autoRouteDi = _$AutoRouteDi();
|
final autoRouteDi = _$AutoRouteDi();
|
||||||
final connectivityDi = _$ConnectivityDi();
|
final connectivityDi = _$ConnectivityDi();
|
||||||
final dioDi = _$DioDi();
|
|
||||||
final packageInfoDi = _$PackageInfoDi();
|
final packageInfoDi = _$PackageInfoDi();
|
||||||
await gh.factoryAsync<_i982.FirebaseApp>(
|
await gh.factoryAsync<_i982.FirebaseApp>(
|
||||||
() => firebaseDi.firebaseApp,
|
() => firebaseDi.firebaseApp,
|
||||||
@ -146,9 +146,9 @@ extension GetItInjectableX on _i174.GetIt {
|
|||||||
() => sharedPreferencesDi.prefs,
|
() => sharedPreferencesDi.prefs,
|
||||||
preResolve: true,
|
preResolve: true,
|
||||||
);
|
);
|
||||||
|
gh.lazySingleton<_i361.Dio>(() => dioDi.dio);
|
||||||
gh.lazySingleton<_i258.AppRouter>(() => autoRouteDi.appRouter);
|
gh.lazySingleton<_i258.AppRouter>(() => autoRouteDi.appRouter);
|
||||||
gh.lazySingleton<_i895.Connectivity>(() => connectivityDi.connectivity);
|
gh.lazySingleton<_i895.Connectivity>(() => connectivityDi.connectivity);
|
||||||
gh.lazySingleton<_i361.Dio>(() => dioDi.dio);
|
|
||||||
await gh.lazySingletonAsync<_i655.PackageInfo>(
|
await gh.lazySingletonAsync<_i655.PackageInfo>(
|
||||||
() => packageInfoDi.packageInfo,
|
() => packageInfoDi.packageInfo,
|
||||||
preResolve: true,
|
preResolve: true,
|
||||||
@ -172,29 +172,29 @@ extension GetItInjectableX on _i174.GetIt {
|
|||||||
() => _i115.ApiClient(gh<_i361.Dio>(), gh<_i6.Env>()),
|
() => _i115.ApiClient(gh<_i361.Dio>(), gh<_i6.Env>()),
|
||||||
);
|
);
|
||||||
gh.factory<_i6.Env>(() => _i6.ProdEnv(), registerFor: {_prod});
|
gh.factory<_i6.Env>(() => _i6.ProdEnv(), registerFor: {_prod});
|
||||||
gh.factory<_i866.AnalyticRemoteDataProvider>(
|
gh.factory<_i130.OrderRemoteDataProvider>(
|
||||||
() => _i866.AnalyticRemoteDataProvider(gh<_i115.ApiClient>()),
|
() => _i130.OrderRemoteDataProvider(gh<_i115.ApiClient>()),
|
||||||
);
|
|
||||||
gh.factory<_i17.AuthRemoteDataProvider>(
|
|
||||||
() => _i17.AuthRemoteDataProvider(gh<_i115.ApiClient>()),
|
|
||||||
);
|
);
|
||||||
gh.factory<_i333.CategoryRemoteDataProvider>(
|
gh.factory<_i333.CategoryRemoteDataProvider>(
|
||||||
() => _i333.CategoryRemoteDataProvider(gh<_i115.ApiClient>()),
|
() => _i333.CategoryRemoteDataProvider(gh<_i115.ApiClient>()),
|
||||||
);
|
);
|
||||||
gh.factory<_i1006.CustomerRemoteDataProvider>(
|
gh.factory<_i17.AuthRemoteDataProvider>(
|
||||||
() => _i1006.CustomerRemoteDataProvider(gh<_i115.ApiClient>()),
|
() => _i17.AuthRemoteDataProvider(gh<_i115.ApiClient>()),
|
||||||
);
|
);
|
||||||
gh.factory<_i130.OrderRemoteDataProvider>(
|
gh.factory<_i785.UserRemoteDataProvider>(
|
||||||
() => _i130.OrderRemoteDataProvider(gh<_i115.ApiClient>()),
|
() => _i785.UserRemoteDataProvider(gh<_i115.ApiClient>()),
|
||||||
);
|
|
||||||
gh.factory<_i27.OutletRemoteDataProvider>(
|
|
||||||
() => _i27.OutletRemoteDataProvider(gh<_i115.ApiClient>()),
|
|
||||||
);
|
);
|
||||||
gh.factory<_i823.ProductRemoteDataProvider>(
|
gh.factory<_i823.ProductRemoteDataProvider>(
|
||||||
() => _i823.ProductRemoteDataProvider(gh<_i115.ApiClient>()),
|
() => _i823.ProductRemoteDataProvider(gh<_i115.ApiClient>()),
|
||||||
);
|
);
|
||||||
gh.factory<_i785.UserRemoteDataProvider>(
|
gh.factory<_i27.OutletRemoteDataProvider>(
|
||||||
() => _i785.UserRemoteDataProvider(gh<_i115.ApiClient>()),
|
() => _i27.OutletRemoteDataProvider(gh<_i115.ApiClient>()),
|
||||||
|
);
|
||||||
|
gh.factory<_i866.AnalyticRemoteDataProvider>(
|
||||||
|
() => _i866.AnalyticRemoteDataProvider(gh<_i115.ApiClient>()),
|
||||||
|
);
|
||||||
|
gh.factory<_i1006.CustomerRemoteDataProvider>(
|
||||||
|
() => _i1006.CustomerRemoteDataProvider(gh<_i115.ApiClient>()),
|
||||||
);
|
);
|
||||||
gh.factory<_i48.ICustomerRepository>(
|
gh.factory<_i48.ICustomerRepository>(
|
||||||
() => _i550.CustomerRepository(gh<_i1006.CustomerRemoteDataProvider>()),
|
() => _i550.CustomerRepository(gh<_i1006.CustomerRemoteDataProvider>()),
|
||||||
@ -248,23 +248,20 @@ extension GetItInjectableX on _i174.GetIt {
|
|||||||
gh<_i850.OutletLocalDataProvider>(),
|
gh<_i850.OutletLocalDataProvider>(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
gh.factory<_i889.SalesLoaderBloc>(
|
|
||||||
() => _i889.SalesLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
|
||||||
);
|
|
||||||
gh.factory<_i473.HomeBloc>(
|
gh.factory<_i473.HomeBloc>(
|
||||||
() => _i473.HomeBloc(gh<_i477.IAnalyticRepository>()),
|
() => _i473.HomeBloc(gh<_i477.IAnalyticRepository>()),
|
||||||
);
|
);
|
||||||
|
gh.factory<_i889.SalesLoaderBloc>(
|
||||||
|
() => _i889.SalesLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
||||||
|
);
|
||||||
gh.factory<_i877.OutletListLoaderBloc>(
|
gh.factory<_i877.OutletListLoaderBloc>(
|
||||||
() => _i877.OutletListLoaderBloc(gh<_i197.IOutletRepository>()),
|
() => _i877.OutletListLoaderBloc(gh<_i197.IOutletRepository>()),
|
||||||
);
|
);
|
||||||
gh.factory<_i337.CurrentOutletLoaderBloc>(
|
gh.factory<_i337.CurrentOutletLoaderBloc>(
|
||||||
() => _i337.CurrentOutletLoaderBloc(gh<_i197.IOutletRepository>()),
|
() => _i337.CurrentOutletLoaderBloc(gh<_i197.IOutletRepository>()),
|
||||||
);
|
);
|
||||||
gh.factory<_i1038.CategoryAnalyticLoaderBloc>(
|
gh.factory<_i221.ProductAnalyticLoaderBloc>(
|
||||||
() => _i1038.CategoryAnalyticLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
() => _i221.ProductAnalyticLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
||||||
);
|
|
||||||
gh.factory<_i516.DashboardAnalyticLoaderBloc>(
|
|
||||||
() => _i516.DashboardAnalyticLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
|
||||||
);
|
);
|
||||||
gh.factory<_i785.InventoryAnalyticLoaderBloc>(
|
gh.factory<_i785.InventoryAnalyticLoaderBloc>(
|
||||||
() => _i785.InventoryAnalyticLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
() => _i785.InventoryAnalyticLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
||||||
@ -274,12 +271,15 @@ extension GetItInjectableX on _i174.GetIt {
|
|||||||
gh<_i477.IAnalyticRepository>(),
|
gh<_i477.IAnalyticRepository>(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
gh.factory<_i221.ProductAnalyticLoaderBloc>(
|
gh.factory<_i1038.CategoryAnalyticLoaderBloc>(
|
||||||
() => _i221.ProductAnalyticLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
() => _i1038.CategoryAnalyticLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
||||||
);
|
);
|
||||||
gh.factory<_i11.ProfitLossLoaderBloc>(
|
gh.factory<_i11.ProfitLossLoaderBloc>(
|
||||||
() => _i11.ProfitLossLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
() => _i11.ProfitLossLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
||||||
);
|
);
|
||||||
|
gh.factory<_i516.DashboardAnalyticLoaderBloc>(
|
||||||
|
() => _i516.DashboardAnalyticLoaderBloc(gh<_i477.IAnalyticRepository>()),
|
||||||
|
);
|
||||||
gh.factory<_i945.AuthBloc>(
|
gh.factory<_i945.AuthBloc>(
|
||||||
() => _i945.AuthBloc(gh<_i49.IAuthRepository>()),
|
() => _i945.AuthBloc(gh<_i49.IAuthRepository>()),
|
||||||
);
|
);
|
||||||
@ -289,12 +289,12 @@ extension GetItInjectableX on _i174.GetIt {
|
|||||||
gh.factory<_i1058.OrderLoaderBloc>(
|
gh.factory<_i1058.OrderLoaderBloc>(
|
||||||
() => _i1058.OrderLoaderBloc(gh<_i219.IOrderRepository>()),
|
() => _i1058.OrderLoaderBloc(gh<_i219.IOrderRepository>()),
|
||||||
);
|
);
|
||||||
gh.factory<_i1030.ChangePasswordFormBloc>(
|
|
||||||
() => _i1030.ChangePasswordFormBloc(gh<_i635.IUserRepository>()),
|
|
||||||
);
|
|
||||||
gh.factory<_i147.UserEditFormBloc>(
|
gh.factory<_i147.UserEditFormBloc>(
|
||||||
() => _i147.UserEditFormBloc(gh<_i635.IUserRepository>()),
|
() => _i147.UserEditFormBloc(gh<_i635.IUserRepository>()),
|
||||||
);
|
);
|
||||||
|
gh.factory<_i1030.ChangePasswordFormBloc>(
|
||||||
|
() => _i1030.ChangePasswordFormBloc(gh<_i635.IUserRepository>()),
|
||||||
|
);
|
||||||
gh.factory<_i775.LoginFormBloc>(
|
gh.factory<_i775.LoginFormBloc>(
|
||||||
() => _i775.LoginFormBloc(
|
() => _i775.LoginFormBloc(
|
||||||
gh<_i49.IAuthRepository>(),
|
gh<_i49.IAuthRepository>(),
|
||||||
@ -302,14 +302,14 @@ extension GetItInjectableX on _i174.GetIt {
|
|||||||
gh<_i179.FcmService>(),
|
gh<_i179.FcmService>(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
gh.factory<_i346.InventoryReportBloc>(
|
gh.factory<_i605.TransactionReportBloc>(
|
||||||
() => _i346.InventoryReportBloc(
|
() => _i605.TransactionReportBloc(
|
||||||
gh<_i477.IAnalyticRepository>(),
|
gh<_i477.IAnalyticRepository>(),
|
||||||
gh<_i197.IOutletRepository>(),
|
gh<_i197.IOutletRepository>(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
gh.factory<_i605.TransactionReportBloc>(
|
gh.factory<_i346.InventoryReportBloc>(
|
||||||
() => _i605.TransactionReportBloc(
|
() => _i346.InventoryReportBloc(
|
||||||
gh<_i477.IAnalyticRepository>(),
|
gh<_i477.IAnalyticRepository>(),
|
||||||
gh<_i197.IOutletRepository>(),
|
gh<_i197.IOutletRepository>(),
|
||||||
),
|
),
|
||||||
@ -322,10 +322,10 @@ class _$FirebaseDi extends _i73.FirebaseDi {}
|
|||||||
|
|
||||||
class _$SharedPreferencesDi extends _i402.SharedPreferencesDi {}
|
class _$SharedPreferencesDi extends _i402.SharedPreferencesDi {}
|
||||||
|
|
||||||
|
class _$DioDi extends _i103.DioDi {}
|
||||||
|
|
||||||
class _$AutoRouteDi extends _i311.AutoRouteDi {}
|
class _$AutoRouteDi extends _i311.AutoRouteDi {}
|
||||||
|
|
||||||
class _$ConnectivityDi extends _i586.ConnectivityDi {}
|
class _$ConnectivityDi extends _i586.ConnectivityDi {}
|
||||||
|
|
||||||
class _$DioDi extends _i103.DioDi {}
|
|
||||||
|
|
||||||
class _$PackageInfoDi extends _i227.PackageInfoDi {}
|
class _$PackageInfoDi extends _i227.PackageInfoDi {}
|
||||||
|
|||||||
@ -91,8 +91,6 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: AppColor.background,
|
backgroundColor: AppColor.background,
|
||||||
body: RefreshIndicator(
|
body: RefreshIndicator(
|
||||||
backgroundColor: AppColor.white,
|
|
||||||
color: AppColor.primary,
|
|
||||||
onRefresh: () {
|
onRefresh: () {
|
||||||
_refetchDashboard(context);
|
_refetchDashboard(context);
|
||||||
return Future.value();
|
return Future.value();
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:shimmer/shimmer.dart';
|
import 'package:shimmer/shimmer.dart';
|
||||||
|
|
||||||
import '../../../../application/order/order_loader/order_loader_bloc.dart';
|
import '../../../../application/order/order_loader/order_loader_bloc.dart';
|
||||||
import '../../../../application/outlet/outlet_list_loader/outlet_list_loader_bloc.dart';
|
|
||||||
import '../../../../common/extension/extension.dart';
|
import '../../../../common/extension/extension.dart';
|
||||||
import '../../../../common/theme/theme.dart';
|
import '../../../../common/theme/theme.dart';
|
||||||
import '../../../../injection.dart';
|
import '../../../../injection.dart';
|
||||||
@ -24,19 +23,10 @@ class OrderPage extends StatefulWidget implements AutoRouteWrapper {
|
|||||||
State<OrderPage> createState() => _OrderPageState();
|
State<OrderPage> createState() => _OrderPageState();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget wrappedRoute(BuildContext context) => MultiBlocProvider(
|
Widget wrappedRoute(BuildContext context) => BlocProvider(
|
||||||
providers: [
|
create: (_) =>
|
||||||
BlocProvider(
|
getIt<OrderLoaderBloc>()
|
||||||
create: (_) =>
|
..add(OrderLoaderEvent.fetched(isRefresh: true)),
|
||||||
getIt<OrderLoaderBloc>()
|
|
||||||
..add(OrderLoaderEvent.fetched(isRefresh: true)),
|
|
||||||
),
|
|
||||||
BlocProvider(
|
|
||||||
create: (_) =>
|
|
||||||
getIt<OutletListLoaderBloc>()
|
|
||||||
..add(const OutletListLoaderEvent.fetched()),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
child: this,
|
child: this,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -189,14 +179,6 @@ class _OrderPageState extends State<OrderPage> with TickerProviderStateMixin {
|
|||||||
backgroundColor: AppColor.background,
|
backgroundColor: AppColor.background,
|
||||||
body: MultiBlocListener(
|
body: MultiBlocListener(
|
||||||
listeners: [
|
listeners: [
|
||||||
BlocListener<OrderLoaderBloc, OrderLoaderState>(
|
|
||||||
listenWhen: (p, c) => p.outletId != c.outletId,
|
|
||||||
listener: (context, state) {
|
|
||||||
context.read<OrderLoaderBloc>().add(
|
|
||||||
OrderLoaderEvent.fetched(isRefresh: true),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
BlocListener<OrderLoaderBloc, OrderLoaderState>(
|
BlocListener<OrderLoaderBloc, OrderLoaderState>(
|
||||||
listenWhen: (p, c) => p.status != c.status,
|
listenWhen: (p, c) => p.status != c.status,
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
@ -216,151 +198,137 @@ class _OrderPageState extends State<OrderPage> with TickerProviderStateMixin {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
child: BlocBuilder<OutletListLoaderBloc, OutletListLoaderState>(
|
child: BlocBuilder<OrderLoaderBloc, OrderLoaderState>(
|
||||||
builder: (context, outletListState) {
|
builder: (context, state) {
|
||||||
return BlocBuilder<OrderLoaderBloc, OrderLoaderState>(
|
return NotificationListener<ScrollNotification>(
|
||||||
builder: (context, state) {
|
onNotification: (notification) {
|
||||||
return NotificationListener<ScrollNotification>(
|
if (notification is ScrollEndNotification &&
|
||||||
onNotification: (notification) {
|
_scrollController.position.extentAfter == 0) {
|
||||||
if (notification is ScrollEndNotification &&
|
context.read<OrderLoaderBloc>().add(
|
||||||
_scrollController.position.extentAfter == 0) {
|
OrderLoaderEvent.fetched(),
|
||||||
context.read<OrderLoaderBloc>().add(
|
);
|
||||||
OrderLoaderEvent.fetched(),
|
return true;
|
||||||
);
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
|
||||||
child: CustomScrollView(
|
|
||||||
controller: _scrollController,
|
|
||||||
slivers: [
|
|
||||||
// Custom App Bar with Hero Effect
|
|
||||||
SliverAppBar(
|
|
||||||
expandedHeight: 120,
|
|
||||||
floating: true,
|
|
||||||
pinned: true,
|
|
||||||
backgroundColor: AppColor.primary,
|
|
||||||
centerTitle: false,
|
|
||||||
flexibleSpace: CustomAppBar(
|
|
||||||
title: context.lang.orders,
|
|
||||||
isBack: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
// Pinned Filter Section
|
|
||||||
SliverPersistentHeader(
|
|
||||||
pinned: true,
|
|
||||||
delegate: FilterHeaderDelegate(
|
|
||||||
backgroundColor: AppColor.background,
|
|
||||||
padding: EdgeInsets.fromLTRB(
|
|
||||||
AppValue.padding,
|
|
||||||
10,
|
|
||||||
AppValue.padding,
|
|
||||||
10,
|
|
||||||
),
|
|
||||||
startDate: state.dateFrom,
|
|
||||||
endDate: state.dateTo,
|
|
||||||
filterOptions: filterOptions,
|
|
||||||
selectedFilter: state.status,
|
|
||||||
selectedOutletId: state.outletId,
|
|
||||||
outletListState: outletListState,
|
|
||||||
onDateChanged: (startDate, endDate) {
|
|
||||||
if (startDate != null && endDate != null) {
|
|
||||||
log('Date changed');
|
|
||||||
context.read<OrderLoaderBloc>().add(
|
|
||||||
OrderLoaderEvent.rangeDateChanged(
|
|
||||||
startDate,
|
|
||||||
endDate,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onFilterChanged: (filter) {
|
|
||||||
final status = filter.toLowerCase();
|
|
||||||
context.read<OrderLoaderBloc>().add(
|
|
||||||
OrderLoaderEvent.statusChanged(status),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
onOutletChanged: (outletId) {
|
|
||||||
context.read<OrderLoaderBloc>().add(
|
|
||||||
OrderLoaderEvent.outletChanged(outletId),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
// Content
|
|
||||||
SliverPadding(
|
|
||||||
padding: EdgeInsets.all(AppValue.padding),
|
|
||||||
sliver: SliverList(
|
|
||||||
delegate: SliverChildListDelegate([
|
|
||||||
FadeTransition(
|
|
||||||
opacity: _fadeAnimation,
|
|
||||||
child: SlideTransition(
|
|
||||||
position: _slideAnimation,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
// Show filtered transaction count
|
|
||||||
if (state.status != 'all' &&
|
|
||||||
!state.isFetching)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
bottom: 16,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'${state.orders.length} ${state.status.toLowerCase()} ${context.lang.orders}',
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColor.textSecondary,
|
|
||||||
fontSize: 14,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
// Order List with Shimmer Loading
|
|
||||||
if (state.isFetching)
|
|
||||||
_buildShimmerList()
|
|
||||||
else if (state.orders.isEmpty)
|
|
||||||
EmptyWidget(
|
|
||||||
title: context.lang.order,
|
|
||||||
message:
|
|
||||||
context.lang.no_order_with_status(
|
|
||||||
state.status.toLowerCase(),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
else
|
|
||||||
ListView.builder(
|
|
||||||
itemCount: state.orders.length,
|
|
||||||
shrinkWrap: true,
|
|
||||||
physics:
|
|
||||||
const NeverScrollableScrollPhysics(),
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return OrderTile(
|
|
||||||
onTap: () => context.router.push(
|
|
||||||
OrderDetailRoute(
|
|
||||||
order: state.orders[index],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
order: state.orders[index],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
child: CustomScrollView(
|
||||||
|
controller: _scrollController,
|
||||||
|
slivers: [
|
||||||
|
// Custom App Bar with Hero Effect
|
||||||
|
SliverAppBar(
|
||||||
|
expandedHeight: 120,
|
||||||
|
floating: true,
|
||||||
|
pinned: true,
|
||||||
|
backgroundColor: AppColor.primary,
|
||||||
|
centerTitle: false,
|
||||||
|
flexibleSpace: CustomAppBar(
|
||||||
|
title: context.lang.orders,
|
||||||
|
isBack: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Pinned Filter Section
|
||||||
|
SliverPersistentHeader(
|
||||||
|
pinned: true,
|
||||||
|
delegate: FilterHeaderDelegate(
|
||||||
|
backgroundColor: AppColor.background,
|
||||||
|
padding: EdgeInsets.fromLTRB(
|
||||||
|
AppValue.padding,
|
||||||
|
10,
|
||||||
|
AppValue.padding,
|
||||||
|
10,
|
||||||
|
),
|
||||||
|
startDate: state.dateFrom,
|
||||||
|
endDate: state.dateTo,
|
||||||
|
filterOptions: filterOptions,
|
||||||
|
selectedFilter: state.status,
|
||||||
|
onDateChanged: (startDate, endDate) {
|
||||||
|
if (startDate != null && endDate != null) {
|
||||||
|
log('Date changed');
|
||||||
|
context.read<OrderLoaderBloc>().add(
|
||||||
|
OrderLoaderEvent.rangeDateChanged(
|
||||||
|
startDate,
|
||||||
|
endDate,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onFilterChanged: (filter) {
|
||||||
|
final status = filter.toLowerCase();
|
||||||
|
|
||||||
|
context.read<OrderLoaderBloc>().add(
|
||||||
|
OrderLoaderEvent.statusChanged(status),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Content
|
||||||
|
SliverPadding(
|
||||||
|
padding: EdgeInsets.all(AppValue.padding),
|
||||||
|
sliver: SliverList(
|
||||||
|
delegate: SliverChildListDelegate([
|
||||||
|
FadeTransition(
|
||||||
|
opacity: _fadeAnimation,
|
||||||
|
child: SlideTransition(
|
||||||
|
position: _slideAnimation,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
// Show filtered transaction count
|
||||||
|
if (state.status != 'all' && !state.isFetching)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 16),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${state.orders.length} ${state.status.toLowerCase()} ${context.lang.orders}',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColor.textSecondary,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Order List with Shimmer Loading
|
||||||
|
if (state.isFetching)
|
||||||
|
_buildShimmerList()
|
||||||
|
else if (state.orders.isEmpty)
|
||||||
|
EmptyWidget(
|
||||||
|
title: context.lang.order,
|
||||||
|
message: context.lang.no_order_with_status(
|
||||||
|
state.status.toLowerCase(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else
|
||||||
|
ListView.builder(
|
||||||
|
itemCount: state.orders.length,
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics:
|
||||||
|
const NeverScrollableScrollPhysics(),
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return OrderTile(
|
||||||
|
onTap: () => context.router.push(
|
||||||
|
OrderDetailRoute(
|
||||||
|
order: state.orders[index],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
order: state.orders[index],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../../../../../application/outlet/outlet_list_loader/outlet_list_loader_bloc.dart';
|
|
||||||
import '../../../../../common/extension/extension.dart';
|
import '../../../../../common/extension/extension.dart';
|
||||||
import '../../../../../common/theme/theme.dart';
|
|
||||||
import '../../../../../domain/outlet/outlet.dart';
|
|
||||||
import '../../../../components/field/date_range_picker_field.dart';
|
import '../../../../components/field/date_range_picker_field.dart';
|
||||||
import 'status_tile.dart';
|
import 'status_tile.dart';
|
||||||
|
|
||||||
@ -14,11 +11,8 @@ class FilterHeaderDelegate extends SliverPersistentHeaderDelegate {
|
|||||||
final DateTime? endDate;
|
final DateTime? endDate;
|
||||||
final List<String> filterOptions;
|
final List<String> filterOptions;
|
||||||
final String selectedFilter;
|
final String selectedFilter;
|
||||||
final String? selectedOutletId;
|
|
||||||
final OutletListLoaderState outletListState;
|
|
||||||
final Function(DateTime?, DateTime?) onDateChanged;
|
final Function(DateTime?, DateTime?) onDateChanged;
|
||||||
final Function(String) onFilterChanged;
|
final Function(String) onFilterChanged;
|
||||||
final Function(String?) onOutletChanged;
|
|
||||||
|
|
||||||
FilterHeaderDelegate({
|
FilterHeaderDelegate({
|
||||||
required this.backgroundColor,
|
required this.backgroundColor,
|
||||||
@ -27,18 +21,15 @@ class FilterHeaderDelegate extends SliverPersistentHeaderDelegate {
|
|||||||
required this.endDate,
|
required this.endDate,
|
||||||
required this.filterOptions,
|
required this.filterOptions,
|
||||||
required this.selectedFilter,
|
required this.selectedFilter,
|
||||||
required this.selectedOutletId,
|
|
||||||
required this.outletListState,
|
|
||||||
required this.onDateChanged,
|
required this.onDateChanged,
|
||||||
required this.onFilterChanged,
|
required this.onFilterChanged,
|
||||||
required this.onOutletChanged,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
double get minExtent => 190;
|
double get minExtent => 130;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
double get maxExtent => 190;
|
double get maxExtent => 130;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(
|
Widget build(
|
||||||
@ -46,55 +37,51 @@ class FilterHeaderDelegate extends SliverPersistentHeaderDelegate {
|
|||||||
double shrinkOffset,
|
double shrinkOffset,
|
||||||
bool overlapsContent,
|
bool overlapsContent,
|
||||||
) {
|
) {
|
||||||
final selectedOutlet = outletListState.outlets
|
|
||||||
.where((o) => o.id == selectedOutletId)
|
|
||||||
.firstOrNull;
|
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
color: backgroundColor,
|
color: backgroundColor,
|
||||||
padding: padding,
|
padding: padding,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Date range picker
|
Padding(
|
||||||
DateRangePickerField(
|
padding: const EdgeInsets.only(bottom: 8.0),
|
||||||
maxDate: DateTime.now(),
|
child: DateRangePickerField(
|
||||||
startDate: startDate,
|
maxDate: DateTime.now(),
|
||||||
endDate: endDate,
|
startDate: startDate,
|
||||||
onChanged: (start, end) => onDateChanged(start, end),
|
endDate: endDate,
|
||||||
|
onChanged: (start, end) {
|
||||||
|
onDateChanged(start, end);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
Expanded(
|
||||||
// Outlet selector + status chips
|
child: SingleChildScrollView(
|
||||||
_OutletSelectorField(
|
scrollDirection: Axis.horizontal,
|
||||||
selectedOutlet: selectedOutlet,
|
child: Row(
|
||||||
isLoading: outletListState.isFetching,
|
children: filterOptions.asMap().entries.map((entry) {
|
||||||
onTap: () => _showOutletSheet(context),
|
final index = entry.key;
|
||||||
),
|
final option = entry.value;
|
||||||
const SizedBox(height: 8),
|
|
||||||
// Status chips
|
return Padding(
|
||||||
SingleChildScrollView(
|
padding: EdgeInsets.only(
|
||||||
scrollDirection: Axis.horizontal,
|
right: index < filterOptions.length - 1 ? 8 : 0,
|
||||||
child: Row(
|
),
|
||||||
children: filterOptions.asMap().entries.map((entry) {
|
child: OrderStatusTile(
|
||||||
final index = entry.key;
|
label: option == "All"
|
||||||
final option = entry.value;
|
? context.lang.all
|
||||||
return Padding(
|
: option == "Completed"
|
||||||
padding: EdgeInsets.only(
|
? context.lang.completed
|
||||||
right: index < filterOptions.length - 1 ? 8 : 0,
|
: context.lang.pending,
|
||||||
),
|
isSelected: option == selectedFilter,
|
||||||
child: OrderStatusTile(
|
onSelected: (isSelected) {
|
||||||
label: option == 'All'
|
if (isSelected) {
|
||||||
? context.lang.all
|
onFilterChanged(option);
|
||||||
: option == 'Completed'
|
}
|
||||||
? context.lang.completed
|
},
|
||||||
: context.lang.pending,
|
),
|
||||||
isSelected: option.toLowerCase() == selectedFilter,
|
);
|
||||||
onSelected: (isSelected) {
|
}).toList(),
|
||||||
if (isSelected) onFilterChanged(option);
|
),
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -102,258 +89,12 @@ class FilterHeaderDelegate extends SliverPersistentHeaderDelegate {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showOutletSheet(BuildContext context) {
|
|
||||||
showModalBottomSheet(
|
|
||||||
context: context,
|
|
||||||
shape: const RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
|
||||||
),
|
|
||||||
builder: (_) => _OutletBottomSheet(
|
|
||||||
outlets: outletListState.outlets,
|
|
||||||
selectedOutletId: selectedOutletId,
|
|
||||||
onSelected: (outletId) {
|
|
||||||
Navigator.pop(context);
|
|
||||||
onOutletChanged(outletId);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool shouldRebuild(covariant FilterHeaderDelegate oldDelegate) {
|
bool shouldRebuild(covariant FilterHeaderDelegate oldDelegate) {
|
||||||
return oldDelegate.startDate != startDate ||
|
return oldDelegate.startDate != startDate ||
|
||||||
oldDelegate.endDate != endDate ||
|
oldDelegate.endDate != endDate ||
|
||||||
oldDelegate.selectedFilter != selectedFilter ||
|
oldDelegate.selectedFilter != selectedFilter ||
|
||||||
oldDelegate.selectedOutletId != selectedOutletId ||
|
|
||||||
oldDelegate.outletListState.outlets.length !=
|
|
||||||
outletListState.outlets.length ||
|
|
||||||
oldDelegate.outletListState.isFetching != outletListState.isFetching ||
|
|
||||||
oldDelegate.filterOptions.length != filterOptions.length ||
|
oldDelegate.filterOptions.length != filterOptions.length ||
|
||||||
oldDelegate.backgroundColor != backgroundColor;
|
oldDelegate.backgroundColor != backgroundColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Field outlet — ikut style DateRangePickerField
|
|
||||||
class _OutletSelectorField extends StatefulWidget {
|
|
||||||
final Outlet? selectedOutlet;
|
|
||||||
final bool isLoading;
|
|
||||||
final VoidCallback onTap;
|
|
||||||
|
|
||||||
const _OutletSelectorField({
|
|
||||||
required this.selectedOutlet,
|
|
||||||
required this.isLoading,
|
|
||||||
required this.onTap,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<_OutletSelectorField> createState() => _OutletSelectorFieldState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _OutletSelectorFieldState extends State<_OutletSelectorField> {
|
|
||||||
bool _isPressed = false;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final hasValue = widget.selectedOutlet != null;
|
|
||||||
final label = widget.selectedOutlet?.name ?? 'Semua Outlet';
|
|
||||||
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: widget.isLoading ? null : widget.onTap,
|
|
||||||
onTapDown: (_) => setState(() => _isPressed = true),
|
|
||||||
onTapUp: (_) => setState(() => _isPressed = false),
|
|
||||||
onTapCancel: () => setState(() => _isPressed = false),
|
|
||||||
child: AnimatedContainer(
|
|
||||||
duration: const Duration(milliseconds: 150),
|
|
||||||
height: 52,
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: _isPressed ? AppColor.backgroundLight : AppColor.white,
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
border: Border.all(
|
|
||||||
color: _isPressed ? AppColor.primary : AppColor.border,
|
|
||||||
width: _isPressed ? 2 : 1,
|
|
||||||
),
|
|
||||||
boxShadow: _isPressed
|
|
||||||
? [
|
|
||||||
BoxShadow(
|
|
||||||
color: AppColor.primary.withOpacity(0.1),
|
|
||||||
blurRadius: 8,
|
|
||||||
offset: const Offset(0, 2),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
label,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 15,
|
|
||||||
fontWeight: hasValue ? FontWeight.w500 : FontWeight.w400,
|
|
||||||
color: hasValue
|
|
||||||
? AppColor.textPrimary
|
|
||||||
: AppColor.textSecondary,
|
|
||||||
),
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.all(4),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColor.primary.withOpacity(0.1),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: widget.isLoading
|
|
||||||
? const SizedBox(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
child: CircularProgressIndicator(
|
|
||||||
strokeWidth: 2,
|
|
||||||
color: AppColor.primary,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: const Icon(
|
|
||||||
Icons.store_rounded,
|
|
||||||
size: 20,
|
|
||||||
color: AppColor.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bottom sheet pilih outlet
|
|
||||||
class _OutletBottomSheet extends StatelessWidget {
|
|
||||||
final List<Outlet> outlets;
|
|
||||||
final String? selectedOutletId;
|
|
||||||
final Function(String?) onSelected;
|
|
||||||
|
|
||||||
const _OutletBottomSheet({
|
|
||||||
required this.outlets,
|
|
||||||
required this.selectedOutletId,
|
|
||||||
required this.onSelected,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return SafeArea(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.fromLTRB(20, 16, 20, 20),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Center(
|
|
||||||
child: Container(
|
|
||||||
width: 40,
|
|
||||||
height: 4,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.grey.shade300,
|
|
||||||
borderRadius: BorderRadius.circular(2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
Text(
|
|
||||||
'Pilih Outlet',
|
|
||||||
style: AppStyle.lg.copyWith(fontWeight: FontWeight.w700),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 12),
|
|
||||||
_OutletItem(
|
|
||||||
label: 'Semua Outlet',
|
|
||||||
icon: Icons.store_rounded,
|
|
||||||
isSelected: selectedOutletId == null,
|
|
||||||
onTap: () => onSelected(null),
|
|
||||||
),
|
|
||||||
const Divider(height: 1),
|
|
||||||
...outlets.map(
|
|
||||||
(outlet) => Column(
|
|
||||||
children: [
|
|
||||||
_OutletItem(
|
|
||||||
label: outlet.name,
|
|
||||||
icon: Icons.storefront_rounded,
|
|
||||||
isSelected: selectedOutletId == outlet.id,
|
|
||||||
isActive: outlet.isActive,
|
|
||||||
onTap: () => onSelected(outlet.id),
|
|
||||||
),
|
|
||||||
if (outlet != outlets.last) const Divider(height: 1),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _OutletItem extends StatelessWidget {
|
|
||||||
final String label;
|
|
||||||
final IconData icon;
|
|
||||||
final bool isSelected;
|
|
||||||
final bool? isActive;
|
|
||||||
final VoidCallback onTap;
|
|
||||||
|
|
||||||
const _OutletItem({
|
|
||||||
required this.label,
|
|
||||||
required this.icon,
|
|
||||||
required this.isSelected,
|
|
||||||
required this.onTap,
|
|
||||||
this.isActive,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return ListTile(
|
|
||||||
onTap: onTap,
|
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
|
|
||||||
leading: Container(
|
|
||||||
width: 36,
|
|
||||||
height: 36,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: isSelected
|
|
||||||
? AppColor.primary.withOpacity(0.1)
|
|
||||||
: AppColor.background,
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: Icon(
|
|
||||||
icon,
|
|
||||||
size: 18,
|
|
||||||
color: isSelected ? AppColor.primary : AppColor.textSecondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
label,
|
|
||||||
style: AppStyle.md.copyWith(
|
|
||||||
fontWeight: isSelected ? FontWeight.w700 : FontWeight.w500,
|
|
||||||
color: isSelected ? AppColor.primary : AppColor.textPrimary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
trailing: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
if (isActive != null)
|
|
||||||
Container(
|
|
||||||
width: 8,
|
|
||||||
height: 8,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
color: isActive! ? AppColor.success : AppColor.error,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (isActive != null) const SizedBox(width: 8),
|
|
||||||
if (isSelected)
|
|
||||||
const Icon(
|
|
||||||
Icons.check_rounded,
|
|
||||||
color: AppColor.primary,
|
|
||||||
size: 20,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -107,20 +107,7 @@ class _ReportPageState extends State<ReportPage> with TickerProviderStateMixin {
|
|||||||
DashboardAnalyticLoaderState
|
DashboardAnalyticLoaderState
|
||||||
>(
|
>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return RefreshIndicator(
|
return CustomScrollView(
|
||||||
color: AppColor.primary,
|
|
||||||
onRefresh: () async {
|
|
||||||
context.read<DashboardAnalyticLoaderBloc>().add(
|
|
||||||
DashboardAnalyticLoaderEvent.fetched(),
|
|
||||||
);
|
|
||||||
// tunggu sampai fetching selesai
|
|
||||||
await context
|
|
||||||
.read<DashboardAnalyticLoaderBloc>()
|
|
||||||
.stream
|
|
||||||
.firstWhere((s) => !s.isFetching);
|
|
||||||
},
|
|
||||||
child: CustomScrollView(
|
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverAppBar(
|
SliverAppBar(
|
||||||
expandedHeight: 120,
|
expandedHeight: 120,
|
||||||
@ -210,7 +197,6 @@ class _ReportPageState extends State<ReportPage> with TickerProviderStateMixin {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user