ActionChip constructor Null safety

const ActionChip(
  1. {Key? key,
  2. Widget? avatar,
  3. required Widget label,
  4. TextStyle? labelStyle,
  5. EdgeInsetsGeometry? labelPadding,
  6. VoidCallback? onPressed,
  7. double? pressElevation,
  8. String? tooltip,
  9. BorderSide? side,
  10. OutlinedBorder? shape,
  11. Clip clipBehavior = Clip.none,
  12. FocusNode? focusNode,
  13. bool autofocus = false,
  14. Color? backgroundColor,
  15. Color? disabledColor,
  16. EdgeInsetsGeometry? padding,
  17. VisualDensity? visualDensity,
  18. MaterialTapTargetSize? materialTapTargetSize,
  19. double? elevation,
  20. Color? shadowColor,
  21. Color? surfaceTintColor,
  22. IconThemeData? iconTheme}
)

Create a chip that acts like a button.

The label, onPressed, autofocus, and clipBehavior arguments must not be null. The pressElevation and elevation must be null or non-negative. Typically, pressElevation is greater than elevation.

Implementation

const ActionChip({
  super.key,
  this.avatar,
  required this.label,
  this.labelStyle,
  this.labelPadding,
  this.onPressed,
  this.pressElevation,
  this.tooltip,
  this.side,
  this.shape,
  this.clipBehavior = Clip.none,
  this.focusNode,
  this.autofocus = false,
  this.backgroundColor,
  this.disabledColor,
  this.padding,
  this.visualDensity,
  this.materialTapTargetSize,
  this.elevation,
  this.shadowColor,
  this.surfaceTintColor,
  this.iconTheme,
}) : assert(label != null),
     assert(clipBehavior != null),
     assert(autofocus != null),
     assert(pressElevation == null || pressElevation >= 0.0),
     assert(elevation == null || elevation >= 0.0);