update
This commit is contained in:
parent
c4618bbc1b
commit
96526c1972
@ -14,7 +14,7 @@ class DashboardAnalyticLoaderState with _$DashboardAnalyticLoaderState {
|
||||
DashboardAnalyticLoaderState(
|
||||
dashboardAnalytic: DashboardAnalytic.empty(),
|
||||
failureOptionDashboardAnalytic: none(),
|
||||
dateFrom: DateTime.now().subtract(const Duration(days: 30)),
|
||||
dateFrom: DateTime.now(),
|
||||
dateTo: DateTime.now(),
|
||||
);
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ class OrderLoaderState with _$OrderLoaderState {
|
||||
factory OrderLoaderState.initial() => OrderLoaderState(
|
||||
orders: [],
|
||||
failureOptionOrder: none(),
|
||||
dateFrom: DateTime.now().subtract(const Duration(days: 30)),
|
||||
dateFrom: DateTime.now(),
|
||||
dateTo: DateTime.now(),
|
||||
status: 'all',
|
||||
);
|
||||
|
||||
@ -91,6 +91,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
child: Scaffold(
|
||||
backgroundColor: AppColor.background,
|
||||
body: RefreshIndicator(
|
||||
backgroundColor: AppColor.white,
|
||||
color: AppColor.primary,
|
||||
onRefresh: () {
|
||||
_refetchDashboard(context);
|
||||
return Future.value();
|
||||
|
||||
@ -107,7 +107,20 @@ class _ReportPageState extends State<ReportPage> with TickerProviderStateMixin {
|
||||
DashboardAnalyticLoaderState
|
||||
>(
|
||||
builder: (context, state) {
|
||||
return CustomScrollView(
|
||||
return RefreshIndicator(
|
||||
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: [
|
||||
SliverAppBar(
|
||||
expandedHeight: 120,
|
||||
@ -197,6 +210,7 @@ class _ReportPageState extends State<ReportPage> with TickerProviderStateMixin {
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user