Skip to content

Commit

Permalink
Revert "Supress strong_mode_implicit_dynamic_method for `invokeMeth…
Browse files Browse the repository at this point in the history
…od` calls. (flutter#1065)"

This reverts commit 8b14bc4.
  • Loading branch information
andreidiaconu authored Feb 17, 2019
1 parent 1ce5155 commit 7326101
Show file tree
Hide file tree
Showing 54 changed files with 0 additions and 633 deletions.
15 changes: 0 additions & 15 deletions packages/android_alarm_manager/lib/android_alarm_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ 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');
}

Expand All @@ -70,9 +67,6 @@ 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', <dynamic>[handle.toRawHandle()]);
return r ?? false;
}
Expand Down Expand Up @@ -112,9 +106,6 @@ 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', <dynamic>[
id,
exact,
Expand Down Expand Up @@ -161,9 +152,6 @@ 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',
<dynamic>[id, exact, wakeup, first, period, handle.toRawHandle()]);
return (r == null) ? false : r;
Expand All @@ -178,9 +166,6 @@ class AndroidAlarmManager {
/// failure.
static Future<bool> 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', <dynamic>[id]);
return (r == null) ? false : r;
}
Expand Down
3 changes: 0 additions & 3 deletions packages/android_intent/lib/android_intent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
3 changes: 0 additions & 3 deletions packages/battery/lib/battery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class Battery {

/// Returns the current battery level in percent.
Future<int> 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')
.then<int>((dynamic result) => result);

Expand Down
3 changes: 0 additions & 3 deletions packages/battery/test/battery_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ 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'))
.thenAnswer((Invocation invoke) => Future<int>.value(42));
expect(await battery.batteryLevel, 42);
Expand Down
27 changes: 0 additions & 27 deletions packages/camera/lib/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import 'package:flutter/widgets.dart';
part 'camera_image.dart';

final MethodChannel _channel = const MethodChannel('plugins.flutter.io/camera')
// TODO(amirh): remove 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');

enum CameraLensDirection { front, back, external }
Expand Down Expand Up @@ -53,9 +50,6 @@ CameraLensDirection _parseCameraLensDirection(String string) {
Future<List<CameraDescription>> availableCameras() async {
try {
final List<dynamic> 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) {
return CameraDescription(
Expand Down Expand Up @@ -220,9 +214,6 @@ class CameraController extends ValueNotifier<CameraValue> {
}
try {
_creatingCompleter = Completer<void>();
// TODO(amirh): remove 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<dynamic, dynamic> reply = await _channel.invokeMethod(
'initialize',
<String, dynamic>{
Expand Down Expand Up @@ -292,9 +283,6 @@ class CameraController extends ValueNotifier<CameraValue> {
}
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(
'takePicture',
<String, dynamic>{'textureId': _textureId, 'path': path},
Expand Down Expand Up @@ -340,9 +328,6 @@ class CameraController extends ValueNotifier<CameraValue> {
}

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');
value = value.copyWith(isStreamingImages: true);
} on PlatformException catch (e) {
Expand Down Expand Up @@ -384,9 +369,6 @@ class CameraController extends ValueNotifier<CameraValue> {

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');
} on PlatformException catch (e) {
throw CameraException(e.code, e.message);
Expand Down Expand Up @@ -427,9 +409,6 @@ class CameraController extends ValueNotifier<CameraValue> {
}

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(
'startVideoRecording',
<String, dynamic>{'textureId': _textureId, 'filePath': filePath},
Expand All @@ -456,9 +435,6 @@ class CameraController extends ValueNotifier<CameraValue> {
}
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(
'stopVideoRecording',
<String, dynamic>{'textureId': _textureId},
Expand All @@ -478,9 +454,6 @@ class CameraController extends ValueNotifier<CameraValue> {
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(
'dispose',
<String, dynamic>{'textureId': _textureId},
Expand Down
18 changes: 0 additions & 18 deletions packages/cloud_firestore/lib/src/document_reference.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ class DocumentReference {
/// If [merge] is true, the provided data will be merged into an
/// existing document instead of overwriting.
Future<void> setData(Map<String, dynamic> 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(
'DocumentReference#setData',
<String, dynamic>{
Expand All @@ -61,9 +58,6 @@ class DocumentReference {
///
/// If no document exists yet, the update will fail.
Future<void> updateData(Map<String, dynamic> 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(
'DocumentReference#updateData',
<String, dynamic>{
Expand All @@ -78,9 +72,6 @@ class DocumentReference {
///
/// If no document exists, the read will return null.
Future<DocumentSnapshot> 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<dynamic, dynamic> data = await Firestore.channel.invokeMethod(
'DocumentReference#get',
<String, dynamic>{'app': firestore.app.name, 'path': path},
Expand All @@ -94,9 +85,6 @@ class DocumentReference {

/// Deletes the document referred to by this [DocumentReference].
Future<void> 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(
'DocumentReference#delete',
<String, dynamic>{'app': firestore.app.name, 'path': path},
Expand All @@ -120,9 +108,6 @@ class DocumentReference {
StreamController<DocumentSnapshot> controller; // ignore: close_sinks
controller = StreamController<DocumentSnapshot>.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(
'Query#addDocumentListener',
<String, dynamic>{
Expand All @@ -136,9 +121,6 @@ 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(
'Query#removeListener',
<String, dynamic>{'handle': handle},
Expand Down
9 changes: 0 additions & 9 deletions packages/cloud_firestore/lib/src/firestore.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ class Firestore {
final int transactionId = _transactionHandlerId++;
_transactionHandlers[transactionId] = transactionHandler;
final Map<dynamic, dynamic> 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', <String, dynamic>{
'app': app.name,
'transactionId': transactionId,
Expand All @@ -125,9 +122,6 @@ class Firestore {
@deprecated
Future<void> 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', <String, dynamic>{
'app': app.name,
'enable': enable,
Expand All @@ -139,9 +133,6 @@ 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', <String, dynamic>{
'app': app.name,
'persistenceEnabled': persistenceEnabled,
Expand Down
9 changes: 0 additions & 9 deletions packages/cloud_firestore/lib/src/query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ class Query {
StreamController<QuerySnapshot> controller; // ignore: close_sinks
controller = StreamController<QuerySnapshot>.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(
'Query#addSnapshotListener',
<String, dynamic>{
Expand All @@ -70,9 +67,6 @@ 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(
'Query#removeListener',
<String, dynamic>{'handle': handle},
Expand All @@ -86,9 +80,6 @@ class Query {

/// Fetch the documents for this query
Future<QuerySnapshot> 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<dynamic, dynamic> data = await Firestore.channel.invokeMethod(
'Query#getDocuments',
<String, dynamic>{
Expand Down
12 changes: 0 additions & 12 deletions packages/cloud_firestore/lib/src/transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ class Transaction {

Future<DocumentSnapshot> 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', <String, dynamic>{
'app': _firestore.app.name,
'transactionId': _transactionId,
Expand All @@ -33,9 +30,6 @@ class Transaction {

Future<void> 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', <String, dynamic>{
'app': _firestore.app.name,
'transactionId': _transactionId,
Expand All @@ -46,9 +40,6 @@ class Transaction {
Future<void> update(
DocumentReference documentReference, Map<String, dynamic> 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', <String, dynamic>{
'app': _firestore.app.name,
'transactionId': _transactionId,
Expand All @@ -59,9 +50,6 @@ class Transaction {

Future<void> set(
DocumentReference documentReference, Map<String, dynamic> 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', <String, dynamic>{
'app': _firestore.app.name,
'transactionId': _transactionId,
Expand Down
15 changes: 0 additions & 15 deletions packages/cloud_firestore/lib/src/write_batch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ 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(
'WriteBatch#create', <String, dynamic>{'app': _firestore.app.name});

Expand All @@ -32,9 +29,6 @@ class WriteBatch {
if (!_committed) {
_committed = true;
await Future.wait<dynamic>(_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(
'WriteBatch#commit', <String, dynamic>{'handle': await _handle});
} else {
Expand All @@ -47,9 +41,6 @@ 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(
'WriteBatch#delete',
<String, dynamic>{
Expand Down Expand Up @@ -77,9 +68,6 @@ 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(
'WriteBatch#setData',
<String, dynamic>{
Expand All @@ -105,9 +93,6 @@ 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(
'WriteBatch#updateData',
<String, dynamic>{
Expand Down
3 changes: 0 additions & 3 deletions packages/cloud_functions/lib/cloud_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ class CloudFunctions {
{@required String functionName, Map<String, dynamic> 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', <String, dynamic>{
'functionName': functionName,
'parameters': parameters,
Expand Down
Loading

0 comments on commit 7326101

Please sign in to comment.