home_view.dart 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  1. import 'package:clean/base/base_view.dart';
  2. import 'package:clean/module/home/home_controller.dart';
  3. import 'package:clean/module/image_picker/image_picker_util.dart';
  4. import 'package:clean/resource/assets.gen.dart';
  5. import 'package:clean/resource/string.gen.dart';
  6. import 'package:flutter/Material.dart';
  7. import 'package:flutter_screenutil/flutter_screenutil.dart';
  8. import 'package:get/get.dart';
  9. import 'package:lottie/lottie.dart';
  10. import 'package:wechat_assets_picker/wechat_assets_picker.dart';
  11. import '../../widget/multi_segment_circle_indicator.dart';
  12. class HomePage extends BaseView<HomeController> {
  13. const HomePage({super.key});
  14. @override
  15. backgroundColor() {
  16. return Color(0xFF05050D);
  17. }
  18. @override
  19. viewHeight() {
  20. return double.infinity;
  21. }
  22. @override
  23. Widget buildBody(BuildContext context) {
  24. // TODO: implement buildBody
  25. return Stack(
  26. children: [
  27. SafeArea(
  28. child: SingleChildScrollView(
  29. child: Column(
  30. children: [
  31. titleCard(),
  32. storageCard(),
  33. similarCard(),
  34. quickPhotoCard(),
  35. peopleCard(),
  36. // locationsCard(),
  37. screenshotsAndBlurryCard(),
  38. SizedBox(height: 40.h),
  39. ],
  40. )),
  41. ),
  42. IgnorePointer(
  43. child: Assets.images.bgHome.image(
  44. width: 360.w,
  45. ),
  46. ),
  47. ],
  48. );
  49. }
  50. Widget titleCard() {
  51. return Padding(
  52. padding: EdgeInsets.only(top: 0.h, left: 16.w, right: 16.w),
  53. child: Row(
  54. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  55. children: [
  56. Text(
  57. StringName.appName,
  58. style: TextStyle(
  59. color: Colors.white,
  60. fontSize: 24.sp,
  61. fontWeight: FontWeight.w900,
  62. ),
  63. ),
  64. GestureDetector(
  65. onTap: controller.titleVipClick,
  66. child: Assets.images.iconHomeTitleVip
  67. .image(width: 60.8.w, height: 20.h),
  68. ),
  69. ],
  70. ),
  71. );
  72. }
  73. Widget storageCard() {
  74. return Container(
  75. margin: EdgeInsets.only(top: 20.h),
  76. padding: EdgeInsets.symmetric(horizontal: 16.w),
  77. width: 328.w,
  78. height: 146.h,
  79. decoration: ShapeDecoration(
  80. color: Colors.white.withValues(alpha: 0.10),
  81. shape: RoundedRectangleBorder(
  82. borderRadius: BorderRadius.circular(14.r),
  83. ),
  84. ),
  85. child: Row(
  86. children: [
  87. circularChartCard(),
  88. SizedBox(
  89. width: 14.w,
  90. ),
  91. storageInfoCard(),
  92. ],
  93. ));
  94. }
  95. Widget circularChartCard() {
  96. return SizedBox(
  97. width: 120.w,
  98. child: Obx(() {
  99. final isScanned = controller.isStorageScanned.value;
  100. if (!isScanned) {
  101. return MultiSegmentCircleIndicator(
  102. strokeWidth: 12.r,
  103. segments: [PieData("Scanning", 100, Colors.grey.withOpacity(0.1))],
  104. subtitle: "Scanning...",
  105. animationDuration: Duration.zero,
  106. centerValue: 0,
  107. );
  108. }
  109. return MultiSegmentCircleIndicator(
  110. key: ValueKey(isScanned),
  111. strokeWidth: 12.r,
  112. segments: controller.pieDataList,
  113. subtitle: "used",
  114. centerValue: controller.usedSpacePercentage,
  115. animationDuration: const Duration(seconds: 2),
  116. );
  117. }),
  118. );
  119. }
  120. Widget storageInfoCard() {
  121. return Column(
  122. crossAxisAlignment: CrossAxisAlignment.start,
  123. children: [
  124. SizedBox(
  125. height: 24.h,
  126. ),
  127. Text(
  128. 'Storage Used',
  129. style: TextStyle(
  130. color: Colors.white,
  131. fontSize: 16.sp,
  132. fontWeight: FontWeight.w500,
  133. ),
  134. ),
  135. Row(
  136. children: [
  137. Obx(() {
  138. return Text.rich(
  139. TextSpan(
  140. children: [
  141. TextSpan(
  142. text: ImagePickerUtil.formatSize(
  143. controller.usedSpace.value),
  144. style: TextStyle(
  145. color: Color(0xFFFC4C4F),
  146. fontSize: 13.sp,
  147. fontWeight: FontWeight.w400,
  148. ),
  149. ),
  150. TextSpan(
  151. text: 'GB',
  152. style: TextStyle(
  153. color: Color(0xFFFC4C4F),
  154. fontSize: 13.sp,
  155. fontWeight: FontWeight.w500,
  156. ),
  157. ),
  158. ],
  159. ),
  160. textAlign: TextAlign.center,
  161. );
  162. }),
  163. Text(
  164. ' / ',
  165. style: TextStyle(
  166. color: Colors.white.withValues(alpha: 0.6000000238418579),
  167. fontSize: 13.sp,
  168. fontWeight: FontWeight.w500,
  169. ),
  170. ),
  171. Obx(() {
  172. return Text.rich(
  173. TextSpan(
  174. children: [
  175. TextSpan(
  176. text: ImagePickerUtil.formatSize(
  177. controller.totalSpace.value),
  178. style: TextStyle(
  179. color:
  180. Colors.white.withValues(alpha: 0.6000000238418579),
  181. fontSize: 13.sp,
  182. fontWeight: FontWeight.w400,
  183. ),
  184. ),
  185. TextSpan(
  186. text: 'GB',
  187. style: TextStyle(
  188. color:
  189. Colors.white.withValues(alpha: 0.6000000238418579),
  190. fontSize: 13.sp,
  191. fontWeight: FontWeight.w500,
  192. ),
  193. ),
  194. ],
  195. ),
  196. textAlign: TextAlign.center,
  197. );
  198. }),
  199. ],
  200. ),
  201. SizedBox(
  202. height: 10.h,
  203. ),
  204. Row(
  205. crossAxisAlignment: CrossAxisAlignment.start,
  206. children: [
  207. Container(
  208. margin: EdgeInsets.only(top: 7.h),
  209. width: 6.w,
  210. height: 6.h,
  211. decoration: ShapeDecoration(
  212. color: Color(0xFF0279FB),
  213. shape: OvalBorder(),
  214. ),
  215. ),
  216. SizedBox(
  217. width: 3.5.w,
  218. ),
  219. Column(
  220. crossAxisAlignment: CrossAxisAlignment.start,
  221. children: [
  222. Text(
  223. 'Photos',
  224. textAlign: TextAlign.start,
  225. style: TextStyle(
  226. color: Colors.white,
  227. fontSize: 14.sp,
  228. fontWeight: FontWeight.w500,
  229. ),
  230. ),
  231. Obx(() {
  232. return Text(
  233. '${controller.photoSpaceStr}',
  234. textAlign: TextAlign.start,
  235. style: TextStyle(
  236. color: Colors.white.withValues(alpha: 0.6499999761581421),
  237. fontSize: 13.sp,
  238. fontWeight: FontWeight.w400,
  239. ),
  240. );
  241. }),
  242. ],
  243. ),
  244. SizedBox(
  245. width: 10.w,
  246. ),
  247. Container(
  248. margin: EdgeInsets.only(top: 7.h),
  249. width: 6.w,
  250. height: 6.h,
  251. decoration: ShapeDecoration(
  252. color: Color(0xFFEE4933),
  253. shape: OvalBorder(),
  254. ),
  255. ),
  256. SizedBox(
  257. width: 3.5.w,
  258. ),
  259. Column(
  260. crossAxisAlignment: CrossAxisAlignment.start,
  261. children: [
  262. Text(
  263. 'iphone',
  264. textAlign: TextAlign.start,
  265. style: TextStyle(
  266. color: Colors.white,
  267. fontSize: 14.sp,
  268. fontWeight: FontWeight.w500,
  269. ),
  270. ),
  271. Obx(() {
  272. return Text(
  273. '${controller.usedSpace.toStringAsFixed(1)} GB',
  274. textAlign: TextAlign.start,
  275. style: TextStyle(
  276. color: Colors.white.withValues(alpha: 0.6499999761581421),
  277. fontSize: 13.sp,
  278. fontWeight: FontWeight.w400,
  279. ),
  280. );
  281. }),
  282. ],
  283. ),
  284. ],
  285. ),
  286. ],
  287. );
  288. }
  289. Widget similarCard() {
  290. return GestureDetector(
  291. onTap: () {
  292. controller.similarCleanClick();
  293. },
  294. child: Container(
  295. width: 328.w,
  296. height: 155.h,
  297. margin: EdgeInsets.only(top: 20.h),
  298. padding: EdgeInsets.symmetric(horizontal: 16.w),
  299. decoration: ShapeDecoration(
  300. color: Colors.white.withValues(alpha: 0.12),
  301. shape: RoundedRectangleBorder(
  302. borderRadius: BorderRadius.circular(16.r),
  303. ),
  304. ),
  305. child: Column(
  306. crossAxisAlignment: CrossAxisAlignment.start,
  307. children: [
  308. SizedBox(height: 12.h),
  309. Row(
  310. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  311. children: [
  312. Column(
  313. crossAxisAlignment: CrossAxisAlignment.start,
  314. children: [
  315. Text(
  316. 'Similar',
  317. style: TextStyle(
  318. color: Colors.white,
  319. fontSize: 16.sp,
  320. fontWeight: FontWeight.w700,
  321. ),
  322. ),
  323. Obx(() {
  324. return Text.rich(
  325. TextSpan(
  326. children: [
  327. TextSpan(
  328. text:
  329. "${ImagePickerUtil.similarPhotoCount.value}",
  330. style: TextStyle(
  331. color: Colors.white,
  332. fontSize: 12.sp,
  333. fontWeight: FontWeight.w400,
  334. ),
  335. ),
  336. TextSpan(
  337. text: ' duplicate photos detected',
  338. style: TextStyle(
  339. color: Colors.white
  340. .withValues(alpha: 0.800000011920929),
  341. fontSize: 12.sp,
  342. fontWeight: FontWeight.w400,
  343. ),
  344. ),
  345. ],
  346. ),
  347. );
  348. }),
  349. ],
  350. ),
  351. Obx(() {
  352. return CleanUpButton(
  353. label: !controller.isScanned.value
  354. ? 'Scanning...'
  355. : 'Clean up',
  356. size: ImagePickerUtil.formatFileSize(
  357. ImagePickerUtil.similarPhotosSize.value),
  358. onTap: () {
  359. controller.similarCleanClick();
  360. },
  361. );
  362. }),
  363. ],
  364. ),
  365. // SizedBox(height: 19.h),
  366. Spacer(),
  367. Obx(() {
  368. return CleanUpButton(
  369. label:
  370. !controller.isSimilarScanned.value ? 'Scanning...' : 'Clean up',
  371. size: ImagePickerUtil.formatFileSize(
  372. ImagePickerUtil.similarPhotosSize.value),
  373. onTap: () {
  374. controller.similarCleanClick();
  375. },
  376. );
  377. }),
  378. ],
  379. ),
  380. // SizedBox(height: 19.h),
  381. Spacer(),
  382. Obx(() {
  383. return Row(
  384. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  385. children: List.generate(4, (index) {
  386. var image = Assets.images.iconHomeNoPhoto.image(
  387. width: 70.w * 0.45,
  388. height: 70.w * 0.45,
  389. );
  390. if (controller.similarPhotos.length > index) {
  391. image = AssetEntityImage(
  392. width: 70.w,
  393. height: 70.w,
  394. controller.similarPhotos[index],
  395. isOriginal: false,
  396. thumbnailSize: const ThumbnailSize.square(300),
  397. fit: BoxFit.cover,
  398. errorBuilder: (context, error, stackTrace) {
  399. return Assets.images.iconHomeNoPhoto.image(
  400. width: 70.w * 0.45,
  401. height: 70.w * 0.45,
  402. );
  403. });
  404. }
  405. return ImageContainer(
  406. size: 70.w,
  407. image: controller.similarPhotos.length > index ? image : Opacity(
  408. opacity: 0.22,
  409. child: const CircularProgressIndicator(color: Colors.white38,)
  410. ),
  411. // AssetEntityImage(
  412. // width: 70.w,
  413. // height: 70.w,
  414. // controller.similarPhotos[index],
  415. // isOriginal: false,
  416. // thumbnailSize: const ThumbnailSize.square(300),
  417. // fit: BoxFit.cover,
  418. // errorBuilder: (context, error, stackTrace) {
  419. // return Assets.images.iconHomeNoPhoto.image(
  420. // width: 70.w * 0.45,
  421. // height: 70.w * 0.45,
  422. // );
  423. // },
  424. );
  425. }),
  426. Spacer(),
  427. ],
  428. ),
  429. ));
  430. }
  431. Widget quickPhotoCard() {
  432. return Container(
  433. padding: EdgeInsets.symmetric(horizontal: 16.w),
  434. margin: EdgeInsets.only(top: 30.h),
  435. alignment: Alignment.centerLeft,
  436. child: Text(
  437. 'Quick Photo Clean',
  438. style: TextStyle(
  439. color: Colors.white,
  440. fontSize: 18.sp,
  441. fontWeight: FontWeight.w700,
  442. ),
  443. ),
  444. );
  445. }
  446. Widget peopleCard() {
  447. return GestureDetector(
  448. onTap: () {
  449. controller.peopleCleanClick();
  450. },
  451. child: Container(
  452. margin: EdgeInsets.only(top: 12.h),
  453. width: 328.w,
  454. height: 205.h,
  455. decoration: ShapeDecoration(
  456. color: Colors.white.withValues(alpha: 0.12),
  457. shape: RoundedRectangleBorder(
  458. borderRadius: BorderRadius.circular(14.sp),
  459. ),
  460. ),
  461. child: Stack(
  462. children: [
  463. Column(
  464. crossAxisAlignment: CrossAxisAlignment.start,
  465. children: [
  466. Spacer(),
  467. Padding(
  468. padding: EdgeInsets.only(left: 14.0.w),
  469. child: Text(
  470. 'People',
  471. style: TextStyle(
  472. color: Colors.white,
  473. fontSize: 16.sp,
  474. fontWeight: FontWeight.w700,
  475. ),
  476. ),
  477. ),
  478. Spacer(),
  479. Obx(() {
  480. return Row(
  481. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  482. children: List.generate(2, (index) {
  483. var image = Assets.images.iconHomeNoPhoto.image(
  484. width: 146.w * 0.45,
  485. height: 146.w * 0.45,
  486. );
  487. if (controller.peoplePhotos.length > index) {
  488. image = AssetEntityImage(
  489. width: 146.w,
  490. height: 146.w,
  491. controller.peoplePhotos[index],
  492. isOriginal: false,
  493. thumbnailSize: const ThumbnailSize.square(300),
  494. fit: BoxFit.cover,
  495. errorBuilder: (context, error, stackTrace) {
  496. return Assets.images.iconHomeNoPhoto.image(
  497. width: 146.w * 0.45,
  498. height: 146.w * 0.45,
  499. );
  500. });
  501. }
  502. return ImageContainer(
  503. image: controller.peoplePhotos.length > index ? image : Opacity(
  504. opacity: 0.22,
  505. child: const CircularProgressIndicator(color: Colors.white38,),
  506. ),
  507. size: 146.w,
  508. // Image.file(
  509. // width: 146.w,
  510. // height: 146.w,
  511. // controller.peoplePhotos[index],
  512. // fit: BoxFit.cover,
  513. // ),
  514. // 可以传入不同的路径
  515. );
  516. }),
  517. );
  518. }),
  519. Spacer(),
  520. ],
  521. ),
  522. Positioned(
  523. bottom: 20.h,
  524. right: 20.w,
  525. child: Obx(() {
  526. return CleanUpButton(
  527. label: !controller.isPeopleScanned.value
  528. ? 'Scanning...'
  529. : 'Clean up',
  530. size: ImagePickerUtil.formatFileSize(
  531. ImagePickerUtil.peopleSize.value),
  532. onTap: () {
  533. controller.peopleCleanClick();
  534. },
  535. );
  536. }),
  537. ),
  538. ],
  539. ),
  540. ));
  541. }
  542. Widget locationsCard() {
  543. return GestureDetector(
  544. onTap: () {
  545. controller.locationCleanClick();
  546. },
  547. child: Container(
  548. padding: EdgeInsets.symmetric(horizontal: 12.w),
  549. margin: EdgeInsets.only(top: 14.h),
  550. width: 328.w,
  551. height: 230.h,
  552. decoration: ShapeDecoration(
  553. color: Colors.white.withValues(alpha: 0.12),
  554. shape: RoundedRectangleBorder(
  555. borderRadius: BorderRadius.circular(14.sp),
  556. ),
  557. ),
  558. child: Stack(
  559. children: [
  560. Column(
  561. crossAxisAlignment: CrossAxisAlignment.start,
  562. children: [
  563. Spacer(),
  564. Text(
  565. 'Locations',
  566. style: TextStyle(
  567. color: Colors.white,
  568. fontSize: 16.sp,
  569. fontWeight: FontWeight.w700,
  570. ),
  571. ),
  572. Spacer(),
  573. Container(
  574. width: 304.w,
  575. height: 171.h,
  576. clipBehavior: Clip.hardEdge,
  577. decoration: ShapeDecoration(
  578. color: Color(0xFF272C33),
  579. shape: RoundedRectangleBorder(
  580. borderRadius: BorderRadius.circular(12.r),
  581. ),
  582. ),
  583. child: Obx(() {
  584. return Center(
  585. child: controller.locationPhoto.value == null
  586. ? Opacity(
  587. opacity: 0.22,
  588. child: Lottie.asset(Assets.anim.animNoPhoto,
  589. repeat: true, width: 160.w, height: 160.w),
  590. )
  591. : AssetEntityImage(
  592. width: 304.w,
  593. height: 171.h,
  594. controller.locationPhoto.value!,
  595. isOriginal: false,
  596. thumbnailSize: const ThumbnailSize.square(300),
  597. fit: BoxFit.cover,
  598. errorBuilder: (context, error, stackTrace) {
  599. return Assets.images.iconHomeNoPhoto.image(
  600. width: 60.w,
  601. height: 60.h,
  602. );
  603. },
  604. ),
  605. // Image.file(
  606. // width: 304.w,
  607. // height: 171.h,
  608. // controller.locationPhoto.value!,
  609. // fit: BoxFit.cover,
  610. // ),
  611. );
  612. }),
  613. ),
  614. Spacer(),
  615. ],
  616. ),
  617. Positioned(
  618. bottom: 20.h,
  619. right: 8.w,
  620. child: Obx(() {
  621. return CleanUpButton(
  622. label: 'Clean up',
  623. size: ImagePickerUtil.formatFileSize(
  624. ImagePickerUtil.locationsSize.value),
  625. onTap: () {
  626. controller.locationCleanClick();
  627. },
  628. );
  629. }),
  630. ),
  631. ],
  632. ),
  633. ));
  634. }
  635. Widget screenshotsAndBlurryCard() {
  636. return Container(
  637. padding: EdgeInsets.symmetric(horizontal: 16.w),
  638. margin: EdgeInsets.only(top: 14.h),
  639. child: Obx(() {
  640. return Row(
  641. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  642. children: [
  643. _buildCard(
  644. 'Screenshots',
  645. !controller.isScreenShotScanned.value ? 'Scanning...' : 'Clean up',
  646. ImagePickerUtil.formatFileSize(
  647. ImagePickerUtil.screenshotsSize.value),
  648. controller.screenshotPhoto.value == null
  649. ? Opacity(
  650. opacity: 0.22,
  651. child: const CircularProgressIndicator(
  652. color: Colors.white38,
  653. ),
  654. )
  655. : AssetEntityImage(
  656. width: 144.w,
  657. height: 142.h,
  658. controller.screenshotPhoto.value!,
  659. isOriginal: false,
  660. thumbnailSize: const ThumbnailSize.square(300),
  661. fit: BoxFit.cover,
  662. errorBuilder: (context, error, stackTrace) {
  663. return Assets.images.iconHomeNoPhoto.image(
  664. width: 60.w,
  665. height: 60.h,
  666. );
  667. },
  668. ),
  669. onTap: () {
  670. controller.screenshotCleanClick();
  671. },
  672. ),
  673. _buildCard(
  674. 'Blurry',
  675. !controller.isBlurryScanned.value ? 'Scanning...' : 'Clean up',
  676. ImagePickerUtil.formatFileSize(
  677. ImagePickerUtil.blurrySize.value),
  678. controller.blurryPhoto.value == null
  679. ? Opacity(
  680. opacity: 0.22,
  681. child: Lottie.asset(Assets.anim.animNoPhoto,
  682. repeat: true, width: 100.w, height: 100.w),
  683. )
  684. : AssetEntityImage(
  685. width: 144.w,
  686. height: 142.h,
  687. controller.blurryPhoto.value!,
  688. isOriginal: false,
  689. thumbnailSize: const ThumbnailSize.square(300),
  690. fit: BoxFit.cover,
  691. errorBuilder: (context, error, stackTrace) {
  692. return Assets.images.iconHomeNoPhoto.image(
  693. width: 60.w,
  694. height: 60.h,
  695. );
  696. },
  697. ), onTap: () {
  698. controller.blurryCleanClick();
  699. }),
  700. ],
  701. );
  702. }),
  703. );
  704. }
  705. Widget _buildCard(String title, String buttonLabel, String size, Widget image,
  706. {required Function() onTap}) {
  707. return Stack(
  708. children: [
  709. GestureDetector(
  710. onTap: onTap,
  711. child: Container(
  712. width: 160.w,
  713. height: 189.h,
  714. decoration: ShapeDecoration(
  715. color: Colors.white.withValues(alpha: 0.12),
  716. shape: RoundedRectangleBorder(
  717. borderRadius: BorderRadius.circular(14.r),
  718. ),
  719. ),
  720. child: Column(
  721. crossAxisAlignment: CrossAxisAlignment.center,
  722. children: [
  723. Spacer(),
  724. Container(
  725. alignment: Alignment.centerLeft,
  726. padding: EdgeInsets.only(left: 9.w),
  727. child: Text(
  728. title,
  729. style: TextStyle(
  730. color: Colors.white,
  731. fontSize: 16.sp,
  732. fontWeight: FontWeight.w700,
  733. ),
  734. ),
  735. ),
  736. Spacer(),
  737. Container(
  738. width: 144.w,
  739. height: 142.h,
  740. clipBehavior: Clip.hardEdge,
  741. decoration: ShapeDecoration(
  742. color: Color(0xFF272C33),
  743. shape: RoundedRectangleBorder(
  744. borderRadius: BorderRadius.circular(12.r),
  745. ),
  746. ),
  747. child: Center(
  748. child: image,
  749. ),
  750. ),
  751. Spacer(),
  752. ],
  753. ),
  754. ),
  755. ),
  756. Positioned(
  757. bottom: 16.h,
  758. right: 16.w,
  759. child: CleanUpButton(
  760. label: buttonLabel,
  761. size: size,
  762. onTap: onTap,
  763. ),
  764. ),
  765. ],
  766. );
  767. }
  768. }
  769. class CleanUpButton extends StatelessWidget {
  770. final String label;
  771. final String size;
  772. final Function() onTap;
  773. const CleanUpButton({
  774. super.key,
  775. required this.label,
  776. required this.size,
  777. required this.onTap,
  778. });
  779. @override
  780. Widget build(BuildContext context) {
  781. return GestureDetector(
  782. onTap: onTap,
  783. child: Container(
  784. width: 94.w,
  785. height: 44.h,
  786. decoration: ShapeDecoration(
  787. color: Color(0xFF0279FB),
  788. shape: RoundedRectangleBorder(
  789. borderRadius: BorderRadius.circular(10.r),
  790. ),
  791. ),
  792. child: Row(
  793. mainAxisAlignment: MainAxisAlignment.spaceAround,
  794. children: [
  795. Column(
  796. crossAxisAlignment: CrossAxisAlignment.start,
  797. children: [
  798. Spacer(),
  799. Text(
  800. label,
  801. style: TextStyle(
  802. color: Colors.white,
  803. fontSize: 12.sp,
  804. fontWeight: FontWeight.w400,
  805. ),
  806. ),
  807. Text(
  808. size,
  809. style: TextStyle(
  810. color: Colors.white,
  811. fontSize: 16.sp,
  812. height: 1,
  813. fontWeight: FontWeight.w700,
  814. ),
  815. ),
  816. Spacer(),
  817. ],
  818. ),
  819. Assets.images.iconHomeRightArrow.image(
  820. width: 6.52.w,
  821. height: 6.52.h,
  822. ),
  823. ],
  824. ),
  825. ));
  826. }
  827. }
  828. class ImageContainer extends StatelessWidget {
  829. final Widget image;
  830. final double size;
  831. const ImageContainer({
  832. super.key,
  833. required this.image,
  834. required this.size,
  835. });
  836. @override
  837. Widget build(BuildContext context) {
  838. return Container(
  839. width: size,
  840. height: size,
  841. clipBehavior: Clip.hardEdge,
  842. decoration: BoxDecoration(
  843. color: Color(0xFF272C33),
  844. borderRadius: BorderRadius.circular(12.r),
  845. ),
  846. child: Center(
  847. child: image,
  848. ),
  849. );
  850. }
  851. }