Flutter package for makes it easy to integrate dialogflow and support dialogflow v2

Overview

Dialogflow v1 & v2 for Flutter apps.

Dialogflow

❤️ Star ❤️ the repo to support the project. Thanks!

A new Flutter package.

Awesome Tutorials

Thanks for the tutorials!

Installation

  • Add this to your package's pubspec.yaml file:
dependencies:
  flutter_dialogflow: ^0.1.0
  • You can install packages from the command line: with Flutter:
$ flutter packages get
  • Dialogflow v1 Import it Now in your Dart code, you can use:
 import 'package:flutter_dialogflow/flutter_dialogflow.dart';
  • Or Dialogflow v2 Import it Now in your Dart code, you can use:
 import 'package:flutter_dialogflow/dialogflow_v2.dart';

Usage

Dialogflow v1

  • Dialogflow register and create new Agent
  • Copy Api key (Token)
  • Code
  Dialogflow dialogflow = Dialogflow(token: "Your Token");
  AIResponse response = await dialogflow.sendQuery("Your Query");
  • Example
  void Response(query) async {
    Dialogflow dialogflow = Dialogflow(token: "10178f9cb6cf12321asdf4aae75c87cd");
    AIResponse response = await dialogflow.sendQuery(query);
    print(response.getMessageResponse());
  }

