You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm currently trying to use your package in a project and get this error: Unhandled Exception: type 'String' is not a subtype of type 'int?'
My code:
staticFuture<List<JikanAnimeDetails?>> get() async {
Jikan j =Jikan();
List<JikanAnimeDetails?> jikanArray = [];
List dataArray =awaitJikanWrapper.getTop();
Future.forEach<dynamic>(dataArray, (element) async {
if (element !=null) {
JikanResult<JikanAnimeDetails?> result =await j.getAnime(animeId: element["mal_id"]);
if (result.hasData) jikanArray.add(result.response);
}
});
return jikanArray;
}
My guess from the stacktrace is that the error would be that the deserialization to the JikanError is the issue.
From the message I would guess maybe the error code is a string instead of an int, but that feels somewhat wrong.
Oddly enough a hot reload seems to somehow fix it (but only temporary), so maybe my code is broken.
EDIT: I just tried if with a regular for inloop,same result, here a hot restart doesn't fix anything.
The text was updated successfully, but these errors were encountered:
@xamantra Thanks a lot, it seems to work really well. I tried to simply say it's of type String, which sometimes worked but not always, so good that I didn't do a pull request with that "fix" of mine XD. And thank you again.
Hello, I'm currently trying to use your package in a project and get this error: Unhandled Exception: type 'String' is not a subtype of type 'int?'
My code:
Stacktrace: (Sorry for the odd formatting)
My guess from the stacktrace is that the error would be that the deserialization to the
JikanError
is the issue.From the message I would guess maybe the error code is a string instead of an int, but that feels somewhat wrong.
Oddly enough a hot reload seems to somehow fix it (but only temporary), so maybe my code is broken.
EDIT: I just tried if with a regular
for in
loop,same result, here a hot restart doesn't fix anything.The text was updated successfully, but these errors were encountered: