OudsTag class

A tag is a small element that shows short info like a label, keyword, or category. It helps users quickly find, group, or understand content. Tags can stay in place or be removed, and can include icons or actions like close or edit.

This version of the tag uses the text only layout which is the most used layout. Other layouts are available for this component: text + icon, text + bullet and text + loader.

parameters :

  • status : The tag's status, OudsTagStatus influencing its color and style (e.g., negative, positive, warning).
  • 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.
  • icon : An optional SVG asset name to display an icon within the tag.
  • hierarchy: The Tag appearance based on its OudsTagHierarchy.
  • layout: Defines the layout to be used for the tag OudsTagLayout.

Styling details :

You can use OudsTag like this :

Text only tag :

This is the default layout of the component.

OudsTag(
      label: 'Label',
      status: OudsTagStatus.accent,
      size: OudsTagSize.small,
      layout : OudsTagLayout.textAndBullet
    );
Inheritance

Constructors

OudsTag.new({Key? key, required String label, OudsTagStatus status = OudsTagStatus.neutral, OudsTagHierarchy hierarchy = OudsTagHierarchy.emphasized, OudsTagSize? size = OudsTagSize.defaultSize, String? icon, OudsTagLayout layout = OudsTagLayout.textOnly})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
hierarchy OudsTagHierarchy
final
icon String?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label String
final
layout OudsTagLayout
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size OudsTagSize?
final
status OudsTagStatus
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

Static Methods

buildIcon(BuildContext context, String? assetName, OudsTagStatus controlItemState, OudsTagHierarchy hierarchy, double width, double height) Widget