1//insideclass
2ClassName.fromJson(Map<String, dynamic> json) {
3 variable1 = json['variable11'];
4 variable2 = json['variable12'];
5 variable3 = json['variable13']['variable14'];
6}
7
8//uses
9//after http request or whatever
10Map<dynamic, dynamic> res = await jsonDecode(response.body.toString());
11Classname.fromJson(res);