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

Fix refresh issue

This commit is contained in:
Pierre HUBERT 2022-03-12 10:14:32 +01:00
parent 11829273e2
commit 5040fbb101

View File

@ -33,7 +33,7 @@ class _UserPageScreenState extends SafeState<UserPageScreen> {
// Objects members
_PageStatus _status = _PageStatus.LOADING;
late AdvancedUserInfo _userInfo;
AdvancedUserInfo? _userInfo;
FriendStatus? _frienshipStatus;
final _refreshIndicatorKey = GlobalKey<RefreshIndicatorState>();
@ -42,6 +42,7 @@ class _UserPageScreenState extends SafeState<UserPageScreen> {
@override
void didChangeDependencies() {
super.didChangeDependencies();
if(_userInfo?.id != widget.userID)
_getUserInfo();
}
@ -112,12 +113,12 @@ class _UserPageScreenState extends SafeState<UserPageScreen> {
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(),
);
}