|
|
@@ -32,6 +32,9 @@ import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
|
import 'package:zhiying_comm/util/event_util/login_success_event.dart'; |
|
|
|
import 'package:zhiying_comm/util/event_util/event_util.dart'; |
|
|
|
import 'package:zhiying_comm/util/event_util/log_out.dart'; |
|
|
|
import 'package:zhiying_comm/util/event_util/login_success_event.dart'; |
|
|
|
import 'package:zhiying_comm/util/event_util/event_util.dart'; |
|
|
|
import 'package:zhiying_comm/util/event_util/log_out.dart'; |
|
|
|
import 'package:package_info/package_info.dart'; |
|
|
|
|
|
|
|
class HomePage extends StatefulWidget { |
|
|
@@ -118,6 +121,19 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker |
|
|
|
// 监听开始(传递监听到原生端,用户监听场景还原的数据回传回来) |
|
|
|
_eventChannel.receiveBroadcastStream().listen(_onEvent, onError: _onError); |
|
|
|
|
|
|
|
MobPushUtil.addPushReceiver(); |
|
|
|
EventUtil.instance.on<LoginSuccessEvent>().listen((event) { |
|
|
|
UserInfoModel userInfo = UserInfoNotifier?.staitcUserInfo; |
|
|
|
Logger.log("我的TOKEN5: " + userInfo?.userId); |
|
|
|
if (!EmptyUtil.isEmpty(userInfo.userId)) { |
|
|
|
MobPushUtil.setAlias(userInfo.userId); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
EventUtil.instance.on<LogOut>().listen((event) { |
|
|
|
MobPushUtil.deleteAlias(); |
|
|
|
}); |
|
|
|
super.initState(); |
|
|
|
MobPushUtil.addPushReceiver(); |
|
|
|
EventUtil.instance.on<LoginSuccessEvent>().listen((event) async { |
|
|
|
UserInfoModel userInfo = UserInfoNotifier?.staitcUserInfo; |
|
|
@@ -138,6 +154,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
void dispose() { |
|
|
|
WidgetsBinding.instance.removeObserver(this); |
|
|
|