1

I want like this

enter image description here

And I got this

enter image description here

            CarouselSlider(
              options: CarouselOptions(
              onPageChanged: (index, reason) {
                      setState(() {
                      _current = index;
                      });},

                autoPlayAnimationDuration:Duration(seconds: 1),
                autoPlayCurve: Curves.easeInOut,
                autoPlay: true,
                // height: 200,
                // initialPage: 0,
                // enlargeCenterPage: true,
              ),
              items: images.map((i) {
                return PageView(
                  controller: controller,
                  physics: BouncingScrollPhysics(),
                  children: [
                    Container(
                       // margin: EdgeInsets.symmetric(horizontal: 10.0),


                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(15),
                          // image: DecorationImage(
                          //     image:AssetImage(i),
                          //     fit: BoxFit.fill,
                          // ),
                        ),
                      child: Image.asset(i,fit: BoxFit.fitWidth, width: 350),
                    ),
                  ]
                );
              }).toList(),

            ),
James Z
  • 12,209
  • 10
  • 24
  • 44
Jaini Shah
  • 45
  • 3

1 Answers1

0

you can fix it by using viewportFraction: 1.0, inside the CarouselOptions

Bigfoot
  • 336
  • 1
  • 3