Husna
Husna

Reputation: 1386

How to retrieve multiple values from a JSON object

I'm working on a mobile application using Flutter.

I'm new to JSON. How do I retrieve multiple values from a JSON object?

body: new Column(
  children: <Widget>[
   new ListTile(
    title: new Text("$(_jsondata['name'])"),// json object calling
   ), 
  ]
 );

) got the values but now i want to call multiple values like desc, url, id other fields. I tried $(_jsondata['name']['desc']) but unable to achieve.

Upvotes: 0

Views: 1136

Answers (1)

Raouf Rahiche
Raouf Rahiche

Reputation: 31376

your _jsondata is Map is String and dynamic to get the value of the field use it's name like this _jsondata['name'] and do the same for other fields _jsondata['url']

  • consider reading this article from the documentation demonstrate how deserialization works in flutter

Upvotes: 2

Related Questions