diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index 4763379..491be63 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -57,11 +57,11 @@ class _HomePageState extends State { final userProvider = Provider.of(context, listen: false); if (userProvider.isLogin) { - Get.to(page); + Get.to(() => page); if (text != '全部应用') appProvider.addRecentApp(AppApplication(text, assetPath, page)); } else - Get.to(LoginPage()); + Get.to(() => LoginPage()); }, child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -206,7 +206,7 @@ class _HomePageState extends State { //搜索框按钮 color: Color(0xFFFFFFFF), onPressed: () { - Get.to(SearchWorkOrderPage()); + Get.to(() => SearchWorkOrderPage()); }, radius: 8.w, child: Row(children: [ @@ -242,7 +242,7 @@ class _HomePageState extends State { minWidth: 78.w, padding: EdgeInsets.zero, onPressed: () { - Get.to(ScanPage()); + Get.to(() => ScanPage()); }, child: Column(children: [ Image.asset( @@ -269,9 +269,9 @@ class _HomePageState extends State { height: double.infinity, onPressed: () { if (userProvider.isLogin) - Get.to(Message()); + Get.to(() => Message()); else - Get.to(LoginPage()); + Get.to(() => LoginPage()); }, child: Column(children: [ Image.asset( @@ -296,9 +296,9 @@ class _HomePageState extends State { GestureDetector( onTap: () { if (!userProvider.isLogin) - Get.to(LoginPage()); + Get.to(() => LoginPage()); else - Get.to(UserInfoPage()); + Get.to(() => UserInfoPage()); }, child: Container( margin: EdgeInsets.only( @@ -372,7 +372,7 @@ class _HomePageState extends State { AkuButton( //全部公告按钮 onPressed: () { - Get.to(AllAnouncement()); + Get.to(() => AllAnouncement()); }, child: Row( children: [ diff --git a/lib/ui/home/messages/message.dart b/lib/ui/home/messages/message.dart index 3db2437..ec18e9f 100644 --- a/lib/ui/home/messages/message.dart +++ b/lib/ui/home/messages/message.dart @@ -162,7 +162,7 @@ class _MessageState extends State { '你有一条新的报事报修待处理', _messageCount, onpressed: () { - Get.to(SystemMessage()); + Get.to(() => SystemMessage()); }, ), Divider( @@ -175,7 +175,7 @@ class _MessageState extends State { '你有一条新的评论回复', _commentCount, onpressed: () { - Get.to(CommentMessage()); + Get.to(() => CommentMessage()); }, ), ], diff --git a/lib/ui/home/personal_draw.dart b/lib/ui/home/personal_draw.dart index cd09b18..307608d 100644 --- a/lib/ui/home/personal_draw.dart +++ b/lib/ui/home/personal_draw.dart @@ -67,8 +67,8 @@ class _PersonalDrawState extends State { InkWell( onTap: () { userProvider.isLogin - ? Get.to(UserInfoPage()) - : Get.to(LoginPage()); + ? Get.to(() => UserInfoPage()) + : Get.to(() => LoginPage()); }, child: Container( margin: EdgeInsets.only(bottom: 80.w, top: 40.w), @@ -122,13 +122,13 @@ class _PersonalDrawState extends State { '个人信息', onPressed: () { userProvider.isLogin - ? Get.to(UserInfoPage()) - : Get.to(LoginPage()); + ? Get.to(() => UserInfoPage()) + : Get.to(() => LoginPage()); }, ), _myListTile(R.ASSETS_USER_IC_KEFU_PNG, '联系客服'), _myListTile(R.ASSETS_USER_IC_SETUP_PNG, '设置', onPressed: () { - Get.to(SettingsPage()); + Get.to(() => SettingsPage()); }), ], ), diff --git a/lib/ui/login/login_page.dart b/lib/ui/login/login_page.dart index 2e56de7..5c59369 100644 --- a/lib/ui/login/login_page.dart +++ b/lib/ui/login/login_page.dart @@ -156,7 +156,7 @@ class _LoginPageState extends State { ExtendedWidgetSpan( child: GestureDetector( onTap: () { - Get.to(AgreementPage()); + Get.to(() => AgreementPage()); }, child: Text( '《服务协议》', @@ -173,7 +173,7 @@ class _LoginPageState extends State { ExtendedWidgetSpan( child: GestureDetector( onTap: () { - Get.to(PrivacyPage()); + Get.to(() => PrivacyPage()); }, child: Text( '《隐私政策》', diff --git a/lib/ui/settings/settings_page.dart b/lib/ui/settings/settings_page.dart index bfbea27..3ef24dd 100644 --- a/lib/ui/settings/settings_page.dart +++ b/lib/ui/settings/settings_page.dart @@ -60,7 +60,7 @@ class _SettingsPageState extends State { AkuTile( title: Text('意见反馈'), arrow: true, - onTap: () => Get.to(SettingFeedBackPage()), + onTap: () => Get.to(() => SettingFeedBackPage()), ), Divider(height: 1.w), AkuTile( @@ -72,13 +72,13 @@ class _SettingsPageState extends State { AkuTile( title: Text('隐私政策'), arrow: true, - onTap: () => Get.to(PrivacyPage()), + onTap: () => Get.to(() => PrivacyPage()), ), Divider(height: 1.w), AkuTile( title: Text('用户协议'), arrow: true, - onTap: () => Get.to(AgreementPage()), + onTap: () => Get.to(() => AgreementPage()), ), AkuBox.h(320), userProvider.isLogin diff --git a/lib/ui/sub_pages/borrow_manager/all_borrow_goods.dart b/lib/ui/sub_pages/borrow_manager/all_borrow_goods.dart index 33ad832..25a8047 100644 --- a/lib/ui/sub_pages/borrow_manager/all_borrow_goods.dart +++ b/lib/ui/sub_pages/borrow_manager/all_borrow_goods.dart @@ -33,7 +33,7 @@ class _AllBorrowGoodsState extends State { // ? AkuMaterialButton( // minWidth: 120.w, // onPressed: () { - // Get.to(AddBorrowObjectPage()); + // Get.to(()=>AddBorrowObjectPage()); // }, // child: Text( // '新增', diff --git a/lib/ui/sub_pages/borrow_manager/borrow_manager_page.dart b/lib/ui/sub_pages/borrow_manager/borrow_manager_page.dart index 1c0d9a9..4a6cb96 100644 --- a/lib/ui/sub_pages/borrow_manager/borrow_manager_page.dart +++ b/lib/ui/sub_pages/borrow_manager/borrow_manager_page.dart @@ -60,7 +60,7 @@ class _BorrowManagerPageState extends State AkuMaterialButton( minWidth: 178.w, onPressed: () { - Get.to(AllBorrowGoods()); + Get.to(() => AllBorrowGoods()); }, child: Text( '全部物品', diff --git a/lib/ui/tool_pages/warning/warning_page.dart b/lib/ui/tool_pages/warning/warning_page.dart index 93e8e11..521c199 100644 --- a/lib/ui/tool_pages/warning/warning_page.dart +++ b/lib/ui/tool_pages/warning/warning_page.dart @@ -37,7 +37,7 @@ class _WarningPageState extends State { AkuMaterialButton( padding: EdgeInsets.symmetric(horizontal: 32.w), onPressed: () { - Get.to(WarningDetailPage()); + Get.to(() => WarningDetailPage()); }, child: Text( '功能说明', @@ -163,7 +163,7 @@ class _WarningPageState extends State { minWidth: 0, onPressed: () { launch('tel:110'); - // Get.to(WarningSubPage()); + // Get.to(()=>WarningSubPage()); }, child: Container( height: 172.w, diff --git a/lib/ui/tool_pages/warning/warning_sub_page.dart b/lib/ui/tool_pages/warning/warning_sub_page.dart index b75c0bd..2a178a3 100644 --- a/lib/ui/tool_pages/warning/warning_sub_page.dart +++ b/lib/ui/tool_pages/warning/warning_sub_page.dart @@ -41,7 +41,7 @@ class _WarningSubPageState extends State { actions: [ AkuMaterialButton( onPressed: () { - Get.to(WarningDetailPage()); + Get.to(() => WarningDetailPage()); }, padding: EdgeInsets.symmetric(horizontal: 32.w), child: Text('功能说明'), diff --git a/lib/ui/tool_pages/warning/warning_success.dart b/lib/ui/tool_pages/warning/warning_success.dart index f86be41..c96d94f 100644 --- a/lib/ui/tool_pages/warning/warning_success.dart +++ b/lib/ui/tool_pages/warning/warning_success.dart @@ -36,7 +36,7 @@ class _WarningSuccessState extends State { actions: [ AkuMaterialButton( onPressed: () { - Get.to(WarningDetailPage()); + Get.to(() => WarningDetailPage()); }, padding: EdgeInsets.symmetric(horizontal: 32.w), child: Text('功能说明'),