fromJson static method

LinkPreviewTypeEmbeddedAudioPlayer? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

static LinkPreviewTypeEmbeddedAudioPlayer? fromJson(
  Map<String, dynamic>? json,
) {
  if (json == null) {
    return null;
  }

  return LinkPreviewTypeEmbeddedAudioPlayer(
    url: (json['url'] as String?) ?? '',
    audio: Audio.fromJson(tdMapFromJson(json['audio'])),
    thumbnail: Photo.fromJson(tdMapFromJson(json['thumbnail'])),
    duration: (json['duration'] as int?) ?? 0,
    width: (json['width'] as int?) ?? 0,
    height: (json['height'] as int?) ?? 0,
  );
}