flutter_dialogflow 0.1.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 85

Dialogflow v1 & v2 for Flutter apps.

Dialogflow

A new Flutter package.

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 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 buttons
    - each button have text and postback

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());
  }

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[0.1.1] - TODO: 26-11-2018.

  • Fix 'AUTHORIZATION' is deprecated and added dartdoc

[0.1.0] - TODO: 25-11-2018.

  • Support Dart 2.0 and added Support for Dialogflow V2

[0.0.1] - TODO: 27-05-2018.

  • The flutter_dialogflow makes it easy to integrate dialogflow

example/README.md

example

A new Flutter project.

Getting Started

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_dialogflow: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_dialogflow/flutter_dialogflow.dart';
  
Version Uploaded Documentation Archive
0.1.1 Nov 26, 2018 Go to the documentation of flutter_dialogflow 0.1.1 Download flutter_dialogflow 0.1.1 archive
0.1.0 Nov 26, 2018 Go to the documentation of flutter_dialogflow 0.1.0 Download flutter_dialogflow 0.1.0 archive
0.0.1 May 27, 2018 Go to the documentation of flutter_dialogflow 0.0.1 Download flutter_dialogflow 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
76
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
85
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs (-10 points)

222 out of 222 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <3.0.0
flutter 0.0.0
googleapis_auth ^0.2.6 0.2.6
http ^0.11.3+16 0.11.3+17 0.12.0
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
http_parser 3.1.3
meta 1.1.6
path 1.6.2
sky_engine 0.0.99
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test