From e74aba2d8b8ef6f329e9d7469f7c16252e366125 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 24 Mar 2024 11:20:59 +0800 Subject: [PATCH] :lipstick: Optimized image browsing --- lib/widgets/feed.dart | 4 ++-- lib/widgets/image.dart | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/widgets/feed.dart b/lib/widgets/feed.dart index d12b664..474e8d2 100644 --- a/lib/widgets/feed.dart +++ b/lib/widgets/feed.dart @@ -51,15 +51,15 @@ class FeedItem extends StatelessWidget { child: FlutterCarousel( options: CarouselOptions( height: 240.0, + viewportFraction: 1.0, showIndicator: true, slideIndicator: const CircularSlideIndicator(), ), items: item.attachments?.map((x) { return Builder( builder: (BuildContext context) { - return Container( + return SizedBox( width: MediaQuery.of(context).size.width, - margin: const EdgeInsets.symmetric(horizontal: 5.0), child: InkWell( child: Image.network( getFileUrl(x.fileId), diff --git a/lib/widgets/image.dart b/lib/widgets/image.dart index b4dace4..a8f9432 100644 --- a/lib/widgets/image.dart +++ b/lib/widgets/image.dart @@ -12,6 +12,7 @@ class ImageLightbox extends StatelessWidget { child: Center( child: SizedBox( height: MediaQuery.of(context).size.height, + width: MediaQuery.of(context).size.width, child: InteractiveViewer( boundaryMargin: const EdgeInsets.all(128), minScale: 0.1,