Im working on a project with the OGD of the Austrian public transportation API which wants for a request just a getter with a "stopID". Also you can concatenate more than one stopID. That means if you try this link, you get a response with all data of the stopIDs:
And now here is my problem: The stopID with the number 4133 (try it on http://www.wienerlinien.at/ogd_realtime/monitor?&stopId=4133) has NULL values in the coordinates. Normally I would just do some NULL checks but there is some strange behaviour I've never seen. I've debugged to the point of the error. It's at the HTTP.get Request and says:
I/flutter (29464): ERROR: Invalid argument(s) (input): Must not be null
But how is that possible if I havent gotten the response at this point? It tries to request and breaks somewhere at building the response.
This is the request code for it (finalURl is the URL from above):
final Response response = await http.get(finalUrl);
if (response.statusCode == 200) {
final encode = jsonDecode(response.body);
}
The error happens even before the if statement and parsing the json String.
So before it gets a proper Response Object. If you ask now how I know why it happens because of the NULL types in the coordinate fields, I've tried the Request without the ID 4133 and it worked fine. If I just use the second request Link (with only the ID 4133), it throws the error.
Does anybody have an idea whats wrong there? It is definetly a problem with Dart/Flutter, did I miss something?