Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable iOS dynamic type in Flutter

Tags:

flutter

Is there any way to disable text getting enlarged by iOS dynamic type when developing in Flutter?

I have a few aesthetic Texts used in stacks with images that get screwed up when the text gets enlarged.

like image 833
BGH Avatar asked Nov 29 '18 03:11

BGH


1 Answers

Enclose the Widget with this, it will disable its dynamic typing, recursively.

return MediaQuery(
  child: your-widget-here,
  data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
);
like image 54
xhg Avatar answered Sep 20 '22 02:09

xhg