Flutter › Accessibility in Flutter Apps

How does Flutter handle text scaling for users who have increased the system wide font size on their device, and why should you avoid hardcoding fixed pixel sizes for text?

Intermediate

Answer

Flutter automatically respects the operating system's text scale factor setting by default, meaning if a user has increased their device wide font size for readability, text within a Flutter app using relative text styles will scale up accordingly as well, and avoiding hardcoded fixed pixel dimensions for elements containing text, and instead using flexible layouts that can accommodate larger text without breaking, ensures the app remains fully usable and readable for users who genuinely depend on larger text sizes.
Text(
  'Order Total',
  style: Theme.of(context).textTheme.bodyLarge,
)
Real-world example A banking app avoids fixing its account balance display to a strict pixel height, instead using a flexible layout so the text can grow properly without being cut off when a visually impaired user increases their device's system font size.

Common follow-ups: How can you test how your app's layout behaves under different text scale factors?;Is it ever appropriate to disable text scaling for a specific piece of text?