community_page_router.dart 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. import '../../modules/community/news/news_page.dart';
  15. import '../../modules/community/following/following_page.dart';
  16. import '../../modules/community/foryou/foryou_page.dart';
  17. part 'community_page_router.gr.dart';
  18. /*\
  19. * Community组件的路由
  20. */
  21. @AutoRouterConfig(replaceInRouteName: 'Page|Screen,PageRoute')
  22. class CommunityPageRouter extends _$CommunityPageRouter {
  23. @override
  24. List<AutoRoute> get routes => [
  25. CustomRoute(
  26. page: CommunityPageRoute.page,
  27. path: RouterPath.community,
  28. transitionsBuilder: applySlideTransition,
  29. children: [
  30. // newsfeed-news page
  31. CustomRoute(
  32. page: NewsPageRoute.page,
  33. path: RouterPath.newsfeedNews,
  34. transitionsBuilder: applySlideTransition,
  35. ),
  36. // newsfeed-following page
  37. CustomRoute(
  38. page: FollowingPageRoute.page,
  39. path: RouterPath.newsfeedFollowing,
  40. transitionsBuilder: applySlideTransition,
  41. ),
  42. // newsfeed-foryou page
  43. CustomRoute(
  44. page: ForyouPageRoute.page,
  45. path: RouterPath.newsfeedForyou,
  46. transitionsBuilder: applySlideTransition,
  47. ),
  48. // CustomRoute(
  49. // page: NewsfeedPageRoute.page,
  50. // path: RouterPath.newsFeed,
  51. // transitionsBuilder: applySlideTransition,
  52. // ),
  53. // CustomRoute(
  54. // page: GaragesalePageRoute.page,
  55. // path: RouterPath.garageSale,
  56. // transitionsBuilder: applySlideTransition,
  57. // ),
  58. ],
  59. ),
  60. CustomRoute(
  61. page: NewsfeedPageRoute.page,
  62. path: RouterPath.newsFeed,
  63. transitionsBuilder: applySlideTransition,
  64. ),
  65. CustomRoute(
  66. page: GaragesalePageRoute.page,
  67. path: RouterPath.garageSale,
  68. transitionsBuilder: applySlideTransition,
  69. ),
  70. CustomRoute(
  71. page: NewsfeedPostPageRoute.page,
  72. path: RouterPath.newsFeedPost,
  73. transitionsBuilder: applySlideTransition,
  74. ),
  75. CustomRoute(
  76. page: NewsfeedDetailPageRoute.page,
  77. path: RouterPath.newsFeedDetail,
  78. transitionsBuilder: applySlideTransition,
  79. ),
  80. CustomRoute(
  81. page: NewsfeedMypostsPageRoute.page,
  82. path: RouterPath.newsFeedMyPosts,
  83. transitionsBuilder: applySlideTransition,
  84. ),
  85. CustomRoute(
  86. page: GaragesalePostPageRoute.page,
  87. path: RouterPath.garageSalePost,
  88. transitionsBuilder: applySlideTransition,
  89. ),
  90. CustomRoute(
  91. page: GaragesaleDetailPageRoute.page,
  92. path: RouterPath.garageSaleDetail,
  93. transitionsBuilder: applySlideTransition,
  94. ),
  95. CustomRoute(
  96. page: GaragesaleMypostsPageRoute.page,
  97. path: RouterPath.garageSaleMyPosts,
  98. transitionsBuilder: applySlideTransition,
  99. ),
  100. ];
  101. }