TranslationResult.fromJson constructor

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

Implementation

factory TranslationResult.fromJson(Map<String, dynamic> json) =>
    TranslationResult(
      text: json['text'],
      translations: List<Translation>.from(
          json['translations'].map((x) => Translation.fromJson(x))),
      detectedLanguage: json.containsKey('detectedLanguage')
          ? DetectedLanguage.fromJson(json['detectedLanguage'])
          : null,
    );