community_page_router.dart 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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/community/community_page.dart';
  6. import '../../modules/garagesale/garagesale_detail/garagesale_detail_page.dart';
  7. import '../../modules/newsfeed/newsfeed_page.dart';
  8. import '../../modules/garagesale/garagesale_page.dart';
  9. import '../../modules/newsfeed/newsfeed_post/newsfeed_post_page.dart';
  10. import '../../modules/newsfeed/newsfeed_detail/newsfeed_detail_page.dart';
  11. import '../../modules/newsfeed/newsfeed_myposts/newsfeed_myposts_page.dart';
  12. import '../../modules/garagesale/garagesale_myposts/garagesale_myposts_page.dart';
  13. import '../../modules/garagesale/garagesale_post/garagesale_post_page.dart';
  14. part 'community_page_router.gr.dart';
  15. /*\
  16. * Community组件的路由
  17. */
  18. @AutoRouterConfig(replaceInRouteName: 'Page|Screen,PageRoute')
  19. class CommunityPageRouter extends _$CommunityPageRouter {
  20. @override
  21. List<AutoRoute> get routes => [
  22. CustomRoute(
  23. page: CommunityPageRoute.page,
  24. path: RouterPath.community,
  25. transitionsBuilder: applySlideTransition,
  26. children: [
  27. CustomRoute(
  28. page: NewsfeedPageRoute.page,
  29. path: RouterPath.newsFeed,
  30. transitionsBuilder: applySlideTransition,
  31. ),
  32. CustomRoute(
  33. page: GaragesalePageRoute.page,
  34. path: RouterPath.garageSale,
  35. transitionsBuilder: applySlideTransition,
  36. ),
  37. ],
  38. ),
  39. CustomRoute(
  40. page: NewsfeedPostPageRoute.page,
  41. path: RouterPath.newsFeedPost,
  42. transitionsBuilder: applySlideTransition,
  43. ),
  44. CustomRoute(
  45. page: NewsfeedDetailPageRoute.page,
  46. path: RouterPath.newsFeedDetail,
  47. transitionsBuilder: applySlideTransition,
  48. ),
  49. CustomRoute(
  50. page: NewsfeedMypostsPageRoute.page,
  51. path: RouterPath.newsFeedMyPosts,
  52. transitionsBuilder: applySlideTransition,
  53. ),
  54. CustomRoute(
  55. page: GaragesalePostPageRoute.page,
  56. path: RouterPath.garageSalePost,
  57. transitionsBuilder: applySlideTransition,
  58. ),
  59. CustomRoute(
  60. page: GaragesaleDetailPageRoute.page,
  61. path: RouterPath.garageSaleDetail,
  62. transitionsBuilder: applySlideTransition,
  63. ),
  64. CustomRoute(
  65. page: GaragesaleMypostsPageRoute.page,
  66. path: RouterPath.garageSaleMyPosts,
  67. transitionsBuilder: applySlideTransition,
  68. ),
  69. ];
  70. }