submitButton static method
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,
})
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,
),
),
),
],
),
),
),
);
}