Skip to content

shirsh94/flutter_dialogflow

Repository files navigation

Flutter Chatbot with Dialogflow

Overview

Welcome to the Flutter Chatbot with Dialogflow project! In this Flutter project, we'll be creating a simple chatbot using Dialogflow, a tool provided by Google. Dialogflow allows you to build chatbots without requiring extensive knowledge of machine learning or natural language processing (NLP). This README will guide you through the process of setting up your chatbot using Dialogflow and integrating it into a Flutter application.

Project Preview:

Chatbot Preview

Table of Contents

Getting Started

Dialogflow Setup

  1. Visit Dialogflow Console and sign in with your Google account.

  2. Create a new agent by clicking on "Create an agent" and provide a name, for example, "ShirshShuklaInfoBot."

  3. Note the Project ID from the settings icon.

  4. Create an intent for your chatbot. You can customize the training phrases and responses based on user inputs.

  5. Navigate to the Google Cloud Console (Google Cloud Console).

  6. Log in with the same Google account used for Dialogflow.

  7. In the Google Cloud Console, go to APIs & Services > Credentials.

  8. Create a new service account, grant it access to the "Dialogflow API Admin," and download the JSON key.

Flutter Project Setup

Dependencies

Add the Dialogflow Flutter package to your pubspec.yaml file:

dependencies:
  dialog_flowtter: any

Assets Configuration

  1. Create an assets folder in your Flutter project.

  2. Rename the JSON key file downloaded from Google Cloud Console to dialog_flow_auth.json and place it inside the assets folder.

  3. Update your pubspec.yaml to include the asset:

assets:
  - assets/dialog_flow_auth.json

Code Implementation

Implement the Flutter chat screen using the provided code in main.dart and message_view.dart. Make sure to adjust the code according to your project structure.

Usage

Run the Flutter App

Run the Flutter app on an emulator or a physical device:

flutter run

Interacting with the Chatbot

  1. Open the app and start typing messages.

  2. The chatbot will respond based on the predefined intents and responses set up in Dialogflow.

  3. Explore the code to understand how messages are sent to Dialogflow and received responses are displayed.

Contributing

If you find any issues or have suggestions for improvements, feel free to contribute. Create a pull request or open an issue on GitHub.

Contact

Acknowledgments

Special thanks to the Flutter and Dialogflow communities for their valuable contributions and support.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published