Translation.fromXmlElement constructor

Translation.fromXmlElement(
  1. XmlElement data
)

Implementation

factory Translation.fromXmlElement(XmlElement data) {
  final aux = data.getElement(ApiXmlElement.transLang.name)?.innerText.trim();
  final language = aux == null ? null : TranslationLanguage.fromHangul(aux);
  final word =
      data.getElement(ApiXmlElement.transWord.name)?.innerText.trim();
  final definition =
      data.getElement(ApiXmlElement.transDfn.name)?.innerText.trim();
  return Translation(
    language: language,
    word: word,
    definition: definition,
  );
}