store_view.dart 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. import 'package:clean/base/base_page.dart';
  2. import 'package:clean/module/store/store_controller.dart';
  3. import 'package:clean/utils/expand.dart';
  4. import 'package:flutter/Material.dart';
  5. import 'package:flutter_screenutil/flutter_screenutil.dart';
  6. import 'package:get/get.dart';
  7. import '../../resource/assets.gen.dart';
  8. class StorePage extends BasePage<StoreController> {
  9. const StorePage({super.key});
  10. @override
  11. bool immersive() {
  12. return true;
  13. }
  14. @override
  15. bool statusBarDarkFont() => false;
  16. @override
  17. Widget buildBody(BuildContext context) {
  18. return Scaffold(
  19. backgroundColor: Colors.black,
  20. body: Stack(
  21. children: [
  22. IgnorePointer(
  23. child: Assets.images.bgStore.image(
  24. width: 360.w,
  25. ),
  26. ),
  27. SafeArea(
  28. child: Column(
  29. crossAxisAlignment: CrossAxisAlignment.start,
  30. children: [
  31. Row(
  32. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  33. crossAxisAlignment: CrossAxisAlignment.center,
  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.iconCommonBack
  42. .image(width: 28.w, height: 28.w),
  43. ),
  44. ),
  45. Container(
  46. margin: EdgeInsets.only(right: 16.w, top: 17.h),
  47. child: GestureDetector(
  48. onTap: () {
  49. Get.back();
  50. },
  51. child: Text(
  52. 'Restore',
  53. style: TextStyle(
  54. color: Colors.white70,
  55. fontSize: 14.sp,
  56. ),
  57. ),
  58. ),
  59. ),
  60. ],
  61. ),
  62. SizedBox(
  63. height: 30.h,
  64. ),
  65. // 标题
  66. Center(
  67. child: RichText(
  68. text: TextSpan(
  69. children: [
  70. TextSpan(
  71. text: 'CLEAN ',
  72. style: TextStyle(
  73. color: "#FFDD55".color,
  74. fontSize: 20.sp,
  75. fontWeight: FontWeight.bold,
  76. ),
  77. ),
  78. TextSpan(
  79. text: 'PRO ',
  80. style: TextStyle(
  81. color: Colors.white,
  82. fontSize: 20.sp,
  83. fontWeight: FontWeight.bold,
  84. ),
  85. ),
  86. TextSpan(
  87. text: 'FREE ',
  88. style: TextStyle(
  89. color: "#FFDD55".color,
  90. fontSize: 20.sp,
  91. fontWeight: FontWeight.bold,
  92. ),
  93. ),
  94. TextSpan(
  95. text: 'UP STORAGE',
  96. style: TextStyle(
  97. color: Colors.white,
  98. fontSize: 20.sp,
  99. fontWeight: FontWeight.bold,
  100. ),
  101. ),
  102. ],
  103. ),
  104. ),
  105. ),
  106. SizedBox(
  107. height: 20.h,
  108. ),
  109. Center(
  110. child: Container(
  111. width: 328.w,
  112. height: 203.h,
  113. decoration: BoxDecoration(
  114. image: DecorationImage(
  115. image: Assets.images.bgStoreFunc.provider(),
  116. fit: BoxFit.fill,
  117. ),
  118. ),
  119. child: Column(
  120. mainAxisAlignment: MainAxisAlignment.spaceAround,
  121. children: [
  122. _buildFeatureItem(
  123. icon: Assets.images.iconStoreSimilar
  124. .image(width: 30.w, height: 30.w),
  125. title: 'One-click Remove Similar Photos',
  126. ),
  127. _buildFeatureItem(
  128. icon: Assets.images.iconStoreAi
  129. .image(width: 30.w, height: 30.w),
  130. title: 'Detect Blurry and Junk Photos',
  131. ),
  132. _buildFeatureItem(
  133. icon: Assets.images.iconStoreContacts
  134. .image(width: 30.w, height: 30.w),
  135. title: 'Merge Duplicate Contacts',
  136. ),
  137. _buildFeatureItem(
  138. icon: Assets.images.iconStorePremium
  139. .image(width: 30.w, height: 30.w),
  140. title: 'Premium Unlimited',
  141. ),
  142. ],
  143. ),
  144. ),
  145. ),
  146. SizedBox(height: 14.h),
  147. Expanded(
  148. child: ListView.builder(
  149. itemCount: 3,
  150. itemBuilder: (context, index) {
  151. return _buildSubscriptionOption(
  152. title: '3-DAY FREE TRIAL',
  153. price: '\$6.99/week',
  154. perDay: 'only \$0.64/day',
  155. isSelected: true,
  156. showTag: true,
  157. );
  158. },
  159. ),
  160. ),
  161. Center(
  162. child: Text(
  163. 'Auto-renewable.Cancel anytime.',
  164. style: TextStyle(
  165. color: Colors.white.withOpacity(0.8),
  166. fontSize: 12.sp,
  167. ),
  168. ),
  169. ),
  170. SizedBox(
  171. height: 5.h,
  172. ),
  173. Center(
  174. child: Container(
  175. width: 312.w,
  176. height: 48.h,
  177. decoration: BoxDecoration(
  178. color: "#0279FB".color,
  179. borderRadius: BorderRadius.all(
  180. Radius.circular(24.r),
  181. ),
  182. ),
  183. child: GestureDetector(
  184. child: Center(
  185. child: Text(
  186. "CONTINUE",
  187. style: TextStyle(
  188. color: Colors.white,
  189. fontWeight: FontWeight.w700,
  190. fontSize: 16.sp,
  191. ),
  192. ),
  193. ),
  194. ),
  195. ),
  196. ),
  197. // // 底部链接
  198. SizedBox(height: 8.h,),
  199. Row(
  200. mainAxisAlignment: MainAxisAlignment.center,
  201. children: [
  202. GestureDetector(
  203. child: Text(
  204. 'Privacy Policy',
  205. style: TextStyle(
  206. color: Colors.white.withOpacity(0.8),
  207. fontSize: 12.sp,
  208. ),
  209. ),
  210. onTap: () {},
  211. ),
  212. Text(
  213. ' | ',
  214. style: TextStyle(
  215. color: Colors.white.withOpacity(0.8),
  216. fontSize: 12.sp,
  217. ),
  218. ),
  219. GestureDetector(
  220. child: Text(
  221. 'User Agreement',
  222. style: TextStyle(
  223. color: Colors.white.withOpacity(0.8),
  224. fontSize: 12.sp,
  225. ),
  226. ),
  227. onTap: () {},
  228. ),
  229. ],
  230. ),
  231. //
  232. // // 订阅选项
  233. // _buildSubscriptionOption(
  234. // title: '3-DAY FREE TRIAL',
  235. // price: '\$6.99/week',
  236. // perDay: 'only \$0.64/day',
  237. // isSelected: true,
  238. // showTag: true,
  239. // ),
  240. //
  241. // _buildSubscriptionOption(
  242. // title: '1 Month',
  243. // price: '\$19.99',
  244. // perDay: 'only \$0.64/day',
  245. // ),
  246. //
  247. // _buildSubscriptionOption(
  248. // title: '1 Year',
  249. // price: '\$69.99',
  250. // perDay: 'only \$0.19/day',
  251. // ),
  252. //
  253. // // 底部文本
  254. // Padding(
  255. // padding: EdgeInsets.symmetric(vertical: 16.h),
  256. // child: Center(
  257. // child: Text(
  258. // 'Auto-renewable.Cancel anytime.',
  259. // style: TextStyle(
  260. // color: Colors.white54,
  261. // fontSize: 12.sp,
  262. // ),
  263. // ),
  264. // ),
  265. // ),
  266. //
  267. // // 继续按钮
  268. // Padding(
  269. // padding: EdgeInsets.all(20.w),
  270. // child: ElevatedButton(
  271. // style: ElevatedButton.styleFrom(
  272. // backgroundColor: Colors.blue,
  273. // minimumSize: Size(double.infinity, 50.h),
  274. // shape: RoundedRectangleBorder(
  275. // borderRadius: BorderRadius.circular(25.r),
  276. // ),
  277. // ),
  278. // child: Text(
  279. // 'CONTINUE',
  280. // style: TextStyle(
  281. // fontSize: 16.sp,
  282. // fontWeight: FontWeight.bold,
  283. // ),
  284. // ),
  285. // onPressed: () {},
  286. // ),
  287. // ),
  288. //
  289. // // 底部链接
  290. // Padding(
  291. // padding: EdgeInsets.symmetric(horizontal: 20.w),
  292. // child: Row(
  293. // mainAxisAlignment: MainAxisAlignment.center,
  294. // children: [
  295. // TextButton(
  296. // child: Text(
  297. // 'Privacy Policy',
  298. // style: TextStyle(color: Colors.white54),
  299. // ),
  300. // onPressed: () {},
  301. // ),
  302. // Text(
  303. // ' | ',
  304. // style: TextStyle(color: Colors.white54),
  305. // ),
  306. // TextButton(
  307. // child: Text(
  308. // 'User Agreement',
  309. // style: TextStyle(color: Colors.white54),
  310. // ),
  311. // onPressed: () {},
  312. // ),
  313. // ],
  314. // ),
  315. // ),
  316. ],
  317. ),
  318. ),
  319. ],
  320. ),
  321. );
  322. }
  323. Widget _buildFeatureItem({
  324. required Image icon,
  325. required String title,
  326. }) {
  327. return Row(
  328. children: [
  329. SizedBox(width: 15.w),
  330. icon,
  331. SizedBox(width: 8.w),
  332. Text(
  333. title,
  334. style: TextStyle(
  335. color: Colors.white,
  336. fontSize: 15.sp,
  337. fontWeight: FontWeight.w500,
  338. ),
  339. ),
  340. ],
  341. );
  342. }
  343. Widget _buildSubscriptionOption({
  344. required String title,
  345. required String price,
  346. required String perDay,
  347. bool isSelected = false,
  348. bool showTag = false,
  349. }) {
  350. return Container(
  351. margin: EdgeInsets.symmetric(horizontal: 20.w, vertical: 5.h),
  352. decoration: BoxDecoration(
  353. color: Colors.white.withOpacity(0.06),
  354. borderRadius: BorderRadius.circular(14.r),
  355. border: isSelected ? Border.all(color: Colors.blue, width: 2.w) : null,
  356. ),
  357. child: Stack(
  358. children: [
  359. Padding(
  360. padding: EdgeInsets.all(16.w),
  361. child: Row(
  362. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  363. children: [
  364. Column(
  365. crossAxisAlignment: CrossAxisAlignment.start,
  366. children: [
  367. Text(
  368. title,
  369. style: TextStyle(
  370. color: Colors.white,
  371. fontSize: 16.sp,
  372. fontWeight: FontWeight.bold,
  373. ),
  374. ),
  375. Text(
  376. perDay,
  377. style: TextStyle(
  378. color: Colors.white54,
  379. fontSize: 12.sp,
  380. ),
  381. ),
  382. ],
  383. ),
  384. Text(
  385. price,
  386. style: TextStyle(
  387. color: Colors.white,
  388. fontSize: 18.sp,
  389. fontWeight: FontWeight.bold,
  390. ),
  391. ),
  392. ],
  393. ),
  394. ),
  395. if (showTag)
  396. Positioned(
  397. right: 0,
  398. top: 0,
  399. child: Container(
  400. padding: EdgeInsets.symmetric(
  401. horizontal: 8.w,
  402. vertical: 4.h,
  403. ),
  404. decoration: BoxDecoration(
  405. color: Colors.red,
  406. borderRadius: BorderRadius.only(
  407. topRight: Radius.circular(12.r),
  408. bottomLeft: Radius.circular(12.r),
  409. ),
  410. ),
  411. child: Text(
  412. 'No payment now!',
  413. style: TextStyle(
  414. color: Colors.white,
  415. fontSize: 12.sp,
  416. ),
  417. ),
  418. ),
  419. ),
  420. ],
  421. ),
  422. );
  423. }
  424. }