member_payment_completed_dialog.dart 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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/resource/colors.gen.dart';
  7. import 'package:location/utils/common_expand.dart';
  8. import '../../resource/assets.gen.dart';
  9. class MemberPaymentCompletedDialog {
  10. static void show({
  11. VoidCallback? cancelOnTap,
  12. VoidCallback? confirmOnTap,}) {
  13. Get.dialog(
  14. SimpleDialog(
  15. titlePadding: EdgeInsets.zero,
  16. contentPadding: EdgeInsets.zero,
  17. insetPadding: EdgeInsets.zero,
  18. backgroundColor:Colors.transparent,
  19. children: [
  20. MemberPaymentCompletedTipView(
  21. cancelOnTap: () {
  22. Get.back();
  23. cancelOnTap!();
  24. },
  25. confirmOnTap: confirmOnTap)
  26. ],
  27. )
  28. );
  29. }
  30. }
  31. class MemberPaymentCompletedTipView extends StatefulWidget {
  32. final VoidCallback? cancelOnTap;
  33. final VoidCallback? confirmOnTap;
  34. const MemberPaymentCompletedTipView({
  35. super.key,
  36. this.cancelOnTap,
  37. required this.confirmOnTap,
  38. });
  39. @override
  40. State<MemberPaymentCompletedTipView> createState() => _MemberPaymentCompletedTipViewState();
  41. }
  42. class _MemberPaymentCompletedTipViewState extends State<MemberPaymentCompletedTipView> {
  43. @override
  44. Widget build(BuildContext context) {
  45. // TODO: implement build
  46. return Container(
  47. width: 1.sw,
  48. margin: EdgeInsets.symmetric(horizontal: 42.w),
  49. child: IntrinsicHeight(
  50. child: Column(
  51. children: [
  52. Container(
  53. decoration: BoxDecoration(
  54. color: Colors.transparent,
  55. image: DecorationImage(
  56. image: Assets.images.iconMemberPaymentCompleted.provider(),
  57. fit: BoxFit.fill,
  58. )
  59. ),
  60. child: Column(
  61. children: [
  62. SizedBox(
  63. height: 150.w,
  64. ),
  65. Text("邀请好友 共享定位",
  66. style: TextStyle(
  67. fontSize: 20.sp,
  68. color: "#333333".color,
  69. fontWeight: FontWeight.bold)),
  70. SizedBox(height: 8.w,),
  71. Row(
  72. mainAxisAlignment: MainAxisAlignment.center,
  73. children: [
  74. Container(
  75. decoration: BoxDecoration(
  76. gradient: LinearGradient(
  77. // 渐变方向:90度(从左到右)
  78. begin: Alignment.centerLeft,
  79. end: Alignment.centerRight,
  80. // 渐变颜色:从透明灰到#AAA
  81. colors: [
  82. Color.fromRGBO(170, 170, 170, 0.0), // rgba(170, 170, 170, 0.00)
  83. Color(0xFFAAAAAA), // #AAA
  84. ],
  85. // 渐变位置:0%到100%
  86. stops: [0.0, 1.0],
  87. ),
  88. ),
  89. width: 14.w,
  90. height: 1.w,
  91. ),
  92. SizedBox(width: 6.w,),
  93. Text("共享定位需要对方下载软件授权",
  94. style: TextStyle(fontSize: 12.sp, color: ColorName.black60)),
  95. SizedBox(width: 6.w,),
  96. Container(
  97. width: 14.w,
  98. height: 1.w,
  99. decoration: BoxDecoration(
  100. gradient: LinearGradient(
  101. // 90度渐变(从左到右)
  102. begin: Alignment(1.0, 0.0), // 左侧起点
  103. end: Alignment(-1.0, 0.0), // 右侧终点
  104. // 渐变颜色:透明灰到#AAA
  105. colors: [
  106. Color.fromARGB(0, 170, 170, 170), // rgba(170, 170, 170, 0.00)
  107. Color(0xFFAAAAAA), // #AAA
  108. ],
  109. // 颜色分布位置
  110. stops: [0.0, 1.0],
  111. ),
  112. ),
  113. )
  114. ],
  115. ),
  116. SizedBox(
  117. height: 32.w,
  118. ),
  119. GestureDetector(
  120. onTap: () {
  121. Get.back();
  122. widget.confirmOnTap!();
  123. },
  124. child: Container(
  125. decoration: BoxDecoration(
  126. gradient: LinearGradient(
  127. begin: Alignment.centerLeft, // 90度相当于从左到右
  128. end: Alignment.centerRight,
  129. colors: [
  130. Color(0xFF7B7DFF), // #7B7DFF
  131. Color(0xFF6365FF), // #6365FF
  132. ],
  133. stops: [0.0, 1.0],
  134. // 从0%到100%
  135. ),
  136. borderRadius: BorderRadius.circular(40.w / 2.0),
  137. ),
  138. margin: EdgeInsets.symmetric(horizontal: 20.w),
  139. height: 40.w,
  140. alignment: Alignment.center,
  141. child: Text("立即邀请",
  142. style: TextStyle(
  143. fontSize: 14.sp,
  144. color: '#FFFFFF'.color,
  145. fontWeight: FontWeight.w500)
  146. ),
  147. ),
  148. ),
  149. SizedBox(
  150. height: 10.w,
  151. ),
  152. GestureDetector(
  153. onTap: widget.cancelOnTap,
  154. child: Container(
  155. height: 20.w,
  156. child: Text("下次再说",
  157. style: TextStyle(
  158. fontSize: 11.sp,
  159. color: '#898996'.color,
  160. fontWeight: FontWeight.w500)
  161. ),
  162. ),
  163. ),
  164. SizedBox(
  165. height: 12.w,
  166. ),
  167. ],
  168. ),
  169. )
  170. ],
  171. ),
  172. ),
  173. );
  174. }
  175. }