A powerful, flexible and production-ready Flutter button library that provides multiple button variants built on top of a single core engine.
This package is designed to help you build a consistent, scalable and reusable button system for your Flutter apps.
- ✅ Primary, Outline, Gradient, Danger buttons
- ✅ Icon-only buttons (filled, outline, gradient)
- ✅ Loading & disabled states
- ✅ Left & right icons
- ✅ Full customization (colors, radius, shadows, borders, decoration)
- ✅ Safe API with assertions
- ✅ Clean, extensible architecture
- ✅ Well-documented & tested
flutter pub add custom_button
or
dependencies:
your_package_name: ^1.0.0
🚀 Basic Usage
import 'package:your_package_name/your_package_name.dart';
PrimaryButton(
text: "Save",
onTap: () {},
);
🧩 Button Variants
Primary Button
PrimaryButton(
text: "Continue",
onTap: () {},
);
Outline Button
OutlineButton(
text: "Cancel",
onTap: () {},
);
Gradient Button
GradientButton(
text: "Upgrade",
gradient: LinearGradient(colors: [Colors.purple, Colors.blue]),
onTap: () {},
);
Danger Button
DangerButton(
text: "Delete",
onTap: () {},
);
🧿 Icon Buttons
IconOnlyButton(
icon: Icon(Icons.edit),
onTap: () {},
);
OutlineIconButton(
icon: Icon(Icons.delete),
onTap: () {},
);
GradientIconButton(
icon: Icon(Icons.add),
gradient: LinearGradient(colors: [Colors.green, Colors.blue]),
onTap: () {},
);
⏳ Loading & Disabled
PrimaryButton(
text: "Saving...",
isLoading: true,
onTap: () {},
);
PrimaryButton(
text: "Submit",
enabled: false,
onTap: () {},
);
📱 Example App
A full component gallery is included inside the /example folder.
Run it using:
cd example
flutter run
🧪 Testing
flutter test
🤝 Contributing
Contributions, issues, and feature requests are welcome!