Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aloisdeniel/tap_builder
A simple widget for building interactive areas.
https://github.com/aloisdeniel/tap_builder
Last synced: about 2 months ago
JSON representation
A simple widget for building interactive areas.
- Host: GitHub
- URL: https://github.com/aloisdeniel/tap_builder
- Owner: aloisdeniel
- License: mit
- Created: 2020-12-02T18:56:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-25T10:14:48.000Z (12 months ago)
- Last Synced: 2024-07-09T00:10:24.957Z (2 months ago)
- Language: Dart
- Size: 3 MB
- Stars: 115
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# tap_builder
![screenshot](https://github.com/aloisdeniel/tap_builder/raw/main/doc/tap_builder.gif)
A simple widget for building interactive areas. It is an alternative to the material's `Inkwell` that allows customizing the visual effects.
## Quickstart
```dart
@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](https://github.com/aloisdeniel/tap_builder/blob/main/example/lib/main.dart)