mirror of
https://github.com/h7x4/unofficial_jisho_api_dart.git
synced 2025-09-21 04:55:56 +02:00
Fixed JishoAttribution bool value parsing
This commit is contained in:
@@ -364,7 +364,7 @@ class JishoWordSense {
|
||||
class JishoAttribution {
|
||||
bool jmdict;
|
||||
bool jmnedict;
|
||||
bool dbpedia;
|
||||
bool dbpedia; //This variable might be returned as a link (String). Not sure about the above
|
||||
|
||||
JishoAttribution({
|
||||
this.jmdict,
|
||||
@@ -373,10 +373,10 @@ class JishoAttribution {
|
||||
});
|
||||
|
||||
factory JishoAttribution.fromJson(Map<String, dynamic> json){
|
||||
return JishoAttribution( //TODO: This is broken. Find the potential values of a json result and fix
|
||||
jmdict: (json['jmdict'] == 'true'),
|
||||
jmnedict: (json['jmnedict'] == 'true'),
|
||||
dbpedia: (json['dbpedia'] == 'true')
|
||||
return JishoAttribution(
|
||||
jmdict: (json['jmdict'].toString() == 'true'),
|
||||
jmnedict: (json['jmnedict'].toString() == 'true'),
|
||||
dbpedia: (json['dbpedia'].toString() == 'true')
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user