Pill constructor
const
Pill({})
Creates a Pill widget.
The label parameter is required and can be a String or a Widget.
If value is null, the pill will display only the label.
The value parameter can be a String, a Widget, or null.
The leading widget is rendered before the label inside the pill.
The trailing widget is rendered after the value (or label) inside the pill.
Implementation
const Pill({
super.key,
required this.label,
this.value,
this.leading,
this.trailing,
this.summary,
this.onValueChanged,
this.style,
this.editable = true,
this.expandable = false,
this.selected = false,
this.showCheckIcon = false,
this.onTap,
}) : assert(
label is String || label is Widget,
'label must be a String or Widget',
),
assert(
value == null || value is String || value is Widget,
'value must be a String, Widget, or null',
);