在 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