@@ -519,6 +519,14 @@ class JishoWordSource {
519519 this .word,
520520 });
521521
522+ // ignore: public_member_api_docs
523+ factory JishoWordSource .fromJson (Map <String , dynamic > json) {
524+ return JishoWordSource (
525+ language: json['language' ] as String ,
526+ word: json['word' ] as String ? ,
527+ );
528+ }
529+
522530 // ignore: public_member_api_docs
523531 Map <String , dynamic > toJson () => {
524532 'language:' : language,
@@ -571,25 +579,28 @@ class JishoWordSense {
571579 // ignore: public_member_api_docs
572580 factory JishoWordSense .fromJson (Map <String , dynamic > json) {
573581 return JishoWordSense (
574- englishDefinitions: (json['english_definitions' ] as List )
575- .map ((result) => result as String )
576- .toList (),
577- partsOfSpeech: (json['parts_of_speech' ] as List )
578- .map ((result) => result as String )
579- .toList (),
580- links: (json['links' ] as List )
581- .map ((result) => JishoSenseLink .fromJson (result))
582- .toList (),
583- tags: (json['tags' ] as List ).map ((result) => result as String ).toList (),
584- seeAlso: (json['see_also' ] as List )
585- .map ((result) => result as String )
586- .toList (),
587- antonyms: (json['antonyms' ] as List )
588- .map ((result) => result as String )
589- .toList (),
590- source: json['source' ] as List <JishoWordSource >,
591- info: (json['info' ] as List ).map ((result) => result as String ).toList (),
592- restrictions: json['restrictions' ] as List <String >);
582+ englishDefinitions: (json['english_definitions' ] as List )
583+ .map ((result) => result as String )
584+ .toList (),
585+ partsOfSpeech: (json['parts_of_speech' ] as List )
586+ .map ((result) => result as String )
587+ .toList (),
588+ links: (json['links' ] as List )
589+ .map ((result) => JishoSenseLink .fromJson (result))
590+ .toList (),
591+ tags: (json['tags' ] as List ).map ((result) => result as String ).toList (),
592+ seeAlso:
593+ (json['see_also' ] as List ).map ((result) => result as String ).toList (),
594+ antonyms:
595+ (json['antonyms' ] as List ).map ((result) => result as String ).toList (),
596+ source: (json['source' ] as List )
597+ .map ((result) => JishoWordSource .fromJson (result))
598+ .toList (),
599+ info: (json['info' ] as List ).map ((result) => result as String ).toList (),
600+ restrictions: (json['restrictions' ] as List )
601+ .map ((result) => result as String )
602+ .toList (),
603+ );
593604 }
594605
595606 // ignore: public_member_api_docs
0 commit comments