carousel_slider 0.0.6

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 46

carousel_slider

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

Installation

Add carousel_slider: ^0.0.6 in your pubspec.yaml dependencies.

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,
  autoPlay: true
)

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

screenshot

Params

new CarouselSlider(
  items: items,
  viewportFraction: 0.8,
  initialPage: 0,
  aspectRatio: 16/9,
  height: 400,
  reverse: false,
  autoPlay: false,
  interval: const Duration(seconds: 4),
  autoPlayCurve: Curves.fastOutSlowIn,
  autoPlayDuration: const Duration(milliseconds: 800)
)

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.

v0.0.1

Initial version.

v0.0.2

Remove useless dependencies, add changelog.

0.0.5

Fix initialPage bug, fix crash when widget is disposed.

0.0.6

Fix hard coded number

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  carousel_slider: ^0.0.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:carousel_slider/carousel_slider.dart';
  
Version Uploaded Documentation Archive
0.0.6 Jul 8, 2018 Go to the documentation of carousel_slider 0.0.6 Download carousel_slider 0.0.6 archive
0.0.5 Jul 3, 2018 Go to the documentation of carousel_slider 0.0.5 Download carousel_slider 0.0.5 archive
0.0.4 May 8, 2018 Go to the documentation of carousel_slider 0.0.4 Download carousel_slider 0.0.4 archive
0.0.3 May 8, 2018 Go to the documentation of carousel_slider 0.0.3 Download carousel_slider 0.0.3 archive
0.0.2 Apr 17, 2018 Go to the documentation of carousel_slider 0.0.2 Download carousel_slider 0.0.2 archive
0.0.1 Apr 17, 2018 Go to the documentation of carousel_slider 0.0.1 Download carousel_slider 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
92
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
46
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.0.0