在 Flutter 中禁用 iOS 动态类型

BGH*_*BGH 6 flutter

在 Flutter 中开发时,有什么方法可以禁用 iOS 动态类型放大的文本?

我在堆栈中使用了一些美学文本,当文本被放大时,这些图像会被搞砸。

xhg*_*xhg 9

用这个将 Widget 括起来,它将以递归方式禁用其动态类型。

return MediaQuery(
  child: your-widget-here,
  data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
);
Run Code Online (Sandbox Code Playgroud)