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