From 5040fbb101673e09ac2a3a4292f7ee402d383501 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 12 Mar 2022 10:14:32 +0100 Subject: [PATCH] Fix refresh issue --- lib/ui/screens/user_page_screen.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ui/screens/user_page_screen.dart b/lib/ui/screens/user_page_screen.dart index fa1a7b9..a764a17 100644 --- a/lib/ui/screens/user_page_screen.dart +++ b/lib/ui/screens/user_page_screen.dart @@ -33,7 +33,7 @@ class _UserPageScreenState extends SafeState { // Objects members _PageStatus _status = _PageStatus.LOADING; - late AdvancedUserInfo _userInfo; + AdvancedUserInfo? _userInfo; FriendStatus? _frienshipStatus; final _refreshIndicatorKey = GlobalKey(); @@ -42,6 +42,7 @@ class _UserPageScreenState extends SafeState { @override void didChangeDependencies() { super.didChangeDependencies(); + if(_userInfo?.id != widget.userID) _getUserInfo(); } @@ -112,12 +113,12 @@ class _UserPageScreenState extends SafeState { Widget _buildBody() { return isTablet(context) ? UserPageTablet( - userInfo: _userInfo, + userInfo: _userInfo!, onNeedRefresh: () => _refreshIndicatorKey.currentState!.show(), friendshipStatus: _frienshipStatus, ) : UserMobilePage( - userInfo: _userInfo, + userInfo: _userInfo!, onNeedRefresh: () => _refreshIndicatorKey.currentState!.show(), ); }