Now that we've created a very basic user interface for our application, we will integrate the Dialogflow agent with the application so that the text that's entered by the user is responded to in real time by the agent. Follow these steps:
- To integrate Dialogflow in the application, we will use the Flutter plugin called flutter_dialogflow.
Add the dependency to the plugin inside the pubspec.yaml file:
- Next, we need to install the dependency. This can be done either using the $ flutter pub get command-line argument or by clicking the option that appears on the screen. Here, we will use dialogflow_v2 so let's import the package inside our chat_screen.dart file: