Medium.fromJson constructor

Medium.fromJson(
  1. dynamic json
)

Creates a medium from platform channel protocol.

Implementation

Medium.fromJson(dynamic json)
    : id = json["id"],
      filename = json["filename"],
      title = json["title"],
      mediumType = jsonToMediumType(json["mediumType"]),
      width = json["width"],
      height = json["height"],
      size = json["size"],
      orientation = json["orientation"],
      mimeType = json["mimeType"],
      duration = json['duration'] ?? 0,
      creationDate = json['creationDate'] != null
          ? DateTime.fromMillisecondsSinceEpoch(json['creationDate'])
          : null,
      modifiedDate = json['modifiedDate'] != null
          ? DateTime.fromMillisecondsSinceEpoch(json['modifiedDate'])
          : null;