|
|
@@ -31,34 +31,37 @@ class ScreenshotsPage extends BasePage<ScreenShotsController> {
|
|
|
return Stack(children: [
|
|
|
Container(
|
|
|
child: SafeArea(
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- _titleCard(),
|
|
|
- // Photo groups
|
|
|
- Expanded(
|
|
|
- child: Obx(() {
|
|
|
- return SizedBox(
|
|
|
- child: GridView.builder(
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
|
- scrollDirection: Axis.vertical,
|
|
|
- // 设置为垂直方向滚动
|
|
|
- physics: BouncingScrollPhysics(),
|
|
|
- gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
- crossAxisCount: 3, // 每行显示 2 个元素
|
|
|
- mainAxisSpacing: 8.w, // 垂直间距
|
|
|
- crossAxisSpacing: 8.h, // 水平间距
|
|
|
- ),
|
|
|
- itemCount: controller.photoGroups[0].imageCount,
|
|
|
- itemBuilder:
|
|
|
- _buildPhotoItem(controller.photoGroups[0].title)),
|
|
|
- );
|
|
|
- }),
|
|
|
- ),
|
|
|
-
|
|
|
- _bottomBarCard(),
|
|
|
- SizedBox(height: 8.h),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ child: (controller.photoGroups.isEmpty ||
|
|
|
+ controller.photoGroups[0].images.isEmpty)
|
|
|
+ ? _noNoPicturesCard()
|
|
|
+ : Column(
|
|
|
+ children: [
|
|
|
+ _titleCard(),
|
|
|
+ Flexible(
|
|
|
+ child: Obx(() {
|
|
|
+ return SizedBox(
|
|
|
+ child: GridView.builder(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
|
+ scrollDirection: Axis.vertical,
|
|
|
+ // 设置为垂直方向滚动
|
|
|
+ physics: BouncingScrollPhysics(),
|
|
|
+ gridDelegate:
|
|
|
+ SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
+ crossAxisCount: 3, // 每行显示 2 个元素
|
|
|
+ mainAxisSpacing: 8.w, // 垂直间距
|
|
|
+ crossAxisSpacing: 8.h, // 水平间距
|
|
|
+ ),
|
|
|
+ itemCount:
|
|
|
+ controller.photoGroups[0].images.length,
|
|
|
+ itemBuilder: _buildPhotoItem(
|
|
|
+ controller.photoGroups[0].title)),
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ _bottomBarCard(),
|
|
|
+ SizedBox(height: 8.h),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
IgnorePointer(
|
|
|
@@ -77,46 +80,59 @@ class ScreenshotsPage extends BasePage<ScreenShotsController> {
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
- children: [
|
|
|
- GestureDetector(
|
|
|
- onTap: () => Get.back(),
|
|
|
- child: Assets.images.iconBackArrow.image(
|
|
|
- width: 28.w,
|
|
|
- height: 28.h,
|
|
|
+ Obx(() {
|
|
|
+ return Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: [
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () => Get.back(),
|
|
|
+ child: Assets.images.iconBackArrow.image(
|
|
|
+ width: 28.w,
|
|
|
+ height: 28.h,
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- GestureDetector(
|
|
|
- onTap: () => controller
|
|
|
- .toggleGroupSelection(controller.photoGroups[0].title),
|
|
|
- child: Obx(() => Text(
|
|
|
- controller.photoGroups
|
|
|
- .firstWhere((g) =>
|
|
|
- g.title == controller.photoGroups[0].title)
|
|
|
- .isSelected
|
|
|
- .value
|
|
|
- ? 'Deselect All'
|
|
|
- : 'Select All',
|
|
|
+ // 如果photoGroup数据为空,不显示全选按钮
|
|
|
+ controller.photoGroups.isEmpty ||
|
|
|
+ controller.photoGroups[0].images.isEmpty
|
|
|
+ ? Container()
|
|
|
+ : GestureDetector(
|
|
|
+ onTap: () => controller.toggleGroupSelection(
|
|
|
+ controller.photoGroups[0].title),
|
|
|
+ child: Obx(() => Text(
|
|
|
+ controller.photoGroups
|
|
|
+ .firstWhere((g) =>
|
|
|
+ g.title ==
|
|
|
+ controller.photoGroups[0].title)
|
|
|
+ .isSelected
|
|
|
+ .value
|
|
|
+ ? 'Deselect All'
|
|
|
+ : 'Select All',
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white.withValues(alpha: 0.7),
|
|
|
+ fontSize: 14.sp,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ ),
|
|
|
+ )),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ controller.photoGroups.isEmpty
|
|
|
+ ? Container()
|
|
|
+ : Column(
|
|
|
+ children: [
|
|
|
+ SizedBox(height: 12.h),
|
|
|
+ Text(
|
|
|
+ controller.titleName,
|
|
|
style: TextStyle(
|
|
|
- color: Colors.white.withValues(alpha: 0.7),
|
|
|
- fontSize: 14.sp,
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 24.sp,
|
|
|
+ fontWeight: FontWeight.w700,
|
|
|
),
|
|
|
- )),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- SizedBox(height: 12.h),
|
|
|
- Text(
|
|
|
- controller.titleName,
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 24.sp,
|
|
|
- fontWeight: FontWeight.w700,
|
|
|
- ),
|
|
|
- ),
|
|
|
- SizedBox(height: 20.h),
|
|
|
+ ),
|
|
|
+ SizedBox(height: 20.h),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
@@ -161,12 +177,11 @@ class ScreenshotsPage extends BasePage<ScreenShotsController> {
|
|
|
(context, index) {
|
|
|
final group =
|
|
|
controller.photoGroups.firstWhere((group) => group.title == title);
|
|
|
- final assetEntity = group.images[index];
|
|
|
|
|
|
return GestureDetector(
|
|
|
onTap: () => controller.clickImage(title, index),
|
|
|
child: Obx(() {
|
|
|
- final isSelected = group.selectedImages[index];
|
|
|
+ var isSelected = group.selectedImages[index];
|
|
|
return Stack(
|
|
|
children: [
|
|
|
Container(
|
|
|
@@ -178,7 +193,8 @@ class ScreenshotsPage extends BasePage<ScreenShotsController> {
|
|
|
borderRadius: BorderRadius.circular(9.27.sp),
|
|
|
),
|
|
|
image: DecorationImage(
|
|
|
- image: AssetEntityImageProvider(assetEntity),
|
|
|
+ image: AssetEntityImageProvider(group.images[index],thumbnailSize: const ThumbnailSize.square(300),
|
|
|
+ isOriginal: false,),
|
|
|
fit: BoxFit.cover,
|
|
|
),
|
|
|
),
|
|
|
@@ -190,19 +206,19 @@ class ScreenshotsPage extends BasePage<ScreenShotsController> {
|
|
|
onTap: () =>
|
|
|
controller.toggleImageSelection(title, 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,
|
|
|
- )),
|
|
|
- )),
|
|
|
+ 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,
|
|
|
+ )),
|
|
|
+ )),
|
|
|
),
|
|
|
],
|
|
|
);
|
|
|
@@ -212,45 +228,44 @@ class ScreenshotsPage extends BasePage<ScreenShotsController> {
|
|
|
|
|
|
Widget _noNoPicturesCard() {
|
|
|
return Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: [
|
|
|
_titleCard(),
|
|
|
- Expanded(
|
|
|
- child: Center(
|
|
|
- child: Column(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- width: 70.w,
|
|
|
- height: 70.h,
|
|
|
- clipBehavior: Clip.antiAlias,
|
|
|
- decoration: BoxDecoration(),
|
|
|
- child: Assets.images.iconNoPictures.image(),
|
|
|
- ),
|
|
|
- SizedBox(height: 22.h),
|
|
|
- Text(
|
|
|
- 'No pictures found',
|
|
|
- textAlign: TextAlign.center,
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 20.sp,
|
|
|
- fontWeight: FontWeight.w700,
|
|
|
- ),
|
|
|
+ Expanded(child: Center(
|
|
|
+ child: Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ width: 70.w,
|
|
|
+ height: 70.h,
|
|
|
+ clipBehavior: Clip.antiAlias,
|
|
|
+ decoration: BoxDecoration(),
|
|
|
+ child: Assets.images.iconNoPictures.image(),
|
|
|
+ ),
|
|
|
+ SizedBox(height: 22.h),
|
|
|
+ Text(
|
|
|
+ 'No pictures found',
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 20.sp,
|
|
|
+ fontWeight: FontWeight.w700,
|
|
|
),
|
|
|
- SizedBox(height: 12.h),
|
|
|
- Text(
|
|
|
- 'No pictures available at the moment',
|
|
|
- textAlign: TextAlign.center,
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white.withValues(alpha: 0.6),
|
|
|
- fontSize: 14.sp,
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
- ),
|
|
|
+ ),
|
|
|
+ SizedBox(height: 12.h),
|
|
|
+ Text(
|
|
|
+ 'No pictures available at the moment',
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white.withValues(alpha: 0.6),
|
|
|
+ fontSize: 14.sp,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
- ),
|
|
|
+ )),
|
|
|
],
|
|
|
);
|
|
|
}
|