M3ECarousel class

Creates a Material Design carousel.

Material Design 3 introduces 3 carousel layouts:

  • Multi-browse: shows at least one large, medium, and small item at a time.
  • Uncontained (default): shows items that scroll to the edge of the container.
  • Hero: shows at least one large and one small item at a time.

Scrolls along axis (horizontal by default, or vertical).

For more info checkout the Official Docs.

Inheritance

Constructors

M3ECarousel({Key? key, double? width, double? height, Axis axis = Axis.horizontal, M3ECarouselType type = M3ECarouselType.hero, bool isExtended = false, bool freeScroll = false, M3ECarouselHeroAlignment heroAlignment = M3ECarouselHeroAlignment.center, double uncontainedItemExtent = M3ECarouselTheme.defaultUncontainedItemExtent, double uncontainedShrinkExtent = M3ECarouselTheme.defaultUncontainedShrinkExtent, double childElementBorderRadius = M3ECarouselTheme.defaultBorderRadiusValue, int scrollAnimationDuration = M3ECarouselTheme.defaultScrollAnimationDuration, double fixedPulseDelta = 4, int singleSwipeGestureSensitivityRange = M3ECarouselTheme.defaultSingleSwipeGestureSensitivityRange, void onTap(int selectedIndex)?, M3EHapticFeedback haptic = M3EHapticFeedback.none, required List<Widget> children})
Creates a Material Design carousel.
const

Properties

axis Axis
Scroll and layout axis. Defaults to Axis.horizontal.
final
childElementBorderRadius double
The curvature factor mapping circular corner clipping arcs over nested item view layouts.
final
children List<Widget>
The continuous structured sequence of elements rendered inside the carousel scroll track.
final
fixedPulseDelta double
Fixed logical pixels added or removed per animating edge at peak pulse.
final
freeScroll bool
True if item canvas movements can glide smoothly without forcing standard snap boundary stops.
final
haptic M3EHapticFeedback
Haptic intensity on item tap. Defaults to M3EHapticFeedback.none.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
The explicit bounded height allocation applied to the root carousel container wrapper.
final
heroAlignment M3ECarouselHeroAlignment
Focal-item alignment for M3ECarouselType.hero.
final
isExtended bool
Flag indicating whether item bounding sizes shift into altered or expanded aspect footprints.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onTap → void Function(int selectedIndex)?
Click event notification pipe exposing the zero-based list tracking index of the interacted element.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollAnimationDuration int
The total lifespan millisecond count allocated to complete layout transition slide curves.
final
singleSwipeGestureSensitivityRange int
The dimensional drag delta requirement needed to trigger single-item sweep navigation actions.
final
type M3ECarouselType
Specifies the structural layout rule type determining element sizes and scaling constraints.
final
uncontainedItemExtent double
Baseline main-axis extent for items in uncontained layouts (width when horizontal, height when vertical).
final
uncontainedShrinkExtent double
The minimal compressed dimension boundary applied to items scaling down near container thresholds.
final
width double?
The explicit bounded width allocation applied to the root carousel container wrapper.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<M3ECarousel>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited