Skip to content
This repository was archived by the owner on Oct 15, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ build/
ios/.generated/
packages
pubspec.lock
.dart_tool/package_config.json
example/.flutter-plugins-dependencies
example/.dart_tool/package_config.json
example/ios/Flutter/flutter_export_environment.sh
13 changes: 7 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@ version '1.0-SNAPSHOT'

buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:3.5.0'
}
}

allprojects {
rootProject.allprojects {
repositories {
google()
jcenter()
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion '28.0.3'
compileSdkVersion 28

defaultConfig {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
minSdkVersion = 14
minSdkVersion 16
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
Expand Down
33 changes: 21 additions & 12 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withInputStream { stream ->
localProperties.load(stream)
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

Expand All @@ -11,24 +11,34 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 25
buildToolsVersion '28.0.3'
compileSdkVersion 28

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
minSdkVersion 16

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "bz.rxla.flutter.speechrecognitionexample"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -45,8 +55,7 @@ flutter {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
1 change: 1 addition & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class _MyAppState extends State<MyApp> {

void onRecognitionResult(String text) => setState(() => transcription = text);

void onRecognitionComplete() => setState(() => _isListening = false);
void onRecognitionComplete(String s) => setState(() => _isListening = false);

void errorHandler() => activateSpeechRecognizer();
}