1

REST_API provides a JSON Object like this:

[
   {
      "key1":"value1"
      "key2":"value2"
   }
]

Question: How can I Parse that with Dart? I do not get it running. My main problem is that any approach with json.decode will remove all annotations so strings are no longer strings.

Sure I could cut of the square brackets at the beginning and at the end but thats not what i would call good coding.

Maybe some of you can help ;-)

Have a great day!

2

1 Answer 1

0
Var _response = JsonDecode(response.body) ; 
print(_response[0]['key1']);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.