ensure_visible_when_focused
1.2.0, released 3 years ago by rodrigobastos.dev
A widget that automatically scrolls its child into view when the child gains focus.
What it does
Ensures that a target widget, such as a text field, automatically scrolls into the viewport whenever it receives focus. You wrap your widget in the provided widget and pass the corresponding FocusNode.
AI-written summary of version 1.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You have large forms with multiple fields that need to scroll into view automatically upon focusing.
- You want to improve user experience on mobile or web forms by keeping focused inputs visible.
Skip it when
- You already manage scrolling manually through complex scroll controllers on every focus event.
Strengths
- Simple integration by wrapping the target widget
- Configurable scroll duration and curve
- Solves a common form-scrolling issue with minimal boilerplate
Weaknesses
- Limited to focus-driven scrolling scenarios
- Requires passing a FocusNode to both the wrapper and the target widget
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
EnsureVisibleWhenFocused(
focusNode: _focusNode,
child: TextFormField(
focusNode: _focusNode,
),
)Alternatives
Packages that do the same job and could replace ensure_visible_when_focused.
- find_in_page
An in-app find bar that highlights and scrolls to text matches, including lazy-list rows.
71Compare - marquee_widget
A Flutter widget that scrolls text and other widgets with RTL support.
47Compare - marquee
A Flutter widget that scrolls text infinitely.
50Compare - keyboard_avoider
A lightweight alternative to Scaffold for avoiding the on-screen software keyboard.
50Compare