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(), ); }