RawChip constructor Null safety

const RawChip(
  1. {Key? key,
  2. ChipThemeData? defaultProperties,
  3. Widget? avatar,
  4. required Widget label,
  5. TextStyle? labelStyle,
  6. EdgeInsetsGeometry? padding,
  7. VisualDensity? visualDensity,
  8. EdgeInsetsGeometry? labelPadding,
  9. Widget? deleteIcon,
  10. VoidCallback? onDeleted,
  11. Color? deleteIconColor,
  12. String? deleteButtonTooltipMessage,
  13. VoidCallback? onPressed,
  14. ValueChanged<bool>? onSelected,
  15. double? pressElevation,
  16. bool tapEnabled = true,
  17. bool selected = false,
  18. bool isEnabled = true,
  19. Color? disabledColor,
  20. Color? selectedColor,
  21. String? tooltip,
  22. BorderSide? side,
  23. OutlinedBorder? shape,
  24. Clip clipBehavior = Clip.none,
  25. FocusNode? focusNode,
  26. bool autofocus = false,
  27. Color? backgroundColor,
  28. MaterialTapTargetSize? materialTapTargetSize,
  29. double? elevation,
  30. Color? shadowColor,
  31. Color? surfaceTintColor,
  32. IconThemeData? iconTheme,
  33. Color? selectedShadowColor,
  34. bool? showCheckmark = true,
  35. Color? checkmarkColor,
  36. ShapeBorder avatarBorder = const CircleBorder(),
  37. @Deprecated('Migrate to deleteButtonTooltipMessage. ' 'This feature was deprecated after v2.10.0-0.3.pre.') bool useDeleteButtonTooltip = true}
)

Creates a RawChip.

The onPressed and onSelected callbacks must not both be specified at the same time.

The label, isEnabled, selected, 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 RawChip({
  super.key,
  this.defaultProperties,
  this.avatar,
  required this.label,
  this.labelStyle,
  this.padding,
  this.visualDensity,
  this.labelPadding,
  Widget? deleteIcon,
  this.onDeleted,
  this.deleteIconColor,
  this.deleteButtonTooltipMessage,
  this.onPressed,
  this.onSelected,
  this.pressElevation,
  this.tapEnabled = true,
  this.selected = false,
  this.isEnabled = true,
  this.disabledColor,
  this.selectedColor,
  this.tooltip,
  this.side,
  this.shape,
  this.clipBehavior = Clip.none,
  this.focusNode,
  this.autofocus = false,
  this.backgroundColor,
  this.materialTapTargetSize,
  this.elevation,
  this.shadowColor,
  this.surfaceTintColor,
  this.iconTheme,
  this.selectedShadowColor,
  this.showCheckmark = true,
  this.checkmarkColor,
  this.avatarBorder = const CircleBorder(),
  @Deprecated(
    'Migrate to deleteButtonTooltipMessage. '
    'This feature was deprecated after v2.10.0-0.3.pre.'
  )
  this.useDeleteButtonTooltip = true,
}) : assert(label != null),
     assert(isEnabled != null),
     assert(selected != null),
     assert(clipBehavior != null),
     assert(autofocus != null),
     assert(pressElevation == null || pressElevation >= 0.0),
     assert(elevation == null || elevation >= 0.0),
     deleteIcon = deleteIcon ?? _kDefaultDeleteIcon;