M3ECarouselWrapper constructor
const
M3ECarouselWrapper({
- Key? key,
- bool freeScroll = false,
- EdgeInsets? padding,
- Color? backgroundColor = Colors.transparent,
- double? elevation = 0.0,
- ShapeBorder? shape = const RoundedRectangleBorder(),
- Clip itemClipBehavior = Clip.none,
- WidgetStateProperty<
Color?> ? overlayColor, - bool itemSnapping = false,
- bool consumeMaxWeight = true,
- double shrinkExtent = 0.0,
- M3ECarouselController? controller,
- Axis scrollDirection = Axis.horizontal,
- bool reverse = false,
- void onTap()?,
- M3EHapticFeedback haptic = M3EHapticFeedback.none,
- bool enableSplash = true,
- bool infinite = false,
- double? itemExtent,
- List<
int> ? flexWeights, - required List<
Widget> children, - void onIndexChanged()?,
- double fixedPulseDelta = 4,
Creates a carousel wrapper with optional pulse animation on tap.
Implementation
const M3ECarouselWrapper({
super.key,
this.freeScroll = false,
this.padding,
this.backgroundColor = Colors.transparent,
this.elevation = 0.0,
this.shape = const RoundedRectangleBorder(),
this.itemClipBehavior = Clip.none,
this.overlayColor,
this.itemSnapping = false,
this.consumeMaxWeight = true,
this.shrinkExtent = 0.0,
this.controller,
this.scrollDirection = Axis.horizontal,
this.reverse = false,
this.onTap,
this.haptic = M3EHapticFeedback.none,
this.enableSplash = true,
this.infinite = false,
this.itemExtent,
this.flexWeights,
required this.children,
this.onIndexChanged,
/// Fixed logical pixels added or removed per animating edge at peak pulse.
///
/// A value of `4` expands or squishes each active edge by up to 4px.
/// When both sides animate, each edge uses the full delta independently.
this.fixedPulseDelta = 4,
}) : assert(
(flexWeights != null && itemExtent == null) ||
(flexWeights == null && itemExtent != null),
'Provide either itemExtent for standard layouts OR flexWeights for weighted layouts.',
);