0

This is a very basic question which I'm sure theres an easy answer to. I have a database and a PHP server which currently pulls all data from the table (for testing purposes).

The result looks like this

[{"post_id":"1","createdon":"2018-11-10","content":"This is my first post"},{"post_id":"2","createdon":"2018-11-10","content":"This is my second post"}]

How would I in Flutter take the content of post_id[1], and load it into my array[0], and same with post_id[2] into my array[1]?

5
  • so is it basically breaking apart the json string. sorry completely new to development, and just getting my head round everything Commented Nov 12, 2018 at 12:58
  • yup found a good link. stackoverflow.com/questions/50706500/…. I just needed to import dart.convert Commented Nov 12, 2018 at 13:01
  • Solution found at stackoverflow.com/questions/50706500/… Commented Nov 12, 2018 at 13:01
  • yes i am aware of flutter.io. but I found my answer. I will take a look at the documentation also Commented Nov 12, 2018 at 13:05
  • flutter.io/docs/development/data-and-backend/json Commented Nov 12, 2018 at 13:10

0

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.