0
点赞
收藏
分享

微信扫一扫

Flutter中字体->样式的值样式((String))无效


在 pubspec.yaml 中添加自定义字体样式

Error detected in pubspec.yaml:
Invalid value Bold ((String)) for font -> style.
Please correct the pubspec.yaml file at /Users/directory/pubspec.yaml

所以​style: bold​​不起作用,是因为​​Flutter​​ > ​​dart:ui​​ > ​​FontStyle enum​​中只有两个常量,分别是:

  • italic → const FontStyle
  • normal → const FontStyle
  • values → const List<FontStyle>

检查: ​​https://api.flutter.dev/flutter/dart-ui/FontStyle.html​​

举报

相关推荐

0 条评论