Search categories, packages and repositories

flutter_carousel_slider cover
Package detailsv1.1.0

flutter_carousel_slider

A customizable carousel slider for Flutter. Supports infinite sliding, custom indicators, and custom animations with many pre-built indicators and animations.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
4.1K
Likes
180
Pub points
140

Install package

flutter pub add flutter_carousel_slider

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A highly customizable carousel slider for Flutter that enables smooth, infinite sliding between items. It supports custom indicators and animations, offering a range of pre-built options for both visual indicators and transition effects. Ideal for showcasing images, products, or content in a dynamic, interactive way across multiple platforms. The package is lightweight and integrates seamlessly into Flutter apps with minimal setup.

Use cases

  • Showcasing product images
  • Displaying promotional banners
  • Presenting user testimonials
  • Creating image galleries
  • Highlighting app features

Key features

  • Infinite scrolling
  • Customizable indicators
  • Pre-built animation options
  • Support for multiple platforms
  • Extensible design
  • Smooth transitions

Suitable for

  • E-commerce apps
  • Marketing websites
  • Portfolio displays
  • Content-rich mobile apps
  • Interactive UIs

Considerations

  • Performance with large datasets
  • Custom indicator complexity
  • Animation lag on low-end devices
  • Limited built-in swipe gestures
  • Requires manual handling of tap events

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Flutter Carousel Slider

A customizable carousel slider for flutter

pub package

Screenshots

Installing

dependencies:
  flutter_carousel_slider: ^1.1.0

Demo

Demo application available at https://flutter-carousel-slider.web.app/

Using

import 'package:flutter/material.dart';
import 'package:flutter_carousel_slider/carousel_slider.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Carousel Slider',
      home: MyHomePage(title: 'Flutter Carousel Slider'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  final String title;

  MyHomePage({Key key, this.title}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final List<Color> colors = [
    Colors.red,
    Colors.orange,
    Colors.yellow,
    Colors.green,
    Colors.blue,
    Colors.indigo,
    Colors.purple,
  ];
  final List<String> letters = [
    "A",
    "B",
    "C",
    "D",
    "E",
    "F",
    "G",
  ];

  bool _isPlaying = false;
  GlobalKey<CarouselSliderState> _sliderKey = GlobalKey();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: ListView(
        children: <Widget>[
          Container(
            height: 500,
            child: CarouselSlider.builder(
                key: _sliderKey,
                unlimitedMode: true,
                slideBuilder: (index) {
                  return Container(
                    alignment: Alignment.center,
                    color: colors[index],
                    child: Text(
                      letters[index],
                      style: TextStyle(fontSize: 200, color: Colors.white),
                    ),
                  );
                },
                slideTransform: CubeTransform(),
                slideIndicator: CircularSlideIndicator(
                  padding: EdgeInsets.only(bottom: 32),
                ),
                itemCount: colors.length),
          ),
          Padding(
            padding: const EdgeInsets.symmetric(vertical: 32),
            child: Align(
              child: ConstrainedBox(
                constraints: BoxConstraints(minWidth: 240, maxWidth: 600),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: [
                    IconButton(
                      iconSize: 48,
                      icon: Icon(Icons.skip_previous),
                      onPressed: () {
                        _sliderKey.currentState.previousPage();
                      },
                    ),
                    IconButton(
                      iconSize: 64,
                      icon: Icon(
                        _isPlaying
                            ? Icons.pause_circle_outline
                            : Icons.play_circle_outline,
                      ),
                      onPressed: () {
                        setState(
                          () {
                            _isPlaying = !_isPlaying;
                            _sliderKey.currentState.setPlaying(_isPlaying);
                          },
                        );
                      },
                    ),
                    IconButton(
                      iconSize: 48,
                      icon: Icon(Icons.skip_next),
                      onPressed: () {
                        _sliderKey.currentState.nextPage();
                      },
                    ),
                  ],
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}

Categories

Source repository

Projects using this package