1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-10-23 06:53:23 +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,31 +96,43 @@ 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>[ children: <Widget>[
// Check for errors Column(
Container(child: _error != _ErrorsLevel.NONE ? _buildError() : null), children: <Widget>[
// Check for errors
Container(
child: _error != _ErrorsLevel.NONE ? _buildError() : null),
// List of friends
Expanded(
child: ListView.builder(
itemCount: _friendsList.length,
itemBuilder: (c, i) => _friendsList[i].accepted
? AcceptedFriendTile(
friend: _friendsList[i],
user: _usersInfo.getUser(_friendsList[i].id),
onOpenPrivateConversation: _openPrivateConversation,
onSetFollowing: _setFollowingFriend,
onRequestDelete: _deleteFriend,
)
: PendingFriendTile(
friend: _friendsList[i],
user: _usersInfo.getUser(_friendsList[i].id),
onRespond: _respondRequest,
)),
),
],
),
// Check if loading // Check if loading
Container(child: _loading ? CircularProgressIndicator() : null), Positioned(
child: Container(
// List of friends child:
Expanded( _loading ? Center(child: CircularProgressIndicator()) : null),
child: ListView.builder( top: 16.0,
itemCount: _friendsList.length, left: 0.0,
itemBuilder: (c, i) => _friendsList[i].accepted right: 0.0,
? AcceptedFriendTile(
friend: _friendsList[i],
user: _usersInfo.getUser(_friendsList[i].id),
onOpenPrivateConversation: _openPrivateConversation,
onSetFollowing: _setFollowingFriend,
onRequestDelete: _deleteFriend,
)
: PendingFriendTile(
friend: _friendsList[i],
user: _usersInfo.getUser(_friendsList[i].id),
onRespond: _respondRequest,
)),
), ),
], ],
); );