10.主题和文字处理
主题和文字处理
如何在 Text widget上设置自定义字体?
fonts:
- family: MyCustomFont
fonts:
- asset: fonts/MyCustomFont.ttf
- style: italic@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Sample App"),
),
body: Center(
child: Text(
'This is a custom font text',
style: TextStyle(fontFamily: 'MyCustomFont'),
),
),
);
}如何在Text上定义样式?
如何给 App 设置主题?
Last updated
Was this helpful?