update image preview

hmxc
小赖 4 years ago
parent ad4f8b41ba
commit de52a4f5d0

@ -104,15 +104,11 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
...model.imgUrls
.map((e) => GestureDetector(
onTap: () {
Get.to(
BeeImagePreview.path(path: e.url),
opaque: false,
);
BeeImagePreview.toPath(path: e.url);
},
child: Hero(
tag: e.url,
child: Container(
height: 228.w,
decoration: BoxDecoration(
color: Colors.black12,
borderRadius: BorderRadius.circular(8.w),

@ -9,6 +9,34 @@ import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/constants/api.dart';
class BeeImagePreview extends StatefulWidget {
static Future<T> toFile<T>({@required File file, String tag}) async {
return await navigator.push(
PageRouteBuilder(
opaque: false,
pageBuilder: (context, animation, secondAnimation) {
return FadeTransition(
opacity: animation,
child: BeeImagePreview.file(file: file, tag: tag),
);
},
),
);
}
static toPath({@required String path, String tag}) {
navigator.push(
PageRouteBuilder(
opaque: false,
pageBuilder: (context, animation, secondAnimation) {
return FadeTransition(
opacity: animation,
child: BeeImagePreview.path(path: path, tag: tag),
);
},
),
);
}
final File file;
final String path;
final String tag;

Loading…
Cancel
Save