main_page_router.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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/page/feedback_page.dart';
  6. import '../../modules/home/home_page.dart';
  7. import '../../modules/main/main_page.dart';
  8. import '../../modules/me/me_page.dart';
  9. import '../../modules/notification/notification_page.dart';
  10. import '../../modules/visitor/visitor_page.dart';
  11. part 'main_page_router.gr.dart';
  12. /*\
  13. * Main模块的路由
  14. */
  15. @AutoRouterConfig(replaceInRouteName: 'Page|Screen,PageRoute')
  16. class MainPageRouter extends _$MainPageRouter {
  17. @override
  18. List<AutoRoute> get routes => [
  19. CustomRoute(
  20. page: MainPageRoute.page,
  21. transitionsBuilder: applySlideTransition,
  22. path: RouterPath.main,
  23. children: [
  24. AutoRoute(page: HomePageRoute.page, path: 'home'),
  25. AutoRoute(page: VisitorPageRoute.page, path: 'visitor'),
  26. AutoRoute(page: FeedbackPageRoute.page, path: 'feedback'),
  27. AutoRoute(page: MePageRoute.page, path: 'me'),
  28. ],
  29. ),
  30. CustomRoute(page: NotificationPageRoute.page, path: RouterPath.notification, transitionsBuilder: applySlideTransition),
  31. ];
  32. }