mark props as required and move onTap to a method
This commit is contained in:
parent
6cc894be2c
commit
1746cc0db5
|
@ -6,16 +6,22 @@ class FullscreenableImage extends StatelessWidget {
|
||||||
final String url;
|
final String url;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
const FullscreenableImage({Key key, this.url, this.child}) : super(key: key);
|
const FullscreenableImage({
|
||||||
|
Key key,
|
||||||
|
@required this.url,
|
||||||
|
@required this.child,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
_onTap(BuildContext c) {
|
||||||
|
Navigator.of(c).push(MaterialPageRoute(
|
||||||
|
builder: (context) => MediaViewPage(url),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () => _onTap(context),
|
||||||
Navigator.of(context).push(MaterialPageRoute(
|
|
||||||
builder: (context) => MediaViewPage(url),
|
|
||||||
));
|
|
||||||
},
|
|
||||||
child: Hero(
|
child: Hero(
|
||||||
tag: url,
|
tag: url,
|
||||||
child: child,
|
child: child,
|
||||||
|
|
Loading…
Reference in New Issue