Skip to content
pubscout

auto_size_text_field

2.3.0, released 7 months ago by zhuoran.li

Flutter TextField widget that automatically resizes text to fit bounds.

WASM-ready
$ flutter pub add auto_size_text_field
Source repository

What it does

Provides an AutoSizeTextField widget that behaves like a standard TextField but automatically resizes its text to fit perfectly within available bounds. It supports minimum and maximum font sizes, step granularity, preset font sizes, and overflow replacements.

AI-written summary of version 2.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a text input field where the font size scales down dynamically to prevent overflow.
  • You want a drop-in replacement for standard Flutter TextFields with automatic text resizing capabilities.

Skip it when

  • The text field lacks bounded constraints, which can cause layout issues or overflows.
  • You require non-standard native text editing features not supported by the underlying TextField wrapper.

Strengths

  • Drop-in replacement for standard TextField widgets.
  • Highly customizable font sizing options including min/max limits, step granularity, and preset font sizes.
  • Supports full-width expansion or intrinsic text width sizing.

Weaknesses

  • Requires bounded constraints to function correctly, otherwise text may overflow.
  • Using an unreasonably high base font size can impact performance.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
AutoSizeTextField(
  controller: _textEditingController,
  style: TextStyle(fontSize: 20),
  maxLines: 2,
)

Alternatives

Packages that do the same job and could replace auto_size_text_field.