Skip to content
This repository was archived by the owner on Jun 19, 2019. 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
12 changes: 6 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 27
compileSdkVersion 28

lintOptions {
disable 'InvalidPackage'
Expand All @@ -36,10 +36,10 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.mlkitdemo"
minSdkVersion 21
targetSdkVersion 27
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -51,7 +51,7 @@ android {
}

dependencies {
api 'com.google.firebase:firebase-ml-vision-image-label-model:16.2.0'
api 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
}
}

Expand All @@ -61,7 +61,7 @@ flutter {

dependencies {
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.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'com.google.firebase:firebase-core:16.0.4'
}
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.1.0'
}
}
Expand Down
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536M
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
#Fri May 31 11:19:07 EDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
6 changes: 3 additions & 3 deletions lib/detector_painters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class LabelDetectorPainter extends CustomPainter {
LabelDetectorPainter(this.imageSize, this.labels);

final Size imageSize;
final List<Label> labels;
final List<ImageLabel> labels;

@override
void paint(Canvas canvas, Size size) {
Expand All @@ -89,8 +89,8 @@ class LabelDetectorPainter extends CustomPainter {
);

builder.pushStyle(ui.TextStyle(color: Colors.green));
for (Label label in labels) {
builder.addText('Label: ${label.label}, '
for (ImageLabel label in labels) {
builder.addText('Label: ${label.text}, '
'Confidence: ${label.confidence.toStringAsFixed(2)}\n');
}
builder.pop();
Expand Down
8 changes: 4 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ class _MyHomePageState extends State<_MyHomePage> {
case Detector.barcode:
return mlVision.barcodeDetector().detectInImage;
case Detector.label:
return mlVision.labelDetector().detectInImage;
return mlVision.imageLabeler().processImage;
case Detector.cloudLabel:
return mlVision.cloudLabelDetector().detectInImage;
return mlVision.cloudImageLabeler().processImage;
default:
assert(_currentDetector == Detector.face);
return mlVision.faceDetector().processImage;
Expand Down Expand Up @@ -110,11 +110,11 @@ class _MyHomePageState extends State<_MyHomePage> {
painter = FaceDetectorPainter(imageSize, _scanResults);
break;
case Detector.label:
if (_scanResults is! List<Label>) return noResultsText;
if (_scanResults is! List<ImageLabel>) return noResultsText;
painter = LabelDetectorPainter(imageSize, _scanResults);
break;
case Detector.cloudLabel:
if (_scanResults is! List<Label>) return noResultsText;
if (_scanResults is! List<ImageLabel>) return noResultsText;
painter = LabelDetectorPainter(imageSize, _scanResults);
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
sdk: flutter

cupertino_icons: ^0.1.2
firebase_ml_vision: ^0.6.0
firebase_ml_vision: ^0.8.0
camera: ^0.4.2

dev_dependencies:
Expand Down