Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8d4a9c0
Added Polyline to GoogleMapsPlugin
Jan 27, 2019
2a372b2
Added polylines to google_maps_flutter
Jan 27, 2019
d2d56f4
Updated AUTHORS, signed CLA, Added Polylines to google maps plugin
Jan 27, 2019
a0b2df1
failed linter: strong_mode_implicit_dynamic_method
Jan 27, 2019
02c476a
ran formatter against code broke macro into multiple lines
Jan 27, 2019
ba3b55d
styles: Fixed styling for googlebot
Jan 27, 2019
0ee6a54
styles: Making googlebot happy
Jan 27, 2019
8218ccc
style: Googlebot is fussy
Jan 27, 2019
c3a3c28
style: Googbot :(
Jan 27, 2019
67b60ee
Added map tap and long tap to both Android and iOS
Feb 1, 2019
6c3a856
Added tap and long tap to Google Maps Plugin
Feb 1, 2019
ecd811e
Merge remote-tracking branch 'upstream/master'
Feb 1, 2019
a73b1d4
Added legacy http support to manifest, extended example app to use tap
Feb 1, 2019
afaac10
Made googlebot happy ;-)
Feb 1, 2019
4083ad4
Merged base master
jan1za Feb 15, 2019
00ce122
Feature: functionality to disable location button
Feb 24, 2019
c4be870
Merge branch 'master' of https://github.com/jan1za/plugins
Feb 24, 2019
805f94f
Merge branch 'master' of https://github.com/flutter/plugins
Feb 24, 2019
8fe046e
updated formating
Feb 24, 2019
d34f82a
removed @null annotation breaking build
Feb 24, 2019
2107a4a
Refactored Polylines
Apr 3, 2019
a7b987d
Refactored Example Code
Apr 4, 2019
bea4d5d
Polylines refactored in example
Apr 4, 2019
87b36cb
Added map tap
Apr 4, 2019
44ab85e
Refactor Polylines
Apr 5, 2019
8d4f9e0
Refactored
Apr 5, 2019
ffbd321
added test cases
Apr 5, 2019
feb9611
Reformat to make googlebot happy
Apr 5, 2019
bb77296
Reformate to keep googlebot happy
Apr 5, 2019
9bfb0a7
Refactored polyline to use widgets same as markers
Apr 5, 2019
ae36a9d
Refactored Polyline support
Apr 5, 2019
53b399a
Added Polyline support
Apr 5, 2019
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ GeneratedPluginRegistrant.java
build/
.flutter-plugins

*.class
3 changes: 2 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ Diego Velásquez <[email protected]>
Hajime Nakamura <[email protected]>
Tuyển Vũ Xuân <[email protected]>
Sarthak Verma <[email protected]>
Jason Nicholls <[email protected]>
Mike Diarmid <[email protected]>
Invertase <[email protected]>
Elliot Hesp <[email protected]>
Katarina Sheremet <[email protected]>
Thomas Stockx <[email protected]>
Thomas Stockx <[email protected]>
4 changes: 0 additions & 4 deletions packages/battery/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
## 0.3.0+3

* Fix `batteryLevel` usage example in README

## 0.3.0+2

* Bump the minimum Flutter version to 1.2.0.
Expand Down
2 changes: 1 addition & 1 deletion packages/battery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'package:battery/battery.dart';
var battery = Battery();

// Access current battery level
print(await battery.batteryLevel);
print(battery.batteryLevel);

// Be informed when the state (full, charging, discharging) changes
_battery.onBatteryStateChanged.listen((BatteryState state) {
Expand Down
2 changes: 1 addition & 1 deletion packages/battery/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for accessing information about the battery state
(full, charging, discharging) on Android and iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/battery
version: 0.3.0+3
version: 0.3.0+2

flutter:
plugin:
Expand Down
10 changes: 0 additions & 10 deletions packages/cloud_firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
## 0.9.11

* Bump Android dependencies to latest.

# 0.9.10

* Support for cloud_firestore running in the background on Android.
* Fixed a bug in cleanup for DocumentReference.snapshots().
* Additional integration testing.

## 0.9.9

* Remove `invokeMapMethod` calls to prevent crash.
Expand Down
2 changes: 1 addition & 1 deletion packages/cloud_firestore/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
disable 'InvalidPackage'
}
dependencies {
api 'com.google.firebase:firebase-firestore:18.2.0'
api 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'androidx.annotation:annotation:1.0.0'
}
}
1 change: 0 additions & 1 deletion packages/cloud_firestore/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ android {
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}

buildTypes {
Expand Down
15 changes: 3 additions & 12 deletions packages/cloud_firestore/example/test_driver/cloud_firestore.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,9 @@ void main() {
});

