payment_fail_dialog.dart 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
  4. import 'package:keyboard/resource/string.gen.dart';
  5. import '../data/consts/web_url.dart';
  6. import '../module/browser/browser_page.dart';
  7. import '../resource/assets.gen.dart';
  8. import '../resource/colors.gen.dart';
  9. import '../utils/styles.dart';
  10. import '../widget/click_text_span.dart';
  11. // 支付失败
  12. class PaymentFailDialog {
  13. static const String tag = 'PaymentFailDialog';
  14. static void show({Function? btnCancel, Function? btnConfirm}) {
  15. SmartDialog.show(
  16. tag: tag,
  17. backType: SmartBackType.block,
  18. clickMaskDismiss: true,
  19. maskColor: ColorName.black70,
  20. builder: (_) {
  21. return Column(
  22. crossAxisAlignment: CrossAxisAlignment.center,
  23. mainAxisAlignment: MainAxisAlignment.center,
  24. children: [
  25. Container(
  26. margin: EdgeInsets.symmetric(horizontal: 31.w),
  27. decoration: ShapeDecoration(
  28. color: Colors.white,
  29. shape: RoundedRectangleBorder(
  30. borderRadius: BorderRadius.circular(20.r),
  31. ),
  32. ),
  33. child: Stack(
  34. children: [
  35. Container(
  36. width: double.infinity,
  37. padding: EdgeInsets.symmetric(
  38. horizontal: 16.w,
  39. vertical: 16.h,
  40. ),
  41. child: Column(
  42. mainAxisSize: MainAxisSize.min,
  43. crossAxisAlignment: CrossAxisAlignment.center,
  44. mainAxisAlignment: MainAxisAlignment.center,
  45. children: [
  46. Assets.images.iconDialogPayFail.image(
  47. width: 88.w,
  48. height: 88.h,
  49. ),
  50. SizedBox(height: 8.h),
  51. Text(
  52. StringName.payFailDialogTitle,
  53. style: Styles.getTextStyleBlack204W500(16.sp),
  54. ),
  55. Text(
  56. StringName.payFailDialogDesc,
  57. style: Styles.getTextStyleBlack153W400(14.sp),
  58. ),
  59. SizedBox(height: 24.h),
  60. Row(
  61. children: [
  62. Expanded(
  63. child: GestureDetector(
  64. onTap: () {
  65. SmartDialog.dismiss();
  66. BrowserPage.start(WebUrl.qiyuService);
  67. },
  68. child: Container(
  69. height: 40.h,
  70. decoration: ShapeDecoration(
  71. color: const Color(0xFFF5F4F9),
  72. shape: RoundedRectangleBorder(
  73. borderRadius: BorderRadius.circular(50.r),
  74. ),
  75. ),
  76. child: Row(
  77. mainAxisAlignment: MainAxisAlignment.center,
  78. children: [
  79. Assets.images.iconDialogPayFailService
  80. .image(width: 22.w, height: 22.w),
  81. Text(
  82. StringName.payFailDialogCancel,
  83. style: Styles.getTextStyleBlack102W500(
  84. 16.sp,
  85. ),
  86. ),
  87. ],
  88. ),
  89. ),
  90. ),
  91. ),
  92. SizedBox(width: 8.w),
  93. Expanded(
  94. child: GestureDetector(
  95. onTap: () {
  96. SmartDialog.dismiss();
  97. btnConfirm?.call();
  98. },
  99. child: Container(
  100. height: 40.h,
  101. decoration: Styles.getActivateButtonDecoration(
  102. 22.r,
  103. ),
  104. child: Center(
  105. child: Text(
  106. StringName.payFailDialogContinue,
  107. style: Styles.getTextStyleWhiteW500(
  108. 16.sp,
  109. ),
  110. ),
  111. ),
  112. ),
  113. ),
  114. ),
  115. ],
  116. ),
  117. ],
  118. ),
  119. ),
  120. Positioned(
  121. right: 14.w,
  122. top: 14.h,
  123. child: GestureDetector(
  124. onTap: () {
  125. SmartDialog.dismiss();
  126. },
  127. child: Assets.images.iconCustomDialogClose.image(
  128. width: 24.w,
  129. height: 24.h,
  130. ),
  131. ),
  132. ),
  133. ],
  134. ),
  135. ),
  136. ],
  137. );
  138. },
  139. );
  140. }
  141. }