├── .gitattributes ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── io │ └── flutter │ └── plugins │ └── firebase_mlkit_language │ ├── DeleteModel.java │ ├── DownloadModel.java │ ├── FirebaseMlkitLanguagePlugin.java │ ├── Interfaces.java │ ├── LanguageIdentifier.java │ ├── LanguageTranslator.java │ └── ViewModels.java ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── firebase_mlkit_language_example │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── 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 │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── 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-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.lock ├── pubspec.yaml └── test │ └── widget_test.dart ├── firebase_mlkit_language.iml ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── DeleteModel.m │ ├── DownloadModel.m │ ├── FirebaseMlkitLanguagePlugin.h │ ├── FirebaseMlkitLanguagePlugin.m │ ├── LanguageIdentifier.m │ ├── LanguageTranslator.m │ └── ViewModels.m └── firebase_mlkit_language.podspec ├── lib ├── firebase_mlkit_language.dart └── src │ ├── firebase_language.dart │ ├── language_identifier.dart │ ├── language_translator.dart │ └── model_manager.dart ├── pubspec.lock ├── pubspec.yaml └── test └── firebase_mlkit_language_test.dart /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | .project 8 | .classpath 9 | .settings/ 10 | 11 | 12 | build/ 13 | example/ios/Flutter/flutter_export_environment.sh 14 | example/.flutter-plugins-dependencies 15 | -------------------------------------------------------------------------------- /.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: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b 8 | channel: stable 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.1.3 2 | 3 | * Updated Firebase SDK 4 | 5 | ## 1.1.2 6 | 7 | * Minor updates 8 | 9 | ## 1.1.1 10 | 11 | * Minor updates 12 | 13 | ## 1.1.0 14 | 15 | * Added support for Android 16 | 17 | ## 1.0.1 18 | 19 | * Updated README, example 20 | 21 | ## 1.0.0 22 | 23 | * Updated README 24 | 25 | ## 0.0.1 26 | 27 | * Initial release 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the names of its 14 | // contributors may be used to endorse or promote products derived from 15 | // this software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ML Kit Natural Language Plugin 2 | 3 | ![Pub](https://img.shields.io/pub/v/firebase_mlkit_language.svg?color=orange) 4 | 5 | A Flutter plugin to use the [ML Kit Natural Language for Firebase API](https://firebase.google.com/docs/ml-kit/). 6 | 7 | For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). 8 | 9 | *Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/rishab2113/firebase_mlkit_language/issues) and [Pull Requests](https://github.com/rishab2113/firebase_mlkit_language/pulls) are most welcome! 10 | 11 | ## Usage 12 | 13 | To use this plugin, add `firebase_mlkit_language` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). You must also configure Firebase for each platform project: Android and iOS (see the example folder or https://codelabs.developers.google.com/codelabs/flutter-firebase/#4 for step by step details). 14 | 15 | ### iOS 16 | Versions `1.0.0+` use the latest ML Kit for Firebase version which requires a minimum deployment 17 | target of 9.0. You can add the line `platform :ios, '9.0'` in your iOS project `Podfile`. 18 | 19 | ## Supported Languages 20 | All the supported languages can be found [here](https://firebase.google.com/docs/ml-kit/translation-language-support). 21 | 22 | Furthermore, they can be found within the `SupportedLanguages` class. 23 | 24 | ## Using the ML Kit Language Identifier 25 | 26 | ### 1. Create an instance of a language identifier 27 | 28 | Initialize a `LanguageIdentifier`. 29 | 30 | ```dart 31 | final LanguageIdentifier languageIdentifier = FirebaseLanguage.instance.languageIdentifier() 32 | ``` 33 | 34 | ### 2. Call `processText(String)` with `languageIdentifier` 35 | 36 | `processText(String)` returns `List` in decreasing order of probability of detected language. 37 | 38 | ```dart 39 | final List labels = await languageIdentifier.processText('Sample Text'); 40 | ``` 41 | 42 | ### 3. Extract data 43 | 44 | `` contains the language names and confidence of the prediction, accessible via `.text` and `.confidence`. 45 | 46 | ```dart 47 | for (LanguageLabel label in labels) { 48 | final String text = label.text; 49 | final double confidence = label.confidence; 50 | } 51 | ``` 52 | 53 | ## Using the ML Kit Language Translator 54 | 55 | ### Note 56 | 57 | Get an instance of `ModelManager`, and download the needed translation models(optional, results in faster first-use). 58 | 59 | ```dart 60 | FirebaseLanguage.instance.modelManager().downloadModel(SupportedLanguages.lang); 61 | ``` 62 | 63 | ### 1. Create an instance of a language translator 64 | 65 | Initialize a `LanguageTranslator`. 66 | 67 | ```dart 68 | final FirebaseLanguage.instance.languageTranslator(SupportedLanguages.lang, SupportedLanguages.lang); 69 | ``` 70 | 71 | ### 2. Call `processText(String) with languageTranslator` 72 | 73 | `processText(String)` returns a string containing the text translated to the target language. 74 | 75 | ```dart 76 | final String translatedString = await languageTranslator.processText('Sample Text'); 77 | ``` 78 | 79 | ## Using the ML Kit Model Manager 80 | 81 | ### 1. Create an instance of a model manager 82 | 83 | Initialize a `ModelManager` 84 | 85 | ```dart 86 | final ModelManager modelManager = FirebaseLanguage.instance.modelManager() 87 | ``` 88 | 89 | ### 2. Download Model using the model manager 90 | 91 | `downloadModel()` downloads the specified model to the device's local storage. It is recommended to download all the models needed to be used before translating to ensure a fast first-use. On a successful download, the string "Downloaded" will be returned. 92 | 93 | ```dart 94 | modelManager.downloadModel(SupportedLanguages.lang) 95 | ``` 96 | 97 | ### 3. Delete Model using the model manager 98 | 99 | `deleteModel()` deletes the specified model from the device's local storage. On a successful delete, the string "Deleted" will be returned. If the model specified is not present on the device, the string "Model not downloaded" will be returned. 100 | 101 | ```dart 102 | modelManager.deleteModel(SupportedLanguages.lang) 103 | ``` 104 | 105 | ### 4. View Models 106 | 107 | `viewModels()` returns a list of the BCP-47 language codes of all the languages downloaded onto the local storage of the device. 108 | 109 | ```dart 110 | modelManager.viewModels() 111 | ``` 112 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | def PLUGIN = "firebase_mlkit_language"; 2 | def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; 3 | gradle.buildFinished { buildResult -> 4 | if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { 5 | println ' *********************************************************' 6 | println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' 7 | println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' 8 | println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' 9 | println ' *********************************************************' 10 | rootProject.ext.set(ANDROIDX_WARNING, true); 11 | } 12 | } 13 | 14 | group 'io.flutter.plugins.firebase_mlkit_language' 15 | version '1.0-SNAPSHOT' 16 | 17 | buildscript { 18 | repositories { 19 | google() 20 | jcenter() 21 | } 22 | 23 | dependencies { 24 | classpath 'com.android.tools.build:gradle:3.5.2' 25 | } 26 | } 27 | 28 | rootProject.allprojects { 29 | repositories { 30 | google() 31 | jcenter() 32 | } 33 | } 34 | 35 | apply plugin: 'com.android.library' 36 | 37 | android { 38 | compileSdkVersion 29 39 | 40 | defaultConfig { 41 | minSdkVersion 19 42 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 43 | } 44 | lintOptions { 45 | disable 'InvalidPackage' 46 | } 47 | dependencies { 48 | implementation 'androidx.annotation:annotation:1.1.0' 49 | implementation 'com.google.firebase:firebase-ml-natural-language:22.0.0' 50 | implementation 'com.google.firebase:firebase-ml-natural-language-language-id-model:20.0.7' 51 | implementation 'com.google.firebase:firebase-ml-natural-language-translate-model:20.0.7' 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Jul 27 17:31:06 CEST 2019 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-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /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 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 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 Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'firebase_mlkit_language' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/io/flutter/plugins/firebase_mlkit_language/DeleteModel.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins.firebase_mlkit_language; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.android.gms.tasks.OnFailureListener; 6 | import com.google.android.gms.tasks.OnSuccessListener; 7 | import com.google.firebase.ml.naturallanguage.translate.FirebaseTranslateLanguage; 8 | import com.google.firebase.ml.common.modeldownload.FirebaseModelManager; 9 | import com.google.firebase.ml.naturallanguage.translate.FirebaseTranslateRemoteModel; 10 | 11 | import io.flutter.plugin.common.MethodChannel; 12 | 13 | class DeleteModel implements ModelAgent { 14 | 15 | static final DeleteModel instance = new DeleteModel(); 16 | 17 | private DeleteModel() { 18 | } 19 | 20 | @Override 21 | public void handleEvent(String modelName, final MethodChannel.Result result) { 22 | FirebaseTranslateRemoteModel model = new FirebaseTranslateRemoteModel.Builder( 23 | FirebaseTranslateLanguage.languageForLanguageCode(modelName)).build(); 24 | FirebaseModelManager.getInstance().deleteDownloadedModel(model) 25 | .addOnSuccessListener(new OnSuccessListener() { 26 | @Override 27 | public void onSuccess(Void v) { 28 | result.success("Deleted"); 29 | } 30 | }).addOnFailureListener(new OnFailureListener() { 31 | @Override 32 | public void onFailure(@NonNull Exception e) { 33 | result.error("deleteError", e.getLocalizedMessage(), null); 34 | } 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /android/src/main/java/io/flutter/plugins/firebase_mlkit_language/DownloadModel.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins.firebase_mlkit_language; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.android.gms.tasks.OnFailureListener; 6 | import com.google.android.gms.tasks.OnSuccessListener; 7 | import com.google.firebase.ml.common.modeldownload.FirebaseModelDownloadConditions; 8 | import com.google.firebase.ml.naturallanguage.translate.FirebaseTranslateLanguage; 9 | import com.google.firebase.ml.common.modeldownload.FirebaseModelManager; 10 | import com.google.firebase.ml.naturallanguage.translate.FirebaseTranslateRemoteModel; 11 | 12 | import io.flutter.plugin.common.MethodChannel; 13 | 14 | class DownloadModel implements ModelAgent{ 15 | 16 | static final DownloadModel instance = new DownloadModel(); 17 | 18 | private DownloadModel(){} 19 | 20 | @Override 21 | public void handleEvent(String modelName, final MethodChannel.Result result) { 22 | Integer languageCode = FirebaseTranslateLanguage.languageForLanguageCode(modelName); 23 | FirebaseModelDownloadConditions conditions = new FirebaseModelDownloadConditions.Builder().build(); 24 | FirebaseTranslateRemoteModel model = new FirebaseTranslateRemoteModel.Builder(languageCode) 25 | .build(); 26 | FirebaseModelManager.getInstance().download(model, conditions) 27 | .addOnSuccessListener(new OnSuccessListener() { 28 | @Override 29 | public void onSuccess(Void v) { 30 | result.success("Downloaded"); 31 | } 32 | }) 33 | .addOnFailureListener(new OnFailureListener() { 34 | @Override 35 | public void onFailure(@NonNull Exception e) { 36 | result.error("downloadError", e.getLocalizedMessage(), null); 37 | } 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /android/src/main/java/io/flutter/plugins/firebase_mlkit_language/FirebaseMlkitLanguagePlugin.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins.firebase_mlkit_language; 2 | 3 | import java.util.Map; 4 | 5 | import io.flutter.plugin.common.MethodCall; 6 | import io.flutter.plugin.common.MethodChannel; 7 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler; 8 | import io.flutter.plugin.common.MethodChannel.Result; 9 | import io.flutter.plugin.common.PluginRegistry.Registrar; 10 | 11 | /** FirebaseMlkitLanguagePlugin */ 12 | public class FirebaseMlkitLanguagePlugin implements MethodCallHandler { 13 | /** Plugin registration. */ 14 | public static void registerWith(Registrar registrar) { 15 | final MethodChannel channel = 16 | new MethodChannel(registrar.messenger(), "firebase_mlkit_language"); 17 | channel.setMethodCallHandler(new FirebaseMlkitLanguagePlugin()); 18 | } 19 | 20 | @Override 21 | public void onMethodCall(MethodCall call, Result result) { 22 | String modelname = call.argument("model"); 23 | String text = call.argument("text"); 24 | Map options = call.argument("options"); 25 | switch (call.method){ 26 | case "LanguageIdentifier#processText": 27 | LanguageIdentifier.instance.handleEvent(text, options, result); 28 | break; 29 | case "LanguageTranslator#processText": 30 | LanguageTranslator.instance.handleEvent(text, options, result); 31 | break; 32 | case "ModelManager#viewModels": 33 | ViewModels.instance.handleEvent(result); 34 | break; 35 | case "ModelManager#deleteModel": 36 | DeleteModel.instance.handleEvent(modelname,result); 37 | break; 38 | case "ModelManager#downloadModel": 39 | DownloadModel.instance.handleEvent(modelname,result); 40 | break; 41 | default: 42 | result.notImplemented(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /android/src/main/java/io/flutter/plugins/firebase_mlkit_language/Interfaces.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins.firebase_mlkit_language; 2 | 3 | import io.flutter.plugin.common.MethodChannel; 4 | import java.util.Map; 5 | 6 | interface LanguageAgent { 7 | void handleEvent( 8 | String text, Map options, final MethodChannel.Result result); 9 | } 10 | 11 | interface ModelAgent { 12 | void handleEvent(String modelName, final MethodChannel.Result result); 13 | } 14 | 15 | interface ViewModelAgent { 16 | void handleEvent(final MethodChannel.Result result); 17 | } -------------------------------------------------------------------------------- /android/src/main/java/io/flutter/plugins/firebase_mlkit_language/LanguageIdentifier.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins.firebase_mlkit_language; 2 | 3 | import com.google.android.gms.tasks.OnFailureListener; 4 | import com.google.android.gms.tasks.OnSuccessListener; 5 | import com.google.firebase.ml.naturallanguage.FirebaseNaturalLanguage; 6 | import com.google.firebase.ml.naturallanguage.languageid.FirebaseLanguageIdentification; 7 | import com.google.firebase.ml.naturallanguage.languageid.FirebaseLanguageIdentificationOptions; 8 | import com.google.firebase.ml.naturallanguage.languageid.IdentifiedLanguage; 9 | 10 | import java.util.ArrayList; 11 | import java.util.HashMap; 12 | import java.util.List; 13 | import java.util.Map; 14 | 15 | import androidx.annotation.NonNull; 16 | import io.flutter.plugin.common.MethodChannel; 17 | 18 | class LanguageIdentifier implements LanguageAgent{ 19 | 20 | static final LanguageIdentifier instance = new LanguageIdentifier(); 21 | 22 | private LanguageIdentifier(){} 23 | 24 | private FirebaseLanguageIdentification identifier; 25 | private Map lastOptions; 26 | 27 | @Override 28 | public void handleEvent(String text, Map options, final MethodChannel.Result result) { 29 | 30 | if (identifier != null && !options.equals(lastOptions)){ 31 | identifier.close(); 32 | identifier = null; 33 | lastOptions = null; 34 | } 35 | 36 | if (identifier == null){ 37 | lastOptions = options; 38 | identifier = FirebaseNaturalLanguage.getInstance().getLanguageIdentification(parseOptions(lastOptions)); 39 | } 40 | 41 | identifier.identifyPossibleLanguages(text) 42 | .addOnSuccessListener( 43 | new OnSuccessListener>() { 44 | @Override 45 | public void onSuccess(List identifiedLanguages) { 46 | List> labels = new ArrayList<>(identifiedLanguages.size()); 47 | for (IdentifiedLanguage identifiedLanguage : identifiedLanguages) { 48 | Map labelData = new HashMap<>(); 49 | String language = identifiedLanguage.getLanguageCode(); 50 | float confidence = identifiedLanguage.getConfidence(); 51 | labelData.put("confidence", (double) confidence); 52 | labelData.put("languageCode", language); 53 | labels.add(labelData); 54 | } 55 | result.success(labels); 56 | } 57 | }) 58 | .addOnFailureListener( 59 | new OnFailureListener() { 60 | @Override 61 | public void onFailure(@NonNull Exception e) { 62 | result.error("languageIdentifierError", e.getLocalizedMessage(), null); 63 | } 64 | }); 65 | 66 | } 67 | 68 | private FirebaseLanguageIdentificationOptions parseOptions( 69 | Map optionsData) { 70 | float conf = (float) (double) optionsData.get("confidenceThreshold"); 71 | return new FirebaseLanguageIdentificationOptions.Builder() 72 | .setConfidenceThreshold(conf) 73 | .build(); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /android/src/main/java/io/flutter/plugins/firebase_mlkit_language/LanguageTranslator.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins.firebase_mlkit_language; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.android.gms.tasks.OnFailureListener; 6 | import com.google.android.gms.tasks.OnSuccessListener; 7 | import com.google.firebase.ml.common.modeldownload.FirebaseModelDownloadConditions; 8 | import com.google.firebase.ml.naturallanguage.FirebaseNaturalLanguage; 9 | import com.google.firebase.ml.naturallanguage.translate.FirebaseTranslateLanguage; 10 | import com.google.firebase.ml.naturallanguage.translate.FirebaseTranslator; 11 | import com.google.firebase.ml.naturallanguage.translate.FirebaseTranslatorOptions; 12 | 13 | import java.util.Map; 14 | 15 | import io.flutter.plugin.common.MethodChannel; 16 | 17 | class LanguageTranslator implements LanguageAgent{ 18 | 19 | static final LanguageTranslator instance = new LanguageTranslator(); 20 | 21 | private LanguageTranslator(){} 22 | 23 | private FirebaseTranslator translator; 24 | private Map lastOptions; 25 | 26 | @Override 27 | public void handleEvent(final String text, Map options, final MethodChannel.Result result) { 28 | 29 | if (translator != null && !options.equals(lastOptions)){ 30 | translator.close(); 31 | translator = null; 32 | lastOptions = null; 33 | } 34 | 35 | if (translator == null){ 36 | lastOptions = options; 37 | FirebaseTranslatorOptions translatorOptions = 38 | new FirebaseTranslatorOptions.Builder() 39 | .setSourceLanguage(FirebaseTranslateLanguage.languageForLanguageCode((String) options.get("fromLanguage"))) 40 | .setTargetLanguage(FirebaseTranslateLanguage.languageForLanguageCode((String) options.get("toLanguage"))) 41 | .build(); 42 | translator = FirebaseNaturalLanguage.getInstance().getTranslator(translatorOptions); 43 | } 44 | FirebaseModelDownloadConditions conditions = new FirebaseModelDownloadConditions.Builder().build(); 45 | translator.downloadModelIfNeeded(conditions) 46 | .addOnSuccessListener( 47 | new OnSuccessListener() { 48 | @Override 49 | public void onSuccess(Void v) { 50 | translator.translate(text) 51 | .addOnSuccessListener( 52 | new OnSuccessListener() { 53 | @Override 54 | public void onSuccess(@NonNull String translatedText) { 55 | result.success(translatedText); 56 | } 57 | }) 58 | .addOnFailureListener( 59 | new OnFailureListener() { 60 | @Override 61 | public void onFailure(@NonNull Exception e) { 62 | result.error("languageTranslatorError", e.getLocalizedMessage(), null); 63 | } 64 | }); 65 | } 66 | }) 67 | .addOnFailureListener( 68 | new OnFailureListener() { 69 | @Override 70 | public void onFailure(@NonNull Exception e) { 71 | result.error("languageTranslatorError", e.getLocalizedMessage(), null); 72 | } 73 | }); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /android/src/main/java/io/flutter/plugins/firebase_mlkit_language/ViewModels.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins.firebase_mlkit_language; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.android.gms.tasks.OnFailureListener; 6 | import com.google.android.gms.tasks.OnSuccessListener; 7 | import com.google.firebase.FirebaseApp; 8 | import com.google.firebase.ml.common.modeldownload.FirebaseModelManager; 9 | import com.google.firebase.ml.naturallanguage.translate.FirebaseTranslateRemoteModel; 10 | 11 | import java.util.ArrayList; 12 | import java.util.HashMap; 13 | import java.util.List; 14 | import java.util.Map; 15 | import java.util.Set; 16 | 17 | import io.flutter.plugin.common.MethodChannel; 18 | 19 | class ViewModels implements ViewModelAgent { 20 | 21 | static final ViewModels instance = new ViewModels(); 22 | 23 | private ViewModels() { 24 | } 25 | 26 | @Override 27 | public void handleEvent(final MethodChannel.Result result) { 28 | FirebaseModelManager.getInstance().getDownloadedModels(FirebaseTranslateRemoteModel.class) 29 | .addOnSuccessListener(new OnSuccessListener>() { 30 | @Override 31 | public void onSuccess(Set models) { 32 | List translateModels = new ArrayList<>(models.size()); 33 | for (FirebaseTranslateRemoteModel model : models) { 34 | translateModels.add(model.getLanguageCode()); 35 | } 36 | result.success(translateModels); 37 | } 38 | }).addOnFailureListener(new OnFailureListener() { 39 | @Override 40 | public void onFailure(@NonNull Exception e) { 41 | result.error("viewError", e.getLocalizedMessage(), null); 42 | } 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | **/android/**/google-services.json 39 | 40 | # iOS/XCode related 41 | **/ios/**/*.mode1v3 42 | **/ios/**/*.mode2v3 43 | **/ios/**/*.moved-aside 44 | **/ios/**/*.pbxuser 45 | **/ios/**/*.perspectivev3 46 | **/ios/**/*sync/ 47 | **/ios/**/.sconsign.dblite 48 | **/ios/**/.tags* 49 | **/ios/**/.vagrant/ 50 | **/ios/**/DerivedData/ 51 | **/ios/**/Icon? 52 | **/ios/**/Pods/ 53 | **/ios/**/.symlinks/ 54 | **/ios/**/profile 55 | **/ios/**/xcuserdata 56 | **/ios/.generated/ 57 | **/ios/Flutter/App.framework 58 | **/ios/Flutter/Flutter.framework 59 | **/ios/Flutter/Generated.xcconfig 60 | **/ios/Flutter/app.flx 61 | **/ios/Flutter/app.zip 62 | **/ios/Flutter/flutter_assets/ 63 | **/ios/ServiceDefinitions.json 64 | **/ios/Runner/GeneratedPluginRegistrant.* 65 | **/ios/Runner/GoogleService-Info.plist 66 | **/ios/GoogleService-Info.plist 67 | 68 | # Exceptions to above rules. 69 | !**/ios/**/default.mode1v3 70 | !**/ios/**/default.mode2v3 71 | !**/ios/**/default.pbxuser 72 | !**/ios/**/default.perspectivev3 73 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 74 | -------------------------------------------------------------------------------- /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: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # firebase_mlkit_language_example 2 | 3 | Demonstrates how to use the firebase_mlkit_language plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /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 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 29 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.firebase_mlkit_language_example" 37 | minSdkVersion 19 38 | targetSdkVersion 29 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'androidx.test:runner:1.2.0' 60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 61 | } 62 | 63 | apply plugin: 'com.google.gms.google-services' 64 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/firebase_mlkit_language_example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.firebase_mlkit_language_example; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.2' 9 | classpath 'com.google.gms:google-services:4.3.3' 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | google() 16 | jcenter() 17 | } 18 | } 19 | 20 | rootProject.buildDir = '../build' 21 | subprojects { 22 | project.buildDir = "${rootProject.buildDir}/${project.name}" 23 | } 24 | subprojects { 25 | project.evaluationDependsOn(':app') 26 | } 27 | 28 | task clean(type: Delete) { 29 | delete rootProject.buildDir 30 | } 31 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 31 23:51:14 EDT 2019 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-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /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/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 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | pods_ary = [] 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) { |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | pods_ary.push({:name => podname, :path => podpath}); 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | } 32 | return pods_ary 33 | end 34 | 35 | target 'Runner' do 36 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 37 | # referring to absolute paths on developers' machines. 38 | system('rm -rf .symlinks') 39 | system('mkdir -p .symlinks/plugins') 40 | 41 | # Flutter Pods 42 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 43 | if generated_xcode_build_settings.empty? 44 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." 45 | end 46 | generated_xcode_build_settings.map { |p| 47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 48 | symlink = File.join('.symlinks', 'flutter') 49 | File.symlink(File.dirname(p[:path]), symlink) 50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 51 | end 52 | } 53 | 54 | # Plugin Pods 55 | plugin_pods = parse_KV_file('../.flutter-plugins') 56 | plugin_pods.map { |p| 57 | symlink = File.join('.symlinks', 'plugins', p[:name]) 58 | File.symlink(p[:path], symlink) 59 | pod p[:name], :path => File.join(symlink, 'ios') 60 | } 61 | end 62 | 63 | post_install do |installer| 64 | installer.pods_project.targets.each do |target| 65 | target.build_configurations.each do |config| 66 | config.build_settings['ENABLE_BITCODE'] = 'NO' 67 | end 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Firebase/Core (6.1.0): 3 | - Firebase/CoreOnly 4 | - FirebaseAnalytics (= 6.0.1) 5 | - Firebase/CoreOnly (6.1.0): 6 | - FirebaseCore (= 6.0.1) 7 | - Firebase/MLNaturalLanguage (6.1.0): 8 | - Firebase/CoreOnly 9 | - FirebaseMLNaturalLanguage (~> 0.16.1) 10 | - Firebase/MLNLLanguageID (6.1.0): 11 | - Firebase/CoreOnly 12 | - FirebaseMLNLLanguageID (~> 0.16.1) 13 | - Firebase/MLNLTranslate (6.1.0): 14 | - Firebase/CoreOnly 15 | - FirebaseMLNLTranslate (~> 0.16.1) 16 | - firebase_mlkit_language (0.0.1): 17 | - Firebase/Core 18 | - Firebase/MLNaturalLanguage 19 | - Firebase/MLNLLanguageID 20 | - Firebase/MLNLTranslate 21 | - Flutter 22 | - FirebaseABTesting (3.0.0): 23 | - FirebaseCore (~> 6.0) 24 | - Protobuf (~> 3.5) 25 | - FirebaseAnalytics (6.0.1): 26 | - FirebaseCore (~> 6.0) 27 | - FirebaseInstanceID (~> 4.1) 28 | - GoogleAppMeasurement (= 6.0.1) 29 | - GoogleUtilities/AppDelegateSwizzler (~> 6.0) 30 | - GoogleUtilities/MethodSwizzler (~> 6.0) 31 | - GoogleUtilities/Network (~> 6.0) 32 | - "GoogleUtilities/NSData+zlib (~> 6.0)" 33 | - nanopb (~> 0.3) 34 | - FirebaseCore (6.0.1): 35 | - GoogleUtilities/Environment (~> 6.0) 36 | - GoogleUtilities/Logger (~> 6.0) 37 | - FirebaseInstanceID (4.1.0): 38 | - FirebaseCore (~> 6.0) 39 | - GoogleUtilities/Environment (~> 6.0) 40 | - GoogleUtilities/UserDefaults (~> 6.0) 41 | - FirebaseMLCommon (0.16.0): 42 | - FirebaseCore (~> 6.0) 43 | - FirebaseInstanceID (~> 4.0) 44 | - GoogleUtilities/UserDefaults (~> 6.0) 45 | - GTMSessionFetcher/Core (~> 1.1) 46 | - FirebaseMLNaturalLanguage (0.16.1): 47 | - FirebaseCore (~> 6.0) 48 | - FirebaseMLCommon (~> 0.16) 49 | - FirebaseMLNLLanguageID (0.16.1): 50 | - FirebaseCore (~> 6.0) 51 | - FirebaseMLNaturalLanguage (~> 0.16) 52 | - FirebaseMLNLTranslate (0.16.1): 53 | - FirebaseCore (~> 6.0) 54 | - FirebaseMLNaturalLanguage (~> 0.16) 55 | - FirebaseRemoteConfig (~> 4.0) 56 | - FirebaseRemoteConfig (4.0.0): 57 | - FirebaseABTesting (~> 3.0) 58 | - FirebaseCore (~> 6.0) 59 | - FirebaseInstanceID (~> 4.0) 60 | - GoogleUtilities/Environment (~> 6.0) 61 | - "GoogleUtilities/NSData+zlib (~> 6.0)" 62 | - Protobuf (~> 3.5) 63 | - Flutter (1.0.0) 64 | - GoogleAppMeasurement (6.0.1): 65 | - GoogleUtilities/AppDelegateSwizzler (~> 6.0) 66 | - GoogleUtilities/MethodSwizzler (~> 6.0) 67 | - GoogleUtilities/Network (~> 6.0) 68 | - "GoogleUtilities/NSData+zlib (~> 6.0)" 69 | - nanopb (~> 0.3) 70 | - GoogleUtilities/AppDelegateSwizzler (6.2.0): 71 | - GoogleUtilities/Environment 72 | - GoogleUtilities/Logger 73 | - GoogleUtilities/Network 74 | - GoogleUtilities/Environment (6.2.0) 75 | - GoogleUtilities/Logger (6.2.0): 76 | - GoogleUtilities/Environment 77 | - GoogleUtilities/MethodSwizzler (6.2.0): 78 | - GoogleUtilities/Logger 79 | - GoogleUtilities/Network (6.2.0): 80 | - GoogleUtilities/Logger 81 | - "GoogleUtilities/NSData+zlib" 82 | - GoogleUtilities/Reachability 83 | - "GoogleUtilities/NSData+zlib (6.2.0)" 84 | - GoogleUtilities/Reachability (6.2.0): 85 | - GoogleUtilities/Logger 86 | - GoogleUtilities/UserDefaults (6.2.0): 87 | - GoogleUtilities/Logger 88 | - GTMSessionFetcher/Core (1.2.2) 89 | - nanopb (0.3.901): 90 | - nanopb/decode (= 0.3.901) 91 | - nanopb/encode (= 0.3.901) 92 | - nanopb/decode (0.3.901) 93 | - nanopb/encode (0.3.901) 94 | - Protobuf (3.8.0) 95 | 96 | DEPENDENCIES: 97 | - firebase_mlkit_language (from `.symlinks/plugins/firebase_mlkit_language/ios`) 98 | - Flutter (from `.symlinks/flutter/ios`) 99 | 100 | SPEC REPOS: 101 | https://github.com/cocoapods/specs.git: 102 | - Firebase 103 | - FirebaseABTesting 104 | - FirebaseAnalytics 105 | - FirebaseCore 106 | - FirebaseInstanceID 107 | - FirebaseMLCommon 108 | - FirebaseMLNaturalLanguage 109 | - FirebaseMLNLLanguageID 110 | - FirebaseMLNLTranslate 111 | - FirebaseRemoteConfig 112 | - GoogleAppMeasurement 113 | - GoogleUtilities 114 | - GTMSessionFetcher 115 | - nanopb 116 | - Protobuf 117 | 118 | EXTERNAL SOURCES: 119 | firebase_mlkit_language: 120 | :path: ".symlinks/plugins/firebase_mlkit_language/ios" 121 | Flutter: 122 | :path: ".symlinks/flutter/ios" 123 | 124 | SPEC CHECKSUMS: 125 | Firebase: 8d77bb33624ae9b62d745d82ec023de5f70f7e4f 126 | firebase_mlkit_language: 5983dc0bd8e4673741474f2baac5f60b47578112 127 | FirebaseABTesting: a32c488eb75089a61eb3d86db061dfb909d765db 128 | FirebaseAnalytics: 629301c2b9925f3537d4093a17a72751ae5b7084 129 | FirebaseCore: 66bdef3b310a026880e2a5bc8aa586ab62ce4543 130 | FirebaseInstanceID: 27bed93a59b6685f5c3e0c028a878a764fd75c33 131 | FirebaseMLCommon: d430756ba2a16bac8fefc81ea416e7f822f052fd 132 | FirebaseMLNaturalLanguage: 780fea6a1812d9479dc78453cece9a8d87c23ce9 133 | FirebaseMLNLLanguageID: 75dd1ae8f6abe660f58c2c4bee1fe41af2b2f472 134 | FirebaseMLNLTranslate: 589dd15afe9b50a73c8a5bf61678cde7323397a0 135 | FirebaseRemoteConfig: 40f75c6ea20a52bf65ef44e3898910dd5b57c532 136 | Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a 137 | GoogleAppMeasurement: 51d8d9ea48f0ca44484d29cfbdef976fbd4fc336 138 | GoogleUtilities: 996e0db07153674fd1b54b220fda3a3dc3547cba 139 | GTMSessionFetcher: 61bb0f61a4cb560030f1222021178008a5727a23 140 | nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48 141 | Protobuf: 3f617b9a6e73605565086864c9bc26b2bf2dd5a3 142 | 143 | PODFILE CHECKSUM: 3389836f37640698630b8f0670315d626d5f1469 144 | 145 | COCOAPODS: 1.7.1 146 | -------------------------------------------------------------------------------- /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 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 17 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 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 | AA62D04322A2C7CF00333AAD /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = AA62D04222A2C7CF00333AAD /* GoogleService-Info.plist */; }; 23 | FE4C35B54243942834EDD847 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E0E62ABD76D3E9946CBD24DB /* libPods-Runner.a */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXCopyFilesBuildPhase section */ 27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 28 | isa = PBXCopyFilesBuildPhase; 29 | buildActionMask = 2147483647; 30 | dstPath = ""; 31 | dstSubfolderSpec = 10; 32 | files = ( 33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 35 | ); 36 | name = "Embed Frameworks"; 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXCopyFilesBuildPhase section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 06C61E4553AE167CE36828BE /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 43 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 44 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 45 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 46 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 47 | 5D9BBDD3E7EF2E26EC8199EF /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 48 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 49 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 50 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 51 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 52 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 53 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 54 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 56 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 57 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 58 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 59 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | 9F309090A79DADB02ECD56CD /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 61 | AA62D04222A2C7CF00333AAD /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 62 | E0E62ABD76D3E9946CBD24DB /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 71 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 72 | FE4C35B54243942834EDD847 /* libPods-Runner.a in Frameworks */, 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | 73FEE1C53C768B733A9402E0 /* Frameworks */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | E0E62ABD76D3E9946CBD24DB /* libPods-Runner.a */, 83 | ); 84 | name = Frameworks; 85 | sourceTree = ""; 86 | }; 87 | 7CEF28FAD9A4608D3CEA51F8 /* Pods */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 5D9BBDD3E7EF2E26EC8199EF /* Pods-Runner.debug.xcconfig */, 91 | 06C61E4553AE167CE36828BE /* Pods-Runner.release.xcconfig */, 92 | 9F309090A79DADB02ECD56CD /* Pods-Runner.profile.xcconfig */, 93 | ); 94 | path = Pods; 95 | sourceTree = ""; 96 | }; 97 | 9740EEB11CF90186004384FC /* Flutter */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 3B80C3931E831B6300D905FE /* App.framework */, 101 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 102 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 103 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 104 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 105 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 106 | ); 107 | name = Flutter; 108 | sourceTree = ""; 109 | }; 110 | 97C146E51CF9000F007C117D = { 111 | isa = PBXGroup; 112 | children = ( 113 | 9740EEB11CF90186004384FC /* Flutter */, 114 | 97C146F01CF9000F007C117D /* Runner */, 115 | 97C146EF1CF9000F007C117D /* Products */, 116 | 7CEF28FAD9A4608D3CEA51F8 /* Pods */, 117 | 73FEE1C53C768B733A9402E0 /* Frameworks */, 118 | ); 119 | sourceTree = ""; 120 | }; 121 | 97C146EF1CF9000F007C117D /* Products */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 97C146EE1CF9000F007C117D /* Runner.app */, 125 | ); 126 | name = Products; 127 | sourceTree = ""; 128 | }; 129 | 97C146F01CF9000F007C117D /* Runner */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | AA62D04222A2C7CF00333AAD /* GoogleService-Info.plist */, 133 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 134 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 135 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 136 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 137 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 138 | 97C147021CF9000F007C117D /* Info.plist */, 139 | 97C146F11CF9000F007C117D /* Supporting Files */, 140 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 141 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 142 | ); 143 | path = Runner; 144 | sourceTree = ""; 145 | }; 146 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 97C146F21CF9000F007C117D /* main.m */, 150 | ); 151 | name = "Supporting Files"; 152 | sourceTree = ""; 153 | }; 154 | /* End PBXGroup section */ 155 | 156 | /* Begin PBXNativeTarget section */ 157 | 97C146ED1CF9000F007C117D /* Runner */ = { 158 | isa = PBXNativeTarget; 159 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 160 | buildPhases = ( 161 | 607429208A25009047CEE4D0 /* [CP] Check Pods Manifest.lock */, 162 | 9740EEB61CF901F6004384FC /* Run Script */, 163 | 97C146EA1CF9000F007C117D /* Sources */, 164 | 97C146EB1CF9000F007C117D /* Frameworks */, 165 | 97C146EC1CF9000F007C117D /* Resources */, 166 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 167 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 168 | 7F567980A427A6D7A5E9E2D5 /* [CP] Embed Pods Frameworks */, 169 | DCC807AE6057016EE91152D0 /* [CP] Copy Pods Resources */, 170 | ); 171 | buildRules = ( 172 | ); 173 | dependencies = ( 174 | ); 175 | name = Runner; 176 | productName = Runner; 177 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 178 | productType = "com.apple.product-type.application"; 179 | }; 180 | /* End PBXNativeTarget section */ 181 | 182 | /* Begin PBXProject section */ 183 | 97C146E61CF9000F007C117D /* Project object */ = { 184 | isa = PBXProject; 185 | attributes = { 186 | LastUpgradeCheck = 0910; 187 | ORGANIZATIONNAME = "The Chromium Authors"; 188 | TargetAttributes = { 189 | 97C146ED1CF9000F007C117D = { 190 | CreatedOnToolsVersion = 7.3.1; 191 | DevelopmentTeam = 5K43Q6FF67; 192 | }; 193 | }; 194 | }; 195 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 196 | compatibilityVersion = "Xcode 3.2"; 197 | developmentRegion = English; 198 | hasScannedForEncodings = 0; 199 | knownRegions = ( 200 | English, 201 | en, 202 | Base, 203 | ); 204 | mainGroup = 97C146E51CF9000F007C117D; 205 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 206 | projectDirPath = ""; 207 | projectRoot = ""; 208 | targets = ( 209 | 97C146ED1CF9000F007C117D /* Runner */, 210 | ); 211 | }; 212 | /* End PBXProject section */ 213 | 214 | /* Begin PBXResourcesBuildPhase section */ 215 | 97C146EC1CF9000F007C117D /* Resources */ = { 216 | isa = PBXResourcesBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 220 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 221 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 222 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 223 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 224 | AA62D04322A2C7CF00333AAD /* GoogleService-Info.plist in Resources */, 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | /* End PBXResourcesBuildPhase section */ 229 | 230 | /* Begin PBXShellScriptBuildPhase section */ 231 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 232 | isa = PBXShellScriptBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | ); 236 | inputPaths = ( 237 | ); 238 | name = "Thin Binary"; 239 | outputPaths = ( 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | shellPath = /bin/sh; 243 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 244 | }; 245 | 607429208A25009047CEE4D0 /* [CP] Check Pods Manifest.lock */ = { 246 | isa = PBXShellScriptBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | ); 250 | inputFileListPaths = ( 251 | ); 252 | inputPaths = ( 253 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 254 | "${PODS_ROOT}/Manifest.lock", 255 | ); 256 | name = "[CP] Check Pods Manifest.lock"; 257 | outputFileListPaths = ( 258 | ); 259 | outputPaths = ( 260 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | shellPath = /bin/sh; 264 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 265 | showEnvVarsInLog = 0; 266 | }; 267 | 7F567980A427A6D7A5E9E2D5 /* [CP] Embed Pods Frameworks */ = { 268 | isa = PBXShellScriptBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | ); 272 | inputPaths = ( 273 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 274 | "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", 275 | ); 276 | name = "[CP] Embed Pods Frameworks"; 277 | outputPaths = ( 278 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | shellPath = /bin/sh; 282 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 283 | showEnvVarsInLog = 0; 284 | }; 285 | 9740EEB61CF901F6004384FC /* Run Script */ = { 286 | isa = PBXShellScriptBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | ); 290 | inputPaths = ( 291 | ); 292 | name = "Run Script"; 293 | outputPaths = ( 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | shellPath = /bin/sh; 297 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 298 | }; 299 | DCC807AE6057016EE91152D0 /* [CP] Copy Pods Resources */ = { 300 | isa = PBXShellScriptBuildPhase; 301 | buildActionMask = 2147483647; 302 | files = ( 303 | ); 304 | inputPaths = ( 305 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", 306 | "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseMLNLTranslate/FirebaseMLNLTranslateResource.bundle", 307 | ); 308 | name = "[CP] Copy Pods Resources"; 309 | outputPaths = ( 310 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseMLNLTranslateResource.bundle", 311 | ); 312 | runOnlyForDeploymentPostprocessing = 0; 313 | shellPath = /bin/sh; 314 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; 315 | showEnvVarsInLog = 0; 316 | }; 317 | /* End PBXShellScriptBuildPhase section */ 318 | 319 | /* Begin PBXSourcesBuildPhase section */ 320 | 97C146EA1CF9000F007C117D /* Sources */ = { 321 | isa = PBXSourcesBuildPhase; 322 | buildActionMask = 2147483647; 323 | files = ( 324 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 325 | 97C146F31CF9000F007C117D /* main.m in Sources */, 326 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 327 | ); 328 | runOnlyForDeploymentPostprocessing = 0; 329 | }; 330 | /* End PBXSourcesBuildPhase section */ 331 | 332 | /* Begin PBXVariantGroup section */ 333 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 334 | isa = PBXVariantGroup; 335 | children = ( 336 | 97C146FB1CF9000F007C117D /* Base */, 337 | ); 338 | name = Main.storyboard; 339 | sourceTree = ""; 340 | }; 341 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 342 | isa = PBXVariantGroup; 343 | children = ( 344 | 97C147001CF9000F007C117D /* Base */, 345 | ); 346 | name = LaunchScreen.storyboard; 347 | sourceTree = ""; 348 | }; 349 | /* End PBXVariantGroup section */ 350 | 351 | /* Begin XCBuildConfiguration section */ 352 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 353 | isa = XCBuildConfiguration; 354 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 355 | buildSettings = { 356 | ALWAYS_SEARCH_USER_PATHS = NO; 357 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 358 | CLANG_ANALYZER_NONNULL = YES; 359 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 360 | CLANG_CXX_LIBRARY = "libc++"; 361 | CLANG_ENABLE_MODULES = YES; 362 | CLANG_ENABLE_OBJC_ARC = YES; 363 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 364 | CLANG_WARN_BOOL_CONVERSION = YES; 365 | CLANG_WARN_COMMA = YES; 366 | CLANG_WARN_CONSTANT_CONVERSION = YES; 367 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 368 | CLANG_WARN_EMPTY_BODY = YES; 369 | CLANG_WARN_ENUM_CONVERSION = YES; 370 | CLANG_WARN_INFINITE_RECURSION = YES; 371 | CLANG_WARN_INT_CONVERSION = YES; 372 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 373 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 374 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 375 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 376 | CLANG_WARN_STRICT_PROTOTYPES = YES; 377 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 378 | CLANG_WARN_UNREACHABLE_CODE = YES; 379 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 380 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 381 | COPY_PHASE_STRIP = NO; 382 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 383 | ENABLE_NS_ASSERTIONS = NO; 384 | ENABLE_STRICT_OBJC_MSGSEND = YES; 385 | GCC_C_LANGUAGE_STANDARD = gnu99; 386 | GCC_NO_COMMON_BLOCKS = YES; 387 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 388 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 389 | GCC_WARN_UNDECLARED_SELECTOR = YES; 390 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 391 | GCC_WARN_UNUSED_FUNCTION = YES; 392 | GCC_WARN_UNUSED_VARIABLE = YES; 393 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 394 | MTL_ENABLE_DEBUG_INFO = NO; 395 | SDKROOT = iphoneos; 396 | TARGETED_DEVICE_FAMILY = "1,2"; 397 | VALIDATE_PRODUCT = YES; 398 | }; 399 | name = Profile; 400 | }; 401 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 402 | isa = XCBuildConfiguration; 403 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 404 | buildSettings = { 405 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 406 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 407 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 408 | DEVELOPMENT_TEAM = 5K43Q6FF67; 409 | ENABLE_BITCODE = NO; 410 | FRAMEWORK_SEARCH_PATHS = ( 411 | "$(inherited)", 412 | "$(PROJECT_DIR)/Flutter", 413 | ); 414 | INFOPLIST_FILE = Runner/Info.plist; 415 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 416 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 417 | LIBRARY_SEARCH_PATHS = ( 418 | "$(inherited)", 419 | "$(PROJECT_DIR)/Flutter", 420 | ); 421 | PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseMlkitLanguageExample; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | VERSIONING_SYSTEM = "apple-generic"; 424 | }; 425 | name = Profile; 426 | }; 427 | 97C147031CF9000F007C117D /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 430 | buildSettings = { 431 | ALWAYS_SEARCH_USER_PATHS = NO; 432 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 433 | CLANG_ANALYZER_NONNULL = YES; 434 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 435 | CLANG_CXX_LIBRARY = "libc++"; 436 | CLANG_ENABLE_MODULES = YES; 437 | CLANG_ENABLE_OBJC_ARC = YES; 438 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 439 | CLANG_WARN_BOOL_CONVERSION = YES; 440 | CLANG_WARN_COMMA = YES; 441 | CLANG_WARN_CONSTANT_CONVERSION = YES; 442 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 443 | CLANG_WARN_EMPTY_BODY = YES; 444 | CLANG_WARN_ENUM_CONVERSION = YES; 445 | CLANG_WARN_INFINITE_RECURSION = YES; 446 | CLANG_WARN_INT_CONVERSION = YES; 447 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 448 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 449 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 450 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 451 | CLANG_WARN_STRICT_PROTOTYPES = YES; 452 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 453 | CLANG_WARN_UNREACHABLE_CODE = YES; 454 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 455 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 456 | COPY_PHASE_STRIP = NO; 457 | DEBUG_INFORMATION_FORMAT = dwarf; 458 | ENABLE_STRICT_OBJC_MSGSEND = YES; 459 | ENABLE_TESTABILITY = YES; 460 | GCC_C_LANGUAGE_STANDARD = gnu99; 461 | GCC_DYNAMIC_NO_PIC = NO; 462 | GCC_NO_COMMON_BLOCKS = YES; 463 | GCC_OPTIMIZATION_LEVEL = 0; 464 | GCC_PREPROCESSOR_DEFINITIONS = ( 465 | "DEBUG=1", 466 | "$(inherited)", 467 | ); 468 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 469 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 470 | GCC_WARN_UNDECLARED_SELECTOR = YES; 471 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 472 | GCC_WARN_UNUSED_FUNCTION = YES; 473 | GCC_WARN_UNUSED_VARIABLE = YES; 474 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 475 | MTL_ENABLE_DEBUG_INFO = YES; 476 | ONLY_ACTIVE_ARCH = YES; 477 | SDKROOT = iphoneos; 478 | TARGETED_DEVICE_FAMILY = "1,2"; 479 | }; 480 | name = Debug; 481 | }; 482 | 97C147041CF9000F007C117D /* Release */ = { 483 | isa = XCBuildConfiguration; 484 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 485 | buildSettings = { 486 | ALWAYS_SEARCH_USER_PATHS = NO; 487 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 488 | CLANG_ANALYZER_NONNULL = YES; 489 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 490 | CLANG_CXX_LIBRARY = "libc++"; 491 | CLANG_ENABLE_MODULES = YES; 492 | CLANG_ENABLE_OBJC_ARC = YES; 493 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 494 | CLANG_WARN_BOOL_CONVERSION = YES; 495 | CLANG_WARN_COMMA = YES; 496 | CLANG_WARN_CONSTANT_CONVERSION = YES; 497 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 498 | CLANG_WARN_EMPTY_BODY = YES; 499 | CLANG_WARN_ENUM_CONVERSION = YES; 500 | CLANG_WARN_INFINITE_RECURSION = YES; 501 | CLANG_WARN_INT_CONVERSION = YES; 502 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 503 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 504 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 505 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 506 | CLANG_WARN_STRICT_PROTOTYPES = YES; 507 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 508 | CLANG_WARN_UNREACHABLE_CODE = YES; 509 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 510 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 511 | COPY_PHASE_STRIP = NO; 512 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 513 | ENABLE_NS_ASSERTIONS = NO; 514 | ENABLE_STRICT_OBJC_MSGSEND = YES; 515 | GCC_C_LANGUAGE_STANDARD = gnu99; 516 | GCC_NO_COMMON_BLOCKS = YES; 517 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 518 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 519 | GCC_WARN_UNDECLARED_SELECTOR = YES; 520 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 521 | GCC_WARN_UNUSED_FUNCTION = YES; 522 | GCC_WARN_UNUSED_VARIABLE = YES; 523 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 524 | MTL_ENABLE_DEBUG_INFO = NO; 525 | SDKROOT = iphoneos; 526 | TARGETED_DEVICE_FAMILY = "1,2"; 527 | VALIDATE_PRODUCT = YES; 528 | }; 529 | name = Release; 530 | }; 531 | 97C147061CF9000F007C117D /* Debug */ = { 532 | isa = XCBuildConfiguration; 533 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 534 | buildSettings = { 535 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 536 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 537 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 538 | DEVELOPMENT_TEAM = 5K43Q6FF67; 539 | ENABLE_BITCODE = NO; 540 | FRAMEWORK_SEARCH_PATHS = ( 541 | "$(inherited)", 542 | "$(PROJECT_DIR)/Flutter", 543 | ); 544 | INFOPLIST_FILE = Runner/Info.plist; 545 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 546 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 547 | LIBRARY_SEARCH_PATHS = ( 548 | "$(inherited)", 549 | "$(PROJECT_DIR)/Flutter", 550 | ); 551 | PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseMlkitLanguageExample; 552 | PRODUCT_NAME = "$(TARGET_NAME)"; 553 | VERSIONING_SYSTEM = "apple-generic"; 554 | }; 555 | name = Debug; 556 | }; 557 | 97C147071CF9000F007C117D /* Release */ = { 558 | isa = XCBuildConfiguration; 559 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 560 | buildSettings = { 561 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 562 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 563 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 564 | DEVELOPMENT_TEAM = 5K43Q6FF67; 565 | ENABLE_BITCODE = NO; 566 | FRAMEWORK_SEARCH_PATHS = ( 567 | "$(inherited)", 568 | "$(PROJECT_DIR)/Flutter", 569 | ); 570 | INFOPLIST_FILE = Runner/Info.plist; 571 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 572 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 573 | LIBRARY_SEARCH_PATHS = ( 574 | "$(inherited)", 575 | "$(PROJECT_DIR)/Flutter", 576 | ); 577 | PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseMlkitLanguageExample; 578 | PRODUCT_NAME = "$(TARGET_NAME)"; 579 | VERSIONING_SYSTEM = "apple-generic"; 580 | }; 581 | name = Release; 582 | }; 583 | /* End XCBuildConfiguration section */ 584 | 585 | /* Begin XCConfigurationList section */ 586 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 587 | isa = XCConfigurationList; 588 | buildConfigurations = ( 589 | 97C147031CF9000F007C117D /* Debug */, 590 | 97C147041CF9000F007C117D /* Release */, 591 | 249021D3217E4FDB00AE95B9 /* Profile */, 592 | ); 593 | defaultConfigurationIsVisible = 0; 594 | defaultConfigurationName = Release; 595 | }; 596 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 597 | isa = XCConfigurationList; 598 | buildConfigurations = ( 599 | 97C147061CF9000F007C117D /* Debug */, 600 | 97C147071CF9000F007C117D /* Release */, 601 | 249021D4217E4FDB00AE95B9 /* Profile */, 602 | ); 603 | defaultConfigurationIsVisible = 0; 604 | defaultConfigurationName = Release; 605 | }; 606 | /* End XCConfigurationList section */ 607 | }; 608 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 609 | } 610 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /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/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/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/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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/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/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 | firebase_mlkit_language_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:firebase_mlkit_language/firebase_mlkit_language.dart'; 4 | 5 | void main() => runApp(MyApp()); 6 | 7 | class MyApp extends StatefulWidget { 8 | @override 9 | _MyAppState createState() => _MyAppState(); 10 | } 11 | 12 | class _MyAppState extends State { 13 | @override 14 | void initState() { 15 | super.initState(); 16 | } 17 | 18 | final inputTextController = TextEditingController(); 19 | 20 | @override 21 | void dispose() { 22 | // Clean up the controller when the Widget is disposed 23 | inputTextController.dispose(); 24 | super.dispose(); 25 | } 26 | 27 | var translatedText = "Translated Text"; 28 | var inputText; 29 | var identifiedLang = "Detected Language"; 30 | var downloadedModelsLabel = ""; 31 | 32 | void onPressed() async { 33 | inputText = inputTextController.text; 34 | var result = await FirebaseLanguage.instance 35 | .languageTranslator( 36 | SupportedLanguages.English, SupportedLanguages.Spanish) 37 | .processText(inputText); 38 | setState(() { 39 | translatedText = result; 40 | }); 41 | } 42 | 43 | void onPoked() async { 44 | inputText = inputTextController.text; 45 | var result = await FirebaseLanguage.instance 46 | .languageIdentifier() 47 | .processText(inputText); 48 | 49 | setState(() { 50 | identifiedLang = result[0].languageCode; //returns most probable 51 | }); 52 | } 53 | 54 | void onGetDownloadedModels() async { 55 | var downloadedModels = 56 | await FirebaseLanguage.instance.modelManager().viewModels(); 57 | setState(() { 58 | downloadedModelsLabel = downloadedModels.join(','); 59 | }); 60 | } 61 | 62 | void onDownloadCSModel() async { 63 | await FirebaseLanguage.instance.modelManager().downloadModel("cs"); 64 | onGetDownloadedModels(); 65 | } 66 | 67 | void onDeleteCSModel() async { 68 | await FirebaseLanguage.instance.modelManager().deleteModel("cs"); 69 | onGetDownloadedModels(); 70 | } 71 | 72 | @override 73 | Widget build(BuildContext context) { 74 | return MaterialApp( 75 | home: Scaffold( 76 | appBar: AppBar( 77 | title: const Text("Plug-In Example App"), 78 | backgroundColor: Colors.blue, 79 | ), 80 | body: new Container( 81 | padding: EdgeInsets.all(10), 82 | child: new Center( 83 | child: new Column( 84 | mainAxisAlignment: MainAxisAlignment.center, 85 | children: [ 86 | new TextField(controller: inputTextController), 87 | new SizedBox(height: 10), 88 | new RaisedButton( 89 | child: new Text("Translate", 90 | style: TextStyle(color: Colors.white)), 91 | color: Colors.blue, 92 | onPressed: onPressed), 93 | new SizedBox(height: 5), 94 | new Container( 95 | padding: EdgeInsets.all(20), 96 | child: new SizedBox( 97 | child: new Text(translatedText), height: 20), 98 | decoration: new BoxDecoration( 99 | color: Colors.black.withOpacity(0.05), 100 | ), 101 | ), 102 | new SizedBox(height: 5), 103 | new RaisedButton( 104 | child: new Text("Identify Language", 105 | style: TextStyle(color: Colors.white)), 106 | color: Colors.blue, 107 | onPressed: onPoked), 108 | new SizedBox(height: 5), 109 | new Container( 110 | padding: EdgeInsets.all(10), 111 | child: new Text(identifiedLang), 112 | decoration: new BoxDecoration( 113 | color: Colors.black.withOpacity(0.05), 114 | ), 115 | ), 116 | new SizedBox(height: 5), 117 | new RaisedButton( 118 | child: new Text("Show downloaded models", 119 | style: TextStyle(color: Colors.white)), 120 | color: Colors.blue, 121 | onPressed: onGetDownloadedModels), 122 | new SizedBox(height: 5), 123 | new Container( 124 | padding: EdgeInsets.all(10), 125 | child: new Text(downloadedModelsLabel), 126 | decoration: new BoxDecoration( 127 | color: Colors.black.withOpacity(0.05), 128 | ), 129 | ), 130 | new SizedBox(height: 5), 131 | new RaisedButton( 132 | child: new Text("Download cs model", 133 | style: TextStyle(color: Colors.white)), 134 | color: Colors.blue, 135 | onPressed: onDownloadCSModel), 136 | new SizedBox(height: 5), 137 | new RaisedButton( 138 | child: new Text("Delete cs model", 139 | style: TextStyle(color: Colors.white)), 140 | color: Colors.blue, 141 | onPressed: onDeleteCSModel), 142 | ], 143 | ), 144 | ), 145 | )), 146 | ); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /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.5.0-nullsafety.1" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.1.0-nullsafety.1" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.0-nullsafety.3" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.2.0-nullsafety.1" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.0-nullsafety.1" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.15.0-nullsafety.3" 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 | fake_async: 54 | dependency: transitive 55 | description: 56 | name: fake_async 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.2.0-nullsafety.1" 60 | firebase_mlkit_language: 61 | dependency: "direct dev" 62 | description: 63 | path: ".." 64 | relative: true 65 | source: path 66 | version: "1.1.3" 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 | matcher: 78 | dependency: transitive 79 | description: 80 | name: matcher 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "0.12.10-nullsafety.1" 84 | meta: 85 | dependency: transitive 86 | description: 87 | name: meta 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "1.3.0-nullsafety.4" 91 | path: 92 | dependency: transitive 93 | description: 94 | name: path 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "1.8.0-nullsafety.1" 98 | sky_engine: 99 | dependency: transitive 100 | description: flutter 101 | source: sdk 102 | version: "0.0.99" 103 | source_span: 104 | dependency: transitive 105 | description: 106 | name: source_span 107 | url: "https://pub.dartlang.org" 108 | source: hosted 109 | version: "1.8.0-nullsafety.2" 110 | stack_trace: 111 | dependency: transitive 112 | description: 113 | name: stack_trace 114 | url: "https://pub.dartlang.org" 115 | source: hosted 116 | version: "1.10.0-nullsafety.2" 117 | stream_channel: 118 | dependency: transitive 119 | description: 120 | name: stream_channel 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "2.1.0-nullsafety.1" 124 | string_scanner: 125 | dependency: transitive 126 | description: 127 | name: string_scanner 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.1.0-nullsafety.1" 131 | term_glyph: 132 | dependency: transitive 133 | description: 134 | name: term_glyph 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "1.2.0-nullsafety.1" 138 | test_api: 139 | dependency: transitive 140 | description: 141 | name: test_api 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "0.2.19-nullsafety.2" 145 | typed_data: 146 | dependency: transitive 147 | description: 148 | name: typed_data 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.3.0-nullsafety.3" 152 | vector_math: 153 | dependency: transitive 154 | description: 155 | name: vector_math 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "2.1.0-nullsafety.3" 159 | sdks: 160 | dart: ">=2.10.0-110 <=2.11.0-213.1.beta" 161 | flutter: ">=1.12.0 <2.0.0" 162 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: firebase_mlkit_language_example 2 | description: Demonstrates how to use the firebase_mlkit_language plugin. 3 | publish_to: 'none' 4 | 5 | environment: 6 | sdk: ">=2.1.0 <3.0.0" 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | 12 | # The following adds the Cupertino Icons font to your application. 13 | # Use with the CupertinoIcons class for iOS style icons. 14 | cupertino_icons: ^0.1.2 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | 20 | firebase_mlkit_language: 21 | path: ../ 22 | 23 | # For information on the generic Dart part of this file, see the 24 | # following page: https://www.dartlang.org/tools/pub/pubspec 25 | 26 | # The following section is specific to Flutter. 27 | flutter: 28 | 29 | # The following line ensures that the Material Icons font is 30 | # included with your application, so that you can use the icons in 31 | # the material Icons class. 32 | uses-material-design: true 33 | 34 | # To add assets to your application, add an assets section, like this: 35 | # assets: 36 | # - images/a_dot_burr.jpeg 37 | # - images/a_dot_ham.jpeg 38 | 39 | # An image asset can refer to one or more resolution-specific "variants", see 40 | # https://flutter.dev/assets-and-images/#resolution-aware. 41 | 42 | # For details regarding adding assets from package dependencies, see 43 | # https://flutter.dev/assets-and-images/#from-packages 44 | 45 | # To add custom fonts to your application, add a fonts section here, 46 | # in this "flutter" section. Each entry in this list should have a 47 | # "family" key with the font family name, and a "fonts" key with a 48 | # list giving the asset and other descriptors for the font. For 49 | # example: 50 | # fonts: 51 | # - family: Schyler 52 | # fonts: 53 | # - asset: fonts/Schyler-Regular.ttf 54 | # - asset: fonts/Schyler-Italic.ttf 55 | # style: italic 56 | # - family: Trajan Pro 57 | # fonts: 58 | # - asset: fonts/TrajanPro.ttf 59 | # - asset: fonts/TrajanPro_Bold.ttf 60 | # weight: 700 61 | # 62 | # For details regarding fonts from package dependencies, 63 | # see https://flutter.dev/custom-fonts/#from-packages 64 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | // import 'package:flutter/material.dart'; 9 | // import 'package:flutter_test/flutter_test.dart'; 10 | // 11 | // import 'package:firebase_mlkit_language_example/main.dart'; 12 | // 13 | // void main() {} 14 | -------------------------------------------------------------------------------- /firebase_mlkit_language.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /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 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabnayak/firebase_mlkit_language/95aa2e09c78daa966d73a837a5bd901c74429cff/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/DeleteModel.m: -------------------------------------------------------------------------------- 1 | #import "FirebaseMlkitLanguagePlugin.h" 2 | 3 | @import FirebaseMLCommon; 4 | 5 | @implementation DeleteModel 6 | 7 | + (void)handleEvent:(NSString *)text result:(FlutterResult)result { 8 | FIRTranslateLanguage modelName = FIRTranslateLanguageForLanguageCode(text); 9 | 10 | NSSet *localModels = 11 | [[FIRModelManager modelManager] availableTranslateModelsWithApp:FIRApp.defaultApp]; 12 | 13 | Boolean isModelPresent = [localModels 14 | containsObject:[FIRTranslateRemoteModel translateRemoteModelWithLanguage:modelName]]; 15 | 16 | if (isModelPresent) { 17 | [[FIRModelManager modelManager] 18 | deleteDownloadedTranslateModel:[FIRTranslateRemoteModel 19 | translateRemoteModelWithLanguage:modelName] 20 | completion:^(NSError *_Nullable error) { 21 | if (error != nil) { 22 | [FLTFirebaseMlkitLanguagePlugin handleError:error result:result]; 23 | return; 24 | } 25 | result(@"Deleted"); 26 | }]; 27 | } else { 28 | result(@"Model not downloaded"); 29 | } 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /ios/Classes/DownloadModel.m: -------------------------------------------------------------------------------- 1 | #import "FirebaseMlkitLanguagePlugin.h" 2 | 3 | @import FirebaseMLCommon; 4 | 5 | @implementation DownloadModel 6 | 7 | + (void)handleEvent:(NSString *)text result:(FlutterResult)result { 8 | FIRTranslateLanguage modelName = FIRTranslateLanguageForLanguageCode(text); 9 | FIRModelDownloadConditions *conditions = 10 | [[FIRModelDownloadConditions alloc] initWithAllowsCellularAccess:YES 11 | allowsBackgroundDownloading:YES]; 12 | FIRTranslateRemoteModel *modelToDownload = 13 | [FIRTranslateRemoteModel translateRemoteModelForApp:FIRApp.defaultApp 14 | language:modelName 15 | conditions:conditions]; 16 | if ([[FIRModelManager modelManager] isRemoteModelDownloaded:modelToDownload]) { 17 | result(@"Already Downloaded"); 18 | } else { 19 | [[FIRModelManager modelManager] downloadRemoteModel:modelToDownload]; 20 | result(@"Downloaded"); 21 | } 22 | } 23 | @end 24 | -------------------------------------------------------------------------------- /ios/Classes/FirebaseMlkitLanguagePlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "Firebase/Firebase.h" 4 | 5 | @interface FLTFirebaseMlkitLanguagePlugin : NSObject 6 | + (void)handleError:(NSError *)error result:(FlutterResult)result; 7 | @end 8 | 9 | @protocol LangAgent 10 | @required 11 | + (void)handleEvent:(NSString *)text options:(NSDictionary *)options result:(FlutterResult)result; 12 | @optional 13 | @end 14 | 15 | @protocol ModelAgent 16 | @required 17 | + (void)handleEvent:(NSString *)text result:(FlutterResult)result; 18 | @optional 19 | @end 20 | 21 | @protocol ViewModelAgent 22 | @required 23 | + (void)result:(FlutterResult)result; 24 | @optional 25 | @end 26 | 27 | @interface LanguageIdentifier : NSObject 28 | @end 29 | 30 | @interface LanguageTranslator : NSObject 31 | @end 32 | 33 | @interface DeleteModel : NSObject 34 | @end 35 | 36 | @interface ViewModels : NSObject 37 | @end 38 | 39 | @interface DownloadModel : NSObject 40 | @end 41 | -------------------------------------------------------------------------------- /ios/Classes/FirebaseMlkitLanguagePlugin.m: -------------------------------------------------------------------------------- 1 | #import "FirebaseMlkitLanguagePlugin.h" 2 | 3 | static FlutterError *getFlutterError(NSError *error) { 4 | return [FlutterError errorWithCode:[NSString stringWithFormat:@"Error %d", (int)error.code] 5 | message:error.domain 6 | details:error.localizedDescription]; 7 | } 8 | 9 | @implementation FLTFirebaseMlkitLanguagePlugin 10 | 11 | + (void)handleError:(NSError *)error result:(FlutterResult)result { 12 | result(getFlutterError(error)); 13 | } 14 | 15 | + (void)registerWithRegistrar:(NSObject *)registrar { 16 | FlutterMethodChannel *channel = 17 | [FlutterMethodChannel methodChannelWithName:@"firebase_mlkit_language" 18 | binaryMessenger:[registrar messenger]]; 19 | FLTFirebaseMlkitLanguagePlugin *instance = [[FLTFirebaseMlkitLanguagePlugin alloc] init]; 20 | [registrar addMethodCallDelegate:instance channel:channel]; 21 | } 22 | 23 | - (instancetype)init { 24 | self = [super init]; 25 | if (self) { 26 | if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { 27 | NSLog(@"Configuring the default Firebase app..."); 28 | [FIRApp configure]; 29 | NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); 30 | } 31 | } 32 | return self; 33 | } 34 | 35 | - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { 36 | NSString *modelname = call.arguments[@"model"]; 37 | NSString *text = call.arguments[@"text"]; 38 | NSDictionary *options = call.arguments[@"options"]; 39 | if ([@"LanguageIdentifier#processText" isEqualToString:call.method]) { 40 | [LanguageIdentifier handleEvent:text options:options result:result]; 41 | } else if ([@"LanguageTranslator#processText" isEqualToString:call.method]) { 42 | [LanguageTranslator handleEvent:text options:options result:result]; 43 | } else if ([@"ModelManager#viewModels" isEqualToString:call.method]) { 44 | [ViewModels result:result]; 45 | } else if ([@"ModelManager#deleteModel" isEqualToString:call.method]) { 46 | [DeleteModel handleEvent:modelname result:result]; 47 | } else if ([@"ModelManager#downloadModel" isEqualToString:call.method]) { 48 | [DownloadModel handleEvent:modelname result:result]; 49 | } else { 50 | result(FlutterMethodNotImplemented); 51 | } 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /ios/Classes/LanguageIdentifier.m: -------------------------------------------------------------------------------- 1 | #import "FirebaseMlkitLanguagePlugin.h" 2 | 3 | @import FirebaseMLCommon; 4 | 5 | @implementation LanguageIdentifier 6 | 7 | + (void)handleEvent:(NSString *)text options:(NSDictionary *)options result:(FlutterResult)result { 8 | FIRNaturalLanguage *naturalLanguage = [FIRNaturalLanguage naturalLanguage]; 9 | FIRLanguageIdentification *languageId = 10 | [naturalLanguage languageIdentificationWithOptions:[LanguageIdentifier parseOptions:options]]; 11 | 12 | [languageId 13 | identifyPossibleLanguagesForText:text 14 | completion:^( 15 | NSArray *_Nonnull identifiedLanguages, 16 | NSError *_Nullable error) { 17 | if (error) { 18 | [FLTFirebaseMlkitLanguagePlugin handleError:error result:result]; 19 | return; 20 | } else if (!identifiedLanguages) { 21 | result(@[]); 22 | } 23 | NSMutableArray *languageData = [NSMutableArray array]; 24 | for (FIRIdentifiedLanguage *language in identifiedLanguages) { 25 | NSDictionary *data = @{ 26 | @"confidence" : [NSNumber numberWithFloat:language.confidence], 27 | @"languageCode" : language.languageCode, 28 | }; 29 | [languageData addObject:data]; 30 | } 31 | 32 | result(languageData); 33 | }]; 34 | } 35 | 36 | + (FIRLanguageIdentificationOptions *)parseOptions:(NSDictionary *)optionsData { 37 | NSNumber *conf = optionsData[@"confidenceThreshold"]; 38 | FIRLanguageIdentificationOptions *options = 39 | [[FIRLanguageIdentificationOptions alloc] initWithConfidenceThreshold:[conf floatValue]]; 40 | return options; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /ios/Classes/LanguageTranslator.m: -------------------------------------------------------------------------------- 1 | #import "FirebaseMlkitLanguagePlugin.h" 2 | 3 | @import FirebaseMLCommon; 4 | 5 | @implementation LanguageTranslator 6 | 7 | + (void)handleEvent:(NSString *)text options:(NSDictionary *)options result:(FlutterResult)result { 8 | 9 | FIRTranslateLanguage sourceModel = FIRTranslateLanguageForLanguageCode(options[@"fromLanguage"]); 10 | FIRTranslateLanguage targetModel = FIRTranslateLanguageForLanguageCode(options[@"toLanguage"]); 11 | 12 | FIRTranslatorOptions *translationOptions = 13 | [[FIRTranslatorOptions alloc] initWithSourceLanguage:sourceModel targetLanguage:targetModel]; 14 | FIRTranslator *customTranslator = 15 | [[FIRNaturalLanguage naturalLanguage] translatorWithOptions:translationOptions]; 16 | 17 | FIRModelDownloadConditions *conditions = 18 | [[FIRModelDownloadConditions alloc] initWithAllowsCellularAccess:YES 19 | allowsBackgroundDownloading:YES]; 20 | 21 | [customTranslator 22 | downloadModelIfNeededWithConditions:conditions 23 | completion:^(NSError *_Nullable error) { 24 | if (error) { 25 | [FLTFirebaseMlkitLanguagePlugin handleError:error result:result]; 26 | } 27 | [customTranslator 28 | translateText:text 29 | completion:^(NSString *_Nullable translatedText, 30 | NSError *_Nullable error) { 31 | if (error != nil || translatedText == nil) { 32 | [FLTFirebaseMlkitLanguagePlugin handleError:error 33 | result:result]; 34 | } 35 | result(translatedText); 36 | }]; 37 | }]; 38 | } 39 | @end 40 | -------------------------------------------------------------------------------- /ios/Classes/ViewModels.m: -------------------------------------------------------------------------------- 1 | #import "FirebaseMlkitLanguagePlugin.h" 2 | 3 | @import FirebaseMLCommon; 4 | 5 | @implementation ViewModels 6 | 7 | + (void)result:(FlutterResult)result { 8 | NSSet *localModels = 9 | [[FIRModelManager modelManager] availableTranslateModelsWithApp:FIRApp.defaultApp]; 10 | 11 | NSArray *array = localModels.allObjects; 12 | 13 | NSMutableArray *arr = [NSMutableArray array]; 14 | for (FIRTranslateRemoteModel *model in array) { 15 | NSString *languageCode = FIRTranslateLanguageCodeForLanguage(model.language); 16 | [arr addObject:languageCode]; 17 | } 18 | 19 | result(arr); 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /ios/firebase_mlkit_language.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'firebase_mlkit_language' 6 | s.version = '0.0.1' 7 | s.summary = 'Firebase ML Kit Language Plugin for Flutter' 8 | s.description = <<-DESC 9 | Firebase ML Kit Language Plugin for Flutter. 10 | DESC 11 | s.homepage = 'https://github.com/rishab2113/firebase_mlkit_language/tree/master' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Rishab Nayak' => 'rishab@bu.edu' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | s.dependency 'Firebase/Core' 19 | s.dependency 'Firebase/MLNLTranslate' 20 | s.dependency 'Firebase/MLNLLanguageID' 21 | s.dependency 'Firebase/MLNaturalLanguage' 22 | s.ios.deployment_target = '9.0' 23 | s.static_framework = true 24 | end 25 | -------------------------------------------------------------------------------- /lib/firebase_mlkit_language.dart: -------------------------------------------------------------------------------- 1 | library firebase_mllanguage; 2 | 3 | import 'dart:async'; 4 | 5 | import 'package:flutter/foundation.dart'; 6 | import 'package:flutter/services.dart'; 7 | 8 | part 'src/firebase_language.dart'; 9 | part 'src/language_identifier.dart'; 10 | part 'src/language_translator.dart'; 11 | part 'src/model_manager.dart'; 12 | -------------------------------------------------------------------------------- /lib/src/firebase_language.dart: -------------------------------------------------------------------------------- 1 | part of firebase_mllanguage; 2 | 3 | class FirebaseLanguage { 4 | FirebaseLanguage._(); 5 | 6 | @visibleForTesting 7 | static const MethodChannel channel = MethodChannel('firebase_mlkit_language'); 8 | 9 | /// Singleton of [FirebaseLanguage]. 10 | /// 11 | /// Use this get an instance of a Language Identifier/Translator: 12 | /// 13 | /// ```dart 14 | /// LanguageIdentifier languageIdentifier = FirebaseLanguage.instance.languageIdentifier(); 15 | /// ``` 16 | static final FirebaseLanguage instance = FirebaseLanguage._(); 17 | 18 | /// Creates an instance of [LanguageIdentifier]. 19 | LanguageIdentifier languageIdentifier([LanguageIdentifierOptions options]) { 20 | return LanguageIdentifier._(options ?? const LanguageIdentifierOptions()); 21 | } 22 | 23 | /// Creates an instance of [LanguageTranslator]. 24 | LanguageTranslator languageTranslator( 25 | String fromLanguage, String toLanguage) { 26 | return LanguageTranslator._( 27 | toLanguage: toLanguage, fromLanguage: fromLanguage); 28 | } 29 | 30 | /// Creates an instance of [ModelManager]. 31 | ModelManager modelManager() { 32 | return ModelManager._(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/src/language_identifier.dart: -------------------------------------------------------------------------------- 1 | part of firebase_mllanguage; 2 | 3 | /// Used for finding [LanguageLabel]s in supplied text. 4 | /// 5 | /// 6 | /// A language identifier is created via 7 | /// `languageIdentifier([LanguageIdentifierOptions options])` in [FirebaseLanguage]: 8 | /// 9 | /// ```dart 10 | /// 11 | /// final LanguageIdentifier languageIdentifier = 12 | /// FirebaseLanguage.instance.languageIdentifier(options); 13 | /// 14 | /// final List labels = await languageIdentifier.processText("Sample Text"); 15 | /// ``` 16 | 17 | class LanguageIdentifier { 18 | LanguageIdentifier._(LanguageIdentifierOptions options) 19 | : _options = options, 20 | assert(options != null); 21 | 22 | // Should be of type LanguageIdentifierOptions. 23 | final LanguageIdentifierOptions _options; 24 | 25 | /// Finds language labels in the input text. 26 | Future> processText(String text) async { 27 | final List reply = await FirebaseLanguage.channel 28 | .invokeMethod('LanguageIdentifier#processText', { 29 | 'options': { 30 | 'confidenceThreshold': _options.confidenceThreshold, 31 | }, 32 | 'text': text 33 | }); 34 | 35 | final List labels = []; 36 | for (dynamic data in reply) { 37 | labels.add(LanguageLabel._(data)); 38 | } 39 | 40 | return labels; 41 | } 42 | } 43 | 44 | /// Options for on device language labeler. 45 | /// 46 | /// Confidence threshold could be provided for the language identification. For example, 47 | /// if the confidence threshold is set to 0.7, only labels with 48 | /// confidence >= 0.7 would be returned. The default threshold is 0.5. 49 | class LanguageIdentifierOptions { 50 | /// Constructor for [LanguageIdentifierOptions]. 51 | /// 52 | /// Confidence threshold could be provided for the language identification. 53 | /// For example, if the confidence threshold is set to 0.7, only labels with 54 | /// confidence >= 0.7 would be returned. The default threshold is 0.5. 55 | const LanguageIdentifierOptions({this.confidenceThreshold = 0.5}) 56 | : assert(confidenceThreshold >= 0.0), 57 | assert(confidenceThreshold <= 1.0); 58 | 59 | /// The minimum confidence threshold of labels to be detected. 60 | /// 61 | /// Required to be in range [0.0, 1.0]. 62 | final double confidenceThreshold; 63 | } 64 | 65 | /// Represents a language label detected by [LanguageIdentifier]. 66 | class LanguageLabel { 67 | LanguageLabel._(dynamic data) 68 | : confidence = data['confidence'], 69 | languageCode = data['languageCode']; 70 | 71 | /// The overall confidence of the result. Range [0.0, 1.0]. 72 | final double confidence; 73 | 74 | /// A detected language from the given text. 75 | final String languageCode; 76 | } 77 | -------------------------------------------------------------------------------- /lib/src/language_translator.dart: -------------------------------------------------------------------------------- 1 | part of firebase_mllanguage; 2 | 3 | /// Used for finding [TranslatedTextLabel]s in supplied text. 4 | /// 5 | /// 6 | /// A language translator is created via 7 | /// `languageTranslator(fromLanguage: SupportedLanguages.lang, toLanguage: SupportedLanguages.lang)` in [FirebaseLanguage]: 8 | /// 9 | /// ```dart 10 | /// 11 | /// final LanguageTranslator languageTranslator = 12 | /// FirebaseLanguage.instance.languageTranslator(fromLanguage: SupportedLanguages.lang, toLanguage: SupportedLanguages.lang); 13 | /// 14 | /// final List labels = await languageTranslator.processText("Sample Text"); 15 | /// ``` 16 | 17 | class LanguageTranslator { 18 | LanguageTranslator._( 19 | {@required String fromLanguage, @required String toLanguage}) 20 | : _fromLanguage = fromLanguage, 21 | _toLanguage = toLanguage, 22 | assert(fromLanguage != null), 23 | assert(toLanguage != null); 24 | 25 | final String _fromLanguage; 26 | final String _toLanguage; 27 | 28 | /// Translates the input text. 29 | Future processText(String text) async { 30 | final String reply = await FirebaseLanguage.channel 31 | .invokeMethod('LanguageTranslator#processText', { 32 | 'options': { 33 | 'fromLanguage': _fromLanguage, 34 | 'toLanguage': _toLanguage 35 | }, 36 | 'text': text 37 | }); 38 | 39 | return reply; 40 | } 41 | } 42 | 43 | /// Conversion for [SupportedLanguages] to BCP-47 language codes 44 | class SupportedLanguages { 45 | static const String Afrikaans = 'af'; 46 | static const String Arabic = 'ar'; 47 | static const String Belarusian = 'be'; 48 | static const String Bulgarian = 'bg'; 49 | static const String Bengali = 'bn'; 50 | static const String Catalan = 'ca'; 51 | static const String Czech = 'cs'; 52 | static const String Welsh = 'cy'; 53 | static const String Danish = 'da'; 54 | static const String German = 'de'; 55 | static const String Greek = 'el'; 56 | static const String English = 'en'; 57 | static const String Esperanto = 'eo'; 58 | static const String Spanish = 'es'; 59 | static const String Estonian = 'et'; 60 | static const String Persian = 'fa'; 61 | static const String Finnish = 'fi'; 62 | static const String French = 'fr'; 63 | static const String Irish = 'ga'; 64 | static const String Galician = 'gl'; 65 | static const String Gujarati = 'gu'; 66 | static const String Hebrew = 'he'; 67 | static const String Hindi = 'hi'; 68 | static const String Croatian = 'hr'; 69 | static const String Haitian = 'ht'; 70 | static const String Hungarian = 'hu'; 71 | static const String Indonesian = 'id'; 72 | static const String Icelandic = 'is'; 73 | static const String Italian = 'it'; 74 | static const String Japanese = 'ja'; 75 | static const String Georgian = 'ka'; 76 | static const String Kannada = 'kn'; 77 | static const String Korean = 'ko'; 78 | static const String Lithuanian = 'lt'; 79 | static const String Latvian = 'lv'; 80 | static const String Macedonian = 'mk'; 81 | static const String Marathi = 'mr'; 82 | static const String Malay = 'ms'; 83 | static const String Maltese = 'mt'; 84 | static const String Dutch = 'nl'; 85 | static const String Norwegian = 'no'; 86 | static const String Polish = 'pl'; 87 | static const String Portuguese = 'pt'; 88 | static const String Romanian = 'ro'; 89 | static const String Russian = 'ru'; 90 | static const String Slovak = 'sk'; 91 | static const String Slovenian = 'sl'; 92 | static const String Albanian = 'sq'; 93 | static const String Swedish = 'sv'; 94 | static const String Swahili = 'sw'; 95 | static const String Tamil = 'ta'; 96 | static const String Telugu = 'te'; 97 | static const String Thai = 'th'; 98 | static const String Tagalog = 'tl'; 99 | static const String Turkish = 'tr'; 100 | static const String Ukranian = 'uk'; 101 | static const String Urdu = 'ur'; 102 | static const String Vietnamese = 'vi'; 103 | static const String Chinese = 'zh'; 104 | } 105 | -------------------------------------------------------------------------------- /lib/src/model_manager.dart: -------------------------------------------------------------------------------- 1 | part of firebase_mllanguage; 2 | 3 | /// Used for viewing downloaded language models, deleting a downloaded language model, and downloading new language models. 4 | /// 5 | /// 6 | /// A model manager is created via 7 | /// `modelManager()` in [FirebaseLanguage]: 8 | /// 9 | /// ```dart 10 | /// 11 | /// final ModelManager modelManager = 12 | /// FirebaseLanguage.instance.modelManager(); 13 | /// 14 | /// final List = await modelManager.viewModels(); 15 | /// ``` 16 | 17 | class ModelManager { 18 | ModelManager._(); 19 | 20 | /// Shows all locally available models. 21 | Future> viewModels() async { 22 | final List availableModels = 23 | await FirebaseLanguage.channel.invokeMethod('ModelManager#viewModels'); 24 | return availableModels.cast().toList(); 25 | } 26 | 27 | /// Deletes specified model. 28 | Future deleteModel(String toDelete) async { 29 | final String status = await FirebaseLanguage.channel.invokeMethod( 30 | 'ModelManager#deleteModel', {'model': toDelete}); 31 | return status; 32 | } 33 | 34 | /// Downloads specified model 35 | Future downloadModel(String toDownload) async { 36 | final String status = await FirebaseLanguage.channel.invokeMethod( 37 | 'ModelManager#downloadModel', {'model': toDownload}); 38 | return status; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "11.0.0" 11 | analyzer: 12 | dependency: transitive 13 | description: 14 | name: analyzer 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "0.40.4" 18 | archive: 19 | dependency: transitive 20 | description: 21 | name: archive 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.0.13" 25 | args: 26 | dependency: transitive 27 | description: 28 | name: args 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.6.0" 32 | async: 33 | dependency: transitive 34 | description: 35 | name: async 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.5.0-nullsafety.1" 39 | boolean_selector: 40 | dependency: transitive 41 | description: 42 | name: boolean_selector 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.1.0-nullsafety.1" 46 | characters: 47 | dependency: transitive 48 | description: 49 | name: characters 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.1.0-nullsafety.3" 53 | charcode: 54 | dependency: transitive 55 | description: 56 | name: charcode 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.2.0-nullsafety.1" 60 | cli_util: 61 | dependency: transitive 62 | description: 63 | name: cli_util 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "0.2.0" 67 | clock: 68 | dependency: transitive 69 | description: 70 | name: clock 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.1.0-nullsafety.1" 74 | collection: 75 | dependency: transitive 76 | description: 77 | name: collection 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.15.0-nullsafety.3" 81 | convert: 82 | dependency: transitive 83 | description: 84 | name: convert 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "2.1.1" 88 | coverage: 89 | dependency: transitive 90 | description: 91 | name: coverage 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "0.14.1" 95 | crypto: 96 | dependency: transitive 97 | description: 98 | name: crypto 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "2.1.5" 102 | fake_async: 103 | dependency: transitive 104 | description: 105 | name: fake_async 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "1.2.0-nullsafety.1" 109 | file: 110 | dependency: transitive 111 | description: 112 | name: file 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "6.0.0-nullsafety.2" 116 | firebase_core: 117 | dependency: "direct dev" 118 | description: 119 | name: firebase_core 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "0.4.0+1" 123 | flutter: 124 | dependency: "direct main" 125 | description: flutter 126 | source: sdk 127 | version: "0.0.0" 128 | flutter_driver: 129 | dependency: "direct dev" 130 | description: flutter 131 | source: sdk 132 | version: "0.0.0" 133 | flutter_test: 134 | dependency: "direct dev" 135 | description: flutter 136 | source: sdk 137 | version: "0.0.0" 138 | fuchsia_remote_debug_protocol: 139 | dependency: transitive 140 | description: flutter 141 | source: sdk 142 | version: "0.0.0" 143 | glob: 144 | dependency: transitive 145 | description: 146 | name: glob 147 | url: "https://pub.dartlang.org" 148 | source: hosted 149 | version: "1.1.7" 150 | http: 151 | dependency: transitive 152 | description: 153 | name: http 154 | url: "https://pub.dartlang.org" 155 | source: hosted 156 | version: "0.12.0+2" 157 | http_multi_server: 158 | dependency: transitive 159 | description: 160 | name: http_multi_server 161 | url: "https://pub.dartlang.org" 162 | source: hosted 163 | version: "2.0.6" 164 | http_parser: 165 | dependency: transitive 166 | description: 167 | name: http_parser 168 | url: "https://pub.dartlang.org" 169 | source: hosted 170 | version: "3.1.3" 171 | io: 172 | dependency: transitive 173 | description: 174 | name: io 175 | url: "https://pub.dartlang.org" 176 | source: hosted 177 | version: "0.3.3" 178 | js: 179 | dependency: transitive 180 | description: 181 | name: js 182 | url: "https://pub.dartlang.org" 183 | source: hosted 184 | version: "0.6.3-nullsafety.2" 185 | json_rpc_2: 186 | dependency: transitive 187 | description: 188 | name: json_rpc_2 189 | url: "https://pub.dartlang.org" 190 | source: hosted 191 | version: "2.2.2" 192 | logging: 193 | dependency: transitive 194 | description: 195 | name: logging 196 | url: "https://pub.dartlang.org" 197 | source: hosted 198 | version: "0.11.3+2" 199 | matcher: 200 | dependency: transitive 201 | description: 202 | name: matcher 203 | url: "https://pub.dartlang.org" 204 | source: hosted 205 | version: "0.12.10-nullsafety.1" 206 | meta: 207 | dependency: transitive 208 | description: 209 | name: meta 210 | url: "https://pub.dartlang.org" 211 | source: hosted 212 | version: "1.3.0-nullsafety.4" 213 | mime: 214 | dependency: transitive 215 | description: 216 | name: mime 217 | url: "https://pub.dartlang.org" 218 | source: hosted 219 | version: "0.9.6+2" 220 | node_preamble: 221 | dependency: transitive 222 | description: 223 | name: node_preamble 224 | url: "https://pub.dartlang.org" 225 | source: hosted 226 | version: "1.4.4" 227 | package_config: 228 | dependency: transitive 229 | description: 230 | name: package_config 231 | url: "https://pub.dartlang.org" 232 | source: hosted 233 | version: "1.9.3" 234 | package_resolver: 235 | dependency: transitive 236 | description: 237 | name: package_resolver 238 | url: "https://pub.dartlang.org" 239 | source: hosted 240 | version: "1.0.10" 241 | path: 242 | dependency: transitive 243 | description: 244 | name: path 245 | url: "https://pub.dartlang.org" 246 | source: hosted 247 | version: "1.8.0-nullsafety.1" 248 | pedantic: 249 | dependency: transitive 250 | description: 251 | name: pedantic 252 | url: "https://pub.dartlang.org" 253 | source: hosted 254 | version: "1.10.0-nullsafety.2" 255 | platform: 256 | dependency: transitive 257 | description: 258 | name: platform 259 | url: "https://pub.dartlang.org" 260 | source: hosted 261 | version: "3.0.0-nullsafety.2" 262 | pool: 263 | dependency: transitive 264 | description: 265 | name: pool 266 | url: "https://pub.dartlang.org" 267 | source: hosted 268 | version: "1.5.0-nullsafety.2" 269 | process: 270 | dependency: transitive 271 | description: 272 | name: process 273 | url: "https://pub.dartlang.org" 274 | source: hosted 275 | version: "4.0.0-nullsafety.2" 276 | pub_semver: 277 | dependency: transitive 278 | description: 279 | name: pub_semver 280 | url: "https://pub.dartlang.org" 281 | source: hosted 282 | version: "1.4.4" 283 | shelf: 284 | dependency: transitive 285 | description: 286 | name: shelf 287 | url: "https://pub.dartlang.org" 288 | source: hosted 289 | version: "0.7.5" 290 | shelf_packages_handler: 291 | dependency: transitive 292 | description: 293 | name: shelf_packages_handler 294 | url: "https://pub.dartlang.org" 295 | source: hosted 296 | version: "1.0.4" 297 | shelf_static: 298 | dependency: transitive 299 | description: 300 | name: shelf_static 301 | url: "https://pub.dartlang.org" 302 | source: hosted 303 | version: "0.2.8" 304 | shelf_web_socket: 305 | dependency: transitive 306 | description: 307 | name: shelf_web_socket 308 | url: "https://pub.dartlang.org" 309 | source: hosted 310 | version: "0.2.3" 311 | sky_engine: 312 | dependency: transitive 313 | description: flutter 314 | source: sdk 315 | version: "0.0.99" 316 | source_map_stack_trace: 317 | dependency: transitive 318 | description: 319 | name: source_map_stack_trace 320 | url: "https://pub.dartlang.org" 321 | source: hosted 322 | version: "2.1.0-nullsafety.3" 323 | source_maps: 324 | dependency: transitive 325 | description: 326 | name: source_maps 327 | url: "https://pub.dartlang.org" 328 | source: hosted 329 | version: "0.10.10-nullsafety.2" 330 | source_span: 331 | dependency: transitive 332 | description: 333 | name: source_span 334 | url: "https://pub.dartlang.org" 335 | source: hosted 336 | version: "1.8.0-nullsafety.2" 337 | stack_trace: 338 | dependency: transitive 339 | description: 340 | name: stack_trace 341 | url: "https://pub.dartlang.org" 342 | source: hosted 343 | version: "1.10.0-nullsafety.2" 344 | stream_channel: 345 | dependency: transitive 346 | description: 347 | name: stream_channel 348 | url: "https://pub.dartlang.org" 349 | source: hosted 350 | version: "2.1.0-nullsafety.1" 351 | string_scanner: 352 | dependency: transitive 353 | description: 354 | name: string_scanner 355 | url: "https://pub.dartlang.org" 356 | source: hosted 357 | version: "1.1.0-nullsafety.1" 358 | sync_http: 359 | dependency: transitive 360 | description: 361 | name: sync_http 362 | url: "https://pub.dartlang.org" 363 | source: hosted 364 | version: "0.2.0" 365 | term_glyph: 366 | dependency: transitive 367 | description: 368 | name: term_glyph 369 | url: "https://pub.dartlang.org" 370 | source: hosted 371 | version: "1.2.0-nullsafety.1" 372 | test: 373 | dependency: "direct dev" 374 | description: 375 | name: test 376 | url: "https://pub.dartlang.org" 377 | source: hosted 378 | version: "1.16.0-nullsafety.5" 379 | test_api: 380 | dependency: transitive 381 | description: 382 | name: test_api 383 | url: "https://pub.dartlang.org" 384 | source: hosted 385 | version: "0.2.19-nullsafety.2" 386 | test_core: 387 | dependency: transitive 388 | description: 389 | name: test_core 390 | url: "https://pub.dartlang.org" 391 | source: hosted 392 | version: "0.3.12-nullsafety.5" 393 | typed_data: 394 | dependency: transitive 395 | description: 396 | name: typed_data 397 | url: "https://pub.dartlang.org" 398 | source: hosted 399 | version: "1.3.0-nullsafety.3" 400 | vector_math: 401 | dependency: transitive 402 | description: 403 | name: vector_math 404 | url: "https://pub.dartlang.org" 405 | source: hosted 406 | version: "2.1.0-nullsafety.3" 407 | vm_service: 408 | dependency: transitive 409 | description: 410 | name: vm_service 411 | url: "https://pub.dartlang.org" 412 | source: hosted 413 | version: "2.1.3" 414 | vm_service_client: 415 | dependency: transitive 416 | description: 417 | name: vm_service_client 418 | url: "https://pub.dartlang.org" 419 | source: hosted 420 | version: "0.2.6+2" 421 | watcher: 422 | dependency: transitive 423 | description: 424 | name: watcher 425 | url: "https://pub.dartlang.org" 426 | source: hosted 427 | version: "0.9.7+10" 428 | web_socket_channel: 429 | dependency: transitive 430 | description: 431 | name: web_socket_channel 432 | url: "https://pub.dartlang.org" 433 | source: hosted 434 | version: "1.1.0" 435 | webdriver: 436 | dependency: transitive 437 | description: 438 | name: webdriver 439 | url: "https://pub.dartlang.org" 440 | source: hosted 441 | version: "2.1.2" 442 | webkit_inspection_protocol: 443 | dependency: transitive 444 | description: 445 | name: webkit_inspection_protocol 446 | url: "https://pub.dartlang.org" 447 | source: hosted 448 | version: "0.7.3" 449 | yaml: 450 | dependency: transitive 451 | description: 452 | name: yaml 453 | url: "https://pub.dartlang.org" 454 | source: hosted 455 | version: "2.1.15" 456 | sdks: 457 | dart: ">=2.10.0-110 <=2.11.0-213.1.beta" 458 | flutter: ">=1.12.0 <2.0.0" 459 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: firebase_mlkit_language 2 | description: Firebase ML Kit Language Plugin for Flutter, enables Language Detection and Translation between 59 Languages 3 | version: 1.1.3 4 | homepage: https://github.com/rishab2113/firebase_mlkit_language/tree/master 5 | 6 | environment: 7 | sdk: ">=2.1.0 <3.0.0" 8 | flutter: ">=1.12.0 <2.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | flutter_driver: 18 | sdk: flutter 19 | firebase_core: ^0.4.0 20 | test: any 21 | 22 | # For information on the generic Dart part of this file, see the 23 | # following page: https://www.dartlang.org/tools/pub/pubspec 24 | 25 | # The following section is specific to Flutter. 26 | flutter: 27 | # This section identifies this Flutter project as a plugin project. 28 | # The androidPackage and pluginClass identifiers should not ordinarily 29 | # be modified. They are used by the tooling to maintain consistency when 30 | # adding or updating assets for this project. 31 | plugin: 32 | platforms: 33 | android: 34 | package: io.flutter.plugins.firebase_mlkit_language 35 | pluginClass: FirebaseMlkitLanguagePlugin 36 | ios: 37 | iosPrefix: FLT 38 | pluginClass: FirebaseMlkitLanguagePlugin 39 | 40 | # To add assets to your plugin package, add an assets section, like this: 41 | # assets: 42 | # - images/a_dot_burr.jpeg 43 | # - images/a_dot_ham.jpeg 44 | # 45 | # For details regarding assets in packages, see 46 | # https://flutter.dev/assets-and-images/#from-packages 47 | # 48 | # An image asset can refer to one or more resolution-specific "variants", see 49 | # https://flutter.dev/assets-and-images/#resolution-aware. 50 | 51 | # To add custom fonts to your plugin package, add a fonts section here, 52 | # in this "flutter" section. Each entry in this list should have a 53 | # "family" key with the font family name, and a "fonts" key with a 54 | # list giving the asset and other descriptors for the font. For 55 | # example: 56 | # fonts: 57 | # - family: Schyler 58 | # fonts: 59 | # - asset: fonts/Schyler-Regular.ttf 60 | # - asset: fonts/Schyler-Italic.ttf 61 | # style: italic 62 | # - family: Trajan Pro 63 | # fonts: 64 | # - asset: fonts/TrajanPro.ttf 65 | # - asset: fonts/TrajanPro_Bold.ttf 66 | # weight: 700 67 | # 68 | # For details regarding fonts in packages, see 69 | # https://flutter.dev/custom-fonts/#from-packages 70 | -------------------------------------------------------------------------------- /test/firebase_mlkit_language_test.dart: -------------------------------------------------------------------------------- 1 | // import 'package:flutter/services.dart'; 2 | // import 'package:flutter_test/flutter_test.dart'; 3 | // import 'package:firebase_mlkit_language/firebase_mlkit_language.dart'; 4 | // 5 | // void main() { 6 | // const MethodChannel channel = MethodChannel('firebase_mlkit_language'); 7 | // } 8 | --------------------------------------------------------------------------------