From fbb4882c3f490338fafee093432d847f1c1c51ca Mon Sep 17 00:00:00 2001 From: Eric Dallo Date: Tue, 31 Mar 2020 22:39:13 -0300 Subject: [PATCH] Update README.md --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index cf993ea..7b89e45 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,40 @@ 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), + ), + ) + ), + ); + } +} +```