Last active
April 11, 2024 06:00
-
-
Save ffkev/8d784f8a7f8149b6af93f3d5fc271d8e to your computer and use it in GitHub Desktop.
There is a MediaQuery property in Flutter which you can use to restrict scaling of your fonts on different devices based on the device accessibility settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MediaQuery( | |
// This will set scaling for the app to always remain 1:1 globally | |
data: MediaQuery.of(context).copyWith(textScaler: TextScaler.linear(1.0)), | |
// Wrap your Material App with MediaQuery to implement this | |
child: MaterialApp.router( | |
title: 'ScaleFactorText', | |
... | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment