1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-25 04:18:51 +00:00

Fix a bug on friends list screen

This commit is contained in:
Pierre HUBERT 2022-03-12 09:42:07 +01:00
parent 98354ee3cc
commit 2ac5caaf96

View File

@ -37,8 +37,7 @@ class _FriendsListScreenState extends SafeState<FriendsListScreen> {
_ErrorsLevel _error = _ErrorsLevel.NONE;
FriendsList? _friendsList;
late UsersList _usersInfo;
GlobalKey<RefreshIndicatorState> _refreshIndicatorKey =
GlobalKey<RefreshIndicatorState>();
final _refreshIndicatorKey = GlobalKey<RefreshIndicatorState>();
/// Useful setters
set error(_ErrorsLevel err) => setState(() => _error = err);
@ -61,7 +60,10 @@ class _FriendsListScreenState extends SafeState<FriendsListScreen> {
/// Refresh the list of friends
Future<void> _refreshList() async {
await _refreshIndicatorKey.currentState!.show();
if (_refreshIndicatorKey.currentState != null)
await _refreshIndicatorKey.currentState!.show();
else
await _getList();
}
/// Load the list of friends