lemmur-app-android/lib/widgets/fullscreenable_image.dart

30 lines
623 B
Dart
Raw Normal View History

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../pages/media_view.dart';
import '../util/goto.dart';
class FullscreenableImage extends StatelessWidget {
final String url;
final Widget child;
const FullscreenableImage({
Key key,
@required this.url,
@required this.child,
}) : super(key: key);
_onTap(BuildContext c) {
goTo(c, (context) => MediaViewPage(url));
}
@override
2020-09-11 21:21:58 +02:00
Widget build(BuildContext context) => InkWell(
onTap: () => _onTap(context),
child: Hero(
tag: url,
child: child,
),
);
}