tap_builder 0.1.0 tap_builder: ^0.1.0 copied to clipboard
A new Flutter package project.
tap_builder #
A simple widget for building interactive areas.
Quickstart #
@override
Widget build(BuildContext context) {
return TapBuilder(
onTap: () {},
builder: (context, state) => AnimatedContainer(
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 20,
),
duration: const Duration(milliseconds: 500),
decoration: BoxDecoration(
color: () {
switch (state) {
case TapState.disabled:
return Colors.grey;
case TapState.focused:
return Colors.lightBlue;
case TapState.hover:
return Colors.blue;
case TapState.inactive:
return Colors.amberAccent;
case TapState.pressed:
return Colors.red;
}
}(),
),
child: Text('Button'),
),
);
}