deprecate_diolog.dart 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. import 'package:flutter_screenutil/flutter_screenutil.dart';
  2. import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
  3. import 'package:flutter/material.dart';
  4. import '../resource/assets.gen.dart';
  5. import '../resource/colors.gen.dart';
  6. import '../resource/string.gen.dart';
  7. import '../utils/styles.dart';
  8. class DeprecateDialog {
  9. static const String tag = "DeprecateDialog";
  10. static void show({Function? btnCancel, Function? btnConfirm}) {
  11. SmartDialog.show(
  12. tag: tag,
  13. backType: SmartBackType.block,
  14. clickMaskDismiss: true,
  15. maskColor: ColorName.black70,
  16. builder: (_) {
  17. return Column(
  18. crossAxisAlignment: CrossAxisAlignment.center,
  19. mainAxisAlignment: MainAxisAlignment.center,
  20. children: [
  21. Container(
  22. margin: EdgeInsets.symmetric(horizontal: 31.w),
  23. decoration: ShapeDecoration(
  24. color: Colors.white,
  25. shape: RoundedRectangleBorder(
  26. borderRadius: BorderRadius.circular(20.r),
  27. ),
  28. ),
  29. child: Stack(
  30. children: [
  31. Container(
  32. padding: EdgeInsets.symmetric(
  33. horizontal: 16.w,
  34. vertical: 24.h,
  35. ),
  36. child: Column(
  37. mainAxisSize: MainAxisSize.min,
  38. crossAxisAlignment: CrossAxisAlignment.center,
  39. mainAxisAlignment: MainAxisAlignment.center,
  40. children: [
  41. Text(
  42. StringName.loginDeleteAccount,
  43. style: Styles.getTextStyleBlack204W500(16.sp),
  44. ),
  45. SizedBox(height: 12.h),
  46. Text(
  47. StringName.loginDeleteAccountDesc,
  48. textAlign: TextAlign.center,
  49. style: TextStyle(
  50. color: Colors.black.withAlpha(204),
  51. fontSize: 14.sp,
  52. fontWeight: FontWeight.w400,
  53. ),
  54. ),
  55. SizedBox(height: 20.h),
  56. Row(
  57. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  58. children: [
  59. GestureDetector(
  60. onTap: () {
  61. if (btnConfirm != null) {
  62. btnConfirm();
  63. }
  64. SmartDialog.dismiss(tag: tag);
  65. },
  66. child: Container(
  67. height: 40.h,
  68. width: 128.r,
  69. alignment: Alignment.center,
  70. decoration: ShapeDecoration(
  71. color: const Color(0xFFFFE5E3),
  72. shape: RoundedRectangleBorder(
  73. borderRadius: BorderRadius.circular(50.r),
  74. ),
  75. ),
  76. child: Text(
  77. StringName.loginDeleteAccountConfirm,
  78. style: TextStyle(
  79. color: const Color(0xFFF44E45),
  80. fontSize: 16.sp,
  81. fontWeight: FontWeight.w500,
  82. ),
  83. ),
  84. ),
  85. ),
  86. GestureDetector(
  87. onTap: () {
  88. if (btnCancel != null) {
  89. btnCancel();
  90. }
  91. SmartDialog.dismiss();
  92. },
  93. child: Container(
  94. height: 40.h,
  95. width: 128.w,
  96. alignment: Alignment.center,
  97. decoration: ShapeDecoration(
  98. color: const Color(0xFFF5F4F9),
  99. shape: RoundedRectangleBorder(
  100. borderRadius: BorderRadius.circular(50.r),
  101. ),
  102. ),
  103. child: Text(
  104. StringName.loginDeleteAccountCancel,
  105. style: Styles.getTextStyleBlack102W500(16.sp),
  106. ),
  107. ),
  108. ),
  109. ],
  110. ),
  111. ],
  112. ),
  113. ),
  114. Positioned(
  115. right: 14.w,
  116. top: 14.h,
  117. child: GestureDetector(
  118. onTap: () {
  119. SmartDialog.dismiss();
  120. },
  121. child: Assets.images.iconCustomDialogClose.image(
  122. width: 24.w,
  123. height: 24.h,
  124. ),
  125. ),
  126. ),
  127. ],
  128. ),
  129. ),
  130. ],
  131. );
  132. },
  133. );
  134. }
  135. }