parse static method

NotifyProvider parse(
  1. String? value
)

Parses the provider: key.

Implementation

static NotifyProvider parse(String? value) {
  switch (value?.toLowerCase().trim()) {
    case 'slack':
      return NotifyProvider.slack;
    case 'discord':
      return NotifyProvider.discord;
    case 'telegram':
      return NotifyProvider.telegram;
    case null:
    case '':
    case 'webhook':
      return NotifyProvider.webhook;
    default:
      throw ArgumentError(
        "Invalid notification provider '$value'. "
        "Expected one of: slack, discord, telegram, webhook.",
      );
  }
}