M3ECarouselWrapper constructor

const M3ECarouselWrapper({
  1. Key? key,
  2. bool freeScroll = false,
  3. EdgeInsets? padding,
  4. Color? backgroundColor = Colors.transparent,
  5. double? elevation = 0.0,
  6. ShapeBorder? shape = const RoundedRectangleBorder(),
  7. Clip itemClipBehavior = Clip.none,
  8. WidgetStateProperty<Color?>? overlayColor,
  9. bool itemSnapping = false,
  10. bool consumeMaxWeight = true,
  11. double shrinkExtent = 0.0,
  12. M3ECarouselController? controller,
  13. Axis scrollDirection = Axis.horizontal,
  14. bool reverse = false,
  15. void onTap(
    1. int
    )?,
  16. M3EHapticFeedback haptic = M3EHapticFeedback.none,
  17. bool enableSplash = true,
  18. bool infinite = false,
  19. double? itemExtent,
  20. List<int>? flexWeights,
  21. required List<Widget> children,
  22. void onIndexChanged(
    1. int
    )?,
  23. 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.',
     );