discount_view.dart 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. class DiscountPage extends BasePage<DiscountController> {
  11. const DiscountPage({super.key});
  12. @override
  13. bool immersive() {
  14. return true;
  15. }
  16. @override
  17. bool statusBarDarkFont() => false;
  18. @override
  19. Widget buildBody(BuildContext context) {
  20. return Scaffold(
  21. backgroundColor: "#05050D".color,
  22. body: Stack(
  23. children: [
  24. // IgnorePointer(
  25. // child: Assets.images.bgStore.image(
  26. // width: 360.w,
  27. // ),
  28. // ),
  29. SafeArea(
  30. child: Column(
  31. crossAxisAlignment: CrossAxisAlignment.center,
  32. children: [
  33. Row(
  34. children: [
  35. Container(
  36. margin: EdgeInsets.only(left: 16.w, top: 14.h),
  37. child: GestureDetector(
  38. onTap: () {
  39. Get.back();
  40. },
  41. child: Assets.images.iconStoreClose
  42. .image(width: 28.w, height: 28.w),
  43. ),
  44. ),
  45. ],
  46. ),
  47. Assets.images.iconDiscountTitle
  48. .image(width: 259.w, height: 55.h),
  49. SizedBox(
  50. height: 20.h,
  51. ),
  52. Assets.images.iconDiscountPercent
  53. .image(width: 195.w, height: 86.h),
  54. SizedBox(
  55. height: 13.h,
  56. ),
  57. Container(
  58. width: 197.w,
  59. height: 32.h,
  60. padding: EdgeInsets.all(1.w),
  61. decoration: BoxDecoration(
  62. gradient: LinearGradient(
  63. begin: Alignment.topCenter,
  64. end: Alignment.bottomCenter,
  65. colors: [
  66. '#CF9EFD'.color,
  67. '#4DCFFF'.color.withOpacity(0.5),
  68. ],
  69. ),
  70. borderRadius: BorderRadius.all(Radius.circular(18.r)),
  71. ),
  72. child: Container(
  73. decoration: BoxDecoration(
  74. color: "#05050D".color,
  75. borderRadius: BorderRadius.all(Radius.circular(18.r)),
  76. ),
  77. child: Center(
  78. child: Text(
  79. "Get CleanPro Premium",
  80. style: TextStyle(
  81. color: Colors.white,
  82. fontSize: 15.sp,
  83. fontWeight: FontWeight.w700,
  84. ),
  85. ),
  86. ),
  87. ),
  88. ),
  89. SizedBox(
  90. height: 26.h,
  91. ),
  92. // 创建一个1分钟的倒计时
  93. CountdownTimer(duration: const Duration(minutes: 1)),
  94. Spacer(),
  95. Text(
  96. "3-Day Free Trial",
  97. style: TextStyle(
  98. color: Colors.white,
  99. fontSize: 16.sp,
  100. fontWeight: FontWeight.w500,
  101. ),
  102. ),
  103. Text(
  104. "Then \$69.99",
  105. style: TextStyle(
  106. color: Colors.white,
  107. fontSize: 13.sp,
  108. ),
  109. ),
  110. SizedBox(
  111. height: 14.h,
  112. ),
  113. GestureDetector(
  114. onTap: () {
  115. // controller.onBuyClick();
  116. },
  117. child: Container(
  118. width: 312.w,
  119. height: 48.h,
  120. decoration: BoxDecoration(
  121. color: "#0279FB".color,
  122. borderRadius: BorderRadius.all(
  123. Radius.circular(24.r),
  124. ),
  125. ),
  126. child: Center(
  127. child: Text(
  128. "START FREE TRIAL",
  129. style: TextStyle(
  130. color: Colors.white,
  131. fontWeight: FontWeight.w700,
  132. fontSize: 16.sp,
  133. ),
  134. ),
  135. ),
  136. ),
  137. ),
  138. SizedBox(
  139. height: 5.h,
  140. ),
  141. Text(
  142. "No payment now!",
  143. style: TextStyle(
  144. color: "#57C87A".color,
  145. fontSize: 12.sp,
  146. fontWeight: FontWeight.w500,
  147. ),
  148. ),
  149. ],
  150. ),
  151. ),
  152. ],
  153. ),
  154. );
  155. }
  156. }