1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-24 13:59:22 +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 // Objects members
_PageStatus _status = _PageStatus.LOADING; _PageStatus _status = _PageStatus.LOADING;
late AdvancedUserInfo _userInfo; AdvancedUserInfo? _userInfo;
FriendStatus? _frienshipStatus; FriendStatus? _frienshipStatus;
final _refreshIndicatorKey = GlobalKey<RefreshIndicatorState>(); final _refreshIndicatorKey = GlobalKey<RefreshIndicatorState>();
@ -42,6 +42,7 @@ class _UserPageScreenState extends SafeState<UserPageScreen> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
if(_userInfo?.id != widget.userID)
_getUserInfo(); _getUserInfo();
} }
@ -112,12 +113,12 @@ class _UserPageScreenState extends SafeState<UserPageScreen> {
Widget _buildBody() { Widget _buildBody() {
return isTablet(context) return isTablet(context)
? UserPageTablet( ? UserPageTablet(
userInfo: _userInfo, userInfo: _userInfo!,
onNeedRefresh: () => _refreshIndicatorKey.currentState!.show(), onNeedRefresh: () => _refreshIndicatorKey.currentState!.show(),
friendshipStatus: _frienshipStatus, friendshipStatus: _frienshipStatus,
) )
: UserMobilePage( : UserMobilePage(
userInfo: _userInfo, userInfo: _userInfo!,
onNeedRefresh: () => _refreshIndicatorKey.currentState!.show(), onNeedRefresh: () => _refreshIndicatorKey.currentState!.show(),
); );
} }