Skip to main content
Logo Appt Light

Scale text on Flutter

Apps should scale text to the size specified by users in the system settings. This is especially important for visually impaired users because they might not be able to read the text otherwise.

Flutter automatically scales the text on the screen to the text size set by the user. We recommend using ThemeData to use the same text sizes and fonts everywhere.

Try to avoid using the textScaleFactor property because it overrides the text scale factor preferred by the user. The default factor is 1.0, but can go as high as 4.0 for some users. Restricting the number means that some users might not be able to read the text.

There are valid use cases to restrict the textScaleFactor to a certain number. You can use MediaQuery to override the value globally. You can also override it for a single use case by using the property inside a Text widget.

MediaQuery(
  data: MediaQuery.of(context).copyWith(
    textScaleFactor: 1.0, // Override scale for all widgets
  ),
  child: ...,
);

Text(
  'Appt', 
  textScaleFactor: 1.0, // Override scale for a single widget
);

Feedback?

Let us know!