├── example ├── android │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── codigopanda │ │ │ │ │ └── example │ │ │ │ │ └── MainActivity.java │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── .gitignore │ ├── settings.gradle │ ├── build.gradle │ ├── gradlew.bat │ └── gradlew ├── ios │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── flutter_export_environment.sh │ │ └── AppFrameworkInfo.plist │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── WorkspaceSettings.xcsettings │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ └── .gitignore ├── img │ ├── placeholder.png │ └── googleasistant.png ├── .gitignore ├── README.md ├── .metadata ├── example.iml ├── test │ └── widget_test.dart ├── example_android.iml ├── pubspec.yaml ├── lib │ ├── main.dart │ ├── widgets │ │ ├── basicCard.dart │ │ ├── simple_message.dart │ │ └── carouselSelect.dart │ ├── google_assistant.dart │ ├── dialogflow_v1.dart │ └── dialogflow_v2.dart └── pubspec.lock ├── demo.jpg ├── image1.png ├── dialogflow.png ├── .gitignore ├── lib ├── dialogflow_v2.dart ├── v2 │ ├── auth_google.dart │ ├── dialogflow_v2.dart │ └── message.dart ├── utils │ └── language.dart └── flutter_dialogflow.dart ├── test └── flutter_dialogflow_test.dart ├── CHANGELOG.md ├── pubspec.yaml ├── flutter_dialogflow.iml ├── README.md ├── pubspec.lock └── LICENSE /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/demo.jpg -------------------------------------------------------------------------------- /image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/image1.png -------------------------------------------------------------------------------- /dialogflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/dialogflow.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .dart_tool/ 4 | .idea 5 | .idea/ 6 | .packages 7 | .pub/ 8 | packages 9 | -------------------------------------------------------------------------------- /example/img/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/img/placeholder.png -------------------------------------------------------------------------------- /example/img/googleasistant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/img/googleasistant.png -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /lib/dialogflow_v2.dart: -------------------------------------------------------------------------------- 1 | library flutter_dialogflow; 2 | 3 | export 'v2/auth_google.dart'; 4 | export 'v2/dialogflow_v2.dart'; 5 | export 'utils/language.dart'; 6 | export 'v2/message.dart'; -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .dart_tool/ 4 | .idea 5 | .vscode/ 6 | .packages 7 | .pub/ 8 | build/ 9 | ios/.generated/ 10 | packages 11 | .flutter-plugins 12 | assets/ -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online 8 | [documentation](https://flutter.io/). 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VictorRancesCode/flutter_dialogflow/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: b397406561f5e7a9c94e28f58d9e49fca0dd58b7 8 | channel: beta 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /test/flutter_dialogflow_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:test/test.dart'; 2 | 3 | import 'package:flutter_dialogflow/flutter_dialogflow.dart'; 4 | 5 | void main() { 6 | test('Test Dialogflow', () async { 7 | Dialogflow dialogflow = 8 | Dialogflow(token: "Your Token"); 9 | AIResponse response = await dialogflow.sendQuery("hello world"); 10 | if (response.getStatus.getCode != 200) 11 | expect(false, throwsNoSuchMethodError); 12 | }); 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.1.3] - TODO: 27-03-2019. 2 | 3 | * Upgrade dependencies and added example 4 | 5 | ## [0.1.2] - TODO: 27-03-2019. 6 | 7 | * Fix delete dartdoc 8 | 9 | ## [0.1.1] - TODO: 26-11-2018. 10 | 11 | * Fix 'AUTHORIZATION' is deprecated and added dartdoc 12 | 13 | ## [0.1.0] - TODO: 25-11-2018. 14 | 15 | * Support Dart 2.0 and added Support for Dialogflow V2 16 | 17 | 18 | ## [0.0.1] - TODO: 27-05-2018. 19 | 20 | * The flutter_dialogflow makes it easy to integrate dialogflow 21 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/codigopanda/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.codigopanda.example; 2 | 3 | import android.os.Bundle; 4 | 5 | import io.flutter.app.FlutterActivity; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | GeneratedPluginRegistrant.registerWith(this); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_dialogflow 2 | description: Flutter package for makes it easy to integrate dialogflow and support dialogflow v2 3 | version: 0.1.3 4 | author: Victor Alfonso Rodas Oña 5 | homepage: https://github.com/VictorRancesCode/flutter_dialogflow 6 | 7 | dependencies: 8 | flutter: 9 | sdk: flutter 10 | http: ^0.12.0+2 11 | googleapis_auth: ^0.2.6 12 | 13 | dev_dependencies: 14 | test: 15 | flutter_test: 16 | sdk: flutter 17 | 18 | flutter: 19 | 20 | environment: 21 | sdk: '>=1.20.1 <3.0.0' 22 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=/Users/rances/development/flutter" 4 | export "FLUTTER_APPLICATION_PATH=/Users/rances/Repositorio/MyProjects/flutter_dialogflow/example" 5 | export "FLUTTER_TARGET=/Users/rances/Repositorio/MyProjects/flutter_dialogflow/example/lib/main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build/ios" 8 | export "FLUTTER_FRAMEWORK_DIR=/Users/rances/development/flutter/bin/cache/artifacts/engine/ios" 9 | -------------------------------------------------------------------------------- /example/example.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.1.2' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | *.pbxuser 16 | *.mode1v3 17 | *.mode2v3 18 | *.perspectivev3 19 | 20 | !default.pbxuser 21 | !default.mode1v3 22 | !default.mode2v3 23 | !default.perspectivev3 24 | 25 | xcuserdata 26 | 27 | *.moved-aside 28 | 29 | *.pyc 30 | *sync/ 31 | Icon? 32 | .tags* 33 | 34 | /Flutter/app.flx 35 | /Flutter/app.zip 36 | /Flutter/flutter_assets/ 37 | /Flutter/App.framework 38 | /Flutter/Flutter.framework 39 | /Flutter/Generated.xcconfig 40 | /ServiceDefinitions.json 41 | 42 | Pods/ 43 | -------------------------------------------------------------------------------- /flutter_dialogflow.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | UIRequiredDeviceCapabilities 24 | 25 | arm64 26 | 27 | MinimumOSVersion 28 | 8.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter 3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to 4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties 5 | // are correct. 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | import 'package:example/main.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(new MyApp()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /example/example_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | arm64 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | 17 | android { 18 | compileSdkVersion 28 19 | 20 | lintOptions { 21 | disable 'InvalidPackage' 22 | } 23 | 24 | defaultConfig { 25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 26 | applicationId "com.codigopanda.example" 27 | minSdkVersion 16 28 | targetSdkVersion 28 29 | versionCode 1 30 | versionName "1.0" 31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 32 | } 33 | 34 | buildTypes { 35 | release { 36 | // TODO: Add your own signing config for the release build. 37 | // Signing with the debug keys for now, so `flutter run --release` works. 38 | signingConfig signingConfigs.debug 39 | } 40 | } 41 | } 42 | 43 | flutter { 44 | source '../..' 45 | } 46 | 47 | dependencies { 48 | testImplementation 'junit:junit:4.12' 49 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 51 | } 52 | -------------------------------------------------------------------------------- /lib/v2/auth_google.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/services.dart'; 4 | import 'package:googleapis_auth/auth_io.dart'; 5 | import 'package:http/http.dart'; 6 | import 'package:meta/meta.dart'; 7 | import 'package:http/http.dart' as http; 8 | 9 | class AuthGoogle { 10 | final String fileJson; 11 | final List scope; 12 | final String sessionId; 13 | AuthGoogle({@required this.fileJson,this.scope=const ["https://www.googleapis.com/auth/cloud-platform"],this.sessionId="123"}); 14 | 15 | 16 | String _projectId; 17 | AccessCredentials _credentials; 18 | 19 | 20 | Future getReadJson() async { 21 | String data = await rootBundle.loadString(this.fileJson); 22 | return data; 23 | } 24 | 25 | Future build() async { 26 | String readJson = await getReadJson(); 27 | Map jsonData = json.decode(readJson); 28 | var _credentialsResponse = new ServiceAccountCredentials.fromJson(readJson); 29 | var data = await clientViaServiceAccount(_credentialsResponse, this.scope); 30 | _projectId = jsonData['project_id']; 31 | _credentials = data.credentials; 32 | return this; 33 | } 34 | 35 | bool get hasExpired{ 36 | return _credentials.accessToken.hasExpired; 37 | } 38 | 39 | String get getSessionId{ 40 | return sessionId; 41 | } 42 | String get getProjectId{ 43 | return _projectId; 44 | } 45 | 46 | String get getToken{ 47 | return _credentials.accessToken.data; 48 | } 49 | 50 | Future post(url, {Map headers, body, 51 | Encoding encoding}) async{ 52 | if (!hasExpired) { 53 | return await http.post(url, headers: headers, body:body); 54 | } else { 55 | await build(); 56 | return await http.post(url, headers: headers, body:body); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | 4 | dependencies: 5 | flutter: 6 | sdk: flutter 7 | flutter_dialogflow: 8 | path: ../ 9 | # The following adds the Cupertino Icons font to your application. 10 | # Use with the CupertinoIcons class for iOS style icons. 11 | cupertino_icons: ^0.1.0 12 | 13 | dev_dependencies: 14 | flutter_test: 15 | sdk: flutter 16 | 17 | 18 | # For information on the generic Dart part of this file, see the 19 | # following page: https://www.dartlang.org/tools/pub/pubspec 20 | 21 | # The following section is specific to Flutter. 22 | flutter: 23 | 24 | # The following line ensures that the Material Icons font is 25 | # included with your application, so that you can use the icons in 26 | # the material Icons class. 27 | uses-material-design: true 28 | 29 | # To add assets to your application, add an assets section, like this: 30 | assets: 31 | - img/placeholder.png 32 | - img/googleasistant.png 33 | # - images/a_dot_ham.jpeg 34 | 35 | # An image asset can refer to one or more resolution-specific "variants", see 36 | # https://flutter.io/assets-and-images/#resolution-aware. 37 | 38 | # For details regarding adding assets from package dependencies, see 39 | # https://flutter.io/assets-and-images/#from-packages 40 | 41 | # To add custom fonts to your application, add a fonts section here, 42 | # in this "flutter" section. Each entry in this list should have a 43 | # "family" key with the font family name, and a "fonts" key with a 44 | # list giving the asset and other descriptors for the font. For 45 | # example: 46 | # fonts: 47 | # - family: Schyler 48 | # fonts: 49 | # - asset: fonts/Schyler-Regular.ttf 50 | # - asset: fonts/Schyler-Italic.ttf 51 | # style: italic 52 | # - family: Trajan Pro 53 | # fonts: 54 | # - asset: fonts/TrajanPro.ttf 55 | # - asset: fonts/TrajanPro_Bold.ttf 56 | # weight: 700 57 | # 58 | # For details regarding fonts from package dependencies, 59 | # see https://flutter.io/custom-fonts/#from-packages 60 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:example/dialogflow_v1.dart'; 2 | import 'package:example/dialogflow_v2.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | import 'google_assistant.dart'; 6 | 7 | void main() => runApp(new MyApp()); 8 | 9 | class MyApp extends StatelessWidget { 10 | @override 11 | Widget build(BuildContext context) { 12 | return new MaterialApp( 13 | title: 'Example Dialogflow Flutter', 14 | theme: new ThemeData( 15 | primarySwatch: Colors.deepOrange, 16 | ), 17 | home: new MyHomePage(title: 'Flutter Demo Dialogflow'), 18 | ); 19 | } 20 | } 21 | 22 | class MyHomePage extends StatefulWidget { 23 | MyHomePage({Key key, this.title}) : super(key: key); 24 | 25 | final String title; 26 | 27 | @override 28 | _MyHomePageState createState() => new _MyHomePageState(); 29 | } 30 | 31 | class _MyHomePageState extends State { 32 | @override 33 | Widget build(BuildContext context) { 34 | return new Scaffold( 35 | appBar: new AppBar( 36 | title: new Text(widget.title), 37 | ), 38 | body: new Column(children: [ 39 | new Container( 40 | margin: EdgeInsets.all(10.0), 41 | child: new RaisedButton( 42 | onPressed: () { 43 | Navigator.push( 44 | context, 45 | MaterialPageRoute(builder: (context) => PageDialogflowV1()), 46 | ); 47 | }, 48 | child: Text("Dialogflow v1"), 49 | ), 50 | ), 51 | new Container( 52 | margin: EdgeInsets.all(10.0), 53 | child: new RaisedButton( 54 | onPressed: () { 55 | Navigator.push( 56 | context, 57 | MaterialPageRoute(builder: (context) => HomePageDialogflowV2()), 58 | ); 59 | }, 60 | child: Text("Dialogflow v2"), 61 | ), 62 | ), 63 | new Container( 64 | margin: EdgeInsets.all(10.0), 65 | child: new RaisedButton( 66 | onPressed: () { 67 | Navigator.push( 68 | context, 69 | MaterialPageRoute(builder: (context) => GoogleAssistant()), 70 | ); 71 | }, 72 | child: Text("GoogleAssistant"), 73 | ), 74 | ) 75 | ]), 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /example/lib/widgets/basicCard.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | import 'package:flutter_dialogflow/v2/message.dart'; 4 | 5 | class BasicCardWidget extends StatelessWidget { 6 | BasicCardWidget({this.card}); 7 | 8 | final BasicCardDialogflow card; 9 | 10 | List generateButton() { 11 | List buttons = []; 12 | 13 | for (var i = 0; i < this.card.buttons.length; i++) { 14 | buttons.add(new SizedBox( 15 | width: double.infinity, 16 | child: new RaisedButton( 17 | onPressed: () {}, 18 | color: Colors.green, 19 | textColor: Colors.white, 20 | child: Text(this.card.buttons[i]['title']), 21 | ))); 22 | } 23 | return buttons; 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return ClipRRect( 29 | borderRadius: BorderRadius.all(Radius.circular(20.0)), 30 | child: new Container( 31 | decoration: BoxDecoration( 32 | borderRadius: BorderRadius.all(Radius.circular(20.0)), 33 | color: Colors.white), 34 | child: new Column( 35 | crossAxisAlignment: CrossAxisAlignment.start, 36 | children: [ 37 | new Container( 38 | child: Image.network(this.card.image.imageUri), 39 | ), 40 | new Padding( 41 | padding: EdgeInsets.all(10.0), 42 | child: Column( 43 | crossAxisAlignment: CrossAxisAlignment.start, 44 | children: [ 45 | new Text( 46 | this.card.title, 47 | style: 48 | TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), 49 | ), 50 | new Text( 51 | this.card.subtitle, 52 | style: TextStyle(color: Colors.black.withOpacity(0.6)), 53 | ), 54 | new Container( 55 | margin: const EdgeInsets.only(top: 5.0), 56 | child: new Text(this.card.formattedText), 57 | ), 58 | ], 59 | ), 60 | ), 61 | new Container( 62 | child: new Column( 63 | children: generateButton(), 64 | ), 65 | ), 66 | ], 67 | ), 68 | ), 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/lib/widgets/simple_message.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | 4 | class SimpleMessage extends StatelessWidget { 5 | SimpleMessage({this.text, this.name, this.type}); 6 | 7 | final String text; 8 | final String name; 9 | final bool type; 10 | 11 | List otherMessage(context) { 12 | return [ 13 | new Container( 14 | margin: const EdgeInsets.only(right: 16.0), 15 | child: new CircleAvatar( 16 | child: new Image.asset("img/googleasistant.png"), 17 | backgroundColor: Colors.transparent, 18 | ), 19 | ), 20 | new Expanded( 21 | child: new Column( 22 | crossAxisAlignment: CrossAxisAlignment.start, 23 | children: [ 24 | new Container( 25 | margin: const EdgeInsets.only(top: 5.0), 26 | decoration: BoxDecoration( 27 | color: Colors.white, 28 | borderRadius: BorderRadius.all(Radius.circular(20.0))), 29 | child: Padding( 30 | padding: EdgeInsets.only( 31 | top: 10.0, bottom: 10.0, left: 10.0, right: 10.0), 32 | child: new Text(text, style: TextStyle(color: Colors.black),), 33 | ), 34 | ), 35 | ], 36 | ), 37 | ), 38 | ]; 39 | } 40 | 41 | List myMessage(context) { 42 | return [ 43 | new Expanded( 44 | child: new Column( 45 | crossAxisAlignment: CrossAxisAlignment.end, 46 | children: [ 47 | new Container( 48 | margin: const EdgeInsets.only(top: 5.0), 49 | decoration: BoxDecoration( 50 | color: Colors.blue, 51 | borderRadius: BorderRadius.all(Radius.circular(20.0))), 52 | child: Padding( 53 | padding: EdgeInsets.only( 54 | top: 10.0, bottom: 10.0, left: 10.0, right: 10.0), 55 | child: new Text(text, style: TextStyle(color: Colors.white),), 56 | ), 57 | ), 58 | ], 59 | ), 60 | ), 61 | new Container( 62 | margin: const EdgeInsets.only(left: 16.0), 63 | child: new CircleAvatar(child: new Text(this.name[0])), 64 | ), 65 | ]; 66 | } 67 | 68 | @override 69 | Widget build(BuildContext context) { 70 | return new Container( 71 | margin: const EdgeInsets.symmetric(vertical: 10.0), 72 | child: new Row( 73 | crossAxisAlignment: CrossAxisAlignment.start, 74 | children: this.type ? myMessage(context) : otherMessage(context), 75 | ), 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /example/lib/widgets/carouselSelect.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | import 'package:flutter_dialogflow/v2/message.dart'; 4 | 5 | 6 | class ItemCarouselWidget extends StatefulWidget { 7 | final ItemCarousel item; 8 | final Function clickItem; 9 | ItemCarouselWidget({Key key,this.item, this.clickItem}) : super(key: key); 10 | 11 | @override 12 | _ItemCarouselWidget createState() => _ItemCarouselWidget(); 13 | } 14 | class _ItemCarouselWidget extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | // TODO: implement build 18 | return InkWell( 19 | onTap: () { 20 | widget.clickItem(widget.item.info); 21 | }, 22 | child: ClipRRect( 23 | borderRadius: BorderRadius.all(Radius.circular(20.0)), 24 | child: new Container( 25 | margin: EdgeInsets.all(10.0), 26 | width: 300.0, 27 | height: 350.0, 28 | decoration: BoxDecoration( 29 | border: Border.all(color: Colors.black26), 30 | borderRadius: BorderRadius.all(Radius.circular(20.0)), 31 | color: Colors.white), 32 | child: new Column( 33 | crossAxisAlignment: CrossAxisAlignment.start, 34 | children: [ 35 | Container( 36 | decoration: new BoxDecoration( 37 | image: new DecorationImage( 38 | image: new NetworkImage(widget.item.image.imageUri), 39 | fit: BoxFit.cover, 40 | ), 41 | borderRadius: BorderRadius.only( 42 | topLeft: Radius.circular(20.0), 43 | topRight: Radius.circular(20.0))), 44 | child: null, 45 | height: 200.0, 46 | ), 47 | new Padding( 48 | padding: EdgeInsets.all(10.0), 49 | child: Column( 50 | crossAxisAlignment: CrossAxisAlignment.start, 51 | children: [ 52 | new Text( 53 | widget.item.title, 54 | style: TextStyle( 55 | fontSize: 20.0, fontWeight: FontWeight.bold), 56 | ), 57 | new Container( 58 | margin: const EdgeInsets.only(top: 5.0), 59 | child: new Text(widget.item.description), 60 | ), 61 | ], 62 | ), 63 | ), 64 | ], 65 | ), 66 | ), 67 | )); 68 | } 69 | } 70 | 71 | class CarouselSelectWidget extends StatefulWidget { 72 | CarouselSelectWidget({this.carouselSelect, this.clickItem}); 73 | 74 | final Function clickItem; 75 | final CarouselSelect carouselSelect; 76 | 77 | @override 78 | _CarouselSelectWidget createState() => _CarouselSelectWidget(); 79 | } 80 | 81 | 82 | class _CarouselSelectWidget extends State { 83 | List listItems() { 84 | List items = []; 85 | 86 | for (var i = 0; i < widget.carouselSelect.items.length; i++) { 87 | items.add(new ItemCarouselWidget( 88 | item: widget.carouselSelect.items[i], clickItem: widget.clickItem)); 89 | } 90 | return items; 91 | } 92 | @override 93 | Widget build(BuildContext context) { 94 | return new Container( 95 | child: new SingleChildScrollView( 96 | scrollDirection: Axis.horizontal, 97 | child: Row(children: listItems()), 98 | ), 99 | ); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /lib/v2/dialogflow_v2.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | import 'package:flutter_dialogflow/v2/auth_google.dart'; 4 | import 'package:meta/meta.dart'; 5 | 6 | class Intent { 7 | String name; 8 | String displayName; 9 | 10 | Intent(Map data) { 11 | name = data["name"]; 12 | displayName = data["displayName"]; 13 | } 14 | } 15 | 16 | class QueryResult { 17 | String queryText; 18 | String action; 19 | Map parameters; 20 | bool allRequiredParamsPresent; 21 | String fulfillmentText; 22 | List fulfillmentMessages; 23 | Intent intent; 24 | 25 | QueryResult(Map data) { 26 | queryText = data["queryText"]; 27 | action = data["action"]; 28 | parameters = data["parameters"] ?? null; 29 | allRequiredParamsPresent = data["allRequiredParamsPresent"]; 30 | fulfillmentText = data["fulfillmentText"]; 31 | intent = data['intent'] != null ? new Intent(data['intent']) : null; 32 | 33 | fulfillmentMessages = data['fulfillmentMessages']; 34 | } 35 | } 36 | 37 | class DiagnosticInfo { 38 | String webhookLatencyMs; 39 | 40 | DiagnosticInfo(Map response) { 41 | webhookLatencyMs = response["webhook_latency_ms"]; 42 | } 43 | } 44 | 45 | class WebhookStatus { 46 | String message; 47 | 48 | WebhookStatus(Map response) { 49 | message = response['message']; 50 | } 51 | } 52 | 53 | class AIResponse { 54 | String _responseId; 55 | QueryResult _queryResult; 56 | num _intentDetectionConfidence; 57 | String _languageCode; 58 | DiagnosticInfo _diagnosticInfo; 59 | WebhookStatus _webhookStatus; 60 | 61 | AIResponse({Map body}) { 62 | _responseId = body['responseId']; 63 | _intentDetectionConfidence = body['intentDetectionConfidence']; 64 | _queryResult = new QueryResult(body['queryResult']); 65 | _languageCode = body['languageCode']; 66 | _diagnosticInfo = (body['diagnosticInfo'] != null 67 | ? new DiagnosticInfo(body['diagnosticInfo']) 68 | : null); 69 | _webhookStatus = body['webhookStatus'] != null 70 | ? new WebhookStatus(body['webhookStatus']) 71 | : null; 72 | } 73 | 74 | String get responseId { 75 | return _responseId; 76 | } 77 | 78 | String getMessage() { 79 | return _queryResult.fulfillmentText; 80 | } 81 | 82 | String getWebhookStatusMessage() { 83 | return _webhookStatus.message; 84 | } 85 | 86 | List getListMessage() { 87 | return _queryResult.fulfillmentMessages; 88 | } 89 | 90 | num get intentDetectionConfidence { 91 | return _intentDetectionConfidence; 92 | } 93 | 94 | String get languageCode { 95 | return _languageCode; 96 | } 97 | 98 | DiagnosticInfo get diagnosticInfo { 99 | return _diagnosticInfo; 100 | } 101 | 102 | WebhookStatus get webhookStatus { 103 | return _webhookStatus; 104 | } 105 | 106 | QueryResult get queryResult { 107 | return _queryResult; 108 | } 109 | } 110 | 111 | class Dialogflow { 112 | final AuthGoogle authGoogle; 113 | final String language; 114 | final String payload; 115 | final bool resetContexts; 116 | 117 | const Dialogflow({@required this.authGoogle, this.language="en", this.payload="", this.resetContexts=false}); 118 | 119 | String _getUrl() { 120 | return "https://dialogflow.googleapis.com/v2/projects/${authGoogle.getProjectId}/agent/sessions/${authGoogle.getSessionId}:detectIntent"; 121 | } 122 | 123 | 124 | Future detectIntent(String query) async { 125 | 126 | String queryParams = '{"resetContexts": ${this.resetContexts} }'; 127 | 128 | if (payload.isNotEmpty) { 129 | queryParams = '{"resetContexts": ${this.resetContexts}, "payload": $payload}'; 130 | } 131 | 132 | String body = '{"queryInput":{"text":{"text":"$query","language_code":"$language"}}, "queryParams": $queryParams}'; 133 | 134 | var response = await authGoogle.post(_getUrl(), 135 | headers: { 136 | HttpHeaders.authorizationHeader: "Bearer ${authGoogle.getToken}" 137 | }, 138 | body: body); 139 | 140 | return AIResponse(body: json.decode(response.body)); 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /lib/v2/message.dart: -------------------------------------------------------------------------------- 1 | class ListTextDialogflow { 2 | List listText = []; 3 | 4 | ListTextDialogflow(Map response) { 5 | List listText = response['text']['text']; 6 | listText.forEach((element)=> this.listText.add(element)); 7 | } 8 | } 9 | 10 | class ImageDialogflow { 11 | String imageUri; 12 | String accessibilityText; 13 | 14 | ImageDialogflow(Map response) { 15 | this.imageUri = response['imageUri']; 16 | this.accessibilityText = response['accessibilityText']; 17 | } 18 | } 19 | 20 | class QuickReplies { 21 | String title; 22 | List quickReplies=[]; 23 | 24 | QuickReplies(Map response) { 25 | this.title = response['quickReplies']['title']; 26 | List listQuickReplies = response['quickReplies']['quickReplies']; 27 | listQuickReplies.forEach((element)=> this.quickReplies.add(element)); 28 | } 29 | } 30 | 31 | class ButtonDialogflow { 32 | String text; 33 | String postback; 34 | 35 | ButtonDialogflow(Map response) { 36 | text = response['text']; 37 | postback = response['postback']; 38 | } 39 | } 40 | 41 | class CardDialogflow { 42 | String title; 43 | String subtitle; 44 | String imageUri; 45 | List buttons=[]; 46 | 47 | CardDialogflow(Map response) { 48 | this.title = response['card']['title']; 49 | this.subtitle = response['card']['subtitle']; 50 | this.imageUri = response['card']['imageUri']; 51 | List listButtons = response['card']['buttons']; 52 | for (int i = 0; i < listButtons.length; i++) { 53 | ButtonDialogflow b =new ButtonDialogflow(listButtons[i]); 54 | buttons.add(b); 55 | } 56 | } 57 | } 58 | 59 | class SimpleResponse { 60 | String textToSpeech; 61 | String ssml; 62 | String displayText; 63 | 64 | SimpleResponse(Map response){ 65 | this.textToSpeech = response['textToSpeech']; 66 | this.ssml = response['ssml']; 67 | this.displayText = response['displayText']; 68 | } 69 | } 70 | 71 | class SimpleResponses { 72 | List simpleResponses =[]; 73 | 74 | SimpleResponses(Map response){ 75 | List listSimpleResponse = response['simpleResponses']['simpleResponses']; 76 | for (int i = 0; i < listSimpleResponse.length; i++) { 77 | SimpleResponse b =new SimpleResponse(listSimpleResponse[i]); 78 | simpleResponses.add(b); 79 | } 80 | } 81 | } 82 | 83 | class BasicCardDialogflow { 84 | String title; 85 | String subtitle; 86 | String formattedText; 87 | ImageDialogflow image; 88 | List buttons; 89 | 90 | BasicCardDialogflow(Map response) { 91 | this.title = response['basicCard']['title']; 92 | this.subtitle = response['basicCard']['subtitle']; 93 | this.formattedText = response['basicCard']['formattedText']; 94 | this.image = new ImageDialogflow(response['basicCard']['image']) ; 95 | this.buttons = response['basicCard']['buttons']; 96 | } 97 | } 98 | 99 | 100 | class ItemCarousel{ 101 | dynamic info; 102 | String title; 103 | String description; 104 | ImageDialogflow image; 105 | ItemCarousel(Map item){ 106 | this.info = item['info']; 107 | this.title = item['title']; 108 | this.description = item['description']; 109 | this.image =new ImageDialogflow(item['image']); 110 | } 111 | } 112 | 113 | class CarouselSelect { 114 | List items=[]; 115 | CarouselSelect(Map response){ 116 | List list = response['carouselSelect']['items']; 117 | for(var i=0;i new _GoogleAssistant(); 14 | } 15 | 16 | class _GoogleAssistant extends State { 17 | final List _messages = []; 18 | final TextEditingController _textController = new TextEditingController(); 19 | BuildContext buildContext; 20 | Widget _buildTextComposer() { 21 | return new IconTheme( 22 | data: new IconThemeData(color: Theme.of(context).accentColor), 23 | child: new Container( 24 | margin: const EdgeInsets.symmetric(horizontal: 8.0), 25 | child: new Row( 26 | children: [ 27 | new Flexible( 28 | child: new TextField( 29 | controller: _textController, 30 | onSubmitted: _handleSubmitted, 31 | decoration: 32 | new InputDecoration.collapsed(hintText: "Send a message"), 33 | ), 34 | ), 35 | new Container( 36 | margin: new EdgeInsets.symmetric(horizontal: 4.0), 37 | child: new IconButton( 38 | icon: new Icon(Icons.send,color: Colors.blue,), 39 | onPressed: () => _handleSubmitted(_textController.text)), 40 | ), 41 | ], 42 | ), 43 | ), 44 | ); 45 | } 46 | 47 | dynamic getWidgetMessage(message) { 48 | TypeMessage ms = TypeMessage(message); 49 | if (ms.platform == "ACTIONS_ON_GOOGLE") { 50 | if (ms.type == "simpleResponses") { 51 | return SimpleMessage( 52 | text: message['simpleResponses']['simpleResponses'][0] 53 | ['textToSpeech'], 54 | name: "Bot", 55 | type: false, 56 | ); 57 | } 58 | if (ms.type == "basicCard") { 59 | return BasicCardWidget(card: BasicCardDialogflow(message)); 60 | } 61 | if (ms.type == "carouselSelect") { 62 | return CarouselSelectWidget( 63 | carouselSelect: CarouselSelect(message), 64 | clickItem: (info) { 65 | print(info); // Item Click print List Keys 66 | }); 67 | } 68 | } 69 | return null; 70 | } 71 | 72 | void Response(query) async { 73 | _textController.clear(); 74 | AuthGoogle authGoogle = 75 | await AuthGoogle(fileJson: "Asset Your File Json").build(); 76 | Dialogflow dialogflow = 77 | Dialogflow(authGoogle: authGoogle, language: Language.english); 78 | AIResponse response = await dialogflow.detectIntent(query); 79 | if (response.getMessage() != null && response.getMessage() != "") { 80 | SimpleMessage message = new SimpleMessage( 81 | text: response.getMessage(), 82 | name: "Bot", 83 | type: false, 84 | ); 85 | setState(() { 86 | _messages.insert(0, message); 87 | }); 88 | } else { 89 | List messages = response.getListMessage(); 90 | for (var i = 0; i < messages.length; i++) { 91 | dynamic message = getWidgetMessage(messages[i]); 92 | if (message != null) { 93 | setState(() { 94 | _messages.insert(0, message); 95 | }); 96 | } 97 | } 98 | } 99 | } 100 | 101 | void _handleSubmitted(String text) { 102 | _textController.clear(); 103 | SimpleMessage message = new SimpleMessage( 104 | text: text, 105 | name: "Rances", 106 | type: true, 107 | ); 108 | setState(() { 109 | _messages.insert(0, message); 110 | }); 111 | Response(text); 112 | } 113 | 114 | @override 115 | Widget build(BuildContext context) { 116 | this.buildContext=context; 117 | return new Scaffold( 118 | backgroundColor: Color(0xf4f4f4f4f4), 119 | appBar: new AppBar( 120 | title: new Text("Google Assistant"), 121 | backgroundColor: Colors.blue, 122 | ), 123 | body: new Column(children: [ 124 | new Flexible( 125 | child: new ListView.builder( 126 | padding: new EdgeInsets.all(8.0), 127 | reverse: true, 128 | itemBuilder: (_, int index) => _messages[index], 129 | itemCount: _messages.length, 130 | )), 131 | new Divider(height: 1.0), 132 | new Container( 133 | decoration: new BoxDecoration(color: Theme.of(context).cardColor), 134 | child: _buildTextComposer(), 135 | ), 136 | ]), 137 | ); 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /lib/utils/language.dart: -------------------------------------------------------------------------------- 1 | class Language { 2 | /* Chinese Cantonese */ 3 | static String chineseCantonese = "zh-HK"; 4 | @Deprecated("Use chineseCantonese") 5 | static String CHINESE_CANTONESE = chineseCantonese; 6 | 7 | /* Chinese Simplified */ 8 | static String chineseSimplified = "zh-CN"; 9 | @Deprecated("Use chineseSimplified") 10 | static String CHINESE_SIMPLIFIED = chineseSimplified; 11 | 12 | /* Chinese Traditional */ 13 | static String chineseTraditional = "zh-TW"; 14 | @Deprecated("Use chineseTraditional") 15 | static String CHINESE_TRADITIONAL = chineseTraditional; 16 | 17 | /* Danish */ 18 | static String danish = "da"; 19 | @Deprecated("Use danish") 20 | static String DANISH = danish; 21 | 22 | /* Dutch */ 23 | static String dutch = "nl"; 24 | @Deprecated("Use dutch") 25 | static String DUTCH = dutch; 26 | 27 | /* English */ 28 | static String english = "en"; 29 | @Deprecated("Use english") 30 | static String ENGLISH = english; 31 | 32 | /* English Australian locale */ 33 | static String englishAustralianLocale = "en-AU"; 34 | @Deprecated("Use englishAustralianLocale") 35 | static String ENGLISH_AUSTRALIAN_LOCALE = englishAustralianLocale; 36 | 37 | /* English Canadian locale */ 38 | static String englishCanadianLocale = "en-CA"; 39 | @Deprecated("Use englishCanadianLocale") 40 | static String ENGLISH_CANADIAN_LOCALE = englishCanadianLocale; 41 | 42 | /* English Great Britain locale */ 43 | static String englishGreatBritaniLocale = "en-GB"; 44 | @Deprecated("Use englishGreatBritaniLocale") 45 | static String ENGLISH_GREAT_BRITANI_LOCALE = englishGreatBritaniLocale; 46 | 47 | /* English Indian locale */ 48 | static String englishIndianLocale = "en-IN"; 49 | @Deprecated("Use englishIndianLocale") 50 | static String ENGLISH_INDIAN_LOCALE = englishIndianLocale; 51 | 52 | /* English US locale */ 53 | static String englishUsLocale = "en-US"; 54 | @Deprecated("Use englishUsLocale") 55 | static String ENGLISH_US_LOCALE = englishUsLocale; 56 | 57 | /* French */ 58 | static String french = "fr"; 59 | @Deprecated("Use french") 60 | static String FRENCH = french; 61 | 62 | /* French Canadian locale */ 63 | static String frenchCanadianLocale = "fr-CA"; 64 | @Deprecated("Use frenchCanadianLocale") 65 | static String FRENCH_CANADIAN_LOCALE = frenchCanadianLocale; 66 | 67 | /* France locale */ 68 | static String frenchFranceLocale = "fr-FR"; 69 | @Deprecated("Use frenchFranceLocale") 70 | static String FRENCH_FRANCE_LOCALE = frenchFranceLocale; 71 | 72 | /* German */ 73 | static String german = "de"; 74 | @Deprecated("Use german") 75 | static String GERMAN = german; 76 | 77 | /* Hindi */ 78 | static String hindi = "hi"; 79 | @Deprecated("Use hindi") 80 | static String HINDI = hindi; 81 | 82 | /* Indonesian */ 83 | static String indonesian = "id"; 84 | @Deprecated("Use indonesian") 85 | static String INDONESIAN = indonesian; 86 | 87 | /* Italian */ 88 | static String italian = "it"; 89 | @Deprecated("Use italian") 90 | static String ITALIAN = italian; 91 | 92 | /* Japanese */ 93 | static String japonese = "ja"; 94 | @Deprecated("Use japonese") 95 | static String JAPANESE = japonese; 96 | 97 | /* Korean */ 98 | static String korean = "ko"; 99 | @Deprecated("Use korean") 100 | static String KOREAN = korean; 101 | 102 | /* Norwegian */ 103 | static String norwegian = "no"; 104 | @Deprecated("Use norwegian") 105 | static String NORWEGIAN = norwegian; 106 | 107 | /* Portuguese */ 108 | static String portuguese = "pt"; 109 | @Deprecated("Use portuguese") 110 | static String PORTUGUESE = portuguese; 111 | 112 | /* Portuguese Brazilian */ 113 | static String portugueseBrazilian = "pt-BR"; 114 | @Deprecated("Use portugueseBrazilian") 115 | static String PORTUGUESE_BRAZILIAN = portugueseBrazilian; 116 | 117 | /* Russian */ 118 | static String russian = "ru"; 119 | @Deprecated("Use russian") 120 | static String RUSSIAN = russian; 121 | 122 | /* Spanish */ 123 | static String spanish = "es"; 124 | @Deprecated("Use spanish") 125 | static String SPANISH = spanish; 126 | 127 | /* Spanish Latin America locale */ 128 | static String spanishLatinAmerica = "es-419"; 129 | @Deprecated("Use spanishLatinAmerica") 130 | static String SPANISH_LATIN_AMERICA = spanishLatinAmerica; 131 | 132 | /* Spanish Spain */ 133 | static String spanishSpain = "es-ES"; 134 | @Deprecated("Use spanishSpain") 135 | static String SPANISH_SPAIN = spanishSpain; 136 | 137 | /* Swedish */ 138 | static String swedish = "sv"; 139 | @Deprecated("Use swedish") 140 | static String SWEDISH = swedish; 141 | 142 | /* Thai */ 143 | static String thai = "th"; 144 | @Deprecated("Use thai") 145 | static String THAI = thai; 146 | 147 | /* Ukranian */ 148 | static String ukranian = "uk"; 149 | @Deprecated("Use ukranian") 150 | static String UKRANIAN = ukranian; 151 | } 152 | -------------------------------------------------------------------------------- /example/lib/dialogflow_v1.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_dialogflow/flutter_dialogflow.dart'; 3 | class PageDialogflowV1 extends StatefulWidget { 4 | PageDialogflowV1({Key key, this.title}) : super(key: key); 5 | 6 | final String title; 7 | 8 | @override 9 | _PageDialogflowV1 createState() => new _PageDialogflowV1(); 10 | } 11 | 12 | class _PageDialogflowV1 extends State { 13 | final List _messages = []; 14 | final TextEditingController _textController = new TextEditingController(); 15 | 16 | Widget _buildTextComposer() { 17 | return new IconTheme( 18 | data: new IconThemeData(color: Theme.of(context).accentColor), 19 | child: new Container( 20 | margin: const EdgeInsets.symmetric(horizontal: 8.0), 21 | child: new Row( 22 | children: [ 23 | new Flexible( 24 | child: new TextField( 25 | controller: _textController, 26 | onSubmitted: _handleSubmitted, 27 | decoration: 28 | new InputDecoration.collapsed(hintText: "Send a message"), 29 | ), 30 | ), 31 | new Container( 32 | margin: new EdgeInsets.symmetric(horizontal: 4.0), 33 | child: new IconButton( 34 | icon: new Icon(Icons.send), 35 | onPressed: () => _handleSubmitted(_textController.text)), 36 | ), 37 | ], 38 | ), 39 | ), 40 | ); 41 | } 42 | 43 | void Response(query) async { 44 | _textController.clear(); 45 | Dialogflow dialogflow =Dialogflow(token: "Your Token"); 46 | AIResponse response = await dialogflow.sendQuery(query); 47 | ChatMessage message = new ChatMessage( 48 | text: response.getMessageResponse(), 49 | name: "Bot", 50 | type: false, 51 | ); 52 | setState(() { 53 | _messages.insert(0, message); 54 | }); 55 | } 56 | 57 | void _handleSubmitted(String text) { 58 | _textController.clear(); 59 | ChatMessage message = new ChatMessage( 60 | text: text, 61 | name: "Rances", 62 | type: true, 63 | ); 64 | setState(() { 65 | _messages.insert(0, message); 66 | }); 67 | Response(text); 68 | } 69 | 70 | @override 71 | Widget build(BuildContext context) { 72 | return new Scaffold( 73 | appBar: new AppBar( 74 | title: new Text("Dialogflow V1"), 75 | ), 76 | body: new Column(children: [ 77 | new Flexible( 78 | child: new ListView.builder( 79 | padding: new EdgeInsets.all(8.0), 80 | reverse: true, 81 | itemBuilder: (_, int index) => _messages[index], 82 | itemCount: _messages.length, 83 | )), 84 | new Divider(height: 1.0), 85 | new Container( 86 | decoration: new BoxDecoration(color: Theme.of(context).cardColor), 87 | child: _buildTextComposer(), 88 | ), 89 | ]), 90 | ); 91 | } 92 | } 93 | 94 | class ChatMessage extends StatelessWidget { 95 | ChatMessage({this.text, this.name, this.type}); 96 | 97 | final String text; 98 | final String name; 99 | final bool type; 100 | 101 | List otherMessage(context) { 102 | return [ 103 | new Container( 104 | margin: const EdgeInsets.only(right: 16.0), 105 | child: new CircleAvatar(child: new Image.asset("img/placeholder.png")), 106 | ), 107 | new Expanded( 108 | child: new Column( 109 | crossAxisAlignment: CrossAxisAlignment.start, 110 | children: [ 111 | new Text(this.name, style:new TextStyle(fontWeight:FontWeight.bold )), 112 | new Container( 113 | margin: const EdgeInsets.only(top: 5.0), 114 | child: new Text(text), 115 | ), 116 | ], 117 | ), 118 | ), 119 | ]; 120 | } 121 | 122 | List myMessage(context) { 123 | return [ 124 | new Expanded( 125 | child: new Column( 126 | crossAxisAlignment: CrossAxisAlignment.end, 127 | children: [ 128 | new Text(this.name, style: Theme.of(context).textTheme.subhead), 129 | new Container( 130 | margin: const EdgeInsets.only(top: 5.0), 131 | child: new Text(text), 132 | ), 133 | ], 134 | ), 135 | ), 136 | new Container( 137 | margin: const EdgeInsets.only(left: 16.0), 138 | child: new CircleAvatar(child: new Text(this.name[0])), 139 | ), 140 | ]; 141 | } 142 | 143 | @override 144 | Widget build(BuildContext context) { 145 | return new Container( 146 | margin: const EdgeInsets.symmetric(vertical: 10.0), 147 | child: new Row( 148 | crossAxisAlignment: CrossAxisAlignment.start, 149 | children: this.type ? myMessage(context) : otherMessage(context), 150 | ), 151 | ); 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.3.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.0.5" 18 | charcode: 19 | dependency: transitive 20 | description: 21 | name: charcode 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.2" 25 | collection: 26 | dependency: transitive 27 | description: 28 | name: collection 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.14.11" 32 | convert: 33 | dependency: transitive 34 | description: 35 | name: convert 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.0.2" 39 | crypto: 40 | dependency: transitive 41 | description: 42 | name: crypto 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.0.6" 46 | cupertino_icons: 47 | dependency: "direct main" 48 | description: 49 | name: cupertino_icons 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "0.1.2" 53 | flutter: 54 | dependency: "direct main" 55 | description: flutter 56 | source: sdk 57 | version: "0.0.0" 58 | flutter_dialogflow: 59 | dependency: "direct main" 60 | description: 61 | path: ".." 62 | relative: true 63 | source: path 64 | version: "0.1.2" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | googleapis_auth: 71 | dependency: transitive 72 | description: 73 | name: googleapis_auth 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "0.2.6" 77 | http: 78 | dependency: transitive 79 | description: 80 | name: http 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "0.12.0+2" 84 | http_parser: 85 | dependency: transitive 86 | description: 87 | name: http_parser 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "3.1.3" 91 | matcher: 92 | dependency: transitive 93 | description: 94 | name: matcher 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.12.5" 98 | meta: 99 | dependency: transitive 100 | description: 101 | name: meta 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.1.7" 105 | path: 106 | dependency: transitive 107 | description: 108 | name: path 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.6.4" 112 | pedantic: 113 | dependency: transitive 114 | description: 115 | name: pedantic 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "1.8.0+1" 119 | quiver: 120 | dependency: transitive 121 | description: 122 | name: quiver 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "2.0.5" 126 | sky_engine: 127 | dependency: transitive 128 | description: flutter 129 | source: sdk 130 | version: "0.0.99" 131 | source_span: 132 | dependency: transitive 133 | description: 134 | name: source_span 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "1.5.5" 138 | stack_trace: 139 | dependency: transitive 140 | description: 141 | name: stack_trace 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.9.3" 145 | stream_channel: 146 | dependency: transitive 147 | description: 148 | name: stream_channel 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "2.0.0" 152 | string_scanner: 153 | dependency: transitive 154 | description: 155 | name: string_scanner 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "1.0.5" 159 | term_glyph: 160 | dependency: transitive 161 | description: 162 | name: term_glyph 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.1.0" 166 | test_api: 167 | dependency: transitive 168 | description: 169 | name: test_api 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "0.2.5" 173 | typed_data: 174 | dependency: transitive 175 | description: 176 | name: typed_data 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "1.1.6" 180 | vector_math: 181 | dependency: transitive 182 | description: 183 | name: vector_math 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "2.0.8" 187 | sdks: 188 | dart: ">=2.2.2 <3.0.0" 189 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dialogflow v1 & v2 for Flutter apps. 2 | 3 | 4 | ![Dialogflow](https://github.com/VictorRancesCode/flutter_dialogflow/raw/master/dialogflow.png) 5 | 6 | ### :heart: Star :heart: the repo to support the project. Thanks! 7 | 8 | A new Flutter package. 9 | * [Example](https://github.com/VictorRancesCode/flutter_dialogflow/tree/master/example) 10 | 11 | 12 |

13 | 14 |

15 | 16 | ## Awesome Tutorials 17 | * [Flutter and Bots (DialogFlow)](https://medium.com/flutterpub/flutter-and-bots-dialogflow-d490fc7e5aaf). By [Aseem Wangoo](https://medium.com/@aseemwangoo) 18 | * [Chatbot Inventory Tracking iOS & Android App with Flutter, DialogFlow, and GCP](https://medium.com/flutter-community/chatbot-inventory-tracking-ios-android-app-with-flutter-dialogflow-and-gcp-d7d903ce7f90). By [Alfian Losari](https://medium.com/@alfianlosari) 19 | 20 | Thanks for the tutorials! 21 | ## Installation 22 | 23 | * Add this to your package's pubspec.yaml file: 24 | ``` 25 | dependencies: 26 | flutter_dialogflow: ^0.1.0 27 | ``` 28 | * You can install packages from the command line: 29 | with Flutter: 30 | ``` 31 | $ flutter packages get 32 | ``` 33 | 34 | * Dialogflow v1 Import it Now in your Dart code, you can use: 35 | ``` 36 | import 'package:flutter_dialogflow/flutter_dialogflow.dart'; 37 | ``` 38 | * Or Dialogflow v2 Import it Now in your Dart code, you can use: 39 | ``` 40 | import 'package:flutter_dialogflow/dialogflow_v2.dart'; 41 | ``` 42 | 43 | ## Usage 44 | ### Dialogflow v1 45 | * [Dialogflow](https://dialogflow.com/) register and create new Agent 46 | * Copy Api key (Token) 47 | * Code 48 | ``` 49 | Dialogflow dialogflow = Dialogflow(token: "Your Token"); 50 | AIResponse response = await dialogflow.sendQuery("Your Query"); 51 | ``` 52 | * Example 53 | ``` 54 | void Response(query) async { 55 | Dialogflow dialogflow = Dialogflow(token: "10178f9cb6cf12321asdf4aae75c87cd"); 56 | AIResponse response = await dialogflow.sendQuery(query); 57 | print(response.getMessageResponse()); 58 | } 59 | ``` 60 | 61 | 62 | ### Dialogflow v2 63 | * Dialogflow](https://dialogflow.com/) register and create new Agent 64 | * Project Setup and Authentication 65 | * First of all, we need to create a Google Cloud Platform Project using [Console Google Cloud](https://console.cloud.google.com/) 66 | * Create or select an existing GCP project. 67 | * From the GCP console, go to APIs and Services and click on credentials. 68 | * Click on Create credentials and choose Service account key. 69 | * Select your service account from the dropdown, choose JSON and click Create. This will download the JSON key to your computer. Save it securely. 70 | * We downloaded a JSON file with all our data. 71 | * In your project create folder assets(folder name recommended optional) 72 | * Move file json in your project in folder created 73 | * open file pubspec.yaml 74 | ``` 75 | flutter: 76 | uses-material-design: true 77 | assets: 78 | - assets/your_file_downloaded_google_cloud.json 79 | ``` 80 | * Import dialogflow_v2 81 | ``` 82 | import 'package:flutter_dialogflow/dialogflow_v2.dart'; 83 | ``` 84 | 85 | * Code 86 | ``` 87 | AuthGoogle authGoogle = await AuthGoogle(fileJson: "Asset Your File Json").build(); 88 | // Select Language.ENGLISH or Language.SPANISH or others... 89 | Dialogflow dialogflow =Dialogflow(authGoogle: authGoogle,language: Language.ENGLISH); 90 | AIResponse response = await dialogflow.detectIntent("Your Query"); 91 | ``` 92 | 93 | * Example 94 | ``` 95 | AuthGoogle authGoogle = await AuthGoogle(fileJson: "assets/your_file_downloaded_google_cloud.json").build(); 96 | Dialogflow dialogflow = Dialogflow(authGoogle: authGoogle,language: Language.ENGLISH); 97 | AIResponse response = await dialogflow.detectIntent("Hi!!!"); 98 | print(response.getMessage()) 99 | ``` 100 | 101 | * Or Get List Message type Card 102 | ``` 103 | Call function response.getListMessage() 104 | response List 105 | example 106 | new CardDialogflow(response.getListMessage()[0]).title 107 | Convert first item in CardDialogflow for worked easy 108 | CardDialogflow have 109 | - title 110 | - subtitle 111 | - imageUri 112 | - List buttonss 113 | - each button have text and postback 114 | ``` 115 | * Or Setup custom authentication (session) 116 | ``` 117 | Get a session id from your backend server after authentication.(Eg: OAuth Token) 118 | Pass the session id a named parameter 'sessionId' to AuthGoogle function. 119 | On the dialogflow fulfillment, access it inside `agent.session` (WebhookClient.session) 120 | and apply your session logic 121 | 122 | Example: 123 | AuthGoogle authGoogle = await AuthGoogle(fileJson: "assets/your_file_downloaded_google_cloud.json", sessionId: "YOUR_CUSTOM_SESSION_ID").build(); 124 | Dialogflow dialogflow = Dialogflow(authGoogle: authGoogle,language: Language.ENGLISH); 125 | AIResponse response = await dialogflow.detectIntent("Hi!!!"); 126 | print(response.getMessage()) 127 | 128 | ``` 129 | 130 | ![Demo](https://github.com/VictorRancesCode/flutter_dialogflow/raw/master/demo.jpg) 131 | 132 | ### Dialogflow For Flutter Web 133 | Visit the repository: [Flutter Dialogflow Web](https://github.com/VictorRancesCode/flutter_dialogflow_web) 🚀 134 | -------------------------------------------------------------------------------- /example/lib/dialogflow_v2.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_dialogflow/dialogflow_v2.dart'; 3 | 4 | class HomePageDialogflowV2 extends StatefulWidget { 5 | HomePageDialogflowV2({Key key, this.title}) : super(key: key); 6 | 7 | final String title; 8 | 9 | @override 10 | _HomePageDialogflowV2 createState() => new _HomePageDialogflowV2(); 11 | } 12 | 13 | class _HomePageDialogflowV2 extends State { 14 | final List _messages = []; 15 | final TextEditingController _textController = new TextEditingController(); 16 | 17 | Widget _buildTextComposer() { 18 | return new IconTheme( 19 | data: new IconThemeData(color: Theme.of(context).accentColor), 20 | child: new Container( 21 | margin: const EdgeInsets.symmetric(horizontal: 8.0), 22 | child: new Row( 23 | children: [ 24 | new Flexible( 25 | child: new TextField( 26 | controller: _textController, 27 | onSubmitted: _handleSubmitted, 28 | decoration: 29 | new InputDecoration.collapsed(hintText: "Send a message"), 30 | ), 31 | ), 32 | new Container( 33 | margin: new EdgeInsets.symmetric(horizontal: 4.0), 34 | child: new IconButton( 35 | icon: new Icon(Icons.send), 36 | onPressed: () => _handleSubmitted(_textController.text)), 37 | ), 38 | ], 39 | ), 40 | ), 41 | ); 42 | } 43 | 44 | void Response(query) async { 45 | _textController.clear(); 46 | AuthGoogle authGoogle = await AuthGoogle(fileJson: "Asset Your File Json").build(); 47 | Dialogflow dialogflow =Dialogflow(authGoogle: authGoogle,language: Language.english); 48 | AIResponse response = await dialogflow.detectIntent(query); 49 | ChatMessage message = new ChatMessage( 50 | text: response.getMessage() ?? new TypeMessage(response.getListMessage()[0]).platform, 51 | name: "Bot", 52 | type: false, 53 | ); 54 | setState(() { 55 | _messages.insert(0, message); 56 | }); 57 | } 58 | 59 | void _handleSubmitted(String text) { 60 | _textController.clear(); 61 | ChatMessage message = new ChatMessage( 62 | text: text, 63 | name: "Rances", 64 | type: true, 65 | ); 66 | setState(() { 67 | _messages.insert(0, message); 68 | }); 69 | Response(text); 70 | } 71 | 72 | @override 73 | Widget build(BuildContext context) { 74 | return new Scaffold( 75 | appBar: new AppBar( 76 | title: new Text("Dialogflow V2"), 77 | ), 78 | body: new Column(children: [ 79 | new Flexible( 80 | child: new ListView.builder( 81 | padding: new EdgeInsets.all(8.0), 82 | reverse: true, 83 | itemBuilder: (_, int index) => _messages[index], 84 | itemCount: _messages.length, 85 | )), 86 | new Divider(height: 1.0), 87 | new Container( 88 | decoration: new BoxDecoration(color: Theme.of(context).cardColor), 89 | child: _buildTextComposer(), 90 | ), 91 | ]), 92 | ); 93 | } 94 | } 95 | 96 | class ChatMessage extends StatelessWidget { 97 | ChatMessage({this.text, this.name, this.type}); 98 | 99 | final String text; 100 | final String name; 101 | final bool type; 102 | 103 | List otherMessage(context) { 104 | return [ 105 | new Container( 106 | margin: const EdgeInsets.only(right: 16.0), 107 | child: new CircleAvatar(child: new Image.asset("img/placeholder.png")), 108 | ), 109 | new Expanded( 110 | child: new Column( 111 | crossAxisAlignment: CrossAxisAlignment.start, 112 | children: [ 113 | new Text(this.name, style:new TextStyle(fontWeight:FontWeight.bold )), 114 | new Container( 115 | margin: const EdgeInsets.only(top: 5.0), 116 | child: new Text(text), 117 | ), 118 | ], 119 | ), 120 | ), 121 | ]; 122 | } 123 | 124 | List myMessage(context) { 125 | return [ 126 | new Expanded( 127 | child: new Column( 128 | crossAxisAlignment: CrossAxisAlignment.end, 129 | children: [ 130 | new Text(this.name, style: Theme.of(context).textTheme.subhead), 131 | new Container( 132 | margin: const EdgeInsets.only(top: 5.0), 133 | child: new Text(text), 134 | ), 135 | ], 136 | ), 137 | ), 138 | new Container( 139 | margin: const EdgeInsets.only(left: 16.0), 140 | child: new CircleAvatar(child: new Text(this.name[0])), 141 | ), 142 | ]; 143 | } 144 | 145 | @override 146 | Widget build(BuildContext context) { 147 | return new Container( 148 | margin: const EdgeInsets.symmetric(vertical: 10.0), 149 | child: new Row( 150 | crossAxisAlignment: CrossAxisAlignment.start, 151 | children: this.type ? myMessage(context) : otherMessage(context), 152 | ), 153 | ); 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /lib/flutter_dialogflow.dart: -------------------------------------------------------------------------------- 1 | library flutter_dialogflow; 2 | 3 | import 'package:meta/meta.dart'; 4 | import 'package:http/http.dart' as http; 5 | import 'dart:async'; 6 | import 'dart:convert'; 7 | import 'dart:io'; 8 | 9 | class Status { 10 | int _code; 11 | String _errorType; 12 | String _errorDetails; 13 | 14 | Status(Map response) { 15 | this._code = response["code"]; 16 | this._errorType = response["errorType"]; 17 | this._errorDetails = response["errorDetails"]; 18 | } 19 | 20 | int get getCode => _code; 21 | 22 | set code(int value) { 23 | _code = value; 24 | } 25 | 26 | String get getErrorType => _errorType; 27 | 28 | set errorType(String value) { 29 | _errorType = value; 30 | } 31 | 32 | String get getErrorDetails => _errorDetails; 33 | 34 | set errorDetails(String value) { 35 | _errorDetails = value; 36 | } 37 | } 38 | 39 | class Fulfillment { 40 | String _speech; 41 | dynamic _messages; 42 | 43 | Fulfillment(Map response) { 44 | this._speech = response["speech"]; 45 | this._messages = response["messages"]; 46 | } 47 | 48 | getMessageResponse() { 49 | return this._messages[0]["speech"]; 50 | } 51 | 52 | getSpeechResponse() { 53 | return this._speech; 54 | } 55 | 56 | String get getSApeech => _speech; 57 | 58 | set speech(String value) { 59 | _speech = value; 60 | } 61 | 62 | dynamic get getMessages => _messages; 63 | 64 | set messages(dynamic value) { 65 | _messages = value; 66 | } 67 | } 68 | 69 | class Metadata { 70 | String _intentId; 71 | String _webhookUsed; 72 | String _webhookForSlotFillingUsed; 73 | String _intentName; 74 | 75 | Metadata(Map response) { 76 | this._intentId = response["intentId"]; 77 | this._webhookUsed = response["webhookUsed"]; 78 | this._webhookForSlotFillingUsed = response["webhookForSlotFillingUsed"]; 79 | this._intentName = response["intentName"]; 80 | } 81 | 82 | String get getIntentId => _intentId; 83 | 84 | set intentId(String value) { 85 | _intentId = value; 86 | } 87 | 88 | String get getWebhookUsed => _webhookUsed; 89 | 90 | set webhookUsed(String value) { 91 | _webhookUsed = value; 92 | } 93 | 94 | String get getWebhookForSlotFillingUsed => _webhookForSlotFillingUsed; 95 | 96 | set webhookForSlotFillingUsed(String value) { 97 | _webhookForSlotFillingUsed = value; 98 | } 99 | 100 | String get getIntentName => _intentName; 101 | 102 | set intentName(String value) { 103 | _intentName = value; 104 | } 105 | } 106 | 107 | class Result { 108 | String _source; 109 | String _action; 110 | String _resolvedQuery; 111 | bool _actionIncomplete; 112 | Map _parameters; 113 | dynamic _contexts; 114 | Metadata _metadata; 115 | Fulfillment _fulfillment; 116 | double _score; 117 | 118 | Result(Map response) { 119 | this._source = response["source"]; 120 | this._action = response["action"]; 121 | this._resolvedQuery = response["resolvedQuery"]; 122 | this._actionIncomplete = response["actionIncomplete"]; 123 | this._parameters = response["parameters"]; 124 | this._contexts = response["contexts"]; 125 | this._metadata = new Metadata(response["metadata"]); 126 | this._fulfillment = new Fulfillment(response["fulfillment"]); 127 | this._score = response["score"]; 128 | } 129 | 130 | String get getSource => _source; 131 | 132 | set source(String value) { 133 | _source = value; 134 | } 135 | 136 | String get getAction => _action; 137 | 138 | set action(String value) { 139 | _action = value; 140 | } 141 | 142 | String get getResolvedQuery => _resolvedQuery; 143 | 144 | set resolvedQuery(String value) { 145 | _resolvedQuery = value; 146 | } 147 | 148 | bool get getActionIncomplete => _actionIncomplete; 149 | 150 | set actionIncomplete(bool value) { 151 | _actionIncomplete = value; 152 | } 153 | 154 | Map get getParameters => _parameters; 155 | 156 | set parameters(Map value) { 157 | _parameters = value; 158 | } 159 | 160 | dynamic get getContexts => _contexts; 161 | 162 | set contexts(dynamic value) { 163 | _contexts = value; 164 | } 165 | 166 | Metadata get getMetadata => _metadata; 167 | 168 | set metadata(Metadata value) { 169 | _metadata = value; 170 | } 171 | 172 | Fulfillment get getFulfillment => _fulfillment; 173 | 174 | set fulfillment(Fulfillment value) { 175 | _fulfillment = value; 176 | } 177 | 178 | double get getScore => _score; 179 | 180 | set score(double value) { 181 | _score = value; 182 | } 183 | } 184 | 185 | class AIResponse { 186 | String _id; 187 | String _timestamp; 188 | String _lang; 189 | Result _result; 190 | Status _status; 191 | String _sessionId; 192 | 193 | AIResponse(Map response) { 194 | this._status = new Status(response["status"]); 195 | if (this._status.getCode != 200) { 196 | print(this._status.getErrorType); 197 | print(this._status.getErrorDetails); 198 | throw new FormatException(this._status.getErrorDetails); 199 | } else { 200 | this._id = response["id"]; 201 | this._timestamp = response["timestamp"]; 202 | this._lang = response["lang"]; 203 | this._result = new Result(response["result"]); 204 | } 205 | } 206 | 207 | getMessageResponse() { 208 | return this._result.getFulfillment.getMessageResponse(); 209 | } 210 | 211 | getSpeechResponse() { 212 | return this._result.getFulfillment.getSpeechResponse(); 213 | } 214 | 215 | String get getId => _id; 216 | 217 | set id(String value) { 218 | _id = value; 219 | } 220 | 221 | String get getTimestamp => _timestamp; 222 | 223 | set timestamp(String value) { 224 | _timestamp = value; 225 | } 226 | 227 | String get getLang => _lang; 228 | 229 | set lang(String value) { 230 | _lang = value; 231 | } 232 | 233 | Result get getResult => _result; 234 | 235 | set result(Result value) { 236 | _result = value; 237 | } 238 | 239 | Status get getStatus => _status; 240 | 241 | set status(Status value) { 242 | _status = value; 243 | } 244 | 245 | String get getsessionId => _sessionId; 246 | 247 | set sessionId(String value) { 248 | _sessionId = value; 249 | } 250 | } 251 | 252 | class Dialogflow { 253 | final String token; 254 | final String version; 255 | final String timezone; 256 | final String sessionId; 257 | final String language; 258 | 259 | const Dialogflow( 260 | {@required this.token, 261 | this.version = "20170712", 262 | this.timezone = "America/New_York", 263 | this.sessionId = "12345", 264 | this.language = "en"}); 265 | 266 | String _getUrl(query) { 267 | return "https://api.dialogflow.com/v1/query?v=$version&contexts=$query" 268 | "&lang=es&query=$query&lang=$language&sessionId=$sessionId&timezone=$timezone"; 269 | } 270 | 271 | Future sendQuery(query) async { 272 | var response = await http.get( 273 | _getUrl(query), 274 | headers: {HttpHeaders.authorizationHeader: "Bearer " + token}, 275 | ); 276 | Map data = json.decode(response.body); 277 | AIResponse aiResponse = new AIResponse(data); 278 | return aiResponse; 279 | } 280 | } -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | analyzer: 5 | dependency: transitive 6 | description: 7 | name: analyzer 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.36.4" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.3.0" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.3" 60 | csslib: 61 | dependency: transitive 62 | description: 63 | name: csslib 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "0.16.1" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | front_end: 78 | dependency: transitive 79 | description: 80 | name: front_end 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "0.1.19" 84 | glob: 85 | dependency: transitive 86 | description: 87 | name: glob 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "1.2.0" 91 | googleapis_auth: 92 | dependency: "direct main" 93 | description: 94 | name: googleapis_auth 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.2.10" 98 | html: 99 | dependency: transitive 100 | description: 101 | name: html 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "0.14.0+3" 105 | http: 106 | dependency: "direct main" 107 | description: 108 | name: http 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "0.12.0+2" 112 | http_multi_server: 113 | dependency: transitive 114 | description: 115 | name: http_multi_server 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "2.1.0" 119 | http_parser: 120 | dependency: transitive 121 | description: 122 | name: http_parser 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "3.1.3" 126 | io: 127 | dependency: transitive 128 | description: 129 | name: io 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "0.3.3" 133 | js: 134 | dependency: transitive 135 | description: 136 | name: js 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "0.6.1+1" 140 | json_rpc_2: 141 | dependency: transitive 142 | description: 143 | name: json_rpc_2 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "2.1.0" 147 | kernel: 148 | dependency: transitive 149 | description: 150 | name: kernel 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "0.3.19" 154 | matcher: 155 | dependency: transitive 156 | description: 157 | name: matcher 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "0.12.5" 161 | meta: 162 | dependency: transitive 163 | description: 164 | name: meta 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "1.1.7" 168 | mime: 169 | dependency: transitive 170 | description: 171 | name: mime 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "0.9.6+3" 175 | multi_server_socket: 176 | dependency: transitive 177 | description: 178 | name: multi_server_socket 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "1.0.2" 182 | node_interop: 183 | dependency: transitive 184 | description: 185 | name: node_interop 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "1.0.3" 189 | node_io: 190 | dependency: transitive 191 | description: 192 | name: node_io 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "1.0.1+2" 196 | node_preamble: 197 | dependency: transitive 198 | description: 199 | name: node_preamble 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "1.4.8" 203 | package_config: 204 | dependency: transitive 205 | description: 206 | name: package_config 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "1.1.0" 210 | package_resolver: 211 | dependency: transitive 212 | description: 213 | name: package_resolver 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "1.0.10" 217 | path: 218 | dependency: transitive 219 | description: 220 | name: path 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "1.6.4" 224 | pedantic: 225 | dependency: transitive 226 | description: 227 | name: pedantic 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "1.8.0+1" 231 | pool: 232 | dependency: transitive 233 | description: 234 | name: pool 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "1.4.0" 238 | pub_semver: 239 | dependency: transitive 240 | description: 241 | name: pub_semver 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "1.4.2" 245 | quiver: 246 | dependency: transitive 247 | description: 248 | name: quiver 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "2.0.5" 252 | shelf: 253 | dependency: transitive 254 | description: 255 | name: shelf 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "0.7.5" 259 | shelf_packages_handler: 260 | dependency: transitive 261 | description: 262 | name: shelf_packages_handler 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "1.0.4" 266 | shelf_static: 267 | dependency: transitive 268 | description: 269 | name: shelf_static 270 | url: "https://pub.dartlang.org" 271 | source: hosted 272 | version: "0.2.8" 273 | shelf_web_socket: 274 | dependency: transitive 275 | description: 276 | name: shelf_web_socket 277 | url: "https://pub.dartlang.org" 278 | source: hosted 279 | version: "0.2.3" 280 | sky_engine: 281 | dependency: transitive 282 | description: flutter 283 | source: sdk 284 | version: "0.0.99" 285 | source_map_stack_trace: 286 | dependency: transitive 287 | description: 288 | name: source_map_stack_trace 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "1.1.5" 292 | source_maps: 293 | dependency: transitive 294 | description: 295 | name: source_maps 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "0.10.8" 299 | source_span: 300 | dependency: transitive 301 | description: 302 | name: source_span 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "1.5.5" 306 | stack_trace: 307 | dependency: transitive 308 | description: 309 | name: stack_trace 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "1.9.3" 313 | stream_channel: 314 | dependency: transitive 315 | description: 316 | name: stream_channel 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "2.0.0" 320 | string_scanner: 321 | dependency: transitive 322 | description: 323 | name: string_scanner 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "1.0.5" 327 | term_glyph: 328 | dependency: transitive 329 | description: 330 | name: term_glyph 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "1.1.0" 334 | test: 335 | dependency: "direct dev" 336 | description: 337 | name: test 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "1.6.3" 341 | test_api: 342 | dependency: transitive 343 | description: 344 | name: test_api 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "0.2.5" 348 | test_core: 349 | dependency: transitive 350 | description: 351 | name: test_core 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "0.2.5" 355 | typed_data: 356 | dependency: transitive 357 | description: 358 | name: typed_data 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "1.1.6" 362 | vector_math: 363 | dependency: transitive 364 | description: 365 | name: vector_math 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "2.0.8" 369 | vm_service_client: 370 | dependency: transitive 371 | description: 372 | name: vm_service_client 373 | url: "https://pub.dartlang.org" 374 | source: hosted 375 | version: "0.2.6+3" 376 | watcher: 377 | dependency: transitive 378 | description: 379 | name: watcher 380 | url: "https://pub.dartlang.org" 381 | source: hosted 382 | version: "0.9.7+12" 383 | web_socket_channel: 384 | dependency: transitive 385 | description: 386 | name: web_socket_channel 387 | url: "https://pub.dartlang.org" 388 | source: hosted 389 | version: "1.1.0" 390 | yaml: 391 | dependency: transitive 392 | description: 393 | name: yaml 394 | url: "https://pub.dartlang.org" 395 | source: hosted 396 | version: "2.2.0" 397 | sdks: 398 | dart: ">=2.3.0 <3.0.0" 399 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 44 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 45 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 46 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 47 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 48 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 49 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 50 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 52 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 53 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 54 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 63 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | /* End PBXFrameworksBuildPhase section */ 68 | 69 | /* Begin PBXGroup section */ 70 | 9740EEB11CF90186004384FC /* Flutter */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 3B80C3931E831B6300D905FE /* App.framework */, 74 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 75 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 76 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 77 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 78 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 79 | ); 80 | name = Flutter; 81 | sourceTree = ""; 82 | }; 83 | 97C146E51CF9000F007C117D = { 84 | isa = PBXGroup; 85 | children = ( 86 | 9740EEB11CF90186004384FC /* Flutter */, 87 | 97C146F01CF9000F007C117D /* Runner */, 88 | 97C146EF1CF9000F007C117D /* Products */, 89 | ); 90 | sourceTree = ""; 91 | }; 92 | 97C146EF1CF9000F007C117D /* Products */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 97C146EE1CF9000F007C117D /* Runner.app */, 96 | ); 97 | name = Products; 98 | sourceTree = ""; 99 | }; 100 | 97C146F01CF9000F007C117D /* Runner */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 104 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 105 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 106 | 97C147021CF9000F007C117D /* Info.plist */, 107 | 97C146F11CF9000F007C117D /* Supporting Files */, 108 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 109 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 110 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 111 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 112 | ); 113 | path = Runner; 114 | sourceTree = ""; 115 | }; 116 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | ); 120 | name = "Supporting Files"; 121 | sourceTree = ""; 122 | }; 123 | /* End PBXGroup section */ 124 | 125 | /* Begin PBXNativeTarget section */ 126 | 97C146ED1CF9000F007C117D /* Runner */ = { 127 | isa = PBXNativeTarget; 128 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 129 | buildPhases = ( 130 | 9740EEB61CF901F6004384FC /* Run Script */, 131 | 97C146EA1CF9000F007C117D /* Sources */, 132 | 97C146EB1CF9000F007C117D /* Frameworks */, 133 | 97C146EC1CF9000F007C117D /* Resources */, 134 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 135 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 136 | ); 137 | buildRules = ( 138 | ); 139 | dependencies = ( 140 | ); 141 | name = Runner; 142 | productName = Runner; 143 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 144 | productType = "com.apple.product-type.application"; 145 | }; 146 | /* End PBXNativeTarget section */ 147 | 148 | /* Begin PBXProject section */ 149 | 97C146E61CF9000F007C117D /* Project object */ = { 150 | isa = PBXProject; 151 | attributes = { 152 | LastUpgradeCheck = 0910; 153 | ORGANIZATIONNAME = "The Chromium Authors"; 154 | TargetAttributes = { 155 | 97C146ED1CF9000F007C117D = { 156 | CreatedOnToolsVersion = 7.3.1; 157 | LastSwiftMigration = 0910; 158 | }; 159 | }; 160 | }; 161 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 162 | compatibilityVersion = "Xcode 3.2"; 163 | developmentRegion = English; 164 | hasScannedForEncodings = 0; 165 | knownRegions = ( 166 | en, 167 | Base, 168 | ); 169 | mainGroup = 97C146E51CF9000F007C117D; 170 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 171 | projectDirPath = ""; 172 | projectRoot = ""; 173 | targets = ( 174 | 97C146ED1CF9000F007C117D /* Runner */, 175 | ); 176 | }; 177 | /* End PBXProject section */ 178 | 179 | /* Begin PBXResourcesBuildPhase section */ 180 | 97C146EC1CF9000F007C117D /* Resources */ = { 181 | isa = PBXResourcesBuildPhase; 182 | buildActionMask = 2147483647; 183 | files = ( 184 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 185 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 186 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 187 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 188 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 189 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 190 | ); 191 | runOnlyForDeploymentPostprocessing = 0; 192 | }; 193 | /* End PBXResourcesBuildPhase section */ 194 | 195 | /* Begin PBXShellScriptBuildPhase section */ 196 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 197 | isa = PBXShellScriptBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | ); 201 | inputPaths = ( 202 | ); 203 | name = "Thin Binary"; 204 | outputPaths = ( 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | shellPath = /bin/sh; 208 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 209 | }; 210 | 9740EEB61CF901F6004384FC /* Run Script */ = { 211 | isa = PBXShellScriptBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | ); 215 | inputPaths = ( 216 | ); 217 | name = "Run Script"; 218 | outputPaths = ( 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | shellPath = /bin/sh; 222 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 223 | }; 224 | /* End PBXShellScriptBuildPhase section */ 225 | 226 | /* Begin PBXSourcesBuildPhase section */ 227 | 97C146EA1CF9000F007C117D /* Sources */ = { 228 | isa = PBXSourcesBuildPhase; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 232 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | /* End PBXSourcesBuildPhase section */ 237 | 238 | /* Begin PBXVariantGroup section */ 239 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 240 | isa = PBXVariantGroup; 241 | children = ( 242 | 97C146FB1CF9000F007C117D /* Base */, 243 | ); 244 | name = Main.storyboard; 245 | sourceTree = ""; 246 | }; 247 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | 97C147001CF9000F007C117D /* Base */, 251 | ); 252 | name = LaunchScreen.storyboard; 253 | sourceTree = ""; 254 | }; 255 | /* End PBXVariantGroup section */ 256 | 257 | /* Begin XCBuildConfiguration section */ 258 | 97C147031CF9000F007C117D /* Debug */ = { 259 | isa = XCBuildConfiguration; 260 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 261 | buildSettings = { 262 | ALWAYS_SEARCH_USER_PATHS = NO; 263 | CLANG_ANALYZER_NONNULL = YES; 264 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 265 | CLANG_CXX_LIBRARY = "libc++"; 266 | CLANG_ENABLE_MODULES = YES; 267 | CLANG_ENABLE_OBJC_ARC = YES; 268 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 269 | CLANG_WARN_BOOL_CONVERSION = YES; 270 | CLANG_WARN_COMMA = YES; 271 | CLANG_WARN_CONSTANT_CONVERSION = YES; 272 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 273 | CLANG_WARN_EMPTY_BODY = YES; 274 | CLANG_WARN_ENUM_CONVERSION = YES; 275 | CLANG_WARN_INFINITE_RECURSION = YES; 276 | CLANG_WARN_INT_CONVERSION = YES; 277 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 278 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 279 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 280 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 281 | CLANG_WARN_STRICT_PROTOTYPES = YES; 282 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 286 | COPY_PHASE_STRIP = NO; 287 | DEBUG_INFORMATION_FORMAT = dwarf; 288 | ENABLE_STRICT_OBJC_MSGSEND = YES; 289 | ENABLE_TESTABILITY = YES; 290 | GCC_C_LANGUAGE_STANDARD = gnu99; 291 | GCC_DYNAMIC_NO_PIC = NO; 292 | GCC_NO_COMMON_BLOCKS = YES; 293 | GCC_OPTIMIZATION_LEVEL = 0; 294 | GCC_PREPROCESSOR_DEFINITIONS = ( 295 | "DEBUG=1", 296 | "$(inherited)", 297 | ); 298 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 299 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 300 | GCC_WARN_UNDECLARED_SELECTOR = YES; 301 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 302 | GCC_WARN_UNUSED_FUNCTION = YES; 303 | GCC_WARN_UNUSED_VARIABLE = YES; 304 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 305 | MTL_ENABLE_DEBUG_INFO = YES; 306 | ONLY_ACTIVE_ARCH = YES; 307 | SDKROOT = iphoneos; 308 | TARGETED_DEVICE_FAMILY = "1,2"; 309 | }; 310 | name = Debug; 311 | }; 312 | 97C147041CF9000F007C117D /* Release */ = { 313 | isa = XCBuildConfiguration; 314 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 315 | buildSettings = { 316 | ALWAYS_SEARCH_USER_PATHS = NO; 317 | CLANG_ANALYZER_NONNULL = YES; 318 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 319 | CLANG_CXX_LIBRARY = "libc++"; 320 | CLANG_ENABLE_MODULES = YES; 321 | CLANG_ENABLE_OBJC_ARC = YES; 322 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 323 | CLANG_WARN_BOOL_CONVERSION = YES; 324 | CLANG_WARN_COMMA = YES; 325 | CLANG_WARN_CONSTANT_CONVERSION = YES; 326 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 327 | CLANG_WARN_EMPTY_BODY = YES; 328 | CLANG_WARN_ENUM_CONVERSION = YES; 329 | CLANG_WARN_INFINITE_RECURSION = YES; 330 | CLANG_WARN_INT_CONVERSION = YES; 331 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 333 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 334 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 335 | CLANG_WARN_STRICT_PROTOTYPES = YES; 336 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 337 | CLANG_WARN_UNREACHABLE_CODE = YES; 338 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 339 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 340 | COPY_PHASE_STRIP = NO; 341 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 342 | ENABLE_NS_ASSERTIONS = NO; 343 | ENABLE_STRICT_OBJC_MSGSEND = YES; 344 | GCC_C_LANGUAGE_STANDARD = gnu99; 345 | GCC_NO_COMMON_BLOCKS = YES; 346 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 347 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 348 | GCC_WARN_UNDECLARED_SELECTOR = YES; 349 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 350 | GCC_WARN_UNUSED_FUNCTION = YES; 351 | GCC_WARN_UNUSED_VARIABLE = YES; 352 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 353 | MTL_ENABLE_DEBUG_INFO = NO; 354 | SDKROOT = iphoneos; 355 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 356 | TARGETED_DEVICE_FAMILY = "1,2"; 357 | VALIDATE_PRODUCT = YES; 358 | }; 359 | name = Release; 360 | }; 361 | 97C147061CF9000F007C117D /* Debug */ = { 362 | isa = XCBuildConfiguration; 363 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 364 | buildSettings = { 365 | ARCHS = arm64; 366 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 367 | CLANG_ENABLE_MODULES = YES; 368 | CURRENT_PROJECT_VERSION = 1; 369 | ENABLE_BITCODE = NO; 370 | FRAMEWORK_SEARCH_PATHS = ( 371 | "$(inherited)", 372 | "$(PROJECT_DIR)/Flutter", 373 | ); 374 | INFOPLIST_FILE = Runner/Info.plist; 375 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 376 | LIBRARY_SEARCH_PATHS = ( 377 | "$(inherited)", 378 | "$(PROJECT_DIR)/Flutter", 379 | ); 380 | PRODUCT_BUNDLE_IDENTIFIER = com.codigopanda.example; 381 | PRODUCT_NAME = "$(TARGET_NAME)"; 382 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 383 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 384 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 385 | SWIFT_VERSION = 4.0; 386 | VERSIONING_SYSTEM = "apple-generic"; 387 | }; 388 | name = Debug; 389 | }; 390 | 97C147071CF9000F007C117D /* Release */ = { 391 | isa = XCBuildConfiguration; 392 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 393 | buildSettings = { 394 | ARCHS = arm64; 395 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 396 | CLANG_ENABLE_MODULES = YES; 397 | CURRENT_PROJECT_VERSION = 1; 398 | ENABLE_BITCODE = NO; 399 | FRAMEWORK_SEARCH_PATHS = ( 400 | "$(inherited)", 401 | "$(PROJECT_DIR)/Flutter", 402 | ); 403 | INFOPLIST_FILE = Runner/Info.plist; 404 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 405 | LIBRARY_SEARCH_PATHS = ( 406 | "$(inherited)", 407 | "$(PROJECT_DIR)/Flutter", 408 | ); 409 | PRODUCT_BUNDLE_IDENTIFIER = com.codigopanda.example; 410 | PRODUCT_NAME = "$(TARGET_NAME)"; 411 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 412 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 413 | SWIFT_VERSION = 4.0; 414 | VERSIONING_SYSTEM = "apple-generic"; 415 | }; 416 | name = Release; 417 | }; 418 | /* End XCBuildConfiguration section */ 419 | 420 | /* Begin XCConfigurationList section */ 421 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 422 | isa = XCConfigurationList; 423 | buildConfigurations = ( 424 | 97C147031CF9000F007C117D /* Debug */, 425 | 97C147041CF9000F007C117D /* Release */, 426 | ); 427 | defaultConfigurationIsVisible = 0; 428 | defaultConfigurationName = Release; 429 | }; 430 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 431 | isa = XCConfigurationList; 432 | buildConfigurations = ( 433 | 97C147061CF9000F007C117D /* Debug */, 434 | 97C147071CF9000F007C117D /* Release */, 435 | ); 436 | defaultConfigurationIsVisible = 0; 437 | defaultConfigurationName = Release; 438 | }; 439 | /* End XCConfigurationList section */ 440 | }; 441 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 442 | } 443 | --------------------------------------------------------------------------------