diff --git a/CHANGELOG.md b/CHANGELOG.md index 57fe71c..e98d93c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.3 + +- Bug fixes + ## 2.0.2 - Fixed formatting diff --git a/lib/src/objects.dart b/lib/src/objects.dart index f024839..aee5ae8 100644 --- a/lib/src/objects.dart +++ b/lib/src/objects.dart @@ -519,6 +519,14 @@ class JishoWordSource { this.word, }); + // ignore: public_member_api_docs + factory JishoWordSource.fromJson(Map json) { + return JishoWordSource( + language: json['language'] as String, + word: json['word'] as String?, + ); + } + // ignore: public_member_api_docs Map toJson() => { 'language:': language, @@ -571,25 +579,28 @@ class JishoWordSense { // ignore: public_member_api_docs factory JishoWordSense.fromJson(Map json) { return JishoWordSense( - englishDefinitions: (json['english_definitions'] as List) - .map((result) => result as String) - .toList(), - partsOfSpeech: (json['parts_of_speech'] as List) - .map((result) => result as String) - .toList(), - links: (json['links'] as List) - .map((result) => JishoSenseLink.fromJson(result)) - .toList(), - tags: (json['tags'] as List).map((result) => result as String).toList(), - seeAlso: (json['see_also'] as List) - .map((result) => result as String) - .toList(), - antonyms: (json['antonyms'] as List) - .map((result) => result as String) - .toList(), - source: json['source'] as List, - info: (json['info'] as List).map((result) => result as String).toList(), - restrictions: json['restrictions'] as List); + englishDefinitions: (json['english_definitions'] as List) + .map((result) => result as String) + .toList(), + partsOfSpeech: (json['parts_of_speech'] as List) + .map((result) => result as String) + .toList(), + links: (json['links'] as List) + .map((result) => JishoSenseLink.fromJson(result)) + .toList(), + tags: (json['tags'] as List).map((result) => result as String).toList(), + seeAlso: + (json['see_also'] as List).map((result) => result as String).toList(), + antonyms: + (json['antonyms'] as List).map((result) => result as String).toList(), + source: (json['source'] as List) + .map((result) => JishoWordSource.fromJson(result)) + .toList(), + info: (json['info'] as List).map((result) => result as String).toList(), + restrictions: (json['restrictions'] as List) + .map((result) => result as String) + .toList(), + ); } // ignore: public_member_api_docs diff --git a/pubspec.yaml b/pubspec.yaml index c00e2d8..9212469 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: unofficial_jisho_api -version: 2.0.2 +version: 2.0.3 description: An unofficial api for searching and scraping the japanese dictionary Jisho.org homepage: https://github.com/h7x4ABk3g/unofficial_jisho_api_dart/