From 66a7c5411aa2ad06493baa552567cdb51eecd31d Mon Sep 17 00:00:00 2001 From: Tomasz Trela <153635094+tomasz-trela@users.noreply.github.com> Date: Sun, 26 Jan 2025 18:53:12 +0100 Subject: [PATCH] fix(digital-guide): infinite image carousel with 1 image (#560) * fix(digital-guide): infinite 1 image carousel * refactor: meet PR requirements --- .../presentation/widgets/digital_guide_photo_row.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/features/digital_guide_view/presentation/widgets/digital_guide_photo_row.dart b/lib/features/digital_guide_view/presentation/widgets/digital_guide_photo_row.dart index 87e418dd..c3acf0aa 100644 --- a/lib/features/digital_guide_view/presentation/widgets/digital_guide_photo_row.dart +++ b/lib/features/digital_guide_view/presentation/widgets/digital_guide_photo_row.dart @@ -39,10 +39,14 @@ class DigitalGuidePhotoRow extends StatelessWidget { DigitalGuideConfig.borderRadiusMedium, ), child: GestureDetector( - onTap: () async => showGallery(context, initId: id), + onTap: () async { + if (imagesIDs.length > 1) { + await showGallery(context, initId: id); + } + }, child: DigitalGuideImage( id: id, - zoomable: false, + zoomable: imagesIDs.length == 1, ), ), ),