improve expandable image viewer
This commit is contained in:
parent
3349ca7253
commit
2d0f41000e
1 changed files with 19 additions and 17 deletions
|
|
@ -20,21 +20,12 @@ class ExpandableImage extends ConsumerWidget {
|
||||||
builder: (_) => SafeArea(
|
builder: (_) => SafeArea(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Positioned.fill(
|
||||||
alignment: .topRight,
|
child: GestureDetector(
|
||||||
child: Padding(
|
onTap: Navigator.of(context).pop,
|
||||||
padding: .all(32),
|
|
||||||
child: M3EButton(
|
|
||||||
onPressed: Navigator.of(context).pop,
|
|
||||||
child: Icon(Icons.close),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Center(
|
|
||||||
child: InteractiveViewer(
|
child: InteractiveViewer(
|
||||||
maxScale: 10,
|
maxScale: 10,
|
||||||
child: Image(
|
child: Image(
|
||||||
fit: .contain,
|
|
||||||
errorBuilder: (_, error, stackTrace) => ErrorDialog(
|
errorBuilder: (_, error, stackTrace) => ErrorDialog(
|
||||||
"Loading failed for $source\nError: $error",
|
"Loading failed for $source\nError: $error",
|
||||||
stackTrace,
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue