CarouselSlider(
items: [0, 1, 2, 3].map((e) {
return Image.asset('assets/images/onboarding6.png');
}).toList(),
this is my code
how to make different pictures using the carousel slider?
pic below is my UI Program
CodePudding user response:
CarouselSlider(
items: [
'assets/images/onboarding1.png',
'assets/images/onboarding2.png',
'assets/images/onboarding3.png',
'assets/images/onboarding4.png',
].map((e) {
return Image.asset(e);
}).toList(),
CodePudding user response:
List _images=['assets/images/one.png','assets/images/two.png','assets/images/three.png','assets/images/four.png',];
CarouselSlider(items:_images.map((e)=>return Image.asset(e)).toList(),