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,6 +20,25 @@ class ExpandableImage extends ConsumerWidget {
builder: (_) => SafeArea( builder: (_) => SafeArea(
child: Stack( child: Stack(
children: [ children: [
Positioned.fill(
child: GestureDetector(
onTap: Navigator.of(context).pop,
child: InteractiveViewer(
maxScale: 10,
child: Image(
errorBuilder: (_, error, stackTrace) => ErrorDialog(
"Loading failed for $source\nError: $error",
stackTrace,
),
image: CachedNetworkImage(
source!,
ref.watch(CrossCacheController.provider),
headers: ref.headers,
),
),
),
),
),
Align( Align(
alignment: .topRight, alignment: .topRight,
child: Padding( child: Padding(
@ -30,23 +49,6 @@ class ExpandableImage extends ConsumerWidget {
), ),
), ),
), ),
Center(
child: InteractiveViewer(
maxScale: 10,
child: Image(
fit: .contain,
errorBuilder: (_, error, stackTrace) => ErrorDialog(
"Loading failed for $source\nError: $error",
stackTrace,
),
image: CachedNetworkImage(
source!,
ref.watch(CrossCacheController.provider),
headers: ref.headers,
),
),
),
),
], ],
), ),
), ),