Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ericdallo/ripple_effect
A Flutter pub package for add a ripple effect on your app
https://github.com/ericdallo/ripple_effect
dart flutter navigation package pub ripple ripple-animation widget
Last synced: 16 days ago
JSON representation
A Flutter pub package for add a ripple effect on your app
- Host: GitHub
- URL: https://github.com/ericdallo/ripple_effect
- Owner: ericdallo
- License: mit
- Created: 2020-04-01T01:13:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-15T04:05:11.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T00:29:32.929Z (about 1 month ago)
- Topics: dart, flutter, navigation, package, pub, ripple, ripple-animation, widget
- Language: Dart
- Homepage:
- Size: 195 KB
- Stars: 10
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![Pub Package](https://img.shields.io/pub/v/ripple_effect.svg?color=0175C2)](https://pub.dev/packages/ripple_effect)
[![GitHub Actions](https://github.com/ericdallo/ripple_effect/workflows/Tests/badge.svg)](https://github.com/ericdallo/ripple_effect/actions)# ripple_effect
A easy way to achieve a ripple effect on you flutter app.
## Usage
First you need to wrap your page/Scaffold with the `RipplePage` widget, the ripple efect will growth until this widget. Then
wrap with the `RippleEffect` where the animation should begin. When the animation should begin, call the `RippleEffect.start` method passing you callback method(often navigate to other page).The `RipplePage` and `RippleEffect` widgets need their `GlobalKey`s respectively to work.
## Example
```dart
class Stateless extends StatelessWidget {
final pageKey = RipplePage.createGlobalKey();
final effectKey = RippleEffect.createGlobalKey();
@override
Widget build(BuildContext context) {
return RipplePage(
child: Scaffold(
body: Center(),
floatingActionButton: RippleEffect(
pageKey: pageKey,
effectKey: effectKey,
color: Colors.blue,
child: FloatingActionButton(
backgroundColor: Colors.blue,
onPressed: () =>
RippleEffect.start(effectKey, () => toNextPage(context)),
child: Icon(Icons.arrow_back),
),
)
),
);
}
}
```