FLUTTER ECOSYSTEM

aloisdeniel/tap_builder

一個用於建構互動區域的簡單組件。

tap_builder 專案封面
Stars
123
Forks
8
最近推送(UTC)
2023年9月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