add widget for wrapping images that can be fullscreened

This commit is contained in:
krawieck 2020-09-11 20:26:06 +02:00
parent 4a5bb17afb
commit 6cc894be2c
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import '../pages/media_view.dart';
class FullscreenableImage extends StatelessWidget {
final String url;
final Widget child;
const FullscreenableImage({Key key, this.url, this.child}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => MediaViewPage(url),
));
},
child: Hero(
tag: url,
child: child,
),
);
}
}