improve expandable image viewer
This commit is contained in:
parent
3349ca7253
commit
2d0f41000e
1 changed files with 19 additions and 17 deletions
|
|
@ -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,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue