Audio.fromJson constructor

Audio.fromJson(
  1. Map<String, dynamic> json
)

Creates a new Audio object from a JSON Map.

Implementation

factory Audio.fromJson(Map<String, dynamic> json) {
  return Audio(
    fileId: json['file_id']!,
    fileUniqueId: json['file_unique_id']!,
    duration: json['duration']!,
    performer: json['performer'],
    title: json['title'],
    fileName: json['file_name'],
    mimeType: json['mime_type'],
    fileSize: json['file_size'],
    thumbnail: json['thumbnail'] != null
        ? PhotoSize.fromJson(json['thumbnail']!)
        : null,
  );
}