| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
- import 'package:keyboard/resource/string.gen.dart';
- import '../resource/assets.gen.dart';
- import '../resource/colors.gen.dart';
- import '../utils/styles.dart';
- // 支付成功
- class PaymentSuccessDialog {
- static const String tag = 'PaymentSuccessDialog';
- static void show({required String infoText, required Function? btnConfirm}) {
- SmartDialog.show(
- tag: tag,
- backType: SmartBackType.block,
- clickMaskDismiss: true,
- maskColor: ColorName.black70,
- builder: (_) {
- return Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Container(
- width: double.infinity,
- margin: EdgeInsets.symmetric(horizontal: 31.w),
- decoration: ShapeDecoration(
- color: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(20.r),
- ),
- ),
- child: Stack(
- children: [
- Container(
- width: double.infinity,
- padding: EdgeInsets.symmetric(
- horizontal: 16.w,
- vertical: 16.h,
- ),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Assets.images.iconDialogPaySuccess.image(
- width: 88.w,
- height: 88.h,
- ),
- SizedBox(height: 8.h),
- Text(
- StringName.paySuccessDialogTitle,
- style: Styles.getTextStyleBlack204W500(16.sp),
- ),
- Text(
- infoText,
- style: Styles.getTextStyleBlack153W400(14.sp),
- ),
- SizedBox(height: 24.h),
- SizedBox(
- width: double.infinity,
- child: GestureDetector(
- onTap: () {
- SmartDialog.dismiss();
- btnConfirm?.call();
- },
- child: Container(
- height: 40.h,
- decoration: Styles.getActivateButtonDecoration(
- 22.r,
- ),
- child: Center(
- child: Text(
- StringName.paySuccessDialogConfirm,
- style: Styles.getTextStyleWhiteW500(16.sp),
- ),
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- Positioned(
- right: 14.w,
- top: 14.h,
- child: GestureDetector(
- onTap: () {
- SmartDialog.dismiss();
- btnConfirm?.call();
- },
- child: Assets.images.iconCustomDialogClose.image(
- width: 24.w,
- height: 24.h,
- ),
- ),
- ),
- ],
- ),)
- ,
- ]
- ,
- );
- },
- );
- }
- }
|