overscroll_feedback 0.0.1
overscroll_feedback: ^0.0.1 copied to clipboard
A Flutter ListView that reveals custom feedback when users pull beyond the scroll edge, with optional haptics and callbacks.
overscroll_feedback #
A Flutter widget that reveals custom feedback when users pull beyond the end of a list. It can also trigger haptics and callbacks when the scroll limit is reached.
Features #
- Vertical or horizontal
ListViewsupport. - Custom end-of-list feedback widgets.
- Optional haptic feedback while the user keeps pulling.
- One-shot and repeated hold callbacks.
Usage #
Add the package to your app:
dependencies:
overscroll_feedback: ^0.0.1
Use OverscrollFeedback when you want a simple list with an end-of-scroll
reveal.
OverscrollFeedback.strings(
messages: const [
'Welcome aboard',
'Pull gently',
'Keep scrolling',
'Now pull past the end',
],
reachLimitWidget: DecoratedBox(
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(999),
),
child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 18, vertical: 12),
child: Text(
'You reached the end',
style: TextStyle(color: Colors.white),
),
),
),
onReachLimit: () {
debugPrint('Reached the bottom');
},
)
For custom item types, use the generic constructor:
OverscrollFeedback<MyItem>(
items: items,
itemBuilder: (context, item, index) {
return ListTile(title: Text(item.title));
},
reachLimitWidget: const Text('Nothing else here'),
)
Example #
A runnable example app is included in the example folder.
cd example
flutter run