flutter_dialogflow_v2 0.1.0 copy "flutter_dialogflow_v2: ^0.1.0" to clipboard
flutter_dialogflow_v2: ^0.1.0 copied to clipboard

discontinued
outdated

Flutter package useful to integrate dialogflow v2 only

Dialogflow v2 apis for flutter applications. #

Forked from https://github.com/VictorRancesCode/flutter_dialogflow

Dialogflow

Installation #

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

Usage #

  • Dialogflow 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_v2/dialogflow.dart';
  • Code examples
  AuthGoogle authGoogle = await AuthGoogle(fileJson: 'assets/your_file.json').build();
  Dialogflow dialogflow = Dialogflow(authGoogle: authGoogle, language: Language.english);
  AIResponse response = await dialogflow.detectIntent('Hello!');
  • or if you simply want to simple query some text:
  AuthGoogle authGoogle = await AuthGoogle(fileJson: 'assets/your_file.json').build();
  Dialogflow dialogflow = Dialogflow(authGoogle: authGoogle, language: Language.english);
  AIResponse response = await dialogflow.detectIntentFromText('Hello!');
  • get text response
  response.getMessage();
  • or list of messages
  response.getListMessage();
6
likes
0
pub points
70%
popularity

Publisher

unverified uploader

Flutter package useful to integrate dialogflow v2 only

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, googleapis_auth, http

More

Packages that depend on flutter_dialogflow_v2