英文:
Flutter, the problem of custom fonts on the Android platform
问题
我将以下内容翻译为中文:
我在项目中添加了自定义字体
在iOS平台上应用正确,但在Android平台上没有应用
Widget build(BuildContext context) {
return MaterialApp.router(
title: 'Flutter Demo',
theme: ThemeData(
fontFamily: 'RobotoMono',
primarySwatch: Colors.blue,
),
routerConfig: _router,
);
}
fonts:
- family: RobotoMono
fonts:
- asset: fonts/RobotoMono-Regular.ttf
英文:
I added a custom font to the project
It is applied correctly on the iOS platform, but not on the Android platform
Widget build(BuildContext context) {
return MaterialApp.router(
title: 'Flutter Demo',
theme: ThemeData(
fontFamily: 'RobotoMono',
primarySwatch: Colors.blue,
),
routerConfig: _router,
);
}
fonts:
- family: RobotoMono
fonts:
- asset:fonts/RobotoMono-Regular.ttf
答案1
得分: 1
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论