๐ฆ animated_3D_button
A customizable animated button widget for Flutter that creates a bouncing elevation/shadow effect using Stack and AnimatedPositioned.
โจ Features
- Smooth animated shadow/elevation effect
- Custom size, color, and border radius
- Haptic feedback on press
- Lightweight and dependency-free
๐ฆ Installation
Add this to your pubspec.yaml:
dependencies:
animated_3d_button: ^1.0.0
Then run:
flutter pub get
๐ Usage
import 'package:animated_button/animated_button.dart';
AnimatedShadowButton(
width: 180,
height: 55,
color: Colors.deepOrange,
onPressed: () {
// Handle tap
},
child: const Text(
'Click Me',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
);
๐งช Example
A full working example is available in the example directory.
To run it:
cd example
flutter run
๐งฐ API Reference
| Property | Type | Default | Description |
|---|---|---|---|
onPressed |
VoidCallback |
required | Callback fired on button press |
child |
Widget |
required | The inner content of the button |
width |
double |
150 |
Button width |
height |
double |
50 |
Button height |
color |
Color |
Colors.blue |
Background color of the button |
๐ง Contributing
Feel free to submit issues or PRs. For major changes, open a discussion first.
๐ License
MIT ยฉ Saptarshi Mondal