From b32ab1379d9f4db804b1220283c09186664281f0 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Fri, 15 Jan 2021 13:38:29 +0800 Subject: [PATCH] upadte app's pageRoute. --- .../activities_details_page.dart | 5 ++--- lib/pages/community/community_index.dart | 2 +- lib/pages/community/topice_detail_page.dart | 2 +- lib/pages/community/widget/topic_card.dart | 2 +- .../widget/confirm_bottom_bar.dart | 2 +- .../goods_details/goods_details_page.dart | 2 +- .../goods_details/widget/goods_app_bar.dart | 2 +- .../widget/goods_details_bottom_bar.dart | 3 ++- .../goods_deto_page/goods_deto_page.dart | 4 +--- lib/pages/home/home_page.dart | 18 +++++++-------- lib/pages/personal/personal_page.dart | 12 +++++----- lib/pages/property/property_index.dart | 22 +++++++++---------- lib/pages/setting_page/settings_page.dart | 10 +++++---- .../total_applications_page.dart | 2 +- lib/utils/logger_view.dart | 5 +++-- 15 files changed, 47 insertions(+), 46 deletions(-) diff --git a/lib/pages/activities_page/activities_details_page/activities_details_page.dart b/lib/pages/activities_page/activities_details_page/activities_details_page.dart index d95a9c3d..1914e795 100644 --- a/lib/pages/activities_page/activities_details_page/activities_details_page.dart +++ b/lib/pages/activities_page/activities_details_page/activities_details_page.dart @@ -217,7 +217,7 @@ class _ActivitiesDetailsPageState extends State { Widget _inkWellEnterMember(List memberList) { return InkWell( onTap: () { - Get.to(MemberListPage()); + MemberListPage().to(); }, child: Container( padding: EdgeInsets.only(bottom: 24.w), @@ -245,8 +245,7 @@ class _ActivitiesDetailsPageState extends State { child: Text( '已有${320}人参加', style: TextStyle( - fontSize: BaseStyle.fontSize28, - color: ktextPrimary), + fontSize: BaseStyle.fontSize28, color: ktextPrimary), ), ), Icon( diff --git a/lib/pages/community/community_index.dart b/lib/pages/community/community_index.dart index 4ca92c30..282459f0 100644 --- a/lib/pages/community/community_index.dart +++ b/lib/pages/community/community_index.dart @@ -40,7 +40,7 @@ class _CommunityIndexState extends State } void noteCreateRouter() { - Get.to(NoteCreatePage()); + NoteCreatePage().to(); } List _listActions() { diff --git a/lib/pages/community/topice_detail_page.dart b/lib/pages/community/topice_detail_page.dart index c8a9f064..2c450b6f 100644 --- a/lib/pages/community/topice_detail_page.dart +++ b/lib/pages/community/topice_detail_page.dart @@ -80,7 +80,7 @@ class _TopiceDetailPageState extends State { size: 40.sp, ), onPressed: () { - Get.to(NoteCreatePage()); + NoteCreatePage().to(); })); } diff --git a/lib/pages/community/widget/topic_card.dart b/lib/pages/community/widget/topic_card.dart index 4a8a58b3..d2c0d17e 100644 --- a/lib/pages/community/widget/topic_card.dart +++ b/lib/pages/community/widget/topic_card.dart @@ -29,7 +29,7 @@ class _TopicCardState extends State { } void topiceDetailRouter(String subtitle, String imagePath) { - Get.to(TopiceDetailPage()); + TopiceDetailPage().to(); } Row _rowTopic(String title, String subtitle, String imagePath) { diff --git a/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart b/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart index 39149b98..1998a753 100644 --- a/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart +++ b/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart @@ -36,7 +36,7 @@ class ConfirmBottomBar extends StatelessWidget { Widget _submit(BuildContext context) { return InkWell( onTap: () { - Get.to(PayOrderPage()); + PayOrderPage().to(); }, child: Container( decoration: BoxDecoration( diff --git a/lib/pages/goods_details/goods_details_page.dart b/lib/pages/goods_details/goods_details_page.dart index 1eb77a5a..e82a1c94 100644 --- a/lib/pages/goods_details/goods_details_page.dart +++ b/lib/pages/goods_details/goods_details_page.dart @@ -57,7 +57,7 @@ class _GoodsDetailsPageState extends State { // ProductSpecs(), ProductEvaluate( fun: () { - Get.to(ViewCommentsPage()); + ViewCommentsPage().to(); }, ), ProductDetail( diff --git a/lib/pages/goods_details/widget/goods_app_bar.dart b/lib/pages/goods_details/widget/goods_app_bar.dart index a98f9168..b4873ea0 100644 --- a/lib/pages/goods_details/widget/goods_app_bar.dart +++ b/lib/pages/goods_details/widget/goods_app_bar.dart @@ -85,7 +85,7 @@ class _GoodsAppBarState extends State { color: Color(0xff666666), ), onPressed: () { - Get.to(MarketCartPage()); + MarketCartPage().to(); }, ), ], diff --git a/lib/pages/goods_details/widget/goods_details_bottom_bar.dart b/lib/pages/goods_details/widget/goods_details_bottom_bar.dart index 8791d9cd..871101e8 100644 --- a/lib/pages/goods_details/widget/goods_details_bottom_bar.dart +++ b/lib/pages/goods_details/widget/goods_details_bottom_bar.dart @@ -8,6 +8,7 @@ import 'package:provider/provider.dart'; import 'package:akuCommunity/provider/cart.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:akuCommunity/widget/goods_specs_sheet.dart'; +import 'package:akuCommunity/extensions/page_router.dart'; class GoodsDetailsBottomBar extends StatefulWidget { final String itemid, itemtitle, itemprice, itempic; @@ -112,7 +113,7 @@ class _GoodsDetailsBottomBarState extends State { ], ), onTap: () { - Get.to(MarketCartPage()); + MarketCartPage().to(); }, ), SizedBox(width: 53.w), diff --git a/lib/pages/goods_deto_page/goods_deto_page.dart b/lib/pages/goods_deto_page/goods_deto_page.dart index 06588e86..a7bc59db 100644 --- a/lib/pages/goods_deto_page/goods_deto_page.dart +++ b/lib/pages/goods_deto_page/goods_deto_page.dart @@ -79,8 +79,6 @@ class _GoodsDetoPageState extends State { _refreshController.loadComplete(); } - - @override void dispose() { super.dispose(); @@ -131,7 +129,7 @@ class _GoodsDetoPageState extends State { child: BottomButton( title: '新增', fun: () { - Get.to(DetoCreatePage()); + DetoCreatePage().to(); }, ), ), diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 9551a3df..3dd4a7ef 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -58,19 +58,19 @@ class _HomePageState extends State List _gridList = [ GridButton('一键开门', R.ASSETS_ICONS_TOOL_YJKM_PNG, () { - Get.to(OpenDoorPage()); + OpenDoorPage().to(); }), GridButton('访客通行', R.ASSETS_ICONS_TOOL_FKYQ_PNG, () { - Get.to(VisitorAccessPage()); + VisitorAccessPage().to(); }), GridButton('报事报修', R.ASSETS_ICONS_TOOL_BSBX_PNG, () { - Get.to(FixedSubmitPage()); + FixedSubmitPage().to(); }), GridButton('生活缴费', R.ASSETS_ICONS_TOOL_SHJF_PNG, () { - Get.to(LifePayPage()); + LifePayPage().to(); }), GridButton('业委会', R.ASSETS_ICONS_TOOL_YWH_PNG, () { - Get.to(IndustryCommitteePage()); + IndustryCommitteePage().to(); }), GridButton('建议咨询', R.ASSETS_ICONS_TOOL_JYTS_PNG, () { Get.to(ThingsPage( @@ -85,10 +85,10 @@ class _HomePageState extends State )); }), GridButton('便民电话', R.ASSETS_ICONS_TOOL_BMDH_PNG, () { - Get.to(ConvenientPhonePage()); + ConvenientPhonePage().to(); }), GridButton('全部应用', R.ASSETS_ICONS_TOOL_QBYY_PNG, () { - Get.to(TotalApplicationsPage()); + TotalApplicationsPage().to(); }), ]; @@ -181,12 +181,12 @@ class _HomePageState extends State _buildColButton( icon: AntDesign.scan1, title: '扫一扫', - onTap: () => Get.to(ScanPage()), + onTap: () => ScanPage().to(), ), _buildColButton( icon: AntDesign.bells, title: '消息', - onTap: () => Get.to(MessageCenterPage()), + onTap: () => MessageCenterPage().to(), ), 16.wb, ], diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index e563ca57..521645e1 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -38,7 +38,7 @@ class _PersonalIndexState extends State with SingleTickerProviderStateMixin { List _manageGridList = [ GridButton('我的房屋', R.ASSETS_ICONS_USER_ICON_WDFW_PNG, () { - Get.to(MineHousePage()); + MineHousePage().to(); }), GridButton('我的车位', R.ASSETS_ICONS_USER_ICON_WDCW_PNG, () { Get.to(MineCarPage( @@ -56,20 +56,20 @@ class _PersonalIndexState extends State )); }), GridButton('我的缴费', R.ASSETS_ICONS_USER_ICON_WDJF_PNG, () { - Get.to(LifePayPage()); + LifePayPage().to(); }), GridButton('我的保修', R.ASSETS_ICONS_USER_ICON_WDBX_PNG, () { - Get.to(FixedSubmitPage()); + FixedSubmitPage().to(); }), GridButton('我的地址', R.ASSETS_ICONS_USER_ICON_WDDZ_PNG, () { - Get.to(AddressPage()); + AddressPage().to(); }), GridButton('我的管家', R.ASSETS_ICONS_USER_ICON_WDGJ_PNG, () {}), GridButton('我的访客', R.ASSETS_ICONS_USER_ICON_WDFK_PNG, () { - Get.to(VisitorAccessPage()); + VisitorAccessPage().to(); }), GridButton('设置', R.ASSETS_ICONS_USER_ICON_SZ_PNG, () { - Get.to(SettingsPage()); + SettingsPage().to(); }), ]; diff --git a/lib/pages/property/property_index.dart b/lib/pages/property/property_index.dart index 5c1dbea3..91fdebe1 100644 --- a/lib/pages/property/property_index.dart +++ b/lib/pages/property/property_index.dart @@ -40,22 +40,22 @@ class _PropertyIndexState extends State with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin { List _gridList = [ GridButton('一键开门', R.ASSETS_ICONS_TOOL_YJKM_PNG, () { - Get.to(OpenDoorPage()); + OpenDoorPage().to(); }), GridButton('开门码', R.ASSETS_ICONS_TOOL_KMM_PNG, () { - Get.to(OpeningCodePage()); + OpeningCodePage().to(); }), GridButton('访客通行', R.ASSETS_ICONS_TOOL_FKYQ_PNG, () { - Get.to(VisitorAccessPage()); + VisitorAccessPage().to(); }), GridButton('报事报修', R.ASSETS_ICONS_TOOL_BSBX_PNG, () { - Get.to(FixedSubmitPage()); + FixedSubmitPage().to(); }), GridButton('生活缴费', R.ASSETS_ICONS_TOOL_SHJF_PNG, () { - Get.to(LifePayPage()); + LifePayPage().to(); }), GridButton('业委会', R.ASSETS_ICONS_TOOL_YWH_PNG, () { - Get.to(IndustryCommitteePage()); + IndustryCommitteePage().to(); }), GridButton('建议咨询', R.ASSETS_ICONS_TOOL_JYTS_PNG, () { Get.to(ThingsPage( @@ -70,7 +70,7 @@ class _PropertyIndexState extends State )); }), GridButton('便民电话', R.ASSETS_ICONS_TOOL_BMDH_PNG, () { - Get.to(ConvenientPhonePage()); + ConvenientPhonePage().to(); }), GridButton('活动投票', R.ASSETS_ICONS_TOOL_HDTP_PNG, () { Get.to(ActivitiesPage( @@ -78,7 +78,7 @@ class _PropertyIndexState extends State )); }), GridButton('物品出户', R.ASSETS_ICONS_TOOL_WPCM_PNG, () { - Get.to(GoodsDetoPage()); + GoodsDetoPage().to(); }), GridButton('投诉表扬', R.ASSETS_ICONS_TOOL_TSBY_PNG, () { Get.to(ThingsPage( @@ -93,13 +93,13 @@ class _PropertyIndexState extends State )); }), GridButton('问卷调查', R.ASSETS_ICONS_TOOL_WJDC_PNG, () { - Get.to(QuestionnairePage()); + QuestionnairePage().to(); }), GridButton('装修管理', R.ASSETS_ICONS_TOOL_ZXGL_PNG, () { - Get.to(FitupManagePage()); + FitupManagePage().to(); }), GridButton('全部应用', R.ASSETS_ICONS_TOOL_QBYY_PNG, () { - Get.to(TotalApplicationsPage()); + TotalApplicationsPage().to(); }), ]; @override diff --git a/lib/pages/setting_page/settings_page.dart b/lib/pages/setting_page/settings_page.dart index 0b7a9a63..7e43022f 100644 --- a/lib/pages/setting_page/settings_page.dart +++ b/lib/pages/setting_page/settings_page.dart @@ -6,6 +6,8 @@ import 'package:akuCommunity/pages/setting_page/invite_page/invite_page.dart'; import 'package:akuCommunity/pages/sign/sign_in_page.dart'; import 'package:akuCommunity/provider/user_provider.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; +import 'package:akuCommunity/extensions/page_router.dart'; + import 'package:akuCommunity/extensions/widget_list_ext.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter/cupertino.dart'; @@ -85,7 +87,7 @@ class _SettingsPageState extends State { ); }, ) - : Get.to(SignInPage()); + : SignInPage().to(); }, child: userProvider.isSigned ? Container( @@ -144,11 +146,11 @@ class _SettingsPageState extends State { ), _buildTile( title: '关于小蜜蜂智慧社区', - onTap: () => Get.to(AboutPage()), + onTap: () => AboutPage().to(), ), _buildTile( title: '邀请注册', - onTap: () => Get.to(InvitePage()), + onTap: () => InvitePage().to(), ), ].sepWidget( separate: Divider( @@ -166,7 +168,7 @@ class _SettingsPageState extends State { ), _buildTile( title: '意见反馈', - onTap: () => Get.to(FeedBackPage()), + onTap: () => FeedBackPage().to(), ), _buildTile( title: '账号管理', diff --git a/lib/pages/total_application_page/total_applications_page.dart b/lib/pages/total_application_page/total_applications_page.dart index daa417fb..c9a6df70 100644 --- a/lib/pages/total_application_page/total_applications_page.dart +++ b/lib/pages/total_application_page/total_applications_page.dart @@ -127,7 +127,7 @@ class _TotalApplicationsPageState extends State { ).to; break; case '一键开门': - Get.to(OpenDoorPage()); + OpenDoorPage().to(); break; case '开门码': OpeningCodePage().to; diff --git a/lib/utils/logger_view.dart b/lib/utils/logger_view.dart index ed5702a3..055eead6 100644 --- a/lib/utils/logger_view.dart +++ b/lib/utils/logger_view.dart @@ -1,7 +1,8 @@ import 'package:akuCommunity/utils/logger_card.dart'; import 'package:akuCommunity/utils/logger_data.dart'; +import 'package:akuCommunity/extensions/page_router.dart'; + import 'package:flutter/material.dart'; -import 'package:get/get.dart'; class LoggerFAB extends StatefulWidget { static openLogger(BuildContext context) { @@ -52,7 +53,7 @@ class _LoggerFABState extends State { setState(() {}); }, onTap: () { - Get.to(LoggerView()); + LoggerView().to(); }, child: Container( decoration: BoxDecoration(