简体   繁体   English

如何在flutter中获取当前字体系列值?

[英]How to get current font family value in flutter?

 return MaterialApp(
      title: 'title',
      theme: ThemeData(
        fontFamily: 'Times',

How do I get the defined fontfamily string value while on any page?如何在任何页面上获取定义的 fontfamily 字符串值?

You can make your font-family string a global variable using:您可以使用以下方法使您的字体系列字符串成为全局变量:

import 'globals.dart' as globals;

Please refer to the post below for a more detailed explanation请参阅下面的帖子以获得更详细的解释

https://stackoverflow.com/a/29182641/8622829 https://stackoverflow.com/a/29182641/8622829

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM