From 65f84fd639d12d80d37dd16f3114d80047c40e27 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 14 Oct 2021 20:25:59 +0800 Subject: [PATCH] update as grid image view --- lib/utils/as_grid_image_view.dart | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/utils/as_grid_image_view.dart b/lib/utils/as_grid_image_view.dart index 011f667..4a76734 100644 --- a/lib/utils/as_grid_image_view.dart +++ b/lib/utils/as_grid_image_view.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:ansu_ui/ansu_ui.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -30,9 +31,18 @@ class AsGridImageView extends StatelessWidget { shrinkWrap: true, children: files == null ? nets! - .map((e) => FadeInImage.assetNetwork( - placeholder: placeholder ?? '', image: e)) + .map((e) => Hero( + tag: e, + child: PhotoViewer.toNet( + tag: e, + net: e, + ), + )) .toList() - : files!.map((e) => Image.file(e)).toList()); + : files! + .map((e) => Hero( + tag: e.path, + child: PhotoViewer.toFile(tag: e.path, file: e))) + .toList()); } }