feat: pull to refresh on home
This commit is contained in:
parent
5a83bc4049
commit
3f75bffd09
@ -67,7 +67,12 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.background,
|
||||
body: BlocBuilder<HomeBloc, HomeState>(
|
||||
body: RefreshIndicator(
|
||||
onRefresh: () {
|
||||
context.read<HomeBloc>().add(HomeEvent.fetchedDashboard());
|
||||
return Future.value();
|
||||
},
|
||||
child: BlocBuilder<HomeBloc, HomeState>(
|
||||
builder: (context, state) {
|
||||
return CustomScrollView(
|
||||
physics: const BouncingScrollPhysics(
|
||||
@ -100,7 +105,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
|
||||
return FlexibleSpaceBar(
|
||||
title: Opacity(
|
||||
opacity: collapseProgress, // Title muncul saat collapse
|
||||
opacity:
|
||||
collapseProgress, // Title muncul saat collapse
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@ -181,6 +187,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,10 @@ class HomeTopProduct extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (products.isEmpty) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 24,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user