discount_view.dart 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. import 'dart:async';
  2. import 'package:clean/base/base_page.dart';
  3. import 'package:clean/module/store/discount/discount_controller.dart';
  4. import 'package:clean/utils/expand.dart';
  5. import 'package:flutter/Material.dart';
  6. import 'package:flutter_screenutil/flutter_screenutil.dart';
  7. import 'package:get/get.dart';
  8. import '../../../resource/assets.gen.dart';
  9. import 'count_down_timer.dart';
  10. import 'func_page_view.dart';
  11. class DiscountPage extends BasePage<DiscountController> {
  12. const DiscountPage({super.key});
  13. @override
  14. bool immersive() {
  15. return true;
  16. }
  17. @override
  18. bool statusBarDarkFont() => false;
  19. @override
  20. Widget buildBody(BuildContext context) {
  21. return Scaffold(
  22. backgroundColor: "#05050D".color,
  23. body: Stack(
  24. children: [
  25. // IgnorePointer(
  26. // child: Assets.images.bgStore.image(
  27. // width: 360.w,
  28. // ),
  29. // ),
  30. SafeArea(
  31. child: Column(
  32. crossAxisAlignment: CrossAxisAlignment.center,
  33. children: [
  34. Row(
  35. children: [
  36. Container(
  37. margin: EdgeInsets.only(left: 16.w, top: 14.h),
  38. child: GestureDetector(
  39. onTap: () {
  40. Get.back();
  41. },
  42. child: Assets.images.iconStoreClose
  43. .image(width: 28.w, height: 28.w),
  44. ),
  45. ),
  46. ],
  47. ),
  48. Assets.images.iconDiscountTitle
  49. .image(width: 259.w, height: 55.h),
  50. SizedBox(
  51. height: 20.h,
  52. ),
  53. Assets.images.iconDiscountPercent
  54. .image(width: 195.w, height: 86.h),
  55. SizedBox(
  56. height: 13.h,
  57. ),
  58. Container(
  59. width: 197.w,
  60. height: 32.h,
  61. padding: EdgeInsets.all(1.w),
  62. decoration: BoxDecoration(
  63. gradient: LinearGradient(
  64. begin: Alignment.topCenter,
  65. end: Alignment.bottomCenter,
  66. colors: [
  67. '#CF9EFD'.color,
  68. '#4DCFFF'.color.withOpacity(0.5),
  69. ],
  70. ),
  71. borderRadius: BorderRadius.all(Radius.circular(18.r)),
  72. ),
  73. child: Container(
  74. decoration: BoxDecoration(
  75. color: "#05050D".color,
  76. borderRadius: BorderRadius.all(Radius.circular(18.r)),
  77. ),
  78. child: Center(
  79. child: Text(
  80. "Get CleanPro Premium",
  81. style: TextStyle(
  82. color: Colors.white,
  83. fontSize: 15.sp,
  84. fontWeight: FontWeight.w700,
  85. ),
  86. ),
  87. ),
  88. ),
  89. ),
  90. SizedBox(
  91. height: 26.h,
  92. ),
  93. // 创建一个1分钟的倒计时
  94. CountdownTimer(duration: const Duration(minutes: 1)),
  95. InfinitePreviewPageView(
  96. height: 80.h,
  97. autoPlay: true,
  98. autoPlayDuration: const Duration(seconds: 3),
  99. items: [
  100. PreviewItem(
  101. title: 'Merge Duplicate Contacts',
  102. icon: Icons.people_outline,
  103. onTap: () => print('Tapped Merge'),
  104. ),
  105. PreviewItem(
  106. title: 'Clean Storage',
  107. icon: Icons.storage_outlined,
  108. onTap: () => print('Tapped Clean'),
  109. ),
  110. PreviewItem(
  111. title: 'Backup Photos',
  112. icon: Icons.photo_library_outlined,
  113. onTap: () => print('Tapped Backup'),
  114. ),
  115. ],
  116. ),
  117. Spacer(),
  118. Text(
  119. "3-Day Free Trial",
  120. style: TextStyle(
  121. color: Colors.white,
  122. fontSize: 16.sp,
  123. fontWeight: FontWeight.w500,
  124. ),
  125. ),
  126. Text(
  127. "Then \$69.99",
  128. style: TextStyle(
  129. color: Colors.white,
  130. fontSize: 13.sp,
  131. ),
  132. ),
  133. SizedBox(
  134. height: 14.h,
  135. ),
  136. GestureDetector(
  137. onTap: () {
  138. // controller.onBuyClick();
  139. },
  140. child: Container(
  141. width: 312.w,
  142. height: 48.h,
  143. decoration: BoxDecoration(
  144. color: "#0279FB".color,
  145. borderRadius: BorderRadius.all(
  146. Radius.circular(24.r),
  147. ),
  148. ),
  149. child: Center(
  150. child: Text(
  151. "START FREE TRIAL",
  152. style: TextStyle(
  153. color: Colors.white,
  154. fontWeight: FontWeight.w700,
  155. fontSize: 16.sp,
  156. ),
  157. ),
  158. ),
  159. ),
  160. ),
  161. SizedBox(
  162. height: 5.h,
  163. ),
  164. Text(
  165. "No payment now!",
  166. style: TextStyle(
  167. color: "#57C87A".color,
  168. fontSize: 12.sp,
  169. fontWeight: FontWeight.w500,
  170. ),
  171. ),
  172. ],
  173. ),
  174. ),
  175. ],
  176. ),
  177. );
  178. }
  179. }