ChoiceChip constructor Null safety
- {Key? key,
- Widget? avatar,
- required Widget label,
- TextStyle? labelStyle,
- EdgeInsetsGeometry? labelPadding,
- ValueChanged<
bool> ? onSelected, - double? pressElevation,
- required bool selected,
- Color? selectedColor,
- Color? disabledColor,
- String? tooltip,
- 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,
- Color? selectedShadowColor,
- ShapeBorder avatarBorder = const CircleBorder()}
Create a chip that acts like a radio button.
The label, 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 ChoiceChip({
super.key,
this.avatar,
required this.label,
this.labelStyle,
this.labelPadding,
this.onSelected,
this.pressElevation,
required this.selected,
this.selectedColor,
this.disabledColor,
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.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);