30 lines
713 B
Dart
30 lines
713 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class ImageLightbox extends StatelessWidget {
|
||
|
final String url;
|
||
|
|
||
|
const ImageLightbox({super.key, required this.url});
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Scaffold(
|
||
|
body: GestureDetector(
|
||
|
child: Center(
|
||
|
child: SizedBox(
|
||
|
height: MediaQuery.of(context).size.height,
|
||
|
child: InteractiveViewer(
|
||
|
boundaryMargin: const EdgeInsets.all(128),
|
||
|
minScale: 0.1,
|
||
|
maxScale: 16.0,
|
||
|
child: Image.network(url, fit: BoxFit.contain),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
onTap: () {
|
||
|
Navigator.pop(context);
|
||
|
},
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|