Want to manage global textScaleFactor in Flutter app properly? This solution was presented during Google I/O’19 (around the 20-minute mark):
1 2 3 4 5 6 7 8 9 10 | MaterialApp( builder: (BuildContext context, Widget child){ final MediaQueryData data = MediaQuery.of(context); return MediaQuery( data: data.copyWith( textScaleFactor: data.textScaleFactor * (_isPassive ? 2 : 1) ), child: child, ); }, |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.