SpeechRecognitionResult.fromJson constructor

SpeechRecognitionResult.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory SpeechRecognitionResult.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case SpeechRecognitionResultPending.CONSTRUCTOR:
      return SpeechRecognitionResultPending.fromJson(json);
    case SpeechRecognitionResultText.CONSTRUCTOR:
      return SpeechRecognitionResultText.fromJson(json);
    case SpeechRecognitionResultError.CONSTRUCTOR:
      return SpeechRecognitionResultError.fromJson(json);
    default:
      return const SpeechRecognitionResult();
  }
}