M3ECarousel class
Creates a Material Design carousel.
Layouts:
- Multi-browse (M3ECarouselType.contained): large, medium, and small.
- Uncontained: one item size, scrolling to the container edge.
- Uncontained multi-aspect: widths from 9:16 to 16:9.
- Hero: one large item and a small peek.
- Full-screen: one edge-to-edge item, scrolled vertically.
Scrolls along axis (horizontal by default). Full-screen is always vertical. A swipe advances one item unless freeScroll is on, which drags and snaps to the nearest item.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- M3ECarousel
Constructors
-
M3ECarousel({Key? key, M3ECarouselController? controller, double? width, double? height, Axis axis = Axis.horizontal, M3ECarouselType type = M3ECarouselType.hero, bool? isExtended, bool? freeScroll, M3ECarouselHeroAlignment heroAlignment = M3ECarouselHeroAlignment.center, double uncontainedItemExtent = M3ECarouselTheme.defaultUncontainedItemExtent, double uncontainedShrinkExtent = M3ECarouselTheme.defaultUncontainedShrinkExtent, double? childElementBorderRadius, double? largeMaxWidth, EdgeInsetsGeometry? itemPadding, int scrollAnimationDuration = M3ECarouselTheme.defaultScrollAnimationDuration, double fixedPulseDelta = 4, int singleSwipeGestureSensitivityRange = M3ECarouselTheme.defaultSingleSwipeGestureSensitivityRange, void onTap(int selectedIndex)?, ValueChanged<
M3ECarouselChangeDetails> ? onChange, M3EHapticFeedback haptic = M3EHapticFeedback.none, Widget? header, bool showAll = false, required List<M3ECarouselItem> children}) -
Creates a Material Design carousel.
const
Properties
- axis → Axis
-
Scroll and layout axis. Defaults to Axis.horizontal.
final
- childElementBorderRadius → double?
-
Corner radius. Defaults to the theme value for the layout.
final
-
children
→ List<
M3ECarouselItem> -
Items rendered in the scroll track.
final
- controller → M3ECarouselController?
-
Scroll and action controller. The carousel creates one when this is omitted.
final
- fixedPulseDelta → double
-
Fixed logical pixels added or removed per animating edge at peak pulse.
final
- freeScroll → bool?
-
When false, a swipe advances one item and the scroll view does not drag.
When true, the scroll view drags and snaps to the nearest item.
final
- haptic → M3EHapticFeedback
-
Haptic intensity on item tap. Defaults to M3EHapticFeedback.none.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget?
-
Title shown above the items, with an arrow that opens every item.
final
- 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?
-
Expanded slot pattern.
final
- itemPadding → EdgeInsetsGeometry?
-
Padding inside each item. Defaults to the layout gap.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- largeMaxWidth → double?
-
Largest large-item extent. Defaults to the theme value.
final
-
onChange
→ ValueChanged<
M3ECarouselChangeDetails> ? -
Called when the leading or focal item index changes after scrolling.
final
- 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
- showAll → bool
-
Trailing text button that opens every item. Ignored when header is set
or the layout is full-screen.
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