member_payment_completed_dialog.dart 6.5 KB

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