mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-03 19:54:12 +00:00 
			
		
		
		
	Display a notice when there is no post on a page.
This commit is contained in:
		@@ -86,6 +86,15 @@ class _PostsListWidgetState extends State<PostsListWidget> {
 | 
				
			|||||||
    return buildErrorCard(tr("Could not get the list of posts !"));
 | 
					    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() {
 | 
					  Widget _buildListView() {
 | 
				
			||||||
    return ListView.builder(
 | 
					    return ListView.builder(
 | 
				
			||||||
      itemCount: _list.length,
 | 
					      itemCount: _list.length,
 | 
				
			||||||
@@ -117,6 +126,7 @@ class _PostsListWidgetState extends State<PostsListWidget> {
 | 
				
			|||||||
  Widget build(BuildContext context) {
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
    if (_error == ErrorLevel.MAJOR) return _buildErrorCard();
 | 
					    if (_error == ErrorLevel.MAJOR) return _buildErrorCard();
 | 
				
			||||||
    if (_list == null) return buildCenteredProgressBar();
 | 
					    if (_list == null) return buildCenteredProgressBar();
 | 
				
			||||||
 | 
					    if (_list.length == 0) return _buildNoPostNotice();
 | 
				
			||||||
    return widget.buildListView ? _buildListView() : _buildColumn();
 | 
					    return widget.buildListView ? _buildListView() : _buildColumn();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user