1Map<String, dynamic> user = jsonDecode(jsonString);
2
3print('Howdy, ${user['name']}!');
4print('We sent the verification link to ${user['email']}.');
1myJson = {
2 "label": "This is a string",
3 "value": {
4 "address": "This is a string",
5 "country": "This is a string"
6 }
7}
8
9//to access address field
10var decodedJson = json.decode(myJson);
11var jsonValue = json.decode(decodedJson['value']);
12print(jsonValue['address']);
1import 'dart:convert';
2
3main() {
4 String nestedObjText =
5 '{"title": "Dart Tutorial", "description": "Way to parse Json", "author": {"name": "bezkoder", "age": 30}}';
6
7 Tutorial tutorial = Tutorial.fromJson(jsonDecode(nestedObjText));
8
9 print(tutorial);
10