FilterChip constructor Null safety

const FilterChip(
  1. {Key? key,
  2. Widget? avatar,
  3. required Widget label,
  4. TextStyle? labelStyle,
  5. EdgeInsetsGeometry? labelPadding,
  6. bool selected = false,
  7. required ValueChanged<bool>? onSelected,
  8. double? pressElevation,
  9. Color? disabledColor,
  10. Color? selectedColor,
  11. String? tooltip,
  12. BorderSide? side,
  13. OutlinedBorder? shape,
  14. Clip clipBehavior = Clip.none,
  15. FocusNode? focusNode,
  16. bool autofocus = false,
  17. Color? backgroundColor,
  18. EdgeInsetsGeometry? padding,
  19. VisualDensity? visualDensity,
  20. MaterialTapTargetSize? materialTapTargetSize,
  21. double? elevation,
  22. Color? shadowColor,
  23. Color? surfaceTintColor,
  24. IconThemeData? iconTheme,
  25. Color? selectedShadowColor,
  26. bool? showCheckmark,
  27. Color? checkmarkColor,
  28. ShapeBorder avatarBorder = const CircleBorder()}
)

Create a chip that acts like a checkbox.

The selected, label, 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 FilterChip({
  super.key,
  this.avatar,
  required this.label,
  this.labelStyle,
  this.labelPadding,
  this.selected = false,
  required this.onSelected,
  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(),
}) : assert(selected != null),
     assert(label != null),
     assert(clipBehavior != null),
     assert(autofocus != null),
     assert(pressElevation == null || pressElevation >= 0.0),
     assert(elevation == null || elevation >= 0.0);