fromJson method

  1. @override
NotificationReason fromJson(
  1. String json
)

Implementation

@override
NotificationReason fromJson(String json) {
  try {
    final knownValue = KnownNotificationReason.valueOf(json);
    if (knownValue != null) {
      return NotificationReason.knownValue(data: knownValue);
    }

    return NotificationReason.unknown(data: json);
  } catch (_) {
    return NotificationReason.unknown(data: json);
  }
}