Chip constructor Null safety
- {Key? key,
- Widget? avatar,
- required Widget label,
- TextStyle? labelStyle,
- EdgeInsetsGeometry? labelPadding,
- Widget? deleteIcon,
- VoidCallback? onDeleted,
- Color? deleteIconColor,
- String? deleteButtonTooltipMessage,
- BorderSide? side,
- OutlinedBorder? shape,
- Clip clipBehavior = Clip.none,
- FocusNode? focusNode,
- bool autofocus = false,
- Color? backgroundColor,
- EdgeInsetsGeometry? padding,
- VisualDensity? visualDensity,
- MaterialTapTargetSize? materialTapTargetSize,
- double? elevation,
- Color? shadowColor,
- Color? surfaceTintColor,
- IconThemeData? iconTheme,
- @Deprecated('Migrate to deleteButtonTooltipMessage. ' 'This feature was deprecated after v2.10.0-0.3.pre.') bool useDeleteButtonTooltip = true}
Creates a Material Design chip.
The label, autofocus, and clipBehavior arguments must not be null. The elevation must be null or non-negative.
Implementation
const Chip({
super.key,
this.avatar,
required this.label,
this.labelStyle,
this.labelPadding,
this.deleteIcon,
this.onDeleted,
this.deleteIconColor,
this.deleteButtonTooltipMessage,
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,
@Deprecated(
'Migrate to deleteButtonTooltipMessage. '
'This feature was deprecated after v2.10.0-0.3.pre.'
)
this.useDeleteButtonTooltip = true,
}) : assert(label != null),
assert(autofocus != null),
assert(clipBehavior != null),
assert(elevation == null || elevation >= 0.0);