main_page_router.dart 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. part 'main_page_router.gr.dart';
  18. /*\
  19. * Main模块的路由
  20. */
  21. @AutoRouterConfig(replaceInRouteName: 'Page|Screen,PageRoute')
  22. class MainPageRouter extends _$MainPageRouter {
  23. @override
  24. List<AutoRoute> get routes => [
  25. CustomRoute(
  26. page: MainPageRoute.page,
  27. transitionsBuilder: applySlideTransition,
  28. path: RouterPath.main,
  29. children: [
  30. AutoRoute(page: HomePageRoute.page, path: 'home'),
  31. AutoRoute(
  32. page: VisitorPageRoute.page,
  33. path: 'visitor',
  34. children: [
  35. AutoRoute(page: VisitorNowPageRoute.page, path: 'now'),
  36. AutoRoute(page: VisitorActivePageRoute.page, path: 'active'),
  37. AutoRoute(page: VisitorHistoryPageRoute.page, path: 'history'),
  38. ],
  39. ),
  40. AutoRoute(
  41. page: FeedbackPageRoute.page,
  42. path: 'feedback',
  43. children: [
  44. AutoRoute(page: FeedbackSendPageRoute.page, path: 'sent'),
  45. AutoRoute(page: FeedbackProgressPageRoute.page, path: 'progress'),
  46. AutoRoute(page: FeedbackHistoryPageRoute.page, path: 'history'),
  47. ],
  48. ),
  49. AutoRoute(page: MePageRoute.page, path: 'me'),
  50. ],
  51. ),
  52. CustomRoute(page: NotificationPageRoute.page, path: RouterPath.notification, transitionsBuilder: applySlideTransition),
  53. ];
  54. }