A Flutter widget that automatically resizes text to perfectly fit within its bounds.
AutoSizeText is a Flutter package that provides a widget which automatically adjusts the font size of text to fit perfectly within its container bounds. It solves the common problem of text overflow in responsive layouts by dynamically scaling text based on available space, ensuring content remains readable without manual adjustments.
Flutter developers building mobile, web, or desktop applications who need responsive text that adapts to varying screen sizes, content lengths, or dynamic layouts.
Developers choose AutoSizeText because it seamlessly replaces the standard Text widget with zero configuration, offers fine-grained control over resizing behavior, and maintains high performance while eliminating manual text scaling calculations.
Flutter widget that automatically resizes text to fit perfectly within its bounds.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Behaves exactly like Flutter's standard Text widget, allowing direct substitution without refactoring existing code, as emphasized in the README's usage examples.
Offers parameters like minFontSize, maxFontSize, stepGranularity, and presetFontSizes for precise resizing behavior, demonstrated in the GIFs and documentation.
AutoSizeGroup enables multiple text widgets to share the same font size for consistent typography, with clear examples in the README showing synchronized scaling.
Works with AutoSizeText.rich() for styled text spans while maintaining proportional scaling, though it requires careful setup as noted in the troubleshooting section.
Requires explicit width and height bounds to function; in unconstrained layouts like Row or Column without Expanded, it fails to resize, as admitted in the troubleshooting section.
Using AutoSizeText.rich() demands attention to style inheritance and minFontSize settings to avoid incorrect resizing, leading to potential bugs if not configured properly.
While optimized, the README warns that unreasonable font size ranges or small stepGranularity can impact performance, making it less ideal for highly dynamic scenarios.