我是靠谱客的博主 丰富丝袜,这篇文章主要介绍Flutter 设置字体与设备缩放比例,现在分享给大家,希望可以做个参考。

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: widget.globalRouteKey,
      theme: ThemeData(
        primaryColor: Colors.yellow,
        accentColor: Colors.amber,
        highlightColor: Color.fromRGBO(255, 255, 255, 0.6),
        // 水波纹颜色
        splashColor: Colors.yellow,
        fontFamily: 'Roboto',
      ),
      //是否取消右上角的DEBUG标签
      debugShowCheckedModeBanner: false,
      onGenerateRoute: MyRouter.Router.fluroRouter.generator,
      //是否显示性能调试
      showPerformanceOverlay: false,
        builder: (context, widget) {
          return MediaQuery(
            //设置文字大小比例
            data: MediaQuery.of(context).copyWith(textScaleFactor: 0.9),
            child: widget,
          );
        },
    );
  }

最后

以上就是丰富丝袜最近收集整理的关于Flutter 设置字体与设备缩放比例的全部内容,更多相关Flutter内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(135)

评论列表共有 0 条评论

立即
投稿
返回
顶部