Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 1.44 KB

README.md

File metadata and controls

46 lines (39 loc) · 1.44 KB

override_text_scale_factor

A Flutter Widget that overrides the textScaleFactor given by MediaQuery.

When you're too lazy to make parts of your UI respond to a non-default textScaleFactor then OverrideTextScaleFactor is the widget for you.

Usage

The package contains a single widget OverrideTextScaleFactor. By default this widget will set textScaleFactor to 1.0 but the field can be overridden to any value.

Example

OverrideTextScaleFactor(
    // Note that any widget can be used as child - not only Text widgets
    child: Container(
        child: Text(
            // This text will always have a textScaleFactor of 1.0
            // regardless of device settings
            'Random text', 
        ),
    ),
);

If needed, a specific factor can be used to override the textScaleFactor.

Example

OverrideTextScaleFactor(
    // Setting the textScaleFactor to a specific value
    textScaleFactor: 1.5,
    child: Container(
        child: Text(
            // This text will always have a textScaleFactor of 1.5
            // regardless of device settings
            'Random text', 
        ),
    ),
);

Example Project

Take a look at this Example Project Project

Acknowledgements

This package is close to useless but I've found myself needing an OverrideTextScaleFactor widget and you might too.