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..da633bbcc08e 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 @@ -69,11 +66,8 @@ class AndroidAlarmManager { if (handle == null) { 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()]); + final bool r = await _channel.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 bool r = await _channel.invokeMethod('Alarm.oneShot', [ id, exact, wakeup, @@ -172,10 +163,8 @@ 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 bool r = await _channel.invokeMethod( + 'Alarm.periodic', [ id, exact, wakeup, @@ -195,11 +184,8 @@ class AndroidAlarmManager { /// Returns a [Future] that resolves to `true` on success and `false` on /// 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]); + final bool r = + 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..d09018f96427 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 @@ -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/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..561a804d4e46 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: @@ -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/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..6d9af34e8b57 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: @@ -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/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); }); 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..182e2f1fb8a1 100644 --- a/packages/camera/lib/camera.dart +++ b/packages/camera/lib/camera.dart @@ -49,12 +49,9 @@ CameraLensDirection _parseCameraLensDirection(String string) { /// May throw a [CameraException]. 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'); - 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']), @@ -227,10 +224,8 @@ 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.invokeMapMethod( 'initialize', { 'cameraName': description.name, @@ -268,10 +263,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 +309,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 +354,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 +395,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 +435,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 +461,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 +480,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..ebdb08a70b1b 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 @@ -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/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..7f103d3fd769 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,8 @@ 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.invokeMapMethod( 'DocumentReference#get', {'app': firestore.app.name, 'path': path}, ); @@ -94,10 +86,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 +109,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 +122,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..27c90ff599e8 100644 --- a/packages/cloud_firestore/lib/src/firestore.dart +++ b/packages/cloud_firestore/lib/src/firestore.dart @@ -110,25 +110,21 @@ class Firestore { 'Transaction timeout must be more than 0 milliseconds'); 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', { + final Map result = await channel + .invokeMapMethod( + 'Firestore#runTransaction', { 'app': app.name, 'transactionId': transactionId, 'transactionTimeout': timeout.inMilliseconds }); - return result?.cast() ?? {}; + return result ?? {}; } @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 +135,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..dc35082a87fc 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,8 @@ 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.invokeMapMethod( '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..f6f80c6b2d71 100644 --- a/packages/cloud_firestore/lib/src/transaction.dart +++ b/packages/cloud_firestore/lib/src/transaction.dart @@ -14,11 +14,8 @@ class Transaction { Firestore _firestore; 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', { + final Map result = await Firestore.channel + .invokeMapMethod('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,8 @@ 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..5e3c01b4b571 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: @@ -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/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..b22f5a6d60bc 100644 --- a/packages/cloud_functions/lib/cloud_functions.dart +++ b/packages/cloud_functions/lib/cloud_functions.dart @@ -42,11 +42,8 @@ class CloudFunctions { Future call( {@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', { + final dynamic response = 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..34bbd64f441e 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 @@ -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/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..eb2dbb6b3a9f 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: @@ -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/CHANGELOG.md b/packages/device_info/CHANGELOG.md index 0cd39ed0b6eb..e6ef274085f9 100644 --- a/packages/device_info/CHANGELOG.md +++ b/packages/device_info/CHANGELOG.md @@ -1,4 +1,9 @@ -## 0.4.0 +## 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 migration. diff --git a/packages/device_info/lib/device_info.dart b/packages/device_info/lib/device_info.dart index 038de10e2268..6afa58e86604 100644 --- a/packages/device_info/lib/device_info.dart +++ b/packages/device_info/lib/device_info.dart @@ -21,11 +21,8 @@ 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')); + _cachedAndroidDeviceInfo ??= AndroidDeviceInfo._fromMap(await channel + .invokeMapMethod('getAndroidDeviceInfo')); /// This information does not change from call to call. Cache it. IosDeviceInfo _cachedIosDeviceInfo; @@ -33,11 +30,9 @@ class DeviceInfoPlugin { /// Information derived from `UIDevice`. /// /// 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')); + Future get iosInfo async => + _cachedIosDeviceInfo ??= IosDeviceInfo._fromMap( + await channel.invokeMapMethod('getIosDeviceInfo')); } /// Information derived from `android.os.Build`. @@ -130,29 +125,28 @@ class AndroidDeviceInfo { final String androidId; /// Deserializes from the message received from [_kChannel]. - static AndroidDeviceInfo _fromMap(dynamic message) { - final Map map = message; + static AndroidDeviceInfo _fromMap(Map message) { return AndroidDeviceInfo._( - version: AndroidBuildVersion._fromMap(map['version']), - board: map['board'], - bootloader: map['bootloader'], - brand: map['brand'], - device: map['device'], - display: map['display'], - fingerprint: map['fingerprint'], - hardware: map['hardware'], - host: map['host'], - id: map['id'], - manufacturer: map['manufacturer'], - model: map['model'], - product: map['product'], - supported32BitAbis: _fromList(map['supported32BitAbis']), - supported64BitAbis: _fromList(map['supported64BitAbis']), - supportedAbis: _fromList(map['supportedAbis']), - tags: map['tags'], - type: map['type'], - isPhysicalDevice: map['isPhysicalDevice'], - androidId: map['androidId'], + version: AndroidBuildVersion._fromMap(message['version']), + board: message['board'], + bootloader: message['bootloader'], + brand: message['brand'], + device: message['device'], + display: message['display'], + fingerprint: message['fingerprint'], + hardware: message['hardware'], + host: message['host'], + id: message['id'], + manufacturer: message['manufacturer'], + model: message['model'], + product: message['product'], + supported32BitAbis: _fromList(message['supported32BitAbis']), + supported64BitAbis: _fromList(message['supported64BitAbis']), + supportedAbis: _fromList(message['supportedAbis']), + tags: message['tags'], + type: message['type'], + isPhysicalDevice: message['isPhysicalDevice'], + androidId: message['androidId'], ); } @@ -256,17 +250,16 @@ class IosDeviceInfo { final IosUtsname utsname; /// Deserializes from the map message received from [_kChannel]. - static IosDeviceInfo _fromMap(dynamic message) { - final Map map = message; + static IosDeviceInfo _fromMap(Map message) { return IosDeviceInfo._( - name: map['name'], - systemName: map['systemName'], - systemVersion: map['systemVersion'], - model: map['model'], - localizedModel: map['localizedModel'], - identifierForVendor: map['identifierForVendor'], - isPhysicalDevice: map['isPhysicalDevice'] == 'true', - utsname: IosUtsname._fromMap(map['utsname']), + name: message['name'], + systemName: message['systemName'], + systemVersion: message['systemVersion'], + model: message['model'], + localizedModel: message['localizedModel'], + identifierForVendor: message['identifierForVendor'], + isPhysicalDevice: message['isPhysicalDevice'] == 'true', + utsname: IosUtsname._fromMap(message['utsname']), ); } } diff --git a/packages/device_info/pubspec.yaml b/packages/device_info/pubspec.yaml index 762677c6a2e8..bc2146759910 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: @@ -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/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..57a9df3e0e4b 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: @@ -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/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..8dc4f001a052 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,8 @@ 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 +828,8 @@ 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..f2f1bef700f4 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: @@ -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_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); 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..7d8922e8d027 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); }); @@ -78,11 +72,9 @@ class FirebaseAuth { /// Errors: /// • `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}); + final Map data = await channel + .invokeMapMethod( + 'signInAnonymously', {"app": app.name}); final FirebaseUser currentUser = FirebaseUser._(data, app); return currentUser; } @@ -102,10 +94,8 @@ 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.invokeMapMethod( 'createUserWithEmailAndPassword', {'email': email, 'password': password, 'app': app.name}, ); @@ -126,14 +116,10 @@ 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( + return await channel.invokeListMethod( 'fetchSignInMethodsForEmail', {'email': email, 'app': app.name}, ); - return providers?.cast(); } /// Triggers the Firebase Authentication backend to send a password-reset @@ -147,10 +133,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 +188,8 @@ 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.invokeMapMethod( 'signInWithCredential', { 'app': app.name, @@ -288,10 +269,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 +292,8 @@ 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.invokeMapMethod( 'signInWithCustomToken', {'token': token, 'app': app.name}, ); @@ -331,19 +307,14 @@ 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}); + final Map data = await channel + .invokeMapMethod( + "currentUser", {'app': app.name}); final FirebaseUser currentUser = data == null ? null : FirebaseUser._(data, app); return currentUser; @@ -365,10 +336,8 @@ 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.invokeMapMethod( 'linkWithCredential', { 'app': app.name, @@ -385,10 +354,8 @@ 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..8b4746b5b479 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: @@ -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/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..a593bab09949 100644 --- a/packages/firebase_core/lib/src/firebase_app.dart +++ b/packages/firebase_core/lib/src/firebase_app.dart @@ -24,10 +24,8 @@ 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.invokeMapMethod( 'FirebaseApp#appNamed', name, ); @@ -38,10 +36,8 @@ 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.invokeMapMethod( 'FirebaseApp#appNamed', name, ); @@ -70,10 +66,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,15 +77,13 @@ 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.invokeListMethod>( 'FirebaseApp#allApps', ); return result ?.map( - (dynamic app) => FirebaseApp(name: app['name']), + (Map app) => FirebaseApp(name: app['name']), ) ?.toList(); } diff --git a/packages/firebase_core/pubspec.yaml b/packages/firebase_core/pubspec.yaml index 2f215ff691eb..94fce1c10c1c 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: @@ -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/lib/src/database_reference.dart b/packages/firebase_database/lib/src/database_reference.dart index b6d599394b19..dc814d66fc7f 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, @@ -179,11 +170,8 @@ class DatabaseReference extends Query { return TransactionResult._(databaseError, committed, dataSnapshot); } - _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', { + _database._channel.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, 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/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..4e7a97d402c5 100644 --- a/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart +++ b/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart @@ -65,11 +65,9 @@ class DynamicLinkParameters { /// using [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', { + final Map reply = await FirebaseDynamicLinks.channel + .invokeMapMethod( + 'DynamicLinkParameters#shortenUrl', { 'url': url.toString(), 'dynamicLinkParametersOptions': options?._data, }); @@ -92,20 +90,15 @@ 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); + 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 752df5cd691d..647cb8c267d0 100644 --- a/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart +++ b/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart @@ -23,11 +23,9 @@ 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 = - // 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'); + final Map linkData = + await channel.invokeMapMethod( + '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..a8f278bbd434 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 @@ -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/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..f31588c4fe76 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: @@ -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_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)); }); } 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/lib/src/barcode_detector.dart b/packages/firebase_ml_vision/lib/src/barcode_detector.dart index 72ff8b165a9d..8bdc22b90f6d 100644 --- a/packages/firebase_ml_vision/lib/src/barcode_detector.dart +++ b/packages/firebase_ml_vision/lib/src/barcode_detector.dart @@ -190,10 +190,8 @@ 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.invokeListMethod>( 'BarcodeDetector#detectInImage', { 'options': { @@ -203,7 +201,7 @@ class BarcodeDetector { ); final List barcodes = []; - reply.forEach((dynamic barcode) { + reply.forEach((Map barcode) { barcodes.add(Barcode._(barcode)); }); @@ -229,7 +227,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 ad451ba0a104..b01eaa521d61 100644 --- a/packages/firebase_ml_vision/lib/src/face_detector.dart +++ b/packages/firebase_ml_vision/lib/src/face_detector.dart @@ -45,10 +45,8 @@ 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.invokeListMethod>( 'FaceDetector#processImage', { 'options': { @@ -62,7 +60,7 @@ class FaceDetector { ); final List faces = []; - for (dynamic data in reply) { + for (Map data in reply) { faces.add(Face._(data)); } @@ -114,7 +112,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 a37060a9b626..09d819419fd0 100644 --- a/packages/firebase_ml_vision/lib/src/label_detector.dart +++ b/packages/firebase_ml_vision/lib/src/label_detector.dart @@ -34,10 +34,8 @@ 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.invokeListMethod>( 'LabelDetector#detectInImage', { 'options': { @@ -47,7 +45,7 @@ class LabelDetector { ); final List