flutter_gradient_button 0.0.1
flutter_gradient_button: ^0.0.1 copied to clipboard
this simple gradient button widget
gradient_button #
A Flutter package to create customizable gradient buttons.
Installation #
Add this to your package's pubspec.yaml
file:
dependencies:
gradient_button: ^1.0.0
You can install packages from the command line:
flutter pub get
Usage #
Import the package:
import 'package:gradient_button/gradient_button.dart';
Use the GradientButton widget:
GradientButton(
colors: [Colors.blue, Colors.green],
height: 50,
width: 200,
radius: 25,
gradientDirection: GradientDirection.leftToRight,
textStyle: TextStyle(color: Colors.white),
text: "Click me",
onPressed: () {
print("Button clicked");
},
),
You can customize the colors, height, width, radius, gradient direction, text style, and text of the button. You can also provide an onPressed callback to handle button clicks.
Example #
To run the example project, clone the repo, and run flutter run in the example directory.
License #
This project is licensed under the MIT License - see the LICENSE file for details.