skip to Main Content
        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

[UI](https://i.stack.imgur.com/ODAjy.png)

2

Answers


  1.     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(),
    
    Login or Signup to reply.
  2. List<String> _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(),
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search