|
|
@@ -33,34 +33,44 @@ class LocationsSinglePhotoPage
|
|
|
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, // 每行显示 3 个元素
|
|
|
- mainAxisSpacing: 8.w, // 垂直间距
|
|
|
- crossAxisSpacing: 8.h, // 水平间距
|
|
|
- ),
|
|
|
- itemCount: controller.photoGroups.first.imageCount,
|
|
|
- itemBuilder: _buildPhotoItem(
|
|
|
- controller.photoGroups.first.location ?? "")),
|
|
|
- );
|
|
|
+ child: Obx(() {
|
|
|
+ if (controller.photoGroups.isEmpty) {
|
|
|
+ return _noNoPicturesCard();
|
|
|
+ }
|
|
|
+ return Column(
|
|
|
+ children: [
|
|
|
+ _titleCard(),
|
|
|
+ Expanded(
|
|
|
+ child: Obx(() {
|
|
|
+ return SizedBox(
|
|
|
+ child: GridView.builder(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
|
+ scrollDirection: Axis.vertical,
|
|
|
+ // 设置为垂直方向滚动
|
|
|
+ physics: BouncingScrollPhysics(),
|
|
|
+ gridDelegate:
|
|
|
+ SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
+ crossAxisCount: 3, // 每行显示 3 个元素
|
|
|
+ mainAxisSpacing: 8.w, // 垂直间距
|
|
|
+ crossAxisSpacing: 8.h, // 水平间距
|
|
|
+ ),
|
|
|
+ itemCount: controller.photoGroups.first.images.length,
|
|
|
+ itemBuilder: _buildPhotoItem(
|
|
|
+ controller.photoGroups.first.location ?? "")),
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ Obx(() {
|
|
|
+ if (controller.selectedFileCount.value == 0) {
|
|
|
+ return SizedBox();
|
|
|
+ } else {
|
|
|
+ return _bottomBarCard();
|
|
|
+ }
|
|
|
}),
|
|
|
- ),
|
|
|
-
|
|
|
- _bottomBarCard(),
|
|
|
- SizedBox(height: 8.h),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ SizedBox(height: 8.h),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }),
|
|
|
),
|
|
|
),
|
|
|
IgnorePointer(
|
|
|
@@ -79,7 +89,6 @@ class LocationsSinglePhotoPage
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
-
|
|
|
Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
children: [
|
|
|
@@ -90,29 +99,35 @@ class LocationsSinglePhotoPage
|
|
|
height: 28.h,
|
|
|
),
|
|
|
),
|
|
|
- Text(
|
|
|
- controller.photoGroups.first.location ?? "",
|
|
|
- textAlign: TextAlign.center,
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 17.sp,
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
- ),
|
|
|
- ),
|
|
|
- GestureDetector(
|
|
|
- onTap: () => controller
|
|
|
- .toggleGroupSelection(controller.photoGroups.first.location?? ""),
|
|
|
- child: Obx(() => Text(
|
|
|
- controller.photoGroups.first.isSelected.value
|
|
|
- ? 'Deselect All'
|
|
|
- : 'Select All',
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white.withValues(alpha: 0.7),
|
|
|
- fontSize: 14.sp,
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
- ),
|
|
|
- )),
|
|
|
- ),
|
|
|
+ Obx(() {
|
|
|
+ if (controller.photoGroups.isEmpty) return SizedBox();
|
|
|
+ return Text(
|
|
|
+ controller.photoGroups.first.location ?? "",
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 17.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ Obx(() {
|
|
|
+ if (controller.photoGroups.isEmpty) return SizedBox();
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: () => controller.toggleGroupSelection(
|
|
|
+ controller.photoGroups.first.location ?? ""),
|
|
|
+ child: Obx(() => Text(
|
|
|
+ controller.photoGroups.first.isSelected.value
|
|
|
+ ? 'Deselect All'
|
|
|
+ : 'Select All',
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white.withValues(alpha: 0.7),
|
|
|
+ fontSize: 14.sp,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ ),
|
|
|
+ )),
|
|
|
+ );
|
|
|
+ }),
|
|
|
],
|
|
|
),
|
|
|
SizedBox(height: 30.h),
|
|
|
@@ -122,36 +137,39 @@ class LocationsSinglePhotoPage
|
|
|
}
|
|
|
|
|
|
Widget _bottomBarCard() {
|
|
|
- return Container(
|
|
|
- width: 328.w,
|
|
|
- height: 48.h,
|
|
|
- decoration: ShapeDecoration(
|
|
|
- color: Color(0xFF0279FB),
|
|
|
- shape: RoundedRectangleBorder(
|
|
|
- borderRadius: BorderRadius.circular(10.r),
|
|
|
- ),
|
|
|
- ),
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
|
- child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- Assets.images.iconDelete.image(
|
|
|
- width: 18.w,
|
|
|
- height: 18.h,
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: () => controller.clickDelete(),
|
|
|
+ child: Container(
|
|
|
+ width: 328.w,
|
|
|
+ height: 48.h,
|
|
|
+ decoration: ShapeDecoration(
|
|
|
+ color: Color(0xFF0279FB),
|
|
|
+ shape: RoundedRectangleBorder(
|
|
|
+ borderRadius: BorderRadius.circular(10.r),
|
|
|
),
|
|
|
- SizedBox(width: 5.w),
|
|
|
- Obx(() {
|
|
|
- return Text(
|
|
|
- '${controller.selectedFileCount.value} files selected (${controller.selectedFilesSize.value.toStringAsFixed(1)} KB)',
|
|
|
- textAlign: TextAlign.center,
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 16.sp,
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
- ),
|
|
|
- );
|
|
|
- }),
|
|
|
- ],
|
|
|
+ ),
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Assets.images.iconDelete.image(
|
|
|
+ width: 18.w,
|
|
|
+ height: 18.h,
|
|
|
+ ),
|
|
|
+ SizedBox(width: 5.w),
|
|
|
+ Obx(() {
|
|
|
+ return Text(
|
|
|
+ '${controller.selectedFileCount.value} files selected (${controller.selectedFilesSize.value.toStringAsFixed(1)} KB)',
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 16.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
@@ -159,7 +177,6 @@ class LocationsSinglePhotoPage
|
|
|
Widget Function(BuildContext, int) _buildPhotoItem(String location) =>
|
|
|
(context, index) {
|
|
|
final group = controller.getGroupByLocation(location);
|
|
|
- final assetEntity = group.images[index];
|
|
|
|
|
|
return GestureDetector(
|
|
|
onTap: () => controller.clickImage(location, index),
|
|
|
@@ -176,8 +193,11 @@ class LocationsSinglePhotoPage
|
|
|
borderRadius: BorderRadius.circular(9.27.sp),
|
|
|
),
|
|
|
image: DecorationImage(
|
|
|
- image: AssetEntityImageProvider(assetEntity,thumbnailSize: const ThumbnailSize.square(300),
|
|
|
- isOriginal: false,),
|
|
|
+ image: AssetEntityImageProvider(
|
|
|
+ group.images[index],
|
|
|
+ thumbnailSize: const ThumbnailSize.square(300),
|
|
|
+ isOriginal: false,
|
|
|
+ ),
|
|
|
fit: BoxFit.cover,
|
|
|
),
|
|
|
),
|
|
|
@@ -213,41 +233,42 @@ class LocationsSinglePhotoPage
|
|
|
return Column(
|
|
|
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,
|
|
|
- ),
|
|
|
+ SizedBox(
|
|
|
+ height: 170.h,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ 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,
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
),
|
|
|
],
|