Chip constructor

const Chip({
  1. Key? key,
  2. Widget? avatar,
  3. required Widget label,
  4. TextStyle? labelStyle,
  5. EdgeInsetsGeometry? labelPadding,
  6. Widget? deleteIcon,
  7. VoidCallback? onDeleted,
  8. Color? deleteIconColor,
  9. String? deleteButtonTooltipMessage,
  10. BorderSide? side,
  11. OutlinedBorder? shape,
  12. Clip clipBehavior = Clip.none,
  13. FocusNode? focusNode,
  14. bool autofocus = false,
  15. MaterialStateProperty<Color?>? color,
  16. Color? backgroundColor,
  17. EdgeInsetsGeometry? padding,
  18. VisualDensity? visualDensity,
  19. MaterialTapTargetSize? materialTapTargetSize,
  20. double? elevation,
  21. Color? shadowColor,
  22. Color? surfaceTintColor,
  23. IconThemeData? iconTheme,
  24. BoxConstraints? avatarBoxConstraints,
  25. BoxConstraints? deleteIconBoxConstraints,
  26. ChipAnimationStyle? chipAnimationStyle,
})

Creates a Material Design chip.

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.color,
  this.backgroundColor,
  this.padding,
  this.visualDensity,
  this.materialTapTargetSize,
  this.elevation,
  this.shadowColor,
  this.surfaceTintColor,
  this.iconTheme,
  this.avatarBoxConstraints,
  this.deleteIconBoxConstraints,
  this.chipAnimationStyle,
}) : assert(elevation == null || elevation >= 0.0);