fromMap static method

InputMessageAudio? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static InputMessageAudio? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var audio = InputFile.fromMap(_map['audio'])!;
  var album_cover_thumbnail =
      InputThumbnail.fromMap(_map['album_cover_thumbnail']);
  var duration = _map['duration']! as int;
  var title = _map['title']! as String;
  var performer = _map['performer']! as String;
  var caption = FormattedText.fromMap(_map['caption']);
  return InputMessageAudio(
    extra: extra,
    clientId: clientId,
    audio: audio,
    album_cover_thumbnail: album_cover_thumbnail,
    duration: duration,
    title: title,
    performer: performer,
    caption: caption,
  );
}