LanguageList.fromJson constructor

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

Implementation

factory LanguageList.fromJson(Map<String, dynamic> json) => LanguageList(
      translation: json.containsKey('translation')
          ? (json['translation'] as Map<String, dynamic>)
              .entries
              .map((e) => Language.fromJson({
                    'code': e.key,
                    ...(e.value as Map<String, dynamic>),
                  }))
              .toList()
          : null,
      transliteration: json.containsKey('transliteration')
          ? (json['transliteration'] as Map<String, dynamic>)
              .entries
              .map((e) => TranslitLanguage.fromJson({
                    'code': e.key,
                    ...(e.value as Map<String, dynamic>),
                  }))
              .toList()
          : null,
      dictionary: json.containsKey('dictionary')
          ? (json['dictionary'] as Map<String, dynamic>)
              .entries
              .map((e) => DictionaryLanguage.fromJson({
                    'code': e.key,
                    ...(e.value as Map<String, dynamic>),
                  }))
              .toList()
          : null,
    );