Skip to content

Instantly share code, notes, and snippets.

@becek2n
Created June 25, 2020 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save becek2n/4e5ad798672749eb0e17585f694fe17c to your computer and use it in GitHub Desktop.
Save becek2n/4e5ad798672749eb0e17585f694fe17c to your computer and use it in GitHub Desktop.
void response(query) async {
_textController.clear();
df.AuthGoogle authGoogle =
await df.AuthGoogle(fileJson: 'assets/credential-dialogflow.json').build();
df.Dialogflow dialogflow =
df.Dialogflow(authGoogle: authGoogle, sessionId: '123456');
df.DetectIntentResponse response = await dialogflow.detectIntentFromText(query, "id");
ChatMessage message = new ChatMessage(
text: response.queryResult.fulfillmentText,
name: 'Munaroh',
type: false,
);
setState(() {
_messages.insert(0, message);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment