From 14d59215e97395fc72d1c2af55a3a44a4835acf9 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 10:12:11 -0700 Subject: [PATCH 01/49] alarm manager --- packages/android_alarm_manager/CHANGELOG.md | 5 ++++ .../lib/android_alarm_manager.dart | 25 ++++--------------- packages/android_alarm_manager/pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/packages/android_alarm_manager/CHANGELOG.md b/packages/android_alarm_manager/CHANGELOG.md index 3eedeee31ba5..beef6809e45e 100644 --- a/packages/android_alarm_manager/CHANGELOG.md +++ b/packages/android_alarm_manager/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.1+4 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.4.1+3 * Update README.md to include instructions for setting the WAKE_LOCK permission. diff --git a/packages/android_alarm_manager/lib/android_alarm_manager.dart b/packages/android_alarm_manager/lib/android_alarm_manager.dart index 9354a1b34840..8bc4956b7991 100644 --- a/packages/android_alarm_manager/lib/android_alarm_manager.dart +++ b/packages/android_alarm_manager/lib/android_alarm_manager.dart @@ -43,10 +43,7 @@ void _alarmManagerCallbackDispatcher() { // Once we've finished initializing, let the native portion of the plugin // know that it can start scheduling alarms. - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _channel.invokeMethod('AlarmService.initialized'); + _channel.invokeMethod('AlarmService.initialized'); } /// A Flutter plugin for registering Dart callbacks with the Android @@ -70,10 +67,7 @@ class AndroidAlarmManager { return false; } final dynamic r = await _channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('AlarmService.start', [handle.toRawHandle()]); + .invokeMethod('AlarmService.start', [handle.toRawHandle()]); return r ?? false; } @@ -117,10 +111,7 @@ class AndroidAlarmManager { if (handle == null) { return false; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final dynamic r = await _channel.invokeMethod('Alarm.oneShot', [ + final dynamic r = await _channel.invokeMethod('Alarm.oneShot', [ id, exact, wakeup, @@ -172,10 +163,7 @@ class AndroidAlarmManager { if (handle == null) { return false; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final dynamic r = await _channel.invokeMethod('Alarm.periodic', [ + final dynamic r = await _channel.invokeMethod('Alarm.periodic', [ id, exact, wakeup, @@ -196,10 +184,7 @@ class AndroidAlarmManager { /// failure. static Future cancel(int id) async { final dynamic r = - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('Alarm.cancel', [id]); + await _channel.invokeMethod('Alarm.cancel', [id]); return (r == null) ? false : r; } } diff --git a/packages/android_alarm_manager/pubspec.yaml b/packages/android_alarm_manager/pubspec.yaml index d0b36c3a73fd..f5ae1cb6abd0 100644 --- a/packages/android_alarm_manager/pubspec.yaml +++ b/packages/android_alarm_manager/pubspec.yaml @@ -1,7 +1,7 @@ name: android_alarm_manager description: Flutter plugin for accessing the Android AlarmManager service, and running Dart code in the background when alarms fire. -version: 0.4.1+3 +version: 0.4.1+4 author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/android_alarm_manager From 78b7318c45b2357d3e26a6a083bc1a38f70b7b24 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 10:13:27 -0700 Subject: [PATCH 02/49] android intent --- packages/android_intent/CHANGELOG.md | 5 +++++ packages/android_intent/lib/android_intent.dart | 5 +---- packages/android_intent/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/android_intent/CHANGELOG.md b/packages/android_intent/CHANGELOG.md index d9932e048a3a..4c9af5a2fd80 100644 --- a/packages/android_intent/CHANGELOG.md +++ b/packages/android_intent/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.0+2 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.3.0+1 * Log a more detailed warning at build time about the previous AndroidX diff --git a/packages/android_intent/lib/android_intent.dart b/packages/android_intent/lib/android_intent.dart index 8b0acc90fbdd..9e2bc9e0826c 100644 --- a/packages/android_intent/lib/android_intent.dart +++ b/packages/android_intent/lib/android_intent.dart @@ -57,9 +57,6 @@ class AndroidIntent { if (package != null) { args['package'] = package; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('launch', args); + await _channel.invokeMethod('launch', args); } } diff --git a/packages/android_intent/pubspec.yaml b/packages/android_intent/pubspec.yaml index 44e468d60e1e..86ea84edfdc7 100644 --- a/packages/android_intent/pubspec.yaml +++ b/packages/android_intent/pubspec.yaml @@ -2,7 +2,7 @@ name: android_intent description: Flutter plugin for launching Android Intents. Not supported on iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/android_intent -version: 0.3.0+1 +version: 0.3.0+2 flutter: plugin: From 3ff17352c89964ec1c906017d33112631aea3333 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 10:15:40 -0700 Subject: [PATCH 03/49] battery --- packages/battery/CHANGELOG.md | 5 +++++ packages/battery/lib/battery.dart | 5 +---- packages/battery/pubspec.yaml | 2 +- packages/battery/test/battery_test.dart | 5 +---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/battery/CHANGELOG.md b/packages/battery/CHANGELOG.md index abb56c56aa6d..5a0ce460c39a 100644 --- a/packages/battery/CHANGELOG.md +++ b/packages/battery/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.0+2 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.3.0+1 * Log a more detailed warning at build time about the previous AndroidX diff --git a/packages/battery/lib/battery.dart b/packages/battery/lib/battery.dart index 2a0cf2f56b63..96f470e5bbb5 100644 --- a/packages/battery/lib/battery.dart +++ b/packages/battery/lib/battery.dart @@ -33,10 +33,7 @@ class Battery { /// Returns the current battery level in percent. Future get batteryLevel => _methodChannel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('getBatteryLevel') + .invokeMethod('getBatteryLevel') .then((dynamic result) => result); /// Fires whenever the battery state changes. diff --git a/packages/battery/pubspec.yaml b/packages/battery/pubspec.yaml index 51b4d5aebb79..af6b29e5c4bf 100644 --- a/packages/battery/pubspec.yaml +++ b/packages/battery/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for accessing information about the battery state (full, charging, discharging) on Android and iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/battery -version: 0.3.0+1 +version: 0.3.0+2 flutter: plugin: diff --git a/packages/battery/test/battery_test.dart b/packages/battery/test/battery_test.dart index c16bf7f4ecbd..93d69604c83a 100644 --- a/packages/battery/test/battery_test.dart +++ b/packages/battery/test/battery_test.dart @@ -22,10 +22,7 @@ void main() { }); test('batteryLevel', () async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - when(methodChannel.invokeMethod('getBatteryLevel')) + when(methodChannel.invokeMethod('getBatteryLevel')) .thenAnswer((Invocation invoke) => Future.value(42)); expect(await battery.batteryLevel, 42); }); From cc16c9da6fe39575fceb96513f2a9f3b4d717800 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 10:19:09 -0700 Subject: [PATCH 04/49] camera --- packages/camera/CHANGELOG.md | 6 +++++ packages/camera/lib/camera.dart | 45 +++++++-------------------------- packages/camera/pubspec.yaml | 2 +- 3 files changed, 16 insertions(+), 37 deletions(-) diff --git a/packages/camera/CHANGELOG.md b/packages/camera/CHANGELOG.md index 346afa736fc4..23fbb52f221d 100644 --- a/packages/camera/CHANGELOG.md +++ b/packages/camera/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.4.3+1 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + + ## 0.4.3 * Add capability to prepare the capture session for video recording on iOS. diff --git a/packages/camera/lib/camera.dart b/packages/camera/lib/camera.dart index 8edbb8c59658..2f83623d01b4 100644 --- a/packages/camera/lib/camera.dart +++ b/packages/camera/lib/camera.dart @@ -50,10 +50,7 @@ CameraLensDirection _parseCameraLensDirection(String string) { Future> availableCameras() async { try { final List cameras = - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('availableCameras'); + await _channel.invokeMethod>('availableCameras'); return cameras.map((dynamic camera) { return CameraDescription( name: camera['name'], @@ -227,10 +224,7 @@ class CameraController extends ValueNotifier { } try { _creatingCompleter = Completer(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map reply = await _channel.invokeMethod( + final Map reply = await _channel.invokeMethod>( 'initialize', { 'cameraName': description.name, @@ -268,10 +262,7 @@ class CameraController extends ValueNotifier { /// /// Throws a [CameraException] if the prepare fails. Future prepareForVideoRecording() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('prepareForVideoRecording'); + await _channel.invokeMethod('prepareForVideoRecording'); } /// Listen to events from the native plugins. @@ -317,10 +308,7 @@ class CameraController extends ValueNotifier { } try { value = value.copyWith(isTakingPicture: true); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod( 'takePicture', {'textureId': _textureId, 'path': path}, ); @@ -365,10 +353,7 @@ class CameraController extends ValueNotifier { } try { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('startImageStream'); + await _channel.invokeMethod('startImageStream'); value = value.copyWith(isStreamingImages: true); } on PlatformException catch (e) { throw CameraException(e.code, e.message); @@ -409,10 +394,7 @@ class CameraController extends ValueNotifier { try { value = value.copyWith(isStreamingImages: false); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('stopImageStream'); + await _channel.invokeMethod('stopImageStream'); } on PlatformException catch (e) { throw CameraException(e.code, e.message); } @@ -452,10 +434,7 @@ class CameraController extends ValueNotifier { } try { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod( 'startVideoRecording', {'textureId': _textureId, 'filePath': filePath}, ); @@ -481,10 +460,7 @@ class CameraController extends ValueNotifier { } try { value = value.copyWith(isRecordingVideo: false); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod( 'stopVideoRecording', {'textureId': _textureId}, ); @@ -503,10 +479,7 @@ class CameraController extends ValueNotifier { super.dispose(); if (_creatingCompleter != null) { await _creatingCompleter.future; - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod( 'dispose', {'textureId': _textureId}, ); diff --git a/packages/camera/pubspec.yaml b/packages/camera/pubspec.yaml index d3ecc1bc5eeb..a323aa94ad6d 100644 --- a/packages/camera/pubspec.yaml +++ b/packages/camera/pubspec.yaml @@ -2,7 +2,7 @@ name: camera description: A Flutter plugin for getting information about and controlling the camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video, and streaming image buffers to dart. -version: 0.4.3 +version: 0.4.3+1 authors: - Flutter Team - Luigi Agosti From 5c7ef1631e3216a96db85ca28b6cf2a8a20a407f Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 10:29:33 -0700 Subject: [PATCH 05/49] cloud firestore --- packages/cloud_firestore/CHANGELOG.md | 6 ++-- .../lib/src/document_reference.dart | 30 ++++--------------- .../cloud_firestore/lib/src/firestore.dart | 15 ++-------- packages/cloud_firestore/lib/src/query.dart | 15 ++-------- .../cloud_firestore/lib/src/transaction.dart | 20 +++---------- .../cloud_firestore/lib/src/write_batch.dart | 25 ++++------------ packages/cloud_firestore/pubspec.yaml | 2 +- 7 files changed, 25 insertions(+), 88 deletions(-) diff --git a/packages/cloud_firestore/CHANGELOG.md b/packages/cloud_firestore/CHANGELOG.md index 39a58e8e2225..33640f0af6b5 100644 --- a/packages/cloud_firestore/CHANGELOG.md +++ b/packages/cloud_firestore/CHANGELOG.md @@ -1,7 +1,7 @@ -## 0.9.7 +## 0.9.6+1 -* Fixes a NoSuchMethodError when using getDocuments on iOS (introduced in 0.9.6). -* Adds a driver test for getDocuments. +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. ## 0.9.6 diff --git a/packages/cloud_firestore/lib/src/document_reference.dart b/packages/cloud_firestore/lib/src/document_reference.dart index 62f95252af7d..33576c758b6f 100644 --- a/packages/cloud_firestore/lib/src/document_reference.dart +++ b/packages/cloud_firestore/lib/src/document_reference.dart @@ -40,10 +40,7 @@ class DocumentReference { /// If [merge] is true, the provided data will be merged into an /// existing document instead of overwriting. Future setData(Map data, {bool merge = false}) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return Firestore.channel.invokeMethod( + return Firestore.channel.invokeMethod( 'DocumentReference#setData', { 'app': firestore.app.name, @@ -61,10 +58,7 @@ class DocumentReference { /// /// If no document exists yet, the update will fail. Future updateData(Map data) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return Firestore.channel.invokeMethod( + return Firestore.channel.invokeMethod( 'DocumentReference#updateData', { 'app': firestore.app.name, @@ -78,10 +72,7 @@ class DocumentReference { /// /// If no document exists, the read will return null. Future get() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map data = await Firestore.channel.invokeMethod( + final Map data = await Firestore.channel.invokeMethod>( 'DocumentReference#get', {'app': firestore.app.name, 'path': path}, ); @@ -94,10 +85,7 @@ class DocumentReference { /// Deletes the document referred to by this [DocumentReference]. Future delete() { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return Firestore.channel.invokeMethod( + return Firestore.channel.invokeMethod( 'DocumentReference#delete', {'app': firestore.app.name, 'path': path}, ); @@ -120,10 +108,7 @@ class DocumentReference { StreamController controller; // ignore: close_sinks controller = StreamController.broadcast( onListen: () { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _handle = Firestore.channel.invokeMethod( + _handle = Firestore.channel.invokeMethod( 'Query#addDocumentListener', { 'app': firestore.app.name, @@ -136,10 +121,7 @@ class DocumentReference { }, onCancel: () { _handle.then((int handle) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await Firestore.channel.invokeMethod( + await Firestore.channel.invokeMethod( 'Query#removeListener', {'handle': handle}, ); diff --git a/packages/cloud_firestore/lib/src/firestore.dart b/packages/cloud_firestore/lib/src/firestore.dart index 42639d140bfe..239944c09045 100644 --- a/packages/cloud_firestore/lib/src/firestore.dart +++ b/packages/cloud_firestore/lib/src/firestore.dart @@ -111,10 +111,7 @@ class Firestore { final int transactionId = _transactionHandlerId++; _transactionHandlers[transactionId] = transactionHandler; final Map result = await channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('Firestore#runTransaction', { + .invokeMethod>('Firestore#runTransaction', { 'app': app.name, 'transactionId': transactionId, 'transactionTimeout': timeout.inMilliseconds @@ -125,10 +122,7 @@ class Firestore { @deprecated Future enablePersistence(bool enable) async { assert(enable != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod('Firestore#enablePersistence', { + await channel.invokeMethod('Firestore#enablePersistence', { 'app': app.name, 'enable': enable, }); @@ -139,10 +133,7 @@ class Firestore { String host, bool sslEnabled, bool timestampsInSnapshotsEnabled}) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod('Firestore#settings', { + await channel.invokeMethod('Firestore#settings', { 'app': app.name, 'persistenceEnabled': persistenceEnabled, 'host': host, diff --git a/packages/cloud_firestore/lib/src/query.dart b/packages/cloud_firestore/lib/src/query.dart index a23809852a86..710cd3cf776c 100644 --- a/packages/cloud_firestore/lib/src/query.dart +++ b/packages/cloud_firestore/lib/src/query.dart @@ -53,10 +53,7 @@ class Query { StreamController controller; // ignore: close_sinks controller = StreamController.broadcast( onListen: () { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _handle = Firestore.channel.invokeMethod( + _handle = Firestore.channel.invokeMethod( 'Query#addSnapshotListener', { 'app': firestore.app.name, @@ -70,10 +67,7 @@ class Query { }, onCancel: () { _handle.then((int handle) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await Firestore.channel.invokeMethod( + await Firestore.channel.invokeMethod( 'Query#removeListener', {'handle': handle}, ); @@ -86,10 +80,7 @@ class Query { /// Fetch the documents for this query Future getDocuments() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map data = await Firestore.channel.invokeMethod( + final Map data = await Firestore.channel.invokeMethod>( 'Query#getDocuments', { 'app': firestore.app.name, diff --git a/packages/cloud_firestore/lib/src/transaction.dart b/packages/cloud_firestore/lib/src/transaction.dart index 734c942f53fe..e50b4a34d492 100644 --- a/packages/cloud_firestore/lib/src/transaction.dart +++ b/packages/cloud_firestore/lib/src/transaction.dart @@ -15,10 +15,7 @@ class Transaction { Future get(DocumentReference documentReference) async { final dynamic result = await Firestore.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('Transaction#get', { + .invokeMethod('Transaction#get', { 'app': _firestore.app.name, 'transactionId': _transactionId, 'path': documentReference.path, @@ -33,10 +30,7 @@ class Transaction { Future delete(DocumentReference documentReference) async { return Firestore.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('Transaction#delete', { + .invokeMethod('Transaction#delete', { 'app': _firestore.app.name, 'transactionId': _transactionId, 'path': documentReference.path, @@ -46,10 +40,7 @@ class Transaction { Future update( DocumentReference documentReference, Map data) async { return Firestore.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('Transaction#update', { + .invokeMethod('Transaction#update', { 'app': _firestore.app.name, 'transactionId': _transactionId, 'path': documentReference.path, @@ -59,10 +50,7 @@ class Transaction { Future set( DocumentReference documentReference, Map data) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return Firestore.channel.invokeMethod('Transaction#set', { + return Firestore.channel.invokeMethod('Transaction#set', { 'app': _firestore.app.name, 'transactionId': _transactionId, 'path': documentReference.path, diff --git a/packages/cloud_firestore/lib/src/write_batch.dart b/packages/cloud_firestore/lib/src/write_batch.dart index cfa5e5253357..6a41ee7bfec3 100644 --- a/packages/cloud_firestore/lib/src/write_batch.dart +++ b/packages/cloud_firestore/lib/src/write_batch.dart @@ -12,10 +12,7 @@ part of cloud_firestore; /// nor can it be committed again. class WriteBatch { WriteBatch._(this._firestore) - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - : _handle = Firestore.channel.invokeMethod( + : _handle = Firestore.channel.invokeMethod( 'WriteBatch#create', {'app': _firestore.app.name}); final Firestore _firestore; @@ -32,10 +29,7 @@ class WriteBatch { if (!_committed) { _committed = true; await Future.wait(_actions); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await Firestore.channel.invokeMethod( + await Firestore.channel.invokeMethod( 'WriteBatch#commit', {'handle': await _handle}); } else { throw StateError("This batch has already been committed."); @@ -47,10 +41,7 @@ class WriteBatch { if (!_committed) { _handle.then((dynamic handle) { _actions.add( - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - Firestore.channel.invokeMethod( + Firestore.channel.invokeMethod( 'WriteBatch#delete', { 'app': _firestore.app.name, @@ -77,10 +68,7 @@ class WriteBatch { if (!_committed) { _handle.then((dynamic handle) { _actions.add( - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - Firestore.channel.invokeMethod( + Firestore.channel.invokeMethod( 'WriteBatch#setData', { 'app': _firestore.app.name, @@ -105,10 +93,7 @@ class WriteBatch { if (!_committed) { _handle.then((dynamic handle) { _actions.add( - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - Firestore.channel.invokeMethod( + Firestore.channel.invokeMethod( 'WriteBatch#updateData', { 'app': _firestore.app.name, diff --git a/packages/cloud_firestore/pubspec.yaml b/packages/cloud_firestore/pubspec.yaml index f4b9318a6529..1e3c4d6a00b4 100755 --- a/packages/cloud_firestore/pubspec.yaml +++ b/packages/cloud_firestore/pubspec.yaml @@ -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 homepage: https://github.com/flutter/plugins/tree/master/packages/cloud_firestore -version: 0.9.7 +version: 0.9.7+1 flutter: plugin: From b54a29fb0c02ca7feb1fd74bc3f835229c64d465 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 10:32:18 -0700 Subject: [PATCH 06/49] cloud functions --- packages/cloud_functions/CHANGELOG.md | 5 +++++ packages/cloud_functions/lib/cloud_functions.dart | 5 +---- packages/cloud_functions/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/cloud_functions/CHANGELOG.md b/packages/cloud_functions/CHANGELOG.md index 6227fb626b3e..37b78df816ba 100644 --- a/packages/cloud_functions/CHANGELOG.md +++ b/packages/cloud_functions/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.1.2+2 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.1.2+1 * Added a driver test. diff --git a/packages/cloud_functions/lib/cloud_functions.dart b/packages/cloud_functions/lib/cloud_functions.dart index 92ede2c33184..fd681be0dae3 100644 --- a/packages/cloud_functions/lib/cloud_functions.dart +++ b/packages/cloud_functions/lib/cloud_functions.dart @@ -43,10 +43,7 @@ class CloudFunctions { {@required String functionName, Map parameters}) async { try { final dynamic response = - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod('CloudFunctions#call', { + await channel.invokeMethod('CloudFunctions#call', { 'app': _app.name, 'region': _region, 'functionName': functionName, diff --git a/packages/cloud_functions/pubspec.yaml b/packages/cloud_functions/pubspec.yaml index 3bb4751ac4c6..bd8c6b2d2a41 100644 --- a/packages/cloud_functions/pubspec.yaml +++ b/packages/cloud_functions/pubspec.yaml @@ -1,6 +1,6 @@ name: cloud_functions description: Flutter plugin for Cloud Functions. -version: 0.1.2+1 +version: 0.1.2+2 author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/cloud_functions From efe5b556a2b9894e3f9a2b5776bc2db1c973521a Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 10:35:14 -0700 Subject: [PATCH 07/49] connectivity --- packages/connectivity/CHANGELOG.md | 5 +++++ packages/connectivity/lib/connectivity.dart | 12 +++--------- packages/connectivity/pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/connectivity/CHANGELOG.md b/packages/connectivity/CHANGELOG.md index 350889e2b9c4..d14a7998cc34 100644 --- a/packages/connectivity/CHANGELOG.md +++ b/packages/connectivity/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.2+1 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.4.2 * Adding getWifiIP() to obtain current wifi network's IP. diff --git a/packages/connectivity/lib/connectivity.dart b/packages/connectivity/lib/connectivity.dart index fd444b008d97..8726278426ac 100644 --- a/packages/connectivity/lib/connectivity.dart +++ b/packages/connectivity/lib/connectivity.dart @@ -61,10 +61,7 @@ class Connectivity { /// /// Instead listen for connectivity changes via [onConnectivityChanged] stream. Future checkConnectivity() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final String result = await methodChannel.invokeMethod('check'); + final String result = await methodChannel.invokeMethod('check'); return _parseConnectivityResult(result); } @@ -75,10 +72,7 @@ class Connectivity { /// From android 8.0 onwards the GPS must be ON (high accuracy) /// in order to be able to obtain the SSID. Future getWifiName() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - String wifiName = await methodChannel.invokeMethod('wifiName'); + String wifiName = await methodChannel.invokeMethod('wifiName'); // as Android might return , uniforming result // our iOS implementation will return null if (wifiName == '') wifiName = null; @@ -87,7 +81,7 @@ class Connectivity { /// Obtains the IP address of the connected wifi network Future getWifiIP() async { - return await methodChannel.invokeMethod('wifiIPAddress'); + return await methodChannel.invokeMethod('wifiIPAddress'); } } diff --git a/packages/connectivity/pubspec.yaml b/packages/connectivity/pubspec.yaml index 4840b5d50ed3..cbe3b0e091c7 100644 --- a/packages/connectivity/pubspec.yaml +++ b/packages/connectivity/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for discovering the state of the network (WiFi & mobile/cellular) connectivity on Android and iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity -version: 0.4.2 +version: 0.4.2+1 flutter: plugin: From 30d8e2f4be3e857af47700332f30b08c6f9f9564 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 10:54:08 -0700 Subject: [PATCH 08/49] git st --- packages/device_info/CHANGELOG.md | 5 +++++ packages/device_info/lib/device_info.dart | 10 ++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/device_info/CHANGELOG.md b/packages/device_info/CHANGELOG.md index 0cd39ed0b6eb..896b838a2332 100644 --- a/packages/device_info/CHANGELOG.md +++ b/packages/device_info/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.0+1 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.4.0 * Log a more detailed warning at build time about the previous AndroidX diff --git a/packages/device_info/lib/device_info.dart b/packages/device_info/lib/device_info.dart index 038de10e2268..c08d4c6ab340 100644 --- a/packages/device_info/lib/device_info.dart +++ b/packages/device_info/lib/device_info.dart @@ -22,10 +22,7 @@ class DeviceInfoPlugin { /// See: https://developer.android.com/reference/android/os/Build.html Future get androidInfo async => _cachedAndroidDeviceInfo ??= AndroidDeviceInfo._fromMap( - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod('getAndroidDeviceInfo')); + await channel.invokeMethod('getAndroidDeviceInfo')); /// This information does not change from call to call. Cache it. IosDeviceInfo _cachedIosDeviceInfo; @@ -34,10 +31,7 @@ class DeviceInfoPlugin { /// /// See: https://developer.apple.com/documentation/uikit/uidevice Future get iosInfo async => _cachedIosDeviceInfo ??= - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - IosDeviceInfo._fromMap(await channel.invokeMethod('getIosDeviceInfo')); + IosDeviceInfo._fromMap(await channel.invokeMethod('getIosDeviceInfo')); } /// Information derived from `android.os.Build`. From 02c484d6235ce0a8b7bdcdba979b0dba10a97c00 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 10:55:14 -0700 Subject: [PATCH 09/49] device_info --- packages/device_info/CHANGELOG.md | 4 ++-- packages/device_info/pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/device_info/CHANGELOG.md b/packages/device_info/CHANGELOG.md index 896b838a2332..e6ef274085f9 100644 --- a/packages/device_info/CHANGELOG.md +++ b/packages/device_info/CHANGELOG.md @@ -1,9 +1,9 @@ -## 0.4.0+1 +## 0.4.0+2 * Bump the minimum flutter version to 1.2.0. * Add Template type parameter to `invokeMethod` calls. -## 0.4.0 +## 0.4.0+1 * Log a more detailed warning at build time about the previous AndroidX migration. diff --git a/packages/device_info/pubspec.yaml b/packages/device_info/pubspec.yaml index 762677c6a2e8..b69f2838c49a 100644 --- a/packages/device_info/pubspec.yaml +++ b/packages/device_info/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin providing detailed information about the device (make, model, etc.), and Android or iOS version the app is running on. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/device_info -version: 0.4.0+1 +version: 0.4.0+2 flutter: plugin: From 4c056d6f78cc8330ff17eb22d131522a05f485fd Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 10:56:21 -0700 Subject: [PATCH 10/49] addmob --- packages/firebase_admob/CHANGELOG.md | 5 +++++ packages/firebase_admob/lib/firebase_admob.dart | 5 +---- packages/firebase_admob/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/firebase_admob/CHANGELOG.md b/packages/firebase_admob/CHANGELOG.md index 5863bb5558a0..ae3e7d9e97b9 100644 --- a/packages/firebase_admob/CHANGELOG.md +++ b/packages/firebase_admob/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.8.0+4 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.8.0+3 * Log messages about automatic configuration of the default app are now less confusing. diff --git a/packages/firebase_admob/lib/firebase_admob.dart b/packages/firebase_admob/lib/firebase_admob.dart index 4bb00f99c80a..6e7f73206689 100644 --- a/packages/firebase_admob/lib/firebase_admob.dart +++ b/packages/firebase_admob/lib/firebase_admob.dart @@ -515,10 +515,7 @@ class FirebaseAdMob { } Future _invokeBooleanMethod(String method, [dynamic arguments]) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final bool result = await FirebaseAdMob.instance._channel.invokeMethod( + final bool result = await FirebaseAdMob.instance._channel.invokeMethod( method, arguments, ); diff --git a/packages/firebase_admob/pubspec.yaml b/packages/firebase_admob/pubspec.yaml index 196b9a3e08bf..c59ca5263543 100644 --- a/packages/firebase_admob/pubspec.yaml +++ b/packages/firebase_admob/pubspec.yaml @@ -2,7 +2,7 @@ name: firebase_admob description: Firebase AdMob plugin for Flutter applications. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_admob -version: 0.8.0+3 +version: 0.8.0+4 flutter: plugin: From 530d5611c3a8f865f46caa6ba28c41ee806caf7b Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:02:04 -0700 Subject: [PATCH 11/49] firebase_anal --- packages/firebase_analytics/CHANGELOG.md | 5 +++ .../lib/firebase_analytics.dart | 45 ++++--------------- packages/firebase_analytics/pubspec.yaml | 2 +- .../test/firebase_analytics_test.dart | 15 ++----- 4 files changed, 18 insertions(+), 49 deletions(-) diff --git a/packages/firebase_analytics/CHANGELOG.md b/packages/firebase_analytics/CHANGELOG.md index b13e21e93f5f..4c9b0f1cf171 100644 --- a/packages/firebase_analytics/CHANGELOG.md +++ b/packages/firebase_analytics/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.0.4 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 2.0.3 * Add resetAnalyticsData method diff --git a/packages/firebase_analytics/lib/firebase_analytics.dart b/packages/firebase_analytics/lib/firebase_analytics.dart index 02e4dc5c4cda..9bd9482a8e17 100755 --- a/packages/firebase_analytics/lib/firebase_analytics.dart +++ b/packages/firebase_analytics/lib/firebase_analytics.dart @@ -55,10 +55,7 @@ class FirebaseAnalytics { 'Prefix "$kReservedPrefix" is reserved and cannot be used.'); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('logEvent', { + await _channel.invokeMethod('logEvent', { 'name': name, 'parameters': parameters, }); @@ -72,10 +69,7 @@ class FirebaseAnalytics { throw ArgumentError.notNull('enabled'); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('setAnalyticsCollectionEnabled', enabled); + await _channel.invokeMethod('setAnalyticsCollectionEnabled', enabled); } /// Sets the user ID property. @@ -84,10 +78,7 @@ class FirebaseAnalytics { /// /// [1]: https://www.google.com/policies/privacy/ Future setUserId(String id) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('setUserId', id); + await _channel.invokeMethod('setUserId', id); } /// Sets the current [screenName], which specifies the current visual context @@ -114,10 +105,7 @@ class FirebaseAnalytics { throw ArgumentError.notNull('screenName'); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('setCurrentScreen', { + await _channel.invokeMethod('setCurrentScreen', { 'screenName': screenName, 'screenClassOverride': screenClassOverride, }); @@ -151,10 +139,7 @@ class FirebaseAnalytics { if (name.startsWith('firebase_')) throw ArgumentError.value(name, 'name', '"firebase_" prefix is reserved'); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('setUserProperty', { + await _channel.invokeMethod('setUserProperty', { 'name': name, 'value': value, }); @@ -162,10 +147,7 @@ class FirebaseAnalytics { /// Clears all analytics data for this app from the device and resets the app instance id. Future resetAnalyticsData() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('resetAnalyticsData'); + await _channel.invokeMethod('resetAnalyticsData'); } /// Logs the standard `add_payment_info` event. @@ -823,10 +805,7 @@ class FirebaseAnalyticsAndroid { throw ArgumentError.notNull('enabled'); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('setAnalyticsCollectionEnabled', enabled); + await _channel.invokeMethod('setAnalyticsCollectionEnabled', enabled); } /// Sets the minimum engagement time required before starting a session. @@ -837,10 +816,7 @@ class FirebaseAnalyticsAndroid { throw ArgumentError.notNull('milliseconds'); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('setMinimumSessionDuration', milliseconds); + await _channel.invokeMethod('setMinimumSessionDuration', milliseconds); } /// Sets the duration of inactivity that terminates the current session. @@ -851,10 +827,7 @@ class FirebaseAnalyticsAndroid { throw ArgumentError.notNull('milliseconds'); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('setSessionTimeoutDuration', milliseconds); + await _channel.invokeMethod('setSessionTimeoutDuration', milliseconds); } } diff --git a/packages/firebase_analytics/pubspec.yaml b/packages/firebase_analytics/pubspec.yaml index 852f88e02d87..f0a7d6fbd071 100755 --- a/packages/firebase_analytics/pubspec.yaml +++ b/packages/firebase_analytics/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Analytics for Firebase, an app measuremen solution that provides insight on app usage and user engagement on Android and iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_analytics -version: 2.0.3 +version: 2.0.4 flutter: plugin: diff --git a/packages/firebase_analytics/test/firebase_analytics_test.dart b/packages/firebase_analytics/test/firebase_analytics_test.dart index 13c731421662..fb69152d707d 100755 --- a/packages/firebase_analytics/test/firebase_analytics_test.dart +++ b/packages/firebase_analytics/test/firebase_analytics_test.dart @@ -39,10 +39,7 @@ void main() { invokedMethod = null; arguments = null; - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - when(mockChannel.invokeMethod(any, any)) + when(mockChannel.invokeMethod(any, any)) .thenAnswer((Invocation invocation) { invokedMethod = invocation.positionalArguments[0]; arguments = invocation.positionalArguments[1]; @@ -133,10 +130,7 @@ void main() { name = null; parameters = null; - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - when(mockChannel.invokeMethod('logEvent', any)) + when(mockChannel.invokeMethod('logEvent', any)) .thenAnswer((Invocation invocation) { final Map args = invocation.positionalArguments[1]; name = args['name']; @@ -145,10 +139,7 @@ void main() { return Future.value(); }); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - when(mockChannel.invokeMethod(argThat(isNot('logEvent')), any)) + when(mockChannel.invokeMethod(argThat(isNot('logEvent')), any)) .thenThrow(ArgumentError('Only logEvent invocations expected')); analytics = FirebaseAnalytics.private(mockChannel); From 77b4fc202e6737e8f5e841b6e19b378c03c6fb14 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:09:27 -0700 Subject: [PATCH 12/49] firebase_auth --- packages/firebase_auth/CHANGELOG.md | 5 ++ .../firebase_auth/lib/src/firebase_auth.dart | 65 ++++--------------- .../firebase_auth/lib/src/firebase_user.dart | 45 +++---------- packages/firebase_auth/pubspec.yaml | 2 +- 4 files changed, 28 insertions(+), 89 deletions(-) diff --git a/packages/firebase_auth/CHANGELOG.md b/packages/firebase_auth/CHANGELOG.md index b84b050f85a4..8d2b1a7a4bba 100644 --- a/packages/firebase_auth/CHANGELOG.md +++ b/packages/firebase_auth/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.8.1+6 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.8.1+5 * Added a driver test. diff --git a/packages/firebase_auth/lib/src/firebase_auth.dart b/packages/firebase_auth/lib/src/firebase_auth.dart index b47556b84241..f148b4676082 100644 --- a/packages/firebase_auth/lib/src/firebase_auth.dart +++ b/packages/firebase_auth/lib/src/firebase_auth.dart @@ -44,20 +44,14 @@ class FirebaseAuth { StreamController controller; controller = StreamController.broadcast(onListen: () { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _handle = channel.invokeMethod('startListeningAuthState', + _handle = channel.invokeMethod('startListeningAuthState', {"app": app.name}).then((dynamic v) => v); _handle.then((int handle) { _authStateChangedControllers[handle] = controller; }); }, onCancel: () { _handle.then((int handle) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod("stopListeningAuthState", + await channel.invokeMethod("stopListeningAuthState", {"id": handle, "app": app.name}); _authStateChangedControllers.remove(handle); }); @@ -79,10 +73,7 @@ class FirebaseAuth { /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Anonymous accounts are not enabled. Future signInAnonymously() async { final Map data = await channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('signInAnonymously', {"app": app.name}); + .invokeMethod>('signInAnonymously', {"app": app.name}); final FirebaseUser currentUser = FirebaseUser._(data, app); return currentUser; } @@ -102,10 +93,7 @@ class FirebaseAuth { }) async { assert(email != null); assert(password != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map data = await channel.invokeMethod( + final Map data = await channel.invokeMethod>( 'createUserWithEmailAndPassword', {'email': email, 'password': password, 'app': app.name}, ); @@ -126,10 +114,7 @@ class FirebaseAuth { @required String email, }) async { assert(email != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final List providers = await channel.invokeMethod( + final List providers = await channel.invokeMethod>( 'fetchSignInMethodsForEmail', {'email': email, 'app': app.name}, ); @@ -147,10 +132,7 @@ class FirebaseAuth { @required String email, }) async { assert(email != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await channel.invokeMethod( + return await channel.invokeMethod( 'sendPasswordResetEmail', {'email': email, 'app': app.name}, ); @@ -205,10 +187,7 @@ class FirebaseAuth { /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Google accounts are not enabled. Future signInWithCredential(AuthCredential credential) async { assert(credential != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map data = await channel.invokeMethod( + final Map data = await channel.invokeMethod>( 'signInWithCredential', { 'app': app.name, @@ -288,10 +267,7 @@ class FirebaseAuth { 'app': app.name, }; - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod('verifyPhoneNumber', params); + await channel.invokeMethod('verifyPhoneNumber', params); } /// Tries to sign in a user with a given Custom Token [token]. @@ -314,10 +290,7 @@ class FirebaseAuth { /// Ensure your app's SHA1 is correct in the Firebase console. Future signInWithCustomToken({@required String token}) async { assert(token != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map data = await channel.invokeMethod( + final Map data = await channel.invokeMethod>( 'signInWithCustomToken', {'token': token, 'app': app.name}, ); @@ -331,19 +304,13 @@ class FirebaseAuth { /// the [onAuthStateChanged] stream. Future signOut() async { return await channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod("signOut", {'app': app.name}); + .invokeMethod("signOut", {'app': app.name}); } /// Returns the currently signed-in [FirebaseUser] or [null] if there is none. Future currentUser() async { final Map data = await channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod("currentUser", {'app': app.name}); + .invokeMethod>("currentUser", {'app': app.name}); final FirebaseUser currentUser = data == null ? null : FirebaseUser._(data, app); return currentUser; @@ -365,10 +332,7 @@ class FirebaseAuth { /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that this type of account is not enabled. Future linkWithCredential(AuthCredential credential) async { assert(credential != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map data = await channel.invokeMethod( + final Map data = await channel.invokeMethod>( 'linkWithCredential', { 'app': app.name, @@ -385,10 +349,7 @@ class FirebaseAuth { /// code should follow the conventions defined by the IETF in BCP47. Future setLanguageCode(String language) async { assert(language != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await FirebaseAuth.channel.invokeMethod('setLanguageCode', { + await FirebaseAuth.channel.invokeMethod('setLanguageCode', { 'language': language, 'app': app.name, }); diff --git a/packages/firebase_auth/lib/src/firebase_user.dart b/packages/firebase_auth/lib/src/firebase_user.dart index 15fa458f139f..401b5600fbd2 100644 --- a/packages/firebase_auth/lib/src/firebase_user.dart +++ b/packages/firebase_auth/lib/src/firebase_user.dart @@ -35,10 +35,7 @@ class FirebaseUser extends UserInfo { /// Completes with an error if the user is signed out. Future getIdToken({bool refresh = false}) async { return await FirebaseAuth.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('getIdToken', { + .invokeMethod('getIdToken', { 'refresh': refresh, 'app': _app.name, }); @@ -46,10 +43,7 @@ class FirebaseUser extends UserInfo { /// Initiates email verification for the user. Future sendEmailVerification() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await FirebaseAuth.channel.invokeMethod( + await FirebaseAuth.channel.invokeMethod( 'sendEmailVerification', {'app': _app.name}); } @@ -57,19 +51,13 @@ class FirebaseUser extends UserInfo { /// attached providers, display name, and so on). Future reload() async { await FirebaseAuth.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('reload', {'app': _app.name}); + .invokeMethod('reload', {'app': _app.name}); } /// Deletes the user record from your Firebase project's database. Future delete() async { await FirebaseAuth.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('delete', {'app': _app.name}); + .invokeMethod('delete', {'app': _app.name}); } /// Updates the email address of the user. @@ -90,10 +78,7 @@ class FirebaseUser extends UserInfo { /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Email & Password accounts are not enabled. Future updateEmail(String email) async { assert(email != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await FirebaseAuth.channel.invokeMethod( + return await FirebaseAuth.channel.invokeMethod( 'updateEmail', {'email': email, 'app': _app.name}, ); @@ -115,10 +100,7 @@ class FirebaseUser extends UserInfo { /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Email & Password accounts are not enabled. Future updatePassword(String password) async { assert(password != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await FirebaseAuth.channel.invokeMethod( + return await FirebaseAuth.channel.invokeMethod( 'updatePassword', {'password': password, 'app': _app.name}, ); @@ -133,10 +115,7 @@ class FirebaseUser extends UserInfo { assert(userUpdateInfo != null); final Map data = userUpdateInfo._updateData; data['app'] = _app.name; - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await FirebaseAuth.channel.invokeMethod( + return await FirebaseAuth.channel.invokeMethod( 'updateProfile', data, ); @@ -161,10 +140,7 @@ class FirebaseUser extends UserInfo { Future reauthenticateWithCredential( AuthCredential credential) async { assert(credential != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await FirebaseAuth.channel.invokeMethod( + await FirebaseAuth.channel.invokeMethod( 'reauthenticateWithCredential', { 'app': _app.name, @@ -190,10 +166,7 @@ class FirebaseUser extends UserInfo { /// • `ERROR_REQUIRES_RECENT_LOGIN` - If the user's last sign-in time does not meet the security threshold. Use reauthenticate methods to resolve. Future unlinkFromProvider(String provider) async { assert(provider != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await FirebaseAuth.channel.invokeMethod( + return await FirebaseAuth.channel.invokeMethod( 'unlinkFromProvider', {'provider': provider, 'app': _app.name}, ); diff --git a/packages/firebase_auth/pubspec.yaml b/packages/firebase_auth/pubspec.yaml index 7ef7c728d779..93900b9b33b3 100755 --- a/packages/firebase_auth/pubspec.yaml +++ b/packages/firebase_auth/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for Firebase Auth, enabling Android and iOS like Google, Facebook and Twitter. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_auth -version: "0.8.1+5" +version: "0.8.1+6" flutter: plugin: From 3497720a7097eb85f1e48f6f6ab8612886f806e9 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:12:44 -0700 Subject: [PATCH 13/49] firebase_core --- packages/firebase_core/CHANGELOG.md | 5 +++++ .../firebase_core/lib/src/firebase_app.dart | 21 +++++-------------- packages/firebase_core/pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/packages/firebase_core/CHANGELOG.md b/packages/firebase_core/CHANGELOG.md index 99ea4b61983f..68ac9f14da4c 100644 --- a/packages/firebase_core/CHANGELOG.md +++ b/packages/firebase_core/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.1+2 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.3.1+1 * Add nil check on static functions to prevent crashes or unwanted behaviors. diff --git a/packages/firebase_core/lib/src/firebase_app.dart b/packages/firebase_core/lib/src/firebase_app.dart index 041dbf10b650..9d78a87344d8 100644 --- a/packages/firebase_core/lib/src/firebase_app.dart +++ b/packages/firebase_core/lib/src/firebase_app.dart @@ -24,10 +24,7 @@ class FirebaseApp { /// This getter is asynchronous because apps can also be configured by native /// code. Future get options async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map app = await channel.invokeMethod( + final Map app = await channel.invokeMethod>( 'FirebaseApp#appNamed', name, ); @@ -38,10 +35,7 @@ class FirebaseApp { /// Returns a previously created FirebaseApp instance with the given name, /// or null if no such app exists. static Future appNamed(String name) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map app = await channel.invokeMethod( + final Map app = await channel.invokeMethod>( 'FirebaseApp#appNamed', name, ); @@ -70,10 +64,8 @@ class FirebaseApp { if (existingApp != null) { return existingApp; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod( + + await channel.invokeMethod( 'FirebaseApp#configure', {'name': name, 'options': options.asMap}, ); @@ -83,10 +75,7 @@ class FirebaseApp { /// Returns a list of all extant FirebaseApp instances, or null if there are /// no FirebaseApp instances. static Future> allApps() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final List result = await channel.invokeMethod( + final List result = await channel.invokeMethod>( 'FirebaseApp#allApps', ); return result diff --git a/packages/firebase_core/pubspec.yaml b/packages/firebase_core/pubspec.yaml index 2f215ff691eb..9fb3b5b49e71 100644 --- a/packages/firebase_core/pubspec.yaml +++ b/packages/firebase_core/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Core, enabling connecting to multiple Firebase apps. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_core -version: 0.3.1+1 +version: 0.3.1+2 flutter: plugin: From 97a295addeef8e0344a2f641d6cedbe92cef88f9 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:16:59 -0700 Subject: [PATCH 14/49] firebase_database --- .../lib/src/database_reference.dart | 20 +++------------ .../lib/src/firebase_database.dart | 25 ++++--------------- .../lib/src/on_disconnect.dart | 15 +++-------- packages/firebase_database/lib/src/query.dart | 15 +++-------- 4 files changed, 15 insertions(+), 60 deletions(-) diff --git a/packages/firebase_database/lib/src/database_reference.dart b/packages/firebase_database/lib/src/database_reference.dart index b6d599394b19..50ee2fb6fd54 100644 --- a/packages/firebase_database/lib/src/database_reference.dart +++ b/packages/firebase_database/lib/src/database_reference.dart @@ -70,10 +70,7 @@ class DatabaseReference extends Query { /// Passing null for the new value means all data at this location or any /// child location will be deleted. Future set(dynamic value, {dynamic priority}) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _database._channel.invokeMethod( + return _database._channel.invokeMethod( 'DatabaseReference#set', { 'app': _database.app?.name, @@ -87,10 +84,7 @@ class DatabaseReference extends Query { /// Update the node with the `value` Future update(Map value) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _database._channel.invokeMethod( + return _database._channel.invokeMethod( 'DatabaseReference#update', { 'app': _database.app?.name, @@ -126,10 +120,7 @@ class DatabaseReference extends Query { /// floating-point numbers. Keys are always stored as strings and are treated /// as numbers only when they can be parsed as a 32-bit integer. Future setPriority(dynamic priority) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _database._channel.invokeMethod( + return _database._channel.invokeMethod( 'DatabaseReference#setPriority', { 'app': _database.app?.name, @@ -180,10 +171,7 @@ class DatabaseReference extends Query { } _database._channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('DatabaseReference#runTransaction', { + .invokeMethod('DatabaseReference#runTransaction', { 'app': _database.app?.name, 'databaseURL': _database.databaseURL, 'path': path, diff --git a/packages/firebase_database/lib/src/firebase_database.dart b/packages/firebase_database/lib/src/firebase_database.dart index 8780f1a5e56b..e4b16bd50dd6 100644 --- a/packages/firebase_database/lib/src/firebase_database.dart +++ b/packages/firebase_database/lib/src/firebase_database.dart @@ -88,10 +88,7 @@ class FirebaseDatabase { /// thus be available again when the app is restarted (even when there is no /// network connectivity at that time). Future setPersistenceEnabled(bool enabled) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final bool result = await _channel.invokeMethod( + final bool result = await _channel.invokeMethod( 'FirebaseDatabase#setPersistenceEnabled', { 'app': app?.name, @@ -120,10 +117,7 @@ class FirebaseDatabase { /// on disk may temporarily exceed it at times. Cache sizes smaller than 1 MB /// or greater than 100 MB are not supported. Future setPersistenceCacheSizeBytes(int cacheSize) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final bool result = await _channel.invokeMethod( + final bool result = await _channel.invokeMethod( 'FirebaseDatabase#setPersistenceCacheSizeBytes', { 'app': app?.name, @@ -137,10 +131,7 @@ class FirebaseDatabase { /// Resumes our connection to the Firebase Database backend after a previous /// [goOffline] call. Future goOnline() { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _channel.invokeMethod( + return _channel.invokeMethod( 'FirebaseDatabase#goOnline', { 'app': app?.name, @@ -152,10 +143,7 @@ class FirebaseDatabase { /// Shuts down our connection to the Firebase Database backend until /// [goOnline] is called. Future goOffline() { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _channel.invokeMethod( + return _channel.invokeMethod( 'FirebaseDatabase#goOffline', { 'app': app?.name, @@ -175,10 +163,7 @@ class FirebaseDatabase { /// affected event listeners, and the client will not (re-)send them to the /// Firebase Database backend. Future purgeOutstandingWrites() { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _channel.invokeMethod( + return _channel.invokeMethod( 'FirebaseDatabase#purgeOutstandingWrites', { 'app': app?.name, diff --git a/packages/firebase_database/lib/src/on_disconnect.dart b/packages/firebase_database/lib/src/on_disconnect.dart index 4229706240f5..24769710ce0f 100644 --- a/packages/firebase_database/lib/src/on_disconnect.dart +++ b/packages/firebase_database/lib/src/on_disconnect.dart @@ -8,10 +8,7 @@ class OnDisconnect { final String path; Future set(dynamic value, {dynamic priority}) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _database._channel.invokeMethod( + return _database._channel.invokeMethod( 'OnDisconnect#set', { 'app': _database.app?.name, @@ -26,10 +23,7 @@ class OnDisconnect { Future remove() => set(null); Future cancel() { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _database._channel.invokeMethod( + return _database._channel.invokeMethod( 'OnDisconnect#cancel', { 'app': _database.app?.name, @@ -40,10 +34,7 @@ class OnDisconnect { } Future update(Map value) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _database._channel.invokeMethod( + return _database._channel.invokeMethod( 'OnDisconnect#update', { 'app': _database.app?.name, diff --git a/packages/firebase_database/lib/src/query.dart b/packages/firebase_database/lib/src/query.dart index a93ded5a91fb..cd7755aab858 100644 --- a/packages/firebase_database/lib/src/query.dart +++ b/packages/firebase_database/lib/src/query.dart @@ -47,10 +47,7 @@ class Query { StreamController controller; // ignore: close_sinks controller = StreamController.broadcast( onListen: () { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _handle = _database._channel.invokeMethod( + _handle = _database._channel.invokeMethod( 'Query#observe', { 'app': _database.app?.name, @@ -66,10 +63,7 @@ class Query { }, onCancel: () { _handle.then((int handle) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _database._channel.invokeMethod( + await _database._channel.invokeMethod( 'Query#removeObserver', { 'app': _database.app?.name, @@ -212,10 +206,7 @@ class Query { /// attached for that location. Additionally, while a location is kept synced, /// it will not be evicted from the persistent disk cache. Future keepSynced(bool value) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _database._channel.invokeMethod( + return _database._channel.invokeMethod( 'Query#keepSynced', { 'app': _database.app?.name, From a75ab4a84c724114c5d3690ac33ba2e9c449b9cc Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:18:34 -0700 Subject: [PATCH 15/49] dynamic link --- packages/firebase_dynamic_links/CHANGELOG.md | 5 +++++ .../lib/src/dynamic_link_parameters.dart | 15 +++------------ .../lib/src/firebase_dynamic_links.dart | 5 +---- packages/firebase_dynamic_links/pubspec.yaml | 2 +- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/packages/firebase_dynamic_links/CHANGELOG.md b/packages/firebase_dynamic_links/CHANGELOG.md index 5df11e804c8f..bed4d6edb46a 100644 --- a/packages/firebase_dynamic_links/CHANGELOG.md +++ b/packages/firebase_dynamic_links/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.2.0+5 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.2.0+4 * Fix crash when receiving `ShortDynamicLink` warnings. diff --git a/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart b/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart index 0391d8c5b9d2..aa76dfad192c 100644 --- a/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart +++ b/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart @@ -66,10 +66,7 @@ class DynamicLinkParameters { static Future shortenUrl(Uri url, [DynamicLinkParametersOptions options]) async { final Map reply = await FirebaseDynamicLinks.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('DynamicLinkParameters#shortenUrl', { + .invokeMethod >('DynamicLinkParameters#shortenUrl', { 'url': url.toString(), 'dynamicLinkParametersOptions': options?._data, }); @@ -92,20 +89,14 @@ class DynamicLinkParameters { /// Generate a long Dynamic Link URL. Future buildUrl() async { final String url = await FirebaseDynamicLinks.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('DynamicLinkParameters#buildUrl', _data); + .invokeMethod('DynamicLinkParameters#buildUrl', _data); return Uri.parse(url); } /// Generate a short Dynamic Link. Future buildShortLink() async { final Map reply = await FirebaseDynamicLinks.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('DynamicLinkParameters#buildShortLink', _data); + .invokeMethod>('DynamicLinkParameters#buildShortLink', _data); return _parseShortLink(reply); } diff --git a/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart b/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart index 752df5cd691d..cc2731d4e1a7 100644 --- a/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart +++ b/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart @@ -24,10 +24,7 @@ class FirebaseDynamicLinks { /// the first attempt. Future retrieveDynamicLink() async { final Map linkData = - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod('FirebaseDynamicLinks#retrieveDynamicLink'); + await channel.invokeMethod>('FirebaseDynamicLinks#retrieveDynamicLink'); if (linkData == null) return null; diff --git a/packages/firebase_dynamic_links/pubspec.yaml b/packages/firebase_dynamic_links/pubspec.yaml index 8896dd18c419..150a2e48e10b 100644 --- a/packages/firebase_dynamic_links/pubspec.yaml +++ b/packages/firebase_dynamic_links/pubspec.yaml @@ -1,7 +1,7 @@ name: firebase_dynamic_links description: Flutter plugin for Google Dynamic Links for Firebase, an app solution for creating and handling links across multiple platforms. -version: 0.2.0+4 +version: 0.2.0+5 author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_dynamic_links From bc10d378ecf5d3886bc12f25de6e4dfce8e9e2a8 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:24:35 -0700 Subject: [PATCH 16/49] firebase_messaging --- packages/firebase_messaging/CHANGELOG.md | 5 ++ .../lib/firebase_messaging.dart | 41 ++++----------- packages/firebase_messaging/pubspec.yaml | 2 +- .../test/firebase_messaging_test.dart | 50 ++++--------------- 4 files changed, 25 insertions(+), 73 deletions(-) diff --git a/packages/firebase_messaging/CHANGELOG.md b/packages/firebase_messaging/CHANGELOG.md index 88ecf80be9bc..42c48b34ffa9 100644 --- a/packages/firebase_messaging/CHANGELOG.md +++ b/packages/firebase_messaging/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.0.1 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 4.0.0+1 * Log messages about automatic configuration of the default app are now less confusing. diff --git a/packages/firebase_messaging/lib/firebase_messaging.dart b/packages/firebase_messaging/lib/firebase_messaging.dart index 3c2770b760f2..580b7208c268 100644 --- a/packages/firebase_messaging/lib/firebase_messaging.dart +++ b/packages/firebase_messaging/lib/firebase_messaging.dart @@ -42,10 +42,8 @@ class FirebaseMessaging { if (!_platform.isIOS) { return; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _channel.invokeMethod( + + _channel.invokeMethod( 'requestNotificationPermissions', iosSettings.toMap()); } @@ -69,10 +67,7 @@ class FirebaseMessaging { _onLaunch = onLaunch; _onResume = onResume; _channel.setMethodCallHandler(_handleMethod); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _channel.invokeMethod('configure'); + _channel.invokeMethod('configure'); } final StreamController _tokenStreamController = @@ -85,10 +80,7 @@ class FirebaseMessaging { /// Returns the FCM token. Future getToken() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await _channel.invokeMethod('getToken'); + return await _channel.invokeMethod('getToken'); } /// Subscribe to topic in background. @@ -96,18 +88,12 @@ class FirebaseMessaging { /// [topic] must match the following regular expression: /// "[a-zA-Z0-9-_.~%]{1,900}". void subscribeToTopic(String topic) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _channel.invokeMethod('subscribeToTopic', topic); + _channel.invokeMethod('subscribeToTopic', topic); } /// Unsubscribe from topic in background. void unsubscribeFromTopic(String topic) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _channel.invokeMethod('unsubscribeFromTopic', topic); + _channel.invokeMethod('unsubscribeFromTopic', topic); } /// Resets Instance ID and revokes all tokens. In iOS, it also unregisters from remote notifications. @@ -116,26 +102,17 @@ class FirebaseMessaging { /// /// returns true if the operations executed successfully and false if an error ocurred Future deleteInstanceID() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await _channel.invokeMethod('deleteInstanceID'); + return await _channel.invokeMethod('deleteInstanceID'); } /// Determine whether FCM auto-initialization is enabled or disabled. Future autoInitEnabled() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await _channel.invokeMethod('autoInitEnabled'); + return await _channel.invokeMethod('autoInitEnabled'); } /// Enable or disable auto-initialization of Firebase Cloud Messaging. Future setAutoInitEnabled(bool enabled) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('setAutoInitEnabled', enabled); + await _channel.invokeMethod('setAutoInitEnabled', enabled); } Future _handleMethod(MethodCall call) async { diff --git a/packages/firebase_messaging/pubspec.yaml b/packages/firebase_messaging/pubspec.yaml index aa43e8d85e6c..d7e1204137cd 100644 --- a/packages/firebase_messaging/pubspec.yaml +++ b/packages/firebase_messaging/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Cloud Messaging, a cross-platform messaging solution that lets you reliably deliver messages on Android and iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_messaging -version: 4.0.0+1 +version: 4.0.1 flutter: plugin: diff --git a/packages/firebase_messaging/test/firebase_messaging_test.dart b/packages/firebase_messaging/test/firebase_messaging_test.dart index 9ef535138edb..9cfb7e4bad68 100644 --- a/packages/firebase_messaging/test/firebase_messaging_test.dart +++ b/packages/firebase_messaging/test/firebase_messaging_test.dart @@ -22,20 +22,14 @@ void main() { test('requestNotificationPermissions on ios with default permissions', () { firebaseMessaging.requestNotificationPermissions(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - verify(mockChannel.invokeMethod('requestNotificationPermissions', + verify(mockChannel.invokeMethod('requestNotificationPermissions', {'sound': true, 'badge': true, 'alert': true})); }); test('requestNotificationPermissions on ios with custom permissions', () { firebaseMessaging.requestNotificationPermissions( const IosNotificationSettings(sound: false)); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - verify(mockChannel.invokeMethod('requestNotificationPermissions', + verify(mockChannel.invokeMethod('requestNotificationPermissions', {'sound': false, 'badge': true, 'alert': true})); }); @@ -58,10 +52,7 @@ void main() { test('configure', () { firebaseMessaging.configure(); verify(mockChannel.setMethodCallHandler(any)); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - verify(mockChannel.invokeMethod('configure')); + verify(mockChannel.invokeMethod('configure')); }); test('incoming token', () async { @@ -134,42 +125,27 @@ void main() { test('subscribe to topic', () { firebaseMessaging.subscribeToTopic(myTopic); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - verify(mockChannel.invokeMethod('subscribeToTopic', myTopic)); + verify(mockChannel.invokeMethod('subscribeToTopic', myTopic)); }); test('unsubscribe from topic', () { firebaseMessaging.unsubscribeFromTopic(myTopic); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - verify(mockChannel.invokeMethod('unsubscribeFromTopic', myTopic)); + verify(mockChannel.invokeMethod('unsubscribeFromTopic', myTopic)); }); test('getToken', () { firebaseMessaging.getToken(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - verify(mockChannel.invokeMethod('getToken')); + verify(mockChannel.invokeMethod('getToken')); }); test('deleteInstanceID', () { firebaseMessaging.deleteInstanceID(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - verify(mockChannel.invokeMethod('deleteInstanceID')); + verify(mockChannel.invokeMethod('deleteInstanceID')); }); test('autoInitEnabled', () { firebaseMessaging.autoInitEnabled(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - verify(mockChannel.invokeMethod('autoInitEnabled')); + verify(mockChannel.invokeMethod('autoInitEnabled')); }); test('setAutoInitEnabled', () { @@ -179,10 +155,7 @@ void main() { firebaseMessaging.setAutoInitEnabled(true); // assert we called the method with enabled = true - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - verify(mockChannel.invokeMethod('setAutoInitEnabled', true)); + verify(mockChannel.invokeMethod('setAutoInitEnabled', true)); // assert that enabled = false was not yet called verifyNever(firebaseMessaging.setAutoInitEnabled(false)); @@ -190,10 +163,7 @@ void main() { firebaseMessaging.setAutoInitEnabled(false); // assert call with enabled = false was properly done - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - verify(mockChannel.invokeMethod('setAutoInitEnabled', false)); + verify(mockChannel.invokeMethod('setAutoInitEnabled', false)); }); } From a423948035e38a0a27b821dd44eb4f8dabed1a7c Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:26:26 -0700 Subject: [PATCH 17/49] ml_vision --- .../firebase_ml_vision/lib/src/barcode_detector.dart | 5 +---- packages/firebase_ml_vision/lib/src/face_detector.dart | 5 +---- .../firebase_ml_vision/lib/src/label_detector.dart | 10 ++-------- .../firebase_ml_vision/lib/src/text_recognizer.dart | 5 +---- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/packages/firebase_ml_vision/lib/src/barcode_detector.dart b/packages/firebase_ml_vision/lib/src/barcode_detector.dart index 72ff8b165a9d..a65c1c59cb24 100644 --- a/packages/firebase_ml_vision/lib/src/barcode_detector.dart +++ b/packages/firebase_ml_vision/lib/src/barcode_detector.dart @@ -190,10 +190,7 @@ class BarcodeDetector { /// Detects barcodes in the input image. Future> detectInImage(FirebaseVisionImage visionImage) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final List reply = await FirebaseVision.channel.invokeMethod( + final List reply = await FirebaseVision.channel.invokeMethod>( 'BarcodeDetector#detectInImage', { 'options': { diff --git a/packages/firebase_ml_vision/lib/src/face_detector.dart b/packages/firebase_ml_vision/lib/src/face_detector.dart index ad451ba0a104..2bacdfc2aa3f 100644 --- a/packages/firebase_ml_vision/lib/src/face_detector.dart +++ b/packages/firebase_ml_vision/lib/src/face_detector.dart @@ -45,10 +45,7 @@ class FaceDetector { /// Detects faces in the input image. Future> processImage(FirebaseVisionImage visionImage) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final List reply = await FirebaseVision.channel.invokeMethod( + final List reply = await FirebaseVision.channel.invokeMethod>( 'FaceDetector#processImage', { 'options': { diff --git a/packages/firebase_ml_vision/lib/src/label_detector.dart b/packages/firebase_ml_vision/lib/src/label_detector.dart index a37060a9b626..ed5c4ba4f08f 100644 --- a/packages/firebase_ml_vision/lib/src/label_detector.dart +++ b/packages/firebase_ml_vision/lib/src/label_detector.dart @@ -34,10 +34,7 @@ class LabelDetector { /// Detects entities in the input image. Future> detectInImage(FirebaseVisionImage visionImage) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final List reply = await FirebaseVision.channel.invokeMethod( + final List reply = await FirebaseVision.channel.invokeMethod>( 'LabelDetector#detectInImage', { 'options': { @@ -85,10 +82,7 @@ class CloudLabelDetector { /// Detects entities in the input image. Future> detectInImage(FirebaseVisionImage visionImage) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final List reply = await FirebaseVision.channel.invokeMethod( + final List reply = await FirebaseVision.channel.invokeMethod>( 'CloudLabelDetector#detectInImage', { 'options': options._serialize(), diff --git a/packages/firebase_ml_vision/lib/src/text_recognizer.dart b/packages/firebase_ml_vision/lib/src/text_recognizer.dart index 8f6e1d8c2e1d..a7000bf60c9e 100644 --- a/packages/firebase_ml_vision/lib/src/text_recognizer.dart +++ b/packages/firebase_ml_vision/lib/src/text_recognizer.dart @@ -24,10 +24,7 @@ class TextRecognizer { /// Detects [VisionText] from a [FirebaseVisionImage]. Future processImage(FirebaseVisionImage visionImage) async { final Map reply = - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await FirebaseVision.channel.invokeMethod( + await FirebaseVision.channel.invokeMethod>( 'TextRecognizer#processImage', { 'options': {}, From 04b3b310d82f04467aa5e1fe7e412a0e7efae820 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:29:58 -0700 Subject: [PATCH 18/49] firebase_performance --- packages/firebase_performance/CHANGELOG.md | 5 +++++ .../lib/src/firebase_performance.dart | 10 ++-------- packages/firebase_performance/lib/src/http_metric.dart | 10 ++-------- packages/firebase_performance/lib/src/trace.dart | 10 ++-------- packages/firebase_performance/pubspec.yaml | 2 +- 5 files changed, 12 insertions(+), 25 deletions(-) diff --git a/packages/firebase_performance/CHANGELOG.md b/packages/firebase_performance/CHANGELOG.md index b676576bd2c0..fc7964ec878a 100644 --- a/packages/firebase_performance/CHANGELOG.md +++ b/packages/firebase_performance/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.1.0+5 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.1.0+4 * Remove deprecated methods for iOS. diff --git a/packages/firebase_performance/lib/src/firebase_performance.dart b/packages/firebase_performance/lib/src/firebase_performance.dart index 381236d44dc7..25312efac09e 100644 --- a/packages/firebase_performance/lib/src/firebase_performance.dart +++ b/packages/firebase_performance/lib/src/firebase_performance.dart @@ -30,10 +30,7 @@ class FirebasePerformance { /// does not reflect whether instrumentation is enabled/disabled. Future isPerformanceCollectionEnabled() async { final bool isEnabled = await channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('FirebasePerformance#isPerformanceCollectionEnabled'); + .invokeMethod('FirebasePerformance#isPerformanceCollectionEnabled'); return isEnabled; } @@ -42,10 +39,7 @@ class FirebasePerformance { /// This setting is persisted and applied on future invocations of your /// application. By default, performance monitoring is enabled. Future setPerformanceCollectionEnabled(bool enable) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod( + await channel.invokeMethod( 'FirebasePerformance#setPerformanceCollectionEnabled', enable); } diff --git a/packages/firebase_performance/lib/src/http_metric.dart b/packages/firebase_performance/lib/src/http_metric.dart index a2e221b368e1..a0a5ec15732a 100644 --- a/packages/firebase_performance/lib/src/http_metric.dart +++ b/packages/firebase_performance/lib/src/http_metric.dart @@ -48,10 +48,7 @@ class HttpMetric extends PerformanceAttributes { _hasStarted = true; return FirebasePerformance.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('HttpMetric#start', { + .invokeMethod('HttpMetric#start', { 'handle': _handle, 'url': _url, 'httpMethod': _httpMethod.index, @@ -79,10 +76,7 @@ class HttpMetric extends PerformanceAttributes { }; _hasStopped = true; - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return FirebasePerformance.channel.invokeMethod('HttpMetric#stop', data); + return FirebasePerformance.channel.invokeMethod('HttpMetric#stop', data); } /// Sets a String [value] for the specified [attribute]. diff --git a/packages/firebase_performance/lib/src/trace.dart b/packages/firebase_performance/lib/src/trace.dart index 6ff6ab996ee9..96e6bb7d69c6 100644 --- a/packages/firebase_performance/lib/src/trace.dart +++ b/packages/firebase_performance/lib/src/trace.dart @@ -48,10 +48,7 @@ class Trace extends PerformanceAttributes { _hasStarted = true; return FirebasePerformance.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('Trace#start', { + .invokeMethod('Trace#start', { 'handle': _handle, 'name': _name, }); @@ -76,10 +73,7 @@ class Trace extends PerformanceAttributes { }; _hasStopped = true; - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return FirebasePerformance.channel.invokeMethod('Trace#stop', data); + return FirebasePerformance.channel.invokeMethod('Trace#stop', data); } /// Increments the counter with the given [name] by [incrementBy]. diff --git a/packages/firebase_performance/pubspec.yaml b/packages/firebase_performance/pubspec.yaml index 5c7d34b07e7d..64388afa12db 100644 --- a/packages/firebase_performance/pubspec.yaml +++ b/packages/firebase_performance/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for Google Performance Monitoring for Firebase, an a iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_performance -version: 0.1.0+4 +version: 0.1.0+5 dependencies: flutter: From 88eb14914159aeea035bba336f0012502a364551 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:31:57 -0700 Subject: [PATCH 19/49] remote config --- packages/firebase_remote_config/CHANGELOG.md | 5 ++++ .../lib/src/remote_config.dart | 25 ++++--------------- packages/firebase_remote_config/pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/packages/firebase_remote_config/CHANGELOG.md b/packages/firebase_remote_config/CHANGELOG.md index d7b7966f8d31..8e4dd3cb9dac 100644 --- a/packages/firebase_remote_config/CHANGELOG.md +++ b/packages/firebase_remote_config/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.1.0+3 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.1.0+2 * Log messages about automatic configuration of the default app are now less confusing. diff --git a/packages/firebase_remote_config/lib/src/remote_config.dart b/packages/firebase_remote_config/lib/src/remote_config.dart index be3912c61dbe..6d602a755815 100644 --- a/packages/firebase_remote_config/lib/src/remote_config.dart +++ b/packages/firebase_remote_config/lib/src/remote_config.dart @@ -36,10 +36,7 @@ class RemoteConfig extends ChangeNotifier { static void _getRemoteConfigInstance() async { final Map properties = - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod('RemoteConfig#instance'); + await channel.invokeMethod >('RemoteConfig#instance'); final RemoteConfig instance = RemoteConfig(); @@ -102,10 +99,7 @@ class RemoteConfig extends ChangeNotifier { Future setConfigSettings( RemoteConfigSettings remoteConfigSettings) async { await channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('RemoteConfig#setConfigSettings', { + .invokeMethod('RemoteConfig#setConfigSettings', { 'debugMode': remoteConfigSettings.debugMode, }); _remoteConfigSettings = remoteConfigSettings; @@ -119,10 +113,7 @@ class RemoteConfig extends ChangeNotifier { /// Expiration must be defined in seconds. Future fetch({Duration expiration = const Duration(hours: 12)}) async { try { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map properties = await channel.invokeMethod( + final Map properties = await channel.invokeMethod>( 'RemoteConfig#fetch', {'expiration': expiration.inSeconds}); _lastFetchTime = @@ -147,10 +138,7 @@ class RemoteConfig extends ChangeNotifier { /// from the currently activated config, it contains false otherwise. Future activateFetched() async { final Map properties = - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod('RemoteConfig#activate'); + await channel.invokeMethod>('RemoteConfig#activate'); final Map rawParameters = properties['parameters']; final bool newConfig = properties['newConfig']; final Map fetchedParameters = @@ -176,10 +164,7 @@ class RemoteConfig extends ChangeNotifier { _parameters[key] = remoteConfigValue; } }); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod( + await channel.invokeMethod( 'RemoteConfig#setDefaults', {'defaults': defaults}); } diff --git a/packages/firebase_remote_config/pubspec.yaml b/packages/firebase_remote_config/pubspec.yaml index e9dd6074d861..3c81667e928f 100644 --- a/packages/firebase_remote_config/pubspec.yaml +++ b/packages/firebase_remote_config/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Remote Config. Update your application re-releasing. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_remote_config -version: 0.1.0+2 +version: 0.1.0+3 dependencies: flutter: From 0ed5fc0bd5d219f026bef1fefb70d985146ca163 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:36:12 -0700 Subject: [PATCH 20/49] firebase storage --- packages/firebase_storage/CHANGELOG.md | 5 +++ .../lib/src/firebase_storage.dart | 35 ++++------------ .../lib/src/storage_reference.dart | 40 ++++--------------- .../firebase_storage/lib/src/upload_task.dart | 25 +++--------- packages/firebase_storage/pubspec.yaml | 2 +- 5 files changed, 26 insertions(+), 81 deletions(-) diff --git a/packages/firebase_storage/CHANGELOG.md b/packages/firebase_storage/CHANGELOG.md index 822a74bcace5..3ebf44e28a16 100644 --- a/packages/firebase_storage/CHANGELOG.md +++ b/packages/firebase_storage/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.1.1 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 2.1.0+1 * Reverting error.code casting/formatting to what it was until version 2.0.1. diff --git a/packages/firebase_storage/lib/src/firebase_storage.dart b/packages/firebase_storage/lib/src/firebase_storage.dart index 8fc536bdfcc9..c927302320e9 100644 --- a/packages/firebase_storage/lib/src/firebase_storage.dart +++ b/packages/firebase_storage/lib/src/firebase_storage.dart @@ -58,10 +58,7 @@ class FirebaseStorage { StorageReference ref() => StorageReference._(const [], this); Future getMaxDownloadRetryTimeMillis() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await channel.invokeMethod( + return await channel.invokeMethod( "FirebaseStorage#getMaxDownloadRetryTime", { 'app': app?.name, 'bucket': storageBucket, @@ -69,10 +66,7 @@ class FirebaseStorage { } Future getMaxUploadRetryTimeMillis() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await channel.invokeMethod( + return await channel.invokeMethod( "FirebaseStorage#getMaxUploadRetryTime", { 'app': app?.name, 'bucket': storageBucket, @@ -80,10 +74,7 @@ class FirebaseStorage { } Future getMaxOperationRetryTimeMillis() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await channel.invokeMethod( + return await channel.invokeMethod( "FirebaseStorage#getMaxOperationRetryTime", { 'app': app?.name, 'bucket': storageBucket, @@ -91,10 +82,7 @@ class FirebaseStorage { } Future setMaxDownloadRetryTimeMillis(int time) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return channel.invokeMethod( + return channel.invokeMethod( "FirebaseStorage#setMaxDownloadRetryTime", { 'app': app?.name, 'bucket': storageBucket, @@ -103,10 +91,7 @@ class FirebaseStorage { } Future setMaxUploadRetryTimeMillis(int time) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return channel.invokeMethod( + return channel.invokeMethod( "FirebaseStorage#setMaxUploadRetryTime", { 'app': app?.name, 'bucket': storageBucket, @@ -115,10 +100,7 @@ class FirebaseStorage { } Future setMaxOperationRetryTimeMillis(int time) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return channel.invokeMethod( + return channel.invokeMethod( "FirebaseStorage#setMaxOperationRetryTime", { 'app': app?.name, 'bucket': storageBucket, @@ -152,10 +134,7 @@ class StorageFileDownloadTask { final File _file; Future _start() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final int totalByteCount = await FirebaseStorage.channel.invokeMethod( + final int totalByteCount = await FirebaseStorage.channel.invokeMethod( "StorageReference#writeToFile", { 'app': _firebaseStorage.app?.name, diff --git a/packages/firebase_storage/lib/src/storage_reference.dart b/packages/firebase_storage/lib/src/storage_reference.dart index 0325c9e33a85..4e2618ee4dbe 100644 --- a/packages/firebase_storage/lib/src/storage_reference.dart +++ b/packages/firebase_storage/lib/src/storage_reference.dart @@ -77,10 +77,7 @@ class StorageReference { /// Returns the Google Cloud Storage bucket that holds this object. Future getBucket() async { return await FirebaseStorage.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod("StorageReference#getBucket", { + .invokeMethod("StorageReference#getBucket", { 'app': _firebaseStorage.app?.name, 'bucket': _firebaseStorage.storageBucket, 'path': _pathComponents.join("/"), @@ -91,10 +88,7 @@ class StorageReference { /// Storage bucket. Future getPath() async { return await FirebaseStorage.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod("StorageReference#getPath", { + .invokeMethod("StorageReference#getPath", { 'app': _firebaseStorage.app?.name, 'bucket': _firebaseStorage.storageBucket, 'path': _pathComponents.join("/"), @@ -104,10 +98,7 @@ class StorageReference { /// Returns the short name of this object. Future getName() async { return await FirebaseStorage.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod("StorageReference#getName", { + .invokeMethod("StorageReference#getName", { 'app': _firebaseStorage.app?.name, 'bucket': _firebaseStorage.storageBucket, 'path': _pathComponents.join("/"), @@ -117,10 +108,7 @@ class StorageReference { /// Asynchronously downloads the object at the StorageReference to a list in memory. /// A list of the provided max size will be allocated. Future getData(int maxSize) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await FirebaseStorage.channel.invokeMethod( + return await FirebaseStorage.channel.invokeMethod( "StorageReference#getData", { 'app': _firebaseStorage.app?.name, @@ -145,10 +133,7 @@ class StorageReference { /// developer in the Firebase Console if desired. Future getDownloadURL() async { return await FirebaseStorage.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod("StorageReference#getDownloadUrl", { + .invokeMethod("StorageReference#getDownloadUrl", { 'app': _firebaseStorage.app?.name, 'bucket': _firebaseStorage.storageBucket, 'path': _pathComponents.join("/"), @@ -157,10 +142,7 @@ class StorageReference { Future delete() { return FirebaseStorage.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod("StorageReference#delete", { + .invokeMethod("StorageReference#delete", { 'app': _firebaseStorage.app?.name, 'bucket': _firebaseStorage.storageBucket, 'path': _pathComponents.join("/") @@ -170,10 +152,7 @@ class StorageReference { /// Retrieves metadata associated with an object at this [StorageReference]. Future getMetadata() async { return StorageMetadata._fromMap(await FirebaseStorage.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod("StorageReference#getMetadata", { + .invokeMethod>("StorageReference#getMetadata", { 'app': _firebaseStorage.app?.name, 'bucket': _firebaseStorage.storageBucket, 'path': _pathComponents.join("/"), @@ -189,10 +168,7 @@ class StorageReference { /// by passing the empty string. Future updateMetadata(StorageMetadata metadata) async { return StorageMetadata._fromMap(await FirebaseStorage.channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod("StorageReference#updateMetadata", { + .invokeMethod>("StorageReference#updateMetadata", { 'app': _firebaseStorage.app?.name, 'bucket': _firebaseStorage.storageBucket, 'path': _pathComponents.join("/"), diff --git a/packages/firebase_storage/lib/src/upload_task.dart b/packages/firebase_storage/lib/src/upload_task.dart index be432589873d..9c263779e7e1 100644 --- a/packages/firebase_storage/lib/src/upload_task.dart +++ b/packages/firebase_storage/lib/src/upload_task.dart @@ -89,10 +89,7 @@ abstract class StorageUploadTask { } /// Pause the upload - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - void pause() => FirebaseStorage.channel.invokeMethod( + void pause() => FirebaseStorage.channel.invokeMethod( 'UploadTask#pause', { 'app': _firebaseStorage.app?.name, @@ -102,10 +99,7 @@ abstract class StorageUploadTask { ); /// Resume the upload - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - void resume() => FirebaseStorage.channel.invokeMethod( + void resume() => FirebaseStorage.channel.invokeMethod( 'UploadTask#resume', { 'app': _firebaseStorage.app?.name, @@ -115,10 +109,7 @@ abstract class StorageUploadTask { ); /// Cancel the upload - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - void cancel() => FirebaseStorage.channel.invokeMethod( + void cancel() => FirebaseStorage.channel.invokeMethod( 'UploadTask#cancel', { 'app': _firebaseStorage.app?.name, @@ -137,10 +128,7 @@ class _StorageFileUploadTask extends StorageUploadTask { @override Future _platformStart() { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return FirebaseStorage.channel.invokeMethod( + return FirebaseStorage.channel.invokeMethod( 'StorageReference#putFile', { 'app': _firebaseStorage.app?.name, @@ -163,10 +151,7 @@ class _StorageDataUploadTask extends StorageUploadTask { @override Future _platformStart() { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return FirebaseStorage.channel.invokeMethod( + return FirebaseStorage.channel.invokeMethod( 'StorageReference#putData', { 'app': _firebaseStorage.app?.name, diff --git a/packages/firebase_storage/pubspec.yaml b/packages/firebase_storage/pubspec.yaml index 6bca9061bd71..4250da93c72b 100755 --- a/packages/firebase_storage/pubspec.yaml +++ b/packages/firebase_storage/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Cloud Storage, a powerful, simple, and cost-effective object storage service for Android and iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_storage -version: 2.1.0+1 +version: 2.1.1 flutter: plugin: From 33ca3a4b0e8dce4bc734edbd4051900d02903c7b Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:38:08 -0700 Subject: [PATCH 21/49] google_maps_flutter --- packages/google_maps_flutter/CHANGELOG.md | 5 ++++ .../lib/src/controller.dart | 25 ++++--------------- packages/google_maps_flutter/pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/packages/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/CHANGELOG.md index f02bb0961266..64160f34fdcb 100644 --- a/packages/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.0+4 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.4.0 * Change events are call backs on GoogleMap widget. diff --git a/packages/google_maps_flutter/lib/src/controller.dart b/packages/google_maps_flutter/lib/src/controller.dart index 3d5640083698..00eac85c68c7 100644 --- a/packages/google_maps_flutter/lib/src/controller.dart +++ b/packages/google_maps_flutter/lib/src/controller.dart @@ -23,10 +23,7 @@ class GoogleMapController { assert(id != null); final MethodChannel channel = MethodChannel('plugins.flutter.io/google_maps_$id'); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await channel.invokeMethod('map#waitForMap'); + await channel.invokeMethod('map#waitForMap'); return GoogleMapController._( channel, initialCameraPosition, @@ -76,10 +73,7 @@ class GoogleMapController { /// The returned [Future] completes after listeners have been notified. Future _updateMapOptions(Map optionsUpdate) async { assert(optionsUpdate != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod( 'map#update', { 'options': optionsUpdate, @@ -95,10 +89,7 @@ class GoogleMapController { /// The returned [Future] completes after listeners have been notified. Future _updateMarkers(_MarkerUpdates markerUpdates) async { assert(markerUpdates != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod( 'markers#update', markerUpdates._toMap(), ); @@ -109,10 +100,7 @@ class GoogleMapController { /// The returned [Future] completes after the change has been started on the /// platform side. Future animateCamera(CameraUpdate cameraUpdate) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('camera#animate', { + await _channel.invokeMethod('camera#animate', { 'cameraUpdate': cameraUpdate._toJson(), }); } @@ -122,10 +110,7 @@ class GoogleMapController { /// The returned [Future] completes after the change has been made on the /// platform side. Future moveCamera(CameraUpdate cameraUpdate) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('camera#move', { + await _channel.invokeMethod('camera#move', { 'cameraUpdate': cameraUpdate._toJson(), }); } diff --git a/packages/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/pubspec.yaml index 81169e44ff68..1b2aab22102d 100644 --- a/packages/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter -version: 0.4.0 +version: 0.4.0+1 dependencies: flutter: From 2947d44290c4609a8e6472296d7676c29edd50c7 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:40:19 -0700 Subject: [PATCH 22/49] google sign_in --- packages/google_sign_in/CHANGELOG.md | 5 ++++ .../google_sign_in/lib/google_sign_in.dart | 25 ++++--------------- packages/google_sign_in/pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/packages/google_sign_in/CHANGELOG.md b/packages/google_sign_in/CHANGELOG.md index 1f4e4940d9da..c1bb28fff7c7 100644 --- a/packages/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.2 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 4.0.1+1 * Remove categories. diff --git a/packages/google_sign_in/lib/google_sign_in.dart b/packages/google_sign_in/lib/google_sign_in.dart index 234eb5102da2..bc69d6d9c42e 100755 --- a/packages/google_sign_in/lib/google_sign_in.dart +++ b/packages/google_sign_in/lib/google_sign_in.dart @@ -79,10 +79,7 @@ class GoogleSignInAccount implements GoogleIdentity { } final Map response = - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await GoogleSignIn.channel.invokeMethod( + await GoogleSignIn.channel.invokeMethod>( 'getTokens', { 'email': email, @@ -111,10 +108,7 @@ class GoogleSignInAccount implements GoogleIdentity { /// this method and grab `authHeaders` once again. Future clearAuthCache() async { final String token = (await authentication).accessToken; - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await GoogleSignIn.channel.invokeMethod( + await GoogleSignIn.channel.invokeMethod( 'clearAuthCache', {'token': token}, ); @@ -220,10 +214,7 @@ class GoogleSignIn { Future _callMethod(String method) async { await _ensureInitialized(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map response = await channel.invokeMethod(method); + final Map response = await channel.invokeMethod>(method); return _setCurrentUser(response != null && response.isNotEmpty ? GoogleSignInAccount._(this, response) : null); @@ -239,10 +230,7 @@ class GoogleSignIn { Future _ensureInitialized() { if (_initialization == null) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _initialization = channel.invokeMethod('init', { + _initialization = channel.invokeMethod('init', { 'signInOption': (signInOption ?? SignInOption.standard).toString(), 'scopes': scopes ?? [], 'hostedDomain': hostedDomain, @@ -318,10 +306,7 @@ class GoogleSignIn { /// Returns a future that resolves to whether a user is currently signed in. Future isSignedIn() async { await _ensureInitialized(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final bool result = await channel.invokeMethod('isSignedIn'); + final bool result = await channel.invokeMethod('isSignedIn'); return result; } diff --git a/packages/google_sign_in/pubspec.yaml b/packages/google_sign_in/pubspec.yaml index 45c58738a875..75d4abedd997 100755 --- a/packages/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in -version: 4.0.1+1 +version: 4.0.2 flutter: plugin: From ecf894f1aca0893f3fad390952317339520ccbd8 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:41:29 -0700 Subject: [PATCH 23/49] image_picker --- packages/image_picker/CHANGELOG.md | 5 +++++ packages/image_picker/lib/image_picker.dart | 10 ++-------- packages/image_picker/pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/image_picker/CHANGELOG.md b/packages/image_picker/CHANGELOG.md index eee08ac35aca..e0c754f78147 100644 --- a/packages/image_picker/CHANGELOG.md +++ b/packages/image_picker/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.0+10 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.5.0+9 * Remove unnecessary temp video file path. diff --git a/packages/image_picker/lib/image_picker.dart b/packages/image_picker/lib/image_picker.dart index ae1d366d428b..38b15928c398 100755 --- a/packages/image_picker/lib/image_picker.dart +++ b/packages/image_picker/lib/image_picker.dart @@ -44,10 +44,7 @@ class ImagePicker { throw ArgumentError.value(maxHeight, 'maxHeight cannot be negative'); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final String path = await _channel.invokeMethod( + final String path = await _channel.invokeMethod( 'pickImage', { 'source': source.index, @@ -64,10 +61,7 @@ class ImagePicker { }) async { assert(source != null); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final String path = await _channel.invokeMethod( + final String path = await _channel.invokeMethod( 'pickVideo', { 'source': source.index, diff --git a/packages/image_picker/pubspec.yaml b/packages/image_picker/pubspec.yaml index 9610abda2530..d1d3415dc22a 100755 --- a/packages/image_picker/pubspec.yaml +++ b/packages/image_picker/pubspec.yaml @@ -5,7 +5,7 @@ authors: - Flutter Team - Rhodes Davis Jr. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker -version: 0.5.0+9 +version: 0.5.0+10 flutter: plugin: From a586fe5875b0257fa09040794ec5d6837b0fb92f Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:44:40 -0700 Subject: [PATCH 24/49] in app purchase --- .../billing_client_wrappers/billing_client_wrapper.dart | 8 ++++---- .../src/store_kit_wrappers/sk_payment_queue_wrapper.dart | 8 ++++---- .../lib/src/store_kit_wrappers/sk_receipt_manager.dart | 2 +- .../lib/src/store_kit_wrappers/sk_request_maker.dart | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/in_app_purchase/lib/src/billing_client_wrappers/billing_client_wrapper.dart b/packages/in_app_purchase/lib/src/billing_client_wrappers/billing_client_wrapper.dart index da1915f8e6c6..a7716c23d4b5 100644 --- a/packages/in_app_purchase/lib/src/billing_client_wrappers/billing_client_wrapper.dart +++ b/packages/in_app_purchase/lib/src/billing_client_wrappers/billing_client_wrapper.dart @@ -67,7 +67,7 @@ class BillingClient { /// [`BillingClient#isReady()`](https://developer.android.com/reference/com/android/billingclient/api/BillingClient.html#isReady()) /// to get the ready status of the BillingClient instance. Future isReady() async => - await channel.invokeMethod('BillingClient#isReady()'); + await channel.invokeMethod('BillingClient#isReady()'); /// Calls /// [`BillingClient#startConnection(BillingClientStateListener)`](https://developer.android.com/reference/com/android/billingclient/api/BillingClient.html#startconnection) @@ -85,7 +85,7 @@ class BillingClient { List disconnectCallbacks = _callbacks[_kOnBillingServiceDisconnected] ??= []; disconnectCallbacks.add(onBillingServiceDisconnected); - return BillingResponseConverter().fromJson(await channel.invokeMethod( + return BillingResponseConverter().fromJson(await channel.invokeMethod( "BillingClient#startConnection(BillingClientStateListener)", {'handle': disconnectCallbacks.length - 1})); } @@ -98,7 +98,7 @@ class BillingClient { /// /// This triggers the destruction of the `BillingClient` instance in Java. Future endConnection() async { - return channel.invokeMethod("BillingClient#endConnection()", null); + return channel.invokeMethod("BillingClient#endConnection()", null); } /// Returns a list of [SkuDetailsWrapper]s that have [SkuDetailsWrapper.sku] @@ -152,7 +152,7 @@ class BillingClient { 'sku': skuDetails.sku, 'accountId': accountId, }; - return BillingResponseConverter().fromJson(await channel.invokeMethod( + return BillingResponseConverter().fromJson(await channel.invokeMethod( 'BillingClient#launchBillingFlow(Activity, BillingFlowParams)', arguments)); } diff --git a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart index d9a1e45f8987..d8c3134a9fb3 100644 --- a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart +++ b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart @@ -35,7 +35,7 @@ class SKPaymentQueueWrapper { /// Calls [`-[SKPaymentQueue canMakePayments:]`](https://developer.apple.com/documentation/storekit/skpaymentqueue/1506139-canmakepayments?language=objc). static Future canMakePayments() async => - await channel.invokeMethod('-[SKPaymentQueue canMakePayments:]'); + await channel.invokeMethod('-[SKPaymentQueue canMakePayments:]'); /// Sets a transaction observer to listen to all the transaction events of the payment queue. /// @@ -61,7 +61,7 @@ class SKPaymentQueueWrapper { assert(_observer != null, '[in_app_purchase]: Trying to add a payment without an observer. Observer must be set using `setTransactionObserver` before adding a payment `setTransactionObserver`. It is mandatory to set the observer at the moment when app launches.'); Map requestMap = payment.toMap(); - await channel.invokeMethod( + await channel.invokeMethod( '-[InAppPurchasePlugin addPayment:result:]', requestMap, ); @@ -75,7 +75,7 @@ class SKPaymentQueueWrapper { /// This method calls StoreKit's [`-[SKPaymentQueue finishTransaction:]`](https://developer.apple.com/documentation/storekit/skpaymentqueue/1506003-finishtransaction?language=objc). Future finishTransaction( SKPaymentTransactionWrapper transaction) async { - await channel.invokeMethod( + await channel.invokeMethod( '-[InAppPurchasePlugin finishTransaction:result:]', transaction.transactionIdentifier); } @@ -91,7 +91,7 @@ class SKPaymentQueueWrapper { /// This method either triggers [`-[SKPayment restoreCompletedTransactions]`](https://developer.apple.com/documentation/storekit/skpaymentqueue/1506123-restorecompletedtransactions?language=objc) or [`-[SKPayment restoreCompletedTransactionsWithApplicationUsername:]`](https://developer.apple.com/documentation/storekit/skpaymentqueue/1505992-restorecompletedtransactionswith?language=objc) /// depends on weather the `applicationUserName` is passed. Future restoreTransactions({String applicationUserName}) async { - await channel.invokeMethod( + await channel.invokeMethod( '-[InAppPurchasePlugin restoreTransactions:result:]', applicationUserName); } diff --git a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_receipt_manager.dart b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_receipt_manager.dart index 7608275d8a7f..97471f389a1c 100644 --- a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_receipt_manager.dart +++ b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_receipt_manager.dart @@ -16,6 +16,6 @@ class SKReceiptManager { /// If the receipt is invalid or missing, you can use [SKRequestMaker.startRefreshReceiptRequest] to request a new receipt. static Future retrieveReceiptData() { return channel - .invokeMethod('-[InAppPurchasePlugin retrieveReceiptData:result:]'); + .invokeMethod('-[InAppPurchasePlugin retrieveReceiptData:result:]'); } } diff --git a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_request_maker.dart b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_request_maker.dart index 43fee6411a01..f5eb88c8872c 100644 --- a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_request_maker.dart +++ b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_request_maker.dart @@ -24,7 +24,7 @@ class SKRequestMaker { /// A [PlatformException] is thrown if the platform code making the request fails. Future startProductRequest( List productIdentifiers) async { - final Map productResponseMap = await channel.invokeMethod( + final Map productResponseMap = await channel.invokeMethod( '-[InAppPurchasePlugin startProductRequest:result:]', productIdentifiers, ); @@ -47,7 +47,7 @@ class SKRequestMaker { /// * isRevoked: whether the receipt has been revoked. /// * isVolumePurchase: whether the receipt is a Volume Purchase Plan receipt. Future startRefreshReceiptRequest({Map receiptProperties}) { - return channel.invokeMethod( + return channel.invokeMethod( '-[InAppPurchasePlugin refreshReceipt:result:]', receiptProperties, ); From cf8ac324f5a3997bb01120ac5076bbef34580971 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:47:39 -0700 Subject: [PATCH 25/49] local auth --- packages/local_auth/CHANGELOG.md | 5 +++++ packages/local_auth/lib/local_auth.dart | 15 +++------------ packages/local_auth/pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/local_auth/CHANGELOG.md b/packages/local_auth/CHANGELOG.md index f1e64da1c16e..c13f9330d88b 100644 --- a/packages/local_auth/CHANGELOG.md +++ b/packages/local_auth/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.0+2 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.4.0+1 * Log a more detailed warning at build time about the previous AndroidX diff --git a/packages/local_auth/lib/local_auth.dart b/packages/local_auth/lib/local_auth.dart index 9cd011736fff..ce64df79e4a5 100644 --- a/packages/local_auth/lib/local_auth.dart +++ b/packages/local_auth/lib/local_auth.dart @@ -72,20 +72,14 @@ class LocalAuthentication { 'operating systems.', details: 'Your operating system is ${Platform.operatingSystem}'); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await _channel.invokeMethod('authenticateWithBiometrics', args); + return await _channel.invokeMethod('authenticateWithBiometrics', args); } /// Returns true if device is capable of checking biometrics /// /// Returns a [Future] bool true or false: Future get canCheckBiometrics async => - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - (await _channel.invokeMethod('getAvailableBiometrics')).isNotEmpty; + (await _channel.invokeMethod>('getAvailableBiometrics')).isNotEmpty; /// Returns a list of enrolled biometrics /// @@ -95,10 +89,7 @@ class LocalAuthentication { /// - BiometricType.iris (not yet implemented) Future> getAvailableBiometrics() async { final List result = - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - (await _channel.invokeMethod('getAvailableBiometrics')).cast(); + (await _channel.invokeMethod>('getAvailableBiometrics')).cast(); final List biometrics = []; result.forEach((String value) { switch (value) { diff --git a/packages/local_auth/pubspec.yaml b/packages/local_auth/pubspec.yaml index 93afb6299fc4..2c4ac2e6998e 100644 --- a/packages/local_auth/pubspec.yaml +++ b/packages/local_auth/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Android and iOS device authentication sensors such as Fingerprint Reader and Touch ID. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/local_auth -version: 0.4.0+1 +version: 0.4.0+2 flutter: plugin: From ebcbdeed9421138cf1c0825914a476958484b862 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:49:04 -0700 Subject: [PATCH 26/49] location background --- packages/location_background/CHANGELOG.md | 5 +++++ .../lib/location_background_plugin.dart | 15 +++------------ packages/location_background/pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/location_background/CHANGELOG.md b/packages/location_background/CHANGELOG.md index e9815106d525..f9ae45c13362 100644 --- a/packages/location_background/CHANGELOG.md +++ b/packages/location_background/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.1.0+2 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.1.0+1 * Log a more detailed warning at build time about the previous AndroidX diff --git a/packages/location_background/lib/location_background_plugin.dart b/packages/location_background/lib/location_background_plugin.dart index 479862e7209d..57fd867af016 100644 --- a/packages/location_background/lib/location_background_plugin.dart +++ b/packages/location_background/lib/location_background_plugin.dart @@ -118,10 +118,7 @@ class LocationBackgroundPlugin { PluginUtilities.getCallbackHandle(_backgroundCallbackDispatcher); assert(handle != null, 'Unable to lookup callback.'); _channel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod(_kStartHeadlessService, [handle.toRawHandle()]); + .invokeMethod(_kStartHeadlessService, [handle.toRawHandle()]); } // The method channel we'll use to communicate with the native portion of our @@ -147,10 +144,7 @@ class LocationBackgroundPlugin { throw ArgumentError.notNull('callback'); } final CallbackHandle handle = PluginUtilities.getCallbackHandle(callback); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _channel.invokeMethod(_kMonitorLocationChanges, [ + return _channel.invokeMethod(_kMonitorLocationChanges, [ handle.toRawHandle(), pauseLocationUpdatesAutomatically, showsBackgroundLocationIndicator, @@ -160,8 +154,5 @@ class LocationBackgroundPlugin { /// Stop all location updates. Future cancelLocationUpdates() => - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _channel.invokeMethod(_kCancelLocationUpdates); + _channel.invokeMethod(_kCancelLocationUpdates); } diff --git a/packages/location_background/pubspec.yaml b/packages/location_background/pubspec.yaml index ed3b828a81c0..3fd25a0c2abc 100644 --- a/packages/location_background/pubspec.yaml +++ b/packages/location_background/pubspec.yaml @@ -2,7 +2,7 @@ name: location_background_plugin description: A new flutter plugin project. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/location_background -version: 0.1.0+1 +version: 0.1.0+2 publish_to: none dependencies: From 4e060f6df59895d960562a7eb0a1f22b36412d67 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:49:50 -0700 Subject: [PATCH 27/49] ml vision version update --- packages/firebase_ml_vision/CHANGELOG.md | 5 +++++ packages/firebase_ml_vision/pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/firebase_ml_vision/CHANGELOG.md b/packages/firebase_ml_vision/CHANGELOG.md index 5fd15a48e2bb..4520b88c76a0 100644 --- a/packages/firebase_ml_vision/CHANGELOG.md +++ b/packages/firebase_ml_vision/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.6.0+3 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.6.0+2 * Update README.md diff --git a/packages/firebase_ml_vision/pubspec.yaml b/packages/firebase_ml_vision/pubspec.yaml index 30f399fc3520..f582f1e296bd 100644 --- a/packages/firebase_ml_vision/pubspec.yaml +++ b/packages/firebase_ml_vision/pubspec.yaml @@ -2,7 +2,7 @@ name: firebase_ml_vision description: Flutter plugin for Firebase machine learning vision services. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_ml_vision -version: 0.6.0+2 +version: 0.6.0+3 dependencies: flutter: From 7310313b563603d91bda2b6d93b596a649f32f99 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:50:59 -0700 Subject: [PATCH 28/49] package info --- packages/package_info/CHANGELOG.md | 5 +++++ packages/package_info/lib/package_info.dart | 5 +---- packages/package_info/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/package_info/CHANGELOG.md b/packages/package_info/CHANGELOG.md index 404108cf7cb7..8266bdf0544a 100644 --- a/packages/package_info/CHANGELOG.md +++ b/packages/package_info/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.0+3 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.4.0+2 * Android: Using new method for BuildNumber in new android versions diff --git a/packages/package_info/lib/package_info.dart b/packages/package_info/lib/package_info.dart index 093601242cd1..658e8b2d9894 100644 --- a/packages/package_info/lib/package_info.dart +++ b/packages/package_info/lib/package_info.dart @@ -32,10 +32,7 @@ class PackageInfo { if (_fromPlatform == null) { final Completer completer = Completer(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _kChannel.invokeMethod('getAll').then((dynamic result) { + _kChannel.invokeMethod('getAll').then((dynamic result) { final Map map = result; completer.complete(PackageInfo( diff --git a/packages/package_info/pubspec.yaml b/packages/package_info/pubspec.yaml index 61d94f00f4b8..4475b93d473c 100644 --- a/packages/package_info/pubspec.yaml +++ b/packages/package_info/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for querying information about the application package, such as CFBundleVersion on iOS or versionCode on Android. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/package_info -version: 0.4.0+2 +version: 0.4.0+3 flutter: plugin: From ca36d28bd41498b675316b1465ac265ab32b8935 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:52:22 -0700 Subject: [PATCH 29/49] path provider --- packages/path_provider/CHANGELOG.md | 5 +++++ packages/path_provider/lib/path_provider.dart | 15 +++------------ packages/path_provider/pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/path_provider/CHANGELOG.md b/packages/path_provider/CHANGELOG.md index b2578a43ba60..04d1c4b3bd38 100644 --- a/packages/path_provider/CHANGELOG.md +++ b/packages/path_provider/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.0+2 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.5.0+1 * Log a more detailed warning at build time about the previous AndroidX diff --git a/packages/path_provider/lib/path_provider.dart b/packages/path_provider/lib/path_provider.dart index 1875f7436d8b..6271942f4957 100644 --- a/packages/path_provider/lib/path_provider.dart +++ b/packages/path_provider/lib/path_provider.dart @@ -21,10 +21,7 @@ const MethodChannel _channel = /// /// On Android, this uses the `getCacheDir` API on the context. Future getTemporaryDirectory() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final String path = await _channel.invokeMethod('getTemporaryDirectory'); + final String path = await _channel.invokeMethod('getTemporaryDirectory'); if (path == null) { return null; } @@ -40,10 +37,7 @@ Future getTemporaryDirectory() async { /// On Android, this returns the AppData directory. Future getApplicationDocumentsDirectory() async { final String path = - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('getApplicationDocumentsDirectory'); + await _channel.invokeMethod('getApplicationDocumentsDirectory'); if (path == null) { return null; } @@ -61,10 +55,7 @@ Future getApplicationDocumentsDirectory() async { Future getExternalStorageDirectory() async { if (Platform.isIOS) throw UnsupportedError("Functionality not available on iOS"); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final String path = await _channel.invokeMethod('getStorageDirectory'); + final String path = await _channel.invokeMethod('getStorageDirectory'); if (path == null) { return null; } diff --git a/packages/path_provider/pubspec.yaml b/packages/path_provider/pubspec.yaml index 2d3304dcaa35..de2593f4b7c0 100644 --- a/packages/path_provider/pubspec.yaml +++ b/packages/path_provider/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for getting commonly used locations on the Android & iOS file systems, such as the temp and app data directories. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider -version: 0.5.0+1 +version: 0.5.0+2 flutter: plugin: From b52957b72184289352f0c76c45f096c4c3d069b5 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:53:34 -0700 Subject: [PATCH 30/49] quick actions --- packages/quick_actions/CHANGELOG.md | 5 +++++ packages/quick_actions/lib/quick_actions.dart | 10 ++-------- packages/quick_actions/pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/quick_actions/CHANGELOG.md b/packages/quick_actions/CHANGELOG.md index bd87c4f3175c..93f3db8d32c2 100644 --- a/packages/quick_actions/CHANGELOG.md +++ b/packages/quick_actions/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.0+2 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.3.0+1 * Log a more detailed warning at build time about the previous AndroidX diff --git a/packages/quick_actions/lib/quick_actions.dart b/packages/quick_actions/lib/quick_actions.dart index f359fb78e6c4..c4292b5f6fdd 100644 --- a/packages/quick_actions/lib/quick_actions.dart +++ b/packages/quick_actions/lib/quick_actions.dart @@ -52,18 +52,12 @@ class QuickActions { Future setShortcutItems(List items) async { final List> itemsList = items.map(_serializeItem).toList(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _kChannel.invokeMethod('setShortcutItems', itemsList); + await _kChannel.invokeMethod('setShortcutItems', itemsList); } /// Removes all [ShortcutItem]s registered for the app. Future clearShortcutItems() => - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _kChannel.invokeMethod('clearShortcutItems'); + _kChannel.invokeMethod('clearShortcutItems'); Map _serializeItem(ShortcutItem item) { return { diff --git a/packages/quick_actions/pubspec.yaml b/packages/quick_actions/pubspec.yaml index 17d31b8bca9a..05353fb758df 100644 --- a/packages/quick_actions/pubspec.yaml +++ b/packages/quick_actions/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for creating shortcuts on home screen, also known as Quick Actions on iOS and App Shortcuts on Android. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/quick_actions -version: 0.3.0+1 +version: 0.3.0+2 flutter: plugin: From 3132df5125199af8bdbd49de93ea69c90488a659 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:56:38 -0700 Subject: [PATCH 31/49] share --- packages/share/CHANGELOG.md | 5 +++++ packages/share/lib/share.dart | 5 +---- packages/share/pubspec.yaml | 2 +- packages/share/test/share_test.dart | 10 ++-------- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/share/CHANGELOG.md b/packages/share/CHANGELOG.md index 802a5e34a113..2b8b413ae9ff 100644 --- a/packages/share/CHANGELOG.md +++ b/packages/share/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.6.0+2 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.6.0+1 * Log a more detailed warning at build time about the previous AndroidX diff --git a/packages/share/lib/share.dart b/packages/share/lib/share.dart index a86a8261b5f5..50cd52c3ebc6 100644 --- a/packages/share/lib/share.dart +++ b/packages/share/lib/share.dart @@ -41,9 +41,6 @@ class Share { params['originHeight'] = sharePositionOrigin.height; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return channel.invokeMethod('share', params); + return channel.invokeMethod('share', params); } } diff --git a/packages/share/pubspec.yaml b/packages/share/pubspec.yaml index e3b161b0ff87..f7bd39ac5689 100644 --- a/packages/share/pubspec.yaml +++ b/packages/share/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for sharing content via the platform share UI, using the ACTION_SEND intent on Android and UIActivityViewController on iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/share -version: 0.6.0+1 +version: 0.6.0+2 flutter: plugin: diff --git a/packages/share/test/share_test.dart b/packages/share/test/share_test.dart index 5ea12626d353..6c382634954f 100644 --- a/packages/share/test/share_test.dart +++ b/packages/share/test/share_test.dart @@ -17,10 +17,7 @@ void main() { mockChannel = MockMethodChannel(); // Re-pipe to mockito for easier verifies. Share.channel.setMockMethodCallHandler((MethodCall call) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - mockChannel.invokeMethod(call.method, call.arguments); + mockChannel.invokeMethod(call.method, call.arguments); }); }); @@ -45,10 +42,7 @@ void main() { 'some text to share', sharePositionOrigin: Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), ); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - verify(mockChannel.invokeMethod('share', { + verify(mockChannel.invokeMethod('share', { 'text': 'some text to share', 'originX': 1.0, 'originY': 2.0, From 77b2aee832cade6d53e448c1f9e095fe9e3188de Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 11:59:12 -0700 Subject: [PATCH 32/49] shared_preference --- packages/shared_preferences/CHANGELOG.md | 5 ++++ .../lib/shared_preferences.dart | 25 ++++--------------- packages/shared_preferences/pubspec.yaml | 2 +- .../test/shared_preferences_test.dart | 10 ++------ 4 files changed, 13 insertions(+), 29 deletions(-) diff --git a/packages/shared_preferences/CHANGELOG.md b/packages/shared_preferences/CHANGELOG.md index 0fd825507df7..82349ea9a112 100644 --- a/packages/shared_preferences/CHANGELOG.md +++ b/packages/shared_preferences/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.1+3 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.5.1+2 * Add a driver test diff --git a/packages/shared_preferences/lib/shared_preferences.dart b/packages/shared_preferences/lib/shared_preferences.dart index cb24d12fde0d..e606b9cc1eac 100644 --- a/packages/shared_preferences/lib/shared_preferences.dart +++ b/packages/shared_preferences/lib/shared_preferences.dart @@ -22,10 +22,7 @@ class SharedPreferences { static Future getInstance() async { if (_instance == null) { final Map fromSystem = - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _kChannel.invokeMethod('getAll'); + await _kChannel.invokeMethod >('getAll'); assert(fromSystem != null); // Strip the flutter. prefix from the returned preferences. final Map preferencesMap = {}; @@ -121,19 +118,13 @@ class SharedPreferences { if (value == null) { _preferenceCache.remove(key); return _kChannel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('remove', params) + .invokeMethod('remove', params) .then((dynamic result) => result); } else { _preferenceCache[key] = value; params['value'] = value; return _kChannel - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('set$valueType', params) + .invokeMethod('set$valueType', params) .then((dynamic result) => result); } } @@ -141,18 +132,12 @@ class SharedPreferences { /// Always returns true. /// On iOS, synchronize is marked deprecated. On Android, we commit every set. @deprecated - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - Future commit() async => await _kChannel.invokeMethod('commit'); + Future commit() async => await _kChannel.invokeMethod('commit'); /// Completes with true once the user preferences for the app has been cleared. Future clear() async { _preferenceCache.clear(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await _kChannel.invokeMethod('clear'); + return await _kChannel.invokeMethod('clear'); } /// Initializes the shared preferences with mock values for testing. diff --git a/packages/shared_preferences/pubspec.yaml b/packages/shared_preferences/pubspec.yaml index 1ae1c3b1742b..8f32cfbee1ff 100644 --- a/packages/shared_preferences/pubspec.yaml +++ b/packages/shared_preferences/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/shared_preferences -version: 0.5.1+2 +version: 0.5.1+3 flutter: plugin: diff --git a/packages/shared_preferences/test/shared_preferences_test.dart b/packages/shared_preferences/test/shared_preferences_test.dart index c296bde635c5..26c4a7d133b1 100755 --- a/packages/shared_preferences/test/shared_preferences_test.dart +++ b/packages/shared_preferences/test/shared_preferences_test.dart @@ -136,15 +136,9 @@ void main() { }); test('mocking', () async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - expect(await channel.invokeMethod('getAll'), kTestValues); + expect(await channel.invokeMethod>('getAll'), kTestValues); SharedPreferences.setMockInitialValues(kTestValues2); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - expect(await channel.invokeMethod('getAll'), kTestValues2); + expect(await channel.invokeMethod >('getAll'), kTestValues2); }); }); } From 514fdc5f17308dd762af8976f5a7fdae9b758d5a Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 12:00:28 -0700 Subject: [PATCH 33/49] url launcher --- packages/url_launcher/CHANGELOG.md | 7 ++++++- packages/url_launcher/lib/url_launcher.dart | 15 +++------------ packages/url_launcher/pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/url_launcher/CHANGELOG.md b/packages/url_launcher/CHANGELOG.md index 7f4e90c0fc9a..3657f1deeff9 100644 --- a/packages/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/CHANGELOG.md @@ -1,4 +1,9 @@ -## 5.0.2 +## 5.0.3 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + +# 5.0.2 * Fixes `closeWebView` failure on iOS. ## 5.0.1 diff --git a/packages/url_launcher/lib/url_launcher.dart b/packages/url_launcher/lib/url_launcher.dart index b51a4832920c..a942b5053e63 100644 --- a/packages/url_launcher/lib/url_launcher.dart +++ b/packages/url_launcher/lib/url_launcher.dart @@ -79,10 +79,7 @@ Future launch( ? SystemUiOverlayStyle.dark : SystemUiOverlayStyle.light); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final bool result = await _channel.invokeMethod( + final bool result = await _channel.invokeMethod( 'launch', { 'url': urlString, @@ -105,10 +102,7 @@ Future canLaunch(String urlString) async { if (urlString == null) { return false; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await _channel.invokeMethod( + return await _channel.invokeMethod( 'canLaunch', {'url': urlString}, ); @@ -126,8 +120,5 @@ Future canLaunch(String urlString) async { /// SafariViewController is only available on IOS version >= 9.0, this method does not do anything /// on IOS version below 9.0 Future closeWebView() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return await _channel.invokeMethod('closeWebView'); + return await _channel.invokeMethod('closeWebView'); } diff --git a/packages/url_launcher/pubspec.yaml b/packages/url_launcher/pubspec.yaml index 6845650be0a7..dcccd5c235a8 100644 --- a/packages/url_launcher/pubspec.yaml +++ b/packages/url_launcher/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for launching a URL on Android and iOS. Supports web, phone, SMS, and email schemes. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher -version: 5.0.2 +version: 5.0.3 flutter: plugin: From 8861d1c6058b2180ff3f1e868bf19e0ed81b1bad Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 12:04:17 -0700 Subject: [PATCH 34/49] video player --- packages/video_player/CHANGELOG.md | 5 +++ packages/video_player/lib/video_player.dart | 45 +++++---------------- packages/video_player/pubspec.yaml | 2 +- 3 files changed, 15 insertions(+), 37 deletions(-) diff --git a/packages/video_player/CHANGELOG.md b/packages/video_player/CHANGELOG.md index de5f66e5afd7..0fce24137d9c 100644 --- a/packages/video_player/CHANGELOG.md +++ b/packages/video_player/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.10.0+5 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.10.0+4 * Android: Upgrade ExoPlayer to 2.9.6. diff --git a/packages/video_player/lib/video_player.dart b/packages/video_player/lib/video_player.dart index 441057de32b6..dec75888e811 100644 --- a/packages/video_player/lib/video_player.dart +++ b/packages/video_player/lib/video_player.dart @@ -12,10 +12,7 @@ import 'package:meta/meta.dart'; final MethodChannel _channel = const MethodChannel('flutter.io/videoPlayer') // This will clear all open videos on the platform when a full restart is // performed. - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - ..invokeMethod('init'); + ..invokeMethod('init'); class DurationRange { DurationRange(this.start, this.end); @@ -208,10 +205,7 @@ class VideoPlayerController extends ValueNotifier { case DataSourceType.file: dataSourceDescription = {'uri': dataSource}; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map response = await _channel.invokeMethod( + final Map response = await _channel.invokeMethod>( 'create', dataSourceDescription, ); @@ -284,10 +278,7 @@ class VideoPlayerController extends ValueNotifier { _isDisposed = true; _timer?.cancel(); await _eventSubscription?.cancel(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod( 'dispose', {'textureId': _textureId}, ); @@ -317,10 +308,7 @@ class VideoPlayerController extends ValueNotifier { if (!value.initialized || _isDisposed) { return; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _channel.invokeMethod( + _channel.invokeMethod( 'setLooping', {'textureId': _textureId, 'looping': value.isLooping}, ); @@ -331,10 +319,7 @@ class VideoPlayerController extends ValueNotifier { return; } if (value.isPlaying) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod( 'play', {'textureId': _textureId}, ); @@ -353,10 +338,7 @@ class VideoPlayerController extends ValueNotifier { ); } else { _timer?.cancel(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod( 'pause', {'textureId': _textureId}, ); @@ -367,10 +349,7 @@ class VideoPlayerController extends ValueNotifier { if (!value.initialized || _isDisposed) { return; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod( 'setVolume', {'textureId': _textureId, 'volume': value.volume}, ); @@ -382,10 +361,7 @@ class VideoPlayerController extends ValueNotifier { return null; } return Duration( - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - milliseconds: await _channel.invokeMethod( + milliseconds: await _channel.invokeMethod( 'position', {'textureId': _textureId}, ), @@ -401,10 +377,7 @@ class VideoPlayerController extends ValueNotifier { } else if (moment < const Duration()) { moment = const Duration(); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('seekTo', { + await _channel.invokeMethod('seekTo', { 'textureId': _textureId, 'location': moment.inMilliseconds, }); diff --git a/packages/video_player/pubspec.yaml b/packages/video_player/pubspec.yaml index 5d006914ba7a..8cae1f2811ff 100644 --- a/packages/video_player/pubspec.yaml +++ b/packages/video_player/pubspec.yaml @@ -2,7 +2,7 @@ name: video_player description: Flutter plugin for displaying inline video with other Flutter widgets on Android and iOS. author: Flutter Team -version: 0.10.0+4 +version: 0.10.0+5 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player flutter: From a062bc5fb397f652614830d14cf27506d42ca225 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 12:06:47 -0700 Subject: [PATCH 35/49] webview flutter --- packages/webview_flutter/CHANGELOG.md | 5 ++ .../webview_flutter/lib/webview_flutter.dart | 65 ++++--------------- packages/webview_flutter/pubspec.yaml | 2 +- 3 files changed, 19 insertions(+), 53 deletions(-) diff --git a/packages/webview_flutter/CHANGELOG.md b/packages/webview_flutter/CHANGELOG.md index 92e2a10c7eab..9f0a67699477 100644 --- a/packages/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.5+1 + +* Bump the minimum flutter version to 1.2.0. +* Add Template type parameter to `invokeMethod` calls. + ## 0.3.5 * Added an onPageFinished callback. diff --git a/packages/webview_flutter/lib/webview_flutter.dart b/packages/webview_flutter/lib/webview_flutter.dart index 96a626b51f10..f7e162a88abd 100644 --- a/packages/webview_flutter/lib/webview_flutter.dart +++ b/packages/webview_flutter/lib/webview_flutter.dart @@ -436,10 +436,7 @@ class WebViewController { Future loadUrl(String url) async { assert(url != null); _validateUrlString(url); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _channel.invokeMethod('loadUrl', url); + return _channel.invokeMethod('loadUrl', url); } /// Accessor to the current URL that the WebView is displaying. @@ -450,10 +447,7 @@ class WebViewController { /// words, by the time this future completes, the WebView may be displaying a /// different URL). Future currentUrl() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final String url = await _channel.invokeMethod('currentUrl'); + final String url = await _channel.invokeMethod('currentUrl'); return url; } @@ -462,10 +456,7 @@ class WebViewController { /// Note that this operation is asynchronous, and it is possible that the "canGoBack" state has /// changed by the time the future completed. Future canGoBack() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final bool canGoBack = await _channel.invokeMethod("canGoBack"); + final bool canGoBack = await _channel.invokeMethod("canGoBack"); return canGoBack; } @@ -474,10 +465,7 @@ class WebViewController { /// Note that this operation is asynchronous, and it is possible that the "canGoForward" state has /// changed by the time the future completed. Future canGoForward() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final bool canGoForward = await _channel.invokeMethod("canGoForward"); + final bool canGoForward = await _channel.invokeMethod("canGoForward"); return canGoForward; } @@ -485,28 +473,19 @@ class WebViewController { /// /// If there is no back history item this is a no-op. Future goBack() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _channel.invokeMethod("goBack"); + return _channel.invokeMethod("goBack"); } /// Goes forward in the history of this WebView. /// /// If there is no forward history item this is a no-op. Future goForward() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _channel.invokeMethod("goForward"); + return _channel.invokeMethod("goForward"); } /// Reloads the current URL. Future reload() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _channel.invokeMethod("reload"); + return _channel.invokeMethod("reload"); } /// Clears all caches used by the [WebView]. @@ -520,10 +499,7 @@ class WebViewController { /// /// Note: Calling this method also triggers a reload. Future clearCache() async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod("clearCache"); + await _channel.invokeMethod("clearCache"); return reload(); } @@ -533,10 +509,7 @@ class WebViewController { return null; } _settings = setting; - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - return _channel.invokeMethod('updateSettings', updateMap); + return _channel.invokeMethod('updateSettings', updateMap); } Future _updateJavascriptChannels( @@ -548,17 +521,11 @@ class WebViewController { final Set channelsToRemove = currentChannels.difference(newChannelNames); if (channelsToRemove.isNotEmpty) { - // TODO(amirh): remove this when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _channel.invokeMethod( + _channel.invokeMethod( 'removeJavascriptChannels', channelsToRemove.toList()); } if (channelsToAdd.isNotEmpty) { - // TODO(amirh): remove this when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _channel.invokeMethod('addJavascriptChannels', channelsToAdd.toList()); + _channel.invokeMethod('addJavascriptChannels', channelsToAdd.toList()); } _updateJavascriptChannelsFromSet(newChannels); } @@ -597,11 +564,8 @@ class WebViewController { if (javascriptString == null) { throw ArgumentError('The argument javascriptString must not be null. '); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method final String result = - await _channel.invokeMethod('evaluateJavascript', javascriptString); + await _channel.invokeMethod('evaluateJavascript', javascriptString); return result; } } @@ -625,10 +589,7 @@ class CookieManager { /// /// Returns true if cookies were present before clearing, else false. Future clearCookies() => _channel - // TODO(amirh): remove this when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - .invokeMethod('clearCookies') + .invokeMethod('clearCookies') .then((dynamic result) => result); } diff --git a/packages/webview_flutter/pubspec.yaml b/packages/webview_flutter/pubspec.yaml index ccaecd36cd3c..e21da558eb95 100644 --- a/packages/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: webview_flutter description: A Flutter plugin that provides a WebView widget on Android and iOS. -version: 0.3.5 +version: 0.3.5+1 author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter From 4d4ab2b6f76911f551bf535c99b9132adf09e7f4 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 12:15:12 -0700 Subject: [PATCH 36/49] bump flutter version for all plugins --- packages/android_alarm_manager/pubspec.yaml | 2 +- packages/android_intent/pubspec.yaml | 2 +- packages/battery/pubspec.yaml | 2 +- packages/camera/pubspec.yaml | 2 +- packages/cloud_firestore/pubspec.yaml | 2 +- packages/cloud_functions/pubspec.yaml | 2 +- packages/connectivity/pubspec.yaml | 2 +- packages/device_info/pubspec.yaml | 2 +- packages/firebase_admob/pubspec.yaml | 2 +- packages/firebase_analytics/pubspec.yaml | 2 +- packages/firebase_auth/pubspec.yaml | 2 +- packages/firebase_core/pubspec.yaml | 2 +- packages/firebase_database/pubspec.yaml | 2 +- packages/firebase_dynamic_links/pubspec.yaml | 2 +- packages/firebase_messaging/pubspec.yaml | 2 +- packages/firebase_ml_vision/pubspec.yaml | 2 +- packages/firebase_performance/pubspec.yaml | 2 +- packages/firebase_remote_config/pubspec.yaml | 2 +- packages/firebase_storage/pubspec.yaml | 2 +- packages/google_maps_flutter/pubspec.yaml | 2 +- packages/google_sign_in/pubspec.yaml | 2 +- packages/image_picker/pubspec.yaml | 2 +- packages/in_app_purchase/example/pubspec.yaml | 2 +- packages/in_app_purchase/pubspec.yaml | 2 +- packages/local_auth/pubspec.yaml | 2 +- packages/location_background/pubspec.yaml | 2 +- packages/package_info/pubspec.yaml | 2 +- packages/path_provider/pubspec.yaml | 2 +- packages/quick_actions/pubspec.yaml | 2 +- packages/sensors/pubspec.yaml | 2 +- packages/share/pubspec.yaml | 2 +- packages/shared_preferences/pubspec.yaml | 2 +- packages/url_launcher/pubspec.yaml | 2 +- packages/video_player/pubspec.yaml | 2 +- packages/webview_flutter/pubspec.yaml | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/packages/android_alarm_manager/pubspec.yaml b/packages/android_alarm_manager/pubspec.yaml index f5ae1cb6abd0..d09018f96427 100644 --- a/packages/android_alarm_manager/pubspec.yaml +++ b/packages/android_alarm_manager/pubspec.yaml @@ -20,4 +20,4 @@ flutter: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/android_intent/pubspec.yaml b/packages/android_intent/pubspec.yaml index 86ea84edfdc7..561a804d4e46 100644 --- a/packages/android_intent/pubspec.yaml +++ b/packages/android_intent/pubspec.yaml @@ -18,4 +18,4 @@ dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/battery/pubspec.yaml b/packages/battery/pubspec.yaml index af6b29e5c4bf..6d9af34e8b57 100644 --- a/packages/battery/pubspec.yaml +++ b/packages/battery/pubspec.yaml @@ -25,4 +25,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/camera/pubspec.yaml b/packages/camera/pubspec.yaml index a323aa94ad6d..ebdb08a70b1b 100644 --- a/packages/camera/pubspec.yaml +++ b/packages/camera/pubspec.yaml @@ -27,4 +27,4 @@ flutter: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/cloud_firestore/pubspec.yaml b/packages/cloud_firestore/pubspec.yaml index 1e3c4d6a00b4..5e3c01b4b571 100755 --- a/packages/cloud_firestore/pubspec.yaml +++ b/packages/cloud_firestore/pubspec.yaml @@ -27,4 +27,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.2.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/cloud_functions/pubspec.yaml b/packages/cloud_functions/pubspec.yaml index bd8c6b2d2a41..34bbd64f441e 100644 --- a/packages/cloud_functions/pubspec.yaml +++ b/packages/cloud_functions/pubspec.yaml @@ -24,4 +24,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.2.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/connectivity/pubspec.yaml b/packages/connectivity/pubspec.yaml index cbe3b0e091c7..eb2dbb6b3a9f 100644 --- a/packages/connectivity/pubspec.yaml +++ b/packages/connectivity/pubspec.yaml @@ -22,4 +22,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/device_info/pubspec.yaml b/packages/device_info/pubspec.yaml index b69f2838c49a..bc2146759910 100644 --- a/packages/device_info/pubspec.yaml +++ b/packages/device_info/pubspec.yaml @@ -17,4 +17,4 @@ dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/firebase_admob/pubspec.yaml b/packages/firebase_admob/pubspec.yaml index c59ca5263543..57a9df3e0e4b 100644 --- a/packages/firebase_admob/pubspec.yaml +++ b/packages/firebase_admob/pubspec.yaml @@ -24,4 +24,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/firebase_analytics/pubspec.yaml b/packages/firebase_analytics/pubspec.yaml index f0a7d6fbd071..f2f1bef700f4 100755 --- a/packages/firebase_analytics/pubspec.yaml +++ b/packages/firebase_analytics/pubspec.yaml @@ -25,4 +25,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/firebase_auth/pubspec.yaml b/packages/firebase_auth/pubspec.yaml index 93900b9b33b3..8b4746b5b479 100755 --- a/packages/firebase_auth/pubspec.yaml +++ b/packages/firebase_auth/pubspec.yaml @@ -29,4 +29,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/firebase_core/pubspec.yaml b/packages/firebase_core/pubspec.yaml index 9fb3b5b49e71..94fce1c10c1c 100644 --- a/packages/firebase_core/pubspec.yaml +++ b/packages/firebase_core/pubspec.yaml @@ -22,4 +22,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/firebase_database/pubspec.yaml b/packages/firebase_database/pubspec.yaml index d0f669868ba8..47ade45ff3d3 100755 --- a/packages/firebase_database/pubspec.yaml +++ b/packages/firebase_database/pubspec.yaml @@ -24,4 +24,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/firebase_dynamic_links/pubspec.yaml b/packages/firebase_dynamic_links/pubspec.yaml index 150a2e48e10b..a8f278bbd434 100644 --- a/packages/firebase_dynamic_links/pubspec.yaml +++ b/packages/firebase_dynamic_links/pubspec.yaml @@ -24,4 +24,4 @@ flutter: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.2.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/firebase_messaging/pubspec.yaml b/packages/firebase_messaging/pubspec.yaml index d7e1204137cd..f31588c4fe76 100644 --- a/packages/firebase_messaging/pubspec.yaml +++ b/packages/firebase_messaging/pubspec.yaml @@ -26,4 +26,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/firebase_ml_vision/pubspec.yaml b/packages/firebase_ml_vision/pubspec.yaml index f582f1e296bd..c073a1363bbd 100644 --- a/packages/firebase_ml_vision/pubspec.yaml +++ b/packages/firebase_ml_vision/pubspec.yaml @@ -22,4 +22,4 @@ flutter: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.2.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/firebase_performance/pubspec.yaml b/packages/firebase_performance/pubspec.yaml index 64388afa12db..9f41c9d81721 100644 --- a/packages/firebase_performance/pubspec.yaml +++ b/packages/firebase_performance/pubspec.yaml @@ -24,4 +24,4 @@ flutter: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.2.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/firebase_remote_config/pubspec.yaml b/packages/firebase_remote_config/pubspec.yaml index 3c81667e928f..1318fc585dd4 100644 --- a/packages/firebase_remote_config/pubspec.yaml +++ b/packages/firebase_remote_config/pubspec.yaml @@ -21,4 +21,4 @@ flutter: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/firebase_storage/pubspec.yaml b/packages/firebase_storage/pubspec.yaml index 4250da93c72b..81f8779403d5 100755 --- a/packages/firebase_storage/pubspec.yaml +++ b/packages/firebase_storage/pubspec.yaml @@ -24,4 +24,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/pubspec.yaml index 1b2aab22102d..7aed15294da5 100644 --- a/packages/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/pubspec.yaml @@ -21,4 +21,4 @@ flutter: environment: sdk: ">=2.0.0-dev.47.0 <3.0.0" - flutter: ">=0.11.9 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/google_sign_in/pubspec.yaml b/packages/google_sign_in/pubspec.yaml index 75d4abedd997..c35b6477f4ee 100755 --- a/packages/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/pubspec.yaml @@ -23,4 +23,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/image_picker/pubspec.yaml b/packages/image_picker/pubspec.yaml index d1d3415dc22a..ca377dc7395d 100755 --- a/packages/image_picker/pubspec.yaml +++ b/packages/image_picker/pubspec.yaml @@ -24,4 +24,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/in_app_purchase/example/pubspec.yaml b/packages/in_app_purchase/example/pubspec.yaml index ccc21beacaec..0204c1453524 100644 --- a/packages/in_app_purchase/example/pubspec.yaml +++ b/packages/in_app_purchase/example/pubspec.yaml @@ -19,4 +19,4 @@ flutter: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.4.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index cffd35c77e7e..397b262a5120 100644 --- a/packages/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/pubspec.yaml @@ -30,5 +30,5 @@ flutter: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.4.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/local_auth/pubspec.yaml b/packages/local_auth/pubspec.yaml index 2c4ac2e6998e..ed1c2774678d 100644 --- a/packages/local_auth/pubspec.yaml +++ b/packages/local_auth/pubspec.yaml @@ -19,4 +19,4 @@ dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/location_background/pubspec.yaml b/packages/location_background/pubspec.yaml index 3fd25a0c2abc..ea54507f708d 100644 --- a/packages/location_background/pubspec.yaml +++ b/packages/location_background/pubspec.yaml @@ -20,4 +20,4 @@ flutter: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.4.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/package_info/pubspec.yaml b/packages/package_info/pubspec.yaml index 4475b93d473c..4118d12ab931 100644 --- a/packages/package_info/pubspec.yaml +++ b/packages/package_info/pubspec.yaml @@ -17,4 +17,4 @@ dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/path_provider/pubspec.yaml b/packages/path_provider/pubspec.yaml index de2593f4b7c0..b1ce0bc5d243 100644 --- a/packages/path_provider/pubspec.yaml +++ b/packages/path_provider/pubspec.yaml @@ -21,4 +21,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/quick_actions/pubspec.yaml b/packages/quick_actions/pubspec.yaml index 05353fb758df..c103e19335dc 100644 --- a/packages/quick_actions/pubspec.yaml +++ b/packages/quick_actions/pubspec.yaml @@ -18,4 +18,4 @@ dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/sensors/pubspec.yaml b/packages/sensors/pubspec.yaml index dcf0e26dbe00..e2596229d7b9 100644 --- a/packages/sensors/pubspec.yaml +++ b/packages/sensors/pubspec.yaml @@ -22,4 +22,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/share/pubspec.yaml b/packages/share/pubspec.yaml index f7bd39ac5689..4ebfc076a586 100644 --- a/packages/share/pubspec.yaml +++ b/packages/share/pubspec.yaml @@ -24,4 +24,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/shared_preferences/pubspec.yaml b/packages/shared_preferences/pubspec.yaml index 8f32cfbee1ff..21bf37582a9b 100644 --- a/packages/shared_preferences/pubspec.yaml +++ b/packages/shared_preferences/pubspec.yaml @@ -25,4 +25,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/url_launcher/pubspec.yaml b/packages/url_launcher/pubspec.yaml index dcccd5c235a8..2353dea78a86 100644 --- a/packages/url_launcher/pubspec.yaml +++ b/packages/url_launcher/pubspec.yaml @@ -21,4 +21,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.5.6 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/video_player/pubspec.yaml b/packages/video_player/pubspec.yaml index 8cae1f2811ff..3abaecd1b7af 100644 --- a/packages/video_player/pubspec.yaml +++ b/packages/video_player/pubspec.yaml @@ -22,4 +22,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.2.5 <2.0.0" + flutter: ">=1.2.0 <2.0.0" diff --git a/packages/webview_flutter/pubspec.yaml b/packages/webview_flutter/pubspec.yaml index e21da558eb95..5e3a413a3cbb 100644 --- a/packages/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/pubspec.yaml @@ -6,7 +6,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutte environment: sdk: ">=2.0.0-dev.68.0 <3.0.0" - flutter: ">=0.11.9 <2.0.0" + flutter: ">=1.2.0 <2.0.0" dependencies: flutter: From e29597f041ffd33c1c3107c9018e7aa13aed187e Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 12:32:46 -0700 Subject: [PATCH 37/49] analyzer fix --- packages/firebase_storage/lib/src/firebase_storage.dart | 2 +- .../lib/src/billing_client_wrappers/billing_client_wrapper.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/firebase_storage/lib/src/firebase_storage.dart b/packages/firebase_storage/lib/src/firebase_storage.dart index c927302320e9..4f8f6aa80d24 100644 --- a/packages/firebase_storage/lib/src/firebase_storage.dart +++ b/packages/firebase_storage/lib/src/firebase_storage.dart @@ -134,7 +134,7 @@ class StorageFileDownloadTask { final File _file; Future _start() async { - final int totalByteCount = await FirebaseStorage.channel.invokeMethod( + final int totalByteCount = await FirebaseStorage.channel.invokeMethod( "StorageReference#writeToFile", { 'app': _firebaseStorage.app?.name, diff --git a/packages/in_app_purchase/lib/src/billing_client_wrappers/billing_client_wrapper.dart b/packages/in_app_purchase/lib/src/billing_client_wrappers/billing_client_wrapper.dart index a7716c23d4b5..aa33fd5504b1 100644 --- a/packages/in_app_purchase/lib/src/billing_client_wrappers/billing_client_wrapper.dart +++ b/packages/in_app_purchase/lib/src/billing_client_wrappers/billing_client_wrapper.dart @@ -67,7 +67,7 @@ class BillingClient { /// [`BillingClient#isReady()`](https://developer.android.com/reference/com/android/billingclient/api/BillingClient.html#isReady()) /// to get the ready status of the BillingClient instance. Future isReady() async => - await channel.invokeMethod('BillingClient#isReady()'); + await channel.invokeMethod('BillingClient#isReady()'); /// Calls /// [`BillingClient#startConnection(BillingClientStateListener)`](https://developer.android.com/reference/com/android/billingclient/api/BillingClient.html#startconnection) From dab879f8b05578fc76735576df495117ce98dc7c Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 12:33:47 -0700 Subject: [PATCH 38/49] rever min flutter version for sensor plugin --- packages/sensors/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sensors/pubspec.yaml b/packages/sensors/pubspec.yaml index e2596229d7b9..dcf0e26dbe00 100644 --- a/packages/sensors/pubspec.yaml +++ b/packages/sensors/pubspec.yaml @@ -22,4 +22,4 @@ dev_dependencies: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.2.0 <2.0.0" + flutter: ">=0.1.4 <2.0.0" From f3231e8c12eb277250d2f51bb639379fb96f3ce1 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 12:39:16 -0700 Subject: [PATCH 39/49] fix --- packages/firebase_storage/lib/src/firebase_storage.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/firebase_storage/lib/src/firebase_storage.dart b/packages/firebase_storage/lib/src/firebase_storage.dart index 4f8f6aa80d24..cbd1131d3880 100644 --- a/packages/firebase_storage/lib/src/firebase_storage.dart +++ b/packages/firebase_storage/lib/src/firebase_storage.dart @@ -111,7 +111,7 @@ class FirebaseStorage { /// Creates a [StorageReference] given a gs:// or // URL pointing to a Firebase /// Storage location. Future getReferenceFromUrl(String fullUrl) async { - final String path = await channel.invokeMethod( + final String path = await channel.invokeMethod( "FirebaseStorage#getReferenceFromUrl", { 'app': app?.name, 'bucket': storageBucket, From c810604f6092c41b77a803fc465ff22d0707f015 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 20 Mar 2019 12:47:31 -0700 Subject: [PATCH 40/49] Update packages/android_alarm_manager/lib/android_alarm_manager.dart Co-Authored-By: cyanglaz --- packages/android_alarm_manager/lib/android_alarm_manager.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/android_alarm_manager/lib/android_alarm_manager.dart b/packages/android_alarm_manager/lib/android_alarm_manager.dart index 8bc4956b7991..97f472159916 100644 --- a/packages/android_alarm_manager/lib/android_alarm_manager.dart +++ b/packages/android_alarm_manager/lib/android_alarm_manager.dart @@ -67,7 +67,7 @@ class AndroidAlarmManager { return false; } final dynamic r = await _channel - .invokeMethod('AlarmService.start', [handle.toRawHandle()]); + return _channel.invokeMethod('AlarmService.start', [handle.toRawHandle()]); return r ?? false; } From 9b29deece7aea7b718678937db2cc09550d68581 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 20 Mar 2019 12:48:55 -0700 Subject: [PATCH 41/49] Update packages/android_alarm_manager/lib/android_alarm_manager.dart Co-Authored-By: cyanglaz --- packages/android_alarm_manager/lib/android_alarm_manager.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/android_alarm_manager/lib/android_alarm_manager.dart b/packages/android_alarm_manager/lib/android_alarm_manager.dart index 97f472159916..e8224c7100a6 100644 --- a/packages/android_alarm_manager/lib/android_alarm_manager.dart +++ b/packages/android_alarm_manager/lib/android_alarm_manager.dart @@ -111,7 +111,7 @@ class AndroidAlarmManager { if (handle == null) { return false; } - final dynamic r = await _channel.invokeMethod('Alarm.oneShot', [ + return _channel.invokeMethod('Alarm.oneShot', [ id, exact, wakeup, From 19ec463aca392ad8378e0b6fd47de88555962e86 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 20 Mar 2019 12:49:02 -0700 Subject: [PATCH 42/49] Update packages/android_alarm_manager/lib/android_alarm_manager.dart Co-Authored-By: cyanglaz --- packages/android_alarm_manager/lib/android_alarm_manager.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/android_alarm_manager/lib/android_alarm_manager.dart b/packages/android_alarm_manager/lib/android_alarm_manager.dart index e8224c7100a6..a76d2ece20f9 100644 --- a/packages/android_alarm_manager/lib/android_alarm_manager.dart +++ b/packages/android_alarm_manager/lib/android_alarm_manager.dart @@ -184,7 +184,7 @@ class AndroidAlarmManager { /// failure. static Future cancel(int id) async { final dynamic r = - await _channel.invokeMethod('Alarm.cancel', [id]); + final bool r = await _channel.invokeMethod('Alarm.cancel', [id]); return (r == null) ? false : r; } } From f2d907cdef43bb314408545f1f60f593b5106643 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 13:02:45 -0700 Subject: [PATCH 43/49] invokeMapMethod --- packages/camera/lib/camera.dart | 2 +- .../cloud_firestore/lib/src/document_reference.dart | 2 +- packages/cloud_firestore/lib/src/firestore.dart | 6 +++--- packages/cloud_firestore/lib/src/query.dart | 2 +- packages/firebase_auth/lib/src/firebase_auth.dart | 12 ++++++------ packages/firebase_core/lib/src/firebase_app.dart | 6 +++--- .../lib/src/dynamic_link_parameters.dart | 4 ++-- .../lib/src/firebase_dynamic_links.dart | 2 +- .../firebase_ml_vision/lib/src/text_recognizer.dart | 2 +- .../lib/src/remote_config.dart | 6 +++--- .../firebase_storage/lib/src/storage_reference.dart | 4 ++-- packages/google_sign_in/lib/google_sign_in.dart | 4 ++-- .../lib/src/store_kit_wrappers/sk_request_maker.dart | 2 +- .../shared_preferences/lib/shared_preferences.dart | 2 +- .../test/shared_preferences_test.dart | 4 ++-- packages/video_player/lib/video_player.dart | 2 +- 16 files changed, 31 insertions(+), 31 deletions(-) diff --git a/packages/camera/lib/camera.dart b/packages/camera/lib/camera.dart index 2f83623d01b4..d9272b22b011 100644 --- a/packages/camera/lib/camera.dart +++ b/packages/camera/lib/camera.dart @@ -224,7 +224,7 @@ class CameraController extends ValueNotifier { } try { _creatingCompleter = Completer(); - final Map reply = await _channel.invokeMethod>( + final Map reply = await _channel.invokeMapMethod( 'initialize', { 'cameraName': description.name, diff --git a/packages/cloud_firestore/lib/src/document_reference.dart b/packages/cloud_firestore/lib/src/document_reference.dart index 33576c758b6f..f9feae58332c 100644 --- a/packages/cloud_firestore/lib/src/document_reference.dart +++ b/packages/cloud_firestore/lib/src/document_reference.dart @@ -72,7 +72,7 @@ class DocumentReference { /// /// If no document exists, the read will return null. Future get() async { - final Map data = await Firestore.channel.invokeMethod>( + final Map data = await Firestore.channel.invokeMapMethod( 'DocumentReference#get', {'app': firestore.app.name, 'path': path}, ); diff --git a/packages/cloud_firestore/lib/src/firestore.dart b/packages/cloud_firestore/lib/src/firestore.dart index 239944c09045..9531570f6714 100644 --- a/packages/cloud_firestore/lib/src/firestore.dart +++ b/packages/cloud_firestore/lib/src/firestore.dart @@ -110,13 +110,13 @@ class Firestore { 'Transaction timeout must be more than 0 milliseconds'); final int transactionId = _transactionHandlerId++; _transactionHandlers[transactionId] = transactionHandler; - final Map result = await channel - .invokeMethod>('Firestore#runTransaction', { + final Map result = await channel + .invokeMapMethod('Firestore#runTransaction', { 'app': app.name, 'transactionId': transactionId, 'transactionTimeout': timeout.inMilliseconds }); - return result?.cast() ?? {}; + return result ?? {}; } @deprecated diff --git a/packages/cloud_firestore/lib/src/query.dart b/packages/cloud_firestore/lib/src/query.dart index 710cd3cf776c..87bb25a56b83 100644 --- a/packages/cloud_firestore/lib/src/query.dart +++ b/packages/cloud_firestore/lib/src/query.dart @@ -80,7 +80,7 @@ class Query { /// Fetch the documents for this query Future getDocuments() async { - final Map data = await Firestore.channel.invokeMethod>( + final Map data = await Firestore.channel.invokeMapMethod( 'Query#getDocuments', { 'app': firestore.app.name, diff --git a/packages/firebase_auth/lib/src/firebase_auth.dart b/packages/firebase_auth/lib/src/firebase_auth.dart index f148b4676082..43e3c797c2a0 100644 --- a/packages/firebase_auth/lib/src/firebase_auth.dart +++ b/packages/firebase_auth/lib/src/firebase_auth.dart @@ -73,7 +73,7 @@ class FirebaseAuth { /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Anonymous accounts are not enabled. Future signInAnonymously() async { final Map data = await channel - .invokeMethod>('signInAnonymously', {"app": app.name}); + .invokeMapMethod('signInAnonymously', {"app": app.name}); final FirebaseUser currentUser = FirebaseUser._(data, app); return currentUser; } @@ -93,7 +93,7 @@ class FirebaseAuth { }) async { assert(email != null); assert(password != null); - final Map data = await channel.invokeMethod>( + final Map data = await channel.invokeMapMethod( 'createUserWithEmailAndPassword', {'email': email, 'password': password, 'app': app.name}, ); @@ -187,7 +187,7 @@ class FirebaseAuth { /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Google accounts are not enabled. Future signInWithCredential(AuthCredential credential) async { assert(credential != null); - final Map data = await channel.invokeMethod>( + final Map data = await channel.invokeMapMethod( 'signInWithCredential', { 'app': app.name, @@ -290,7 +290,7 @@ class FirebaseAuth { /// Ensure your app's SHA1 is correct in the Firebase console. Future signInWithCustomToken({@required String token}) async { assert(token != null); - final Map data = await channel.invokeMethod>( + final Map data = await channel.invokeMapMethod( 'signInWithCustomToken', {'token': token, 'app': app.name}, ); @@ -310,7 +310,7 @@ class FirebaseAuth { /// Returns the currently signed-in [FirebaseUser] or [null] if there is none. Future currentUser() async { final Map data = await channel - .invokeMethod>("currentUser", {'app': app.name}); + .invokeMapMethod("currentUser", {'app': app.name}); final FirebaseUser currentUser = data == null ? null : FirebaseUser._(data, app); return currentUser; @@ -332,7 +332,7 @@ class FirebaseAuth { /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that this type of account is not enabled. Future linkWithCredential(AuthCredential credential) async { assert(credential != null); - final Map data = await channel.invokeMethod>( + final Map data = await channel.invokeMapMethod( 'linkWithCredential', { 'app': app.name, diff --git a/packages/firebase_core/lib/src/firebase_app.dart b/packages/firebase_core/lib/src/firebase_app.dart index 9d78a87344d8..2b655046c09b 100644 --- a/packages/firebase_core/lib/src/firebase_app.dart +++ b/packages/firebase_core/lib/src/firebase_app.dart @@ -24,7 +24,7 @@ class FirebaseApp { /// This getter is asynchronous because apps can also be configured by native /// code. Future get options async { - final Map app = await channel.invokeMethod>( + final Map app = await channel.invokeMapMethod( 'FirebaseApp#appNamed', name, ); @@ -35,7 +35,7 @@ class FirebaseApp { /// Returns a previously created FirebaseApp instance with the given name, /// or null if no such app exists. static Future appNamed(String name) async { - final Map app = await channel.invokeMethod>( + final Map app = await channel.invokeMapMethod( 'FirebaseApp#appNamed', name, ); @@ -75,7 +75,7 @@ class FirebaseApp { /// Returns a list of all extant FirebaseApp instances, or null if there are /// no FirebaseApp instances. static Future> allApps() async { - final List result = await channel.invokeMethod>( + final List result = await channel.invokeListMethod( 'FirebaseApp#allApps', ); return result diff --git a/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart b/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart index aa76dfad192c..bcb7a729d8ee 100644 --- a/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart +++ b/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart @@ -66,7 +66,7 @@ class DynamicLinkParameters { static Future shortenUrl(Uri url, [DynamicLinkParametersOptions options]) async { final Map reply = await FirebaseDynamicLinks.channel - .invokeMethod >('DynamicLinkParameters#shortenUrl', { + .invokeMapMethod('DynamicLinkParameters#shortenUrl', { 'url': url.toString(), 'dynamicLinkParametersOptions': options?._data, }); @@ -96,7 +96,7 @@ class DynamicLinkParameters { /// Generate a short Dynamic Link. Future buildShortLink() async { final Map reply = await FirebaseDynamicLinks.channel - .invokeMethod>('DynamicLinkParameters#buildShortLink', _data); + .invokeMapMethod('DynamicLinkParameters#buildShortLink', _data); return _parseShortLink(reply); } diff --git a/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart b/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart index cc2731d4e1a7..79bd0201f06d 100644 --- a/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart +++ b/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart @@ -24,7 +24,7 @@ class FirebaseDynamicLinks { /// the first attempt. Future retrieveDynamicLink() async { final Map linkData = - await channel.invokeMethod>('FirebaseDynamicLinks#retrieveDynamicLink'); + await channel.invokeMapMethod('FirebaseDynamicLinks#retrieveDynamicLink'); if (linkData == null) return null; diff --git a/packages/firebase_ml_vision/lib/src/text_recognizer.dart b/packages/firebase_ml_vision/lib/src/text_recognizer.dart index a7000bf60c9e..1c1f277c3de5 100644 --- a/packages/firebase_ml_vision/lib/src/text_recognizer.dart +++ b/packages/firebase_ml_vision/lib/src/text_recognizer.dart @@ -24,7 +24,7 @@ class TextRecognizer { /// Detects [VisionText] from a [FirebaseVisionImage]. Future processImage(FirebaseVisionImage visionImage) async { final Map reply = - await FirebaseVision.channel.invokeMethod>( + await FirebaseVision.channel.invokeMapMethod( 'TextRecognizer#processImage', { 'options': {}, diff --git a/packages/firebase_remote_config/lib/src/remote_config.dart b/packages/firebase_remote_config/lib/src/remote_config.dart index 6d602a755815..f1ec8eccb055 100644 --- a/packages/firebase_remote_config/lib/src/remote_config.dart +++ b/packages/firebase_remote_config/lib/src/remote_config.dart @@ -36,7 +36,7 @@ class RemoteConfig extends ChangeNotifier { static void _getRemoteConfigInstance() async { final Map properties = - await channel.invokeMethod >('RemoteConfig#instance'); + await channel.invokeMapMethod('RemoteConfig#instance'); final RemoteConfig instance = RemoteConfig(); @@ -113,7 +113,7 @@ class RemoteConfig extends ChangeNotifier { /// Expiration must be defined in seconds. Future fetch({Duration expiration = const Duration(hours: 12)}) async { try { - final Map properties = await channel.invokeMethod>( + final Map properties = await channel.invokeMapMethod( 'RemoteConfig#fetch', {'expiration': expiration.inSeconds}); _lastFetchTime = @@ -138,7 +138,7 @@ class RemoteConfig extends ChangeNotifier { /// from the currently activated config, it contains false otherwise. Future activateFetched() async { final Map properties = - await channel.invokeMethod>('RemoteConfig#activate'); + await channel.invokeMapMethod('RemoteConfig#activate'); final Map rawParameters = properties['parameters']; final bool newConfig = properties['newConfig']; final Map fetchedParameters = diff --git a/packages/firebase_storage/lib/src/storage_reference.dart b/packages/firebase_storage/lib/src/storage_reference.dart index 4e2618ee4dbe..a5c828681c64 100644 --- a/packages/firebase_storage/lib/src/storage_reference.dart +++ b/packages/firebase_storage/lib/src/storage_reference.dart @@ -152,7 +152,7 @@ class StorageReference { /// Retrieves metadata associated with an object at this [StorageReference]. Future getMetadata() async { return StorageMetadata._fromMap(await FirebaseStorage.channel - .invokeMethod>("StorageReference#getMetadata", { + .invokeMapMethod("StorageReference#getMetadata", { 'app': _firebaseStorage.app?.name, 'bucket': _firebaseStorage.storageBucket, 'path': _pathComponents.join("/"), @@ -168,7 +168,7 @@ class StorageReference { /// by passing the empty string. Future updateMetadata(StorageMetadata metadata) async { return StorageMetadata._fromMap(await FirebaseStorage.channel - .invokeMethod>("StorageReference#updateMetadata", { + .invokeMapMethod("StorageReference#updateMetadata", { 'app': _firebaseStorage.app?.name, 'bucket': _firebaseStorage.storageBucket, 'path': _pathComponents.join("/"), diff --git a/packages/google_sign_in/lib/google_sign_in.dart b/packages/google_sign_in/lib/google_sign_in.dart index bc69d6d9c42e..56e2d1428c98 100755 --- a/packages/google_sign_in/lib/google_sign_in.dart +++ b/packages/google_sign_in/lib/google_sign_in.dart @@ -79,7 +79,7 @@ class GoogleSignInAccount implements GoogleIdentity { } final Map response = - await GoogleSignIn.channel.invokeMethod>( + await GoogleSignIn.channel.invokeMapMethod( 'getTokens', { 'email': email, @@ -214,7 +214,7 @@ class GoogleSignIn { Future _callMethod(String method) async { await _ensureInitialized(); - final Map response = await channel.invokeMethod>(method); + final Map response = await channel.invokeMapMethod(method); return _setCurrentUser(response != null && response.isNotEmpty ? GoogleSignInAccount._(this, response) : null); diff --git a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_request_maker.dart b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_request_maker.dart index f5eb88c8872c..ec2af1345315 100644 --- a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_request_maker.dart +++ b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_request_maker.dart @@ -24,7 +24,7 @@ class SKRequestMaker { /// A [PlatformException] is thrown if the platform code making the request fails. Future startProductRequest( List productIdentifiers) async { - final Map productResponseMap = await channel.invokeMethod( + final Map productResponseMap = await channel.invokeMapMethod( '-[InAppPurchasePlugin startProductRequest:result:]', productIdentifiers, ); diff --git a/packages/shared_preferences/lib/shared_preferences.dart b/packages/shared_preferences/lib/shared_preferences.dart index e606b9cc1eac..7b231276bdfc 100644 --- a/packages/shared_preferences/lib/shared_preferences.dart +++ b/packages/shared_preferences/lib/shared_preferences.dart @@ -22,7 +22,7 @@ class SharedPreferences { static Future getInstance() async { if (_instance == null) { final Map fromSystem = - await _kChannel.invokeMethod >('getAll'); + await _kChannel.invokeMapMethod('getAll'); assert(fromSystem != null); // Strip the flutter. prefix from the returned preferences. final Map preferencesMap = {}; diff --git a/packages/shared_preferences/test/shared_preferences_test.dart b/packages/shared_preferences/test/shared_preferences_test.dart index 26c4a7d133b1..0ae2d8be1765 100755 --- a/packages/shared_preferences/test/shared_preferences_test.dart +++ b/packages/shared_preferences/test/shared_preferences_test.dart @@ -136,9 +136,9 @@ void main() { }); test('mocking', () async { - expect(await channel.invokeMethod>('getAll'), kTestValues); + expect(await channel.invokeMapMethod('getAll'), kTestValues); SharedPreferences.setMockInitialValues(kTestValues2); - expect(await channel.invokeMethod >('getAll'), kTestValues2); + expect(await channel.invokeMapMethod('getAll'), kTestValues2); }); }); } diff --git a/packages/video_player/lib/video_player.dart b/packages/video_player/lib/video_player.dart index dec75888e811..d36c1e5c7197 100644 --- a/packages/video_player/lib/video_player.dart +++ b/packages/video_player/lib/video_player.dart @@ -205,7 +205,7 @@ class VideoPlayerController extends ValueNotifier { case DataSourceType.file: dataSourceDescription = {'uri': dataSource}; } - final Map response = await _channel.invokeMethod>( + final Map response = await _channel.invokeMapMethod( 'create', dataSourceDescription, ); From 2e77a28fb1496eb9b0eb2cfb971e408c4626da6d Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 14:05:24 -0700 Subject: [PATCH 44/49] invokeListMethod --- packages/camera/lib/camera.dart | 4 ++-- packages/firebase_auth/lib/src/firebase_auth.dart | 3 +-- packages/firebase_ml_vision/lib/src/barcode_detector.dart | 2 +- packages/firebase_ml_vision/lib/src/face_detector.dart | 2 +- packages/firebase_ml_vision/lib/src/label_detector.dart | 4 ++-- packages/local_auth/lib/local_auth.dart | 4 ++-- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/camera/lib/camera.dart b/packages/camera/lib/camera.dart index d9272b22b011..24cdf16e0125 100644 --- a/packages/camera/lib/camera.dart +++ b/packages/camera/lib/camera.dart @@ -50,7 +50,7 @@ CameraLensDirection _parseCameraLensDirection(String string) { Future> availableCameras() async { try { final List cameras = - await _channel.invokeMethod>('availableCameras'); + await _channel.invokeListMethod('availableCameras'); return cameras.map((dynamic camera) { return CameraDescription( name: camera['name'], @@ -224,7 +224,7 @@ class CameraController extends ValueNotifier { } try { _creatingCompleter = Completer(); - final Map reply = await _channel.invokeMapMethod( + final Map reply = await _channel.invokeMapMethod( 'initialize', { 'cameraName': description.name, diff --git a/packages/firebase_auth/lib/src/firebase_auth.dart b/packages/firebase_auth/lib/src/firebase_auth.dart index 43e3c797c2a0..b1cd8ebb85cd 100644 --- a/packages/firebase_auth/lib/src/firebase_auth.dart +++ b/packages/firebase_auth/lib/src/firebase_auth.dart @@ -114,11 +114,10 @@ class FirebaseAuth { @required String email, }) async { assert(email != null); - final List providers = await channel.invokeMethod>( + return await channel.invokeListMethod( 'fetchSignInMethodsForEmail', {'email': email, 'app': app.name}, ); - return providers?.cast(); } /// Triggers the Firebase Authentication backend to send a password-reset diff --git a/packages/firebase_ml_vision/lib/src/barcode_detector.dart b/packages/firebase_ml_vision/lib/src/barcode_detector.dart index a65c1c59cb24..e1901e03c194 100644 --- a/packages/firebase_ml_vision/lib/src/barcode_detector.dart +++ b/packages/firebase_ml_vision/lib/src/barcode_detector.dart @@ -190,7 +190,7 @@ class BarcodeDetector { /// Detects barcodes in the input image. Future> detectInImage(FirebaseVisionImage visionImage) async { - final List reply = await FirebaseVision.channel.invokeMethod>( + final List reply = await FirebaseVision.channel.invokeListMethod( 'BarcodeDetector#detectInImage', { 'options': { diff --git a/packages/firebase_ml_vision/lib/src/face_detector.dart b/packages/firebase_ml_vision/lib/src/face_detector.dart index 2bacdfc2aa3f..e95bab07c99d 100644 --- a/packages/firebase_ml_vision/lib/src/face_detector.dart +++ b/packages/firebase_ml_vision/lib/src/face_detector.dart @@ -45,7 +45,7 @@ class FaceDetector { /// Detects faces in the input image. Future> processImage(FirebaseVisionImage visionImage) async { - final List reply = await FirebaseVision.channel.invokeMethod>( + final List reply = await FirebaseVision.channel.invokeListMethod( 'FaceDetector#processImage', { 'options': { diff --git a/packages/firebase_ml_vision/lib/src/label_detector.dart b/packages/firebase_ml_vision/lib/src/label_detector.dart index ed5c4ba4f08f..05ca089cacc7 100644 --- a/packages/firebase_ml_vision/lib/src/label_detector.dart +++ b/packages/firebase_ml_vision/lib/src/label_detector.dart @@ -34,7 +34,7 @@ class LabelDetector { /// Detects entities in the input image. Future> detectInImage(FirebaseVisionImage visionImage) async { - final List reply = await FirebaseVision.channel.invokeMethod>( + final List reply = await FirebaseVision.channel.invokeListMethod( 'LabelDetector#detectInImage', { 'options': { @@ -82,7 +82,7 @@ class CloudLabelDetector { /// Detects entities in the input image. Future> detectInImage(FirebaseVisionImage visionImage) async { - final List reply = await FirebaseVision.channel.invokeMethod>( + final List reply = await FirebaseVision.channel.invokeListMethod( 'CloudLabelDetector#detectInImage', { 'options': options._serialize(), diff --git a/packages/local_auth/lib/local_auth.dart b/packages/local_auth/lib/local_auth.dart index ce64df79e4a5..ed4c2c26b137 100644 --- a/packages/local_auth/lib/local_auth.dart +++ b/packages/local_auth/lib/local_auth.dart @@ -79,7 +79,7 @@ class LocalAuthentication { /// /// Returns a [Future] bool true or false: Future get canCheckBiometrics async => - (await _channel.invokeMethod>('getAvailableBiometrics')).isNotEmpty; + (await _channel.invokeListMethod('getAvailableBiometrics')).isNotEmpty; /// Returns a list of enrolled biometrics /// @@ -89,7 +89,7 @@ class LocalAuthentication { /// - BiometricType.iris (not yet implemented) Future> getAvailableBiometrics() async { final List result = - (await _channel.invokeMethod>('getAvailableBiometrics')).cast(); + (await _channel.invokeListMethod('getAvailableBiometrics')); final List biometrics = []; result.forEach((String value) { switch (value) { From dd4995d994888b9b73ec529bf83188eef04adb4d Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 20 Mar 2019 14:23:21 -0700 Subject: [PATCH 45/49] remove explict casting --- .../lib/android_alarm_manager.dart | 2 -- packages/camera/lib/camera.dart | 8 ++++---- .../lib/src/document_reference.dart | 2 +- packages/cloud_firestore/lib/src/query.dart | 2 +- .../firebase_auth/lib/src/firebase_auth.dart | 16 ++++++++-------- packages/firebase_core/lib/src/firebase_app.dart | 8 ++++---- .../lib/src/dynamic_link_parameters.dart | 8 ++++---- .../lib/src/firebase_dynamic_links.dart | 4 ++-- .../lib/src/barcode_detector.dart | 6 +++--- .../lib/src/face_detector.dart | 6 +++--- .../lib/src/label_detector.dart | 10 +++++----- .../lib/src/text_recognizer.dart | 4 ++-- .../lib/src/remote_config.dart | 10 +++++----- .../lib/src/storage_metadata.dart | 2 +- .../lib/src/storage_reference.dart | 4 ++-- packages/google_sign_in/lib/google_sign_in.dart | 6 +++--- packages/video_player/lib/video_player.dart | 2 +- 17 files changed, 49 insertions(+), 51 deletions(-) diff --git a/packages/android_alarm_manager/lib/android_alarm_manager.dart b/packages/android_alarm_manager/lib/android_alarm_manager.dart index a76d2ece20f9..b295a71bb962 100644 --- a/packages/android_alarm_manager/lib/android_alarm_manager.dart +++ b/packages/android_alarm_manager/lib/android_alarm_manager.dart @@ -66,9 +66,7 @@ class AndroidAlarmManager { if (handle == null) { return false; } - final dynamic r = await _channel return _channel.invokeMethod('AlarmService.start', [handle.toRawHandle()]); - return r ?? false; } /// Schedules a one-shot timer to run `callback` after time `delay`. diff --git a/packages/camera/lib/camera.dart b/packages/camera/lib/camera.dart index 24cdf16e0125..d9f61adb6c05 100644 --- a/packages/camera/lib/camera.dart +++ b/packages/camera/lib/camera.dart @@ -49,9 +49,9 @@ CameraLensDirection _parseCameraLensDirection(String string) { /// May throw a [CameraException]. Future> availableCameras() async { try { - final List cameras = - await _channel.invokeListMethod('availableCameras'); - return cameras.map((dynamic camera) { + final List> cameras = + await _channel.invokeListMethod>('availableCameras'); + return cameras.map((Map camera) { return CameraDescription( name: camera['name'], lensDirection: _parseCameraLensDirection(camera['lensFacing']), @@ -224,7 +224,7 @@ class CameraController extends ValueNotifier { } try { _creatingCompleter = Completer(); - final Map reply = await _channel.invokeMapMethod( + final Map reply = await _channel.invokeMapMethod( 'initialize', { 'cameraName': description.name, diff --git a/packages/cloud_firestore/lib/src/document_reference.dart b/packages/cloud_firestore/lib/src/document_reference.dart index f9feae58332c..b4c38d3a27e4 100644 --- a/packages/cloud_firestore/lib/src/document_reference.dart +++ b/packages/cloud_firestore/lib/src/document_reference.dart @@ -72,7 +72,7 @@ class DocumentReference { /// /// If no document exists, the read will return null. Future get() async { - final Map data = await Firestore.channel.invokeMapMethod( + final Map data = await Firestore.channel.invokeMapMethod( 'DocumentReference#get', {'app': firestore.app.name, 'path': path}, ); diff --git a/packages/cloud_firestore/lib/src/query.dart b/packages/cloud_firestore/lib/src/query.dart index 87bb25a56b83..29ca0bc6c3e4 100644 --- a/packages/cloud_firestore/lib/src/query.dart +++ b/packages/cloud_firestore/lib/src/query.dart @@ -80,7 +80,7 @@ class Query { /// Fetch the documents for this query Future getDocuments() async { - final Map data = await Firestore.channel.invokeMapMethod( + final Map data = await Firestore.channel.invokeMapMethod( 'Query#getDocuments', { 'app': firestore.app.name, diff --git a/packages/firebase_auth/lib/src/firebase_auth.dart b/packages/firebase_auth/lib/src/firebase_auth.dart index b1cd8ebb85cd..dccb50ac9c3e 100644 --- a/packages/firebase_auth/lib/src/firebase_auth.dart +++ b/packages/firebase_auth/lib/src/firebase_auth.dart @@ -72,8 +72,8 @@ class FirebaseAuth { /// Errors: /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Anonymous accounts are not enabled. Future signInAnonymously() async { - final Map data = await channel - .invokeMapMethod('signInAnonymously', {"app": app.name}); + final Map data = await channel + .invokeMapMethod('signInAnonymously', {"app": app.name}); final FirebaseUser currentUser = FirebaseUser._(data, app); return currentUser; } @@ -93,7 +93,7 @@ class FirebaseAuth { }) async { assert(email != null); assert(password != null); - final Map data = await channel.invokeMapMethod( + final Map data = await channel.invokeMapMethod( 'createUserWithEmailAndPassword', {'email': email, 'password': password, 'app': app.name}, ); @@ -186,7 +186,7 @@ class FirebaseAuth { /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Google accounts are not enabled. Future signInWithCredential(AuthCredential credential) async { assert(credential != null); - final Map data = await channel.invokeMapMethod( + final Map data = await channel.invokeMapMethod( 'signInWithCredential', { 'app': app.name, @@ -289,7 +289,7 @@ class FirebaseAuth { /// Ensure your app's SHA1 is correct in the Firebase console. Future signInWithCustomToken({@required String token}) async { assert(token != null); - final Map data = await channel.invokeMapMethod( + final Map data = await channel.invokeMapMethod( 'signInWithCustomToken', {'token': token, 'app': app.name}, ); @@ -308,8 +308,8 @@ class FirebaseAuth { /// Returns the currently signed-in [FirebaseUser] or [null] if there is none. Future currentUser() async { - final Map data = await channel - .invokeMapMethod("currentUser", {'app': app.name}); + final Map data = await channel + .invokeMapMethod("currentUser", {'app': app.name}); final FirebaseUser currentUser = data == null ? null : FirebaseUser._(data, app); return currentUser; @@ -331,7 +331,7 @@ class FirebaseAuth { /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that this type of account is not enabled. Future linkWithCredential(AuthCredential credential) async { assert(credential != null); - final Map data = await channel.invokeMapMethod( + final Map data = await channel.invokeMapMethod( 'linkWithCredential', { 'app': app.name, diff --git a/packages/firebase_core/lib/src/firebase_app.dart b/packages/firebase_core/lib/src/firebase_app.dart index 2b655046c09b..7d9f5822ee55 100644 --- a/packages/firebase_core/lib/src/firebase_app.dart +++ b/packages/firebase_core/lib/src/firebase_app.dart @@ -24,7 +24,7 @@ class FirebaseApp { /// This getter is asynchronous because apps can also be configured by native /// code. Future get options async { - final Map app = await channel.invokeMapMethod( + final Map app = await channel.invokeMapMethod( 'FirebaseApp#appNamed', name, ); @@ -35,7 +35,7 @@ class FirebaseApp { /// Returns a previously created FirebaseApp instance with the given name, /// or null if no such app exists. static Future appNamed(String name) async { - final Map app = await channel.invokeMapMethod( + final Map app = await channel.invokeMapMethod( 'FirebaseApp#appNamed', name, ); @@ -75,12 +75,12 @@ class FirebaseApp { /// Returns a list of all extant FirebaseApp instances, or null if there are /// no FirebaseApp instances. static Future> allApps() async { - final List result = await channel.invokeListMethod( + final List> result = await channel.invokeListMethod>( 'FirebaseApp#allApps', ); return result ?.map( - (dynamic app) => FirebaseApp(name: app['name']), + (Map app) => FirebaseApp(name: app['name']), ) ?.toList(); } diff --git a/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart b/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart index bcb7a729d8ee..c72ef3fdb877 100644 --- a/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart +++ b/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart @@ -65,8 +65,8 @@ class DynamicLinkParameters { /// using [DynamicLinkParameters]. static Future shortenUrl(Uri url, [DynamicLinkParametersOptions options]) async { - final Map reply = await FirebaseDynamicLinks.channel - .invokeMapMethod('DynamicLinkParameters#shortenUrl', { + final Map reply = await FirebaseDynamicLinks.channel + .invokeMapMethod('DynamicLinkParameters#shortenUrl', { 'url': url.toString(), 'dynamicLinkParametersOptions': options?._data, }); @@ -95,8 +95,8 @@ class DynamicLinkParameters { /// Generate a short Dynamic Link. Future buildShortLink() async { - final Map reply = await FirebaseDynamicLinks.channel - .invokeMapMethod('DynamicLinkParameters#buildShortLink', _data); + final Map reply = await FirebaseDynamicLinks.channel + .invokeMapMethod('DynamicLinkParameters#buildShortLink', _data); return _parseShortLink(reply); } diff --git a/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart b/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart index 79bd0201f06d..959b062f2b0b 100644 --- a/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart +++ b/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart @@ -23,8 +23,8 @@ class FirebaseDynamicLinks { /// there is no pending dynamic link or any call to this method after the /// the first attempt. Future retrieveDynamicLink() async { - final Map linkData = - await channel.invokeMapMethod('FirebaseDynamicLinks#retrieveDynamicLink'); + final Map linkData = + await channel.invokeMapMethod('FirebaseDynamicLinks#retrieveDynamicLink'); if (linkData == null) return null; diff --git a/packages/firebase_ml_vision/lib/src/barcode_detector.dart b/packages/firebase_ml_vision/lib/src/barcode_detector.dart index e1901e03c194..f94ce742e78d 100644 --- a/packages/firebase_ml_vision/lib/src/barcode_detector.dart +++ b/packages/firebase_ml_vision/lib/src/barcode_detector.dart @@ -190,7 +190,7 @@ class BarcodeDetector { /// Detects barcodes in the input image. Future> detectInImage(FirebaseVisionImage visionImage) async { - final List reply = await FirebaseVision.channel.invokeListMethod( + final List> reply = await FirebaseVision.channel.invokeListMethod>( 'BarcodeDetector#detectInImage', { 'options': { @@ -200,7 +200,7 @@ class BarcodeDetector { ); final List barcodes = []; - reply.forEach((dynamic barcode) { + reply.forEach((Map barcode) { barcodes.add(Barcode._(barcode)); }); @@ -226,7 +226,7 @@ class BarcodeDetectorOptions { /// Represents a single recognized barcode and its value. class Barcode { - Barcode._(Map _data) + Barcode._(Map_data) : boundingBox = _data['left'] != null ? Rect.fromLTWH( _data['left'], diff --git a/packages/firebase_ml_vision/lib/src/face_detector.dart b/packages/firebase_ml_vision/lib/src/face_detector.dart index e95bab07c99d..dd4a87b30d30 100644 --- a/packages/firebase_ml_vision/lib/src/face_detector.dart +++ b/packages/firebase_ml_vision/lib/src/face_detector.dart @@ -45,7 +45,7 @@ class FaceDetector { /// Detects faces in the input image. Future> processImage(FirebaseVisionImage visionImage) async { - final List reply = await FirebaseVision.channel.invokeListMethod( + final List> reply = await FirebaseVision.channel.invokeListMethod>( 'FaceDetector#processImage', { 'options': { @@ -59,7 +59,7 @@ class FaceDetector { ); final List faces = []; - for (dynamic data in reply) { + for (Map data in reply) { faces.add(Face._(data)); } @@ -111,7 +111,7 @@ class FaceDetectorOptions { /// Represents a face detected by [FaceDetector]. class Face { - Face._(dynamic data) + Face._(Map data) : boundingBox = Rect.fromLTWH( data['left'], data['top'], diff --git a/packages/firebase_ml_vision/lib/src/label_detector.dart b/packages/firebase_ml_vision/lib/src/label_detector.dart index 05ca089cacc7..4e7d5d5d18c7 100644 --- a/packages/firebase_ml_vision/lib/src/label_detector.dart +++ b/packages/firebase_ml_vision/lib/src/label_detector.dart @@ -34,7 +34,7 @@ class LabelDetector { /// Detects entities in the input image. Future> detectInImage(FirebaseVisionImage visionImage) async { - final List reply = await FirebaseVision.channel.invokeListMethod( + final List> reply = await FirebaseVision.channel.invokeListMethod>( 'LabelDetector#detectInImage', { 'options': { @@ -44,7 +44,7 @@ class LabelDetector { ); final List