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

26 lines
560 B
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import '../pages/media_view.dart';
import '../util/goto.dart';
2020-09-30 19:05:00 +02:00
/// If the media is pressed, it opens itself in a [MediaViewPage]
class FullscreenableImage extends StatelessWidget {
final String url;
final Widget child;
const FullscreenableImage({
2022-05-11 22:23:18 +02:00
super.key,
required this.url,
required this.child,
2022-05-11 22:23:18 +02:00
});
@override
2020-09-11 21:21:58 +02:00
Widget build(BuildContext context) => InkWell(
2020-10-06 22:28:10 +02:00
onTap: () => goToMedia(context, url),
2020-09-11 21:21:58 +02:00
child: Hero(
tag: url,
child: child,
),
);
}