Last updated:
0 purchases
flutter gradient button
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
copied to clipboard
You can install packages from the command line:
flutter pub get
copied to clipboard
Usage #
Import the package:
import 'package:gradient_button/gradient_button.dart';
copied to clipboard
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");
},
),
copied to clipboard
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.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.