main_page_router.dart 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. part 'main_page_router.gr.dart';
  26. /*\
  27. * Main模块的路由
  28. */
  29. @AutoRouterConfig(replaceInRouteName: 'Page|Screen,PageRoute')
  30. class MainPageRouter extends _$MainPageRouter {
  31. @override
  32. List<AutoRoute> get routes => [
  33. CustomRoute(
  34. page: MainPageRoute.page,
  35. transitionsBuilder: applySlideTransition,
  36. path: RouterPath.main,
  37. children: [
  38. AutoRoute(page: HomePageRoute.page, path: 'home'),
  39. AutoRoute(
  40. page: VisitorPageRoute.page,
  41. path: 'visitor',
  42. children: [
  43. AutoRoute(page: VisitorNowPageRoute.page, path: 'now'),
  44. AutoRoute(page: VisitorActivePageRoute.page, path: 'active'),
  45. AutoRoute(page: VisitorHistoryPageRoute.page, path: 'history'),
  46. ],
  47. ),
  48. AutoRoute(
  49. page: FeedbackPageRoute.page,
  50. path: 'feedback',
  51. children: [
  52. AutoRoute(page: FeedbackSendPageRoute.page, path: 'sent'),
  53. AutoRoute(page: FeedbackProgressPageRoute.page, path: 'progress'),
  54. AutoRoute(page: FeedbackHistoryPageRoute.page, path: 'history'),
  55. ],
  56. ),
  57. AutoRoute(page: MePageRoute.page, path: 'me'),
  58. ],
  59. ),
  60. CustomRoute(page: NotificationPageRoute.page, path: RouterPath.notification, transitionsBuilder: applySlideTransition),
  61. CustomRoute(page: HomePropertyNewsPageRoute.page, path: RouterPath.homePropertyNews, transitionsBuilder: applySlideTransition),
  62. CustomRoute(
  63. page: LatestNewsPageRoute.page,
  64. path: RouterPath.homeLatestNews,
  65. transitionsBuilder: applySlideTransition,
  66. children: [
  67. AutoRoute(page: LatestNewsPropertyPageRoute.page, path: 'property'),
  68. AutoRoute(page: LatestNewsInternalPageRoute.page, path: 'internal'),
  69. AutoRoute(page: LatestNewsInfoPageRoute.page, path: 'info'),
  70. AutoRoute(page: LatestNewsPublishPageRoute.page, path: 'publish'),
  71. ],
  72. ),
  73. CustomRoute(page: ManagementGuidesPageRoute.page, path: RouterPath.homeManagementGuides, transitionsBuilder: applySlideTransition),
  74. CustomRoute(page: VisitorRegisterPageRoute.page, path: RouterPath.visitorRegister, transitionsBuilder: applySlideTransition),
  75. ];
  76. }