dev #1

Merged
aefril merged 108 commits from dev into main 2026-05-15 05:52:26 +00:00
4 changed files with 19 additions and 3 deletions
Showing only changes of commit 96526c1972 - Show all commits

View File

@ -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(),
);
}

View File

@ -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',
);

View File

@ -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();

View File

@ -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 {
),
),
],
),
);
},
),