gradientButton2 static method
Widget
gradientButton2({
- required String text,
- Color textColor = Colors.white,
- double? width,
- double? height,
- double radius = buttonRadius,
- double fontSize = buttonFontSize,
- VoidCallback? onPressed,
- Gradient? gradient,
- EdgeInsetsGeometry? margin,
- EdgeInsetsGeometry? padding,
- Color? borderColor,
Implementation
static Widget gradientButton2(
{required String text,
Color textColor = Colors.white,
double? width,
double? height,
double radius = buttonRadius,
double fontSize = buttonFontSize,
VoidCallback? onPressed,
Gradient? gradient,
EdgeInsetsGeometry? margin,
EdgeInsetsGeometry? padding,
Color? borderColor}) {
return ElevatedButton(
onPressed: onPressed,
style: ButtonStyle(
maximumSize: MaterialStateProperty.all(const Size(double.infinity, double.infinity)),
minimumSize: MaterialStateProperty.all(const Size(0, 0)),
backgroundColor: ButtonStyleButton.allOrNull<Color>(Colors.transparent),
overlayColor: ButtonStyleButton.allOrNull<Color>(Colors.transparent),
elevation: ButtonStyleButton.allOrNull<double>(0),
padding: ButtonStyleButton.allOrNull<EdgeInsetsGeometry>(margin ?? EdgeInsets.zero),
),
child: Container(
alignment: Alignment.center,
padding: padding,
height: height,
width: width,
decoration: BoxDecoration(gradient: gradient, borderRadius: BorderRadius.all(Radius.circular(radius))),
child: TextStyle(color: textColor, fontSize: fontSize).centerText(text)));
}