submitButton static method

Widget submitButton(
  1. String buttonText,
  2. Function onTap, {
  3. double height = 50,
  4. double width = 150,
  5. Color btnColor = Colors.redAccent,
  6. double borderRadius = 30,
  7. Color borderColor = Colors.redAccent,
  8. double fontSize = 16,
  9. FontWeight fontWeight = FontWeight.w600,
  10. Color txtColor = Colors.white,
  11. Widget? prefixIcon,
})

Implementation

static Widget submitButton(
  String buttonText,
  Function onTap, {
  double height = 50,
  double width = 150,
  Color btnColor = Colors.redAccent,
  double borderRadius = 30,
  Color borderColor = Colors.redAccent,
  double fontSize = 16,
  FontWeight fontWeight = FontWeight.w600,
  Color txtColor = Colors.white,
  Widget? prefixIcon,
}) {
  return Container(
    height: height,
    width: width,
    child: GestureDetector(
      onTap: () {
        onTap();
      },
      child: Container(
        decoration: BoxDecoration(
          border: Border.all(
            color: borderColor,
            style: BorderStyle.solid,
            width: 1.0,
          ),
          color: btnColor,
          borderRadius: BorderRadius.circular(borderRadius),
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            prefixIcon ?? SizedBox(),
            Center(
              child: Text(
                buttonText,
                style: TextStyle(
                  color: txtColor,
                  fontSize: fontSize,
                  fontWeight: fontWeight,
                  letterSpacing: 1,
                ),
              ),
            ),
          ],
        ),
      ),
    ),
  );
}