mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-09 20:49:29 +00:00
responsive home_page
This commit is contained in:
parent
a720c977c2
commit
ebc14a0448
9 changed files with 171 additions and 85 deletions
|
|
@ -38,19 +38,16 @@ class HomePage extends HookConsumerWidget {
|
|||
child: views.when(
|
||||
data: (data) {
|
||||
final shelvesToDisplay = data
|
||||
.where((element) => !element.id.contains('discover'))
|
||||
.map(
|
||||
(shelf) => HomeShelf(
|
||||
title: Text(shelf.label),
|
||||
shelf: shelf,
|
||||
),
|
||||
)
|
||||
.toList();
|
||||
// .where((element) => !element.id.contains('discover'))
|
||||
.map((shelf) {
|
||||
debugPrint('building shelf ${shelf.label}');
|
||||
return HomeShelf(
|
||||
title: shelf.label,
|
||||
shelf: shelf,
|
||||
);
|
||||
}).toList();
|
||||
return RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
// await ref
|
||||
// .read(personalizedViewProvider.notifier)
|
||||
// .forceRefresh();
|
||||
return ref.refresh(personalizedViewProvider);
|
||||
},
|
||||
child: ListView.separated(
|
||||
|
|
@ -65,7 +62,7 @@ class HomePage extends HookConsumerWidget {
|
|||
),
|
||||
);
|
||||
},
|
||||
loading: () => const CircularProgressIndicator(),
|
||||
loading: () => const HomePageSkeleton(),
|
||||
error: (error, stack) {
|
||||
return Text('Error: $error');
|
||||
},
|
||||
|
|
@ -74,3 +71,17 @@ class HomePage extends HookConsumerWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class HomePageSkeleton extends StatelessWidget {
|
||||
const HomePageSkeleton({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue