I want to extract the child value of queryResult ie. "Hello there. I am chat bot So shall we get started?" from the JSON using flutter
final responseJson = json.decode(response.body);
print("DATA \n ${responseJson['queryResult']}");
JSON DATA ===>
{
"responseId":"123456789",
"queryResult":{
"queryText":"Hello",
"action":"input.welcome",
"parameters":{
},
"allRequiredParamsPresent":true,
"fulfillmentText":"Greetings! How can I assist?",
"fulfillmentMessages":[
{
"text":{
"text":[
"Hello there. I am chat bot So shall we get started?"
]
}
},
{
"quickReplies":{
"quickReplies":[
"Yes",
"No"
]
}
}
],
"outputContexts":[
{
"name":"xyz",
"lifespanCount":5
}
],
"intent":{
"name":"xyz",
"displayName":"Default Welcome Intent"
},
"intentDetectionConfidence":1,
"diagnosticInfo":{
"webhook_latency_ms":5
},
"languageCode":"en"
},
"webhookStatus":{
"message":"Webhook execution successful"
}
}
I am unable to read the child data of queryResult using
final responseJson = json.decode(response.body);
print("DATA \n ${responseJson['queryResult']}");