fix home
This commit is contained in:
parent
d7cd84e130
commit
6fda0f5636
@ -78,13 +78,21 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _refetchDashboard(BuildContext context) {
|
||||
context.read<HomeBloc>().add(HomeEvent.fetchedDashboard());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
return BlocListener<SelectedOutletBloc, SelectedOutletState>(
|
||||
listenWhen: (previous, current) =>
|
||||
previous.selectedOutletId != current.selectedOutletId,
|
||||
listener: (context, state) => _refetchDashboard(context),
|
||||
child: Scaffold(
|
||||
backgroundColor: AppColor.background,
|
||||
body: RefreshIndicator(
|
||||
onRefresh: () {
|
||||
context.read<HomeBloc>().add(HomeEvent.fetchedDashboard());
|
||||
_refetchDashboard(context);
|
||||
return Future.value();
|
||||
},
|
||||
child: BlocBuilder<HomeBloc, HomeState>(
|
||||
@ -201,6 +209,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
), // Scaffold
|
||||
); // BlocListener
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user