Member-only story
Yes, Your Flutter App Changes When Users Increase Font Size
Have you ever noticed that your flutter app text getting too big or too small when user change font size from settings? Users can change text size in their phone settings, and sometimes it breaks your app UI and layout.
The Problem
When users change their phone’s font size, Flutter apps change too. Big text can overflow containers. Small text becomes unreadable.
The Solution
Add this code to your MaterialApp or main widget:
final mediaQuery = MediaQuery.of(context);
return MediaQuery(
data: mediaQuery.copyWith(
textScaler: TextScaler.linear(1.0),
boldText: false,
),
child: YourWidget(),
);What This Does
- TextScaler.linear(1.0) — Fixes text size to default (no scaling)
- boldText: false — Prevents forced bold text from system settings
Where to Put It
Put it at the root of your app:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaler: TextScaler.linear(1.0),
boldText: false,
),
child: MaterialApp(
home: MyHomePage(),
),
);
}
}Only use this if your app truly needs fixed text sizes. Some users rely on larger text for accessibility. Else a better solution is to handle text scaling properly using the flutter_utils package.
Thanks for reading! If this helped you, don’t forget to clap and follow for more Flutter tips!









