|
|
@@ -12,6 +12,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:fluwx/fluwx.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
import 'package:iquokka/pages/guide_page.dart';
|
|
|
+import 'package:iquokka/utils/tips_dialog.dart';
|
|
|
import 'package:logger/logger.dart';
|
|
|
// import 'package:macos_ui/macos_ui.dart';
|
|
|
import 'package:home_widget/home_widget.dart';
|
|
|
@@ -31,6 +32,7 @@ import 'package:iquokka/utils/hex_color.dart';
|
|
|
import 'package:iquokka/utils/toast_utils.dart';
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
|
import 'package:share_plus/share_plus.dart';
|
|
|
+import 'package:shared_preferences/shared_preferences.dart';
|
|
|
import 'package:sp_util/sp_util.dart';
|
|
|
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
|
import 'package:universal_platform/universal_platform.dart';
|
|
|
@@ -40,98 +42,105 @@ import 'common/AC.dart';
|
|
|
import 'common/LanguagePack.dart';
|
|
|
import 'constant/wx_constant.dart';
|
|
|
import 'module/app_service.dart';
|
|
|
+import 'module/shared_prefs_util.dart';
|
|
|
import 'module/user_service.dart';
|
|
|
import 'pages/today/main/page/sentence_list_page.dart';
|
|
|
|
|
|
-@pragma("vm:entry-point")
|
|
|
-Future<void> backgroundCallback(Uri? data) async {
|
|
|
- if (data?.host == "recordMood") {
|
|
|
- if (await UserService().isLoginToLoginPage()) {
|
|
|
- Get.to(() => MoodChoosePage(),
|
|
|
- binding: MoodRecordBinding(), arguments: {"recordType": 1});
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-@pragma('vm:entry-point')
|
|
|
-void workManagerCallback() {
|
|
|
- Workmanager().executeTask((task, inputData) async {
|
|
|
- if (task == 'dayUpdate') {
|
|
|
- await SpUtil.getInstance();
|
|
|
- await HomeWidgetService().scheduleUpdateSentenceWidget();
|
|
|
- await HomeWidgetService().scheduleUpdateRecordMoodWeekWidget();
|
|
|
- await HomeWidgetService().scheduleUpdateRecordMoodMonthWidget();
|
|
|
- }
|
|
|
- return Future.value(true);
|
|
|
- });
|
|
|
-}
|
|
|
+// @pragma("vm:entry-point")
|
|
|
+// Future<void> backgroundCallback(Uri? data) async {
|
|
|
+// if (data?.host == "recordMood") {
|
|
|
+// if (await UserService().isLoginToLoginPage()) {
|
|
|
+// Get.to(() => MoodChoosePage(),
|
|
|
+// binding: MoodRecordBinding(), arguments: {"recordType": 1});
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// @pragma('vm:entry-point')
|
|
|
+// void workManagerCallback() {
|
|
|
+// Workmanager().executeTask((task, inputData) async {
|
|
|
+// if (task == 'dayUpdate') {
|
|
|
+// await SpUtil.getInstance();
|
|
|
+// await HomeWidgetService().scheduleUpdateSentenceWidget();
|
|
|
+// await HomeWidgetService().scheduleUpdateRecordMoodWeekWidget();
|
|
|
+// await HomeWidgetService().scheduleUpdateRecordMoodMonthWidget();
|
|
|
+// }
|
|
|
+// return Future.value(true);
|
|
|
+// });
|
|
|
+// }
|
|
|
|
|
|
void main() async {
|
|
|
- // 禁用自动剪贴板读取
|
|
|
- // SystemChannels.textInput.invokeMethod('TextInput.setDataTransferEnabled', false);
|
|
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
- await SpUtil.getInstance();
|
|
|
-
|
|
|
- SystemChannels.lifecycle.setMessageHandler((msg) async {
|
|
|
- Logger().d('SystemChannels> $msg');
|
|
|
- /// msg是个字符串,是下面的值
|
|
|
- /// AppLifecycleState.resumed
|
|
|
- /// AppLifecycleState.inactive
|
|
|
- /// AppLifecycleState.paused
|
|
|
- /// AppLifecycleState.detached
|
|
|
- if (msg == "AppLifecycleState.resumed") { //进入前台
|
|
|
- Logger().d("===================== app进入前台 =====================");
|
|
|
- AppEvent.getInstance()?.fire(AppEnterForegroundEvent());
|
|
|
- if (AppService().getThemeMode() == 0) { //跟随系统
|
|
|
- if (HexColor.isDarkMode != (PlatformDispatcher.instance.platformBrightness==Brightness.dark)) { //系统模式改变
|
|
|
- HexColor.reload();
|
|
|
- AC.reload();
|
|
|
- Get.forceAppUpdate();
|
|
|
- // ToastUtil.settingEasyLoading();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else if (msg == "AppLifecycleState.inactive") { //进入非活跃状态
|
|
|
- Logger().d("===================== app进入非活跃状态 =====================");
|
|
|
- }
|
|
|
- else if (msg == "AppLifecycleState.paused") { //进入后台
|
|
|
- Logger().d("===================== app进入后台 =====================");
|
|
|
- AppEvent.getInstance()?.fire(AppPasswordLockEvent());
|
|
|
- }
|
|
|
- else if (msg == "AppLifecycleState.detached") { //app被杀死
|
|
|
- Logger().d("===================== app被杀死 =====================");
|
|
|
- }
|
|
|
- return msg;
|
|
|
- });
|
|
|
-
|
|
|
- Duration delay;
|
|
|
- DateTime now = DateTime.now();
|
|
|
- DateTime targetTime = DateTime(now.year, now.month, now.day, 1, 0, 0);
|
|
|
-
|
|
|
- if (now.isBefore(targetTime)) {
|
|
|
- delay = targetTime.difference(now);
|
|
|
- } else {
|
|
|
- targetTime = targetTime.add(Duration(days: 1));
|
|
|
- delay = targetTime.difference(now);
|
|
|
- }
|
|
|
-
|
|
|
- Workmanager().initialize(
|
|
|
- workManagerCallback, // The top level function, aka callbackDispatcher
|
|
|
- isInDebugMode: false // If enabled it will post a notification whenever the task is running. Handy for debugging tasks
|
|
|
- );
|
|
|
- Workmanager().registerPeriodicTask(
|
|
|
- "dayUpdate",
|
|
|
- "dayUpdate",
|
|
|
- initialDelay: delay,
|
|
|
- constraints: Constraints(
|
|
|
- networkType: NetworkType.connected,
|
|
|
- ),
|
|
|
- backoffPolicy: BackoffPolicy.linear,
|
|
|
- existingWorkPolicy: ExistingWorkPolicy.replace,
|
|
|
- frequency: Duration(days: 1),
|
|
|
- backoffPolicyDelay: Duration(hours: 4)
|
|
|
- );
|
|
|
+ // await SpUtil.getInstance();
|
|
|
+ await SharedPrefsUtil.getInstance();
|
|
|
+
|
|
|
+ // Future.delayed(Duration(seconds: 1), () async {
|
|
|
+ // // await SpUtil.getInstance();
|
|
|
+ // await SharedPrefsUtil.getInstance();
|
|
|
+ // });
|
|
|
+
|
|
|
+ // await SharedPrefsUtil.getInstance();
|
|
|
+
|
|
|
+ // SystemChannels.lifecycle.setMessageHandler((msg) async {
|
|
|
+ // Logger().d('SystemChannels> $msg');
|
|
|
+ // /// msg是个字符串,是下面的值
|
|
|
+ // /// AppLifecycleState.resumed
|
|
|
+ // /// AppLifecycleState.inactive
|
|
|
+ // /// AppLifecycleState.paused
|
|
|
+ // /// AppLifecycleState.detached
|
|
|
+ // if (msg == "AppLifecycleState.resumed") { //进入前台
|
|
|
+ // Logger().d("===================== app进入前台 =====================");
|
|
|
+ // AppEvent.getInstance()?.fire(AppEnterForegroundEvent());
|
|
|
+ // if (AppService().getThemeMode() == 0) { //跟随系统
|
|
|
+ // if (HexColor.isDarkMode != (PlatformDispatcher.instance.platformBrightness==Brightness.dark)) { //系统模式改变
|
|
|
+ // HexColor.reload();
|
|
|
+ // AC.reload();
|
|
|
+ // Get.forceAppUpdate();
|
|
|
+ // // ToastUtil.settingEasyLoading();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else if (msg == "AppLifecycleState.inactive") { //进入非活跃状态
|
|
|
+ // Logger().d("===================== app进入非活跃状态 =====================");
|
|
|
+ // }
|
|
|
+ // else if (msg == "AppLifecycleState.paused") { //进入后台
|
|
|
+ // Logger().d("===================== app进入后台 =====================");
|
|
|
+ // AppEvent.getInstance()?.fire(AppPasswordLockEvent());
|
|
|
+ // }
|
|
|
+ // else if (msg == "AppLifecycleState.detached") { //app被杀死
|
|
|
+ // Logger().d("===================== app被杀死 =====================");
|
|
|
+ // }
|
|
|
+ // return msg;
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // Duration delay;
|
|
|
+ // DateTime now = DateTime.now();
|
|
|
+ // DateTime targetTime = DateTime(now.year, now.month, now.day, 1, 0, 0);
|
|
|
+ //
|
|
|
+ // if (now.isBefore(targetTime)) {
|
|
|
+ // delay = targetTime.difference(now);
|
|
|
+ // } else {
|
|
|
+ // targetTime = targetTime.add(Duration(days: 1));
|
|
|
+ // delay = targetTime.difference(now);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // Workmanager().initialize(
|
|
|
+ // workManagerCallback, // The top level function, aka callbackDispatcher
|
|
|
+ // isInDebugMode: false // If enabled it will post a notification whenever the task is running. Handy for debugging tasks
|
|
|
+ // );
|
|
|
+ // Workmanager().registerPeriodicTask(
|
|
|
+ // "dayUpdate",
|
|
|
+ // "dayUpdate",
|
|
|
+ // initialDelay: delay,
|
|
|
+ // constraints: Constraints(
|
|
|
+ // networkType: NetworkType.connected,
|
|
|
+ // ),
|
|
|
+ // backoffPolicy: BackoffPolicy.linear,
|
|
|
+ // existingWorkPolicy: ExistingWorkPolicy.replace,
|
|
|
+ // frequency: Duration(days: 1),
|
|
|
+ // backoffPolicyDelay: Duration(hours: 4)
|
|
|
+ // );
|
|
|
|
|
|
runApp(const MyApp());
|
|
|
}
|
|
|
@@ -147,100 +156,110 @@ class MyApp extends StatefulWidget {
|
|
|
|
|
|
class _MyAppState extends State<MyApp> {
|
|
|
|
|
|
- StreamSubscription<Uri>? _linkSubscription;
|
|
|
-
|
|
|
- Future<void> _launchedFromWidget(Uri? uri) async {
|
|
|
- if (uri?.host == "record") {
|
|
|
- if (await UserService().isLoginToLoginPage()) {
|
|
|
- Get.to(() => MoodChoosePage(),
|
|
|
- binding: MoodRecordBinding(), arguments: {"recordType": 1});
|
|
|
- }
|
|
|
- } else if (uri?.host == "footprint") {
|
|
|
- AppEvent.getInstance()?.fire(BottomNaviBarToIndexEvent(2));
|
|
|
- } else if (uri?.host == "goodthing") {
|
|
|
- Get.to(()=>ExamPage(), binding: ExamBinding(), arguments: {
|
|
|
- "id": 32,
|
|
|
- "type": 1,
|
|
|
- "title": "每天三件开心事".tr,
|
|
|
- "doneNumber": 0,
|
|
|
- "doneType": 0,
|
|
|
- "isVip": false,
|
|
|
- "isPay": false
|
|
|
- });
|
|
|
- } else if (uri?.host == "sentence") {
|
|
|
- Get.to(() => SentenceListPage(type: 1,));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @override
|
|
|
- void didChangeDependencies() {
|
|
|
- super.didChangeDependencies();
|
|
|
- HomeWidget.initiallyLaunchedFromHomeWidget().then(_launchedFromWidget);
|
|
|
- HomeWidget.widgetClicked.listen(_launchedFromWidget);
|
|
|
- }
|
|
|
+ // StreamSubscription<Uri>? _linkSubscription;
|
|
|
+ //
|
|
|
+ // Future<void> _launchedFromWidget(Uri? uri) async {
|
|
|
+ // if (uri?.host == "record") {
|
|
|
+ // if (await UserService().isLoginToLoginPage()) {
|
|
|
+ // Get.to(() => MoodChoosePage(),
|
|
|
+ // binding: MoodRecordBinding(), arguments: {"recordType": 1});
|
|
|
+ // }
|
|
|
+ // } else if (uri?.host == "footprint") {
|
|
|
+ // AppEvent.getInstance()?.fire(BottomNaviBarToIndexEvent(2));
|
|
|
+ // } else if (uri?.host == "goodthing") {
|
|
|
+ // Get.to(()=>ExamPage(), binding: ExamBinding(), arguments: {
|
|
|
+ // "id": 32,
|
|
|
+ // "type": 1,
|
|
|
+ // "title": "每天三件开心事".tr,
|
|
|
+ // "doneNumber": 0,
|
|
|
+ // "doneType": 0,
|
|
|
+ // "isVip": false,
|
|
|
+ // "isPay": false
|
|
|
+ // });
|
|
|
+ // } else if (uri?.host == "sentence") {
|
|
|
+ // Get.to(() => SentenceListPage(type: 1,));
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // @override
|
|
|
+ // void didChangeDependencies() {
|
|
|
+ // super.didChangeDependencies();
|
|
|
+ // HomeWidget.initiallyLaunchedFromHomeWidget().then(_launchedFromWidget);
|
|
|
+ // HomeWidget.widgetClicked.listen(_launchedFromWidget);
|
|
|
+ // }
|
|
|
|
|
|
@override
|
|
|
void initState() {
|
|
|
super.initState();
|
|
|
|
|
|
- _registerWechatApi();
|
|
|
- HomeWidget.registerInteractivityCallback(backgroundCallback);
|
|
|
-
|
|
|
- initDeepLinks();
|
|
|
+ // _registerWechatApi();
|
|
|
+ // HomeWidget.registerInteractivityCallback(backgroundCallback);
|
|
|
+ //
|
|
|
+ // initDeepLinks();
|
|
|
|
|
|
//更新语言
|
|
|
- WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
- Get.updateLocale(Localizations.localeOf(Get.context!));
|
|
|
- });
|
|
|
+ // WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
+ // // Get.updateLocale(Localizations.localeOf(Get.context!));
|
|
|
+ // try {
|
|
|
+ // SharedPreferences? prefs = await SharedPrefsUtil.getInstance();
|
|
|
+ // if (prefs != null) {
|
|
|
+ // TipsDialog.showDialog(title: "SharedPreferences初始化成功");
|
|
|
+ // } else {
|
|
|
+ // TipsDialog.showDialog(title: "SharedPreferences初始化失败");
|
|
|
+ // }
|
|
|
+ // } catch (e) {
|
|
|
+ // TipsDialog.showDialog(title: e.toString());
|
|
|
+ // }
|
|
|
+ // });
|
|
|
}
|
|
|
|
|
|
- Future<void> initDeepLinks() async {
|
|
|
- AppLinks().stringLinkStream.listen((scheme) {
|
|
|
- print("schemescheme = "+scheme);
|
|
|
- if (scheme == "iquokka-MoodRecordPage") {
|
|
|
- Get.to(()=>MoodChoosePage(), binding: MoodRecordBinding(), arguments: {"recordType": 1});
|
|
|
- }
|
|
|
- else if (scheme == "iquokka-FootprintPage") {
|
|
|
- AppEvent.getInstance()?.fire(BottomNaviBarToIndexEvent(2));
|
|
|
- }
|
|
|
- else if (scheme == "iquokka-RecordGoodThingPage") {
|
|
|
- Get.to(()=>ExamPage(), binding: ExamBinding(), arguments: {
|
|
|
- "id": 32,
|
|
|
- "type": 1,
|
|
|
- "title": "每天三件开心事".tr,
|
|
|
- "doneNumber": 0,
|
|
|
- "doneType": 0,
|
|
|
- "isVip": false,
|
|
|
- "isPay": false
|
|
|
- });
|
|
|
- }
|
|
|
- else if (scheme == "https://h5.iquokka.cn/.well-known/apple-app-site-association/explore") {
|
|
|
- AppEvent.getInstance()?.fire(BottomNaviBarToIndexEvent(1));
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ // Future<void> initDeepLinks() async {
|
|
|
+ // AppLinks().stringLinkStream.listen((scheme) {
|
|
|
+ // print("schemescheme = "+scheme);
|
|
|
+ // if (scheme == "iquokka-MoodRecordPage") {
|
|
|
+ // Get.to(()=>MoodChoosePage(), binding: MoodRecordBinding(), arguments: {"recordType": 1});
|
|
|
+ // }
|
|
|
+ // else if (scheme == "iquokka-FootprintPage") {
|
|
|
+ // AppEvent.getInstance()?.fire(BottomNaviBarToIndexEvent(2));
|
|
|
+ // }
|
|
|
+ // else if (scheme == "iquokka-RecordGoodThingPage") {
|
|
|
+ // Get.to(()=>ExamPage(), binding: ExamBinding(), arguments: {
|
|
|
+ // "id": 32,
|
|
|
+ // "type": 1,
|
|
|
+ // "title": "每天三件开心事".tr,
|
|
|
+ // "doneNumber": 0,
|
|
|
+ // "doneType": 0,
|
|
|
+ // "isVip": false,
|
|
|
+ // "isPay": false
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // else if (scheme == "https://h5.iquokka.cn/.well-known/apple-app-site-association/explore") {
|
|
|
+ // AppEvent.getInstance()?.fire(BottomNaviBarToIndexEvent(1));
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
- ///禁用横屏
|
|
|
- SystemChrome.setPreferredOrientations([
|
|
|
- DeviceOrientation.portraitUp, //只能纵向
|
|
|
- DeviceOrientation.portraitDown, //只能纵向
|
|
|
- ]);
|
|
|
-
|
|
|
- if (Platform.isAndroid) {
|
|
|
- /// 以下两行 设置android状态栏为透明的沉浸。写在组件渲染之后,是为了在渲染后进行set赋值,覆盖状态栏,写在渲染之前MaterialApp组件会覆盖掉这个值。
|
|
|
- /// SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(statusBarColor: Colors.transparent);
|
|
|
- /// SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
|
|
|
- SystemChrome.setSystemUIOverlayStyle(
|
|
|
- const SystemUiOverlayStyle(
|
|
|
- statusBarColor: Colors.transparent,
|
|
|
- systemNavigationBarColor: Colors.white,
|
|
|
- systemNavigationBarDividerColor: Colors.white,
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
+ // ///禁用横屏
|
|
|
+ // SystemChrome.setPreferredOrientations([
|
|
|
+ // DeviceOrientation.portraitUp, //只能纵向
|
|
|
+ // DeviceOrientation.portraitDown, //只能纵向
|
|
|
+ // ]);
|
|
|
+ //
|
|
|
+ // if (Platform.isAndroid) {
|
|
|
+ // /// 以下两行 设置android状态栏为透明的沉浸。写在组件渲染之后,是为了在渲染后进行set赋值,覆盖状态栏,写在渲染之前MaterialApp组件会覆盖掉这个值。
|
|
|
+ // /// SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(statusBarColor: Colors.transparent);
|
|
|
+ // /// SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
|
|
|
+ // SystemChrome.setSystemUIOverlayStyle(
|
|
|
+ // const SystemUiOverlayStyle(
|
|
|
+ // statusBarColor: Colors.transparent,
|
|
|
+ // systemNavigationBarColor: Colors.white,
|
|
|
+ // systemNavigationBarDividerColor: Colors.white,
|
|
|
+ // )
|
|
|
+ // );
|
|
|
+ // }
|
|
|
|
|
|
return ScreenUtilInit(
|
|
|
splitScreenMode: true,
|
|
|
@@ -353,24 +372,6 @@ class _MyAppState extends State<MyApp> {
|
|
|
|
|
|
Widget _getRootWidget() {
|
|
|
|
|
|
- // bool isShowGuide = AppService().isShowGuide();
|
|
|
- // if (UniversalPlatform.isIOS || UniversalPlatform.isAndroid) {
|
|
|
- // if (!isShowGuide) { //展示引导页
|
|
|
- // return GuidePage();
|
|
|
- // }
|
|
|
- // else {
|
|
|
- // if (!UserService().isLogin()) { //展示登录页
|
|
|
- // return LoginPage();
|
|
|
- // }
|
|
|
- // else {
|
|
|
- // return MainPage();
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // else {
|
|
|
- // return MainPage();
|
|
|
- // }
|
|
|
-
|
|
|
if (!UserService().isLogin()) { //展示登录页
|
|
|
return LoginPage();
|
|
|
}
|
|
|
@@ -379,43 +380,43 @@ class _MyAppState extends State<MyApp> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void _registerWechatApi() {
|
|
|
- // registerWxApi(
|
|
|
- // appId: WxConstant.appId, universalLink: WxConstant.universalLink);
|
|
|
-
|
|
|
- if (AppService().getLoginDialog()) {
|
|
|
- Fluwx fluwx = Fluwx();
|
|
|
- fluwx.registerApi(
|
|
|
- appId: WxConstant.appId,
|
|
|
- universalLink: WxConstant.universalLink,
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
+ // void _registerWechatApi() {
|
|
|
+ // // registerWxApi(
|
|
|
+ // // appId: WxConstant.appId, universalLink: WxConstant.universalLink);
|
|
|
+ //
|
|
|
+ // if (AppService().getLoginDialog()) {
|
|
|
+ // Fluwx fluwx = Fluwx();
|
|
|
+ // fluwx.registerApi(
|
|
|
+ // appId: WxConstant.appId,
|
|
|
+ // universalLink: WxConstant.universalLink,
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
-class GetObserver extends NavigatorObserver {
|
|
|
- @override
|
|
|
- void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) {
|
|
|
- super.didPush(route, previousRoute);
|
|
|
- String routerName = route.settings.name??"";
|
|
|
- if (routerName.contains("?")) {
|
|
|
- int index = routerName.indexOf("?");
|
|
|
- routerName = routerName.substring(0, index);
|
|
|
- }
|
|
|
- UmengCommonSdk.onPageStart(routerName);
|
|
|
- }
|
|
|
-
|
|
|
- @override
|
|
|
- void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) {
|
|
|
- super.didPop(route, previousRoute);
|
|
|
- String routerName = route.settings.name??"";
|
|
|
- if (routerName.contains("?")) {
|
|
|
- int index = routerName.indexOf("?");
|
|
|
- routerName = routerName.substring(0, index);
|
|
|
- }
|
|
|
- UmengCommonSdk.onPageEnd(routerName);
|
|
|
- }
|
|
|
-}
|
|
|
+// class GetObserver extends NavigatorObserver {
|
|
|
+// @override
|
|
|
+// void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) {
|
|
|
+// super.didPush(route, previousRoute);
|
|
|
+// String routerName = route.settings.name??"";
|
|
|
+// if (routerName.contains("?")) {
|
|
|
+// int index = routerName.indexOf("?");
|
|
|
+// routerName = routerName.substring(0, index);
|
|
|
+// }
|
|
|
+// UmengCommonSdk.onPageStart(routerName);
|
|
|
+// }
|
|
|
+//
|
|
|
+// @override
|
|
|
+// void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) {
|
|
|
+// super.didPop(route, previousRoute);
|
|
|
+// String routerName = route.settings.name??"";
|
|
|
+// if (routerName.contains("?")) {
|
|
|
+// int index = routerName.indexOf("?");
|
|
|
+// routerName = routerName.substring(0, index);
|
|
|
+// }
|
|
|
+// UmengCommonSdk.onPageEnd(routerName);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|