showToast method
dynamic
showToast(
- dynamic args
showToast which parses the required arguments and pass it to addHtmlToast
Implementation
showToast(args) {
String msg = args['msg'];
String? gravity = "top";
if (args['gravity'] == "top" || args['gravity'] == "bottom") {
gravity = args["gravity"];
}
String position = args['webPosition'] ?? 'right';
String bgColor =
args['webBgColor'] ?? "linear-gradient(to right, #00b09b, #96c93d)";
int? textColor = args['textcolor'];
int time = args['time'] == null
? 3000
: (int.parse(args['time'].toString()) * 1000);
bool showClose = args['webShowClose'] ?? false;
addHtmlToast(
msg: msg,
gravity: gravity,
position: position,
bgcolor: bgColor,
showClose: showClose,
time: time,
textColor: textColor);
}