normalButton static method
Widget
normalButton(
- String text, {
- double? width,
- double? height,
- double? size,
- AlignmentGeometry? alignment,
- Color backgroundColor = Colors.blue,
- Color textColor = Colors.white,
- double fontSize = buttonFontSize,
- double radius = buttonRadius,
- VoidCallback? onPressed,
- EdgeInsetsGeometry padding = const EdgeInsets.all(8.0),
Implementation
static Widget normalButton(String text,
{double? width,
double? height,
double? size,
AlignmentGeometry? alignment,
Color backgroundColor = Colors.blue,
Color textColor = Colors.white,
double fontSize = buttonFontSize,
double radius = buttonRadius,
VoidCallback? onPressed,
EdgeInsetsGeometry padding = const EdgeInsets.all(8.0)}) {
return ElevatedButton(
onPressed: onPressed,
style: ButtonStyle(
alignment: alignment,
backgroundColor: ButtonStyleButton.allOrNull<Color>(backgroundColor),
shape: ButtonStyleButton.allOrNull<OutlinedBorder>(RoundedRectangleBorder(borderRadius: BorderRadius.circular(radius))),
overlayColor: ButtonStyleButton.allOrNull<Color>(Colors.transparent),
elevation: ButtonStyleButton.allOrNull<double>(0),
padding: ButtonStyleButton.allOrNull<EdgeInsetsGeometry>(padding),
maximumSize: ButtonStyleButton.allOrNull<Size>(Size(size ?? width ?? double.infinity, size ?? height ?? double.infinity)),
minimumSize: ButtonStyleButton.allOrNull<Size>(Size(size ?? width ?? 0, size ?? height ?? 0))),
child: TextStyle(color: textColor, fontSize: fontSize).centerText(text),
);
}