π Flutter Easy Button
The simplest, most powerful button package for Flutter! π―
Create beautiful Material 3 buttons with just a few lines of code. No more boilerplate, no more complexityβjust clean, customizable buttons that work perfectly every time.
β¨ Why Choose Flutter Easy Button?
- π¨ Beautiful by Default - Material 3 design out of the box
- β‘ Lightning Fast - Zero dependencies, optimized performance
- π Smart Loading States - Built-in loading indicators that preserve your colors
- π― Type-Safe - Compile-time safety with required parameters
- π οΈ Highly Customizable - Control every aspect of your buttons
- π± Production Ready - Battle-tested and ready for your app
π― Features
| Feature | Description |
|---|---|
| π¨ Dual Button Styles | Switch between filled and outlined with one parameter |
| β³ Loading State | Built-in spinners that maintain your brand colors |
| π« Disabled State | Automatic styling with proper accessibility |
| πΌοΈ Icon Support | Add leading icons with customizable sizes |
| π Full-Width Layout | Responsive buttons that adapt to any screen |
| π¨ Custom Colors | Complete control over background, text, and borders |
| βοΈ Border Control | Adjustable width and color for outlined buttons |
| π Type Safety | Required parameters prevent runtime errors |
π¦ Installation
Add this to your pubspec.yaml:
dependencies:
flutter_easy_button: ^1.0.3
π» Quick Start
π¨ Filled Button (Primary Actions)
import 'package:flutter_easy_button/flutter_easy_button.dart';
CustomButton(
buttonText: 'Login',
buttonColor: Colors.blue,
textColor: Colors.white,
buttonType: ButtonType.filled,
onPressed: () {
debugPrint('Button pressed');
},
)
π² Outlined Button (Secondary Actions)
CustomButton(
buttonText: 'Cancel',
buttonColor: Colors.blue,
textColor: Colors.blue,
buttonType: ButtonType.outlined,
borderColor: Colors.red, // Optional custom border
borderWidth: 2.0,
onPressed: () {
debugPrint('Button pressed');
},
)
π― With Icons (Enhanced UX)
CustomOutlineButton(
buttonText: 'Sign Up',
buttonColor: Colors.green,
textColor: Colors.green,
buttonType: ButtonType.outlined,
icon: Icons.person_add, // Beautiful icons
onPressed: () {
debugPrint('Sign up pressed');
},
)
β³ Loading State (Smart & Automatic)
CustomButton(
buttonText: 'Submit',
buttonColor: Colors.blue,
textColor: Colors.white,
buttonType: ButtonType.filled,
isLoading: true, // Colors preserved automatically!
loadingText: 'Submitting...',
onPressed: () {},
)
π± Full-Width Responsive Button
CustomButton(
buttonText: 'Continue',
buttonColor: Colors.purple,
textColor: Colors.white,
buttonType: ButtonType.filled,
icon: Icons.arrow_forward,
iconSize: 20,
isFullWidth: true,
onPressed: () {
debugPrint('Continue pressed');
},
)
π Complete API Reference
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
buttonText |
String |
β | - | Text displayed on the button |
buttonColor |
Color |
β | - | Background/border color |
textColor |
Color |
β | - | Text and icon color |
buttonType |
ButtonType |
β | - | Button style (filled/outlined) |
onPressed |
VoidCallback |
β | - | Callback when pressed |
buttonTextId |
String? |
β | null |
Optional localization ID |
icon |
IconData? |
β | null |
Optional leading icon |
iconSize |
int |
β | 18 |
Icon size |
borderColor |
Color? |
β | buttonColor |
Border color (outlined) |
borderWidth |
double |
β | 2.0 |
Border width (outlined) |
isLoading |
bool |
β | false |
Show loading indicator |
isFullWidth |
bool |
β | false |
Expand to full width |
isDisabled |
bool |
β | false |
Disable the button |
loadingText |
String |
β | "Loading..." |
Text during loading |
π― What Makes This Different?
Unlike other button packages, Flutter Easy Button:
- β Preserves colors during loading - No more gray buttons when loading
- β Zero dependencies - Won't bloat your app
- β Type-safe by design - Catches errors at compile time
- β Material 3 compliant - Modern design standards
- β Production tested - Used in real-world apps
π€ Contributing
Contributions are welcome! Feel free to open issues or submit pull requests on GitHub.
π License
This package is licensed under the MIT License. See LICENSE for details.
β Show Your Support
If you find this package helpful, please give it a β on GitHub and like it on pub.dev!
Made with β€οΈ for the Flutter community