normalButton2 static method

Widget normalButton2({
  1. required Widget child,
  2. double? width,
  3. double? height,
  4. double? size,
  5. Color backgroundColor = Colors.blue,
  6. Color textColor = Colors.white,
  7. double fontSize = buttonFontSize,
  8. double radius = buttonRadius,
  9. VoidCallback? onPressed,
  10. EdgeInsetsGeometry padding = const EdgeInsets.all(8.0),
})

Implementation

static Widget normalButton2(
    {required Widget child,
    double? width,
    double? height,
    double? size,
    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(
        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),
        minimumSize: ButtonStyleButton.allOrNull<Size>(Size.zero)),
    child: SizedBox(height: size ?? height, width: size ?? width, child: child),
  );
}