fromJson static method

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

Implementation

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

  return DraftMessageContentVoiceNote(
    filePath: (json['file_path'] as String?) ?? '',
    duration: (json['duration'] as int?) ?? 0,
    waveform: (json['waveform'] as String?) ?? '',
    selfDestructType: MessageSelfDestructType.fromJson(
      tdMapFromJson(json['self_destruct_type']),
    ),
  );
}