一、自定義字體
- 先下載**.ttf的字體文件;
- 在項(xiàng)目中新增fonts文件夾,放置上述**.ttf文件;
- 在pubspec.yaml配置文件中,啟用字體。完成字體注冊;
fonts:- family: Schyler
fonts:- asset: fonts/Schyler-Regular.ttf
- family: Schyler
- 全局應(yīng)用字體:
theme: ThemeData(fontFamily: 'Schyler') - 局部使用字體:
Text('data測試', style: TextStyle(fontFamily: 'Schyler'))