diff --git a/lib/ui/widgets/posts_list_widget.dart b/lib/ui/widgets/posts_list_widget.dart index a7b531c..01be463 100644 --- a/lib/ui/widgets/posts_list_widget.dart +++ b/lib/ui/widgets/posts_list_widget.dart @@ -86,6 +86,15 @@ class _PostsListWidgetState extends State { return buildErrorCard(tr("Could not get the list of posts !")); } + Widget _buildNoPostNotice() { + return Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(tr("There is no post to display here yet.")), + ), + ); + } + Widget _buildListView() { return ListView.builder( itemCount: _list.length, @@ -117,6 +126,7 @@ class _PostsListWidgetState extends State { Widget build(BuildContext context) { if (_error == ErrorLevel.MAJOR) return _buildErrorCard(); if (_list == null) return buildCenteredProgressBar(); + if (_list.length == 0) return _buildNoPostNotice(); return widget.buildListView ? _buildListView() : _buildColumn(); }