FLUTTER ECOSYSTEM

ericdallo/ripple_effect

アプリにリップル効果を追加するためのFlutterパッケージ

リップル効果 のプロジェクト画像
Stars
11
Forks
8
最終プッシュ(UTC)
2022/12/15
プロジェクト状態
公開中
Eric Dallo GitHub avatar
GITHUB User

Eric Dallo ↗

Emacs fanatic, NixOS enthusiast, maintainer of clojure-lsp, ECA, emacs-lsp and lsp-dart

@nubank São Paulo, Brazil公式サイト ↗
言語Dart

技術トピック

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 3 件
  • flutter{"sdk":"flutter"}
  • rect_getter^0.1.0
  • flutter_test開発用{"sdk":"flutter"}

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

Pub Package GitHub Actions

ripple_effect

A easy way to achieve a ripple effect on you flutter app.

https://user-images.githubusercontent.com/7820865/78139282-a2e49c00-73fe-11ea-9159-7ea019c87d0e.gif

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 GlobalKeys respectively to work.

Example

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),
          ),
        )
      ),
    );
  }
}