import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:router/ext/auto_router_extensions.dart';
import 'package:router/path/router_path.dart';

import '../../modules/community/community_page.dart';
import '../../modules/garagesale/garagesale_detail/garagesale_detail_page.dart';
import '../../modules/newsfeed/newsfeed_page.dart';
import '../../modules/garagesale/garagesale_page.dart';
import '../../modules/newsfeed/newsfeed_post/newsfeed_post_page.dart';
import '../../modules/newsfeed/newsfeed_detail/newsfeed_detail_page.dart';
import '../../modules/newsfeed/newsfeed_myposts/newsfeed_myposts_page.dart';
import '../../modules/garagesale/garagesale_myposts/garagesale_myposts_page.dart';
import '../../modules/garagesale/garagesale_post/garagesale_post_page.dart';

part 'community_page_router.gr.dart';

/*\
 * Community组件的路由
 */
@AutoRouterConfig(replaceInRouteName: 'Page|Screen,PageRoute')
class CommunityPageRouter extends _$CommunityPageRouter {
  @override
  List<AutoRoute> get routes => [

    CustomRoute(
        page: CommunityPageRoute.page,
        path: RouterPath.community,
        transitionsBuilder: applySlideTransition,
        children: [
          CustomRoute(
              page: NewsfeedPageRoute.page,
              path: RouterPath.newsFeed,
              transitionsBuilder: applySlideTransition,
          ),
          CustomRoute(
            page: GaragesalePageRoute.page,
            path: RouterPath.garageSale,
            transitionsBuilder: applySlideTransition,
          ),
        ],
    ),
    CustomRoute(
      page: NewsfeedPostPageRoute.page,
      path: RouterPath.newsFeedPost,
      transitionsBuilder: applySlideTransition,
    ),
    CustomRoute(
      page: NewsfeedDetailPageRoute.page,
      path: RouterPath.newsFeedDetail,
      transitionsBuilder: applySlideTransition,
    ),
    CustomRoute(
      page: NewsfeedMypostsPageRoute.page,
      path: RouterPath.newsFeedMyPosts,
      transitionsBuilder: applySlideTransition,
    ),
    CustomRoute(
      page: GaragesalePostPageRoute.page,
      path: RouterPath.garageSalePost,
      transitionsBuilder: applySlideTransition,
    ),
    CustomRoute(
      page: GaragesaleDetailPageRoute.page,
      path: RouterPath.garageSaleDetail,
      transitionsBuilder: applySlideTransition,
    ),
    CustomRoute(
      page: GaragesaleMypostsPageRoute.page,
      path: RouterPath.garageSaleMyPosts,
      transitionsBuilder: applySlideTransition,
    ),
  ];
}
