fromMap static method

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

Construct from Map.

Implementation

static VoiceNote? 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 duration = _map['duration']! as int;
  var waveform = _map['waveform']! as bytes;
  var mime_type = _map['mime_type']! as String;
  var speech_recognition_result =
      SpeechRecognitionResult.fromMap(_map['speech_recognition_result']);
  var voice = File.fromMap(_map['voice'])!;
  return VoiceNote(
    extra: extra,
    clientId: clientId,
    duration: duration,
    waveform: waveform,
    mime_type: mime_type,
    speech_recognition_result: speech_recognition_result,
    voice: voice,
  );
}