1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 21:09:21 +00:00

Improved loading bar

This commit is contained in:
Pierre HUBERT 2019-05-02 08:14:54 +02:00
parent 21a60f423b
commit a80ccb0a9f

View File

@ -96,13 +96,13 @@ class _FriendsListScreenState extends SafeState<FriendsListScreen> {
if (_error == _ErrorsLevel.MAJOR) return _buildError(); if (_error == _ErrorsLevel.MAJOR) return _buildError();
if (_friendsList == null) return buildCenteredProgressBar(); if (_friendsList == null) return buildCenteredProgressBar();
return Column( return Stack(
children: <Widget>[
Column(
children: <Widget>[ children: <Widget>[
// Check for errors // Check for errors
Container(child: _error != _ErrorsLevel.NONE ? _buildError() : null), Container(
child: _error != _ErrorsLevel.NONE ? _buildError() : null),
// Check if loading
Container(child: _loading ? CircularProgressIndicator() : null),
// List of friends // List of friends
Expanded( Expanded(
@ -123,6 +123,18 @@ class _FriendsListScreenState extends SafeState<FriendsListScreen> {
)), )),
), ),
], ],
),
// Check if loading
Positioned(
child: Container(
child:
_loading ? Center(child: CircularProgressIndicator()) : null),
top: 16.0,
left: 0.0,
right: 0.0,
),
],
); );
} }