YurToast function
void
YurToast({})
Implementation
void YurToast({
required String message,
InfoType toastType = InfoType.info,
Toast duration = Toast.LENGTH_SHORT,
ToastGravity gravity = ToastGravity.CENTER,
int timeInSecForIosWeb = 1,
Color? backgroundColor,
Color? textColor = Colors.white,
double fontSize = 14.0,
}) {
if (backgroundColor == null) {
switch (toastType) {
case InfoType.info:
backgroundColor = primaryRed;
break;
case InfoType.warning:
backgroundColor = secondaryYellow;
break;
case InfoType.error:
backgroundColor = primaryRed;
break;
case InfoType.success:
backgroundColor = tertiaryGreen;
break;
}
}
YurLog(name: "YurToast", message);
Fluttertoast.showToast(
msg: message,
toastLength: duration,
gravity: gravity,
timeInSecForIosWeb: timeInSecForIosWeb,
backgroundColor: backgroundColor,
textColor: textColor,
fontSize: fontSize,
);
}