test('getDocuments', () async {
final Query query = firestore
.collection('messages')
.where('message', isEqualTo: 'Hello world!')
.limit(1);
final QuerySnapshot querySnapshot = await query.getDocuments();
expect(querySnapshot.documents.first['message'], 'Hello world!');
final DocumentReference firstDoc =
querySnapshot.documents.first.reference;
final DocumentSnapshot documentSnapshot = await firstDoc.get();
expect(documentSnapshot.data['message'], 'Hello world!');
final DocumentSnapshot snapshot = await firstDoc.snapshots().first;
expect(snapshot.data['message'], 'Hello world!');
final CollectionReference reference = firestore.collection('messages');
final QuerySnapshot snapshot = await reference.getDocuments();
expect(snapshot.documents.length, isNonZero);
});
});
}
2 changes: 1 addition & 1 deletion packages/cloud_firestore/lib/src/document_reference.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class DocumentReference {
'Query#removeListener',
<String, dynamic>{'handle': handle},
);
Firestore._documentObservers.remove(handle);
Firestore._queryObservers.remove(handle);
});
},
);
Expand Down
2 changes: 1 addition & 1 deletion packages/cloud_firestore/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Cloud Firestore, a cloud-hosted, noSQL database
live synchronization and offline support on Android and iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/cloud_firestore
version: 0.9.11
version: 0.9.9

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class FirebaseCorePlugin implements MethodCallHandler {
public static void registerWith(PluginRegistry.Registrar registrar) {
final MethodChannel channel =
new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_core");
channel.setMethodCallHandler(new FirebaseCorePlugin(registrar.context()));
channel.setMethodCallHandler(new FirebaseCorePlugin(registrar.activity()));
}

private FirebaseCorePlugin(Context context) {
Expand Down
4 changes: 0 additions & 4 deletions packages/firebase_crashlytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
## 0.0.3

* Rely on firebase_core to add the Android dependency on Firebase instead of hardcoding the version ourselves

## 0.0.2+1

* Update variable name `enableInDevMode` in README.
Expand Down
1 change: 1 addition & 0 deletions packages/firebase_crashlytics/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ android {
}

dependencies {
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
}
2 changes: 1 addition & 1 deletion packages/firebase_crashlytics/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: firebase_crashlytics
description: Flutter plugin for Firebase Crashlytics. It reports uncaught errors to the
Firebase console.
version: 0.0.3
version: 0.0.2+1
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_crashlytics

Expand Down
9 changes: 0 additions & 9 deletions packages/firebase_ml_vision/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
## 0.7.0

* **Breaking Change** Unified and enhanced on-device and cloud image-labeling API.
`iOS` now requires minimum deployment target of 9.0. Add `platform :ios, '9.0'` in your `Podfile`.
Updated to latest version of `Firebase/MLVision` on `iOS`. Please run `pod update` in directory containing your `iOS` project `Podfile`.
`Label` renamed to `ImageLabel`.
`LabelDetector` renamed to `ImageLabeler`.
Removed `CloudLabelDetector` and replaced it with a cloud `ImageLabeler`.

## 0.6.0+2

* Update README.md
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ml_vision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android {
dependencies {
// ...

api 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
api 'com.google.firebase:firebase-ml-vision-image-label-model:16.2.0'
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ml_vision/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
disable 'InvalidPackage'
}
dependencies {
api 'com.google.firebase:firebase-ml-vision:19.0.2'
api 'com.google.firebase:firebase-ml-vision:17.0.1'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package io.flutter.plugins.firebasemlvision;

import androidx.annotation.NonNull;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.ml.vision.FirebaseVision;
import com.google.firebase.ml.vision.cloud.FirebaseVisionCloudDetectorOptions;
import com.google.firebase.ml.vision.cloud.label.FirebaseVisionCloudLabel;
import com.google.firebase.ml.vision.cloud.label.FirebaseVisionCloudLabelDetector;
import com.google.firebase.ml.vision.common.FirebaseVisionImage;
import io.flutter.plugin.common.MethodChannel;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

class CloudLabelDetector implements Detector {
static final CloudLabelDetector instance = new CloudLabelDetector();

private CloudLabelDetector() {}

private FirebaseVisionCloudLabelDetector detector;
private Map<String, Object> lastOptions;

@Override
public void handleDetection(
FirebaseVisionImage image, Map<String, Object> options, final MethodChannel.Result result) {

// Use instantiated detector if the options are the same. Otherwise, close and instantiate new
// options.

if (detector == null) {
lastOptions = options;
detector =
FirebaseVision.getInstance().getVisionCloudLabelDetector(parseOptions(lastOptions));
} else if (!options.equals(lastOptions)) {
try {
detector.close();
} catch (IOException e) {
result.error("cloudLabelDetectorIOError", e.getLocalizedMessage(), null);
return;
}

lastOptions = options;
detector =
FirebaseVision.getInstance().getVisionCloudLabelDetector(parseOptions(lastOptions));
}

detector
.detectInImage(image)
.addOnSuccessListener(
new OnSuccessListener<List<FirebaseVisionCloudLabel>>() {
@Override
public void onSuccess(List<FirebaseVisionCloudLabel> firebaseVisionCloudLabels) {
List<Map<String, Object>> labels =
new ArrayList<>(firebaseVisionCloudLabels.size());
for (FirebaseVisionCloudLabel label : firebaseVisionCloudLabels) {
Map<String, Object> labelData = new HashMap<>();
labelData.put("confidence", (double) label.getConfidence());
labelData.put("entityId", label.getEntityId());
labelData.put("label", label.getLabel());

labels.add(labelData);
}

result.success(labels);
}
})
.addOnFailureListener(
new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
result.error("labelDetectorError", e.getLocalizedMessage(), null);
}
});
}

private FirebaseVisionCloudDetectorOptions parseOptions(Map<String, Object> optionsData) {
final int maxResults = (int) optionsData.get("maxResults");
final String modelTypeStr = (String) optionsData.get("modelType");

final int modelType;
switch (modelTypeStr) {
case "stable":
modelType = FirebaseVisionCloudDetectorOptions.STABLE_MODEL;
break;
case "latest":
modelType = FirebaseVisionCloudDetectorOptions.LATEST_MODEL;
break;
default:
throw new IllegalArgumentException(String.format("No type for model: %s", modelTypeStr));
}

return new FirebaseVisionCloudDetectorOptions.Builder()
.setMaxResults(maxResults)
.setModelType(modelType)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@ public void onFailure(@NonNull Exception exception) {
private Map<String, double[]> getLandmarkData(FirebaseVisionFace face) {
Map<String, double[]> landmarks = new HashMap<>();

landmarks.put("bottomMouth", landmarkPosition(face, FirebaseVisionFaceLandmark.MOUTH_BOTTOM));
landmarks.put("bottomMouth", landmarkPosition(face, FirebaseVisionFaceLandmark.BOTTOM_MOUTH));
landmarks.put("leftCheek", landmarkPosition(face, FirebaseVisionFaceLandmark.LEFT_CHEEK));
landmarks.put("leftEar", landmarkPosition(face, FirebaseVisionFaceLandmark.LEFT_EAR));
landmarks.put("leftEye", landmarkPosition(face, FirebaseVisionFaceLandmark.LEFT_EYE));
landmarks.put("leftMouth", landmarkPosition(face, FirebaseVisionFaceLandmark.MOUTH_LEFT));
landmarks.put("leftMouth", landmarkPosition(face, FirebaseVisionFaceLandmark.LEFT_MOUTH));
landmarks.put("noseBase", landmarkPosition(face, FirebaseVisionFaceLandmark.NOSE_BASE));
landmarks.put("rightCheek", landmarkPosition(face, FirebaseVisionFaceLandmark.RIGHT_CHEEK));
landmarks.put("rightEar", landmarkPosition(face, FirebaseVisionFaceLandmark.RIGHT_EAR));
landmarks.put("rightEye", landmarkPosition(face, FirebaseVisionFaceLandmark.RIGHT_EYE));
landmarks.put("rightMouth", landmarkPosition(face, FirebaseVisionFaceLandmark.MOUTH_RIGHT));
landmarks.put("rightMouth", landmarkPosition(face, FirebaseVisionFaceLandmark.RIGHT_MOUTH));

return landmarks;
}
Expand Down Expand Up @@ -139,26 +139,21 @@ private FirebaseVisionFaceDetectorOptions parseOptions(Map<String, Object> optio
int mode;
switch ((String) options.get("mode")) {
case "accurate":
mode = FirebaseVisionFaceDetectorOptions.ACCURATE;
mode = FirebaseVisionFaceDetectorOptions.ACCURATE_MODE;
break;
case "fast":
mode = FirebaseVisionFaceDetectorOptions.FAST;
mode = FirebaseVisionFaceDetectorOptions.FAST_MODE;
break;
default:
throw new IllegalArgumentException("Not a mode:" + options.get("mode"));
}

FirebaseVisionFaceDetectorOptions.Builder builder =
new FirebaseVisionFaceDetectorOptions.Builder()
.setClassificationMode(classification)
.setLandmarkMode(landmark)
.setMinFaceSize((float) ((double) options.get("minFaceSize")))
.setPerformanceMode(mode);

if ((boolean) options.get("enableTracking")) {
builder.enableTracking();
}

return builder.build();
return new FirebaseVisionFaceDetectorOptions.Builder()
.setClassificationType(classification)
.setLandmarkType(landmark)
.setMinFaceSize((float) ((double) options.get("minFaceSize")))
.setModeType(mode)
.setTrackingEnabled((boolean) options.get("enableTracking"))
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ public void onMethodCall(MethodCall call, Result result) {
case "FaceDetector#processImage":
FaceDetector.instance.handleDetection(image, options, result);
break;
case "ImageLabeler#processImage":
ImageLabeler.instance.handleDetection(image, options, result);
case "LabelDetector#detectInImage":
LabelDetector.instance.handleDetection(image, options, result);
break;
case "CloudLabelDetector#detectInImage":
CloudLabelDetector.instance.handleDetection(image, options, result);
break;
case "TextRecognizer#processImage":
TextRecognizer.instance.handleDetection(image, options, result);
Expand Down
Loading