pShowToast function

void pShowToast({
  1. required String message,
  2. Color? colorText,
  3. Color? backgroundColor,
  4. Color? errorBackgroundColor,
  5. bool isError = false,
  6. ToastGravity? toastGravity,
  7. Toast? toastLength,
})

Implementation

void pShowToast(
    {required String message,
      Color? colorText,
      Color? backgroundColor,
      Color? errorBackgroundColor,
      bool isError = false,
      ToastGravity? toastGravity,
      Toast? toastLength}) {
  Fluttertoast.showToast(
    msg: message,
    toastLength: toastLength ?? Static.toastLength??Toast.LENGTH_SHORT,
    gravity: toastGravity ?? Static.toastGravity??ToastGravity.CENTER,
    backgroundColor: isError
        ? ((errorBackgroundColor ?? Colors.red))
        : (backgroundColor ?? Static.toastBackgroundColor?? Clr.colorPrimary),
    textColor: colorText??Static.toastTextColor??Colors.white,
    fontSize: 16.0,
  );
}