payment_page_router.dart 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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/payment/payment_page.dart';
  6. import '../../modules/payment/info/info_screen.dart';
  7. import '../../modules/payment/manage/manage_screen.dart';
  8. import '../../modules/payment/history/history_list_screen.dart';
  9. import '../../modules/payment/payment/payment_list_screen.dart';
  10. import '../../modules/payment_info/payment_info_page.dart';
  11. import '../../modules/payment_confirm/payment_confirm_page.dart';
  12. import '../../modules/payment_success/payment_success_page.dart';
  13. import '../../modules/add_card/add_card_page.dart';
  14. import '../../modules/choose_card/choose_card_page.dart';
  15. import '../../modules/offline_payment/offline_payment_page.dart';
  16. import '../../modules/payment/payment/payment_list_screen.dart';
  17. import '../../modules/payment/history/history_list_screen.dart';
  18. part 'payment_page_router.gr.dart';
  19. /*\
  20. * Payment 模块的路由
  21. */
  22. @AutoRouterConfig(replaceInRouteName: 'Page|Screen,PageRoute')
  23. class PaymentPageRouter extends _$PaymentPageRouter {
  24. @override
  25. List<AutoRoute> get routes => [
  26. CustomRoute(
  27. page: PaymentPageRoute.page,
  28. path: RouterPath.payment,
  29. transitionsBuilder: applySlideTransition,
  30. children: [
  31. AutoRoute(page: InfoPageRoute.page, path: 'info'),
  32. AutoRoute(page: PaymentListPageRoute.page, path: 'payment'),
  33. AutoRoute(page: HistoryListPageRoute.page, path: 'history'),
  34. AutoRoute(page: ManagePageRoute.page, path: 'manage'),
  35. ],
  36. ),
  37. CustomRoute(page: PaymentInfoPageRoute.page, path: RouterPath.paymentInfo, transitionsBuilder: applySlideTransition),
  38. CustomRoute(page: PaymentConfirmPageRoute.page, path: RouterPath.paymentConfirm, transitionsBuilder: applySlideTransition),
  39. CustomRoute(page: PaymentSuccessPageRoute.page, path: RouterPath.paymentSuccess, transitionsBuilder: applySlideTransition),
  40. CustomRoute(page: AddCardPageRoute.page, path: RouterPath.paymentAddCard, transitionsBuilder: applySlideTransition),
  41. CustomRoute(page: ChooseCardPageRoute.page, path: RouterPath.paymentChooseCard, transitionsBuilder: applySlideTransition),
  42. CustomRoute(page: OfflinePaymentPageRoute.page, path: RouterPath.paymentOffline, transitionsBuilder: applySlideTransition),
  43. ];
  44. }