SlidableAction constructor

const SlidableAction({
  1. Key? key,
  2. int flex = _kFlex,
  3. Color backgroundColor = _kBackgroundColor,
  4. Color? foregroundColor,
  5. bool autoClose = _kAutoClose,
  6. required SlidableActionCallback? onPressed,
  7. IconData? icon,
  8. double spacing = 4,
  9. String? label,
  10. BorderRadius borderRadius = BorderRadius.zero,
  11. EdgeInsets? padding,
})

Creates a SlidableAction.

The flex, backgroundColor, autoClose and spacing arguments must not be null.

You must set either an icon or a label.

The flex argument must also be greater than 0.

Implementation

const SlidableAction({
  Key? key,
  this.flex = _kFlex,
  this.backgroundColor = _kBackgroundColor,
  this.foregroundColor,
  this.autoClose = _kAutoClose,
  required this.onPressed,
  this.icon,
  this.spacing = 4,
  this.label,
  this.borderRadius = BorderRadius.zero,
  this.padding,
})  : assert(flex > 0),
      assert(icon != null || label != null),
      super(key: key);