improve expandable image viewer

This commit is contained in:
Henry Hiles 2026-06-13 20:49:45 -04:00
commit 2d0f41000e
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -20,21 +20,12 @@ class ExpandableImage extends ConsumerWidget {
builder: (_) => SafeArea(
child: Stack(
children: [
Align(
alignment: .topRight,
child: Padding(
padding: .all(32),
child: M3EButton(
onPressed: Navigator.of(context).pop,
child: Icon(Icons.close),
),
),
),
Center(
Positioned.fill(
child: GestureDetector(
onTap: Navigator.of(context).pop,
child: InteractiveViewer(
maxScale: 10,
child: Image(
fit: .contain,
errorBuilder: (_, error, stackTrace) => ErrorDialog(
"Loading failed for $source\nError: $error",
stackTrace,
@ -47,6 +38,17 @@ class ExpandableImage extends ConsumerWidget {
),
),
),
),
Align(
alignment: .topRight,
child: Padding(
padding: .all(32),
child: M3EButton(
onPressed: Navigator.of(context).pop,
child: Icon(Icons.close),
),
),
),
],
),
),