Created
June 25, 2020 14:10
-
-
Save becek2n/4e5ad798672749eb0e17585f694fe17c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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