ZdsTag class

A tag used to show status information or selected options.

The height of the tag will change depending on the parameters selected. The default height is 24 dp. If rectangular is true the height is also 24 dp. If rounded is true, the height will be 20 dp. If onClose is not null, the height will be 32 dp. The height can be unbounded if unrestrictedSize is set to true, but the minimum height will always be of 20 dp at least.

There are three main styles:

  • Setting rounded as true, typically with prefix, typically used to indicate priority levels.
  • Setting rectangular as true, typically with prefix, typically used to indicate status, e.g pending, approved and declined.
  • Setting rounded and rectangular as false, typically used to indicate status and to allow actions on the tag with onClose.
Inheritance
Available Extensions

Constructors

ZdsTag({Key? key, bool rounded = false, bool rectangular = false, bool filled = false, Widget? prefix, ZdsTagColor color = ZdsTagColor.basic, Color? customColor, Widget? child, VoidCallback? onClose, bool unrestrictedSize = false, Color? customBackgroundColor})
Tag item that can have a close/remove button.
const

Properties

child Widget?
The tag's contents.
final
color ZdsTagColor
This tag's background color.
final
customBackgroundColor Color?
This tag's background color
final
customColor Color?
This tag's foreground color. This will be used as a foreground color or if filled as background color.
final
filled bool
Whether the color or customColor will act as the background color (with the foreground color being be computed based on effective background), or as the foreground color (with the background color being the color set to 10% opacity).
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onClose VoidCallback?
A function called whenever the user taps on the closing button of this tag.
final
prefix Widget?
A prefix shown before the child.
final
rectangular bool
Whether to have a more rectangular shape, with only 2dp border radius
final
rounded bool
Whether to have completely rounded ends (pill shape) or to have a rectangle shape
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unrestrictedSize bool
Whether the tag's height sizes itself to the child's size. This is useful for bigger fonts or non-text children like images and such. If false, the tag will have a set height.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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.
override
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}) 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