diff --git a/lib/base/base_style.dart b/lib/base/base_style.dart index 0e20133b..a29e8d40 100644 --- a/lib/base/base_style.dart +++ b/lib/base/base_style.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; const ktextPrimary = Color(0xff333333); const ktextSubColor = Color(0xff666666); diff --git a/lib/extensions/page_router.dart b/lib/extensions/page_router.dart new file mode 100644 index 00000000..28943a29 --- /dev/null +++ b/lib/extensions/page_router.dart @@ -0,0 +1,7 @@ + +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +extension PageExt on Widget{ + Function get to => (){Get.to(this);}; +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index faee9920..0972f108 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,7 +20,6 @@ import 'package:akuCommunity/provider/cart.dart'; import 'package:flutter_picker/flutter_picker.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:akuCommunity/routers/router_init.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -44,7 +43,6 @@ class _MyAppState extends State { @override void initState() { super.initState(); - RouterInit.setupRouter(); registerWxApi(appId: 'wxd7bdef0d4849ddb8'); } @@ -57,16 +55,11 @@ class _MyAppState extends State { ], child: GetMaterialApp( title: '智慧社区', - // builder: BotToastInit(), - // navigatorObservers: [BotToastNavigatorObserver()], - navigatorKey: RouterInit.navigatorKey, - onGenerateRoute: RouterInit.router.generator, debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.yellow, visualDensity: VisualDensity.adaptivePlatformDensity, ), - // home: TabNavigator(), home: TabNavigator(), //国际化支持 localizationsDelegates: [ 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 5d3faf25..d95a9c3d 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 @@ -1,9 +1,11 @@ +import 'package:akuCommunity/pages/activities_page/member_list_page/member_list_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; +import 'package:get/get.dart'; import 'package:image_stack/image_stack.dart'; import 'package:flutter_html/flutter_html.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/widget/bottom_button.dart'; @@ -107,7 +109,7 @@ class _ActivitiesDetailsPageState extends State { ), ), onPressed: () { - Navigator.of(context).pop(); + Get.back(); }, ), CupertinoDialogAction( @@ -120,7 +122,7 @@ class _ActivitiesDetailsPageState extends State { ), ), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), ], @@ -215,7 +217,7 @@ class _ActivitiesDetailsPageState extends State { Widget _inkWellEnterMember(List memberList) { return InkWell( onTap: () { - Navigator.pushNamed(context, PageName.member_list_page.toString()); + Get.to(MemberListPage()); }, child: Container( padding: EdgeInsets.only(bottom: 24.w), diff --git a/lib/pages/activities_page/activities_page.dart b/lib/pages/activities_page/activities_page.dart index 1c70244c..fc5b24ae 100644 --- a/lib/pages/activities_page/activities_page.dart +++ b/lib/pages/activities_page/activities_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:get/get.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/activity_card.dart'; @@ -104,16 +105,17 @@ class _ActivitiesPageState extends State { void detailsRouter(String imagePath, title, bool isOver, isVote, isVoteOver, List memberList) { - Navigator.pushNamed(context, PageName.activities_details_page.toString(), - arguments: Bundle() - ..putMap('details', { - 'title': title, - 'imagePath': imagePath, - 'isOver': isOver, - 'isVote': isVote, - 'isVoteOver': isVoteOver, - 'memberList': memberList - })); + Get.to(ActivitiesPage( + bundle: Bundle() + ..putMap('details', { + 'title': title, + 'imagePath': imagePath, + 'isOver': isOver, + 'isVote': isVote, + 'isVoteOver': isVoteOver, + 'memberList': memberList + }), + )); } @override diff --git a/lib/pages/activities_page/member_list_page/member_list_page.dart b/lib/pages/activities_page/member_list_page/member_list_page.dart index 730674f7..9d50deaf 100644 --- a/lib/pages/activities_page/member_list_page/member_list_page.dart +++ b/lib/pages/activities_page/member_list_page/member_list_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; diff --git a/lib/pages/address_page/address_edit_page.dart b/lib/pages/address_page/address_edit_page.dart index 7ac93aff..132d0d2d 100644 --- a/lib/pages/address_page/address_edit_page.dart +++ b/lib/pages/address_page/address_edit_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'widget/address_edit_item.dart'; diff --git a/lib/pages/address_page/widget/address_edit_item.dart b/lib/pages/address_page/widget/address_edit_item.dart index f98171e1..29d9b2cf 100644 --- a/lib/pages/address_page/widget/address_edit_item.dart +++ b/lib/pages/address_page/widget/address_edit_item.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:flutter/services.dart'; class AddressEditItem extends StatefulWidget { diff --git a/lib/pages/address_page/widget/address_item.dart b/lib/pages/address_page/widget/address_item.dart index 1b6c9b23..e67de26c 100644 --- a/lib/pages/address_page/widget/address_item.dart +++ b/lib/pages/address_page/widget/address_item.dart @@ -1,9 +1,11 @@ +import 'package:akuCommunity/pages/address_page/address_edit_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:extended_text/extended_text.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; +import 'package:get/get.dart'; class AddressItem extends StatelessWidget { final String name, phone, address; @@ -67,8 +69,7 @@ class AddressItem extends StatelessWidget { isDefualt ? ExtendedWidgetSpan( child: Container( - margin: - EdgeInsets.only(right: 16.w), + margin: EdgeInsets.only(right: 16.w), decoration: BoxDecoration( color: Color(0xfffff7d2), border: Border.all( @@ -92,9 +93,7 @@ class AddressItem extends StatelessWidget { TextSpan( text: address, style: TextStyle( - fontSize: 24.sp, - color: Color(0xff999999), - height: 1.5), + fontSize: 24.sp, color: Color(0xff999999), height: 1.5), ) ], ), @@ -113,15 +112,18 @@ class AddressItem extends StatelessWidget { top: 55.w, child: InkWell( onTap: () { - Navigator.pushNamed(context, PageName.address_edit_page.toString(), - arguments: Bundle() + Get.to( + AddressEditPage( + bundle: Bundle() ..putMap('details', { 'title': '编辑地址', 'name': name, 'phone': phone, 'address': address, 'isDelete': true - })); + }), + ), + ); }, child: Row( children: [ diff --git a/lib/pages/certification_page/certification_page.dart b/lib/pages/certification_page/certification_page.dart index e70b24e0..561538b0 100644 --- a/lib/pages/certification_page/certification_page.dart +++ b/lib/pages/certification_page/certification_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:akuCommunity/base/assets_image.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_input.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'package:akuCommunity/widget/single_image_up.dart'; diff --git a/lib/pages/common/common_page.dart b/lib/pages/common/common_page.dart index 5cce5bba..1e607f9d 100644 --- a/lib/pages/common/common_page.dart +++ b/lib/pages/common/common_page.dart @@ -2,9 +2,10 @@ import 'package:akuCommunity/widget/search_bar_delegate.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/base/base_style.dart'; +import 'package:get/get.dart'; // import 'visitor_invitation/visitor_invitation.dart'; // import 'visitor_invitation/visitor_record.dart'; @@ -122,20 +123,23 @@ class _CommonPageState extends State { // } void recordRouter() { - Navigator.pushNamed(context, PageName.common_page.toString(), - arguments: Bundle() - ..putMap('commentMap', {'title': '访客记录', 'isActions': false})); + Get.to( + CommonPage( + bundle: Bundle() + ..putMap('commentMap', {'title': '访客记录', 'isActions': false})), + ); } void evaluateRouter(bool isAlone, bool isPropose) { - Navigator.pushNamed(context, PageName.common_page.toString(), - arguments: Bundle() - ..putMap('commentMap', { - 'title': '评价', - 'isActions': false, - 'isAlone': isAlone, - 'isPropose': isPropose - })); + Get.to(CommonPage( + bundle: Bundle() + ..putMap('commentMap', { + 'title': '评价', + 'isActions': false, + 'isAlone': isAlone, + 'isPropose': isPropose + }), + )); } InkWell _inkWellSearch() { @@ -174,7 +178,7 @@ class _CommonPageState extends State { elevation: 0, backgroundColor: Color(0xffffffff), leading: InkWell( - onTap: () => Navigator.pop(context), + onTap: () => Get.back(), child: Icon(AntDesign.left, size: 40.sp), ), centerTitle: true, @@ -214,28 +218,24 @@ class _CommonPageState extends State { ); break; case '生活缴费': - Navigator.pushNamed( - context, PageName.common_page.toString(), - arguments: Bundle() - ..putMap('commentMap', - {'title': '缴费记录', 'isActions': false})); + Get.to(CommonPage( + bundle: Bundle() + ..putMap('commentMap', + {'title': '缴费记录', 'isActions': false}), + )); break; case '借还管理': - Navigator.pushNamed( - context, PageName.common_page.toString(), - arguments: Bundle() + Get.to(CommonPage(bundle: Bundle() ..putMap('commentMap', - {'title': '我的借还物品', 'isActions': false})); + {'title': '我的借还物品', 'isActions': false}),)); break; case '我的地址': - Navigator.pushNamed( - context, PageName.common_page.toString(), - arguments: Bundle() + Get.to(CommonPage(bundle: Bundle() ..putMap('commentMap', { 'title': '添加新地址', 'isActions': true, 'isNew': true - })); + }),)); break; case '一键报警': // showExplain(); diff --git a/lib/pages/community/community_index.dart b/lib/pages/community/community_index.dart index 74b1d9c2..4ca92c30 100644 --- a/lib/pages/community/community_index.dart +++ b/lib/pages/community/community_index.dart @@ -1,9 +1,11 @@ +import 'package:akuCommunity/pages/community/note_create_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/app_bar_action.dart'; import 'package:akuCommunity/routers/page_routers.dart'; +import 'package:get/get.dart'; import 'widget/tab_list.dart'; class CommunityIndex extends StatefulWidget { @@ -38,10 +40,7 @@ class _CommunityIndexState extends State } void noteCreateRouter() { - Navigator.pushNamed( - context, - PageName.note_create_page.toString(), - ); + Get.to(NoteCreatePage()); } List _listActions() { diff --git a/lib/pages/community/note_create_page.dart b/lib/pages/community/note_create_page.dart index afc8991f..703b1e73 100644 --- a/lib/pages/community/note_create_page.dart +++ b/lib/pages/community/note_create_page.dart @@ -1,8 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:flutter_icons/flutter_icons.dart'; +import 'package:get/get.dart'; class NoteCreatePage extends StatefulWidget { NoteCreatePage({Key key}) : super(key: key); @@ -39,7 +40,7 @@ class _NoteCreatePageState extends State { ), ), leading: InkWell( - onTap: () => Navigator.pop(context), + onTap: () => Get.back(), child: Container( padding: EdgeInsets.only(left: 32.w), alignment: Alignment.center, diff --git a/lib/pages/community/topice_detail_page.dart b/lib/pages/community/topice_detail_page.dart index 8f2173c5..c8a9f064 100644 --- a/lib/pages/community/topice_detail_page.dart +++ b/lib/pages/community/topice_detail_page.dart @@ -1,8 +1,10 @@ +import 'package:akuCommunity/pages/community/note_create_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:get/get.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'widget/trend_card.dart'; @@ -23,13 +25,6 @@ class _TopiceDetailPageState extends State { void initState() { super.initState(); } - - void noteCreateRouter() { - Navigator.pushNamed( - context, - PageName.note_create_page.toString(), - ); - } void _onRefresh() async { await Future.delayed(Duration(milliseconds: 1500)); @@ -60,7 +55,7 @@ class _TopiceDetailPageState extends State { leading: IconButton( icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), flexibleSpace: FlexibleSpaceBar( @@ -73,19 +68,20 @@ class _TopiceDetailPageState extends State { ); } - Positioned _positionedFloatActionButton(){ + Positioned _positionedFloatActionButton() { return Positioned( - bottom: 124.w, - right: 32.w, - child: FloatingActionButton( - backgroundColor: Color(0xffffd000), - child: Icon( - Icons.add, - color: Colors.white, - size: 40.sp, - ), - onPressed: noteCreateRouter, - )); + bottom: 124.w, + right: 32.w, + child: FloatingActionButton( + backgroundColor: Color(0xffffd000), + child: Icon( + Icons.add, + color: Colors.white, + size: 40.sp, + ), + onPressed: () { + Get.to(NoteCreatePage()); + })); } @override diff --git a/lib/pages/community/widget/tab_list.dart b/lib/pages/community/widget/tab_list.dart index c191baf4..7cba4a63 100644 --- a/lib/pages/community/widget/tab_list.dart +++ b/lib/pages/community/widget/tab_list.dart @@ -1,4 +1,4 @@ -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; diff --git a/lib/pages/community/widget/topic_card.dart b/lib/pages/community/widget/topic_card.dart index 4e931713..4a8a58b3 100644 --- a/lib/pages/community/widget/topic_card.dart +++ b/lib/pages/community/widget/topic_card.dart @@ -1,8 +1,10 @@ +import 'package:akuCommunity/pages/community/topice_detail_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; +import 'package:get/get.dart'; class TopicCard extends StatefulWidget { final String title, subtitle, imagePath, hotNum; @@ -27,9 +29,7 @@ class _TopicCardState extends State { } void topiceDetailRouter(String subtitle, String imagePath) { - Navigator.pushNamed(context, PageName.topice_detail_page.toString(), - arguments: Bundle() - ..putMap('topicMap', {'subtitle': subtitle, 'imagePath': imagePath})); + Get.to(TopiceDetailPage()); } Row _rowTopic(String title, String subtitle, String imagePath) { diff --git a/lib/pages/community/widget/trend_card.dart b/lib/pages/community/widget/trend_card.dart index c599b103..5b1db585 100644 --- a/lib/pages/community/widget/trend_card.dart +++ b/lib/pages/community/widget/trend_card.dart @@ -3,10 +3,11 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/expandable_text.dart'; import 'package:akuCommunity/widget/image_grid.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; class TrendCard extends StatefulWidget { final String name; @@ -50,7 +51,7 @@ class _TrendCardState extends State { ), ), onPressed: () { - Navigator.of(context).pop(); + Get.back(); }, ), CupertinoDialogAction( @@ -63,7 +64,7 @@ class _TrendCardState extends State { ), ), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), ], @@ -94,7 +95,7 @@ class _TrendCardState extends State { itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { - Navigator.of(context).pop(); + Get.back(); _showDialog(nameItems[index]['title']); }, child: Container( @@ -136,7 +137,7 @@ class _TrendCardState extends State { bottom: 0, child: InkWell( onTap: () { - Navigator.of(context).pop(); + Get.back(); }, child: Container( width: MediaQuery.of(context).size.width, diff --git a/lib/pages/confirm_order_page/confirm_order_page.dart b/lib/pages/confirm_order_page/confirm_order_page.dart index a02a7fe5..60d06a50 100644 --- a/lib/pages/confirm_order_page/confirm_order_page.dart +++ b/lib/pages/confirm_order_page/confirm_order_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'widget/confirm_address.dart'; diff --git a/lib/pages/confirm_order_page/pay_order_page.dart b/lib/pages/confirm_order_page/pay_order_page.dart index 865c531f..890aa35d 100644 --- a/lib/pages/confirm_order_page/pay_order_page.dart +++ b/lib/pages/confirm_order_page/pay_order_page.dart @@ -1,8 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; +import 'package:get/get.dart'; import 'package:rflutter_alert/rflutter_alert.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; @@ -82,13 +83,12 @@ class PayOrderPage extends StatelessWidget { "确认", style: TextStyle(color: Colors.white, fontSize: 20), ), - onPressed: () => Navigator.pop(context), + onPressed: () => Get.back(), color: Color(0xffffc40d), radius: BorderRadius.circular(8.w), ), ], ).show(); - // Navigator.pushNamed(context, PageName.pay_success_page.toString()); }, child: Container( padding: EdgeInsets.only( diff --git a/lib/pages/confirm_order_page/widget/confirm_address.dart b/lib/pages/confirm_order_page/widget/confirm_address.dart index a8f69d92..2a38e60e 100644 --- a/lib/pages/confirm_order_page/widget/confirm_address.dart +++ b/lib/pages/confirm_order_page/widget/confirm_address.dart @@ -1,9 +1,11 @@ +import 'package:akuCommunity/pages/common/common_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/routers/page_routers.dart'; +import 'package:get/get.dart'; class ConfirmAddress extends StatefulWidget { ConfirmAddress({Key key}) : super(key: key); @@ -79,9 +81,10 @@ class _ConfirmAddressState extends State { Widget build(BuildContext context) { return InkWell( onTap: () { - Navigator.pushNamed(context, PageName.common_page.toString(), - arguments: Bundle() - ..putMap('commentMap', {'title': '我的地址', 'isActions': true})); + Get.to(CommonPage( + bundle: Bundle() + ..putMap('commentMap', {'title': '我的地址', 'isActions': true}), + )); }, child: Container( margin: EdgeInsets.symmetric(horizontal: 32.w), 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 bf201619..39149b98 100644 --- a/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart +++ b/lib/pages/confirm_order_page/widget/confirm_bottom_bar.dart @@ -1,8 +1,10 @@ +import 'package:akuCommunity/pages/confirm_order_page/pay_order_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/routers/page_routers.dart'; +import 'package:get/get.dart'; class ConfirmBottomBar extends StatelessWidget { final Map cartMap; @@ -34,8 +36,7 @@ class ConfirmBottomBar extends StatelessWidget { Widget _submit(BuildContext context) { return InkWell( onTap: () { - Navigator.pushNamed(context, PageName.pay_order_page.toString(), - arguments: Bundle()..putMap('cartMap', cartMap)); + Get.to(PayOrderPage()); }, child: Container( decoration: BoxDecoration( diff --git a/lib/pages/confirm_order_page/widget/confirm_content.dart b/lib/pages/confirm_order_page/widget/confirm_content.dart index 6b322735..f515ac60 100644 --- a/lib/pages/confirm_order_page/widget/confirm_content.dart +++ b/lib/pages/confirm_order_page/widget/confirm_content.dart @@ -1,10 +1,12 @@ +import 'package:akuCommunity/pages/invoice/invoice_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:akuCommunity/routers/page_routers.dart'; // import 'package:akuCommunity/widget/cart_count.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; +import 'package:get/get.dart'; class ConfirmContent extends StatelessWidget { final Map cartMap; @@ -160,15 +162,13 @@ class ConfirmContent extends StatelessWidget { Text( '配送方式', style: TextStyle( - fontSize: 28.sp, - color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), SizedBox(width: 26.w), Text( '普通配送', style: TextStyle( - fontSize: 28.sp, - color: Color(0xff999999)), + fontSize: 28.sp, color: Color(0xff999999)), ), ], ), @@ -183,15 +183,14 @@ class ConfirmContent extends StatelessWidget { Text( '开具发票', style: TextStyle( - fontSize: 28.sp, - color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), InkWell( onTap: () { - Navigator.pushNamed( - context, PageName.invoice_page.toString(), - arguments: Bundle() - ..putString('title', '1123123123123')); + Get.to(InvoicePage( + bundle: Bundle() + ..putString('title', '1123123123123'), + )); }, child: Row( children: [ @@ -230,15 +229,13 @@ class ConfirmContent extends StatelessWidget { Text( '订单备注', style: TextStyle( - fontSize: 28.sp, - color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), SizedBox(width: 14.w), Text( '选填', style: TextStyle( - fontSize: 28.sp, - color: Color(0xff999999)), + fontSize: 28.sp, color: Color(0xff999999)), ), ], ), diff --git a/lib/pages/convenient_phone/convenient_phone_page.dart b/lib/pages/convenient_phone/convenient_phone_page.dart index abf9c1be..4951da2b 100644 --- a/lib/pages/convenient_phone/convenient_phone_page.dart +++ b/lib/pages/convenient_phone/convenient_phone_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/sliver_app_bar_delegate.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'package:akuCommunity/widget/search_bar_delegate.dart'; diff --git a/lib/pages/convenient_phone/widget/phone_list.dart b/lib/pages/convenient_phone/widget/phone_list.dart index 22d078de..1505cf66 100644 --- a/lib/pages/convenient_phone/widget/phone_list.dart +++ b/lib/pages/convenient_phone/widget/phone_list.dart @@ -1,6 +1,7 @@ -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:get/get.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:akuCommunity/base/assets_image.dart'; @@ -64,7 +65,7 @@ class _PhoneListState extends State { ), ), onPressed: () { - Navigator.of(context).pop(); + Get.back(); }, ), CupertinoDialogAction( @@ -78,7 +79,7 @@ class _PhoneListState extends State { ), onPressed: () { _phoneCall('tel:$url'); - Navigator.pop(context); + Get.back(); }, ), ], diff --git a/lib/pages/fitup_manage/fitup_manage_page.dart b/lib/pages/fitup_manage/fitup_manage_page.dart index d874c090..2e35694d 100644 --- a/lib/pages/fitup_manage/fitup_manage_page.dart +++ b/lib/pages/fitup_manage/fitup_manage_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/sliver_app_bar_delegate.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; diff --git a/lib/pages/fitup_manage/widget/common_select.dart b/lib/pages/fitup_manage/widget/common_select.dart index 6d2b4dbd..8c8a9079 100644 --- a/lib/pages/fitup_manage/widget/common_select.dart +++ b/lib/pages/fitup_manage/widget/common_select.dart @@ -3,7 +3,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_picker/flutter_picker.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; class CommonSelect extends StatefulWidget { diff --git a/lib/pages/fitup_manage/widget/decorator_info.dart b/lib/pages/fitup_manage/widget/decorator_info.dart index 2c88c832..8ecf81c8 100644 --- a/lib/pages/fitup_manage/widget/decorator_info.dart +++ b/lib/pages/fitup_manage/widget/decorator_info.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/widget/common_input.dart'; diff --git a/lib/pages/fitup_manage/widget/director_manage.dart b/lib/pages/fitup_manage/widget/director_manage.dart index 52dae82c..c29ce21c 100644 --- a/lib/pages/fitup_manage/widget/director_manage.dart +++ b/lib/pages/fitup_manage/widget/director_manage.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/widget/common_input.dart'; diff --git a/lib/pages/fitup_manage/widget/house_info.dart b/lib/pages/fitup_manage/widget/house_info.dart index ef6568bf..892cb382 100644 --- a/lib/pages/fitup_manage/widget/house_info.dart +++ b/lib/pages/fitup_manage/widget/house_info.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/base/base_style.dart'; diff --git a/lib/pages/fitup_manage/widget/owner_manage.dart b/lib/pages/fitup_manage/widget/owner_manage.dart index ff8e9aae..4f96fd78 100644 --- a/lib/pages/fitup_manage/widget/owner_manage.dart +++ b/lib/pages/fitup_manage/widget/owner_manage.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/bottom_button.dart'; import 'package:akuCommunity/widget/common_input.dart'; diff --git a/lib/pages/fitup_manage/widget/pay_model_sheet.dart b/lib/pages/fitup_manage/widget/pay_model_sheet.dart index 784f9b48..17bc6ca8 100644 --- a/lib/pages/fitup_manage/widget/pay_model_sheet.dart +++ b/lib/pages/fitup_manage/widget/pay_model_sheet.dart @@ -1,10 +1,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/widget/bottom_button.dart'; +import 'package:get/get.dart'; class PayModelSheet extends StatefulWidget { PayModelSheet({Key key}) : super(key: key); @@ -77,7 +78,7 @@ class _PayModelSheetState extends State { color: BaseStyle.color999999, ), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), Container( @@ -118,7 +119,7 @@ class _PayModelSheetState extends State { }); _listPay[index]['isCheck'] = true; _currentindex = index; - Navigator.pop(context); + Get.back(); }); }, child: Container( diff --git a/lib/pages/goods_details/goods_details_page.dart b/lib/pages/goods_details/goods_details_page.dart index c6588f50..1eb77a5a 100644 --- a/lib/pages/goods_details/goods_details_page.dart +++ b/lib/pages/goods_details/goods_details_page.dart @@ -1,8 +1,10 @@ import 'dart:convert'; +import 'package:akuCommunity/pages/goods_details/view_comments_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:akuCommunity/routers/page_routers.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; +import 'package:get/get.dart'; import 'widget/goods_app_bar.dart'; import 'widget/product_swiper.dart'; import 'widget/product_content.dart'; @@ -55,10 +57,7 @@ class _GoodsDetailsPageState extends State { // ProductSpecs(), ProductEvaluate( fun: () { - Navigator.pushNamed( - context, - PageName.view_comments_page.toString(), - ); + Get.to(ViewCommentsPage()); }, ), ProductDetail( diff --git a/lib/pages/goods_details/view_comments_page.dart b/lib/pages/goods_details/view_comments_page.dart index 97f48086..024478ff 100644 --- a/lib/pages/goods_details/view_comments_page.dart +++ b/lib/pages/goods_details/view_comments_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'widget/goods_app_bar.dart'; import 'widget/goods_comments_card.dart'; diff --git a/lib/pages/goods_details/widget/goods_app_bar.dart b/lib/pages/goods_details/widget/goods_app_bar.dart index 04a3291e..a98f9168 100644 --- a/lib/pages/goods_details/widget/goods_app_bar.dart +++ b/lib/pages/goods_details/widget/goods_app_bar.dart @@ -1,10 +1,11 @@ -import 'package:akuCommunity/routers/page_routers.dart'; +import 'package:akuCommunity/pages/market/market_cart_page/market_cart_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:akuCommunity/base/base_style.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:fluwx/fluwx.dart'; +import 'package:get/get.dart'; class GoodsAppBar extends StatefulWidget { final String shareImg; @@ -25,7 +26,7 @@ class _GoodsAppBarState extends State { leading: IconButton( icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), title: Container( @@ -84,7 +85,7 @@ class _GoodsAppBarState extends State { color: Color(0xff666666), ), onPressed: () { - Navigator.pushNamed(context, PageName.market_cart_page.toString()); + Get.to(MarketCartPage()); }, ), ], diff --git a/lib/pages/goods_details/widget/goods_comments_card.dart b/lib/pages/goods_details/widget/goods_comments_card.dart index 760ecec9..58f359c6 100644 --- a/lib/pages/goods_details/widget/goods_comments_card.dart +++ b/lib/pages/goods_details/widget/goods_comments_card.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/widget/expandable_text.dart'; 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 03123733..8791d9cd 100644 --- a/lib/pages/goods_details/widget/goods_details_bottom_bar.dart +++ b/lib/pages/goods_details/widget/goods_details_bottom_bar.dart @@ -1,7 +1,9 @@ +import 'package:akuCommunity/pages/market/market_cart_page/market_cart_page.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; +import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:akuCommunity/provider/cart.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -110,8 +112,7 @@ class _GoodsDetailsBottomBarState extends State { ], ), onTap: () { - Navigator.pushNamed( - context, PageName.market_cart_page.toString()); + Get.to(MarketCartPage()); }, ), SizedBox(width: 53.w), diff --git a/lib/pages/goods_details/widget/product_detail.dart b/lib/pages/goods_details/widget/product_detail.dart index afb85198..c9ab060e 100644 --- a/lib/pages/goods_details/widget/product_detail.dart +++ b/lib/pages/goods_details/widget/product_detail.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; diff --git a/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart b/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart index 550be963..6048250b 100644 --- a/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart +++ b/lib/pages/goods_deto_page/deto_code_page/deto_code_page.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:qr_flutter/qr_flutter.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/dotted_line.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; 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 8fc341db..c317d9e3 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 @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/widget/common_image_picker.dart'; import 'package:akuCommunity/widget/bottom_button.dart'; diff --git a/lib/pages/goods_deto_page/deto_create_page/widget/common_picker.dart b/lib/pages/goods_deto_page/deto_create_page/widget/common_picker.dart index 72a3c9f7..85605c6a 100644 --- a/lib/pages/goods_deto_page/deto_create_page/widget/common_picker.dart +++ b/lib/pages/goods_deto_page/deto_create_page/widget/common_picker.dart @@ -3,7 +3,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_picker/flutter_picker.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; class CommonPicker extends StatefulWidget { final String title; diff --git a/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart b/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart index 9687a738..c1a84fda 100644 --- a/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart +++ b/lib/pages/goods_deto_page/deto_create_page/widget/common_radio.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:akuCommunity/base/base_style.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; class CommonRadio extends StatefulWidget { final List> commonlist; diff --git a/lib/pages/goods_deto_page/goods_deto_page.dart b/lib/pages/goods_deto_page/goods_deto_page.dart index 894b7374..06588e86 100644 --- a/lib/pages/goods_deto_page/goods_deto_page.dart +++ b/lib/pages/goods_deto_page/goods_deto_page.dart @@ -1,6 +1,8 @@ -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/deto_create_page.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:get/get.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/bottom_button.dart'; @@ -56,7 +58,6 @@ class _GoodsDetoPageState extends State { } ]; - RefreshController _refreshController = RefreshController(initialRefresh: false); @@ -78,9 +79,7 @@ class _GoodsDetoPageState extends State { _refreshController.loadComplete(); } - void createRouter() { - Navigator.pushNamed(context, PageName.deto_create_page.toString()); - } + @override void dispose() { @@ -131,7 +130,9 @@ class _GoodsDetoPageState extends State { bottom: 0, child: BottomButton( title: '新增', - fun: createRouter, + fun: () { + Get.to(DetoCreatePage()); + }, ), ), ], diff --git a/lib/pages/goods_deto_page/widget/goods_info_card.dart b/lib/pages/goods_deto_page/widget/goods_info_card.dart index 677d500d..d4aff041 100644 --- a/lib/pages/goods_deto_page/widget/goods_info_card.dart +++ b/lib/pages/goods_deto_page/widget/goods_info_card.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'image_horizontal_list.dart'; import 'goods_info_card_button.dart'; 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 63ec5f02..d3c816a1 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 @@ -1,10 +1,11 @@ +import 'package:akuCommunity/pages/goods_deto_page/deto_code_page/deto_code_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; +import 'package:get/get.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:akuCommunity/routers/page_routers.dart'; - +import 'package:akuCommunity/extensions/page_router.dart'; class GoodsInfoCardButton extends StatelessWidget { GoodsInfoCardButton({Key key}) : super(key: key); @@ -42,7 +43,7 @@ class GoodsInfoCardButton extends StatelessWidget { ), ), onPressed: () { - Navigator.of(context).pop(); + Get.back(); }, ), CupertinoDialogAction( @@ -56,7 +57,7 @@ class GoodsInfoCardButton extends StatelessWidget { ), onPressed: () { _phoneCall('tel:$url'); - Navigator.pop(context); + Get.back(); }, ), ], @@ -85,8 +86,7 @@ class GoodsInfoCardButton extends StatelessWidget { onTap: () { switch (_listButton[index]['title']) { case '查看二维码': - Navigator.pushNamed( - context, PageName.deto_code_page.toString()); + DetoCodePage().to; break; case '搬家公司': _showDialog(context, '0574-88467897'); diff --git a/lib/pages/goods_deto_page/widget/image_horizontal_list.dart b/lib/pages/goods_deto_page/widget/image_horizontal_list.dart index 6e0b1e19..66f56b9e 100644 --- a/lib/pages/goods_deto_page/widget/image_horizontal_list.dart +++ b/lib/pages/goods_deto_page/widget/image_horizontal_list.dart @@ -1,7 +1,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/fade_route.dart'; import 'package:akuCommunity/widget/gallery_photo_view_wrapper.dart'; diff --git a/lib/pages/goods_manage_page/goods_manage_page.dart b/lib/pages/goods_manage_page/goods_manage_page.dart index d13f930b..30770c0b 100644 --- a/lib/pages/goods_manage_page/goods_manage_page.dart +++ b/lib/pages/goods_manage_page/goods_manage_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/bottom_button.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; diff --git a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart index 3a64f189..ad2bed90 100644 --- a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart +++ b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; class MineGoodsPage extends StatefulWidget { diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 4070677e..7c8b8d86 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/const/resource.dart'; +import 'package:akuCommunity/pages/activities_page/activities_page.dart'; import 'package:akuCommunity/pages/convenient_phone/convenient_phone_page.dart'; import 'package:akuCommunity/pages/industry_committee/industry_committee_page.dart'; import 'package:akuCommunity/pages/life_pay/life_pay_page.dart'; @@ -21,7 +22,7 @@ import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'widget/home_search.dart'; import 'widget/home_swiper.dart'; import 'widget/home_card.dart'; @@ -33,6 +34,7 @@ import 'package:akuCommunity/model/aku_shop_model.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:velocity_x/velocity_x.dart'; +import 'package:akuCommunity/extensions/page_router.dart'; class HomePage extends StatefulWidget { HomePage({Key key}) : super(key: key); @@ -223,9 +225,7 @@ class _HomePageState extends State tag: '活动', isShowImage: false, fun: () { - Navigator.pushNamed( - context, PageName.activities_page.toString(), - arguments: Bundle()..putBool('isVote', false)); + ActivitiesPage(bundle: Bundle()..putBool('isVote', false),).to; }, ), HomeCard( diff --git a/lib/pages/home/widget/home_app_bar.dart b/lib/pages/home/widget/home_app_bar.dart index aa27be2b..ba02f6c4 100644 --- a/lib/pages/home/widget/home_app_bar.dart +++ b/lib/pages/home/widget/home_app_bar.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/app_bar_action.dart'; class HomeAppBar extends StatefulWidget { diff --git a/lib/pages/home/widget/home_card.dart b/lib/pages/home/widget/home_card.dart index d1f804d5..86ef0612 100644 --- a/lib/pages/home/widget/home_card.dart +++ b/lib/pages/home/widget/home_card.dart @@ -1,8 +1,10 @@ import 'dart:convert'; +import 'package:akuCommunity/pages/activities_page/activities_details_page/activities_details_page.dart'; +import 'package:akuCommunity/pages/goods_details/goods_details_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:image_stack/image_stack.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/routers/page_routers.dart'; @@ -32,29 +34,28 @@ class _HomeCardState extends State { "https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3604827221,1047385274&fm=26&gp=0.jpg", ]; - Widget _button(String buttonName) { return InkWell( onTap: () { switch (widget.isActivity) { case true: - Navigator.pushNamed( - context, PageName.activities_details_page.toString(), - arguments: Bundle() - ..putMap('details', { - 'title': widget.title, - 'imagePath': widget.imagePath, - 'isOver': false, - 'isVoteOver': false, - 'isVote': false, - 'memberList': images - })); + ActivitiesDetailsPage( + bundle: Bundle() + ..putMap('details', { + 'title': widget.title, + 'imagePath': widget.imagePath, + 'isOver': false, + 'isVoteOver': false, + 'isVote': false, + 'memberList': images + }), + ).to; break; case false: var shopInfo; shopInfo = { 'itemid': '1', - 'itemtitle':widget.title, + 'itemtitle': widget.title, 'taobao_image': "${widget.imagePath},${widget.imagePath}", 'itemprice': '69.9', 'itemshorttitle': widget.title, @@ -62,10 +63,10 @@ class _HomeCardState extends State { 'itemdesc': widget.title, 'itempic': widget.imagePath }; - Navigator.pushNamed(context, PageName.goods_details_page.toString(), - arguments: Bundle() - ..putString( - 'shoplist', json.encode(shopInfo).toString())); + GoodsDetailsPage( + bundle: Bundle() + ..putString('shoplist', json.encode(shopInfo).toString()), + ).to; break; default: } @@ -76,8 +77,7 @@ class _HomeCardState extends State { alignment: Alignment.center, decoration: BoxDecoration( color: Color(0xffffc40c), - borderRadius: - BorderRadius.all(Radius.circular(22.w)), + borderRadius: BorderRadius.all(Radius.circular(22.w)), ), padding: EdgeInsets.symmetric(vertical: 8.w), child: Text( @@ -107,8 +107,7 @@ class _HomeCardState extends State { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(8.w)), - border: - Border.all(color: Color(0xffe8e8e8), width: 2.w), + border: Border.all(color: Color(0xffe8e8e8), width: 2.w), ), padding: EdgeInsets.only(bottom: 24.w), child: Column( diff --git a/lib/pages/home/widget/home_search.dart b/lib/pages/home/widget/home_search.dart index 6a617b24..75567d2e 100644 --- a/lib/pages/home/widget/home_search.dart +++ b/lib/pages/home/widget/home_search.dart @@ -2,7 +2,7 @@ import 'package:akuCommunity/widget/search_bar_delegate.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; class HomeSearch extends StatefulWidget { HomeSearch({Key key}) : super(key: key); diff --git a/lib/pages/home/widget/home_swiper.dart b/lib/pages/home/widget/home_swiper.dart index b15ef5d7..8a8d2fc2 100644 --- a/lib/pages/home/widget/home_swiper.dart +++ b/lib/pages/home/widget/home_swiper.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; class HomeSwiper extends StatefulWidget { diff --git a/lib/pages/home/widget/home_tag_bar.dart b/lib/pages/home/widget/home_tag_bar.dart index 1a9b398f..c511650e 100644 --- a/lib/pages/home/widget/home_tag_bar.dart +++ b/lib/pages/home/widget/home_tag_bar.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; class HomeTagBar extends StatefulWidget { diff --git a/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart b/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart index dc58d534..c2d5433b 100644 --- a/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart +++ b/lib/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; class CommitteeMailboxPage extends StatefulWidget { diff --git a/lib/pages/industry_committee/industry_committee_page.dart b/lib/pages/industry_committee/industry_committee_page.dart index 5f0555fc..86197f58 100644 --- a/lib/pages/industry_committee/industry_committee_page.dart +++ b/lib/pages/industry_committee/industry_committee_page.dart @@ -1,9 +1,10 @@ +import 'package:akuCommunity/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:get/get.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; -import 'package:akuCommunity/routers/page_routers.dart'; import 'widget/staff_list.dart'; class IndustryCommitteePage extends StatefulWidget { @@ -56,7 +57,7 @@ class _IndustryCommitteePageState extends State { ), ), onPressed: () { - Navigator.of(context).pop(); + Get.back(); }, ), CupertinoDialogAction( @@ -70,7 +71,7 @@ class _IndustryCommitteePageState extends State { ), onPressed: () { _phoneCall('tel:${'0574-88478909'}'); - Navigator.pop(context); + Get.back(); }, ), ], @@ -87,8 +88,7 @@ class _IndustryCommitteePageState extends State { _showDialog(); break; case '业委会信箱': - Navigator.pushNamed( - context, PageName.committee_mailbox_page.toString()); + CommitteeMailboxPage().to; break; default: } diff --git a/lib/pages/industry_committee/widget/staff_list.dart b/lib/pages/industry_committee/widget/staff_list.dart index 347aa2ec..f8f75634 100644 --- a/lib/pages/industry_committee/widget/staff_list.dart +++ b/lib/pages/industry_committee/widget/staff_list.dart @@ -1,4 +1,4 @@ -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; diff --git a/lib/pages/invoice/invoice_page.dart b/lib/pages/invoice/invoice_page.dart index 527240c4..a95387b0 100644 --- a/lib/pages/invoice/invoice_page.dart +++ b/lib/pages/invoice/invoice_page.dart @@ -1,9 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/round_check_box.dart'; +import 'package:get/get.dart'; import 'widget/invoice_input.dart'; class InvoicePage extends StatefulWidget { @@ -39,7 +40,7 @@ class _InvoicePageState extends State { leading: IconButton( icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), centerTitle: true, diff --git a/lib/pages/invoice/widget/invoice_input.dart b/lib/pages/invoice/widget/invoice_input.dart index 7174a7b6..068d9d25 100644 --- a/lib/pages/invoice/widget/invoice_input.dart +++ b/lib/pages/invoice/widget/invoice_input.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; class InvoiceInput extends StatefulWidget { final bool isEnterprise; diff --git a/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart b/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart index 3de1bcc3..820b3464 100644 --- a/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart +++ b/lib/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'widget/bill_card.dart'; diff --git a/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart b/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart index 70dcf918..21ebf814 100644 --- a/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart +++ b/lib/pages/life_pay/life_pay_bill_page/widget/bill_card.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; class BillCard extends StatelessWidget { 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 ddc47f99..c8ba59c9 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 @@ -1,6 +1,7 @@ +import 'package:akuCommunity/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'widget/details_card.dart'; @@ -15,9 +16,6 @@ class LifePayInfoPage extends StatefulWidget { } class _LifePayInfoPageState extends State { - void billRouter() { - Navigator.pushNamed(context, PageName.life_pay_bill_page.toString()); - } @override Widget build(BuildContext context) { @@ -33,7 +31,7 @@ class _LifePayInfoPageState extends State { ListView( padding: EdgeInsets.only(bottom: 130.w), children: [ - DetailsCard(fun: billRouter), + DetailsCard(fun: LifePayBillPage().to), ], ), Positioned( diff --git a/lib/pages/life_pay/life_pay_info_page/widget/details_card.dart b/lib/pages/life_pay/life_pay_info_page/widget/details_card.dart index 758b5bad..07a66969 100644 --- a/lib/pages/life_pay/life_pay_info_page/widget/details_card.dart +++ b/lib/pages/life_pay/life_pay_info_page/widget/details_card.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:flutter_icons/flutter_icons.dart'; diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index 69c4bf49..4501ca9a 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -1,6 +1,7 @@ +import 'package:akuCommunity/pages/life_pay/life_pay_info_page/life_pay_info_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'widget/order_card.dart'; @@ -14,12 +15,6 @@ class LifePayPage extends StatefulWidget { } class _LifePayPageState extends State { - void detailsRouter() { - Navigator.pushNamed(context, PageName.life_pay_info_page.toString(), - arguments: Bundle() - ..putMap('commentMap', {'title': '明细', 'isActions': false})); - } - @override Widget build(BuildContext context) { return Scaffold( @@ -43,9 +38,8 @@ class _LifePayPageState extends State { ), child: RichText( text: TextSpan( - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff666666)), + style: + TextStyle(fontSize: 28.sp, color: Color(0xff666666)), children: [ TextSpan( text: '深圳华茂悦峰', @@ -57,7 +51,11 @@ class _LifePayPageState extends State { ]), ), ), - OrderCard(fun: detailsRouter), + OrderCard( + fun: LifePayInfoPage( + bundle: Bundle() + ..putMap('commentMap', {'title': '明细', 'isActions': false}), + ).to), ], ), Positioned( diff --git a/lib/pages/life_pay/life_pay_record_page/life_pay_record_page.dart b/lib/pages/life_pay/life_pay_record_page/life_pay_record_page.dart index 59b95c9e..88c3bb44 100644 --- a/lib/pages/life_pay/life_pay_record_page/life_pay_record_page.dart +++ b/lib/pages/life_pay/life_pay_record_page/life_pay_record_page.dart @@ -1,7 +1,8 @@ +import 'package:akuCommunity/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'widget/record_card.dart'; @@ -35,9 +36,6 @@ class _LifePayRecordPageState extends State { _refreshController.loadComplete(); } - void billRouter() { - Navigator.pushNamed(context, PageName.life_pay_bill_page.toString()); - } @override void dispose() { @@ -85,10 +83,10 @@ class _LifePayRecordPageState extends State { ]), ), ), - RecordCard(fun: billRouter), - RecordCard(fun: billRouter), - RecordCard(fun: billRouter), - RecordCard(fun: billRouter), + RecordCard(fun: LifePayBillPage().to), + RecordCard(fun: LifePayBillPage().to), + RecordCard(fun: LifePayBillPage().to), + RecordCard(fun: LifePayBillPage().to), ], ), ), diff --git a/lib/pages/life_pay/life_pay_record_page/widget/record_card.dart b/lib/pages/life_pay/life_pay_record_page/widget/record_card.dart index 7bb637fd..a72b0396 100644 --- a/lib/pages/life_pay/life_pay_record_page/widget/record_card.dart +++ b/lib/pages/life_pay/life_pay_record_page/widget/record_card.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:flutter_icons/flutter_icons.dart'; diff --git a/lib/pages/life_pay/widget/order_card.dart b/lib/pages/life_pay/widget/order_card.dart index 0bb8b1bf..86cb6b3c 100644 --- a/lib/pages/life_pay/widget/order_card.dart +++ b/lib/pages/life_pay/widget/order_card.dart @@ -1,6 +1,7 @@ +import 'package:akuCommunity/pages/life_pay/life_pay_info_page/life_pay_info_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/routers/page_routers.dart'; @@ -76,9 +77,8 @@ class _OrderCardState extends State { InkWell _checkInfo(Function fun) { return InkWell( onTap: (){ - Navigator.pushNamed(context, PageName.life_pay_info_page.toString(), - arguments: Bundle() - ..putMap('detailMap', {'title': '去年(2019年)'})); + LifePayInfoPage(bundle: Bundle() + ..putMap('detailMap', {'title': '去年(2019年)'}),).to; }, child: Container( margin: EdgeInsets.only(top: 20.w), diff --git a/lib/pages/life_pay/widget/submit_bar.dart b/lib/pages/life_pay/widget/submit_bar.dart index 8d1ebcc1..898d02a7 100644 --- a/lib/pages/life_pay/widget/submit_bar.dart +++ b/lib/pages/life_pay/widget/submit_bar.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; class SubmitBar extends StatefulWidget { diff --git a/lib/pages/market/market_cart_page/market_cart_page.dart b/lib/pages/market/market_cart_page/market_cart_page.dart index 50f7cc97..f33a225c 100644 --- a/lib/pages/market/market_cart_page/market_cart_page.dart +++ b/lib/pages/market/market_cart_page/market_cart_page.dart @@ -1,5 +1,5 @@ import 'package:akuCommunity/model/aku_shop_model.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/widget/cart_count.dart'; import 'package:flutter/material.dart'; diff --git a/lib/pages/market/market_cart_page/widget/market_cart_app_bar.dart b/lib/pages/market/market_cart_page/widget/market_cart_app_bar.dart index 5a3a3132..e5ac1685 100644 --- a/lib/pages/market/market_cart_page/widget/market_cart_app_bar.dart +++ b/lib/pages/market/market_cart_page/widget/market_cart_app_bar.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; +import 'package:get/get.dart'; class MarketCartAppBar extends StatelessWidget { const MarketCartAppBar({Key key}) : super(key: key); @@ -16,7 +17,7 @@ class MarketCartAppBar extends StatelessWidget { padding: EdgeInsets.all(0), icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), centerTitle: false, diff --git a/lib/pages/market/market_cart_page/widget/market_cart_bottom_bar.dart b/lib/pages/market/market_cart_page/widget/market_cart_bottom_bar.dart index c61dc7af..5dce34ae 100644 --- a/lib/pages/market/market_cart_page/widget/market_cart_bottom_bar.dart +++ b/lib/pages/market/market_cart_page/widget/market_cart_bottom_bar.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:provider/provider.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/provider/cart.dart'; class MarketCartBottomBar extends StatelessWidget { diff --git a/lib/pages/market/market_cart_page/widget/market_cart_card.dart b/lib/pages/market/market_cart_page/widget/market_cart_card.dart index 3a96ea9d..182203f3 100644 --- a/lib/pages/market/market_cart_page/widget/market_cart_card.dart +++ b/lib/pages/market/market_cart_page/widget/market_cart_card.dart @@ -3,7 +3,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/widget/cart_count.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/model/aku_shop_model.dart'; import 'package:provider/provider.dart'; import 'package:akuCommunity/provider/cart.dart'; diff --git a/lib/pages/market/market_detail_page/widget/market_details_app_bar.dart b/lib/pages/market/market_detail_page/widget/market_details_app_bar.dart index e5672794..d1722f4b 100644 --- a/lib/pages/market/market_detail_page/widget/market_details_app_bar.dart +++ b/lib/pages/market/market_detail_page/widget/market_details_app_bar.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; +import 'package:get/get.dart'; class MarketDetailsAppBar extends StatefulWidget { final String title; @@ -59,7 +60,7 @@ class _MarketDetailsAppBarState extends State { itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { - Navigator.pop(context); + Get.back(); }, child: Container( decoration: BoxDecoration( @@ -131,7 +132,7 @@ class _MarketDetailsAppBarState extends State { padding: EdgeInsets.all(0), icon: Icon(AntDesign.left, size: 37.sp), onPressed: () { - Navigator.pop(context); + Get.back(); }), title: InkWell( onTap: _showModelTopSheet, diff --git a/lib/pages/market/market_page.dart b/lib/pages/market/market_page.dart index b2fbecb3..72603a71 100644 --- a/lib/pages/market/market_page.dart +++ b/lib/pages/market/market_page.dart @@ -1,14 +1,13 @@ +import 'package:akuCommunity/widget/grid_buttons.dart'; import 'package:akuCommunity/widget/search_bar_delegate.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/widget/container_comment.dart'; import 'package:akuCommunity/widget/app_bar_action.dart'; import 'package:akuCommunity/widget/single_ad_space.dart'; -import 'package:akuCommunity/widget/grid_button.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'widget/market_sticky_bar.dart'; import 'widget/market_list.dart'; @@ -131,9 +130,9 @@ class _MarketPageState extends State ), ContainerComment( radius: 8, - customWidget: GridButton( - gridList: AssetsImage.shopGridList, - count: 4, + customWidget: GridButtons( + gridList: [], + crossCount: 4, ), ), ], diff --git a/lib/pages/market/widget/market_list.dart b/lib/pages/market/widget/market_list.dart index 204df57e..f3abe76b 100644 --- a/lib/pages/market/widget/market_list.dart +++ b/lib/pages/market/widget/market_list.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:akuCommunity/widget/sliver_goods_card.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/goods_card_skeleton.dart'; import 'package:akuCommunity/service/base_model.dart'; import 'package:akuCommunity/model/aku_shop_model.dart'; diff --git a/lib/pages/market/widget/sliver_goods_group_card.dart b/lib/pages/market/widget/sliver_goods_group_card.dart index 3f1c3f23..14373e7d 100644 --- a/lib/pages/market/widget/sliver_goods_group_card.dart +++ b/lib/pages/market/widget/sliver_goods_group_card.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; class SliverGoodsGroupCard extends StatefulWidget { SliverGoodsGroupCard({Key key}) : super(key: key); diff --git a/lib/pages/market_class/market_class_page.dart b/lib/pages/market_class/market_class_page.dart index 5dca447e..c4639629 100644 --- a/lib/pages/market_class/market_class_page.dart +++ b/lib/pages/market_class/market_class_page.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/model/aku_shop_class_model.dart'; diff --git a/lib/pages/market_class/widget/market_class_bar.dart b/lib/pages/market_class/widget/market_class_bar.dart index 0f1f2a5a..c4dbaaad 100644 --- a/lib/pages/market_class/widget/market_class_bar.dart +++ b/lib/pages/market_class/widget/market_class_bar.dart @@ -1,8 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/search_bar_delegate.dart'; +import 'package:get/get.dart'; class MarketClassBar extends StatelessWidget { Widget _inkWellSearch(BuildContext context) { @@ -47,7 +48,7 @@ class MarketClassBar extends StatelessWidget { titleSpacing: 0, backgroundColor: Color(0xffffffff), leading: InkWell( - onTap: () => Navigator.pop(context), + onTap: () => Get.back(), child: Icon(AntDesign.left, size: 40.sp), ), centerTitle: true, diff --git a/lib/pages/message_center_page/comment_message_page/comment_message_page.dart b/lib/pages/message_center_page/comment_message_page/comment_message_page.dart index ddc1bb87..7a0bd1af 100644 --- a/lib/pages/message_center_page/comment_message_page/comment_message_page.dart +++ b/lib/pages/message_center_page/comment_message_page/comment_message_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; class CommentMessagePage extends StatefulWidget { @@ -49,12 +49,7 @@ class _CommentMessagePageState extends State { super.initState(); } - void noteCreateRouter() { - // Navigator.pushNamed( - // context, - // PageName.note_create_page.toString(), - // ); - } + void _onRefresh() async { await Future.delayed(Duration(milliseconds: 1500)); diff --git a/lib/pages/message_center_page/message_center_page.dart b/lib/pages/message_center_page/message_center_page.dart index 094de92c..cf719acb 100644 --- a/lib/pages/message_center_page/message_center_page.dart +++ b/lib/pages/message_center_page/message_center_page.dart @@ -1,6 +1,9 @@ +import 'package:akuCommunity/pages/message_center_page/comment_message_page/comment_message_page.dart'; +import 'package:akuCommunity/pages/message_center_page/shop_message_page/shop_message_page.dart'; +import 'package:akuCommunity/pages/message_center_page/system_message_page/system_message_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; @@ -65,13 +68,13 @@ class _MessageCenterPageState extends State { onTap: () { switch (_messageList[index]['title']) { case '系统通知': - Navigator.pushNamed(context, PageName.system_message_page.toString()); + SystemMessagePage().to; break; case '评论通知': - Navigator.pushNamed(context, PageName.comment_message_page.toString()); + CommentMessagePage().to; break; case '商城通知': - Navigator.pushNamed(context, PageName.shop_message_page.toString()); + ShopMessagePage().to; break; default: } @@ -81,8 +84,7 @@ class _MessageCenterPageState extends State { top: 36.w, bottom: 19.w, ), - margin: EdgeInsets.symmetric( - horizontal: 32.w), + margin: EdgeInsets.symmetric(horizontal: 32.w), decoration: BoxDecoration( border: Border( bottom: Divider.createBorderSide(context, diff --git a/lib/pages/message_center_page/refund_details.dart b/lib/pages/message_center_page/refund_details.dart index f61d6a4c..5529adcd 100644 --- a/lib/pages/message_center_page/refund_details.dart +++ b/lib/pages/message_center_page/refund_details.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; class RefundDetails extends StatelessWidget { diff --git a/lib/pages/message_center_page/shop_message_page/shop_message_page.dart b/lib/pages/message_center_page/shop_message_page/shop_message_page.dart index 380a24f1..b72097b2 100644 --- a/lib/pages/message_center_page/shop_message_page/shop_message_page.dart +++ b/lib/pages/message_center_page/shop_message_page/shop_message_page.dart @@ -1,8 +1,9 @@ +import 'package:akuCommunity/pages/common/common_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; @@ -45,13 +46,6 @@ class _ShopMessagePageState extends State { super.initState(); } - void noteCreateRouter() { - // Navigator.pushNamed( - // context, - // PageName.note_create_page.toString(), - // ); - } - void _onRefresh() async { await Future.delayed(Duration(milliseconds: 1500)); @@ -66,12 +60,13 @@ class _ShopMessagePageState extends State { } void refundRouter() { - Navigator.pushNamed(context, PageName.common_page.toString(), - arguments: Bundle() - ..putMap('commentMap', { - 'title': '退款详情', - 'isActions': false, - })); + CommonPage( + bundle: Bundle() + ..putMap('commentMap', { + 'title': '退款详情', + 'isActions': false, + }), + ).to; } void expressRouter() {} @@ -92,8 +87,7 @@ class _ShopMessagePageState extends State { children: [ Text( lookType, - style: TextStyle( - fontSize: 28.sp, color: Color(0xff333333)), + style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)), ), Icon(AntDesign.right, size: 40.sp), ], @@ -108,11 +102,8 @@ class _ShopMessagePageState extends State { left: 32.w, right: 32.w, ), - padding: EdgeInsets.only( - top: 21.w, - bottom: 14.w, - left: 30.w, - right: 20.w), + padding: + EdgeInsets.only(top: 21.w, bottom: 14.w, left: 30.w, right: 20.w), decoration: BoxDecoration( color: Color(0xffffffff), borderRadius: BorderRadius.all(Radius.circular(4)), @@ -143,17 +134,15 @@ class _ShopMessagePageState extends State { ), Text( status, - style: TextStyle( - fontSize: 32.sp, - color: Color(0xff999999)), + style: + TextStyle(fontSize: 32.sp, color: Color(0xff999999)), ), ], ), SizedBox(height: 5.w), Text(type, - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff333333))), + style: + TextStyle(fontSize: 28.sp, color: Color(0xff333333))), SizedBox(height: 8.w), Row( children: [ @@ -170,8 +159,7 @@ class _ShopMessagePageState extends State { maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: 28.sp, - color: Color(0xff999999)), + fontSize: 28.sp, color: Color(0xff999999)), ), ), ], diff --git a/lib/pages/message_center_page/system_message_page/system_details_page/system_details_page.dart b/lib/pages/message_center_page/system_message_page/system_details_page/system_details_page.dart index c459b856..dd293048 100644 --- a/lib/pages/message_center_page/system_message_page/system_details_page/system_details_page.dart +++ b/lib/pages/message_center_page/system_message_page/system_details_page/system_details_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'package:akuCommunity/routers/page_routers.dart'; diff --git a/lib/pages/message_center_page/system_message_page/system_message_page.dart b/lib/pages/message_center_page/system_message_page/system_message_page.dart index aef9aa74..28c7a910 100644 --- a/lib/pages/message_center_page/system_message_page/system_message_page.dart +++ b/lib/pages/message_center_page/system_message_page/system_message_page.dart @@ -1,8 +1,9 @@ +import 'package:akuCommunity/pages/message_center_page/system_message_page/system_details_page/system_details_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; @@ -35,13 +36,6 @@ class _SystemMessagePageState extends State { super.initState(); } - void noteCreateRouter() { - // Navigator.pushNamed( - // context, - // PageName.note_create_page.toString(), - // ); - } - void _onRefresh() async { await Future.delayed(Duration(milliseconds: 1500)); @@ -64,17 +58,17 @@ class _SystemMessagePageState extends State { InkWell _inkWellLook(String type, String content) { return InkWell( onTap: () { - Navigator.pushNamed(context, PageName.system_details_page.toString(), - arguments: Bundle() - ..putMap('detailsMap', {'type': type, 'content': content})); + SystemDetailsPage( + bundle: Bundle() + ..putMap('detailsMap', {'type': type, 'content': content}), + ).to; }, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( '查看详情', - style: TextStyle( - fontSize: 28.sp, color: Color(0xff333333)), + style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)), ), Icon(AntDesign.right, size: 40.sp), ], @@ -89,11 +83,8 @@ class _SystemMessagePageState extends State { left: 32.w, right: 32.w, ), - padding: EdgeInsets.only( - top: 21.w, - bottom: 14.w, - left: 30.w, - right: 20.w), + padding: + EdgeInsets.only(top: 21.w, bottom: 14.w, left: 30.w, right: 20.w), decoration: BoxDecoration( color: Color(0xffffffff), borderRadius: BorderRadius.all(Radius.circular(4)), @@ -124,25 +115,22 @@ class _SystemMessagePageState extends State { ), Text( status, - style: TextStyle( - fontSize: 32.sp, - color: Color(0xff999999)), + style: + TextStyle(fontSize: 32.sp, color: Color(0xff999999)), ), ], ), SizedBox(height: 5.w), Text( type, - style: TextStyle( - fontSize: 28.sp, color: Color(0xff333333)), + style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)), ), SizedBox(height: 8.w), Text( '驳回理由:$content', maxLines: 1, overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 28.sp, color: Color(0xff333333)), + style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)), ), ], ), diff --git a/lib/pages/mine_car_page/car_add_page/car_add_page.dart b/lib/pages/mine_car_page/car_add_page/car_add_page.dart index 90a13216..f31b5b70 100644 --- a/lib/pages/mine_car_page/car_add_page/car_add_page.dart +++ b/lib/pages/mine_car_page/car_add_page/car_add_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'package:akuCommunity/widget/common_input.dart'; diff --git a/lib/pages/mine_car_page/mine_car_page.dart b/lib/pages/mine_car_page/mine_car_page.dart index ed1c5859..bcb539bc 100644 --- a/lib/pages/mine_car_page/mine_car_page.dart +++ b/lib/pages/mine_car_page/mine_car_page.dart @@ -1,7 +1,9 @@ +import 'package:akuCommunity/pages/mine_car_page/car_add_page/car_add_page.dart'; +import 'package:akuCommunity/pages/mine_car_page/select_community_page/select_community_page.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/routers/page_routers.dart'; @@ -76,11 +78,10 @@ class _MineCarPageState extends State { onTap: () { switch (type) { case '车': - Navigator.pushNamed(context, PageName.car_add_page.toString()); + CarAddPage().to; break; case '车位': - Navigator.pushNamed( - context, PageName.select_community_page.toString()); + SelectCommunityPage().to; break; default: } diff --git a/lib/pages/mine_car_page/select_community_page/select_community_page.dart b/lib/pages/mine_car_page/select_community_page/select_community_page.dart index b49aaa76..d9891574 100644 --- a/lib/pages/mine_car_page/select_community_page/select_community_page.dart +++ b/lib/pages/mine_car_page/select_community_page/select_community_page.dart @@ -1,7 +1,8 @@ +import 'package:akuCommunity/pages/mine_car_page/select_parking_page/select_parking_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; @@ -30,9 +31,7 @@ class _SelectCommunityPageState extends State { width: MediaQuery.of(context).size.width, color: Colors.white, margin: EdgeInsets.only(top: 32.w), - padding: EdgeInsets.symmetric( - vertical: 28.w, - horizontal: 32.w), + padding: EdgeInsets.symmetric(vertical: 28.w, horizontal: 32.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -78,17 +77,15 @@ class _SelectCommunityPageState extends State { _communityList.length, (index) => InkWell( onTap: () { - Navigator.pushNamed( - context, PageName.select_parking_page.toString(), - arguments: Bundle() - ..putString('title', _communityList[index])); + SelectParkingPage( + bundle: Bundle()..putString('title', _communityList[index]), + ).to; }, child: Container( width: MediaQuery.of(context).size.width, color: Colors.white, - padding: EdgeInsets.symmetric( - vertical: 28.w, - horizontal: 32.w), + padding: + EdgeInsets.symmetric(vertical: 28.w, horizontal: 32.w), child: Text( _communityList[index], style: TextStyle( diff --git a/lib/pages/mine_car_page/select_parking_page/select_parking_page.dart b/lib/pages/mine_car_page/select_parking_page/select_parking_page.dart index 50ee1db0..3a60fd07 100644 --- a/lib/pages/mine_car_page/select_parking_page/select_parking_page.dart +++ b/lib/pages/mine_car_page/select_parking_page/select_parking_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; diff --git a/lib/pages/mine_house_page/house_authenticate_page/house_authenticate_page.dart b/lib/pages/mine_house_page/house_authenticate_page/house_authenticate_page.dart index c4b10f6e..5cb5d220 100644 --- a/lib/pages/mine_house_page/house_authenticate_page/house_authenticate_page.dart +++ b/lib/pages/mine_house_page/house_authenticate_page/house_authenticate_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'package:akuCommunity/widget/common_input.dart'; diff --git a/lib/pages/mine_house_page/mine_house_page.dart b/lib/pages/mine_house_page/mine_house_page.dart index 7a3f55f4..034a7a5c 100644 --- a/lib/pages/mine_house_page/mine_house_page.dart +++ b/lib/pages/mine_house_page/mine_house_page.dart @@ -1,7 +1,8 @@ +import 'package:akuCommunity/pages/mine_house_page/house_authenticate_page/house_authenticate_page.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; @@ -74,8 +75,7 @@ class _MineHousePageState extends State { Widget _inkWellCheck() { return InkWell( onTap: () { - Navigator.pushNamed( - context, PageName.house_authenticate_page.toString()); + HouseAuthenticatePage().to; }, child: Container( padding: EdgeInsets.only( diff --git a/lib/pages/notice_page/notice_page.dart b/lib/pages/notice_page/notice_page.dart index 7b9802a7..f35d5abce 100644 --- a/lib/pages/notice_page/notice_page.dart +++ b/lib/pages/notice_page/notice_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_html/flutter_html.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; diff --git a/lib/pages/one_alarm/widget/alarm_page.dart b/lib/pages/one_alarm/widget/alarm_page.dart index 98ab2237..dc6235b4 100644 --- a/lib/pages/one_alarm/widget/alarm_page.dart +++ b/lib/pages/one_alarm/widget/alarm_page.dart @@ -1,4 +1,4 @@ -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'package:flutter/material.dart'; import 'package:amap_map_fluttify/amap_map_fluttify.dart'; diff --git a/lib/pages/one_alarm/widget/explain_template.dart b/lib/pages/one_alarm/widget/explain_template.dart index da8ad605..ea28ed81 100644 --- a/lib/pages/one_alarm/widget/explain_template.dart +++ b/lib/pages/one_alarm/widget/explain_template.dart @@ -2,7 +2,7 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_beautiful_popup/main.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/pages/open_door_page/open_door_page.dart b/lib/pages/open_door_page/open_door_page.dart index ed404721..f6717543 100644 --- a/lib/pages/open_door_page/open_door_page.dart +++ b/lib/pages/open_door_page/open_door_page.dart @@ -1,9 +1,11 @@ +import 'package:akuCommunity/pages/certification_page/certification_page.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; +import 'package:get/get.dart'; class OpenDoorPage extends StatefulWidget { OpenDoorPage({Key key}) : super(key: key); @@ -42,7 +44,7 @@ class _OpenDoorPageState extends State { ), ), onPressed: () { - Navigator.of(context).pop(); + Get.back(); }, ), CupertinoDialogAction( @@ -55,9 +57,8 @@ class _OpenDoorPageState extends State { ), ), onPressed: () { - Navigator.of(context).pop(); - Navigator.pushNamed( - context, PageName.certification_page.toString()); + Get.back(); + CertificationPage().to; }, ), ], diff --git a/lib/pages/opening_code_page/opening_code_page.dart b/lib/pages/opening_code_page/opening_code_page.dart index 2c707d44..93d6b37d 100644 --- a/lib/pages/opening_code_page/opening_code_page.dart +++ b/lib/pages/opening_code_page/opening_code_page.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:qr_flutter/qr_flutter.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; class OpeningCodePage extends StatefulWidget { diff --git a/lib/pages/personal/evaluate_good_page.dart b/lib/pages/personal/evaluate_good_page.dart index 7e6eb6a2..c0856bc9 100644 --- a/lib/pages/personal/evaluate_good_page.dart +++ b/lib/pages/personal/evaluate_good_page.dart @@ -1,10 +1,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/routers/page_routers.dart'; +import 'package:get/get.dart'; import 'widget/refund_shop_card.dart'; class EvaluateGoodPage extends StatefulWidget { @@ -31,7 +32,7 @@ class _EvaluateGoodPageState extends State { leading: IconButton( icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), centerTitle: true, diff --git a/lib/pages/personal/look_logistics_page.dart b/lib/pages/personal/look_logistics_page.dart index 369e7344..181738cd 100644 --- a/lib/pages/personal/look_logistics_page.dart +++ b/lib/pages/personal/look_logistics_page.dart @@ -1,12 +1,13 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:get/get.dart'; import 'package:sliding_up_panel/sliding_up_panel.dart'; import 'package:flutter_map/flutter_map.dart'; import 'package:latlong/latlong.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; @@ -64,7 +65,7 @@ class _LookLogisticsPageState extends State { alignment: Alignment.centerLeft, icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), ), diff --git a/lib/pages/personal/order_details_page.dart b/lib/pages/personal/order_details_page.dart index 842a405b..b166fe61 100644 --- a/lib/pages/personal/order_details_page.dart +++ b/lib/pages/personal/order_details_page.dart @@ -1,11 +1,13 @@ +import 'package:akuCommunity/pages/personal/refund_select_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:extended_text/extended_text.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/routers/page_routers.dart'; +import 'package:get/get.dart'; class OrderDetailsPage extends StatefulWidget { final Bundle bundle; @@ -23,7 +25,7 @@ class _OrderDetailsPageState extends State { leading: IconButton( icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), centerTitle: true, @@ -141,12 +143,13 @@ class _OrderDetailsPageState extends State { List> listContent, double payPrice) { return InkWell( onTap: () { - Navigator.pushNamed(context, PageName.refund_select_page.toString(), - arguments: Bundle() - ..putMap('details', { - 'listContent': listContent, - 'payPrice': payPrice, - })); + RefundSelectPage( + bundle: Bundle() + ..putMap('details', { + 'listContent': listContent, + 'payPrice': payPrice, + }), + ).to; }, child: Container( alignment: Alignment.center, @@ -158,8 +161,7 @@ class _OrderDetailsPageState extends State { ), child: Text( '退款', - style: TextStyle( - fontSize: BaseStyle.fontSize28, color: ktextPrimary), + style: TextStyle(fontSize: BaseStyle.fontSize28, color: ktextPrimary), ), ), ); @@ -264,7 +266,7 @@ class _OrderDetailsPageState extends State { Positioned( top: 103.w, right: 0, - child: _inkWellRefund(listContent,payPrice), + child: _inkWellRefund(listContent, payPrice), ), ], ), @@ -285,14 +287,13 @@ class _OrderDetailsPageState extends State { child: Column( children: listContent .map((item) => _containerContent( - item['imagePath'], - item['content'], - item['specs'], - item['price'], - payPrice, - item['shopNum'], - listContent - )) + item['imagePath'], + item['content'], + item['specs'], + item['price'], + payPrice, + item['shopNum'], + listContent)) .toList(), ), ); diff --git a/lib/pages/personal/order_page.dart b/lib/pages/personal/order_page.dart index 488e2194..0491e2c9 100644 --- a/lib/pages/personal/order_page.dart +++ b/lib/pages/personal/order_page.dart @@ -1,9 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/routers/page_routers.dart'; +import 'package:get/get.dart'; import 'widget/order_list.dart'; class OrderPage extends StatefulWidget { @@ -108,7 +109,7 @@ class _OrderPageState extends State titleSpacing: 0, backgroundColor: Color(0xffffffff), leading: InkWell( - onTap: () => Navigator.pop(context), + onTap: () => Get.back(), child: Icon(AntDesign.left, size: 40.sp), ), centerTitle: false, diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index 23c406a6..e563ca57 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -4,6 +4,7 @@ import 'package:akuCommunity/pages/address_page/address_page.dart'; import 'package:akuCommunity/pages/life_pay/life_pay_page.dart'; import 'package:akuCommunity/pages/mine_car_page/mine_car_page.dart'; import 'package:akuCommunity/pages/mine_house_page/mine_house_page.dart'; +import 'package:akuCommunity/pages/personal/order_page.dart'; import 'package:akuCommunity/pages/setting_page/settings_page.dart'; import 'package:akuCommunity/pages/sign/sign_in_page.dart'; import 'package:akuCommunity/pages/things_page/fixed_submit_page.dart'; @@ -15,7 +16,7 @@ import 'package:ani_route/ani_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/single_ad_space.dart'; @@ -198,8 +199,7 @@ class _PersonalIndexState extends State ? SizedBox() : InkWell( onTap: () { - Navigator.pushNamed( - context, PageName.order_page.toString()); + OrderPage().to; }, child: Row( mainAxisAlignment: MainAxisAlignment.start, diff --git a/lib/pages/personal/refund_apply_page.dart b/lib/pages/personal/refund_apply_page.dart index fdb30376..56a5f250 100644 --- a/lib/pages/personal/refund_apply_page.dart +++ b/lib/pages/personal/refund_apply_page.dart @@ -1,9 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/routers/page_routers.dart'; +import 'package:get/get.dart'; import 'widget/refund_shop_card.dart'; import 'widget/refund_tile_card.dart'; @@ -27,7 +28,7 @@ class _RefundApplyPageState extends State { leading: IconButton( icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), centerTitle: true, diff --git a/lib/pages/personal/refund_select_page.dart b/lib/pages/personal/refund_select_page.dart index 7484ddf7..fee776c3 100644 --- a/lib/pages/personal/refund_select_page.dart +++ b/lib/pages/personal/refund_select_page.dart @@ -1,9 +1,11 @@ +import 'package:akuCommunity/pages/personal/refund_apply_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/routers/page_routers.dart'; +import 'package:get/get.dart'; import 'widget/refund_shop_card.dart'; import 'widget/refund_tile_card.dart'; @@ -16,7 +18,6 @@ class RefundSelectPage extends StatefulWidget { } class _RefundSelectPageState extends State { - AppBar _appBar() { return AppBar( elevation: 0, @@ -24,7 +25,7 @@ class _RefundSelectPageState extends State { leading: IconButton( icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), centerTitle: true, @@ -60,13 +61,14 @@ class _RefundSelectPageState extends State { 'title': '我要退款', 'subtitle': '没有收到货,与物业协商直接退货', 'fun': () { - Navigator.pushNamed(context, PageName.refund_apply_page.toString(), - arguments: Bundle() - ..putMap('details', { - 'listContent': widget.bundle.getMap('details')['listContent'], - 'payPrice': widget.bundle.getMap('details')['payPrice'], - 'isRefundGood':false - })); + RefundApplyPage( + bundle: Bundle() + ..putMap('details', { + 'listContent': widget.bundle.getMap('details')['listContent'], + 'payPrice': widget.bundle.getMap('details')['payPrice'], + 'isRefundGood': false + }), + ).to; }, 'isRight': true }, @@ -74,13 +76,14 @@ class _RefundSelectPageState extends State { 'title': '我要退款退货', 'subtitle': '已收到货,需要退还货物', 'fun': () { - Navigator.pushNamed(context, PageName.refund_apply_page.toString(), - arguments: Bundle() - ..putMap('details', { - 'listContent': widget.bundle.getMap('details')['listContent'], - 'payPrice': widget.bundle.getMap('details')['payPrice'], - 'isRefundGood':true - })); + RefundApplyPage( + bundle: Bundle() + ..putMap('details', { + 'listContent': widget.bundle.getMap('details')['listContent'], + 'payPrice': widget.bundle.getMap('details')['payPrice'], + 'isRefundGood': true + }), + ).to; }, 'isRight': true } diff --git a/lib/pages/personal/widget/order_card.dart b/lib/pages/personal/widget/order_card.dart index b9a47628..c005866a 100644 --- a/lib/pages/personal/widget/order_card.dart +++ b/lib/pages/personal/widget/order_card.dart @@ -1,6 +1,9 @@ +import 'package:akuCommunity/pages/personal/evaluate_good_page.dart'; +import 'package:akuCommunity/pages/personal/look_logistics_page.dart'; +import 'package:akuCommunity/pages/personal/order_details_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/routers/page_routers.dart'; @@ -174,15 +177,15 @@ class _OrderCardState extends State { onTap: () { switch (buttonName) { case '评价': - Navigator.pushNamed(context, PageName.evaluate_good_page.toString(), - arguments: Bundle() - ..putMap('details', { - 'listContent': widget.listContent, - })); + EvaluateGoodPage( + bundle: Bundle() + ..putMap('details', { + 'listContent': widget.listContent, + }), + ).to; break; case '查看物流': - Navigator.pushNamed( - context, PageName.look_logistics_page.toString()); + LookLogisticsPage().to; break; default: } @@ -226,16 +229,17 @@ class _OrderCardState extends State { Widget build(BuildContext context) { return InkWell( onTap: () { - Navigator.pushNamed(context, PageName.order_details_page.toString(), - arguments: Bundle() - ..putMap('details', { - 'status': widget.status, - 'listContent': widget.listContent, - 'totalPrice': widget.totalPrice, - 'payPrice': widget.payPrice, - 'listButton': widget.listButton, - 'listOrderDetail': widget.listOrderDetail, - })); + 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/personal/widget/refund_shop_card.dart b/lib/pages/personal/widget/refund_shop_card.dart index bcec6141..74613bff 100644 --- a/lib/pages/personal/widget/refund_shop_card.dart +++ b/lib/pages/personal/widget/refund_shop_card.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; class RefundShopCard extends StatelessWidget { diff --git a/lib/pages/personal/widget/refund_tile_card.dart b/lib/pages/personal/widget/refund_tile_card.dart index 3c1533e6..efe1899f 100644 --- a/lib/pages/personal/widget/refund_tile_card.dart +++ b/lib/pages/personal/widget/refund_tile_card.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; class RefundTileCard extends StatefulWidget { diff --git a/lib/pages/property/property_index.dart b/lib/pages/property/property_index.dart index 6fc4ad74..8d697219 100644 --- a/lib/pages/property/property_index.dart +++ b/lib/pages/property/property_index.dart @@ -1,10 +1,12 @@ import 'package:akuCommunity/const/resource.dart'; +import 'package:akuCommunity/pages/activities_page/activities_details_page/activities_details_page.dart'; import 'package:akuCommunity/pages/activities_page/activities_page.dart'; import 'package:akuCommunity/pages/convenient_phone/convenient_phone_page.dart'; import 'package:akuCommunity/pages/fitup_manage/fitup_manage_page.dart'; import 'package:akuCommunity/pages/goods_deto_page/goods_deto_page.dart'; import 'package:akuCommunity/pages/industry_committee/industry_committee_page.dart'; import 'package:akuCommunity/pages/life_pay/life_pay_page.dart'; +import 'package:akuCommunity/pages/notice_page/notice_page.dart'; import 'package:akuCommunity/pages/open_door_page/open_door_page.dart'; import 'package:akuCommunity/pages/opening_code_page/opening_code_page.dart'; import 'package:akuCommunity/pages/questionnaire_page/questionnaire_page.dart'; @@ -26,6 +28,7 @@ import 'package:akuCommunity/routers/page_routers.dart'; import 'widget/property_card.dart'; import 'widget/property_bar.dart'; import 'widget/property_activity_card.dart'; +import 'package:akuCommunity/utils/headers.dart'; class PropertyIndex extends StatefulWidget { PropertyIndex({Key key}) : super(key: key); @@ -163,28 +166,31 @@ class _PropertyIndexState extends State } void activityRouter() { - Navigator.pushNamed(context, PageName.activities_page.toString(), - arguments: Bundle()..putBool('isVote', false)); + ActivitiesPage( + bundle: Bundle()..putBool('isVote', false), + ).to; } void activityDetailsRouter(String imagePath, title, bool isOver, isVote, isVoteOver, List memberList) { - Navigator.pushNamed(context, PageName.activities_details_page.toString(), - arguments: Bundle() - ..putMap('details', { - 'title': title, - 'imagePath': imagePath, - 'isOver': isOver, - 'isVote': isVote, - 'isVoteOver': isVoteOver, - 'memberList': memberList - })); + ActivitiesDetailsPage( + bundle: Bundle() + ..putMap('details', { + 'title': title, + 'imagePath': imagePath, + 'isOver': isOver, + 'isVote': isVote, + 'isVoteOver': isVoteOver, + 'memberList': memberList + }), + ).to; } void noticeRouter(String theme, imagePath) { - Navigator.pushNamed(context, PageName.notice_page.toString(), - arguments: Bundle() - ..putMap('details', {'title': theme, 'imagePath': imagePath})); + NoticePage( + bundle: Bundle() + ..putMap('details', {'title': theme, 'imagePath': imagePath}), + ).to; } @override diff --git a/lib/pages/property/widget/property_activity_card.dart b/lib/pages/property/widget/property_activity_card.dart index 726ee734..60c171d0 100644 --- a/lib/pages/property/widget/property_activity_card.dart +++ b/lib/pages/property/widget/property_activity_card.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:image_stack/image_stack.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; class PropertyActivityCard extends StatelessWidget { diff --git a/lib/pages/property/widget/property_bar.dart b/lib/pages/property/widget/property_bar.dart index 41ce7310..c339425d 100644 --- a/lib/pages/property/widget/property_bar.dart +++ b/lib/pages/property/widget/property_bar.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/sliver_app_bar_delegate.dart'; class PropertyBar extends StatelessWidget { diff --git a/lib/pages/property/widget/property_card.dart b/lib/pages/property/widget/property_card.dart index ae50ef6b..bf006c57 100644 --- a/lib/pages/property/widget/property_card.dart +++ b/lib/pages/property/widget/property_card.dart @@ -1,8 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; +import 'package:get/get.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:akuCommunity/base/assets_image.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; class PropertyCard extends StatelessWidget { PropertyCard({Key key}) : super(key: key); @@ -54,7 +55,7 @@ class PropertyCard extends StatelessWidget { ), ), onPressed: () { - Navigator.of(context).pop(); + Get.back(); }, ), CupertinoDialogAction( @@ -68,7 +69,7 @@ class PropertyCard extends StatelessWidget { ), onPressed: () { _phoneCall('tel:$url'); - Navigator.pop(context); + Get.back(); }, ), ], diff --git a/lib/pages/questionnaire_page/questionnaire_details_page/questionnaire_details_page.dart b/lib/pages/questionnaire_page/questionnaire_details_page/questionnaire_details_page.dart index 456bb28d..74c5054d 100644 --- a/lib/pages/questionnaire_page/questionnaire_details_page/questionnaire_details_page.dart +++ b/lib/pages/questionnaire_page/questionnaire_details_page/questionnaire_details_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_html/flutter_html.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; diff --git a/lib/pages/questionnaire_page/questionnaire_page.dart b/lib/pages/questionnaire_page/questionnaire_page.dart index 9b7daf65..72fccac4 100644 --- a/lib/pages/questionnaire_page/questionnaire_page.dart +++ b/lib/pages/questionnaire_page/questionnaire_page.dart @@ -1,9 +1,11 @@ +import 'package:akuCommunity/pages/questionnaire_page/questionnaire_details_page/questionnaire_details_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/community_card.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; +import 'package:akuCommunity/utils/headers.dart'; class QuestionnairePage extends StatefulWidget { QuestionnairePage({Key key}) : super(key: key); @@ -72,12 +74,11 @@ class _QuestionnairePageState extends State { } void detailsRouter(String imagePath, title) { - Navigator.pushNamed(context, PageName.questionnaire_details_page.toString(), - arguments: Bundle() + QuestionnaireDetailsPage(bundle: Bundle() ..putMap('details', { 'title': title, 'imagePath': imagePath, - })); + }),).to; } @override diff --git a/lib/pages/setting_page/about_page/about_page.dart b/lib/pages/setting_page/about_page/about_page.dart index 516228a4..6f5e65b8 100644 --- a/lib/pages/setting_page/about_page/about_page.dart +++ b/lib/pages/setting_page/about_page/about_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; class AboutPage extends StatelessWidget { diff --git a/lib/pages/setting_page/agreement_page/agreement_page.dart b/lib/pages/setting_page/agreement_page/agreement_page.dart index 16c54052..80488c28 100644 --- a/lib/pages/setting_page/agreement_page/agreement_page.dart +++ b/lib/pages/setting_page/agreement_page/agreement_page.dart @@ -1,4 +1,4 @@ -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:flutter/material.dart'; class AgreementPage extends StatefulWidget { diff --git a/lib/pages/setting_page/agreement_page/privacy_page.dart b/lib/pages/setting_page/agreement_page/privacy_page.dart index a7816060..4a13f0c2 100644 --- a/lib/pages/setting_page/agreement_page/privacy_page.dart +++ b/lib/pages/setting_page/agreement_page/privacy_page.dart @@ -1,4 +1,4 @@ -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:flutter/material.dart'; class PrivacyPage extends StatefulWidget { diff --git a/lib/pages/setting_page/feedback_page/feedback_page.dart b/lib/pages/setting_page/feedback_page/feedback_page.dart index cf0c3e6c..a4b1d10c 100644 --- a/lib/pages/setting_page/feedback_page/feedback_page.dart +++ b/lib/pages/setting_page/feedback_page/feedback_page.dart @@ -4,9 +4,10 @@ import 'package:bot_toast/bot_toast.dart'; import 'package:flustars/flustars.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'package:akuCommunity/widget/common_image_picker.dart'; +import 'package:get/get.dart'; class FeedBackPage extends StatefulWidget { FeedBackPage({Key key}) : super(key: key); @@ -72,8 +73,8 @@ class _FeedBackPageState extends State { Future.delayed(Duration(milliseconds: 1000 + Random().nextInt(1000)), () { BotToast.showText(text:'提交成功'); - Navigator.pop(context); - Navigator.pop(context); + Get.back(); + Get.back(); }); } }, diff --git a/lib/pages/setting_page/invite_page/invite_page.dart b/lib/pages/setting_page/invite_page/invite_page.dart index 2e84282f..5e24cc15 100644 --- a/lib/pages/setting_page/invite_page/invite_page.dart +++ b/lib/pages/setting_page/invite_page/invite_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:qr_flutter/qr_flutter.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; class InvitePage extends StatelessWidget { diff --git a/lib/pages/setting_page/settings_page.dart b/lib/pages/setting_page/settings_page.dart index f27b12be..8f8caae2 100644 --- a/lib/pages/setting_page/settings_page.dart +++ b/lib/pages/setting_page/settings_page.dart @@ -79,7 +79,7 @@ class _SettingsPageState extends State { cancelButton: CupertinoButton( child: Text('取消'), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), ); @@ -198,7 +198,7 @@ class _SettingsPageState extends State { cancelButton: CupertinoButton( child: Text('取消'), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), ); diff --git a/lib/pages/sign/sign_in_page.dart b/lib/pages/sign/sign_in_page.dart index 432f200f..a269404c 100644 --- a/lib/pages/sign/sign_in_page.dart +++ b/lib/pages/sign/sign_in_page.dart @@ -13,10 +13,11 @@ import 'package:common_utils/common_utils.dart'; import 'package:flustars/flustars.dart' show TextUtil; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; class SignInPage extends StatefulWidget { @@ -72,7 +73,7 @@ class _SignInPageState extends State { Future.delayed( Duration(milliseconds: 1000 + Random().nextInt(500)), () { - Navigator.pop(context); + Get.back(); (_phone.text == '18067170899') && (_code.text == '123456') ? ARoute.push(context, UserAuthenticationPage()) @@ -84,7 +85,7 @@ class _SignInPageState extends State { CupertinoDialogAction( child: Text('拒绝'), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), ], diff --git a/lib/pages/sign/user_authentication_page.dart b/lib/pages/sign/user_authentication_page.dart index 838d83ee..ab0a1599 100644 --- a/lib/pages/sign/user_authentication_page.dart +++ b/lib/pages/sign/user_authentication_page.dart @@ -4,8 +4,9 @@ import 'package:ani_route/ani_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; +import 'package:get/get.dart'; import 'package:provider/provider.dart'; class UserAuthenticationPage extends StatefulWidget { @@ -35,7 +36,7 @@ class _UserAuthenticationPageState extends State { leading: IconButton( icon: Icon(AntDesign.left, size: 40.sp), onPressed: () { - Navigator.pop(context); + Get.back(); }, ), actions: [ diff --git a/lib/pages/things_page/things_create_page/things_create_page.dart b/lib/pages/things_page/things_create_page/things_create_page.dart index c6d364e0..1036294a 100644 --- a/lib/pages/things_page/things_create_page/things_create_page.dart +++ b/lib/pages/things_page/things_create_page/things_create_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'package:akuCommunity/routers/page_routers.dart'; 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 index a12c83dc..996184d6 100644 --- a/lib/pages/things_page/things_detail_page/things_detail_page.dart +++ b/lib/pages/things_page/things_detail_page/things_detail_page.dart @@ -1,6 +1,7 @@ +import 'package:akuCommunity/pages/things_page/things_evaluate_page/things_evaluate_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/expandable_text.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; @@ -17,9 +18,9 @@ class ThingsDetailPage extends StatefulWidget { class _ThingsDetailPageState extends State { void againRouter() { - Navigator.pushNamed(context, PageName.things_evaluate_page.toString(), - arguments: Bundle() - ..putMap('details', {'title': '继续提问', 'isShow': false})); + ThingsEvaluatePage( + bundle: Bundle()..putMap('details', {'title': '继续提问', 'isShow': false}), + ).to; } Widget _containerCard( @@ -69,13 +70,12 @@ class _ThingsDetailPageState extends State { return Positioned( bottom: 0, child: InkWell( - onTap: (){ - switch (widget.bundle.getMap('things')['isRepair'] ) { + onTap: () { + switch (widget.bundle.getMap('things')['isRepair']) { case true: - break; case false: - againRouter(); + againRouter(); break; default: } 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 index 0143dfee..667716cb 100644 --- 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 @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'image_horizontal_list.dart'; import 'goods_info_card_button.dart'; 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 index 63ec5f02..d0e765ca 100644 --- 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 @@ -1,7 +1,9 @@ +import 'package:akuCommunity/pages/goods_deto_page/deto_code_page/deto_code_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; +import 'package:get/get.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:akuCommunity/routers/page_routers.dart'; @@ -42,7 +44,7 @@ class GoodsInfoCardButton extends StatelessWidget { ), ), onPressed: () { - Navigator.of(context).pop(); + Get.back(); }, ), CupertinoDialogAction( @@ -56,7 +58,7 @@ class GoodsInfoCardButton extends StatelessWidget { ), onPressed: () { _phoneCall('tel:$url'); - Navigator.pop(context); + Get.back(); }, ), ], @@ -85,8 +87,7 @@ class GoodsInfoCardButton extends StatelessWidget { onTap: () { switch (_listButton[index]['title']) { case '查看二维码': - Navigator.pushNamed( - context, PageName.deto_code_page.toString()); + DetoCodePage().to; break; case '搬家公司': _showDialog(context, '0574-88467897'); 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 index 6e0b1e19..66f56b9e 100644 --- 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 @@ -1,7 +1,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/fade_route.dart'; import 'package:akuCommunity/widget/gallery_photo_view_wrapper.dart'; diff --git a/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart b/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart index 3568d767..bfed7c97 100644 --- a/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart +++ b/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:smooth_star_rating/smooth_star_rating.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'package:akuCommunity/routers/page_routers.dart'; diff --git a/lib/pages/things_page/things_page.dart b/lib/pages/things_page/things_page.dart index 8b3abd3c..77536c1c 100644 --- a/lib/pages/things_page/things_page.dart +++ b/lib/pages/things_page/things_page.dart @@ -1,7 +1,8 @@ +import 'package:akuCommunity/pages/things_page/things_create_page/things_create_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:akuCommunity/routers/page_routers.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'widget/things_app_bar.dart'; import 'widget/things_list.dart'; @@ -130,12 +131,13 @@ class _ThingsPageState extends State with TickerProviderStateMixin { break; default: } - Navigator.pushNamed(context, PageName.things_create_page.toString(), - arguments: Bundle() - ..putMap('create', { - 'title': widget.bundle.getMap('things')['title'], - 'isIdea': isIdea - })); + ThingsCreatePage( + bundle: Bundle() + ..putMap('create', { + 'title': widget.bundle.getMap('things')['title'], + 'isIdea': isIdea + }), + ).to; }, child: Container( alignment: Alignment.center, diff --git a/lib/pages/things_page/widget/things_app_bar.dart b/lib/pages/things_page/widget/things_app_bar.dart index 0c046984..855267a5 100644 --- a/lib/pages/things_page/widget/things_app_bar.dart +++ b/lib/pages/things_page/widget/things_app_bar.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; +import 'package:get/get.dart'; class ThingsAppBar extends StatelessWidget { final String title, subtitle; @@ -22,7 +23,7 @@ class ThingsAppBar extends StatelessWidget { elevation: 0, backgroundColor: Colors.white, leading: InkWell( - onTap: () => Navigator.pop(context), + onTap: () => Get.back(), child: Icon( AntDesign.left, size: 45.sp, diff --git a/lib/pages/things_page/widget/things_card.dart b/lib/pages/things_page/widget/things_card.dart index 7e50729d..a9d20e51 100644 --- a/lib/pages/things_page/widget/things_card.dart +++ b/lib/pages/things_page/widget/things_card.dart @@ -1,6 +1,7 @@ +import 'package:akuCommunity/pages/things_page/things_detail_page/things_detail_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/widget/expandable_text.dart'; import 'image_grid.dart'; @@ -24,14 +25,15 @@ class ThingsCard extends StatefulWidget { class _ThingsCardState extends State { void detailRouter() { - Navigator.pushNamed(context, PageName.things_detail_page.toString(), - arguments: Bundle() - ..putMap('things', { - 'isRepair':widget.isRepair, - 'content': widget.content, - 'time': widget.time, - 'imageList': widget.imageList, - })); + ThingsDetailPage( + bundle: Bundle() + ..putMap('things', { + 'isRepair': widget.isRepair, + 'content': widget.content, + 'time': widget.time, + 'imageList': widget.imageList, + }), + ).to; } InkWell _inkWellPropose( @@ -74,7 +76,7 @@ class _ThingsCardState extends State { expand: false, ), SizedBox(height: 29.w), - imageList.length != 0 ? ImageGrid(imageList):SizedBox() + imageList.length != 0 ? ImageGrid(imageList) : SizedBox() ], ), ), diff --git a/lib/pages/things_page/widget/things_list.dart b/lib/pages/things_page/widget/things_list.dart index 77f1529a..1cd1c31d 100644 --- a/lib/pages/things_page/widget/things_list.dart +++ b/lib/pages/things_page/widget/things_list.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'things_card.dart'; class ThingsList extends StatefulWidget { diff --git a/lib/pages/total_application_page/total_applications_page.dart b/lib/pages/total_application_page/total_applications_page.dart index 1b5990ba..97d802ed 100644 --- a/lib/pages/total_application_page/total_applications_page.dart +++ b/lib/pages/total_application_page/total_applications_page.dart @@ -1,9 +1,21 @@ +import 'package:akuCommunity/pages/activities_page/activities_page.dart'; +import 'package:akuCommunity/pages/convenient_phone/convenient_phone_page.dart'; +import 'package:akuCommunity/pages/fitup_manage/fitup_manage_page.dart'; +import 'package:akuCommunity/pages/goods_deto_page/goods_deto_page.dart'; +import 'package:akuCommunity/pages/goods_manage_page/goods_manage_page.dart'; +import 'package:akuCommunity/pages/industry_committee/industry_committee_page.dart'; +import 'package:akuCommunity/pages/life_pay/life_pay_page.dart'; +import 'package:akuCommunity/pages/market/market_detail_page/market_detail_page.dart'; import 'package:akuCommunity/pages/one_alarm/widget/alarm_page.dart'; import 'package:akuCommunity/pages/open_door_page/open_door_page.dart'; +import 'package:akuCommunity/pages/opening_code_page/opening_code_page.dart'; +import 'package:akuCommunity/pages/questionnaire_page/questionnaire_page.dart'; +import 'package:akuCommunity/pages/things_page/things_page.dart'; +import 'package:akuCommunity/pages/visitor_access_page/visitor_access_page.dart'; import 'package:ani_route/ani_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:get/get.dart'; @@ -109,96 +121,87 @@ class _TotalApplicationsPageState extends State { case '服饰箱包': case '母婴玩具': case '饮料酒水': - Navigator.pushNamed( - context, PageName.market_detail_page.toString(), - arguments: Bundle() - ..putString('title', gridList[index]['title'])); + MarketDetailPage( + bundle: Bundle() + ..putString('title', gridList[index]['title']), + ).to; break; case '一键开门': Get.to(OpenDoorPage()); break; case '开门码': - Navigator.pushNamed( - context, PageName.opening_code_page.toString()); + OpeningCodePage().to; break; case '访客通行': case '我的访客': - Navigator.pushNamed( - context, PageName.visitor_access_page.toString()); + VisitorAccessPage().to; break; case '报事报修': - Navigator.pushNamed( - context, PageName.things_page.toString(), - arguments: Bundle() - ..putMap('things', { - 'title': '报事报修', - })); + ThingsPage( + bundle: Bundle() + ..putMap('things', { + 'title': '报事报修', + }), + ).to; break; case '生活缴费': case '我的缴费': - Navigator.pushNamed( - context, PageName.life_pay_page.toString()); + LifePayPage().to; break; case '业委会': - Navigator.pushNamed(context, - PageName.industry_committee_page.toString()); + IndustryCommitteePage().to; break; case '建议咨询': - Navigator.pushNamed( - context, PageName.things_page.toString(), - arguments: Bundle() - ..putMap('things', { - 'title': '建议咨询', - 'treeList': >[ - {'name': '您的建议'}, - {'name': '您的咨询'}, - ] - })); + ThingsPage( + bundle: Bundle() + ..putMap('things', { + 'title': '建议咨询', + 'treeList': >[ + {'name': '您的建议'}, + {'name': '您的咨询'}, + ] + }), + ).to; break; case '便民电话': - Navigator.pushNamed( - context, PageName.convenient_phone_page.toString()); + ConvenientPhonePage().to; break; case '活动投票': - Navigator.pushNamed( - context, PageName.activities_page.toString(), - arguments: Bundle()..putBool('isVote', true)); + ActivitiesPage( + bundle: Bundle()..putBool('isVote', true), + ).to; break; case '社区活动': - Navigator.pushNamed( - context, PageName.activities_page.toString(), - arguments: Bundle()..putBool('isVote', false)); + ActivitiesPage( + bundle: Bundle()..putBool('isVote', false), + ).to; break; case '物品出户': - Navigator.pushNamed( - context, PageName.goods_deto_page.toString()); + GoodsDetoPage().to; break; case '投诉表扬': - Navigator.pushNamed( - context, PageName.things_page.toString(), - arguments: Bundle() - ..putMap('things', { - 'title': '投诉表扬', - 'treeList': >[ - {'name': '您的表扬'}, - {'name': '您的投诉'}, - ] - })); + ThingsPage( + bundle: Bundle() + ..putMap('things', { + 'title': '投诉表扬', + 'treeList': >[ + {'name': '您的表扬'}, + {'name': '您的投诉'}, + ] + }), + ).to; break; case '问卷调查': - Navigator.pushNamed( - context, PageName.questionnaire_page.toString()); + QuestionnairePage().to; break; case '装修管理': - Navigator.pushNamed( - context, PageName.fitup_manage_page.toString()); + FitupManagePage().to; break; case '借还管理': - Navigator.pushNamed( - context, PageName.goods_manage_page.toString()); + GoodsManagePage().to; break; case '一键报警': - ARoute.push(context, AlarmPage()); + AlarmPage().to; break; default: break; diff --git a/lib/pages/total_application_page/widget/applications_bar.dart b/lib/pages/total_application_page/widget/applications_bar.dart index 97e8dfa6..86e8c962 100644 --- a/lib/pages/total_application_page/widget/applications_bar.dart +++ b/lib/pages/total_application_page/widget/applications_bar.dart @@ -2,7 +2,8 @@ import 'package:akuCommunity/widget/search_bar_delegate.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; +import 'package:get/get.dart'; class ApplicationsBar extends StatelessWidget { const ApplicationsBar({Key key}) : super(key: key); @@ -15,7 +16,7 @@ class ApplicationsBar extends StatelessWidget { titleSpacing: 0, backgroundColor: Colors.white, leading: InkWell( - onTap: () => Navigator.pop(context), + onTap: () => Get.back(), child: Icon( AntDesign.left, size: 45.sp, diff --git a/lib/pages/visitor_access_page/visitor_access_page.dart b/lib/pages/visitor_access_page/visitor_access_page.dart index 03dff92e..cde8b00a 100644 --- a/lib/pages/visitor_access_page/visitor_access_page.dart +++ b/lib/pages/visitor_access_page/visitor_access_page.dart @@ -3,7 +3,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:akuCommunity/base/assets_image.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; import 'package:akuCommunity/widget/common_input.dart'; diff --git a/lib/pages/visitor_access_page/visitor_pass_page.dart b/lib/pages/visitor_access_page/visitor_pass_page.dart index faa9e010..0ecc11b6 100644 --- a/lib/pages/visitor_access_page/visitor_pass_page.dart +++ b/lib/pages/visitor_access_page/visitor_pass_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/dotted_line.dart'; import 'package:akuCommunity/widget/common_app_bar.dart'; diff --git a/lib/pages/visitor_access_page/widget/record_item.dart b/lib/pages/visitor_access_page/widget/record_item.dart index 6be9caed..f003e5c9 100644 --- a/lib/pages/visitor_access_page/widget/record_item.dart +++ b/lib/pages/visitor_access_page/widget/record_item.dart @@ -1,7 +1,8 @@ +import 'package:akuCommunity/pages/visitor_access_page/visitor_pass_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; class RecordItem extends StatefulWidget { @@ -17,7 +18,7 @@ class _RecordItemState extends State @override bool get wantKeepAlive => true; void recordPass() { - Navigator.pushNamed(context, PageName.visitor_pass_page.toString()); + VisitorPassPage().to; } Positioned _positionedAgain() { diff --git a/lib/routers/page_routers.dart b/lib/routers/page_routers.dart index 36efccfd..d190cd1f 100644 --- a/lib/routers/page_routers.dart +++ b/lib/routers/page_routers.dart @@ -1,171 +1,4 @@ -import 'package:akuCommunity/pages/one_alarm/widget/alarm_page.dart'; -import 'package:akuCommunity/pages/setting_page/agreement_page/privacy_page.dart'; -import 'package:fluro/fluro.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/pages/market/market_detail_page/market_detail_page.dart'; -import 'package:akuCommunity/pages/market/market_cart_page/market_cart_page.dart'; -import 'package:akuCommunity/pages/goods_details/goods_details_page.dart'; -import 'package:akuCommunity/pages//goods_details/view_comments_page.dart'; -import 'package:akuCommunity/pages/community/note_create_page.dart'; -import 'package:akuCommunity/pages/community/topice_detail_page.dart'; -import 'package:akuCommunity/pages/common/common_page.dart'; -import 'package:akuCommunity/pages/personal/order_page.dart'; -import 'package:akuCommunity/pages/personal/order_details_page.dart'; -import 'package:akuCommunity/pages/personal/refund_select_page.dart'; -import 'package:akuCommunity/pages/personal/refund_apply_page.dart'; -import 'package:akuCommunity/pages/personal/evaluate_good_page.dart'; -import 'package:akuCommunity/pages/personal/look_logistics_page.dart'; -import 'package:akuCommunity/pages/sign/sign_in_page.dart'; -import 'package:akuCommunity/pages/sign/user_authentication_page.dart'; -import 'package:akuCommunity/pages/confirm_order_page/confirm_order_page.dart'; -import 'package:akuCommunity/pages/confirm_order_page/pay_order_page.dart'; - -import 'package:akuCommunity/pages/scan/scan_page.dart'; - -import 'package:akuCommunity/pages/message_center_page/message_center_page.dart'; -import 'package:akuCommunity/pages/message_center_page/system_message_page/system_message_page.dart'; -import 'package:akuCommunity/pages/message_center_page/comment_message_page/comment_message_page.dart'; -import 'package:akuCommunity/pages/message_center_page/shop_message_page/shop_message_page.dart'; -import 'package:akuCommunity/pages/message_center_page/system_message_page/system_details_page/system_details_page.dart'; - -import 'package:akuCommunity/pages/certification_page/certification_page.dart'; - -import 'package:akuCommunity/pages/visitor_access_page/visitor_access_page.dart'; -import 'package:akuCommunity/pages/visitor_access_page/visitor_record_page.dart'; -import 'package:akuCommunity/pages/visitor_access_page/visitor_pass_page.dart'; - -import 'package:akuCommunity/pages/life_pay/life_pay_page.dart'; -import 'package:akuCommunity/pages/life_pay/life_pay_record_page/life_pay_record_page.dart'; -import 'package:akuCommunity/pages/life_pay/life_pay_bill_page/life_pay_bill_page.dart'; -import 'package:akuCommunity/pages/life_pay/life_pay_info_page/life_pay_info_page.dart'; - -import 'package:akuCommunity/pages/industry_committee/industry_committee_page.dart'; -import 'package:akuCommunity/pages/industry_committee/committee_mailbox/committee_mailbox_page.dart'; - -import 'package:akuCommunity/pages/convenient_phone/convenient_phone_page.dart'; - -import 'package:akuCommunity/pages/total_application_page/total_applications_page.dart'; - -import 'package:akuCommunity/pages/questionnaire_page/questionnaire_page.dart'; -import 'package:akuCommunity/pages/questionnaire_page/questionnaire_details_page/questionnaire_details_page.dart'; - -import 'package:akuCommunity/pages/goods_manage_page/goods_manage_page.dart'; -import 'package:akuCommunity/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart'; - -import 'package:akuCommunity/pages/opening_code_page/opening_code_page.dart'; - -import 'package:akuCommunity/pages/goods_deto_page/goods_deto_page.dart'; -import 'package:akuCommunity/pages/goods_deto_page/deto_code_page/deto_code_page.dart'; -import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/deto_create_page.dart'; - -import 'package:akuCommunity/pages/activities_page/activities_page.dart'; -import 'package:akuCommunity/pages/activities_page/activities_details_page/activities_details_page.dart'; -import 'package:akuCommunity/pages/activities_page/member_list_page/member_list_page.dart'; - -import 'package:akuCommunity/pages/notice_page/notice_page.dart'; - -import 'package:akuCommunity/pages/mine_house_page/mine_house_page.dart'; -import 'package:akuCommunity/pages/mine_house_page/house_authenticate_page/house_authenticate_page.dart'; - -import 'package:akuCommunity/pages/mine_car_page/mine_car_page.dart'; -import 'package:akuCommunity/pages/mine_car_page/car_add_page/car_add_page.dart'; -import 'package:akuCommunity/pages/mine_car_page/select_community_page/select_community_page.dart'; -import 'package:akuCommunity/pages/mine_car_page/select_parking_page/select_parking_page.dart'; - -import 'package:akuCommunity/pages/market_class/market_class_page.dart'; - -import 'package:akuCommunity/pages/address_page/address_page.dart'; -import 'package:akuCommunity/pages/address_page/address_edit_page.dart'; - -import 'package:akuCommunity/pages/fitup_manage/fitup_manage_page.dart'; - -import 'package:akuCommunity/pages/invoice/invoice_page.dart'; -import 'package:akuCommunity/pages/setting_page/about_page/about_page.dart'; -import 'package:akuCommunity/pages/setting_page/feedback_page/feedback_page.dart'; -import 'package:akuCommunity/pages/setting_page/invite_page/invite_page.dart'; -import 'package:akuCommunity/pages/setting_page/agreement_page/agreement_page.dart'; - -import 'package:akuCommunity/pages/things_page/things_page.dart'; -import 'package:akuCommunity/pages/things_page/things_detail_page/things_detail_page.dart'; -import 'package:akuCommunity/pages/things_page/things_create_page/things_create_page.dart'; -import 'package:akuCommunity/pages/things_page/things_evaluate_page/things_evaluate_page.dart'; - -enum PageName { - market_detail_page, - market_cart_page, - goods_details_page, - view_comments_page, - invoice_page, - common_page, - note_create_page, - topice_detail_page, - order_page, - order_details_page, - refund_select_page, - refund_apply_page, - evaluate_good_page, - look_logistics_page, - sign_in_page, - user_authentication_page, - confirm_order_page, - pay_order_page, - pay_success_page, - scan_page, - message_center_page, - system_message_page, - comment_message_page, - shop_message_page, - system_details_page, - open_door_page, - certification_page, - visitor_access_page, - visitor_record_page, - visitor_pass_page, - life_pay_page, - life_pay_record_page, - life_pay_bill_page, - life_pay_info_page, - industry_committee_page, - committee_mailbox_page, - convenient_phone_page, - total_applications_page, - questionnaire_page, - questionnaire_details_page, - goods_manage_page, - mine_goods_page, - opening_code_page, - goods_deto_page, - deto_code_page, - deto_create_page, - activities_page, - activities_details_page, - member_list_page, - notice_page, - mine_house_page, - house_authenticate_page, - mine_car_page, - car_add_page, - select_community_page, - select_parking_page, - market_class_page, - address_page, - address_edit_page, - one_alarm_page, - fitup_manage_page, - setting_page, - about_page, - feedback_page, - invite_page, - things_page, - things_detail_page, - things_create_page, - things_evaluate_page, - agreement_page, - privacy_page, - alarm_page, -} class Bundle { Map _map = {}; @@ -205,142 +38,3 @@ class Bundle { } } -typedef Widget HandlerFunc( - BuildContext context, Map> params); - -typedef Widget PageBuilderFunc(Bundle bundle); - -class PageBuilder { - final PageBuilderFunc builder; - HandlerFunc handlerFunc; - PageBuilder({this.builder}) { - this.handlerFunc = (context, _) { - return this.builder(ModalRoute.of(context).settings.arguments as Bundle); - }; - } - Handler getHandler() { - return Handler(handlerFunc: this.handlerFunc); - } -} - -final Map pageRoutes = { - PageName.market_detail_page: - PageBuilder(builder: (bundle) => MarketDetailPage(bundle: bundle)), - PageName.market_cart_page: PageBuilder(builder: (bundle) => MarketCartPage()), - PageName.goods_details_page: - PageBuilder(builder: (bundle) => GoodsDetailsPage(bundle: bundle)), - PageName.view_comments_page: - PageBuilder(builder: (bundle) => ViewCommentsPage()), - PageName.invoice_page: - PageBuilder(builder: (bundle) => InvoicePage(bundle: bundle)), - PageName.note_create_page: PageBuilder(builder: (bundle) => NoteCreatePage()), - PageName.topice_detail_page: - PageBuilder(builder: (bundle) => TopiceDetailPage(bundle: bundle)), - PageName.order_page: - PageBuilder(builder: (bundle) => OrderPage(bundle: bundle)), - PageName.order_details_page: - PageBuilder(builder: (bundle) => OrderDetailsPage(bundle: bundle)), - PageName.refund_select_page: - PageBuilder(builder: (bundle) => RefundSelectPage(bundle: bundle)), - PageName.refund_apply_page: - PageBuilder(builder: (bundle) => RefundApplyPage(bundle: bundle)), - PageName.evaluate_good_page: - PageBuilder(builder: (bundle) => EvaluateGoodPage(bundle: bundle)), - PageName.look_logistics_page: - PageBuilder(builder: (bundle) => LookLogisticsPage()), - PageName.sign_in_page: PageBuilder(builder: (bundle) => SignInPage()), - PageName.user_authentication_page: - PageBuilder(builder: (bundle) => UserAuthenticationPage()), - PageName.common_page: - PageBuilder(builder: (bundle) => CommonPage(bundle: bundle)), - PageName.privacy_page: PageBuilder(builder: (bundle) => PrivacyPage()), - PageName.confirm_order_page: - PageBuilder(builder: (bundle) => ConfirmOrderPage(bundle: bundle)), - PageName.pay_order_page: - PageBuilder(builder: (bundle) => PayOrderPage(bundle: bundle)), - PageName.scan_page: PageBuilder(builder: (bundle) => ScanPage()), - PageName.message_center_page: - PageBuilder(builder: (bundle) => MessageCenterPage()), - PageName.system_message_page: - PageBuilder(builder: (bundle) => SystemMessagePage()), - PageName.comment_message_page: - PageBuilder(builder: (bundle) => CommentMessagePage()), - PageName.shop_message_page: - PageBuilder(builder: (bundle) => ShopMessagePage()), - PageName.system_details_page: - PageBuilder(builder: (bundle) => SystemDetailsPage(bundle: bundle)), - PageName.certification_page: - PageBuilder(builder: (bundle) => CertificationPage()), - PageName.visitor_access_page: - PageBuilder(builder: (bundle) => VisitorAccessPage()), - PageName.visitor_record_page: - PageBuilder(builder: (bundle) => VisitorRecordPage()), - PageName.visitor_pass_page: - PageBuilder(builder: (bundle) => VisitorPassPage()), - PageName.life_pay_page: PageBuilder(builder: (bundle) => LifePayPage()), - PageName.life_pay_record_page: - PageBuilder(builder: (bundle) => LifePayRecordPage()), - PageName.life_pay_bill_page: - PageBuilder(builder: (bundle) => LifePayBillPage()), - PageName.life_pay_info_page: - PageBuilder(builder: (bundle) => LifePayInfoPage(bundle: bundle)), - PageName.industry_committee_page: - PageBuilder(builder: (bundle) => IndustryCommitteePage()), - PageName.committee_mailbox_page: - PageBuilder(builder: (bundle) => CommitteeMailboxPage()), - PageName.convenient_phone_page: - PageBuilder(builder: (bundle) => ConvenientPhonePage()), - PageName.total_applications_page: - PageBuilder(builder: (bundle) => TotalApplicationsPage()), - PageName.questionnaire_page: - PageBuilder(builder: (bundle) => QuestionnairePage()), - PageName.questionnaire_details_page: PageBuilder( - builder: (bundle) => QuestionnaireDetailsPage(bundle: bundle)), - PageName.goods_manage_page: - PageBuilder(builder: (bundle) => GoodsManagePage()), - PageName.mine_goods_page: PageBuilder(builder: (bundle) => MineGoodsPage()), - PageName.opening_code_page: - PageBuilder(builder: (bundle) => OpeningCodePage()), - PageName.goods_deto_page: PageBuilder(builder: (bundle) => GoodsDetoPage()), - PageName.deto_code_page: PageBuilder(builder: (bundle) => DetoCodePage()), - PageName.deto_create_page: PageBuilder(builder: (bundle) => DetoCreatePage()), - PageName.activities_page: - PageBuilder(builder: (bundle) => ActivitiesPage(bundle: bundle)), - PageName.activities_details_page: - PageBuilder(builder: (bundle) => ActivitiesDetailsPage(bundle: bundle)), - PageName.member_list_page: PageBuilder(builder: (bundle) => MemberListPage()), - PageName.notice_page: - PageBuilder(builder: (bundle) => NoticePage(bundle: bundle)), - PageName.mine_house_page: PageBuilder(builder: (bundle) => MineHousePage()), - PageName.house_authenticate_page: - PageBuilder(builder: (bundle) => HouseAuthenticatePage()), - PageName.mine_car_page: - PageBuilder(builder: (bundle) => MineCarPage(bundle: bundle)), - PageName.car_add_page: PageBuilder(builder: (bundle) => CarAddPage()), - PageName.select_community_page: - PageBuilder(builder: (bundle) => SelectCommunityPage()), - PageName.select_parking_page: - PageBuilder(builder: (bundle) => SelectParkingPage(bundle: bundle)), - PageName.market_class_page: - PageBuilder(builder: (bundle) => MarketClassPage()), - PageName.address_page: PageBuilder(builder: (bundle) => AddressPage()), - PageName.address_edit_page: - PageBuilder(builder: (bundle) => AddressEditPage(bundle: bundle)), - PageName.fitup_manage_page: - PageBuilder(builder: (bundle) => FitupManagePage()), - PageName.about_page: PageBuilder(builder: (bundle) => AboutPage()), - PageName.invite_page: PageBuilder(builder: (bundle) => InvitePage()), - PageName.feedback_page: PageBuilder(builder: (bundle) => FeedBackPage()), - PageName.agreement_page: PageBuilder(builder: (bundle) => AgreementPage()), - PageName.things_page: - PageBuilder(builder: (bundle) => ThingsPage(bundle: bundle)), - PageName.things_detail_page: - PageBuilder(builder: (bundle) => ThingsDetailPage(bundle: bundle)), - PageName.things_create_page: - PageBuilder(builder: (bundle) => ThingsCreatePage(bundle: bundle)), - PageName.things_evaluate_page: - PageBuilder(builder: (bundle) => ThingsEvaluatePage(bundle: bundle)), - PageName.alarm_page: PageBuilder( - builder: (bundle) => AlarmPage(bundle: bundle), - ) -}; diff --git a/lib/routers/router_init.dart b/lib/routers/router_init.dart deleted file mode 100644 index 31f412a3..00000000 --- a/lib/routers/router_init.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:fluro/fluro.dart'; -import 'package:flutter/material.dart' hide Router; -import 'page_routers.dart'; - -class RouterInit { - static final router = Router(); - static final GlobalKey navigatorKey = GlobalKey(); - static setupRouter() { - pageRoutes.forEach((path, handler) { - router.define( - path.toString(), - handler: handler.getHandler(), - transitionType: TransitionType.cupertino, - ); - }); - } -} diff --git a/lib/utils/fade_route.dart b/lib/utils/fade_route.dart index e8288814..80d86b7d 100644 --- a/lib/utils/fade_route.dart +++ b/lib/utils/fade_route.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -class FadeRoute extends PageRouteBuilder { +class FadeRoute extends PageRouteBuilder { final Widget page; FadeRoute({this.page}) : super( diff --git a/lib/utils/headers.dart b/lib/utils/headers.dart new file mode 100644 index 00000000..1464443b --- /dev/null +++ b/lib/utils/headers.dart @@ -0,0 +1,7 @@ +export 'package:flutter_screenutil/flutter_screenutil.dart'; +export 'package:akuCommunity/extensions/page_router.dart'; +// class Screenutil { +// static double length(double lengthNum) => ScreenUtil().setWidth(lengthNum); + +// static double size(double sizeNum) => ScreenUtil().setSp(sizeNum); +// } diff --git a/lib/utils/screenutil.dart b/lib/utils/screenutil.dart deleted file mode 100644 index b51af6bc..00000000 --- a/lib/utils/screenutil.dart +++ /dev/null @@ -1 +0,0 @@ -export 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/widget/activity_card.dart b/lib/widget/activity_card.dart index 61214154..7b4253c2 100644 --- a/lib/widget/activity_card.dart +++ b/lib/widget/activity_card.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:image_stack/image_stack.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; diff --git a/lib/widget/app_bar_action.dart b/lib/widget/app_bar_action.dart index db84e180..5f35f565 100644 --- a/lib/widget/app_bar_action.dart +++ b/lib/widget/app_bar_action.dart @@ -1,6 +1,9 @@ +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:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; class AppBarAction extends StatefulWidget { @@ -40,16 +43,13 @@ class _AppBarActionState extends State { case '扫一扫': break; case '消息': - Navigator.pushNamed( - context, PageName.message_center_page.toString()); + MessageCenterPage().to; break; case '购物车': - Navigator.pushNamed( - context, PageName.market_cart_page.toString()); + MarketCartPage().to; break; case '分类': - Navigator.pushNamed( - context, PageName.market_class_page.toString()); + MarketClassPage().to; break; default: } diff --git a/lib/widget/bee_back_button.dart b/lib/widget/bee_back_button.dart index 8b1aa93b..505932ab 100644 --- a/lib/widget/bee_back_button.dart +++ b/lib/widget/bee_back_button.dart @@ -1,5 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:get/get.dart'; class BeeBackButton extends StatelessWidget { const BeeBackButton({Key key}) : super(key: key); @@ -8,7 +9,7 @@ class BeeBackButton extends StatelessWidget { Widget build(BuildContext context) { return Navigator.canPop(context) ? IconButton( - onPressed: () => Navigator.pop(context), + onPressed: () => Get.back(), icon: Icon( CupertinoIcons.chevron_back, ), diff --git a/lib/widget/bottom_button.dart b/lib/widget/bottom_button.dart index 2a9b68ed..f1672af7 100644 --- a/lib/widget/bottom_button.dart +++ b/lib/widget/bottom_button.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; class BottomButton extends StatefulWidget { diff --git a/lib/widget/cart_count.dart b/lib/widget/cart_count.dart index 0715a21a..c209b684 100644 --- a/lib/widget/cart_count.dart +++ b/lib/widget/cart_count.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:akuCommunity/provider/cart.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/model/aku_shop_model.dart'; class CartCount extends StatelessWidget { diff --git a/lib/widget/circle_trend.dart b/lib/widget/circle_trend.dart index c0eb5f38..eabdadb4 100644 --- a/lib/widget/circle_trend.dart +++ b/lib/widget/circle_trend.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; class CircleTrend extends StatefulWidget { diff --git a/lib/widget/common_app_bar.dart b/lib/widget/common_app_bar.dart index ea970b45..80996b6b 100644 --- a/lib/widget/common_app_bar.dart +++ b/lib/widget/common_app_bar.dart @@ -1,10 +1,16 @@ +import 'package:akuCommunity/pages/address_page/address_edit_page.dart'; +import 'package:akuCommunity/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart'; +import 'package:akuCommunity/pages/life_pay/life_pay_record_page/life_pay_record_page.dart'; +import 'package:akuCommunity/pages/things_page/things_evaluate_page/things_evaluate_page.dart'; +import 'package:akuCommunity/pages/visitor_access_page/visitor_record_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_beautiful_popup/main.dart'; import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/pages/one_alarm/widget/explain_template.dart'; +import 'package:get/get.dart'; class CommonAppBar extends StatelessWidget { final String title, subtitle; @@ -62,7 +68,7 @@ class CommonAppBar extends StatelessWidget { ? Color(0xff333333) : Colors.white, leading: InkWell( - onTap: () => Navigator.pop(context), + onTap: () => Get.back(), child: Icon( AntDesign.left, size: 45.sp, @@ -88,32 +94,30 @@ class CommonAppBar extends StatelessWidget { onTap: () { switch (subtitle) { case '访客记录': - Navigator.pushNamed( - context, PageName.visitor_record_page.toString()); + VisitorRecordPage().to; break; case '缴费记录': - Navigator.pushNamed( - context, PageName.life_pay_record_page.toString()); + LifePayRecordPage().to; break; case '我的借还物品': - Navigator.pushNamed( - context, PageName.mine_goods_page.toString()); + MineGoodsPage().to; break; case '添加新地址': - Navigator.pushNamed( - context, PageName.address_edit_page.toString(), - arguments: Bundle() - ..putMap('details', - {'title': '添加新地址', 'isDelete': false})); + AddressEditPage( + bundle: Bundle() + ..putMap('details', + {'title': '添加新地址', 'isDelete': false}), + ).to; break; case '功能说明': showExplain(context); break; case '评价': - Navigator.pushNamed( - context, PageName.things_evaluate_page.toString(), - arguments: Bundle() - ..putMap('details', {'title': '评价','isShow':true})); + ThingsEvaluatePage( + bundle: Bundle() + ..putMap( + 'details', {'title': '评价', 'isShow': true}), + ).to; break; default: } @@ -142,12 +146,10 @@ class CommonAppBar extends StatelessWidget { fontWeight: FontWeight.w600, fontSize: 28.sp, ), - labelPadding: - EdgeInsets.symmetric(horizontal: 131.5.w), + labelPadding: EdgeInsets.symmetric(horizontal: 131.5.w), indicatorColor: Color(0xffffc40c), indicatorSize: TabBarIndicatorSize.label, - indicatorPadding: - EdgeInsets.symmetric(horizontal: 21.w), + indicatorPadding: EdgeInsets.symmetric(horizontal: 21.w), isScrollable: true, controller: tabController, tabs: List.generate( diff --git a/lib/widget/common_image_picker.dart b/lib/widget/common_image_picker.dart index 79057117..51e36036 100644 --- a/lib/widget/common_image_picker.dart +++ b/lib/widget/common_image_picker.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:multi_image_picker/multi_image_picker.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/base/assets_image.dart'; diff --git a/lib/widget/common_input.dart b/lib/widget/common_input.dart index fa5bb5de..4180bdac 100644 --- a/lib/widget/common_input.dart +++ b/lib/widget/common_input.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; class CommonInput extends StatefulWidget { diff --git a/lib/widget/common_upload_image.dart b/lib/widget/common_upload_image.dart index 59347b04..47813ce2 100644 --- a/lib/widget/common_upload_image.dart +++ b/lib/widget/common_upload_image.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; class CommonUploadImage extends StatefulWidget { diff --git a/lib/widget/community_card.dart b/lib/widget/community_card.dart index 1395bc1f..40fea851 100644 --- a/lib/widget/community_card.dart +++ b/lib/widget/community_card.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:image_stack/image_stack.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; diff --git a/lib/widget/custom_action_sheet.dart b/lib/widget/custom_action_sheet.dart index 6f6e5205..b40bfe06 100644 --- a/lib/widget/custom_action_sheet.dart +++ b/lib/widget/custom_action_sheet.dart @@ -21,8 +21,8 @@ Future showCustomBottomSheet({ elevation: 0, // 透明度 builder: (BuildContext context) { return GestureDetector( - onTap: () { - Navigator.pop(context, -1); + onTap: () { + Navigator.pop(context, -1); }, child: Container( color: Color(0x00ffffff), // 设置颜色后点击事件才有效 diff --git a/lib/widget/gallery_photo_view_wrapper.dart b/lib/widget/gallery_photo_view_wrapper.dart index 4fcee52d..bad7bcd7 100644 --- a/lib/widget/gallery_photo_view_wrapper.dart +++ b/lib/widget/gallery_photo_view_wrapper.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:get/get.dart'; import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view_gallery.dart'; // import 'package:image_gallery_saver/image_gallery_saver.dart'; @@ -87,7 +88,7 @@ class _GalleryPhotoViewWrapperState extends State { color: Colors.white, ), onPressed: () { - Navigator.of(context).pop(); + Get.back(); }, ), ), @@ -113,7 +114,7 @@ class _GalleryPhotoViewWrapperState extends State { return PhotoViewGalleryPageOptions( onTapUp: (BuildContext context, TapUpDetails details, PhotoViewControllerValue controllerValue) { - Navigator.of(context).pop(); + Get.back(); }, imageProvider: NetworkImage(item.resource), // initialScale: PhotoViewComputedScale.contained, diff --git a/lib/widget/goods_card_skeleton.dart b/lib/widget/goods_card_skeleton.dart index 5dffc0bd..9fc0baab 100644 --- a/lib/widget/goods_card_skeleton.dart +++ b/lib/widget/goods_card_skeleton.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:shimmer/shimmer.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; class GoodsCardSkeleton extends StatelessWidget { const GoodsCardSkeleton({Key key}) : super(key: key); diff --git a/lib/widget/goods_specs_sheet.dart b/lib/widget/goods_specs_sheet.dart index a8c9d48c..a59ce212 100644 --- a/lib/widget/goods_specs_sheet.dart +++ b/lib/widget/goods_specs_sheet.dart @@ -1,8 +1,10 @@ +import 'package:akuCommunity/pages/confirm_order_page/confirm_order_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; +import 'package:get/get.dart'; import 'package:provider/provider.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/toast.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/provider/cart.dart'; @@ -119,8 +121,7 @@ class _GoodsSpecsSheetState extends State { Container( margin: EdgeInsets.only(right: 20.w), child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(4.w)), + borderRadius: BorderRadius.all(Radius.circular(4.w)), child: CachedImageWrapper( url: image, height: 180.w, @@ -173,7 +174,7 @@ class _GoodsSpecsSheetState extends State { size: 38.sp, color: Color(0xff999999), ), - onPressed: () => Navigator.of(context).pop(), + onPressed: () => Get.back(), ), ), ], @@ -275,7 +276,7 @@ class _GoodsSpecsSheetState extends State { Widget _inkwellSubmit(String type, CartProvidde model) { return InkWell( onTap: () { - Navigator.of(context).pop(); + Get.back(); switch (type) { case '加入购物车': Toast.globalToast('已添加入购物车'); @@ -283,15 +284,16 @@ class _GoodsSpecsSheetState extends State { widget.itempic); break; case '立即购买': - Navigator.pushNamed(context, PageName.confirm_order_page.toString(), - arguments: Bundle() - ..putMap('cartMap', { - 'itemid': widget.itemid, - 'itemtitle': widget.itemtitle, - 'itemprice': widget.itemprice, - 'itempic': widget.itempic, - 'count': count - })); + ConfirmOrderPage( + bundle: Bundle() + ..putMap('cartMap', { + 'itemid': widget.itemid, + 'itemtitle': widget.itemtitle, + 'itemprice': widget.itemprice, + 'itempic': widget.itempic, + 'count': count + }), + ).to; break; case '请选择规格': Toast.globalToast('已添加入购物车'); @@ -299,9 +301,6 @@ class _GoodsSpecsSheetState extends State { default: } - // Navigator.pushNamed(context, PageName.common_page.toString(), - // arguments: Bundle() - // ..putMap('commentMap', {'title': '确认订单', 'isActions': false})); }, child: Container( decoration: BoxDecoration( diff --git a/lib/widget/grid_button.dart b/lib/widget/grid_button.dart deleted file mode 100644 index 88922280..00000000 --- a/lib/widget/grid_button.dart +++ /dev/null @@ -1,207 +0,0 @@ -import 'package:akuCommunity/pages/open_door_page/open_door_page.dart'; -import 'package:akuCommunity/pages/setting_page/settings_page.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; -import 'package:akuCommunity/routers/page_routers.dart'; -import 'package:get/get.dart'; - -class GridButton extends StatelessWidget { - final List> gridList; - final int count; - GridButton({Key key, this.gridList, this.count}) : super(key: key); - - @override - Widget build(BuildContext context) { - return GridView.builder( - padding: EdgeInsets.zero, - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemCount: gridList.length, - itemBuilder: (BuildContext context, int index) { - return InkWell( - onTap: () { - switch (gridList[index]['title']) { - case '一键开门': - Get.to(OpenDoorPage()); - break; - case '开门码': - Navigator.pushNamed( - context, PageName.opening_code_page.toString()); - break; - case '访客通行': - case '我的访客': - Navigator.pushNamed( - context, PageName.visitor_access_page.toString()); - break; - case '报事报修': - case '我的报修': - Navigator.pushNamed(context, PageName.things_page.toString(), - arguments: Bundle() - ..putMap('things', { - 'title': '报事报修', - })); - break; - case '生活缴费': - case '我的缴费': - Navigator.pushNamed(context, PageName.life_pay_page.toString()); - break; - case '业委会': - Navigator.pushNamed( - context, PageName.industry_committee_page.toString()); - break; - case '建议咨询': - Navigator.pushNamed(context, PageName.things_page.toString(), - arguments: Bundle() - ..putMap('things', { - 'title': '建议咨询', - 'treeList': >[ - {'name': '您的建议'}, - {'name': '您的咨询'}, - ] - })); - break; - case '便民电话': - Navigator.pushNamed( - context, PageName.convenient_phone_page.toString()); - break; - case '活动投票': - Navigator.pushNamed( - context, PageName.activities_page.toString(), - arguments: Bundle()..putBool('isVote', true)); - break; - case '社区活动': - Navigator.pushNamed( - context, PageName.activities_page.toString(), - arguments: Bundle()..putBool('isVote', false)); - break; - case '物品出户': - Navigator.pushNamed( - context, PageName.goods_deto_page.toString()); - break; - case '投诉表扬': - Navigator.pushNamed(context, PageName.things_page.toString(), - arguments: Bundle() - ..putMap('things', { - 'title': '投诉表扬', - 'treeList': >[ - {'name': '您的表扬'}, - {'name': '您的投诉'}, - ] - })); - break; - case '问卷调查': - Navigator.pushNamed( - context, PageName.questionnaire_page.toString()); - break; - case '装修管理': - Navigator.pushNamed( - context, PageName.fitup_manage_page.toString()); - break; - case '借还管理': - Navigator.pushNamed( - context, PageName.goods_manage_page.toString()); - break; - case '一键报警': - Navigator.pushNamed( - context, PageName.one_alarm_page.toString()); - break; - case '全部应用': - Navigator.pushNamed( - context, PageName.total_applications_page.toString()); - break; - case '我的房屋': - Navigator.pushNamed( - context, PageName.mine_house_page.toString()); - break; - case '我的车位': - Navigator.pushNamed(context, PageName.mine_car_page.toString(), - arguments: Bundle()..putMap('carType', {'type': '车位'})); - break; - case '我的车': - Navigator.pushNamed(context, PageName.mine_car_page.toString(), - arguments: Bundle()..putMap('carType', {'type': '车'})); - break; - case '我的地址': - Navigator.pushNamed(context, PageName.address_page.toString()); - break; - case '设置': - Get.to(SettingsPage()); - break; - case '居家生活': - case '数码家电': - case '休闲副食': - case '滋补保健': - case '彩妆香水': - case '服饰箱包': - case '母婴玩具': - case '饮料酒水': - Navigator.pushNamed( - context, PageName.market_detail_page.toString(), - arguments: Bundle() - ..putString('title', gridList[index]['title'])); - break; - case '待付款': - case '待发货': - case '待收货': - case '待评价': - case '售后': - Navigator.pushNamed(context, PageName.order_page.toString(), - arguments: Bundle() - ..putString('title', gridList[index]['title'])); - break; - default: - } - // switch (title) { - // case '物业': - // Navigator.pushNamed(context, PageName.common_page.toString(), - // arguments: Bundle() - // ..putMap('commentMap', { - // 'title': girdList[index]['title'], - // 'isActions': girdList[index]['isAction'], - // 'isAlone': girdList[index]['isAlone'], - // 'isPropose': girdList[index]['isPropose'], - // })); - // break; - // case '商城': - // Navigator.pushNamed( - // context, PageName.market_detail_page.toString(), - // arguments: Bundle() - // ..putString('title', girdList[index]['title'])); - // break; - // case '订单': - // Navigator.pushNamed( - // context, PageName.order_page.toString(), - // arguments: Bundle() - // ..putString('title', girdList[index]['title'])); - // break; - // default: - // } - }, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - gridList[index]['imagePath'], - height: 53.w, - width: 53.w, - fit: BoxFit.cover, - ), - SizedBox(height: 5), - Text( - gridList[index]['title'], - style: TextStyle(fontSize: 24.sp), - ) - ], - ), - ), - ); - }, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: count, mainAxisSpacing: 6.0, childAspectRatio: 1.0), - ); - } -} diff --git a/lib/widget/round_check_box.dart b/lib/widget/round_check_box.dart index 7941e234..59a39251 100644 --- a/lib/widget/round_check_box.dart +++ b/lib/widget/round_check_box.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; class RoundCheckBox extends StatefulWidget { var value = false; diff --git a/lib/widget/single_image_up.dart b/lib/widget/single_image_up.dart index 96e4934b..4b1a0691 100644 --- a/lib/widget/single_image_up.dart +++ b/lib/widget/single_image_up.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:multi_image_picker/multi_image_picker.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/base/base_style.dart'; class SingleImageUp extends StatefulWidget { diff --git a/lib/widget/sliver_goods_card.dart b/lib/widget/sliver_goods_card.dart index 039b83c0..f62a2a7f 100644 --- a/lib/widget/sliver_goods_card.dart +++ b/lib/widget/sliver_goods_card.dart @@ -1,7 +1,8 @@ import 'dart:convert'; +import 'package:akuCommunity/pages/goods_details/goods_details_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/utils/screenutil.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/model/aku_shop_model.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart'; @@ -19,11 +20,11 @@ class SliverGoodsCard extends StatelessWidget { (BuildContext context, int index) { return InkWell( onTap: () { - Navigator.pushNamed( - context, PageName.goods_details_page.toString(), - arguments: Bundle() - ..putString( - 'shoplist', json.encode(shoplist[index]).toString())); + GoodsDetailsPage( + bundle: Bundle() + ..putString( + 'shoplist', json.encode(shoplist[index]).toString()), + ).to; }, child: Container( color: Colors.white, @@ -94,14 +95,14 @@ class SliverGoodsCard extends StatelessWidget { ) : InkWell( onTap: () { - Navigator.pushNamed(context, - PageName.goods_details_page.toString(), - arguments: Bundle() - ..putString( - 'shoplist', - json - .encode(shoplist[index]) - .toString())); + GoodsDetailsPage( + bundle: Bundle() + ..putString( + 'shoplist', + json + .encode(shoplist[index]) + .toString()), + ).to; }, child: Container( width: 134.w,