parse static method

NotifyOn parse(
  1. String? value
)

Parses the on: key, defaulting to NotifyOn.always.

Implementation

static NotifyOn parse(String? value) {
  switch (value?.toLowerCase().trim()) {
    case null:
    case '':
    case 'always':
      return NotifyOn.always;
    case 'success':
      return NotifyOn.success;
    case 'failure':
      return NotifyOn.failure;
    default:
      throw ArgumentError(
        "Invalid notification 'on' value '$value'. "
        "Expected one of: always, success, failure.",
      );
  }
}