Last updated:
0 purchases
override text scale factor
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',
),
),
);
copied to clipboard
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',
),
),
);
copied to clipboard
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.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.