customFlatButton static method
Implementation
static Widget customFlatButton(
String title, Color bgColor, Function onPressed,
[isIconButton = false,
IconData icon = Icons.check_circle,
Color textColor = Colors.white]) {
return !isIconButton
? TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(bgColor)),
onPressed: onPressed as void Function()?,
child: Text(
title,
style: const TextStyle(color: Colors.white),
),
)
: TextButton.icon(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(bgColor)),
onPressed: onPressed as void Function()?,
icon: Icon(
icon,
color: textColor,
),
label: Text(
title,
style: TextStyle(color: textColor),
));
}