scroll_when_needed
3.0.1, released 4 years ago by vanlooverenkoen.be
Custom scroll behavior and physics to scroll only when content exceeds available space.
What it does
Provides a custom ScrollBehavior and scroll physics that enable platform-specific scrolling behavior only when there is not enough space inside a scrollable widget. It helps prevent unnecessary scrolling behavior on platforms where it is not desired when content fits completely.
AI-written summary of version 3.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want a scrollable widget to only scroll when its content exceeds the available space
- You need platform-specific scrolling behavior based on content overflow
Skip it when
- You always want scrolling enabled regardless of content size
Strengths
- Simple integration via ScrollConfiguration and ListView physics
- Supports platform-specific scrolling behaviors
Weaknesses
- Limited documentation beyond basic usage
- No topics specified on pub.dev
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
ScrollConfiguration(
behavior: ScrollWhenNeededBehavior(),
child: ListView(
physics: ScrollWhenNeededPhysics(targetPlatform: Theme.of(context).platform),
children: [
Container(
height: 100,
color: Colors.amber,
),
TextField(),
Container(
height: 300,
color: Colors.amber,
),
],
),
),Alternatives
Packages that do the same job and could replace scroll_when_needed.
- scroll_to_index
Scroll to a specific child of any scrollable widget in Flutter.
50Compare - smooth_highlight
Provides a widget that highlights its child with a customizable animation.
50Compare - stretchy_header
Create an elastic stretchy header effect when scrolling down a widget in Flutter.
49Compare - extended_tabs
An extension library for Flutter Tabs, TabBar, and TabView with advanced scrolling support.
58Compare