gradient_coloured_buttons 0.0.1 gradient_coloured_buttons: ^0.0.1 copied to clipboard
A Flutter package that offers customizable buttons with gradient colors. Enhance your Flutter UI by easily creating buttons with smooth gradient backgrounds. Customize the gradient colors, button dime [...]
Gradient Button #
A Flutter package that provides customizable buttons with gradient colors. Enhance your Flutter UI by easily creating buttons with smooth gradient backgrounds.
Features #
- Create buttons with gradient backgrounds using the
GradientButton
widget. - Customize button dimensions, border radius, and more.
- Easy integration and usage within your Flutter projects.
Getting started #
To use this package, add gradient_button
as a dependency in your pubspec.yaml
file:
dependencies: gradient_coloured_buttons: ^0.0.1
//Import the package in your Dart file:
import 'package:gradient_button/gradient_button.dart';
// Create a gradient button:
class GradientButton extends StatelessWidget {
const GradientButton({Key? key, }) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
width: width,
height: height,
child: ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(borderRadius),
), backgroundColor: Colors.transparent,
padding: EdgeInsets.zero,
elevation: 0,
),
child: Ink(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: gradientColors,
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
borderRadius: BorderRadius.circular(borderRadius),
),
child: Container(
alignment: Alignment.center,
child: Text(
text,
style: textStyle,
),
),
),
),
);
}
}
Additional information #
For more information, refer to the documentation.
To contribute to this package, please visit the GitHub repository and follow the contribution guidelines.
If you encounter any issues or have suggestions, please create an issue on the issue tracker.