forked from Nexus/nexus
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(
|
||||
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),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue