Skip to content

Commit

Permalink
feat(overview): add a refresh button for when there are no posts to d…
Browse files Browse the repository at this point in the history
…isplay
  • Loading branch information
yoannLafore committed Apr 8, 2024
1 parent 0fca270 commit ac34ef4
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions lib/views/pages/home/posts/home_feed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import "package:proxima/views/sort_option_widgets/feed_sort_option/feed_sort_opt
class HomeFeed extends HookConsumerWidget {
static const feedSortOptionKey = Key("feedSortOption");
static const emptyHomeFeedKey = Key("emptyHomeFeed");
static const refreshButtonKey = Key("refreshButton");
const HomeFeed({super.key});

@override
Expand All @@ -19,20 +20,32 @@ class HomeFeed extends HookConsumerWidget {

final emptyHelper = Center(
key: emptyHomeFeedKey,
child: Row(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text("No post to display, "),
InkWell(
onTap: () => {
//TODO: Add navigation to create post page
},
child: const Text(
"create one",
style: TextStyle(
color: Colors.blue,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text("No post to display, "),
InkWell(
onTap: () => {
//TODO: Add navigation to create post page
},
child: const Text(
"create one",
style: TextStyle(
color: Colors.blue,
),
),
),
),
],
),
ElevatedButton(
key: refreshButtonKey,
onPressed: () async {
return ref.refresh(postOverviewProvider);
},
child: const Text("Refresh"),
),
],
),
Expand Down

0 comments on commit ac34ef4

Please sign in to comment.