Fix image overflowing onto text and apparent lack of responsiveness when zoomed in issue

merge-requests/67/merge
Hank Grabowski 2023-01-21 21:23:39 -05:00
rodzic 57deeab1a0
commit 90b71fc8ef
1 zmienionych plików z 33 dodań i 38 usunięć

Wyświetl plik

@ -48,46 +48,41 @@ class ImageViewerScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final width = MediaQuery.of(context).size.width;
final height = MediaQuery.of(context).size.height;
return Scaffold(
appBar: AppBar(
actions: [
IconButton(
onPressed: () => saveImage(context),
icon: const Icon(Icons.download))
],
),
body: SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 9,
child: InteractiveViewer(
clipBehavior: Clip.none,
constrained: true,
maxScale: 10.0,
scaleFactor: 400,
child:
CachedNetworkImage(imageUrl: attachment.uri.toString()),
appBar: AppBar(
actions: [
IconButton(
onPressed: () => saveImage(context),
icon: const Icon(Icons.download))
],
),
body: SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: width,
height: 0.8 * height,
child: InteractiveViewer(
maxScale: 10.0,
scaleFactor: 400,
child: CachedNetworkImage(imageUrl: attachment.uri.toString()),
),
),
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(attachment.description),
),
),
if (attachment.description.isNotEmpty)
Expanded(
flex: 1,
child: Padding(
padding: const EdgeInsets.only(
left: 8.0,
right: 8.0,
bottom: 8.0,
),
child: SingleChildScrollView(
child: Text(attachment.description),
),
),
),
],
),
));
),
],
),
),
);
}
}