From c4ffd5e3260b8b60b62f6188455789ff8142abe6 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 14 Oct 2021 20:44:58 +0800 Subject: [PATCH] update as grid image view --- lib/utils/as_grid_image_view.dart | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/utils/as_grid_image_view.dart b/lib/utils/as_grid_image_view.dart index 4a76734..92edf86 100644 --- a/lib/utils/as_grid_image_view.dart +++ b/lib/utils/as_grid_image_view.dart @@ -31,18 +31,23 @@ class AsGridImageView extends StatelessWidget { shrinkWrap: true, children: files == null ? nets! - .map((e) => Hero( - tag: e, - child: PhotoViewer.toNet( + .map((e) => GestureDetector( + onTap: () => PhotoViewer.toNet( tag: e, net: e, ), + child: Hero( + tag: e, + child: FadeInImage.assetNetwork( + placeholder: placeholder ?? '', image: e), + ), )) .toList() : files! - .map((e) => Hero( - tag: e.path, - child: PhotoViewer.toFile(tag: e.path, file: e))) + .map((e) => GestureDetector( + onTap: () => PhotoViewer.toFile(tag: e.path, file: e), + child: Hero(tag: e.path, child: Image.file(e)), + )) .toList()); } }