的默认fontSize值为14.0。因此,textScaleFactor: 2.0似乎与fontSize: 28.0我的代码示例相同:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Title')),
body: Row(
children: <Widget>[
new Text("Jane", textScaleFactor: 2.0),
new Text(" Doe", style: new TextStyle(fontSize: 28.0)),
],
)
)
);
}
}
Run Code Online (Sandbox Code Playgroud)
优缺点都有什么?在特定情况下何时使用一种或另一种有什么建议吗?
flutter ×1