carousel_slider 0.0.2 copy "carousel_slider: ^0.0.2" to clipboard
carousel_slider: ^0.0.2 copied to clipboard

outdatedDart 1 only

A carousel slider widget, support infinite scroll and custom child widget.

carousel_slider #

A carousel slider widget, support infinite scroll and custom child widget.

How to use #

Simply create a CarouselSlider widget, and pass the required params:

new CarouselSlider(
  items: [1,2,3,4,5].map((i) {
    return new Builder(
      builder: (BuildContext context) {
        return new Container(
          width: MediaQuery.of(context).size.width,
          margin: new EdgeInsets.symmetric(horizontal: 5.0),
          decoration: new BoxDecoration(
            color: Colors.amber
          ),
          child: new Text('text $i', style: new TextStyle(fontSize: 16.0),)
        );
      },
    );
  }).toList(),
  height: 400.0
)

For a more detail example please take a look at the example folder.

screenshot

Params #

new CarouselSlider(
  items: items,
  viewportFraction: viewportFraction,
  initialPage: initialPage,
  aspectRatio: aspectRatio,
  height: height
)

You can pass the above params to the class. If you pass the height params, the aspectRatio param will be ignore.

Instance methods #

You can use the instance methods to programmatically take control of the pageView's position.

.nextPage({Duration duration, Curve curve}) #

Animate to the next page

.previousPage({Duration duration, Curve curve}) #

Animate to the previous page

.jumpToPage(int page) #

Jump to the given page.

.animateToPage(int page, {Duration duration, Curve curve}) #

Animate to the given page.

5116
likes
0
pub points
100%
popularity

Publisher

verified publisherserenader.me

A carousel slider widget, support infinite scroll and custom child widget.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on carousel_slider