FLUTTER ECOSYSTEM

aloisdeniel/tap_builder

インタラクティブな領域を構築するためのシンプルなウィジェット。

tap_builder のプロジェクト画像
Stars
123
Forks
8
最終プッシュ(UTC)
2023/09/25
プロジェクト状態
公開中
Aloïs Deniel GitHub avatar
GITHUB User

Aloïs Deniel ↗

Flutter Freelance

FreelanceRennes, France公式サイト ↗
言語DartC++CMakeHTMLCSwiftKotlinObjective-C

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

使用している依存関係

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

元の README

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

README を開く / 閉じる

tap_builder

https://img.shields.io/pub/v/tap_builder.svg https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat

screenshot

A simple widget for building interactive areas. It is an alternative to the material's Inkwell that allows customizing the visual effects.

Quickstart

 @override
Widget build(BuildContext context) {
    return TapBuilder(
        onTap: () {},
        builder: (context, state, isFocused) => AnimatedContainer(
            padding: EdgeInsets.symmetric(
                vertical: 10,
                horizontal: 20,
            ),
            duration: const Duration(milliseconds: 500),
            decoration: BoxDecoration(
                border: Border.all(
                    color: Colors.white.withOpacity(isFocused ? 0.2 : 0.0),
                    width: 2,
                ),
                color: () {
                    switch (state) {
                        case TapState.disabled:
                            return Colors.grey;
                        case TapState.hover:
                            return Colors.blue;
                        case TapState.inactive:
                            return Colors.amberAccent;
                        case TapState.pressed:
                            return Colors.red;
                    }
                }(),
            ),
            child: Text('Button'),
        ),
    );
}

Example

See the full example