Unhandled Exception: FormatException: Unexpected character (at character 1) Flutter

Viewed 658

I'm having a trouble why I'm getting this error and I'm following this an old source like like.It is possible that the syntax of old version is not the same that been using now programitically? It would be great if anybody could figure out, thank you so much in advance!.

enter image description here

There are the list of error when I clicked those error in my console

json.dart

  dynamic convert(String input) => _parseJson(input, _reviver);

json.dart

    if (reviver == null) return decoder.convert(source);
    return JsonDecoder(reviver).convert(source);

main.dart

var datauser = json.decode(response.body);
1 Answers

You're first character is a <br>, so it's not a json or strong, could be a 404 error html page, which can't be parsed. Double check the URL you are pinging.

Related