payment_success_page.dart 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. import 'package:cs_resources/generated/assets.dart';
  2. import 'package:cs_resources/generated/l10n.dart';
  3. import 'package:cs_resources/theme/app_colors_theme.dart';
  4. import 'package:flutter/material.dart';
  5. import 'package:auto_route/auto_route.dart';
  6. import 'package:hooks_riverpod/hooks_riverpod.dart';
  7. import 'package:router/ext/auto_router_extensions.dart';
  8. import 'package:widgets/ext/ex_widget.dart';
  9. import 'package:widgets/my_appbar.dart';
  10. import 'package:widgets/my_load_image.dart';
  11. import 'package:widgets/my_text_view.dart';
  12. import 'package:widgets/utils/dark_theme_util.dart';
  13. import '../../router/page/payment_page_router.dart';
  14. import 'payment_success_view_model.dart';
  15. @RoutePage()
  16. class PaymentSuccessPage extends HookConsumerWidget {
  17. const PaymentSuccessPage({Key? key}) : super(key: key);
  18. //启动并关闭其他栈
  19. static void startWithPop() {
  20. appRouter.pushAndPopUntil(
  21. const PaymentSuccessPageRoute(),
  22. predicate: (route) {
  23. return route.settings.name == 'PaymentPageRoute';
  24. },
  25. );
  26. }
  27. @override
  28. Widget build(BuildContext context, WidgetRef ref) {
  29. final viewModel = ref.watch(paymentSuccessViewModelProvider.notifier);
  30. return Scaffold(
  31. appBar: MyAppBar.appBar(context, "付款的标题"),
  32. backgroundColor: context.appColors.backgroundWhite,
  33. body: SizedBox(
  34. width: double.infinity,
  35. child: Column(
  36. children: [
  37. //成功图片
  38. MyAssetImage(
  39. Assets.facilityPaymentSuccessIcon,
  40. width: 54,
  41. height: 54,
  42. color: DarkThemeUtil.multiColors(context, AppColorsTheme.colorPrimary, darkColor: Colors.white),
  43. ).marginOnly(top: 11, bottom: 13),
  44. //支付成功
  45. MyTextView(
  46. S.current.booking_successful,
  47. fontSize: 18,
  48. marginBottom: 3,
  49. isFontMedium: true,
  50. textColor: context.appColors.textPrimary,
  51. ),
  52. //支付金额
  53. MyTextView(
  54. S.current.fee_paid,
  55. marginTop: 40,
  56. fontSize: 15,
  57. isFontRegular: true,
  58. textColor: context.appColors.textBlack,
  59. ),
  60. MyTextView(
  61. "\$10.80",
  62. fontSize: 15,
  63. isFontRegular: true,
  64. textColor: context.appColors.textPrimary,
  65. ),
  66. //付款类型与时间
  67. Row(
  68. mainAxisSize: MainAxisSize.min,
  69. children: [
  70. MyTextView(
  71. "Master card ending",
  72. fontSize: 15,
  73. isFontRegular: true,
  74. textColor: context.appColors.textBlack,
  75. ),
  76. MyTextView(
  77. "9423",
  78. fontSize: 15,
  79. isFontMedium: true,
  80. textColor: context.appColors.textBlack,
  81. ),
  82. ],
  83. ).marginOnly(top: 12),
  84. Row(
  85. mainAxisSize: MainAxisSize.min,
  86. children: [
  87. MyTextView(
  88. S.current.paid_on,
  89. fontSize: 15,
  90. isFontRegular: true,
  91. textColor: context.appColors.textBlack,
  92. ),
  93. MyTextView(
  94. "24 Oct 2023 at 02:19 PM",
  95. fontSize: 15,
  96. isFontMedium: true,
  97. textColor: context.appColors.textBlack,
  98. ),
  99. ],
  100. ).marginOnly(top: 5),
  101. const SizedBox(height: 23),
  102. ],
  103. ),
  104. ),
  105. );
  106. }
  107. }