getJsonValueOrNull<T> function Null safety

T? getJsonValueOrNull<T>(
  1. Map<String, dynamic> json,
  2. String key
)

Implementation

T? getJsonValueOrNull<T>(
  Map<String, dynamic> json,
  String key,
) {
  if (json.containsKey(key) && json[key] != null) {
    return getJsonValue(json, key);
  } else {
    return null;
  }
}