fromMap static method

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

Construct from Map.

Implementation

static MessageVoiceNote? 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 voice_note = VoiceNote.fromMap(_map['voice_note'])!;
  var caption = FormattedText.fromMap(_map['caption'])!;
  var is_listened = _map['is_listened']! as bool;
  return MessageVoiceNote(
    extra: extra,
    clientId: clientId,
    voice_note: voice_note,
    caption: caption,
    is_listened: is_listened,
  );
}