TextStyle style
2021-11-16 本文已影响0人
码农_小斌哥
属性 | 说明 |
---|---|
bool inherit | 是否继承父节点样式,默认为true |
Color color | 设置字体颜色 例: Colors.green |
Color backgroundColor | 设置背景颜色 |
double fontSize | 设置字体大小 |
FontWeight fontWeight | 设置字体粗细 |
FontWeight.normal: | 默认,与w400一致 |
FontWeight.bold: | 加粗,与w700一致 |
FontWeight.w[100-900] | |
FontStyle fontStyle | 设置字体样式: |
FontStyle.normal: | 正常 |
FontStyle.italic: | 斜体 |
double letterSpacing | 字母间间距 |
double wordSpacing | 单词间间距 |
TextBaseline textBaseline | 对齐文本的水平线 |
TextBaseline.alphabetic | |
TextBaseline.ideographic | |
double height | 文本行高 |
Locale locale | 根据地区以不同方式呈现 |
Paint foreground | 文本颜色,使用该属性时,color需为null |
Paint()..color = Colors.red | |
Paint background | 文本背景色,使用该属性时,backgroundColor需为null |
TextDecoration decoration | TextDecoration.none: 默认 |
TextDecoration.lineThrough: 删除线 | |
TextDecoration.underline: 下划线 | |
TextDecoration.overline: 上划线 | |
Color decorationColor | 控制decoration中产生线的颜色 |
TextDecorationStyle decorationStyle | 控制decoration中产生线的样式 |
TextDecorationStyle.solid: 实线 | |
TextDecorationStyle.double: 双线 | |
TextDecorationStyle.dotted: 点线 | |
TextDecorationStyle.dashed: 虚线 | |
TextDecorationStyle.wavy: 波浪线 | |
double decorationThickness | 控制decoration产生线的粗细 |
String fontFamily | 设置文字字体 |
List<Shadow> shadows | 设置字体阴影 |
Shadow(color: Colors.black, offset: Offset(1.0, 1.0), blurRadius; 5.0) |