|
@@ -9,6 +9,7 @@ import 'package:flutter/widgets.dart';
|
|
|
import 'package:plugin_basic/modules/global_web_page.dart';
|
|
|
import 'package:plugin_basic/modules/preview_photo_page.dart';
|
|
|
import 'package:plugin_basic/router/basic_page_router.dart';
|
|
|
+import 'package:plugin_platform/engine/image/image_preview.dart';
|
|
|
import 'package:router/componentRouter/component_service_manager.dart';
|
|
|
import 'package:router/ext/auto_router_extensions.dart';
|
|
|
import 'package:shared/utils/color_utils.dart';
|
|
@@ -17,15 +18,6 @@ import 'package:widgets/ext/ex_widget.dart';
|
|
|
import 'package:widgets/my_load_image.dart';
|
|
|
import 'package:widgets/my_text_view.dart';
|
|
|
|
|
|
-// 'id':1,
|
|
|
-// 'avator': Assets.communityCamera,
|
|
|
-// 'title': 'William Jefferson',
|
|
|
-// 'isFollow': false,
|
|
|
-// 'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
|
|
|
-// 'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
|
|
|
-// 'time': 'June 17,2016 at 7:23 p.m.',
|
|
|
-// 'likeno': 12
|
|
|
-
|
|
|
class NewsFeedCardContent extends StatelessWidget {
|
|
|
final String content;
|
|
|
final List<dynamic>? imageUrls;
|
|
@@ -109,23 +101,32 @@ class NewsFeedCardContent extends StatelessWidget {
|
|
|
color: ColorUtils.string2Color("#F2F3F6"),
|
|
|
child:Stack(
|
|
|
children: [
|
|
|
- MyLoadImage(
|
|
|
- imageUrls[index],
|
|
|
- height: 87,
|
|
|
- // width: maxWidth/imageCount - 16,
|
|
|
- width: (totalImageCount < rowMaxImageNum)? maxWidth/rowMaxImageNum - 16 : maxWidth/imageCount - 16,
|
|
|
- fit: BoxFit.cover,
|
|
|
- // fit:BoxFit.fitWidth,
|
|
|
- cornerRadius: 5,
|
|
|
- onClick: (){
|
|
|
- if(isPreviewImage){
|
|
|
- // 点击图片预览
|
|
|
- // 过滤掉非字符串类型的元素
|
|
|
- List<String> filteredImages = totalImageUrls?.whereType<String>().toList() ?? [];
|
|
|
- // PreviewPhotoPage.startInstance(context: context, images: filteredImages, position: index);
|
|
|
- context.appRouter.push(PreviewPhotoPageRoute(images: filteredImages, position: index));
|
|
|
- }
|
|
|
- },
|
|
|
+ Hero(
|
|
|
+ tag: imageUrls[index],
|
|
|
+ child: MyLoadImage(
|
|
|
+ imageUrls[index],
|
|
|
+ height: 87,
|
|
|
+ // width: maxWidth/imageCount - 16,
|
|
|
+ width: (totalImageCount < rowMaxImageNum)? maxWidth/rowMaxImageNum - 16 : maxWidth/imageCount - 16,
|
|
|
+ fit: BoxFit.cover,
|
|
|
+ // fit:BoxFit.fitWidth,
|
|
|
+ cornerRadius: 5,
|
|
|
+ onClick: (){
|
|
|
+ if(isPreviewImage){
|
|
|
+ // 点击图片预览
|
|
|
+ // 过滤掉非字符串类型的元素
|
|
|
+ List<String> filteredImages = totalImageUrls?.whereType<String>().toList() ?? [];
|
|
|
+ // PreviewPhotoPage.startInstance(context: context, images: filteredImages, position: index);
|
|
|
+ context.appRouter.push(PreviewPhotoPageRoute(images: filteredImages, position: index));
|
|
|
+ // ImagePreviewEngine.multipleImagePreview(
|
|
|
+ // context,
|
|
|
+ // filteredImages,
|
|
|
+ // heroes: List.generate(filteredImages.length, (index) => filteredImages[index]),
|
|
|
+ // onLongPressAction: (url) {}
|
|
|
+ // );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ),
|
|
|
),
|
|
|
otherImageCount > 0 && index == imageCount-1 ?
|
|
|
Positioned(
|