I have a dynamic list image from the server and I want to push them in Carousel Slider. but when I've added them in the item, and run, I've got this error :
Class 'String' has no instance method 'map'.
Tried calling: map(Closure: (dynamic) => Builder)
and this is my code.
child: Container(
// width: pageWidth * 0.84,
height: pageWidth * 0.42,
child: CarouselSlider(
options: CarouselOptions(
height: pageWidth * 0.42,
aspectRatio: 1,
viewportFraction: 1,
autoPlay: true,
autoPlayInterval: const Duration(seconds:5),
enableInfiniteScroll: true,
enlargeCenterPage: true,
),
items : [
ListView.builder(itemBuilder: (context ,index){
return homeView.details![index]['Image'];})].map((i){
return Builder(
builder:(BuildContext context) {
return ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: homeView.details!.length,
itemBuilder: (context, index) {
return Container(
width: pageWidth * 0.84,
height: pageWidth * 0.42,
// margin: EdgeInsets.only(left: 15),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(i),
),
borderRadius: BorderRadius.all(
Radius.circular(15),),));});});}).toList(),