account_deactivation_dialog.dart 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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:widgets/ext/ex_widget.dart';
  6. import 'package:widgets/my_load_image.dart';
  7. import 'package:widgets/my_text_view.dart';
  8. import 'package:widgets/widget_export.dart';
  9. class AccountDeactivationDialog extends StatelessWidget {
  10. VoidCallback confirmAction;
  11. AccountDeactivationDialog({
  12. required this.confirmAction,
  13. });
  14. @override
  15. Widget build(BuildContext context) {
  16. return Column(
  17. crossAxisAlignment: CrossAxisAlignment.center,
  18. mainAxisAlignment: MainAxisAlignment.center,
  19. children: [
  20. Container(
  21. width: double.infinity,
  22. height: 55,
  23. decoration: BoxDecoration(
  24. color: context.appColors.btnBgDefault,
  25. borderRadius: const BorderRadius.only(
  26. topRight: Radius.circular(15),
  27. topLeft: Radius.circular(15),
  28. ),
  29. ),
  30. child: Row(
  31. children: [
  32. const SizedBox(width: 45),
  33. MyTextView(
  34. S.current.account_deactivation,
  35. fontSize: 18,
  36. textAlign: TextAlign.center,
  37. isFontMedium: true,
  38. textColor: Colors.white,
  39. ).expanded(),
  40. const MyAssetImage(
  41. Assets.baseServiceDialogDeleteIcon,
  42. width: 25,
  43. height: 25.5,
  44. ).onTap(() {
  45. onCancel();
  46. }, padding: 10)
  47. ],
  48. ),
  49. ),
  50. Container(
  51. width: double.infinity,
  52. padding: const EdgeInsets.only(top: 22),
  53. decoration: BoxDecoration(
  54. color: context.appColors.whiteSecondBG,
  55. borderRadius: const BorderRadius.only(
  56. bottomLeft: Radius.circular(15),
  57. bottomRight: Radius.circular(15),
  58. ),
  59. ),
  60. child: Column(
  61. children: [
  62. const MyAssetImage(Assets.mainAccountDeactivationImg, width: 296.5, height: 158.5),
  63. MyTextView(
  64. S.current.account_deactivate_alert,
  65. textAlign: TextAlign.center,
  66. textColor: context.appColors.textBlack,
  67. marginTop: 24,
  68. paddingLeft: 30,
  69. paddingRight: 30,
  70. fontSize: 15,
  71. isFontMedium: true,
  72. ),
  73. Row(
  74. children: [
  75. const SizedBox(width: 18),
  76. Expanded(
  77. flex: 1,
  78. child: InkWell(
  79. onTap: () {
  80. onCancel();
  81. },
  82. child: MyTextView(
  83. S.current.no,
  84. fontSize: 16,
  85. isFontMedium: true,
  86. paddingTop: 13,
  87. marginRight: 15,
  88. paddingBottom: 13,
  89. textAlign: TextAlign.center,
  90. textColor: Colors.white,
  91. backgroundColor: context.appColors.orangeBG,
  92. cornerRadius: 7,
  93. ),
  94. )),
  95. Expanded(
  96. flex: 1,
  97. child: InkWell(
  98. onTap: () async {
  99. onCancel();
  100. confirmAction();
  101. },
  102. child: MyTextView(
  103. S.current.yes,
  104. fontSize: 16,
  105. paddingTop: 13,
  106. paddingBottom: 13,
  107. isFontMedium: true,
  108. textAlign: TextAlign.center,
  109. textColor: Colors.white,
  110. backgroundColor: context.appColors.btnBgDefault,
  111. cornerRadius: 7,
  112. ),
  113. )),
  114. const SizedBox(width: 18),
  115. ],
  116. ).marginOnly(bottom: 30, top: 28),
  117. ],
  118. ),
  119. ),
  120. ],
  121. ).constrained(width: 340);
  122. }
  123. //取消弹框
  124. void onCancel() async {
  125. SmartDialog.dismiss();
  126. }
  127. }