From bfe9f274c207b4f2e6fb2e6907a6e305a9e3f858 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Mon, 29 Mar 2021 14:37:49 +0800 Subject: [PATCH] refactor route tool --- lib/extensions/page_router.dart | 7 - .../address_page/widget/address_item.dart | 21 +- .../widget/confirm_bottom_bar.dart | 3 +- .../event_activity/event_voting_page.dart | 5 +- .../goods_details/goods_details_page.dart | 3 +- .../goods_details/widget/goods_app_bar.dart | 2 +- .../widget/goods_details_bottom_bar.dart | 4 +- .../deto_create_page/deto_create_page.dart | 2 +- .../goods_deto_page/goods_deto_page.dart | 3 +- .../widget/goods_info_card_button.dart | 3 +- .../goods_manage_page/goods_manage_page.dart | 3 +- lib/pages/home/home_page.dart | 6 +- .../life_pay_info_page.dart | 3 +- lib/pages/life_pay/life_pay_page.dart | 5 +- .../message_center_page.dart | 5 +- .../system_message/system_message_page.dart | 5 +- lib/pages/open_door_page/open_door_page.dart | 2 +- lib/pages/personal/order_details_page.dart | 14 +- lib/pages/personal/personal_page.dart | 7 +- lib/pages/personal/refund_select_page.dart | 32 +-- lib/pages/personal/user_profile_page.dart | 4 +- lib/pages/personal/widget/order_card.dart | 50 ++--- lib/pages/setting_page/settings_page.dart | 13 +- lib/pages/sign/sign_in_page.dart | 4 +- .../sign/sign_up/sign_up_pick_plot_page.dart | 4 +- lib/pages/things_page/fixed_submit_page.dart | 4 +- .../things_detail_page.dart | 182 ------------------ .../widget/goods_info_card.dart | 157 --------------- .../widget/goods_info_card_button.dart | 140 -------------- .../widget/image_horizontal_list.dart | 64 ------ .../widget/add_fixed_submit_page.dart | 2 +- lib/pages/things_page/widget/things_card.dart | 112 ----------- lib/pages/things_page/widget/things_list.dart | 36 ---- .../visitor_access_page.dart | 2 +- lib/ui/community/activity/activity_card.dart | 9 +- .../community_views/community_page.dart | 2 +- lib/ui/home/home_notification.dart | 2 +- lib/ui/manager/advice/advice_card.dart | 3 +- lib/ui/manager/advice/advice_detail_page.dart | 3 +- .../questionnaire_detail_page.dart | 8 +- .../questionnaire/questionnaire_page.dart | 13 +- lib/ui/manager/visitor/visitor_list_item.dart | 3 +- lib/utils/headers.dart | 1 - lib/widget/app_bar_action.dart | 7 +- lib/widget/goods_specs_sheet.dart | 20 +- lib/widget/others/bee_header_house.dart | 75 -------- lib/widget/sliver_goods_card.dart | 4 +- 47 files changed, 149 insertions(+), 910 deletions(-) delete mode 100644 lib/extensions/page_router.dart delete mode 100644 lib/pages/things_page/things_detail_page/things_detail_page.dart delete mode 100644 lib/pages/things_page/things_detail_page/widget/goods_info_card.dart delete mode 100644 lib/pages/things_page/things_detail_page/widget/goods_info_card_button.dart delete mode 100644 lib/pages/things_page/things_detail_page/widget/image_horizontal_list.dart delete mode 100644 lib/pages/things_page/widget/things_card.dart delete mode 100644 lib/pages/things_page/widget/things_list.dart delete mode 100644 lib/widget/others/bee_header_house.dart diff --git a/lib/extensions/page_router.dart b/lib/extensions/page_router.dart deleted file mode 100644 index 9a5a7171..00000000 --- a/lib/extensions/page_router.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:get/get.dart'; - -extension PageExt on Widget { - Function get to => () => Get.to(() => this); -} diff --git a/lib/pages/address_page/widget/address_item.dart b/lib/pages/address_page/widget/address_item.dart index abfef902..e1179676 100644 --- a/lib/pages/address_page/widget/address_item.dart +++ b/lib/pages/address_page/widget/address_item.dart @@ -7,6 +7,7 @@ import 'package:flutter_icons/flutter_icons.dart'; import 'package:akuCommunity/pages/address_page/address_edit_page.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/utils/headers.dart'; +import 'package:get/get.dart'; class AddressItem extends StatelessWidget { final String name, phone, address; @@ -113,16 +114,16 @@ class AddressItem extends StatelessWidget { top: 55.w, child: InkWell( onTap: () { - AddressEditPage( - bundle: Bundle() - ..putMap('details', { - 'title': '编辑地址', - 'name': name, - 'phone': phone, - 'address': address, - 'isDelete': true - }), - ).to(); + Get.to(() => AddressEditPage( + bundle: Bundle() + ..putMap('details', { + 'title': '编辑地址', + 'name': name, + 'phone': phone, + 'address': address, + 'isDelete': true + }), + )); }, child: Row( children: [ 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 de9f7ce1..ec4ed058 100644 --- a/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart +++ b/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/pages/confirm_order_page/pay_order_page.dart'; import 'package:akuCommunity/utils/headers.dart'; +import 'package:get/get.dart'; class ConfirmBottomBar extends StatelessWidget { final Map cartMap; @@ -35,7 +36,7 @@ class ConfirmBottomBar extends StatelessWidget { Widget _submit(BuildContext context) { return InkWell( onTap: () { - PayOrderPage().to(); + Get.to(()=>PayOrderPage()); }, child: Container( decoration: BoxDecoration( diff --git a/lib/pages/event_activity/event_voting_page.dart b/lib/pages/event_activity/event_voting_page.dart index a4a7ab9c..2c6085ce 100644 --- a/lib/pages/event_activity/event_voting_page.dart +++ b/lib/pages/event_activity/event_voting_page.dart @@ -10,6 +10,7 @@ import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart'; import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/others/stack_avatar.dart'; +import 'package:get/get.dart'; class EventVotingPage extends StatefulWidget { EventVotingPage({Key key}) : super(key: key); @@ -108,9 +109,7 @@ class _EventVotingPageState extends State { // EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.w), elevation: 0, onPressed: () { - VotingDetailPage( - id: model.id, - ).to(); + Get.to(() => VotingDetailPage(id: model.id)); }, child: (_getButtonText(model.status)) .text diff --git a/lib/pages/goods_details/goods_details_page.dart b/lib/pages/goods_details/goods_details_page.dart index 69c889aa..76a6259e 100644 --- a/lib/pages/goods_details/goods_details_page.dart +++ b/lib/pages/goods_details/goods_details_page.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; import 'package:akuCommunity/pages/goods_details/view_comments_page.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/utils/headers.dart'; +import 'package:get/get.dart'; import 'widget/goods_app_bar.dart'; import 'widget/goods_details_bottom_bar.dart'; import 'widget/product_content.dart'; @@ -58,7 +59,7 @@ class _GoodsDetailsPageState extends State { // ProductSpecs(), ProductEvaluate( fun: () { - ViewCommentsPage().to(); + Get.to(() => ViewCommentsPage()); }, ), ProductDetail( diff --git a/lib/pages/goods_details/widget/goods_app_bar.dart b/lib/pages/goods_details/widget/goods_app_bar.dart index 25b17ac5..34340f57 100644 --- a/lib/pages/goods_details/widget/goods_app_bar.dart +++ b/lib/pages/goods_details/widget/goods_app_bar.dart @@ -87,7 +87,7 @@ class _GoodsAppBarState extends State { color: Color(0xff666666), ), onPressed: () { - MarketCartPage().to(); + Get.to(() => MarketCartPage()); }, ), ], 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 e894e30d..e205ef64 100644 --- a/lib/pages/goods_details/widget/goods_details_bottom_bar.dart +++ b/lib/pages/goods_details/widget/goods_details_bottom_bar.dart @@ -3,9 +3,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:provider/provider.dart'; -import 'package:akuCommunity/extensions/page_router.dart'; import 'package:akuCommunity/pages/market/market_cart_page/market_cart_page.dart'; import 'package:akuCommunity/provider/cart.dart'; import 'package:akuCommunity/widget/goods_specs_sheet.dart'; @@ -113,7 +113,7 @@ class _GoodsDetailsBottomBarState extends State { ], ), onTap: () { - MarketCartPage().to(); + Get.to(() => MarketCartPage()); }, ), SizedBox(width: 53.w), diff --git a/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart b/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart index eb13439a..a0403b3f 100644 --- a/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart +++ b/lib/pages/goods_deto_page/deto_create_page/deto_create_page.dart @@ -362,7 +362,7 @@ class _DetoCreatePageState extends State { 16.w.heightBox, InkWell( onTap: () async { - _selectTel = await SelectMoveCompanyPage().to(); + _selectTel = await Get.to(() => SelectMoveCompanyPage()); setState(() {}); }, child: Padding( diff --git a/lib/pages/goods_deto_page/goods_deto_page.dart b/lib/pages/goods_deto_page/goods_deto_page.dart index 7b81edbf..0b439768 100644 --- a/lib/pages/goods_deto_page/goods_deto_page.dart +++ b/lib/pages/goods_deto_page/goods_deto_page.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; @@ -125,7 +126,7 @@ class _GoodsDetoPageState extends State { } : () { userProvider.isLogin - ? DetoCreatePage().to() + ? Get.to(()=>DetoCreatePage()) : BotToast.showText(text: '请先登录!'); }, child: _isEdit diff --git a/lib/pages/goods_deto_page/widget/goods_info_card_button.dart b/lib/pages/goods_deto_page/widget/goods_info_card_button.dart index 563c0795..d1ff3fed 100644 --- a/lib/pages/goods_deto_page/widget/goods_info_card_button.dart +++ b/lib/pages/goods_deto_page/widget/goods_info_card_button.dart @@ -6,7 +6,6 @@ import 'package:flutter_icons/flutter_icons.dart'; import 'package:get/get.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:akuCommunity/extensions/page_router.dart'; import 'package:akuCommunity/model/manager/article_QR_code_model.dart'; import 'package:akuCommunity/pages/goods_deto_page/deto_code_page/deto_code_page.dart'; import 'package:akuCommunity/pages/manager_func.dart'; @@ -98,7 +97,7 @@ class GoodsInfoCardButton extends StatelessWidget { ArticleQRModel _model = await ManagerFunc.getQRcode(id); if (_model.status) { - DetoCodePage(id: id, model: _model).to(); + Get.to(() => DetoCodePage(id: id, model: _model)); } else { BotToast.showText(text: _model.message); } diff --git a/lib/pages/goods_manage_page/goods_manage_page.dart b/lib/pages/goods_manage_page/goods_manage_page.dart index 5bb884f6..c9c6c997 100644 --- a/lib/pages/goods_manage_page/goods_manage_page.dart +++ b/lib/pages/goods_manage_page/goods_manage_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; import 'package:akuCommunity/const/resource.dart'; @@ -87,7 +88,7 @@ class _GoodsManagePageState extends State { actions: [ MaterialButton( onPressed: () { - MineGoodsPage().to(); + Get.to(() => MineGoodsPage()); }, child: '我的借还物品'.text.black.size(28.sp).make(), padding: EdgeInsets.symmetric(horizontal: 32.w), diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 8dcfd748..0844116f 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -6,11 +6,11 @@ import 'package:flutter/material.dart'; import 'package:badges/badges.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; import 'package:akuCommunity/const/resource.dart'; -import 'package:akuCommunity/extensions/page_router.dart'; import 'package:akuCommunity/model/aku_shop_model.dart'; import 'package:akuCommunity/model/community/activity_item_model.dart'; import 'package:akuCommunity/model/community/board_model.dart'; @@ -75,7 +75,7 @@ class _HomePageState extends State child: ColumnActionButton( onPressed: () { if (LoginUtil.isNotLogin) return; - MessageCenterPage().to(); + Get.to(() => MessageCenterPage()); }, title: '消息', path: R.ASSETS_ICONS_ALARM_PNG, @@ -150,7 +150,7 @@ class _HomePageState extends State HomeTitle( title: '社区活动', suffixTitle: '更多活动', - onTap: ActivityListPage().to, + onTap: () => Get.to(() => ActivityListPage()), ), _activityItemModel == null ? SizedBox() diff --git a/lib/pages/life_pay/life_pay_info_page/life_pay_info_page.dart b/lib/pages/life_pay/life_pay_info_page/life_pay_info_page.dart index bee405ad..b99f18b1 100644 --- a/lib/pages/life_pay/life_pay_info_page/life_pay_info_page.dart +++ b/lib/pages/life_pay/life_pay_info_page/life_pay_info_page.dart @@ -5,6 +5,7 @@ import 'package:akuCommunity/pages/life_pay/life_pay_bill_page/life_pay_bill_pag import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; +import 'package:get/get.dart'; import '../widget/submit_bar.dart'; import 'widget/details_card.dart'; @@ -26,7 +27,7 @@ class _LifePayInfoPageState extends State { ListView( padding: EdgeInsets.only(bottom: 130.w), children: [ - DetailsCard(fun: LifePayBillPage().to), + DetailsCard(fun: () => Get.to(() => LifePayBillPage())), ], ), Positioned( diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index 083a2596..6d85a58a 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -183,9 +183,8 @@ class _LifePayPageState extends State { children: [ GestureDetector( onTap: () async { - List payMent = await LifePayDetailPage( - model: _models[index], - ).to(); + List payMent = await Get.to( + () => LifePayDetailPage(model: _models[index])); _selectPay[index].payCount = payMent[0]; _selectPay[index].payTotal = payMent[1]; setState(() {}); diff --git a/lib/pages/message_center_page/message_center_page.dart b/lib/pages/message_center_page/message_center_page.dart index f8cf77e2..b2a906e4 100644 --- a/lib/pages/message_center_page/message_center_page.dart +++ b/lib/pages/message_center_page/message_center_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:badges/badges.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:akuCommunity/constants/api.dart'; @@ -99,7 +100,7 @@ class _MessageCenterPageState extends State { title: '系统通知', content: appProvider.messageCenterModel.sysTitle ?? '无系统通知消息', count: appProvider.messageCenterModel.sysCount ?? 0, - onTap: SystemMessagePage().to, + onTap: () => Get.to(() => SystemMessagePage()), ), _buildCard( path: R.ASSETS_ICONS_COMMENT_NOTICE_PNG, @@ -109,7 +110,7 @@ class _MessageCenterPageState extends State { count: appProvider.messageCenterModel.commentCount ?? 0, onTap: () async { // await NetUtil().dio.get(API.message.allReadComment); - CommentMessagePage().to(); + Get.to(() => CommentMessagePage()); }, ), // _buildCard( diff --git a/lib/pages/message_center_page/system_message/system_message_page.dart b/lib/pages/message_center_page/system_message/system_message_page.dart index 67ec62c3..96f6b7db 100644 --- a/lib/pages/message_center_page/system_message/system_message_page.dart +++ b/lib/pages/message_center_page/system_message/system_message_page.dart @@ -13,6 +13,7 @@ import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/network/net_util.dart'; import 'package:akuCommunity/widget/bee_divider.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; +import 'package:get/get.dart'; class SystemMessagePage extends StatefulWidget { SystemMessagePage({Key key}) : super(key: key); @@ -41,9 +42,7 @@ class _SystemMessagePageState extends State { await NetUtil().dio.get(API.message.readMessage, queryParameters: { 'sysMessageId': model.id, }); - SystemMessageDetailPage( - id: model.id, - ).to(); + Get.to(() => SystemMessageDetailPage(id: model.id)); }, child: Container( decoration: BoxDecoration( diff --git a/lib/pages/open_door_page/open_door_page.dart b/lib/pages/open_door_page/open_door_page.dart index ebf198b4..dae39018 100644 --- a/lib/pages/open_door_page/open_door_page.dart +++ b/lib/pages/open_door_page/open_door_page.dart @@ -58,7 +58,7 @@ class _OpenDoorPageState extends State { ), onPressed: () { Get.back(); - CertificationPage().to; + Get.to(() => CertificationPage()); }, ), ], diff --git a/lib/pages/personal/order_details_page.dart b/lib/pages/personal/order_details_page.dart index 7222f0d8..b96a4ef7 100644 --- a/lib/pages/personal/order_details_page.dart +++ b/lib/pages/personal/order_details_page.dart @@ -124,13 +124,13 @@ class _OrderDetailsPageState extends State { List> listContent, double payPrice) { return InkWell( onTap: () { - RefundSelectPage( - bundle: Bundle() - ..putMap('details', { - 'listContent': listContent, - 'payPrice': payPrice, - }), - ).to; + Get.to(() => RefundSelectPage( + bundle: Bundle() + ..putMap('details', { + 'listContent': listContent, + 'payPrice': payPrice, + }), + )); }, child: Container( alignment: Alignment.center, diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index 1220c833..3b7a12d2 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:akuCommunity/base/assets_image.dart'; @@ -60,9 +61,9 @@ class _PersonalIndexState extends State padding: EdgeInsets.all(5.w), onPressed: () { if (!userProvider.isLogin) - SignInPage().to(); + Get.to(() => SignInPage()); else - UserProfilePage().to(); + Get.to(() => UserProfilePage()); }, child: Container( margin: EdgeInsets.only(left: 32.w), @@ -162,7 +163,7 @@ class _PersonalIndexState extends State ? SizedBox() : InkWell( onTap: () { - OrderPage().to; + Get.to(() => OrderPage()); }, child: Row( mainAxisAlignment: MainAxisAlignment.start, diff --git a/lib/pages/personal/refund_select_page.dart b/lib/pages/personal/refund_select_page.dart index 3048e247..cb15f906 100644 --- a/lib/pages/personal/refund_select_page.dart +++ b/lib/pages/personal/refund_select_page.dart @@ -41,14 +41,14 @@ class _RefundSelectPageState extends State { 'title': '我要退款', 'subtitle': '没有收到货,与物业协商直接退货', 'fun': () { - RefundApplyPage( - bundle: Bundle() - ..putMap('details', { - 'listContent': widget.bundle.getMap('details')['listContent'], - 'payPrice': widget.bundle.getMap('details')['payPrice'], - 'isRefundGood': false - }), - ).to; + // RefundApplyPage( + // bundle: Bundle() + // ..putMap('details', { + // 'listContent': widget.bundle.getMap('details')['listContent'], + // 'payPrice': widget.bundle.getMap('details')['payPrice'], + // 'isRefundGood': false + // }), + // ); }, 'isRight': true }, @@ -56,14 +56,14 @@ class _RefundSelectPageState extends State { 'title': '我要退款退货', 'subtitle': '已收到货,需要退还货物', 'fun': () { - RefundApplyPage( - bundle: Bundle() - ..putMap('details', { - 'listContent': widget.bundle.getMap('details')['listContent'], - 'payPrice': widget.bundle.getMap('details')['payPrice'], - 'isRefundGood': true - }), - ).to; + // RefundApplyPage( + // bundle: Bundle() + // ..putMap('details', { + // 'listContent': widget.bundle.getMap('details')['listContent'], + // 'payPrice': widget.bundle.getMap('details')['payPrice'], + // 'isRefundGood': true + // }), + // ); }, 'isRight': true } diff --git a/lib/pages/personal/user_profile_page.dart b/lib/pages/personal/user_profile_page.dart index 7c4b7d69..2df4d13a 100644 --- a/lib/pages/personal/user_profile_page.dart +++ b/lib/pages/personal/user_profile_page.dart @@ -114,14 +114,14 @@ class _UserProfilePageState extends State { '昵称', (userProvider.userInfoModel?.nickName ?? '').text.make(), onPressed: () { - ChangeNickName().to(); + Get.to(() => ChangeNickName()); }, ), _buildTile( '手机号', TextUtil.hideNumber(userProvider.userInfoModel.tel).text.make(), onPressed: () { - UpdateTelPage().to(); + Get.to(() => UpdateTelPage()); }, ), _buildTile( diff --git a/lib/pages/personal/widget/order_card.dart b/lib/pages/personal/widget/order_card.dart index 4ec13da2..3adca2a9 100644 --- a/lib/pages/personal/widget/order_card.dart +++ b/lib/pages/personal/widget/order_card.dart @@ -176,20 +176,20 @@ class _OrderCardState extends State { } return InkWell( onTap: () { - switch (buttonName) { - case '评价': - EvaluateGoodPage( - bundle: Bundle() - ..putMap('details', { - 'listContent': widget.listContent, - }), - ).to; - break; - case '查看物流': - LookLogisticsPage().to; - break; - default: - } + // switch (buttonName) { + // case '评价': + // EvaluateGoodPage( + // bundle: Bundle() + // ..putMap('details', { + // 'listContent': widget.listContent, + // }), + // ).to; + // break; + // case '查看物流': + // LookLogisticsPage().to; + // break; + // default: + // } }, child: Container( margin: EdgeInsets.only(left: 16.w), @@ -230,17 +230,17 @@ class _OrderCardState extends State { Widget build(BuildContext context) { return InkWell( onTap: () { - OrderDetailsPage( - bundle: Bundle() - ..putMap('details', { - 'status': widget.status, - 'listContent': widget.listContent, - 'totalPrice': widget.totalPrice, - 'payPrice': widget.payPrice, - 'listButton': widget.listButton, - 'listOrderDetail': widget.listOrderDetail, - }), - ).to; + // OrderDetailsPage( + // bundle: Bundle() + // ..putMap('details', { + // 'status': widget.status, + // 'listContent': widget.listContent, + // 'totalPrice': widget.totalPrice, + // 'payPrice': widget.payPrice, + // 'listButton': widget.listButton, + // 'listOrderDetail': widget.listOrderDetail, + // }), + // ).to; }, child: Container( decoration: BoxDecoration( diff --git a/lib/pages/setting_page/settings_page.dart b/lib/pages/setting_page/settings_page.dart index 3c5a581d..17957a5a 100644 --- a/lib/pages/setting_page/settings_page.dart +++ b/lib/pages/setting_page/settings_page.dart @@ -8,7 +8,6 @@ import 'package:velocity_x/velocity_x.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/extensions/num_ext.dart'; -import 'package:akuCommunity/extensions/page_router.dart'; import 'package:akuCommunity/extensions/widget_list_ext.dart'; import 'package:akuCommunity/pages/setting_page/about_page/about_page.dart'; import 'package:akuCommunity/pages/setting_page/account_manager_page.dart'; @@ -81,7 +80,7 @@ class _SettingsPageState extends State { ), onPressed: () { userProvider.logout(); - Get.offAll(()=>TabNavigator()); + Get.offAll(() => TabNavigator()); }, ), ], @@ -116,7 +115,7 @@ class _SettingsPageState extends State { // ), _buildTile( title: '关于小蜜蜂智慧社区', - onTap: () => AboutPage().to(), + onTap: () => Get.to(() => AboutPage()), ), //TODO 邀请注册 // _buildTile( @@ -139,19 +138,19 @@ class _SettingsPageState extends State { ), _buildTile( title: '意见反馈', - onTap: FeedBackPage().to, + onTap: () => Get.to(() => FeedBackPage()), ), _buildTile( title: '账号管理', - onTap: AccountManagerPage().to, + onTap: () => Get.to(() => AccountManagerPage()), ), _buildTile( title: '小蜜蜂用户协议', - onTap: AgreementPage().to, + onTap: () => Get.to(() => AgreementPage()), ), _buildTile( title: '小蜜蜂隐私政策', - onTap: PrivacyPage().to, + onTap: () => Get.to(() => PrivacyPage()), ), ].sepWidget( separate: Divider( diff --git a/lib/pages/sign/sign_in_page.dart b/lib/pages/sign/sign_in_page.dart index b4316450..951ccb56 100644 --- a/lib/pages/sign/sign_in_page.dart +++ b/lib/pages/sign/sign_in_page.dart @@ -271,7 +271,7 @@ class _SignInPageState extends State { FlatButton( shape: StadiumBorder(), padding: EdgeInsets.zero, - onPressed: AgreementPage().to, + onPressed: () => Get.to(AgreementPage()), child: Text( '《小蜜蜂用户协议》', style: TextStyle( @@ -282,7 +282,7 @@ class _SignInPageState extends State { FlatButton( shape: StadiumBorder(), padding: EdgeInsets.zero, - onPressed: PrivacyPage().to, + onPressed: () => Get.to(() => PrivacyPage()), child: Text( '《小蜜蜂隐私政策》', style: TextStyle( diff --git a/lib/pages/sign/sign_up/sign_up_pick_plot_page.dart b/lib/pages/sign/sign_up/sign_up_pick_plot_page.dart index 34b72ee3..46de4bfa 100644 --- a/lib/pages/sign/sign_up/sign_up_pick_plot_page.dart +++ b/lib/pages/sign/sign_up/sign_up_pick_plot_page.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; -import 'package:akuCommunity/extensions/page_router.dart'; import 'package:akuCommunity/pages/sign/sign_up/sign_up_pick_building_page.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; @@ -22,7 +22,7 @@ class _SignUpPickPlotPageState extends State { children: [ ListTile( title: '五象新区人才公寓'.text.make(), - onTap: SignUpPickBuildingPage().to, + onTap: () => Get.to(SignUpPickBuildingPage()), ).material(color: Colors.white), ], ), diff --git a/lib/pages/things_page/fixed_submit_page.dart b/lib/pages/things_page/fixed_submit_page.dart index 7c54fbf3..708ce688 100644 --- a/lib/pages/things_page/fixed_submit_page.dart +++ b/lib/pages/things_page/fixed_submit_page.dart @@ -10,7 +10,7 @@ import 'package:velocity_x/velocity_x.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/constants/api.dart'; import 'package:akuCommunity/extensions/num_ext.dart'; -import 'package:akuCommunity/extensions/page_router.dart'; + import 'package:akuCommunity/model/user/fixed_submit_model.dart'; import 'package:akuCommunity/pages/manager_func.dart'; import 'package:akuCommunity/pages/things_page/widget/add_fixed_submit_page.dart'; @@ -87,7 +87,7 @@ class _FixedSubmitPageState extends State { curve: Curves.easeInOutCubic, child: GestureDetector( onTap: () { - FixedDetailPage(model.id).to(); + Get.to(() => FixedDetailPage(model.id)); }, child: Container( width: 686.w, diff --git a/lib/pages/things_page/things_detail_page/things_detail_page.dart b/lib/pages/things_page/things_detail_page/things_detail_page.dart deleted file mode 100644 index 8f7db2b0..00000000 --- a/lib/pages/things_page/things_detail_page/things_detail_page.dart +++ /dev/null @@ -1,182 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:velocity_x/velocity_x.dart'; - -import 'package:akuCommunity/pages/things_page/things_evaluate_page/things_evaluate_page.dart'; -import 'package:akuCommunity/routers/page_routers.dart'; -import 'package:akuCommunity/utils/headers.dart'; -import 'package:akuCommunity/widget/bee_scaffold.dart'; -import 'package:akuCommunity/widget/expandable_text.dart'; -import 'package:akuCommunity/widget/views/horizontal_image_view.dart'; -import 'widget/goods_info_card.dart'; - -class ThingsDetailPage extends StatefulWidget { - final Bundle bundle; - ThingsDetailPage({Key key, this.bundle}) : super(key: key); - - @override - _ThingsDetailPageState createState() => _ThingsDetailPageState(); -} - -class _ThingsDetailPageState extends State { - void againRouter() { - ThingsEvaluatePage( - bundle: Bundle()..putMap('details', {'title': '继续提问', 'isShow': false}), - ).to; - } - - Widget _containerCard( - String tag, String content, String time, List imageList) { - return Container( - padding: EdgeInsets.only( - top: 46.w, - left: 33.w, - right: 44.w, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - tag, - style: TextStyle( - fontSize: 38.sp, - color: Color(0xff333333), - ), - ), - SizedBox(height: 30.w), - ExpandableText( - text: content, - maxLines: 2, - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff666666), - ), - expand: false, - ), - SizedBox(height: 29.w), - imageList.length != 0 ? HorizontalImageView(imageList) : SizedBox(), - SizedBox(height: 24.w), - Text( - time, - style: TextStyle( - fontSize: 24.sp, - color: Color(0xff999999), - ), - ), - ], - ), - ); - } - - Widget _positionedButton() { - return Positioned( - bottom: 0, - child: InkWell( - onTap: () { - switch (widget.bundle.getMap('things')['isRepair']) { - case true: - break; - case false: - againRouter(); - break; - default: - } - }, - child: Container( - alignment: Alignment.center, - height: 98.w, - width: 750.w, - padding: EdgeInsets.symmetric(vertical: 26.5.w), - color: Color(0xffffc40c), - child: Text( - widget.bundle.getMap('things')['isRepair'] ? '确认完成' : '继续提问', - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 32.sp, - color: Color(0xff333333), - ), - ), - ), - ), - ); - } - - @override - Widget build(BuildContext context) { - return BeeScaffold( - title: '查看详情', - actions: [ - widget.bundle.getMap('things')['isRepair'] - ? SizedBox() - : InkWell( - onTap: () {}, - child: Container( - padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w), - child: '评价'.text.black.size(28.sp).make(), - alignment: Alignment.center, - ), - ) - ], - body: Container( - color: Colors.white, - child: Stack( - children: [ - widget.bundle.getMap('things')['isRepair'] - ? ListView( - padding: EdgeInsets.only(bottom: 108.w), - children: [ - GoodsInfoCard( - status: widget.bundle.getMap('things')['time'], - listImage: widget.bundle.getMap('things')['imageList'], - infodetails: widget.bundle.getMap('things')['content'], - isShow: false, - ), - GoodsInfoCard( - status: widget.bundle.getMap('things')['time'], - detoInfoList: [ - {'title': '订单编号', 'content': 'LC20200630064682'}, - {'title': '下单时间', 'content': '2020-06-30 22:54:30'}, - {'title': '派单类型', 'content': '无偿服务'}, - {'title': '维修人员', 'content': '王珂'}, - {'title': '分配人', 'content': '马泽鹏'}, - ], - isShow: false, - ), - GoodsInfoCard( - status: widget.bundle.getMap('things')['time'], - detoInfoList: [ - {'title': '报修时间', 'content': '2020-06-30 10:23'}, - {'title': '管家分派', 'content': '2020-06-30 13:54'}, - {'title': '师傅接单', 'content': '2020-06-30 14:30'}, - {'title': '回访', 'content': '2020-06-31 12:30'}, - ], - isShow: true, - ), - ], - ) - : ListView( - padding: EdgeInsets.only(bottom: 108.w), - children: [ - _containerCard( - '您的建议', - widget.bundle.getMap('things')['content'], - widget.bundle.getMap('things')['time'], - widget.bundle.getMap('things')['imageList'], - ), - SizedBox(height: 3.w), - _containerCard( - '物业回复', - widget.bundle.getMap('things')['content'], - widget.bundle.getMap('things')['time'], - [], - ), - ], - ), - _positionedButton(), - ], - ), - ), - ); - } -} diff --git a/lib/pages/things_page/things_detail_page/widget/goods_info_card.dart b/lib/pages/things_page/things_detail_page/widget/goods_info_card.dart deleted file mode 100644 index fc6bf612..00000000 --- a/lib/pages/things_page/things_detail_page/widget/goods_info_card.dart +++ /dev/null @@ -1,157 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:akuCommunity/utils/headers.dart'; -import 'goods_info_card_button.dart'; -import 'image_horizontal_list.dart'; - -class GoodsInfoCard extends StatelessWidget { - final List listImage; - final String status, infodetails; - final List> detoInfoList; - final bool isShow; - GoodsInfoCard( - {Key key, - this.listImage, - this.status, - this.detoInfoList, - this.isShow, - this.infodetails}) - : super(key: key); - - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only( - top: 32.w, - left: 32.w, - right: 32.w, - ), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(6)), - ), - child: Column( - children: [ - Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(6), - topRight: Radius.circular(6), - ), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.2), - offset: Offset(1.1, 1.1), - blurRadius: 10.0), - ], - ), - padding: EdgeInsets.only(top: 25.w, left: 24.w, right: 24.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(bottom: 24.w), - decoration: BoxDecoration( - border: Border( - bottom: - BorderSide(color: Color(0xffeeeeee), width: 0.5)), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '出户信息', - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 32.sp, - color: Color(0xff333333)), - ), - Text(status, - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 28.sp, - color: Color(0xff333333))), - ], - ), - ), - Container( - padding: EdgeInsets.only( - bottom: 33.w, - top: 16.w, - ), - decoration: BoxDecoration( - border: Border( - bottom: - BorderSide(color: Color(0xffeeeeee), width: 0.5)), - ), - child: infodetails != null - ? Container( - width: 630.w, - child: Text( - infodetails, - style: TextStyle( - fontSize: 28.sp, color: Color(0xff333333)), - ), - ) - : Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: detoInfoList - .map( - (item) => Container( - padding: EdgeInsets.only(top: 8.w), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - item['title'], - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff999999)), - ), - Text( - item['content'], - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff333333)), - ), - ], - ), - ), - ) - .toList(), - ), - ), - listImage != null - ? Container( - margin: EdgeInsets.only( - top: 19.w, - bottom: 30.w, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(bottom: 25.w), - child: Text( - '图片信息', - style: TextStyle( - fontSize: 28.sp, color: Color(0xff333333)), - ), - ), - ImageHorizontalList(imageUrl: listImage), - ], - ), - ) - : SizedBox(), - ], - ), - ), - isShow ? GoodsInfoCardButton() : SizedBox() - ], - ), - ); - } -} diff --git a/lib/pages/things_page/things_detail_page/widget/goods_info_card_button.dart b/lib/pages/things_page/things_detail_page/widget/goods_info_card_button.dart deleted file mode 100644 index 85948826..00000000 --- a/lib/pages/things_page/things_detail_page/widget/goods_info_card_button.dart +++ /dev/null @@ -1,140 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:flutter_icons/flutter_icons.dart'; -import 'package:get/get.dart'; -import 'package:url_launcher/url_launcher.dart'; - -import 'package:akuCommunity/pages/goods_deto_page/deto_code_page/deto_code_page.dart'; -import 'package:akuCommunity/utils/headers.dart'; - -class GoodsInfoCardButton extends StatelessWidget { - GoodsInfoCardButton({Key key}) : super(key: key); - - final List> _listButton = [ - {'title': '查看二维码', 'icon': MaterialCommunityIcons.qrcode}, - {'title': '搬家公司', 'icon': SimpleLineIcons.phone} - ]; - Future _phoneCall(String url) async { - if (await canLaunch(url)) { - await launch(url); - } else { - throw 'Could not launch $url'; - } - } - - void _showDialog(BuildContext context, String url) { - showCupertinoDialog( - context: context, - builder: (context) { - return CupertinoAlertDialog( - title: Text( - url, - style: TextStyle( - fontSize: 34.sp, - color: Color(0xff030303), - ), - ), - actions: [ - CupertinoDialogAction( - child: Text( - '取消', - style: TextStyle( - fontSize: 34.sp, - color: Color(0xff333333), - ), - ), - onPressed: () { - Get.back(); - }, - ), - CupertinoDialogAction( - child: Text( - '呼叫', - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 34.sp, - color: Color(0xffff8200), - ), - ), - onPressed: () { - _phoneCall('tel:$url'); - Get.back(); - }, - ), - ], - ); - }, - ); - } - - @override - Widget build(BuildContext context) { - return Container( - decoration: BoxDecoration( - color: Colors.white.withOpacity(0.6), - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(6), - bottomRight: Radius.circular(6), - ), - ), - height: 96.w, - child: Row( - children: _listButton - .asMap() - .keys - .map((index) => Expanded( - child: InkWell( - onTap: () { - switch (_listButton[index]['title']) { - case '查看二维码': - DetoCodePage().to; - break; - case '搬家公司': - _showDialog(context, '0574-88467897'); - break; - default: - } - }, - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.symmetric( - vertical: 26.5.w, - ), - decoration: BoxDecoration( - border: Border( - right: BorderSide( - color: Color(0xffeeeeee), - width: index == _listButton.length - 1 ? 0 : 0.5), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Icon( - _listButton[index]['icon'], - size: 36.sp, - color: Color(0xff333333), - ), - Container( - margin: EdgeInsets.only(left: 14.w), - child: Text( - _listButton[index]['title'], - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 32.sp, - color: Color(0xff333333), - ), - ), - ), - ], - ), - ), - ), - )) - .toList(), - ), - ); - } -} diff --git a/lib/pages/things_page/things_detail_page/widget/image_horizontal_list.dart b/lib/pages/things_page/things_detail_page/widget/image_horizontal_list.dart deleted file mode 100644 index 16c9cee1..00000000 --- a/lib/pages/things_page/things_detail_page/widget/image_horizontal_list.dart +++ /dev/null @@ -1,64 +0,0 @@ -import 'dart:math'; - -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:akuCommunity/utils/fade_route.dart'; -import 'package:akuCommunity/utils/headers.dart'; -import 'package:akuCommunity/widget/gallery_photo_view_wrapper.dart'; - -class ImageHorizontalList extends StatelessWidget { - final List imageUrl; - ImageHorizontalList({Key key, this.imageUrl}) : super(key: key); - - final Random _random = new Random(); - int next(int min, int max) => min + _random.nextInt(max - min); - List imageModel() { - List imgList = List(); - for (int x = 0; x < imageUrl.length; x++) { - GalleryExampleItem item = GalleryExampleItem(); - item.id = '${next(x + 100, x + 1000)}'; - item.resource = imageUrl[x]; - imgList.add(item); - } - - return imgList; - } - - @override - Widget build(BuildContext context) { - return Container( - height: 184.w, - child: ListView.builder( - shrinkWrap: true, - scrollDirection: Axis.horizontal, - itemBuilder: (BuildContext context, int index) { - return AspectRatio( - aspectRatio: 1, - child: Container( - margin: EdgeInsets.only(right: 16.w), - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(4)), - child: GalleryExampleItemThumbnail( - galleryExampleItem: imageModel()[index], - onTap: () { - Navigator.of(context).push(new FadeRoute( - page: GalleryPhotoViewWrapper( - galleryItems: imageModel(), - backgroundDecoration: const BoxDecoration( - color: Colors.black, - ), - initialIndex: index, - ), - )); - }, - ), - ), - ), - ); - }, - itemCount: imageUrl.length, - ), - ); - } -} diff --git a/lib/pages/things_page/widget/add_fixed_submit_page.dart b/lib/pages/things_page/widget/add_fixed_submit_page.dart index 25019693..91e66f16 100644 --- a/lib/pages/things_page/widget/add_fixed_submit_page.dart +++ b/lib/pages/things_page/widget/add_fixed_submit_page.dart @@ -16,7 +16,7 @@ import 'package:velocity_x/velocity_x.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/const/resource.dart'; import 'package:akuCommunity/constants/api.dart'; -import 'package:akuCommunity/extensions/page_router.dart'; + import 'package:akuCommunity/extensions/widget_list_ext.dart'; import 'package:akuCommunity/pages/life_pay/widget/my_house_page.dart'; import 'package:akuCommunity/pages/manager_func.dart'; diff --git a/lib/pages/things_page/widget/things_card.dart b/lib/pages/things_page/widget/things_card.dart deleted file mode 100644 index 0fa1e2f0..00000000 --- a/lib/pages/things_page/widget/things_card.dart +++ /dev/null @@ -1,112 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:akuCommunity/pages/things_page/things_detail_page/things_detail_page.dart'; -import 'package:akuCommunity/routers/page_routers.dart'; -import 'package:akuCommunity/utils/headers.dart'; -import 'package:akuCommunity/widget/expandable_text.dart'; -import 'package:akuCommunity/widget/views/horizontal_image_view.dart'; - -class ThingsCard extends StatefulWidget { - final String time, tag, content; - final List imageList; - final bool isRepair; - ThingsCard( - {this.time, - this.tag, - this.content, - this.imageList, - this.isRepair, - Key key}) - : super(key: key); - - @override - _ThingsCardState createState() => _ThingsCardState(); -} - -class _ThingsCardState extends State { - void detailRouter() { - ThingsDetailPage( - bundle: Bundle() - ..putMap('things', { - 'isRepair': widget.isRepair, - 'content': widget.content, - 'time': widget.time, - 'imageList': widget.imageList, - }), - ).to; - } - - InkWell _inkWellPropose( - String time, String tag, String content, List imageList) { - return InkWell( - onTap: detailRouter, - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - time, - style: TextStyle( - fontSize: 32.sp, - color: Color(0xff333333), - ), - ), - Text( - tag, - style: TextStyle( - fontSize: 24.sp, - color: Color(0xffff8200), - ), - ), - ], - ), - SizedBox(height: 24.w), - Divider(height: 0.5), - SizedBox(height: 24.w), - ExpandableText( - text: content, - maxLines: 2, - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff333333), - ), - expand: false, - ), - SizedBox(height: 29.w), - imageList.length != 0 ? HorizontalImageView(imageList) : SizedBox() - ], - ), - ), - ); - } - - @override - Widget build(BuildContext context) { - return Container( - decoration: BoxDecoration( - color: Color(0xffffffff), - borderRadius: BorderRadius.all(Radius.circular(8))), - margin: EdgeInsets.only( - left: 32.w, - right: 32.w, - top: 20.w, - ), - padding: EdgeInsets.only( - left: 28.w, - right: 28.w, - top: 21.w, - bottom: 24.w, - ), - child: _inkWellPropose( - widget.time, - widget.tag, - widget.content, - widget.imageList, - ), - ); - } -} diff --git a/lib/pages/things_page/widget/things_list.dart b/lib/pages/things_page/widget/things_list.dart deleted file mode 100644 index f076b836..00000000 --- a/lib/pages/things_page/widget/things_list.dart +++ /dev/null @@ -1,36 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:akuCommunity/utils/headers.dart'; -import 'things_card.dart'; - -class ThingsList extends StatefulWidget { - final List> listCard; - final bool isRepair; - ThingsList({Key key, this.listCard, this.isRepair}) : super(key: key); - - @override - _ThingsListState createState() => _ThingsListState(); -} - -class _ThingsListState extends State - with AutomaticKeepAliveClientMixin { - @override - bool get wantKeepAlive => true; - - @override - Widget build(BuildContext context) { - super.build(context); - return ListView.builder( - padding: EdgeInsets.only(bottom: 98.w), - itemBuilder: (context, index) => ThingsCard( - time: widget.listCard[index]['time'], - tag: widget.listCard[index]['tag'], - content: widget.listCard[index]['content'], - imageList: widget.listCard[index]['imageList'], - isRepair: widget.isRepair, - ), - itemCount: widget.listCard.length, - ); - } -} diff --git a/lib/pages/visitor_access_page/visitor_access_page.dart b/lib/pages/visitor_access_page/visitor_access_page.dart index 8ae3ae6a..5f423d40 100644 --- a/lib/pages/visitor_access_page/visitor_access_page.dart +++ b/lib/pages/visitor_access_page/visitor_access_page.dart @@ -288,7 +288,7 @@ class _VisitorAccessPageState extends State { MaterialButton( padding: EdgeInsets.symmetric(horizontal: 20.w), onPressed: () { - VisitorRecordPage().to(); + Get.to(() => VisitorRecordPage()); }, child: '访客记录'.text.black.size(28.sp).make(), ) diff --git a/lib/ui/community/activity/activity_card.dart b/lib/ui/community/activity/activity_card.dart index f3011b1b..352ce8f3 100644 --- a/lib/ui/community/activity/activity_card.dart +++ b/lib/ui/community/activity/activity_card.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flustars/flustars.dart'; +import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; import 'package:akuCommunity/const/resource.dart'; @@ -25,7 +26,7 @@ class ActivityCard extends StatelessWidget { clipBehavior: Clip.antiAlias, color: Colors.white, padding: EdgeInsets.zero, - onPressed: ActivityDetailPage(id: model.id).to, + onPressed: () => Get.to(() => ActivityDetailPage(id: model.id)), elevation: 0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.w), @@ -87,7 +88,11 @@ class ActivityCard extends StatelessWidget { height: 44.w, minWidth: 120.w, disabledColor: Color(0xFFABABAB), - onPressed: outdate ? null : ActivityDetailPage(id: model.id).to, + onPressed: outdate + ? null + : () { + Get.to(() => ActivityDetailPage(id: model.id)); + }, child: outdate ? '已结束'.text.size(20.sp).bold.make() : '去看看'.text.size(20.sp).bold.make(), diff --git a/lib/ui/community/community_views/community_page.dart b/lib/ui/community/community_views/community_page.dart index 8e62c380..4b3de518 100644 --- a/lib/ui/community/community_views/community_page.dart +++ b/lib/ui/community/community_views/community_page.dart @@ -59,7 +59,7 @@ class _CommunityPageState extends State ColumnActionButton( onPressed: () { if (LoginUtil.isNotLogin) return; - MessageCenter().to(); + Get.to(() => MessageCenter()); }, title: '消息', path: R.ASSETS_ICONS_ALARM_PNG, diff --git a/lib/ui/home/home_notification.dart b/lib/ui/home/home_notification.dart index 40c961ea..731cd930 100644 --- a/lib/ui/home/home_notification.dart +++ b/lib/ui/home/home_notification.dart @@ -75,7 +75,7 @@ class _HomeNotificationState extends State { shape: StadiumBorder(), padding: EdgeInsets.symmetric(horizontal: 12.w), onPressed: () { - NoticePage().to(); + Get.to(() => NoticePage()); }, child: Row( children: [ diff --git a/lib/ui/manager/advice/advice_card.dart b/lib/ui/manager/advice/advice_card.dart index 37d3f443..9ff342b6 100644 --- a/lib/ui/manager/advice/advice_card.dart +++ b/lib/ui/manager/advice/advice_card.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flustars/flustars.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart'; +import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; import 'package:akuCommunity/base/base_style.dart'; @@ -53,7 +54,7 @@ class _AdviceCardState extends State { elevation: 0, padding: EdgeInsets.zero, color: Colors.white, - onPressed: AdviceDetailPage(model: widget.model).to, + onPressed: () => Get.to(() => AdviceDetailPage(model: widget.model)), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.w), ), diff --git a/lib/ui/manager/advice/advice_detail_page.dart b/lib/ui/manager/advice/advice_detail_page.dart index af99263c..e4ef07c9 100644 --- a/lib/ui/manager/advice/advice_detail_page.dart +++ b/lib/ui/manager/advice/advice_detail_page.dart @@ -163,7 +163,8 @@ class _AdviceDetailPageState extends State { title: '查看详情', actions: [ FlatButton( - onPressed: AdviceEvaluatePage(id: widget.model.id).to, + onPressed: () => + Get.to(() => AdviceEvaluatePage(id: widget.model.id)), child: '评价'.text.make(), ), ], diff --git a/lib/ui/manager/questionnaire/questionnaire_detail_page.dart b/lib/ui/manager/questionnaire/questionnaire_detail_page.dart index 17f5850e..56a22c4e 100644 --- a/lib/ui/manager/questionnaire/questionnaire_detail_page.dart +++ b/lib/ui/manager/questionnaire/questionnaire_detail_page.dart @@ -254,10 +254,10 @@ class _QuestionnaireDetailPageState extends State { onPressed: () async { BaseModel baseModel = await ManagerFunc.questionnaireSubmit(widget.id, _submitModels); - SubmitComplishPage( - status: baseModel.status, - message: baseModel.message, - ).to(); + Get.to(() => SubmitComplishPage( + status: baseModel.status, + message: baseModel.message, + )); }, ), ); diff --git a/lib/ui/manager/questionnaire/questionnaire_page.dart b/lib/ui/manager/questionnaire/questionnaire_page.dart index 66c0ba4c..9f1be0d6 100644 --- a/lib/ui/manager/questionnaire/questionnaire_page.dart +++ b/lib/ui/manager/questionnaire/questionnaire_page.dart @@ -11,6 +11,7 @@ import 'package:akuCommunity/ui/manager/questionnaire/questionnaire_detail_page. import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/others/stack_avatar.dart'; +import 'package:get/get.dart'; class QuestionnairePage extends StatefulWidget { QuestionnairePage({Key key}) : super(key: key); @@ -43,9 +44,9 @@ class _QuestionnairePageState extends State { Widget _buildCard(QuestionnaireModel model) { return GestureDetector( onTap: () { - QuestionnaireDetailPage( - id: model.id, - ).to(); + Get.to(() => QuestionnaireDetailPage( + id: model.id, + )); }, child: Container( decoration: BoxDecoration( @@ -126,9 +127,9 @@ class _QuestionnairePageState extends State { // EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.w), elevation: 0, onPressed: () { - QuestionnaireDetailPage( - id: model.id, - ).to(); + Get.to(() => QuestionnaireDetailPage( + id: model.id, + )); }, child: (_getButtonText(model.status)) .text diff --git a/lib/ui/manager/visitor/visitor_list_item.dart b/lib/ui/manager/visitor/visitor_list_item.dart index 78b227fb..c398f701 100644 --- a/lib/ui/manager/visitor/visitor_list_item.dart +++ b/lib/ui/manager/visitor/visitor_list_item.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flustars/flustars.dart'; +import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; import 'package:akuCommunity/model/manager/visitor_list_item_model.dart'; @@ -58,7 +59,7 @@ class _VisitorListItemState extends State { return MaterialButton( onPressed: () { if (!outDate) { - VisitorPassportPage(model: widget.model).to(); + Get.to(() => VisitorPassportPage(model: widget.model)); } }, color: Colors.white, diff --git a/lib/utils/headers.dart b/lib/utils/headers.dart index 9ff83659..5ccd4463 100644 --- a/lib/utils/headers.dart +++ b/lib/utils/headers.dart @@ -1,5 +1,4 @@ export 'package:flutter_screenutil/flutter_screenutil.dart'; -export 'package:akuCommunity/extensions/page_router.dart'; export 'package:akuCommunity/extensions/num_ext.dart'; export 'package:akuCommunity/extensions/widget_list_ext.dart'; export 'package:velocity_x/velocity_x.dart'; diff --git a/lib/widget/app_bar_action.dart b/lib/widget/app_bar_action.dart index 84b1a90a..93d54a0f 100644 --- a/lib/widget/app_bar_action.dart +++ b/lib/widget/app_bar_action.dart @@ -5,6 +5,7 @@ import 'package:akuCommunity/pages/market/market_cart_page/market_cart_page.dart import 'package:akuCommunity/pages/market_class/market_class_page.dart'; import 'package:akuCommunity/pages/message_center_page/message_center_page.dart'; import 'package:akuCommunity/utils/headers.dart'; +import 'package:get/get.dart'; class AppBarAction extends StatefulWidget { final IconData icon; @@ -43,13 +44,13 @@ class _AppBarActionState extends State { case '扫一扫': break; case '消息': - MessageCenterPage().to; + Get.to(() => MessageCenterPage()); break; case '购物车': - MarketCartPage().to; + Get.to(() => MarketCartPage()); break; case '分类': - MarketClassPage().to; + Get.to(() => MarketClassPage()); break; default: } diff --git a/lib/widget/goods_specs_sheet.dart b/lib/widget/goods_specs_sheet.dart index 59b6e7ed..5c92700e 100644 --- a/lib/widget/goods_specs_sheet.dart +++ b/lib/widget/goods_specs_sheet.dart @@ -286,16 +286,16 @@ class _GoodsSpecsSheetState extends State { widget.itempic); break; case '立即购买': - ConfirmOrderPage( - bundle: Bundle() - ..putMap('cartMap', { - 'itemid': widget.itemid, - 'itemtitle': widget.itemtitle, - 'itemprice': widget.itemprice, - 'itempic': widget.itempic, - 'count': count - }), - ).to; + Get.to(() => ConfirmOrderPage( + bundle: Bundle() + ..putMap('cartMap', { + 'itemid': widget.itemid, + 'itemtitle': widget.itemtitle, + 'itemprice': widget.itemprice, + 'itempic': widget.itempic, + 'count': count + }), + )); break; case '请选择规格': BotToast.showText(text: '已添加入购物车'); diff --git a/lib/widget/others/bee_header_house.dart b/lib/widget/others/bee_header_house.dart deleted file mode 100644 index dcc01103..00000000 --- a/lib/widget/others/bee_header_house.dart +++ /dev/null @@ -1,75 +0,0 @@ -import 'package:akuCommunity/constants/app_values.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; - -import 'package:akuCommunity/base/base_style.dart'; -import 'package:akuCommunity/pages/life_pay/widget/my_house_page.dart'; -import 'package:akuCommunity/provider/user_provider.dart'; -import 'package:akuCommunity/utils/headers.dart'; -import 'package:akuCommunity/widget/bee_divider.dart'; - -class BeeHeaderHouse extends StatefulWidget { - BeeHeaderHouse({Key key}) : super(key: key); - - @override - _BeeHeaderHouseState createState() => _BeeHeaderHouseState(); -} - -class _BeeHeaderHouseState extends State { - @override - Widget build(BuildContext context) { - UserProvider userProvider = Provider.of(context); - return Material( - color: Colors.transparent, - child: Padding( - padding: EdgeInsets.all(32.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - '当前房屋'.text.black.size(28.sp).make(), - 32.w.heightBox, - GestureDetector( - onTap: () { - MyHousePage( - needFindPayTag: true, - ).to(); - }, - child: Row( - children: [ - Image.asset( - R.ASSETS_ICONS_HOUSE_PNG, - width: 60.w, - height: 60.w, - ), - 40.w.widthBox, - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppValues.plotName.text.black.size(32.sp).bold.make(), - 10.w.heightBox, - userProvider.currentHouse.text.black - .size(32.sp) - .bold - .make() - ], - ), - ), - Icon( - CupertinoIcons.chevron_forward, - size: 40.w, - ), - ], - ).material(color: Colors.transparent), - ), - 24.w.heightBox, - BeeDivider.horizontal() - ], - ), - ), - ); - } -} diff --git a/lib/widget/sliver_goods_card.dart b/lib/widget/sliver_goods_card.dart index 21f641fd..0b0df255 100644 --- a/lib/widget/sliver_goods_card.dart +++ b/lib/widget/sliver_goods_card.dart @@ -26,7 +26,7 @@ class SliverGoodsCard extends StatelessWidget { bundle: Bundle() ..putString( 'shoplist', json.encode(shoplist[index]).toString()), - ).to; + ); }, child: Container( color: Colors.white, @@ -104,7 +104,7 @@ class SliverGoodsCard extends StatelessWidget { json .encode(shoplist[index]) .toString()), - ).to; + ); }, child: Container( width: 134.w,