main_page_router.dart 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import 'package:auto_route/auto_route.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:router/ext/auto_router_extensions.dart';
  4. import 'package:router/path/router_path.dart';
  5. import '../../modules/feedback/feedback_page.dart';
  6. import '../../modules/feedback/progress/feedback_progress.dart';
  7. import '../../modules/feedback/history/feedback_history.dart';
  8. import '../../modules/feedback/send/feedback_send.dart';
  9. import '../../modules/home/home_page.dart';
  10. import '../../modules/main/main_page.dart';
  11. import '../../modules/me/me_page.dart';
  12. import '../../modules/notification/notification_page.dart';
  13. import '../../modules/visitor/visitor_page.dart';
  14. import '../../modules/visitor/now/visitor_now.dart';
  15. import '../../modules/visitor/active/visitor_active.dart';
  16. import '../../modules/visitor/history/visitor_history.dart';
  17. import '../../modules/home/property_news/home_property_news_page.dart';
  18. import '../../modules/home/latest_news/info/latest_news_info_screen.dart';
  19. import '../../modules/home/latest_news/internal/latest_news_internal_screen.dart';
  20. import '../../modules/home/latest_news/property/latest_news_property_screen.dart';
  21. import '../../modules/home/latest_news/publish/latest_news_publish_screen.dart';
  22. import '../../modules/home/latest_news/latest_news_page.dart';
  23. import '../../modules/home/management_guides/management_guides_page.dart';
  24. import '../../modules/visitor/register/visitor_register_page.dart';
  25. import '../../modules/feedback/create/feedback_create_page.dart';
  26. import '../../modules/feedback/detail/feedback_detail_page.dart';
  27. import '../../modules/feedback/create_success/feedback_create_success_page.dart';
  28. part 'main_page_router.gr.dart';
  29. /*\
  30. * Main模块的路由
  31. */
  32. @AutoRouterConfig(replaceInRouteName: 'Page|Screen,PageRoute')
  33. class MainPageRouter extends _$MainPageRouter {
  34. @override
  35. List<AutoRoute> get routes => [
  36. CustomRoute(
  37. page: MainPageRoute.page,
  38. transitionsBuilder: applySlideTransition,
  39. path: RouterPath.main,
  40. children: [
  41. AutoRoute(page: HomePageRoute.page, path: 'home'),
  42. AutoRoute(
  43. page: VisitorPageRoute.page,
  44. path: 'visitor',
  45. children: [
  46. AutoRoute(page: VisitorNowPageRoute.page, path: 'now'),
  47. AutoRoute(page: VisitorActivePageRoute.page, path: 'active'),
  48. AutoRoute(page: VisitorHistoryPageRoute.page, path: 'history'),
  49. ],
  50. ),
  51. AutoRoute(
  52. page: FeedbackPageRoute.page,
  53. path: 'feedback',
  54. children: [
  55. AutoRoute(page: FeedbackSendPageRoute.page, path: 'sent'),
  56. AutoRoute(page: FeedbackProgressPageRoute.page, path: 'progress'),
  57. AutoRoute(page: FeedbackHistoryPageRoute.page, path: 'history'),
  58. ],
  59. ),
  60. AutoRoute(page: MePageRoute.page, path: 'me'),
  61. ],
  62. ),
  63. CustomRoute(page: NotificationPageRoute.page, path: RouterPath.notification, transitionsBuilder: applySlideTransition),
  64. CustomRoute(page: HomePropertyNewsPageRoute.page, path: RouterPath.homePropertyNews, transitionsBuilder: applySlideTransition),
  65. CustomRoute(
  66. page: LatestNewsPageRoute.page,
  67. path: RouterPath.homeLatestNews,
  68. transitionsBuilder: applySlideTransition,
  69. children: [
  70. AutoRoute(page: LatestNewsPropertyPageRoute.page, path: 'property'),
  71. AutoRoute(page: LatestNewsInternalPageRoute.page, path: 'internal'),
  72. AutoRoute(page: LatestNewsInfoPageRoute.page, path: 'info'),
  73. AutoRoute(page: LatestNewsPublishPageRoute.page, path: 'publish'),
  74. ],
  75. ),
  76. CustomRoute(page: ManagementGuidesPageRoute.page, path: RouterPath.homeManagementGuides, transitionsBuilder: applySlideTransition),
  77. CustomRoute(page: VisitorRegisterPageRoute.page, path: RouterPath.visitorRegister, transitionsBuilder: applySlideTransition),
  78. CustomRoute(page: FeedbackCreatePageRoute.page, path: RouterPath.feedbackCreate, transitionsBuilder: applySlideTransition),
  79. CustomRoute(page: FeedbackCreateSuccessPageRoute.page, path: RouterPath.feedbackCreateSuccess, transitionsBuilder: applySlideTransition),
  80. CustomRoute(page: FeedbackDetailPageRoute.page, path: RouterPath.feedbackDetail, transitionsBuilder: applySlideTransition),
  81. ];
  82. }