|
@@ -1,16 +1,9 @@
|
|
|
import 'package:cpt_auth/router/auth_service_impl.dart';
|
|
|
import 'package:cpt_auth/router/page_router.dart';
|
|
|
-import 'package:cpt_job/router/job_service_impl.dart';
|
|
|
-import 'package:cpt_job/router/page_router.dart';
|
|
|
-import 'package:cpt_job_sg/router/job_sg_service_impl.dart';
|
|
|
-import 'package:cpt_job_sg/router/page_router.dart';
|
|
|
-import 'package:cpt_labour/router/labour_service_impl.dart';
|
|
|
-import 'package:cpt_labour/router/page_router.dart';
|
|
|
-import 'package:cpt_labour_sg/router/labour_sg_service_impl.dart';
|
|
|
-import 'package:cpt_labour_sg/router/page_router.dart';
|
|
|
-import 'package:cpt_report/router/page_router.dart';
|
|
|
-import 'package:cpt_report/router/report_service_impl.dart';
|
|
|
+import 'package:cpt_sg/router/sg_router.dart';
|
|
|
+import 'package:cpt_sg/router/sg_service_impl.dart';
|
|
|
import 'package:cpt_uk/router/uk_router.dart';
|
|
|
+import 'package:cpt_vn/router/vn_router.dart';
|
|
|
import 'package:cpt_uk/router/uk_service_impl.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter/services.dart';
|
|
@@ -19,11 +12,9 @@ import 'package:initializer/global_services_injection.dart';
|
|
|
import 'package:initializer/app_initializer.dart';
|
|
|
import 'package:plugin_basic/basic_export.dart';
|
|
|
import 'package:router/componentRouter/auth_service.dart';
|
|
|
-import 'package:router/componentRouter/job_service.dart';
|
|
|
-import 'package:router/componentRouter/job_sg_service.dart';
|
|
|
-import 'package:router/componentRouter/labour_service.dart';
|
|
|
-import 'package:router/componentRouter/labour_sg_service.dart';
|
|
|
-import 'package:router/componentRouter/report_service.dart';
|
|
|
+import 'package:router/componentRouter/sg_service.dart';
|
|
|
+import 'package:router/componentRouter/vn_service.dart';
|
|
|
+import 'package:cpt_vn/router/vn_service_impl.dart';
|
|
|
import 'package:cs_resources/local/theme/theme_config.dart';
|
|
|
import 'package:cs_resources/local/language/translation_service.dart';
|
|
|
import 'package:router/componentRouter/uk_service.dart';
|
|
@@ -38,24 +29,21 @@ import 'package:widgets/dialog/custom_loading_widget.dart';
|
|
|
import 'package:widgets/widget_export.dart';
|
|
|
import 'router/page_router.dart';
|
|
|
|
|
|
-void main() async{
|
|
|
+void main() async {
|
|
|
//运行App
|
|
|
// FlutterBugly.postCatchedException(() async {
|
|
|
- //交给初始化构造器去统一初始化
|
|
|
- await AppInitializer.initializeRunalone();
|
|
|
+ //交给初始化构造器去统一初始化
|
|
|
+ await AppInitializer.initializeRunalone();
|
|
|
|
|
|
- //全局自定义单例服务的注入
|
|
|
- GlobalServicesInjection.init(additionalDependencies: () {
|
|
|
- Get.lazyPut<AuthService>(() => AuthServiceImpl());
|
|
|
- Get.lazyPut<LabourService>(() => LabourServiceImpl());
|
|
|
- Get.lazyPut<JobService>(() => JobServiceImpl());
|
|
|
- Get.lazyPut<ReportService>(() => ReportServiceImpl());
|
|
|
- Get.lazyPut<JobSGService>(() => JobSGServiceImpl());
|
|
|
- Get.lazyPut<LabourSGService>(() => LabourSGServiceImpl());
|
|
|
- Get.lazyPut<UKService>(() => UKServiceImpl());
|
|
|
- });
|
|
|
+ //全局自定义单例服务的注入
|
|
|
+ GlobalServicesInjection.init(additionalDependencies: () {
|
|
|
+ Get.lazyPut<AuthService>(() => AuthServiceImpl());
|
|
|
+ Get.lazyPut<UKService>(() => UKServiceImpl());
|
|
|
+ Get.lazyPut<VNService>(() => VNServiceImpl());
|
|
|
+ Get.lazyPut<SGService>(() => SGServiceImpl());
|
|
|
+ });
|
|
|
|
|
|
- runApp(MyApp());
|
|
|
+ runApp(MyApp());
|
|
|
// });
|
|
|
}
|
|
|
|
|
@@ -129,8 +117,7 @@ class MyApp extends StatelessWidget {
|
|
|
enableLog: true,
|
|
|
//默认路由与路由表的加载
|
|
|
initialRoute: RouterPath.splash,
|
|
|
- getPages: PageRouter.routes + BasicPageRouter.routes + AuthPageRouter.routes + JobPageRouter.routes + LabourPageRouter.routes +
|
|
|
- ReportPageRouter.routes + LabourSGPageRouter.routes + JobPageSGRouter.routes + UKPageRouter.routes,
|
|
|
+ getPages: PageRouter.routes + BasicPageRouter.routes + AuthPageRouter.routes + UKPageRouter.routes + VNPageRouter.routes + SGPageRouter.routes,
|
|
|
//对原生导航的兼容;SmartDialog路由配置生命周期处理
|
|
|
navigatorObservers: [GetXRouterObserver(), FlutterSmartDialog.observer, routeObserver],
|
|
|
//默认页面动画
|
|
@@ -145,7 +132,7 @@ class MyApp extends StatelessWidget {
|
|
|
//本地化相关
|
|
|
locale: TranslationService.locale,
|
|
|
fallbackLocale: TranslationService.fallbackLocale,
|
|
|
- localizationsDelegates: const [
|
|
|
+ localizationsDelegates: const [
|
|
|
GlobalMaterialLocalizations.delegate,
|
|
|
GlobalWidgetsLocalizations.delegate,
|
|
|
GlobalCupertinoLocalizations.delegate,
|