我正在尝试更改 Flutter for Web Application 中标题的字体,我该怎么做?我发现 pubsec.yaml 与移动版完全不同,这里是文件:
name: projectbaseclient
description: An app built using Flutter for web
environment:
# You must be using Flutter >=1.5.0 or Dart >=2.3.0
sdk: '>=2.3.0 <3.0.0'
dependencies:
flutter_web: any
flutter_web_ui: any
dev_dependencies:
build_runner: ^1.5.0
build_web_compilers: ^2.1.0
pedantic: ^1.7.0
dependency_overrides:
flutter_web:
git:
url: https://github.com/flutter/flutter_web
path: packages/flutter_web
flutter_web_ui:
git:
url: https://github.com/flutter/flutter_web
path: packages/flutter_web_ui
这是 FontManifest.json:
[
{
"family": "Poppins",
"fonts": [
{
"asset": "fonts/Poppins-Regular.ttf"
}
]
},
{
"family": "KronaOne",
"fonts": [
{
"asset": "fonts/KronaOne-Regular.ttf"
}
]
},
{
"family": "Ubuntu",
"fonts": [
{
"asset": "fonts/Ubuntu-Regular.ttf"
}
]
}
]
我已经创建了一个文件夹 assets/fonts 并在文件夹中添加了字体,我还创建了 FontManifest.json 并将其放在 assets 文件夹中,但是代码不起作用,当我更改文本中的 fontFamily 参数时,它给了我错误目的。
如何将字体用于 Flutter for Web 项目?