tap_builder 0.5.0 copy "tap_builder: ^0.5.0" to clipboard
tap_builder: ^0.5.0 copied to clipboard

A simple widget for building interactive areas.

tap_builder #

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

96
likes
120
pub points
83%
popularity

Publisher

verified publisheraloisdeniel.com

A simple widget for building interactive areas.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on tap_builder