Skip to content

Commit 0941a2f

Browse files
committed
Bug fixes
1 parent de9c0c8 commit 0941a2f

File tree

3 files changed

+35
-20
lines changed

3 files changed

+35
-20
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.3
2+
3+
- Bug fixes
4+
15
## 2.0.2
26

37
- Fixed formatting

lib/src/objects.dart

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: unofficial_jisho_api
2-
version: 2.0.2
2+
version: 2.0.3
33

44
description: An unofficial api for searching and scraping the japanese dictionary Jisho.org
55
homepage: https://github.com/h7x4ABk3g/unofficial_jisho_api_dart/

0 commit comments

Comments
 (0)