Tag 标签
代码演示
基本用法
dart
Tag(child: "Tag", type: TagType.primary),
Tag(child: "Tag", type: TagType.success),
Tag(child: "Tag", type: TagType.danger),
Tag(child: "Tag", type: TagType.warning),
朴素样式、形状、图标
dart
Tag(child: "Tag", type: TagType.primary, plain: true),
Tag(child: "Tag", type: TagType.primary, round: true),
Tag(child: "Tag", type: TagType.primary, icon: VanIcons.cross),
大小
dart
Tag(child: "Tag", size: TagSize.small),
Tag(child: "Tag", size: TagSize.medium),
Tag(child: "Tag", size: TagSize.large),
颜色
dart
Tag(child: "Tag", color: Color(0xFF7232dd)),
Tag(
child: "Tag",
color: Color(0xFFffe1e1),
textColor: Color(0xFFad0000),
),
Tag(child: "Tag", plain: true, color: Color(0xFF7232dd)),
API
Props | 类型 | 描述 |
---|---|---|
child | String | 标签文本 |
type | primary | success | warning | danger | 类型 |
size | small | medium | large | 大小 |
plain | bool | 朴素风格 |
round | bool | 圆角风格 |
color | Color | 颜色 |
textColor | Color | 文本颜色 |
icon | Widget | IconDate | 右侧图标 |
onIconTap | Function() | 点击图标触发 |