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/payment/payment_page.dart';
import '../../modules/payment/info/info_screen.dart';
import '../../modules/payment/manage/manage_screen.dart';
import '../../modules/payment/history/history_list_screen.dart';
import '../../modules/payment/payment/payment_list_screen.dart';
import '../../modules/payment_info/payment_info_page.dart';
import '../../modules/payment_confirm/payment_confirm_page.dart';
import '../../modules/payment_success/payment_success_page.dart';
import '../../modules/add_card/add_card_page.dart';
import '../../modules/choose_card/choose_card_page.dart';
import '../../modules/offline_payment/offline_payment_page.dart';
import '../../modules/payment/payment/payment_list_screen.dart';
import '../../modules/payment/history/history_list_screen.dart';

part 'payment_page_router.gr.dart';

/*\
 * Payment 模块的路由
 */
@AutoRouterConfig(replaceInRouteName: 'Page|Screen,PageRoute')
class PaymentPageRouter extends _$PaymentPageRouter {
  @override
  List<AutoRoute> get routes => [
        CustomRoute(
          page: PaymentPageRoute.page,
          path: RouterPath.payment,
          transitionsBuilder: applySlideTransition,
          children: [
            AutoRoute(page: InfoPageRoute.page, path: 'info'),
            AutoRoute(page: PaymentListPageRoute.page, path: 'payment'),
            AutoRoute(page: HistoryListPageRoute.page, path: 'history'),
            AutoRoute(page: ManagePageRoute.page, path: 'manage'),
          ],
        ),
        CustomRoute(page: PaymentInfoPageRoute.page, path: RouterPath.paymentInfo, transitionsBuilder: applySlideTransition),
        CustomRoute(page: PaymentConfirmPageRoute.page, path: RouterPath.paymentConfirm, transitionsBuilder: applySlideTransition),
        CustomRoute(page: PaymentSuccessPageRoute.page, path: RouterPath.paymentSuccess, transitionsBuilder: applySlideTransition),
        CustomRoute(page: AddCardPageRoute.page, path: RouterPath.paymentAddCard, transitionsBuilder: applySlideTransition),
        CustomRoute(page: ChooseCardPageRoute.page, path: RouterPath.paymentChooseCard, transitionsBuilder: applySlideTransition),
        CustomRoute(page: OfflinePaymentPageRoute.page, path: RouterPath.paymentOffline, transitionsBuilder: applySlideTransition),
      ];
}
