mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-24 22:09:21 +00:00
Show a message if user has no friend yet
This commit is contained in:
parent
2ac5caaf96
commit
a0abdc4f1b
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:comunic/helpers/friends_helper.dart';
|
import 'package:comunic/helpers/friends_helper.dart';
|
||||||
import 'package:comunic/helpers/users_helper.dart';
|
import 'package:comunic/helpers/users_helper.dart';
|
||||||
import 'package:comunic/lists/friends_list.dart';
|
import 'package:comunic/lists/friends_list.dart';
|
||||||
@ -133,20 +135,29 @@ class _FriendsListScreenState extends SafeState<FriendsListScreen> {
|
|||||||
onRefresh: () => _loadList(true),
|
onRefresh: () => _loadList(true),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
physics: AlwaysScrollableScrollPhysics(),
|
physics: AlwaysScrollableScrollPhysics(),
|
||||||
itemCount: _friendsList!.length,
|
itemCount: max(_friendsList!.length, 1),
|
||||||
itemBuilder: (c, i) => _friendsList![i].accepted
|
itemBuilder: (c, i) {
|
||||||
? AcceptedFriendTile(
|
if (_friendsList!.isEmpty)
|
||||||
friend: _friendsList![i],
|
return Padding(
|
||||||
user: _usersInfo.getUser(_friendsList![i].id),
|
padding: const EdgeInsets.all(8.0),
|
||||||
onOpenPrivateConversation: _openPrivateConversation,
|
child: Center(
|
||||||
onSetFollowing: _setFollowingFriend,
|
child: Text(tr("You do not have any friend yet!")!)),
|
||||||
onRequestDelete: _deleteFriend,
|
);
|
||||||
)
|
|
||||||
: PendingFriendTile(
|
return _friendsList![i].accepted
|
||||||
friend: _friendsList![i],
|
? AcceptedFriendTile(
|
||||||
user: _usersInfo.getUser(_friendsList![i].id),
|
friend: _friendsList![i],
|
||||||
onRespond: _respondRequest,
|
user: _usersInfo.getUser(_friendsList![i].id),
|
||||||
)),
|
onOpenPrivateConversation: _openPrivateConversation,
|
||||||
|
onSetFollowing: _setFollowingFriend,
|
||||||
|
onRequestDelete: _deleteFriend,
|
||||||
|
)
|
||||||
|
: PendingFriendTile(
|
||||||
|
friend: _friendsList![i],
|
||||||
|
user: _usersInfo.getUser(_friendsList![i].id),
|
||||||
|
onRespond: _respondRequest,
|
||||||
|
);
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user