privacy_dialog.dart 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. import 'package:clean/data/consts/constants.dart';
  2. import 'package:clean/module/browser/browser_view.dart';
  3. import 'package:clean/resource/assets.gen.dart';
  4. import 'package:clean/resource/colors.gen.dart';
  5. import 'package:flutter/Material.dart';
  6. import 'package:flutter/gestures.dart';
  7. import 'package:flutter_screenutil/flutter_screenutil.dart';
  8. import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
  9. import 'package:lottie/lottie.dart';
  10. void privacyDialog() {
  11. const tag = 'privacyDialog';
  12. SmartDialog.show(
  13. tag: tag,
  14. backType: SmartBackType.normal,
  15. clickMaskDismiss: false,
  16. maskColor: ColorName.black,
  17. builder: (_) {
  18. return Container(
  19. height: double.infinity,
  20. width: double.infinity,
  21. child: Stack(
  22. children: [
  23. SafeArea(
  24. child: Column(
  25. crossAxisAlignment: CrossAxisAlignment.start,
  26. children: [
  27. Container(
  28. margin: EdgeInsets.only(left: 16.w, top: 16.h),
  29. width: 28.w,
  30. height: 28.w,
  31. decoration: ShapeDecoration(
  32. color: Color(0xFF2A3E55),
  33. shape: RoundedRectangleBorder(
  34. borderRadius: BorderRadius.circular(86.r),
  35. ),
  36. image: DecorationImage(
  37. image: Assets.images.iconPrivateClose.provider(),
  38. ),
  39. ),
  40. ),
  41. SizedBox(
  42. height: 45.h,
  43. ),
  44. Column(
  45. crossAxisAlignment: CrossAxisAlignment.center,
  46. mainAxisAlignment: MainAxisAlignment.center,
  47. children: [
  48. SizedBox(
  49. width: 245.w,
  50. child: Text(
  51. 'Clean up your iphone and free up storage',
  52. textAlign: TextAlign.center,
  53. style: TextStyle(
  54. color: Colors.white,
  55. fontSize: 24.sp,
  56. fontWeight: FontWeight.w500,
  57. height: 1.25.h,
  58. ),
  59. ),
  60. ),
  61. SizedBox(
  62. child: Lottie.asset(
  63. Assets.anim.animPrivacy,
  64. height: 412.w,
  65. repeat: true,
  66. )),
  67. SizedBox(
  68. height: 8,
  69. ),
  70. Text(
  71. 'CleanPro values your privacy. By starting, you agree to ',
  72. style: TextStyle(
  73. color: Colors.white.withValues(alpha: 0.8),
  74. fontSize: 12.sp,
  75. fontWeight: FontWeight.w400,
  76. height: 1.50.h,
  77. ),
  78. ),
  79. Text.rich(
  80. TextSpan(
  81. children: [
  82. TextSpan(
  83. text: 'our ',
  84. style: TextStyle(
  85. color: Colors.white.withValues(alpha: 0.8),
  86. fontSize: 12.sp,
  87. fontWeight: FontWeight.w400,
  88. height: 2.50.h,
  89. ),
  90. ),
  91. buildLinkText(
  92. 'Privacy Policy', Constants.privacyPolicy),
  93. TextSpan(
  94. text: ' and ',
  95. style: TextStyle(
  96. color: Colors.white.withValues(alpha: 0.8),
  97. fontSize: 12.sp,
  98. fontWeight: FontWeight.w400,
  99. height: 2.50.h,
  100. ),
  101. ),
  102. buildLinkText(
  103. 'Terms of Service', Constants.userAgreement),
  104. TextSpan(
  105. text: '.',
  106. style: TextStyle(
  107. color: Colors.white,
  108. fontSize: 12.sp,
  109. fontWeight: FontWeight.w400,
  110. height: 2.50.h,
  111. ),
  112. ),
  113. ],
  114. ),
  115. ),
  116. SizedBox(
  117. height: 8.h,
  118. ),
  119. GestureDetector(
  120. onTap: () {
  121. },
  122. child: Container(
  123. width: 316.w,
  124. height: 48.h,
  125. decoration: ShapeDecoration(
  126. color: Color(0xFF0279FB),
  127. shape: RoundedRectangleBorder(
  128. borderRadius: BorderRadius.circular(24.r),
  129. ),
  130. ),
  131. child: Center(
  132. child: Text(
  133. 'Start',
  134. style: TextStyle(
  135. color: Colors.white,
  136. fontSize: 16.sp,
  137. fontWeight: FontWeight.w500,
  138. ),
  139. ),
  140. ),
  141. )),
  142. ],
  143. ),
  144. ],
  145. ),
  146. ),
  147. IgnorePointer(
  148. child: Assets.images.bgPhotoSelectedPreviewFinish.image(
  149. width: 360.w,
  150. height: 335.h,
  151. ),
  152. ),
  153. ],
  154. ),
  155. );
  156. });
  157. }
  158. TextSpan buildLinkText(String text, String url) {
  159. return TextSpan(
  160. text: text,
  161. style: TextStyle(
  162. color: Colors.white,
  163. decoration: TextDecoration.underline,
  164. decorationColor: Colors.white,
  165. fontSize: 12.sp,
  166. fontWeight: FontWeight.w400,
  167. height: 2.50.h,
  168. ),
  169. // 链接文字样式
  170. recognizer: TapGestureRecognizer()
  171. ..onTap = () {
  172. BrowserPage.start(url);
  173. },
  174. );
  175. }