我尝试用自定义字体创建bottomNavigationBar,但是应用程序崩溃。
如果删除bottomNavigationBar,则Text小部件使用字体正确显示,但在添加bottomNavigationBar应用程序崩溃后显示正确。
颤振版
Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.4 18E226, locale en-IR)码
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xffF6F8FA),
bottomNavigationBar: BottomNavigationBar(items: [
BottomNavigationBarItem(icon: Icon(Icons.home), title: Text("Tab 1",style: TextStyle(fontFamily: "iransans"),)),
BottomNavigationBarItem(icon: Icon(Icons.beach_access), title: Text("Tab 2",style: TextStyle(fontFamily: "iransans"),)),
BottomNavigationBarItem(icon: Icon(Icons.offline_bolt), title: Text("Tab 3",style: TextStyle(fontFamily: "iransans"),)),
]),
body: Container(
child: Center(
child: Text("Hello from tab 1"),
),
),
);
}误差
[VERBOSE-2:FontFamily.cpp(184)] Could not get cmap table size!
[VERBOSE-2:FontFamily.cpp(184)] Could not get cmap table size!
[VERBOSE-3:FontCollection.cpp(95)] nTypefaces == 0发布于 2019-05-17 20:40:36
在我的例子中,我忘记在uses-material-design: true文件中在flutter之后添加pubspec.yml。
发布于 2019-05-14 20:37:43
如果您已经将字体添加到pubspec.yaml文件中,并且正在使用iOS模拟器,那么这个问题非常类似于在Github页面(这里)上提到的问题。
https://stackoverflow.com/questions/56137070
复制相似问题