|
|
|
@ -32,7 +32,7 @@ class MinePage extends StatefulWidget {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin ,WidgetsBindingObserver{ |
|
|
|
|
class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin { |
|
|
|
|
ApiService apiService; |
|
|
|
|
UserInfo userInfo; |
|
|
|
|
List<Rank> ranks = []; |
|
|
|
@ -55,29 +55,13 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin ,Widg
|
|
|
|
|
super.dispose(); |
|
|
|
|
if (_refreshController != null) |
|
|
|
|
_refreshController.dispose(); |
|
|
|
|
WidgetsBinding.instance.removeObserver(this); //销毁观察者 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void didChangeAppLifecycleState(AppLifecycleState state) { |
|
|
|
|
print("-didChangeAppLifecycleState-" + state.toString()); |
|
|
|
|
switch (state) { |
|
|
|
|
case AppLifecycleState.inactive: // 处于这种状态的应用程序应该假设它们可能在任何时候暂停。 |
|
|
|
|
break; |
|
|
|
|
case AppLifecycleState.resumed: //从后台切换前台,界面可见 |
|
|
|
|
querySocialInfo(); |
|
|
|
|
break; |
|
|
|
|
case AppLifecycleState.paused: // 界面不可见,后台 |
|
|
|
|
break; |
|
|
|
|
case AppLifecycleState.detached: // APP结束时调用 |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
WidgetsBinding.instance.addObserver(this); |
|
|
|
|
querySocialInfo(); |
|
|
|
|
|
|
|
|
|
eventBus.on<EventType>().listen((event) { |
|
|
|
|