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 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
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (context) => MediaViewPage(url),
|
||||
));
|
||||
},
|
||||
onTap: () => _onTap(context),
|
||||
child: Hero(
|
||||
tag: url,
|
||||
child: child,
|
||||
|
|
Loading…
Reference in New Issue