Bug fixes

This commit is contained in:
Oystein Kristoffer Tveit 2021-08-10 23:59:27 +02:00
parent de9c0c80d6
commit 0941a2f4d1
3 changed files with 35 additions and 20 deletions

View File

@ -1,3 +1,7 @@
## 2.0.3
- Bug fixes
## 2.0.2 ## 2.0.2
- Fixed formatting - Fixed formatting

View File

@ -519,6 +519,14 @@ class JishoWordSource {
this.word, this.word,
}); });
// ignore: public_member_api_docs
factory JishoWordSource.fromJson(Map<String, dynamic> json) {
return JishoWordSource(
language: json['language'] as String,
word: json['word'] as String?,
);
}
// ignore: public_member_api_docs // ignore: public_member_api_docs
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
'language:': language, 'language:': language,
@ -571,25 +579,28 @@ class JishoWordSense {
// ignore: public_member_api_docs // ignore: public_member_api_docs
factory JishoWordSense.fromJson(Map<String, dynamic> json) { factory JishoWordSense.fromJson(Map<String, dynamic> json) {
return JishoWordSense( return JishoWordSense(
englishDefinitions: (json['english_definitions'] as List) englishDefinitions: (json['english_definitions'] as List)
.map((result) => result as String) .map((result) => result as String)
.toList(), .toList(),
partsOfSpeech: (json['parts_of_speech'] as List) partsOfSpeech: (json['parts_of_speech'] as List)
.map((result) => result as String) .map((result) => result as String)
.toList(), .toList(),
links: (json['links'] as List) links: (json['links'] as List)
.map((result) => JishoSenseLink.fromJson(result)) .map((result) => JishoSenseLink.fromJson(result))
.toList(), .toList(),
tags: (json['tags'] as List).map((result) => result as String).toList(), tags: (json['tags'] as List).map((result) => result as String).toList(),
seeAlso: (json['see_also'] as List) seeAlso:
.map((result) => result as String) (json['see_also'] as List).map((result) => result as String).toList(),
.toList(), antonyms:
antonyms: (json['antonyms'] as List) (json['antonyms'] as List).map((result) => result as String).toList(),
.map((result) => result as String) source: (json['source'] as List)
.toList(), .map((result) => JishoWordSource.fromJson(result))
source: json['source'] as List<JishoWordSource>, .toList(),
info: (json['info'] as List).map((result) => result as String).toList(), info: (json['info'] as List).map((result) => result as String).toList(),
restrictions: json['restrictions'] as List<String>); restrictions: (json['restrictions'] as List)
.map((result) => result as String)
.toList(),
);
} }
// ignore: public_member_api_docs // ignore: public_member_api_docs

View File

@ -1,5 +1,5 @@
name: unofficial_jisho_api 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 description: An unofficial api for searching and scraping the japanese dictionary Jisho.org
homepage: https://github.com/h7x4ABk3g/unofficial_jisho_api_dart/ homepage: https://github.com/h7x4ABk3g/unofficial_jisho_api_dart/