mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
Display a notice when there is no post on a page.
This commit is contained in:
parent
e20011d42e
commit
f1b92c8dcd
@ -86,6 +86,15 @@ class _PostsListWidgetState extends State<PostsListWidget> {
|
||||
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<PostsListWidget> {
|
||||
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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user