app_page_router.dart 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import 'package:auto_route/auto_route.dart';
  2. import 'package:cpt_main/router/page/main_page_router.dart';
  3. import 'package:cpt_profile/router/page/profile_page_router.dart';
  4. import 'package:flutter/material.dart';
  5. import 'package:plugin_basic/router/basic_page_router.dart';
  6. import 'package:router/path/router_path.dart';
  7. import 'package:cpt_auth/router/page/auth_page_router.dart';
  8. import 'package:cpt_community/router/page/community_page_router.dart';
  9. import 'package:cpt_facility/router/page/facility_page_router.dart';
  10. import 'package:cpt_form/router/page/form_page_router.dart';
  11. import 'package:cpt_notice_board/router/page/notice_board_page_router.dart';
  12. import 'package:cpt_payment/router/page/payment_page_router.dart';
  13. import 'package:cpt_property/router/page/property_page_router.dart';
  14. import 'package:cpt_rewards/router/page/rewards_page_router.dart';
  15. import 'package:cpt_services/router/page/services_page_router.dart';
  16. import '../../modules/splash/page/splash_page.dart';
  17. part 'app_page_router.gr.dart';
  18. @AutoRouterConfig(replaceInRouteName: 'Page|Screen,PageRoute')
  19. class AppRouter extends _$AppRouter {
  20. @override
  21. List<AutoRoute> get routes => [
  22. AutoRoute(page: SplashPageRoute.page, initial: true, path: RouterPath.splash),
  23. // 合并子模块的路由配置
  24. ...BasicPageRouter().routes,
  25. ...AuthPageRouter().routes,
  26. ...MainPageRouter().routes,
  27. ...CommunityPageRouter().routes,
  28. ...FacilityPageRouter().routes,
  29. ...FormPageRouter().routes,
  30. ...NoticeBoardPageRouter().routes,
  31. ...PaymentPageRouter().routes,
  32. ...PaymentPageRouter().routes,
  33. ...PropertyPageRouter().routes,
  34. ...RewardsPageRouter().routes,
  35. ...ServicesPageRouter().routes,
  36. ...ProfilePageRouter().routes,
  37. ];
  38. @override
  39. Map<String, PageFactory> get pagesMap => {
  40. ...super.pagesMap,
  41. // 合并子模块的 pagesMap
  42. ...BasicPageRouter().pagesMap,
  43. ...AuthPageRouter().pagesMap,
  44. ...MainPageRouter().pagesMap,
  45. ...CommunityPageRouter().pagesMap,
  46. ...FacilityPageRouter().pagesMap,
  47. ...FacilityPageRouter().pagesMap,
  48. ...FormPageRouter().pagesMap,
  49. ...NoticeBoardPageRouter().pagesMap,
  50. ...PaymentPageRouter().pagesMap,
  51. ...PropertyPageRouter().pagesMap,
  52. ...RewardsPageRouter().pagesMap,
  53. ...ServicesPageRouter().pagesMap,
  54. ...ProfilePageRouter().pagesMap,
  55. };
  56. }
  57. final appRouter = AppRouter();