bounce_tapper 1.0.8 bounce_tapper: ^1.0.8 copied to clipboard
Smooth on-tap bounce (shrink/grow) animation that can easily enhance user touch interactions.
example/bounce_tapper_example.dart
import 'package:bounce_tapper/src/bounce_tapper.dart';
import 'package:flutter/material.dart';
class SamplePage extends StatelessWidget {
const SamplePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
BounceTapper(
child: FilledButton(
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
'Yay! A SnackBar!',
),
),
);
},
child: const Text('BUTTON'),
),
),
const SizedBox(height: 50),
BounceTapper(
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
'Yay! A SnackBar!',
),
),
);
},
child: Container(
height: 100,
width: 100,
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(12),
),
),
),
const SizedBox(height: 50),
BounceTapper(
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
'OnTap!',
),
),
);
},
onLongPressUp: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
'OnLongPressUp!',
),
),
);
},
child: const Card(
margin: EdgeInsets.zero,
child: SizedBox(
height: 100,
width: 100,
),
),
),
],
),
),
),
);
}
}