fromJson method Null safety

MediaData fromJson(
  1. Map json
)

Implementation

static MediaData fromJson(Map json) {
  String? type = json['type'] as String?;

  if (type == "IMAGE") {
    return ImageData.fromJson(json);
  } else {
    return VideoData.fromJson(json);
  }
}