|
@@ -50,7 +50,7 @@ class PhotoSelectedPreviewPage
|
|
|
if (controller.photoGroups.isEmpty ||
|
|
if (controller.photoGroups.isEmpty ||
|
|
|
controller.photoGroups[0].images.isEmpty) {
|
|
controller.photoGroups[0].images.isEmpty) {
|
|
|
return _noNoPicturesCard();
|
|
return _noNoPicturesCard();
|
|
|
- }else if (controller.isKeepAll.value) {
|
|
|
|
|
|
|
+ } else if (controller.isKeepAll.value) {
|
|
|
return _finishCleanCard();
|
|
return _finishCleanCard();
|
|
|
}
|
|
}
|
|
|
return Column(
|
|
return Column(
|
|
@@ -72,7 +72,9 @@ class PhotoSelectedPreviewPage
|
|
|
),
|
|
),
|
|
|
itemCount:
|
|
itemCount:
|
|
|
controller.photoGroups[0].images.length,
|
|
controller.photoGroups[0].images.length,
|
|
|
- itemBuilder: _buildPhotoItem(
|
|
|
|
|
|
|
+ itemBuilder: (context, index) => _buildPhotoItem(
|
|
|
|
|
+ context,
|
|
|
|
|
+ index,
|
|
|
controller.photoGroups[0].images)),
|
|
controller.photoGroups[0].images)),
|
|
|
);
|
|
);
|
|
|
}),
|
|
}),
|
|
@@ -96,14 +98,12 @@ class PhotoSelectedPreviewPage
|
|
|
return IgnorePointer(
|
|
return IgnorePointer(
|
|
|
child: Assets.images.bgPhotoSelectedPreviewFinish.image(
|
|
child: Assets.images.bgPhotoSelectedPreviewFinish.image(
|
|
|
width: 360.w,
|
|
width: 360.w,
|
|
|
-
|
|
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
|
} else {
|
|
} else {
|
|
|
return IgnorePointer(
|
|
return IgnorePointer(
|
|
|
child: Assets.images.bgHome.image(
|
|
child: Assets.images.bgHome.image(
|
|
|
width: 360.w,
|
|
width: 360.w,
|
|
|
-
|
|
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -211,69 +211,64 @@ class PhotoSelectedPreviewPage
|
|
|
));
|
|
));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Widget Function(BuildContext, int) _buildPhotoItem(
|
|
|
|
|
- List<AssetEntity> images) =>
|
|
|
|
|
- (context, index) {
|
|
|
|
|
- final group =
|
|
|
|
|
- controller.getGroupByImages(controller.photoGroups[0].images);
|
|
|
|
|
-
|
|
|
|
|
- return GestureDetector(
|
|
|
|
|
- onTap: () =>
|
|
|
|
|
- controller.clickImage(images, index, controller.photosType),
|
|
|
|
|
- child: Obx(() {
|
|
|
|
|
- var isSelected = group.isImageSelected(images[index]);
|
|
|
|
|
- return Stack(
|
|
|
|
|
- children: [
|
|
|
|
|
- Container(
|
|
|
|
|
|
|
+ Widget _buildPhotoItem(context, index, List<AssetEntity> images) {
|
|
|
|
|
+ final group = controller.getGroupByImages(controller.photoGroups[0].images);
|
|
|
|
|
+ return GestureDetector(
|
|
|
|
|
+ onTap: () => controller.clickImage(images, index, controller.photosType),
|
|
|
|
|
+ child: Obx(() {
|
|
|
|
|
+ var isSelected = group.isImageSelected(images[index]);
|
|
|
|
|
+ return Stack(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Container(
|
|
|
|
|
+ width: 104.w,
|
|
|
|
|
+ height: 104.w,
|
|
|
|
|
+ decoration: ShapeDecoration(
|
|
|
|
|
+ color: Colors.white.withValues(alpha: 0.12),
|
|
|
|
|
+ shape: RoundedRectangleBorder(
|
|
|
|
|
+ borderRadius: BorderRadius.circular(9.27.sp),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: ClipRRect(
|
|
|
|
|
+ borderRadius: BorderRadius.circular(9.27.sp),
|
|
|
|
|
+ child: AssetEntityImage(
|
|
|
|
|
+ group.images[index],
|
|
|
width: 104.w,
|
|
width: 104.w,
|
|
|
|
|
+ isOriginal: false,
|
|
|
|
|
+ thumbnailSize: const ThumbnailSize.square(300),
|
|
|
height: 104.w,
|
|
height: 104.w,
|
|
|
- decoration: ShapeDecoration(
|
|
|
|
|
- color: Colors.white.withValues(alpha: 0.12),
|
|
|
|
|
- shape: RoundedRectangleBorder(
|
|
|
|
|
- borderRadius: BorderRadius.circular(9.27.sp),
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- child: ClipRRect(
|
|
|
|
|
- borderRadius: BorderRadius.circular(9.27.sp),
|
|
|
|
|
- child: AssetEntityImage(
|
|
|
|
|
- group.images[index],
|
|
|
|
|
- width: 104.w,
|
|
|
|
|
- thumbnailSize: const ThumbnailSize.square(300),
|
|
|
|
|
- height: 104.w,
|
|
|
|
|
- fit: BoxFit.cover,
|
|
|
|
|
- frameBuilder: Styles.customFrameBuilder(
|
|
|
|
|
- width: 104.w,
|
|
|
|
|
- height: 104.w,
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ fit: BoxFit.cover,
|
|
|
|
|
+ frameBuilder: Styles.customFrameBuilder(
|
|
|
|
|
+ width: 104.w,
|
|
|
|
|
+ height: 104.w,
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
- Positioned(
|
|
|
|
|
- right: 8.w,
|
|
|
|
|
- bottom: 8.h,
|
|
|
|
|
- child: GestureDetector(
|
|
|
|
|
- onTap: () =>
|
|
|
|
|
- controller.toggleImageSelection(images, index),
|
|
|
|
|
- child: Container(
|
|
|
|
|
- child: isSelected
|
|
|
|
|
- ? Center(
|
|
|
|
|
- child: Assets.images.iconSelected.image(
|
|
|
|
|
- width: 20.w,
|
|
|
|
|
- height: 20.h,
|
|
|
|
|
- ),
|
|
|
|
|
- )
|
|
|
|
|
- : Center(
|
|
|
|
|
- child: Assets.images.iconUnselected.image(
|
|
|
|
|
- width: 20.w,
|
|
|
|
|
- height: 20.h,
|
|
|
|
|
- )),
|
|
|
|
|
- )),
|
|
|
|
|
- ),
|
|
|
|
|
- ],
|
|
|
|
|
- );
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ Positioned(
|
|
|
|
|
+ right: 8.w,
|
|
|
|
|
+ bottom: 8.h,
|
|
|
|
|
+ child: GestureDetector(
|
|
|
|
|
+ onTap: () => controller.toggleImageSelection(images, index),
|
|
|
|
|
+ child: Container(
|
|
|
|
|
+ child: isSelected
|
|
|
|
|
+ ? Center(
|
|
|
|
|
+ child: Assets.images.iconSelected.image(
|
|
|
|
|
+ width: 20.w,
|
|
|
|
|
+ height: 20.h,
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ : Center(
|
|
|
|
|
+ child: Assets.images.iconUnselected.image(
|
|
|
|
|
+ width: 20.w,
|
|
|
|
|
+ height: 20.h,
|
|
|
|
|
+ )),
|
|
|
|
|
+ )),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
);
|
|
);
|
|
|
- };
|
|
|
|
|
|
|
+ }),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
Widget _noNoPicturesCard() {
|
|
Widget _noNoPicturesCard() {
|
|
|
return Column(
|
|
return Column(
|