amazing_button 0.0.3+4 amazing_button: ^0.0.3+4 copied to clipboard
A new Flutter buttons package project. You can get easily a pre-build buttons and can customize it.
amazing_button #
A new Flutter package project for createing Buttons.
Example #
Here is a small example flutter app displaying a button.
import 'package:amazing_button/amazing_button.dart';
import 'package:flutter/material.dart';
class AmazingButtonDemo extends StatelessWidget {
const AmazingButtonDemo({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("AmazingButtonDemo"),
),
body: Center(
child: Column(
children: <Widget>[
//This is a default button (primary button)
AmazingButton(
onPressed: (){},
),
//You can get secondery, success, danger, warning, info, light, dark, dark, link type button
AmazingButton.secondery(onPressed: (){}),
AmazingButton.success(onPressed: (){}),
AmazingButton.danger(onPressed: (){}),
AmazingButton.warning(onPressed: (){}),
AmazingButton.info(onPressed: (){}),
AmazingButton.light(onPressed: (){}),
AmazingButton.dark(onPressed: (){}),
AmazingButton.link(onPressed: (){})
],
),
),
);
}
}
You can customize the buttons as you wish.
AmazingButton(
onPressed: (){},
onLongPress: (){},
text: "Button",
color: Colors.green,
fontSize: 30,
backgroundColor: Colors.red,
borderRadius: BorderRadius.all(Radius.circular(10)),
padding: EdgeInsets.all(20),
borderSideColor: Colors.red,
elevation: 5,
height: 100,
width: 300,
),
AmazingButton.warning(
onPressed: (){},
onLongPress: (){},
text: "Button",
color: Colors.green,
fontSize: 30,
backgroundColor: Colors.red,
borderRadius: BorderRadius.all(Radius.circular(10)),
padding: EdgeInsets.all(20),
borderSideColor: Colors.red,
elevation: 5,
height: 100,
width: 300,
),
Types of buttons #
You can get several types of buttons
AmazingButton(
onPressed: (){},
type: ButtonType.iconText,
),
types =>
ButtonType.outline
ButtonType.round
ButtonType.roundoutline
ButtonType.textIcon
ButtonType.iconText
- Type field is not compulsory. If you don't select the type, you will get the default button
Animation Button #
With the new release you can get the animation button. You can get the 'bounse ' animation. For this, you have to mention the type of animation you need as shown below.
// for get defalut bounse animation
AmazingButton(
onPressed: (){},
animation: AmazingAnimation.bounse()
),
// customize bounse animation
AmazingButton(
onPressed: (){},
animation: AmazingAnimation.bounse(
begin: 1.0,
end: 1.5,
duration: Duration(milliseconds: 1000),
)
),
- Animation field is not compulsory. If you don't select animation, you will get a button without animation.