Fix image issues

This commit is contained in:
fhkhd
2023-12-16 12:06:13 +03:30
parent 1342b9f2e1
commit ecdc586ea2
3 changed files with 90 additions and 40 deletions
@@ -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,
),
),
),
),
],
),
),