|
|
@@ -127,20 +127,43 @@ class CalendarPage extends BaseView<CalendarController> {
|
|
|
children: List.generate(2, (index) {
|
|
|
if (index < photoGroup.images.length) {
|
|
|
return GestureDetector(
|
|
|
- onTap: () => controller.clickImage(photoGroup, index),
|
|
|
- child: Container(
|
|
|
- width: 146.w,
|
|
|
- height: 146.w,
|
|
|
- decoration: BoxDecoration(
|
|
|
- borderRadius: BorderRadius.circular(12.r),
|
|
|
- image: DecorationImage(
|
|
|
- image: AssetEntityImageProvider(
|
|
|
+ onTap: () => controller.clickImage(photoGroup, index),
|
|
|
+ child: Stack(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ width: 146.w,
|
|
|
+ height: 146.w,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(12.r),
|
|
|
+ image: DecorationImage(
|
|
|
+ image: AssetEntityImageProvider(
|
|
|
photoGroup.images[index],
|
|
|
- isOriginal: false),
|
|
|
- fit: BoxFit.cover,
|
|
|
+ isOriginal: false,
|
|
|
+ ),
|
|
|
+ fit: BoxFit.cover,
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
- ));
|
|
|
+ // 如果是视频,显示时长
|
|
|
+ if (photoGroup.images[index].type == AssetType.video)
|
|
|
+ Positioned(
|
|
|
+ bottom: 8.w,
|
|
|
+ right: 8.w,
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 6.w, vertical: 2.h),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Colors.black54,
|
|
|
+ borderRadius: BorderRadius.circular(6.r),
|
|
|
+ ),
|
|
|
+ child: Text(
|
|
|
+ CalendarState.formatDuration(photoGroup.images[index].duration),
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
} else {
|
|
|
return Container(
|
|
|
width: 146.w,
|