Dialogflow v2

  • Dialogflow](https://dialogflow.com/) register and create new Agent
  • Project Setup and Authentication
    • First of all, we need to create a Google Cloud Platform Project using Console Google Cloud
    • Create or select an existing GCP project.
    • From the GCP console, go to APIs and Services and click on credentials.
    • Click on Create credentials and choose Service account key.
    • Select your service account from the dropdown, choose JSON and click Create. This will download the JSON key to your computer. Save it securely.
    • We downloaded a JSON file with all our data.
  • In your project create folder assets(folder name recommended optional)
  • Move file json in your project in folder created
  • open file pubspec.yaml
flutter:
  uses-material-design: true
  assets:
    - assets/your_file_downloaded_google_cloud.json
  • Import dialogflow_v2
import 'package:flutter_dialogflow/dialogflow_v2.dart';
  • Code
  AuthGoogle authGoogle = await AuthGoogle(fileJson: "Asset Your File Json").build();
  // Select Language.ENGLISH or Language.SPANISH or others...
  Dialogflow dialogflow =Dialogflow(authGoogle: authGoogle,language: Language.ENGLISH); 
  AIResponse response = await dialogflow.detectIntent("Your Query");
  • Example
  AuthGoogle authGoogle = await AuthGoogle(fileJson: "assets/your_file_downloaded_google_cloud.json").build();
  Dialogflow dialogflow = Dialogflow(authGoogle: authGoogle,language: Language.ENGLISH);
  AIResponse response = await dialogflow.detectIntent("Hi!!!");
  print(response.getMessage())
  • Or Get List Message type Card
Call function response.getListMessage() 
response List<dynamic>
example 
new CardDialogflow(response.getListMessage()[0]).title
Convert first item in CardDialogflow for worked easy
CardDialogflow have
- title
- subtitle
- imageUri
- List buttonss
    - each button have text and postback
  • Or Setup custom authentication (session)
Get a session id from your backend server after authentication.(Eg: OAuth Token)
Pass the session id a named parameter 'sessionId' to AuthGoogle function.
On the dialogflow fulfillment, access it inside `agent.session` (WebhookClient.session)
and apply your session logic

Example:
  AuthGoogle authGoogle = await AuthGoogle(fileJson: "assets/your_file_downloaded_google_cloud.json", sessionId: "YOUR_CUSTOM_SESSION_ID").build();
  Dialogflow dialogflow = Dialogflow(authGoogle: authGoogle,language: Language.ENGLISH);
  AIResponse response = await dialogflow.detectIntent("Hi!!!");
  print(response.getMessage())

Demo

Dialogflow For Flutter Web

Visit the repository: Flutter Dialogflow Web 🚀

Comments
  • don't include both `QuickReplies.html` and `quickReplies.html`

    don't include both `QuickReplies.html` and `quickReplies.html`

    See https://github.com/dart-lang/pub/issues/2072

    In general, I would discourage checking the doc/api/ folder into source control, and I would also discourage you from having it in your folder when publishing as it gets included in the package on pub..

    The problem in this case is probably (just guessing), that you renamed quickReplies to QuickReplies (or maybe you have two types with same name, only one is lowercase) and suddenly you have two files with the same name (except one is lowercase, the other is uppercase)... Such packages won't work on Windows, since the filesystem is case insensitive (case preserving).


    Note: if you think you actually generated documentation producing both QuickReplies.html and quickReplies.html, then please make a small test-case that reproduces this and file an issue with: https://github.com/dart-lang/dartdoc

    opened by jonasfj 3
  • GoogleAuth invalid_grant

    GoogleAuth invalid_grant

    I used the firebase JSON file by mistake for another project. After it my original project throws that error when importing the dialogflow JSON file (GoogleAuth method). I tried refreshing the dialogflow service account. That generated a key I can’t download. All I can do is create a new key and import that one. The error persists.

    https://blog.timekit.io/google-oauth-invalid-grant-nightmare-and-how-to-fix-it-9f4efaf1da35

    opened by javieralcantara 1
  • http package version update

    http package version update

    http package version update.

    Because every version of aad_oauth depends on http ^0.12.0 and flutter_dialogflow >=0.1.0 depends on http ^0.11.3+16, aad_oauth is incompatible with flutter_dialogflow >=0.1.0. So, because my_mobile app depends on both flutter_dialogflow ^0.1.0 and aad_oauth ^0.1.7, version solving failed. pub get failed (1)

    opened by yugandh 1
  • Issues using flutter knowledgebase responses

    Issues using flutter knowledgebase responses

    Normal responses receiving answers with assigned intents are working correctly. However, when a response using knowledge connector is used. I receive the error:

    NoSuchMethodError (NoSuchMethodError: The method '[]' was called on null. Receiver: null Tried calling: )

    There appears to be a response returned specific for using knowledge connectors that is not being handled correctly.

    opened by vetbabble 0
  • intentDetectionConfidence is null

    intentDetectionConfidence is null

    intentDetectionConfidence is coming inside query set in dialogflow v2.0 but in your code you reading intentDetectionConfidence as response.body['intentDetectionConfidence'] but you should read as response.body['queryResult']['intentDetectionConfidence'] or add intentDetectionConfidence in queryResult class. Please make the update in package and push it

    opened by pravindia 1
  • Outdated package and a solution (DialogFlowtter)

    Outdated package and a solution (DialogFlowtter)

    Hi everyone.

    As all of us know, this package seems to be outdated and abandoned by its author. Since I was using it and noticed some areas of opportunity and, most importantly, the chance to get a package that is always updated, I created another package called DialogFlowtter. This package aims to solve the problems that this one has and to be maintained a lot of time, even donate it to the community.

    Feel free to check it out here: https://pub.dev/packages/dialog_flowtter/ Leave your feedback and issues in the Github Repo

    I hope the package can help you with your development journey.

    opened by ElZombieIsra 0
  • AuthGoogle(fileJson)

    AuthGoogle(fileJson)

    Hi Is it possible for me to use a Json file that is not in Assets (defined in pubspec)? I would like to read a dynamic Json file. Ex: await AuthGoogle (fileJson: url)

    Thank you Luciano

    opened by lnsiqueira 1
  • How to respond or utilize

    How to respond or utilize "Parameters and Value" of Dialogflow in Flutter?

    Hi,

    During a conversation in Flutter I am unable to a respond based on "Parameters and Values" of Dialogflow.

    For example, if customer is using "city name" I have to respond it and tell him "current-Time" in that "City".

    Thanks a lot.

    opened by Umang32 0
Owner
Victor Alfonso Rodas Oña
Victor Alfonso Rodas Oña
A Flutter Plugin for Requesting and Writing Reviews for the App Store and Google Play.

app_review Description Flutter Plugin for Requesting and Writing Reviews in Google Play and the App Store. Apps have to be published for the app to be

Rody Davis 37 Oct 10, 2022
Google places picker plugin for flutter. Opens up the google places picker on ios and android returning the chosen place back to the flutter app.

flutter_places_dialog Shows a places picker dialog in ios and android, returning the data in the places picker to the app. Getting Started Generate yo

null 44 Dec 6, 2022
Liquidart is a Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider. Revival of the abandoned AQUEDUCT project.

Liquidart is a modern Dart HTTP server framework. The framework is composed of libraries for handling and routing HTTP requests, object-relational map

Aldrin's Art Factory 35 Dec 27, 2022
Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider.

Aqueduct is a modern Dart HTTP server framework. The framework is composed of libraries for handling and routing HTTP requests, object-relational mapp

Abdelrahman Saed 2 Jul 7, 2021
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal

OneSignal Flutter SDK OneSignal is a free push notification service for mobile apps. This SDK makes it easy to integrate your Flutter iOS and/or Andro

OneSignal 563 Jan 1, 2023
The flutter_ibm_watson makes it easy to integrate IBM Watson

Flutter Ibm Watson Installation Add this to your package's pubspec.yaml file: dependencies: flutter_ibm_watson: ^0.0.1 You can install packages fro

Victor Alfonso Rodas Oña 27 Nov 4, 2022
Flutter: Integrate Google Maps Tutorial Flutter: Integrate Google Maps Tutorial

Flutter Google Maps APP Show some ❤️ and star the repo to support the project A new Flutter project. Getting Started Flutter Project Add this to your

Pawan Kumar 69 Oct 27, 2022
Dialog flowtter-master - A Flutter implementation of DialogFlow, improved

A Flutter implementation of DialogFlow, improved. Build your integrations with D

null 0 Jan 3, 2022
A Flutter package that makes it easy to customize and work with your Flutter desktop app's system tray.

system_tray A Flutter package that that enables support for system tray menu for desktop flutter apps. on Windows, macOS and Linux. Features: - Modify

AnTler 140 Dec 30, 2022
A Flutter package that makes it easy to customize and work with your Flutter desktop app window.

bitsdojo_window A Flutter package that makes it easy to customize and work with your Flutter desktop app window on Windows, macOS and Linux. Watch the

Bits Dojo 606 Dec 27, 2022
A Flutter package that makes it easy to customize and work with your Flutter desktop app window.

bitsdojo_window A Flutter package that makes it easy to customize and work with your Flutter desktop app window on Windows, macOS and Linux. Watch the

Bits Dojo 607 Jan 4, 2023
A Flutter package that makes it easy to customize and work with your Flutter desktop app's system tray.

system_tray A Flutter package that that enables support for system tray menu for desktop flutter apps. on Windows, macOS and Linux. Features: - Modify

AnTler 140 Dec 30, 2022
A Flutter package that makes navigation and routing easy.

A Flutter package that makes navigation and routing easy.

null 197 Jan 5, 2023
A simple Flutter package that makes turning a FAB into a text field easy.

flutter_text_field_fab A simple Flutter widget that makes turning a FAB into a text field easy.

Haefele Software 4 Jan 18, 2022
A flutter package which makes it easy to track a series of images.

A flutter package which makes it easy to track a series of images.

Jaehee Kim 2 Oct 7, 2022
🙌🏾 This package makes it easy to use the Mono connect widget in a flutter project

Flutter Mono ** This is an unofficial SDK for flutter This package makes it easy to use the Mono connect widget in a flutter project. ?? Screen Shots

Chiziaruhoma Ogbonda 12 Dec 20, 2022
Dart package to which makes data communication easy among different modules of your application.

LiveStream - Dart LiveStream is a data holder class which can observe change of data in real-time and emit values too. Here's emitter subscriber patte

Shreyas Patil 75 Sep 28, 2022
flutter_thrio makes it easy and fast to add flutter to existing mobile applications, and provide a simple and consistent navigator APIs.

中文文档 英文文档 问题集 原仓库不再维护,代码已经很老了 最近版本更新会很快,主要是增加新特性,涉及到混合栈的稳定性的问题应该不多,可放心升级,发现问题加 QQ 群号码:1014085473,我会尽快解决。 不打算好好看看源码的使用者可以放弃这个库了,因为很多设定是比较死的,而我本人不打算花时间写

null 290 Dec 29, 2022
flutter_thrio makes it easy and fast to add flutter to existing mobile applications, and provide a simple and consistent navigator APIs.

本仓库不再维护,可移步新仓库 https://github.com/flutter-thrio/flutter_thrio 中文文档 问题集 QQ 群号码:1014085473 The Navigator for iOS, Android, Flutter. Version 0.2.2 requir

Hellobike 732 Dec 5, 2022
Let's Encrypt support for the shelf package (free and automatic HTTPS certificate support).

shelf_letsencrypt shelf_letsencrypt brings support for Let's Encrypt to the shelf package. Usage To use the LetsEncrypt class import 'dart:io'; impor

Graciliano Monteiro Passos 8 Oct 31, 2022