Unverified Commit 65731f75 authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

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

parent 673c5485
...@@ -20,7 +20,7 @@ import 'platform.dart'; ...@@ -20,7 +20,7 @@ import 'platform.dart';
/// "type" key will be set to the string `_extensionType` to indicate /// "type" key will be set to the string `_extensionType` to indicate
/// that this is a return value from a service extension, and the /// that this is a return value from a service extension, and the
/// "method" key will be set to the full name of the method. /// "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 /// Base class for mixins that provide singleton services (also known as
/// "bindings"). /// "bindings").
...@@ -135,7 +135,7 @@ abstract class BindingBase { ...@@ -135,7 +135,7 @@ abstract class BindingBase {
} }
await reassembleApplication(); await reassembleApplication();
} }
return <String, String>{ return <String, dynamic>{
'value': defaultTargetPlatform 'value': defaultTargetPlatform
.toString() .toString()
.substring('$TargetPlatform.'.length), .substring('$TargetPlatform.'.length),
...@@ -248,7 +248,7 @@ abstract class BindingBase { ...@@ -248,7 +248,7 @@ abstract class BindingBase {
name: name, name: name,
callback: (Map<String, String> parameters) async { callback: (Map<String, String> parameters) async {
await callback(); await callback();
return <String, String>{}; return <String, dynamic>{};
} }
); );
} }
...@@ -279,7 +279,7 @@ abstract class BindingBase { ...@@ -279,7 +279,7 @@ abstract class BindingBase {
callback: (Map<String, String> parameters) async { callback: (Map<String, String> parameters) async {
if (parameters.containsKey('enabled')) if (parameters.containsKey('enabled'))
await setter(parameters['enabled'] == 'true'); 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 { ...@@ -309,7 +309,7 @@ abstract class BindingBase {
callback: (Map<String, String> parameters) async { callback: (Map<String, String> parameters) async {
if (parameters.containsKey(name)) if (parameters.containsKey(name))
await setter(double.parse(parameters[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 { ...@@ -338,7 +338,7 @@ abstract class BindingBase {
callback: (Map<String, String> parameters) async { callback: (Map<String, String> parameters) async {
if (parameters.containsKey('value')) if (parameters.containsKey('value'))
await setter(parameters['value']); await setter(parameters['value']);
return <String, String>{ 'value': await getter() }; return <String, dynamic>{ 'value': await getter() };
} }
); );
} }
...@@ -365,7 +365,7 @@ abstract class BindingBase { ...@@ -365,7 +365,7 @@ abstract class BindingBase {
assert(method == methodName); assert(method == methodName);
dynamic caughtException; dynamic caughtException;
StackTrace caughtStack; StackTrace caughtStack;
Map<String, String> result; Map<String, dynamic> result;
try { try {
result = await callback(parameters); result = await callback(parameters);
} catch (exception, stack) { } catch (exception, stack) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment