|
|
@@ -1,6 +1,7 @@
|
|
|
import 'dart:io';
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter_bugly/flutter_bugly.dart';
|
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
|
@@ -10,6 +11,7 @@ import 'package:location/resource/colors.gen.dart';
|
|
|
import 'package:location/resource/string.gen.dart';
|
|
|
import 'package:location/resource/string_source.dart';
|
|
|
import 'package:location/router/app_pages.dart';
|
|
|
+import 'package:location/sdk/bugly/bugly_helper.dart';
|
|
|
import 'package:location/sdk/gravity/gravity_helper.dart';
|
|
|
import 'package:location/sdk/map/map_helper.dart';
|
|
|
import 'package:location/sdk/qiyu/qi_yu_helper.dart';
|
|
|
@@ -26,22 +28,24 @@ import 'data/consts/build_config.dart';
|
|
|
import 'data/consts/constants.dart';
|
|
|
import 'device/device_info_util.dart';
|
|
|
|
|
|
-void main() async {
|
|
|
- WidgetsFlutterBinding.ensureInitialized();
|
|
|
+void main() {
|
|
|
+ FlutterBugly.postCatchedException(() async {
|
|
|
+ WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
|
- //必要初始化
|
|
|
- await initRequired();
|
|
|
+ //必要初始化
|
|
|
+ await initRequired();
|
|
|
|
|
|
- //非隐私相关
|
|
|
- initCommon();
|
|
|
+ //非隐私相关
|
|
|
+ initCommon();
|
|
|
|
|
|
- runApp(const MyApp());
|
|
|
+ runApp(const MyApp());
|
|
|
|
|
|
- //隐私相关:系统参数&第三方sdk初始化
|
|
|
- await PrivacyCompliance.ensurePolicyGranted(AppInitTask());
|
|
|
+ //隐私相关:系统参数&第三方sdk初始化
|
|
|
+ await PrivacyCompliance.ensurePolicyGranted(AppInitTask());
|
|
|
|
|
|
- //檢查地址
|
|
|
- checkEnv();
|
|
|
+ //檢查地址
|
|
|
+ checkEnv();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
Future<void> initRequired() async {
|
|
|
@@ -68,8 +72,10 @@ class AppInitTask implements EnsurePolicyGrant {
|
|
|
//初始化基础信息
|
|
|
await appInfoUtil.init();
|
|
|
await deviceInfoUtil.init();
|
|
|
- //初始化其他sdk
|
|
|
- await MapHelper.init();
|
|
|
+ //bugly
|
|
|
+ BuglyHelper.init();
|
|
|
+ //地图sdk
|
|
|
+ MapHelper.init();
|
|
|
//引力引擎
|
|
|
GravityHelper.init();
|
|
|
//七鱼客服
|