payment_success_dialog.dart 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 '../resource/assets.gen.dart';
  6. import '../resource/colors.gen.dart';
  7. import '../utils/styles.dart';
  8. // 支付成功
  9. class PaymentSuccessDialog {
  10. static const String tag = 'PaymentSuccessDialog';
  11. static void show({required String infoText, required Function? btnConfirm}) {
  12. SmartDialog.show(
  13. tag: tag,
  14. backType: SmartBackType.block,
  15. clickMaskDismiss: true,
  16. maskColor: ColorName.black70,
  17. builder: (_) {
  18. return Column(
  19. crossAxisAlignment: CrossAxisAlignment.center,
  20. mainAxisAlignment: MainAxisAlignment.center,
  21. children: [
  22. Container(
  23. width: double.infinity,
  24. margin: EdgeInsets.symmetric(horizontal: 31.w),
  25. decoration: ShapeDecoration(
  26. color: Colors.white,
  27. shape: RoundedRectangleBorder(
  28. borderRadius: BorderRadius.circular(20.r),
  29. ),
  30. ),
  31. child: Stack(
  32. children: [
  33. Container(
  34. width: double.infinity,
  35. padding: EdgeInsets.symmetric(
  36. horizontal: 16.w,
  37. vertical: 16.h,
  38. ),
  39. child: Column(
  40. mainAxisSize: MainAxisSize.min,
  41. crossAxisAlignment: CrossAxisAlignment.center,
  42. mainAxisAlignment: MainAxisAlignment.center,
  43. children: [
  44. Assets.images.iconDialogPaySuccess.image(
  45. width: 88.w,
  46. height: 88.h,
  47. ),
  48. SizedBox(height: 8.h),
  49. Text(
  50. StringName.paySuccessDialogTitle,
  51. style: Styles.getTextStyleBlack204W500(16.sp),
  52. ),
  53. Text(
  54. infoText,
  55. style: Styles.getTextStyleBlack153W400(14.sp),
  56. ),
  57. SizedBox(height: 24.h),
  58. SizedBox(
  59. width: double.infinity,
  60. child: GestureDetector(
  61. onTap: () {
  62. SmartDialog.dismiss();
  63. btnConfirm?.call();
  64. },
  65. child: Container(
  66. height: 40.h,
  67. decoration: Styles.getActivateButtonDecoration(
  68. 22.r,
  69. ),
  70. child: Center(
  71. child: Text(
  72. StringName.paySuccessDialogConfirm,
  73. style: Styles.getTextStyleWhiteW500(16.sp),
  74. ),
  75. ),
  76. ),
  77. ),
  78. ),
  79. ],
  80. ),
  81. ),
  82. Positioned(
  83. right: 14.w,
  84. top: 14.h,
  85. child: GestureDetector(
  86. onTap: () {
  87. SmartDialog.dismiss();
  88. btnConfirm?.call();
  89. },
  90. child: Assets.images.iconCustomDialogClose.image(
  91. width: 24.w,
  92. height: 24.h,
  93. ),
  94. ),
  95. ),
  96. ],
  97. ),)
  98. ,
  99. ]
  100. ,
  101. );
  102. },
  103. );
  104. }
  105. }