community_page_router.dart 3.6 KB

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