bounceable_effect 0.0.1
bounceable_effect: ^0.0.1 copied to clipboard
Introducing a user-friendly and versatile on-tap bounce animation, which can be effortlessly applied to any widget of your choice. This interactive feature is designed to enhance the user experience a [...]
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:bounceable_effect/bounceable_effect.dart';
void main() {
runApp( MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Bouncable Effect',
home: Scaffold(
appBar: AppBar(
title: Text('Bouncable Effect'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
//bounceable_effect on text
BouncableEffect(
onTap: () {
print('Tapped On Text Widget');
},
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text('Bounceable Effect',style: TextStyle(fontSize: 18,color: Colors.pink,),),
)
),
//Get By Defualt Value
const SizedBox(height: 10,),
//bounceable_effect on button
BouncableEffect(
effect: Curves.bounceInOut,
speed: 200,
bouncing: .7,
onTap: () {
print('Click tapped!');
},
child: Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(30),
color: Colors.blue,
child: Text('Hello, World!'),
),
),
const SizedBox(height: 10,),
//bounceable_effect on Icon
BouncableEffect(
effect: Curves.easeInCirc,
bouncing: .9,
onTap: () {
print('Click tapped!');
},
child: Icon(
Icons.star,
color: Colors.green,size: 100,
),
),
const SizedBox(height: 10,),
//bounceable_effect on Mutli stack widget
BouncableEffect(
effect: Curves.easeInBack,
speed: 100,
bouncing: .9,
onTap: () {
print('Click tapped!');
},
child:
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border.all(color: Colors.grey),
),
clipBehavior: Clip.antiAliasWithSaveLayer,
child: Stack(
children: [
Image.network('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcROw1upqPjzbLnyLZuMHMKLhnny7-8tQr08Ew&usqp=CAU'),
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10),
bottomRight: Radius.circular(10),
),
color: Colors.white.withOpacity(.2),
),
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 16),
child: Text(
'Bounceable Effect',
style: TextStyle(color: Colors.white),
),
),
),
],
),
)
),
],
),
),
),
);
}
}