SelectTag class

选择模式的标签组合 支持流式和横向布局 支持定宽和非定宽 宽高间距可设置 支持单选和多选

Inheritance

Constructors

SelectTag({Key? key, required List<String> tags, void onSelect(List<int>)?, double spacing = 12, double verticalSpacing = 10, TextStyle? tagTextStyle, TextStyle? selectedTagTextStyle, Color? tagBackgroundColor, Color? selectedTagBackgroundColor, double? tagWidth, double? tagHeight, bool isSingleSelect = true, List<bool>? initTagState, bool softWrap = true, Alignment alignment = Alignment.centerLeft, bool fixWidthMode = true, TagConfig? themeData})

Properties

alignment Alignment
对齐模式,默认为 Alignment.centerLeft,靠左
final
fixWidthMode bool
是否需要固定宽度,默认为true,指定为false为流式布局
final
hashCode int
The hash code for this object.
no setterinherited
initTagState List<bool>?
多选时的初始状态数组
final
isSingleSelect bool
是否是单选,默认 true
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onSelect → void Function(List<int>)?
选择tag的回调,返回选中 tag 的位置
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedTagBackgroundColor Color?
选中的标签背景色,默认 B0Color
final
selectedTagTextStyle TextStyle?
选中的标签样式
final
softWrap bool
true 流式展示,false 横向滑动展示,默认 true
final
spacing double
水平间距,默认 12
final
tagBackgroundColor Color?
普通标签背景色,默认 F0Color
final
tagHeight double?
标签高度。默认全局配置高度 34
final
tags List<String>
展示的标签列表
final
tagTextStyle TextStyle?
普通标签的样式
final
tagWidth double?
标签宽度。默认全局配置宽度 75
final
themeData TagConfig?
getter/setter pair
verticalSpacing double
垂直间距,默认 10
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _SelectTagState
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