TDTag class
展示型标签组件,仅展示,内部不可更改自身状态 支持样式:方形/圆角/半圆/带关闭图标
- Inheritance
Constructors
- TDTag(String text, {TDTagTheme? theme, IconData? icon, Widget? iconWidget, Color? textColor, Color? backgroundColor, Font? font, FontWeight? fontWeight, TDTagStyle? style, TDTagSize size = TDTagSize.medium, EdgeInsets? padding, bool forceVerticalCenter = true, bool isOutline = false, TDTagShape shape = TDTagShape.square, bool isLight = false, bool disable = false, bool needCloseIcon = false, GestureTapCallback? onCloseTap, TextOverflow? overflow, Key? key})
-
const
Properties
- backgroundColor → Color?
-
背景颜色, 优先级高于style的backgroundColor
final
- disable → bool
-
是否为禁用状态
final
- font → Font?
-
字体尺寸, 优先级高于style的font
final
- fontWeight → FontWeight?
-
字体粗细, 优先级高于style的fontWeight
final
- forceVerticalCenter → bool
-
是否强制中文文字居中
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
图标内容,可随状态改变颜色
final
- iconWidget → Widget?
-
自定义图标内容,需自处理颜色
final
- isLight → bool
-
是否为浅色
final
- isOutline → bool
-
是否为描边类型,默认不是
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- needCloseIcon → bool
-
关闭图标
final
- onCloseTap → GestureTapCallback?
-
关闭图标点击事件
final
- overflow → TextOverflow?
-
文字溢出处理
final
- padding → EdgeInsets?
-
自定义模式下的间距
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shape → TDTagShape
-
标签形状
final
- size → TDTagSize
-
标签大小
final
- style → TDTagStyle?
-
标签样式
final
- text → String
-
标签内容
final
- textColor → Color?
-
文字颜色, 优先级高于style的textColor
final
- theme → TDTagTheme?
-
主题
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.
inherited
-
getIcon(
TDTagStyle innerStyle) → Widget? -
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