diff --git a/lib/ui/screens/friends_list_screen.dart b/lib/ui/screens/friends_list_screen.dart index 700ea0c..ed98285 100644 --- a/lib/ui/screens/friends_list_screen.dart +++ b/lib/ui/screens/friends_list_screen.dart @@ -37,8 +37,7 @@ class _FriendsListScreenState extends SafeState { _ErrorsLevel _error = _ErrorsLevel.NONE; FriendsList? _friendsList; late UsersList _usersInfo; - GlobalKey _refreshIndicatorKey = - GlobalKey(); + final _refreshIndicatorKey = GlobalKey(); /// Useful setters set error(_ErrorsLevel err) => setState(() => _error = err); @@ -61,7 +60,10 @@ class _FriendsListScreenState extends SafeState { /// Refresh the list of friends Future _refreshList() async { - await _refreshIndicatorKey.currentState!.show(); + if (_refreshIndicatorKey.currentState != null) + await _refreshIndicatorKey.currentState!.show(); + else + await _getList(); } /// Load the list of friends