PillStyle class
Style configuration for the Pill widget.
Use PillStyle to customize the appearance of a pill, including colors, border radius, and text styles. All properties are optional and will fall back to sensible defaults if not specified.
Example:
Pill(
label: 'Status',
value: 'Active',
style: PillStyle(
backgroundColor: Colors.green.shade50,
borderColor: Colors.green.shade200,
labelColor: Colors.green.shade800,
),
)
Constructors
- PillStyle({Color? backgroundColor, Color? borderColor, Color? labelColor, Color? valueColor, Color? dividerColor, double? borderWidth, double? borderRadius, FontWeight? labelFontWeight, FontWeight? valueFontWeight, double? fontSize, Color? selectedBackgroundColor, Color? selectedBorderColor, double? selectedBorderWidth})
-
Creates a PillStyle with the given properties.
const
Properties
- backgroundColor → Color?
-
The background color of the pill.
final
- borderColor → Color?
-
The border color of the pill.
final
- borderRadius → double?
-
The border radius of the pill.
final
- borderWidth → double?
-
The width of the border.
final
- dividerColor → Color?
-
The color of the divider between label and value.
final
- fontSize → double?
-
The font size for both label and value text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- labelColor → Color?
-
The color of the label text.
final
- labelFontWeight → FontWeight?
-
The font weight of the label text.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedBackgroundColor → Color?
-
The background color when the pill is selected.
final
- selectedBorderColor → Color?
-
The border color when the pill is selected.
final
- selectedBorderWidth → double?
-
The border width when the pill is selected.
final
- valueColor → Color?
-
The color of the value text.
final
- valueFontWeight → FontWeight?
-
The font weight of the value text.
final
Methods
-
copyWith(
{Color? backgroundColor, Color? borderColor, Color? labelColor, Color? valueColor, Color? dividerColor, double? borderWidth, double? borderRadius, FontWeight? labelFontWeight, FontWeight? valueFontWeight, double? fontSize, Color? selectedBackgroundColor, Color? selectedBorderColor, double? selectedBorderWidth}) → PillStyle - Creates a copy of this PillStyle with the given fields replaced.
-
merge(
PillStyle? other) → PillStyle - Merges this style with another, with the other style taking precedence.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited