member_evaluation_pop_up_dialog.dart 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import 'package:get/get.dart';
  5. import 'package:get/get_core/src/get_main.dart';
  6. import 'package:location/utils/common_expand.dart';
  7. import '../../resource/assets.gen.dart';
  8. import '../../resource/colors.gen.dart';
  9. class MemberEvaluationPopUpDialog {
  10. static void show({
  11. VoidCallback? cancelOnTap,
  12. VoidCallback? confirmOnTap,
  13. int? days
  14. }) {
  15. Get.dialog(
  16. SimpleDialog(
  17. titlePadding: EdgeInsets.zero,
  18. contentPadding: EdgeInsets.zero,
  19. insetPadding: EdgeInsets.zero,
  20. backgroundColor:Colors.transparent,
  21. children: [
  22. MemberPaymentCompletedTipView(
  23. cancelOnTap: () {
  24. Get.back();
  25. cancelOnTap!();
  26. },
  27. confirmOnTap: confirmOnTap,
  28. days: days,
  29. )
  30. ],
  31. )
  32. );
  33. }
  34. }
  35. class MemberPaymentCompletedTipView extends StatefulWidget {
  36. final VoidCallback? cancelOnTap;
  37. final VoidCallback? confirmOnTap;
  38. final int? days;
  39. const MemberPaymentCompletedTipView({
  40. super.key,
  41. this.cancelOnTap,
  42. required this.confirmOnTap,
  43. this.days
  44. });
  45. @override
  46. State<MemberPaymentCompletedTipView> createState() => _MemberPaymentCompletedTipViewState();
  47. }
  48. class _MemberPaymentCompletedTipViewState extends State<MemberPaymentCompletedTipView> {
  49. @override
  50. Widget build(BuildContext context) {
  51. // TODO: implement build
  52. return Container(
  53. width: 1.sw,
  54. margin: EdgeInsets.symmetric(horizontal: 42.w),
  55. child: Stack(
  56. children: [
  57. IntrinsicHeight(
  58. child: Column(
  59. children: [
  60. Container(
  61. decoration: BoxDecoration(
  62. color: Colors.transparent,
  63. image: DecorationImage(
  64. image: Assets.images.iconMemberContactClickHelp.provider(),
  65. fit: BoxFit.fill,
  66. )
  67. ),
  68. child: Column(
  69. children: [
  70. SizedBox(
  71. height: 110.w,
  72. ),
  73. Row(
  74. crossAxisAlignment: CrossAxisAlignment.end,
  75. mainAxisAlignment: MainAxisAlignment.center,
  76. children: [
  77. Text("五星好评,",
  78. style: TextStyle(
  79. fontSize: 18.sp,
  80. color: "#333333".color,
  81. fontWeight: FontWeight.bold)),
  82. Text("免费领" ,
  83. style: TextStyle(
  84. fontSize: 18.sp,
  85. color: "#5E61F7".color,
  86. fontWeight: FontWeight.bold)),
  87. Transform.translate(
  88. offset: Offset(0, 8), // 向下偏移4像素
  89. child: Text("${widget.days ?? 0}",
  90. style: TextStyle(
  91. fontSize: 32.sp,
  92. color: "#5E61F7".color,
  93. fontWeight: FontWeight.bold)),
  94. ),
  95. Text("天会员",
  96. style: TextStyle(
  97. fontSize: 18.sp,
  98. color: "#5E61F7".color,
  99. fontWeight: FontWeight.bold))
  100. ],
  101. ),
  102. SizedBox(height: 8.w,),
  103. Row(
  104. mainAxisAlignment: MainAxisAlignment.center,
  105. children: [
  106. Container(
  107. decoration: BoxDecoration(
  108. gradient: LinearGradient(
  109. // 渐变方向:90度(从左到右)
  110. begin: Alignment.centerLeft,
  111. end: Alignment.centerRight,
  112. // 渐变颜色:从透明灰到#AAA
  113. colors: [
  114. Color.fromRGBO(170, 170, 170, 0.0), // rgba(170, 170, 170, 0.00)
  115. Color(0xFFAAAAAA), // #AAA
  116. ],
  117. // 渐变位置:0%到100%
  118. stops: [0.0, 1.0],
  119. ),
  120. ),
  121. width: 14.w,
  122. height: 1.w,
  123. ),
  124. SizedBox(width: 6.w,),
  125. Text("为你重要的朋友保驾护航",
  126. style: TextStyle(fontSize: 12.sp, color: ColorName.black60)),
  127. SizedBox(width: 6.w,),
  128. Container(
  129. width: 14.w,
  130. height: 1.w,
  131. decoration: BoxDecoration(
  132. gradient: LinearGradient(
  133. // 90度渐变(从左到右)
  134. begin: Alignment(1.0, 0.0),// 左侧起点
  135. end: Alignment(-1.0, 0.0), // 右侧终点
  136. // 渐变颜色:透明灰到#AAA
  137. colors: [
  138. Color.fromARGB(0, 170, 170, 170), // rgba(170, 170, 170, 0.00)
  139. Color(0xFFAAAAAA), // #AAA
  140. ],
  141. // 颜色分布位置
  142. stops: [0.0, 1.0],
  143. ),
  144. ),
  145. )
  146. ],
  147. ),
  148. SizedBox(height: 20.w,),
  149. GestureDetector(
  150. onTap: () {
  151. Get.back();
  152. widget.confirmOnTap!();
  153. },
  154. child: Container(
  155. decoration: BoxDecoration(
  156. gradient: LinearGradient(
  157. begin: Alignment.centerLeft, // 90度相当于从左到右
  158. end: Alignment.centerRight,
  159. colors: [
  160. Color(0xFF7B7DFF), // #7B7DFF
  161. Color(0xFF6365FF), // #6365FF
  162. ],
  163. stops: [0.0, 1.0],
  164. // 从0%到100%
  165. ),
  166. borderRadius: BorderRadius.circular(40.w / 2.0),
  167. ),
  168. margin: EdgeInsets.symmetric(horizontal: 20.w),
  169. height: 40.w,
  170. alignment: Alignment.center,
  171. child: Text("立即好评",
  172. style: TextStyle(
  173. fontSize: 14.sp,
  174. color: '#FFFFFF'.color,
  175. fontWeight: FontWeight.w500)
  176. ),
  177. ),
  178. ),
  179. SizedBox(
  180. height: 20.w,
  181. ),
  182. ],
  183. ),
  184. )
  185. ],
  186. ),
  187. ),
  188. Positioned(
  189. top: 48.w,
  190. right: 16.w,
  191. width: 20.w,
  192. height: 20.w,
  193. child: GestureDetector(
  194. onTap: widget.cancelOnTap,
  195. child: Assets.images.iconMemberContactClickHelpClose.image(width: 20.w, height: 20.w),
  196. ),
  197. )
  198. ],
  199. ),
  200. );
  201. }
  202. }