diff --git a/lib/widgets/ItemScreens/Details/item_detail_box.dart b/lib/widgets/ItemScreens/Details/item_detail_box.dart index 6f9712a..99bb39c 100755 --- a/lib/widgets/ItemScreens/Details/item_detail_box.dart +++ b/lib/widgets/ItemScreens/Details/item_detail_box.dart @@ -3,6 +3,7 @@ import 'package:cssd/config/colors.dart'; import 'package:cssd/models/item_model.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +import 'package:pinch_zoom/pinch_zoom.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -345,30 +346,46 @@ class ItemDetailsDataBox extends StatelessWidget { ), ], ), - if(datas.filePath!.isNotEmpty) Divider(), - if(datas.filePath!.isNotEmpty) SizedBox( - height: 10, - ), - if(datas.filePath!.isNotEmpty) Container( - width: double.infinity, - padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20), - child: CarouselSlider.builder( - disableGesture: true, - itemBuilder: (ctx, index, realIndex) { - return Image(image: NetworkImage(datas.filePath![index])); - }, - itemCount: datas.filePath!.length, - options: CarouselOptions( - enlargeCenterPage: false, - aspectRatio: 1, - viewportFraction: 1, - padEnds: false, - pauseAutoPlayOnTouch: true, - disableCenter: false, - autoPlay: false, + if (datas.filePath!.isNotEmpty) Divider(), + if (datas.filePath!.isNotEmpty) + SizedBox( + height: 10, + ), + if (datas.filePath!.isNotEmpty) + Container( + width: double.infinity, + padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20), + child: CarouselSlider.builder( + disableGesture: true, + itemBuilder: (ctx, index, realIndex) { + return InkWell( + child: Image( + image: NetworkImage(datas.filePath![index]) + ), + onTap: () { + showDialog( + context: context, + builder: (BuildContext context) => PinchZoom( + child: Image.network(datas.filePath![index]) + ), + ); + }, + ); + }, + itemCount: datas.filePath!.length, + options: CarouselOptions( + enlargeCenterPage: false, + aspectRatio: 1, + viewportFraction: 1, + padEnds: false, + pauseAutoPlayOnTouch: true, + disableCenter: false, + autoPlay: false, + enableInfiniteScroll: + datas.filePath?.length == 1 ? false : true, + ), ), ), - ), ], ), ), diff --git a/pubspec.lock b/pubspec.lock index 74277e3..d56db3e 100755 --- a/pubspec.lock +++ b/pubspec.lock @@ -69,26 +69,26 @@ packages: dependency: "direct main" description: name: camera - sha256: "71fb0e03618a8629a912bbf49bb664869bd16830c1d363b1096df99727b0bebb" + sha256: "7fa53bb1c2059e58bf86b7ab506e3b2a78e42f82d365b44b013239b975a166ef" url: "https://pub.dev" source: hosted - version: "0.10.5+6" + version: "0.10.5+7" camera_android: dependency: transitive description: name: camera_android - sha256: b63304d553dde613ca68fb40aaa76bbbcdbd051683bdbf2019671ec8d9645ce7 + sha256: "7215e38fa0be58cc3203a6e48de3636fb9b1bf93d6eeedf667f882d51b3a4bf3" url: "https://pub.dev" source: hosted - version: "0.10.8+14" + version: "0.10.8+15" camera_avfoundation: dependency: transitive description: name: camera_avfoundation - sha256: "3b6d9f550cfd658c71f34a99509528501e5e5d4fa79f11e3a4d6ef380d8e0254" + sha256: "3c8dd395f18722f01b5f325ddd7f5256e9bcdce538fb9243b378ba759df3283c" url: "https://pub.dev" source: hosted - version: "0.9.13+7" + version: "0.9.13+8" camera_platform_interface: dependency: transitive description: @@ -472,6 +472,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.8.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "04be76c4a4bb50f14904e64749237e541e7c7bcf7ec0b196907322ab5d2fc739" + url: "https://pub.dev" + source: hosted + version: "9.0.16" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: b06739349ec2477e943055aea30172c5c7000225f79dad4702e2ec0eda79a6ff + url: "https://pub.dev" + source: hosted + version: "1.0.5" lints: dependency: transitive description: @@ -492,18 +508,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" mime: dependency: transitive description: @@ -656,6 +672,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.0.2" + pinch_zoom: + dependency: "direct main" + description: + name: pinch_zoom + sha256: "8e430a215db198099a708f334620e223cbea3fdc477b717d6535ab852994985e" + url: "https://pub.dev" + source: hosted + version: "2.0.0" platform: dependency: transitive description: @@ -897,10 +921,10 @@ packages: dependency: transitive description: name: url_launcher_linux - sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd" + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.1" url_launcher_macos: dependency: transitive description: @@ -929,18 +953,18 @@ packages: dependency: transitive description: name: url_launcher_windows - sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc" + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.1" uuid: dependency: transitive description: name: uuid - sha256: df5a4d8f22ee4ccd77f8839ac7cb274ebc11ef9adcce8b92be14b797fe889921 + sha256: bb55f38968b9427ce5dcdb8aaaa41049282195e0cfa4cf48593572fa3d1f36bc url: "https://pub.dev" source: hosted - version: "4.2.1" + version: "4.3.1" vector_math: dependency: transitive description: @@ -949,14 +973,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" web: dependency: transitive description: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: edc8a9573dd8c5a83a183dae1af2b6fd4131377404706ca4e5420474784906fa url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.4.0" win32: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 4f189aa..2731eb9 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -45,6 +45,7 @@ dependencies: flutter_downloader: ^1.11.5 permission_handler: ^11.1.0 carousel_slider: ^4.2.1 + pinch_zoom: ^2.0.0 # video_player: ^0.10.11+2 dev_dependencies: