TagCustom class
用于展示的通用标签 默认是圆角为2的矩形边框,如果不满足需要可以通过tagBorderRadius来单独设置
该标签的每一部分都支持用户自定义,文本颜色、背景色等等
是对Container的封装,减少边框,颜色等模版代码的开发
BrnTagCustom(tagText: '标签',)
BrnTagCustom(tagText: '标签',backgroundColor:Colors.red)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- TagCustom
Constructors
- TagCustom({Key? key, required String tagText, Color? textColor, Color? backgroundColor, BorderRadius tagBorderRadius = const BorderRadius.all(Radius.circular(2)), EdgeInsets textPadding = const EdgeInsets.only(bottom: 0.5, left: 3, right: 3, top: 0), Border? border, double fontSize = 11, FontWeight fontWeight = FontWeight.normal, double maxWidth = double.infinity})
- TagCustom.buildBorderTag({Key? key, required String tagText, Color? backgroundColor = Colors.transparent, EdgeInsets textPadding = const EdgeInsets.only(bottom: 3, left: 3, right: 3, top: 0), double fontSize = 11, FontWeight fontWeight = FontWeight.normal, BorderRadius tagBorderRadius = const BorderRadius.all(Radius.circular(2)), Color? textColor, Color? borderColor, double borderWidth = 1})
- 快捷方式生成边框标签
Properties
- backgroundColor → Color?
-
标签的背景颜色 默认主题色
final
- border → Border?
-
标签边框
final
- fontSize → double
-
文字大小
final
- fontWeight → FontWeight
-
文字粗细
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxWidth → double
-
最大宽度
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tagBorderRadius → BorderRadius
-
标签的圆角 默认为2
如果同时设置了borderRadius、tagBorderRadius字段,优先使用tagBorderRadius字段设置圆角
final
- tagText → String
-
标签的文字
final
- textColor → Color?
-
标签的文本颜色 默认F4的反白颜色
final
- textPadding → EdgeInsets
-
标签的padding 默认为3
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
-
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