Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattrltrent/scrollable
A powerful set of scrollable widgets including haptics, keyboard dismissing, and more. Pub package.
https://github.com/mattrltrent/scrollable
dart flutter haptics package package-manager pub scrollable
Last synced: about 2 months ago
JSON representation
A powerful set of scrollable widgets including haptics, keyboard dismissing, and more. Pub package.
- Host: GitHub
- URL: https://github.com/mattrltrent/scrollable
- Owner: mattrltrent
- License: mit
- Created: 2022-11-06T10:56:31.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-02T03:39:52.000Z (about 1 year ago)
- Last Synced: 2024-12-07T13:06:13.194Z (about 2 months ago)
- Topics: dart, flutter, haptics, package, package-manager, pub, scrollable
- Language: C++
- Homepage: https://pub.dev/packages/scrollable
- Size: 15.4 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 🔥 A powerful set of scrollable widgets: haptics, keyboard dismissing, and more 🔥
- Submit an issue [here](https://github.com/mattrltrent/scrollable/issues).
- Create a pull request [here](https://github.com/mattrltrent/scrollable/pulls).
- Contact me via email [here](mailto:[email protected]).## 3 Widgets in this package 📚
#### 💥 `ScrollHaptics`
- Applies haptic feedback when its `child` is scrolled (during scroll & reaching edge of scroll view).
#### 💥 `KeyboardDismiss`
- Dismisses the soft-keyboard when its `child` is scrolled, tapped, or swiped.
#### 💥 `ScrollableView`
- The above 2 widgets combined into 1 widget for ease-of-use.
## Example Gif 📸
_It's hard to display haptics in a gif, but they're there._
## Installing 🧑🏫
- Install the package from the pub.
- `flutter pub add scrollable`
- Import the package.
- `import 'package:scrollable/exports.dart';`## Quick Start 💨
Simply wrap whatever you want inside the `ScrollHaptics`, `KeyboardDismiss`, or `ScrollableView` widgets, then edit whatever of their properties you want!
## Short Examples of the 3 Widgets 📜
_For a full example with context, view the examples tab. It shows just the `ScrollableView`, but it's the same layout for all 3 widgets._
Scroll Haptics
## **`ScrollHaptics`**
```dart
ScrollHaptics(
//
child: SingleChildScrollView(
child: Column(
children: [
Container(height: 100, width: 100, color: Colors.redAccent),
Container(height: 100, width: 100, color: Colors.blue),
Container(height: 100, width: 100, color: Colors.purple),
],
),
),
);
```Keyboard Dismiss
## **`KeyboardDismiss`**
```dart
KeyboardDismiss(
//
child: SingleChildScrollView(
child: Column(
children: [
Container(height: 100, width: 100, color: Colors.redAccent),
Container(height: 100, width: 100, color: Colors.blue),
Container(height: 100, width: 100, color: Colors.purple),
],
),
),
);
```Scrollable View
## **`ScrollableView`**
```dart
ScrollableView(
//
controller: ScrollController(),
child: SingleChildScrollView(
child: Column(
children: [
Container(height: 100, width: 100, color: Colors.redAccent),
Container(height: 100, width: 100, color: Colors.blue),
Container(height: 100, width: 100, color: Colors.purple),
],
),
),
);
```## Properties of the 3 Widgets 📜
Scroll Haptics
## **`ScrollHaptics`**
**Highly reccomended to use `ClampingScrollPhysics` for the physics of whatever scrollable you're wrapping, as it works best with haptics.**
- `child` (required): This widget's child.
- `bubbleUpScrollNotifications`: Whether the widget should bubble up scroll notifications, or block them.
- `heavyHapticsAtEdgeEnabled`: When a scroll reaches the edge, if there should be a haptic effect emitted.
- `hapticEffectAtEdge`: Which kind of haptic effect should be emitted when the scroll edge is reached?
- `hapticEffectDuringScroll`: Which kind of haptic effect should be emitted during the scroll.
- `distancebetweenHapticEffectsDuringScroll`: The distance, in pixels, that should be scrolled before emitting a new haptic scroll effect.Keyboard Dismiss
## **`KeyboardDismiss`**
- `child` (required): This widget's child.
- `bubbleUpScrollNotifications`: Whether the widget should bubble up scroll notifications, or block them.
- `closeKeyboardOnTap`: If the keyboard should also be closed just on the widget being tapped.
- `closeKeyboardOnVerticalSwipe`: If the keyboard should be closed when a vertical swipe occurs.
- `onKeyboardDismissed`: Callback triggered when a dismiss occurs.Scrollable View
## **`ScrollableView`**
- `child` (required): This widget's child.
- `controller` (required): A `ScrollController` to manage the scrolling of the widget.
- `bubbleUpScrollNotifications`: Whether the widget should bubble up scroll notifications, or block them.
- `closeKeyboardOnScroll`: Whether the keyboard should be automatically closed on the widget being scrolled.
- `closeKeyboardOnTap`: If the keyboard should also be closed just on the widget being tapped.
- `physics`: Physics of the scroll view. **Highly reccomended to use `ClampingScrollPhysics` as it works best with haptics.**
- `scrollDirection`: Direction of the scroll.
- `inlineBottomOrRightPadding`: Inline padding of the scroll view. This is a clean substitute to having to add `SizedBox` widgets inside your scroll view. For the bottom (if vertical) or right (if horizontal) of the scroll view.
- `inlineTopOrLeftPadding`: Inline padding of the scroll view. This is a clean substitute to having to add `SizedBox` widgets inside your scroll view. For the top (if vertical) or left (if horizontal) of the scroll view.
- `padding`: Outer padding of the widget.
- `hapticsEnabled`: If haptics should be enabled.
- `distancebetweenHapticEffectsDuringScroll`: The distance, in pixels, that should be scrolled before emitting a new haptic scroll effect.
- `heavyHapticsAtEdgeEnabled`: If the haptics when the edge of the scroll is reached should be enabled or not.
- `hapticEffectAtEdge`: Which kind of haptic effect should be emitted when the scroll edge is reached?
- `hapticEffectDuringScroll`: Which kind of haptic effect should be emitted during the scroll.
- `primary`: Whether this is the primary scroll view associated with the parent `PrimaryScrollController`.
- `dragStartBehavior`: Determines the way that drag start behavior is handled.
- `restorationId`: Restoration ID to save and restore the scroll offset of the scrollable.
- `reverse`: Whether the scroll view scrolls in the reading direction.
- `closeKeyboardOnVerticalSwipe`: If the keyboard should be closed when a vertical swipe occurs.## Additional Info 📣
- The package is always open to [improvements](https://github.com/mattrltrent/scrollable/issues), [suggestions](mailto:[email protected]), and [additions](https://github.com/mattrltrent/scrollable/pulls)!
- I'll look through PRs and issues as soon as I can!
- [Learn about me](https://matthewtrent.me).
![analytics](https://hidden-coast-90561-45544df95b1b.herokuapp.com/api/v1/analytics/?kind=package-scrollable)