show static method

String show(
  1. String message, {
  2. ToastrType? type,
})

Quick method to show a toast with just a message (auto-detects type from message content).

Returns the toast ID.

Implementation

static String show(String message, {ToastrType? type}) {
  final toastType = type ?? _detectTypeFromMessage(message);

  switch (toastType) {
    case ToastrType.success:
      return success(message);
    case ToastrType.error:
      return error(message);
    case ToastrType.warning:
      return warning(message);
    case ToastrType.info:
      return info(message);
    case ToastrType.loading:
      return loading(message);
    case ToastrType.blank:
      return blank(message);
  }
}