m3_carousel 2.1.4 copy "m3_carousel: ^2.1.4" to clipboard
m3_carousel: ^2.1.4 copied to clipboard

A flutter implementation of the Material Design 3 carousel (https://m3.material.io/components/carousel/overview).

M3_Carousel #

A flutter implementation of the Material Design 3 carousel. Built on the CarouselView.

Feature Highlights #

  • Hero carousel with support for "left", "center" and "right" alignments.

  • Contained carousel. Extended view inclusive.

  • Uncontained carousel.

  • Horizontal or vertical scrolling via axis.

Installing #

In your pubspec.yaml

dependencies:
  m3_carousel: ^2.1.4 # requires Dart => ^3.12.0, Flutter >=3.38.0

Usage #

import "package:m3_carousel/m3_carousel.dart";

M3Carousel(
    type: CarouselType.hero,
    heroAlignment: HeroAlignment.center,
    axis: Axis.horizontal,
    onTap: (int tapIndex) => log(tapIndex.toString()),
    children: List<Widget>.generate(10, (int index) {
        return ColoredBox(
            color: Colors.primaries[index % Colors.primaries.length]
                .withValues(alpha: 0.8),
            child: const SizedBox.expand(),
        );
    }),
),

See example/lib/main.dart for complete examples.

Reference #

Use of CarouselView is govern by the Flutter Authors LICENSE

License #

MIT license

41
likes
160
points
1.05k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A flutter implementation of the Material Design 3 carousel (https://m3.material.io/components/carousel/overview).

Repository (GitHub)
View/report issues

Topics

#ui #material-design #carousel #m3

License

MIT (license)

Dependencies

collection, flutter

More

Packages that depend on m3_carousel