OudsTag class
Reference design version : 1.5.0
Tag is a UI element that allows to display short info like a label, keyword, or category. Tag helps users quickly find, group, or understand content.
Tags are highly configurable and can be styled with different statuses, appearances, and layouts to convey specific meanings and fit various visual contexts.
This widget provides three distinct types of tags, each created using a specific named constructor:
OudsTag.text: A simple tag displaying only text.OudsTag.bullet: A tag that includes a bullet point next to the text.OudsTag.icon: A tag that displays an icon next to the text.
Icon selection is driven by status (OudsIconStatus):
- Functional statuses (
Positive,Info,Warning,Negative) provide fixed icons. - Contextual statuses (
Neutral,Accent) can carry a custom icon asset.
Status model
- Neutral (optional custom icon)
- Accent (optional custom icon)
- Positive (fixed functional icon)
- Info (fixed functional icon)
- Warning (fixed functional icon)
- Negative (fixed functional icon)
This unifies:
- background color
- icon choice
- icon/text foreground color
Parameters
- status : The recommended way to control the tag's appearance.
This object defines the status (e.g.,
Positive,Negative), the visualappearance(emphasizedormuted), and a customiconforNeutralandAccentstatuses. - size : The size of the tag, OudsTagSize such as small or default, to fit various visual needs.
- label : A text to display inside the tag.
- appearance: The Tag appearance based on its OudsTagAppearance.
- layout: Defines the layout to be used for the tag OudsTagLayout.
- enabled: A boolean indicating whether the tag is enabled or disabled.
- loading: A circular progress indicator displayed in the input or tag area to indicate that tags are being loaded or processed.
- roundedCorners: Controls the shape of the tag. When true, the tag has rounded corners, providing a softer and more approachable look, suitable for most modern interfaces. When false, the tag has sharp, square corners, providing a more formal, structured, or technical feel. Often used in a business context to label promotions, offers or important notices.
Usage Example
// Simple tag
OudsTag.text(
label: 'New Tag',
status: Accent(),
size: OudsTagSize.small,
);
// Tag with a custom icon
OudsTag.icon(
label: 'Custom',
status: Neutral(icon: 'assets/custom_icon.svg'),
);
// A Tag with "bullet" type.
OudsTag.bullet(
label: 'Information',
status: Info(),
);
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OudsTag
Constructors
- OudsTag.bullet({Key? key, required String label, bool enabled = true, required OudsIconStatus? status, OudsTagAppearance appearance = OudsTagAppearance.emphasized, OudsTagSize? size = OudsTagSize.defaultSize, OudsTagLayout layout = OudsTagLayout.textAndBullet, bool loading = false, bool roundedCorners = true})
-
const
- OudsTag.icon({Key? key, required String label, bool enabled = true, required OudsIconStatus? status, OudsTagAppearance appearance = OudsTagAppearance.emphasized, OudsTagSize? size = OudsTagSize.defaultSize, OudsTagLayout layout = OudsTagLayout.textAndIcon, bool loading = false, bool roundedCorners = true})
-
const
- OudsTag.text({Key? key, required String label, bool enabled = true, required OudsIconStatus? status, OudsTagAppearance appearance = OudsTagAppearance.emphasized, OudsTagSize? size = OudsTagSize.defaultSize, OudsTagLayout layout = OudsTagLayout.textOnly, bool loading = false, bool roundedCorners = true})
-
const
Properties
- appearance → OudsTagAppearance
-
final
- enabled → bool
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String
-
final
- layout → OudsTagLayout
-
final
- loading → bool
-
final
- roundedCorners → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → OudsTagSize?
-
final
- status → OudsIconStatus?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< OudsTag> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited