WordData.fromJson constructor

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

Implementation

factory WordData.fromJson(Map<String, dynamic> json) {
  return WordData(
    word: json['word'],
    phonetic: json['phonetic'],
    phonetics:
        (json['phonetics'] as List)
            .map((phoneticJson) => Phonetic.fromJson(phoneticJson))
            .toList(),
    origin: json['origin'],
    meanings:
        (json['meanings'] as List)
            .map((meaningJson) => Meaning.fromJson(meaningJson))
            .toList(),
  );
}