Attempt to fix flutter drive --preview-dart-2 errors. (#14897)

This commit is contained in:
Alexander Aprelev 2018-03-02 15:16:46 -08:00 committed by GitHub
parent 673c5485ae
commit 65731f75bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ import 'platform.dart';
/// "type" key will be set to the string `_extensionType` to indicate
/// that this is a return value from a service extension, and the
/// "method" key will be set to the full name of the method.
typedef Future<Map<String, String>> ServiceExtensionCallback(Map<String, String> parameters);
typedef Future<Map<String, dynamic>> ServiceExtensionCallback(Map<String, String> parameters);
/// Base class for mixins that provide singleton services (also known as
/// "bindings").
@ -135,7 +135,7 @@ abstract class BindingBase {
}
await reassembleApplication();
}
return <String, String>{
return <String, dynamic>{
'value': defaultTargetPlatform
.toString()
.substring('$TargetPlatform.'.length),
@ -248,7 +248,7 @@ abstract class BindingBase {
name: name,
callback: (Map<String, String> parameters) async {
await callback();
return <String, String>{};
return <String, dynamic>{};
}
);
}
@ -279,7 +279,7 @@ abstract class BindingBase {
callback: (Map<String, String> parameters) async {
if (parameters.containsKey('enabled'))
await setter(parameters['enabled'] == 'true');
return <String, String>{ 'enabled': await getter() ? 'true' : 'false' };
return <String, dynamic>{ 'enabled': await getter() ? 'true' : 'false' };
}
);
}
@ -309,7 +309,7 @@ abstract class BindingBase {
callback: (Map<String, String> parameters) async {
if (parameters.containsKey(name))
await setter(double.parse(parameters[name]));
return <String, String>{ name: (await getter()).toString() };
return <String, dynamic>{ name: (await getter()).toString() };
}
);
}
@ -338,7 +338,7 @@ abstract class BindingBase {
callback: (Map<String, String> parameters) async {
if (parameters.containsKey('value'))
await setter(parameters['value']);
return <String, String>{ 'value': await getter() };
return <String, dynamic>{ 'value': await getter() };
}
);
}
@ -365,7 +365,7 @@ abstract class BindingBase {
assert(method == methodName);
dynamic caughtException;
StackTrace caughtStack;
Map<String, String> result;
Map<String, dynamic> result;
try {
result = await callback(parameters);
} catch (exception, stack) {