OudsIconStatus class sealed
Describes the configuration for an OudsBadge / OudsTag with an icon.
This sealed class defines the intent of the component's appearance, which in turn determines the icon to display and its associated colors.
Subclasses are provided for each specific status:
- Neutral and Accent allow for a user-defined custom icon. They also
expose
tinted,backgroundColorandsemanticsLabelproperties to control whether the icon is tinted with the theme color, the background color to apply when untinted, and the accessibility label for the custom icon. - Positive, Info, Warning, and Negative use fixed icons defined by the design system to convey a specific meaning.
Example usage in OudsAlertMessage
An Alert message with a fixed "success" icon.
OudsAlertMessage(
label: 'Your profile has been updated.',
status: Positive(),
onClose: () {},
)
An Alert message with a custom user-provided icon.
OudsAlertMessage(
label: 'My custom message',
status: Neutral(icon: 'assets/my_custom_icon.svg'),
onClose: () {},
);
Example usage in OudsTag
A tag with a fixed "success" icon.
OudsTag.icon(
label: 'Success',
status: Positive(),
);
A tag with a custom user-provided icon with untined icon
OudsTag.icon(
label: 'Custom',
status: Neutral(icon: 'assets/my_custom_icon.svg', tinted: false),
);
Properties
- getBackgroundColor → Color?
-
Returns the background color to apply behind the icon.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isTinted → bool
-
Returns whether the icon is tinted.
no setter
- nonFunctionalIcon → String?
-
Returns the custom icon asset path for non-functional statuses.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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
Constants
-
functionalStatuses
→ const List<
Type> - A static list containing the types of all functional statuses.