This is my JSON data:
{
"result":"0",
"school_code":"School Code",
"dashboard":{
"resultPrivilege":"0",
"privilege":[
{
"activity_id":"activity_id",
"privilege_id":"privilege_id"
}
]
}
}
I want to retrieve privilege array from this Json data.
Print privilege array on terminal.
How to retrieve JSON object of privilege array
This is my code to retrieve JSON data:
var data = json.decode(response.body);
var resultCheck = data['result'];
if (resultCheck == '0') {
var rest = data["dashboard"];
debugPrint(rest);
}
output of this code:
result check 0
I/flutter (18905): {"privilege":[
{"activity_id":165,"privilege_id":1568}
I want to output this format when i print privilege:
I/flutter (18905):[{"activity_id":165,"privilege_id":1568}]
How to get only privilege array on terminal also how to print object of privilege?.
