|
|
@@ -361,7 +361,7 @@ class HomePage extends BaseView<HomeController> {
|
|
|
),
|
|
|
Obx(() {
|
|
|
return CleanUpButton(
|
|
|
- label: !controller.isScanned.value
|
|
|
+ label: !controller.isSimilarScanned.value
|
|
|
? 'Scanning...'
|
|
|
: 'Clean up',
|
|
|
size: ImagePickerUtil.formatFileSize(
|
|
|
@@ -376,62 +376,52 @@ class HomePage extends BaseView<HomeController> {
|
|
|
// SizedBox(height: 19.h),
|
|
|
Spacer(),
|
|
|
Obx(() {
|
|
|
- return CleanUpButton(
|
|
|
- label:
|
|
|
- !controller.isSimilarScanned.value ? 'Scanning...' : 'Clean up',
|
|
|
- size: ImagePickerUtil.formatFileSize(
|
|
|
- ImagePickerUtil.similarPhotosSize.value),
|
|
|
- onTap: () {
|
|
|
- controller.similarCleanClick();
|
|
|
- },
|
|
|
- );
|
|
|
- }),
|
|
|
- ],
|
|
|
- ),
|
|
|
- // SizedBox(height: 19.h),
|
|
|
- Spacer(),
|
|
|
- Obx(() {
|
|
|
- return Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
- children: List.generate(4, (index) {
|
|
|
- var image = Assets.images.iconHomeNoPhoto.image(
|
|
|
- width: 70.w * 0.45,
|
|
|
- height: 70.w * 0.45,
|
|
|
- );
|
|
|
- if (controller.similarPhotos.length > index) {
|
|
|
- image = AssetEntityImage(
|
|
|
- width: 70.w,
|
|
|
- height: 70.w,
|
|
|
- controller.similarPhotos[index],
|
|
|
- isOriginal: false,
|
|
|
- thumbnailSize: const ThumbnailSize.square(300),
|
|
|
- fit: BoxFit.cover,
|
|
|
- errorBuilder: (context, error, stackTrace) {
|
|
|
+ return Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: List.generate(4, (index) {
|
|
|
+ var image = Assets.images.iconHomeNoPhoto.image(
|
|
|
+ width: 70.w * 0.45,
|
|
|
+ height: 70.w * 0.45,
|
|
|
+ );
|
|
|
+ if (controller.similarPhotos.length > index) {
|
|
|
+ image = AssetEntityImage(
|
|
|
+ width: 70.w,
|
|
|
+ height: 70.w,
|
|
|
+ controller.similarPhotos[index],
|
|
|
+ isOriginal: false,
|
|
|
+ thumbnailSize: const ThumbnailSize.square(300),
|
|
|
+ fit: BoxFit.cover,
|
|
|
+ errorBuilder: (context, error, stackTrace) {
|
|
|
return Assets.images.iconHomeNoPhoto.image(
|
|
|
width: 70.w * 0.45,
|
|
|
height: 70.w * 0.45,
|
|
|
);
|
|
|
});
|
|
|
- }
|
|
|
- return ImageContainer(
|
|
|
- size: 70.w,
|
|
|
- image: controller.similarPhotos.length > index ? image : Opacity(
|
|
|
- opacity: 0.22,
|
|
|
- child: const CircularProgressIndicator(color: Colors.white38,)
|
|
|
- ),
|
|
|
- // AssetEntityImage(
|
|
|
- // width: 70.w,
|
|
|
- // height: 70.w,
|
|
|
- // controller.similarPhotos[index],
|
|
|
- // isOriginal: false,
|
|
|
- // thumbnailSize: const ThumbnailSize.square(300),
|
|
|
- // fit: BoxFit.cover,
|
|
|
- // errorBuilder: (context, error, stackTrace) {
|
|
|
- // return Assets.images.iconHomeNoPhoto.image(
|
|
|
- // width: 70.w * 0.45,
|
|
|
- // height: 70.w * 0.45,
|
|
|
- // );
|
|
|
- // },
|
|
|
+ }
|
|
|
+ return controller.similarPhotos.isNotEmpty
|
|
|
+ ? image
|
|
|
+ : ImageContainer(
|
|
|
+ size: 70.w,
|
|
|
+ image: Opacity(
|
|
|
+ opacity: 0.22,
|
|
|
+ child: Lottie.asset(Assets.anim.animNoPhoto,
|
|
|
+ repeat: true, width: 100.w, height: 100.w),
|
|
|
+ ),
|
|
|
+ // AssetEntityImage(
|
|
|
+ // width: 70.w,
|
|
|
+ // height: 70.w,
|
|
|
+ // controller.similarPhotos[index],
|
|
|
+ // isOriginal: false,
|
|
|
+ // thumbnailSize: const ThumbnailSize.square(300),
|
|
|
+ // fit: BoxFit.cover,
|
|
|
+ // errorBuilder: (context, error, stackTrace) {
|
|
|
+ // return Assets.images.iconHomeNoPhoto.image(
|
|
|
+ // width: 70.w * 0.45,
|
|
|
+ // height: 70.w * 0.45,
|
|
|
+ // );
|
|
|
+ // },
|
|
|
+ );
|
|
|
+ }),
|
|
|
);
|
|
|
}),
|
|
|
Spacer(),
|
|
|
@@ -513,10 +503,14 @@ class HomePage extends BaseView<HomeController> {
|
|
|
});
|
|
|
}
|
|
|
return ImageContainer(
|
|
|
- image: controller.peoplePhotos.length > index ? image : Opacity(
|
|
|
- opacity: 0.22,
|
|
|
- child: const CircularProgressIndicator(color: Colors.white38,),
|
|
|
- ),
|
|
|
+ image: controller.peoplePhotos.length > index
|
|
|
+ ? image
|
|
|
+ : Opacity(
|
|
|
+ opacity: 0.22,
|
|
|
+ child: const CircularProgressIndicator(
|
|
|
+ color: Colors.white38,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
size: 146.w,
|
|
|
// Image.file(
|
|
|
// width: 146.w,
|
|
|
@@ -657,7 +651,9 @@ class HomePage extends BaseView<HomeController> {
|
|
|
children: [
|
|
|
_buildCard(
|
|
|
'Screenshots',
|
|
|
- !controller.isScreenShotScanned.value ? 'Scanning...' : 'Clean up',
|
|
|
+ !controller.isScreenShotScanned.value
|
|
|
+ ? 'Scanning...'
|
|
|
+ : 'Clean up',
|
|
|
ImagePickerUtil.formatFileSize(
|
|
|
ImagePickerUtil.screenshotsSize.value),
|
|
|
controller.screenshotPhoto.value == null
|