payment_success_page.dart 3.4 KB

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