FLUTTER ECOSYSTEM

aloisdeniel/tap_builder

A simple widget for building interactive areas.

tap_builder project cover
Stars
123
Forks
8
Last push (UTC)
Sep 25, 2023
Project status
Active
Aloïs Deniel GitHub avatar
GITHUB User

Aloïs Deniel ↗

Flutter Freelance

FreelanceRennes, FranceOfficial website ↗
LanguagesDartC++CMakeHTMLCSwiftKotlinObjective-C

Packages published by this repository

Dependencies used

Dependency list 3 items
  • flutter{"sdk":"flutter"}
  • lintsDevelopment^1.0.0
  • flutter_testDevelopment{"sdk":"flutter"}

Original README

English project snapshot. Visit GitHub for the latest content.

Expand / collapse project 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