InputChip constructor Null safety

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

Creates an InputChip.

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 InputChip({
  super.key,
  this.avatar,
  required this.label,
  this.labelStyle,
  this.labelPadding,
  this.selected = false,
  this.isEnabled = true,
  this.onSelected,
  this.deleteIcon,
  this.onDeleted,
  this.deleteIconColor,
  this.deleteButtonTooltipMessage,
  this.onPressed,
  this.pressElevation,
  this.disabledColor,
  this.selectedColor,
  this.tooltip,
  this.side,
  this.shape,
  this.clipBehavior = Clip.none,
  this.focusNode,
  this.autofocus = false,
  this.backgroundColor,
  this.padding,
  this.visualDensity,
  this.materialTapTargetSize,
  this.elevation,
  this.shadowColor,
  this.surfaceTintColor,
  this.iconTheme,
  this.selectedShadowColor,
  this.showCheckmark,
  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(selected != null),
     assert(isEnabled != null),
     assert(label != null),
     assert(clipBehavior != null),
     assert(autofocus != null),
     assert(pressElevation == null || pressElevation >= 0.0),
     assert(elevation == null || elevation >= 0.0);