Unverified Commit 1d8ac6d4 authored by Leaf Petersen's avatar Leaf Petersen Committed by GitHub

Remaining code changes for Dart 2.0 SDK roll. (#13741)

* Remaining code changes for Dart 2.0 SDK roll
parent ece737d1
......@@ -498,10 +498,10 @@ Future<Null> _verifyGeneratedPluginRegistrants(String flutterRoot) async {
final Set<String> outOfDate = new Set<String>();
for (String package in packageToRegistrants.keys) {
final Map<File, String> fileToContent = new Map<File, String>.fromIterable(packageToRegistrants[package],
key: (File f) => f,
value: (File f) => f.readAsStringSync(),
);
final Map<File, String> fileToContent = <File, String>{};
for(File f in packageToRegistrants[package]) {
fileToContent[f] = f.readAsStringSync();
}
await _runCommand(flutter, <String>['inject-plugins'],
workingDirectory: package,
printOutput: false,
......
......@@ -552,7 +552,8 @@ class Navigator extends StatefulWidget {
///
/// Returns a [Future] that completes to the `result` value passed to [pop]
/// when the pushed route is popped off the navigator.
static Future<dynamic> push(BuildContext context, Route<dynamic> route) {
@optionalTypeArgs
static Future<T> push<T>(BuildContext context, Route<T> route) {
return Navigator.of(context).push(route);
}
......@@ -913,7 +914,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
///
/// Returns a [Future] that completes to the `result` value passed to [pop]
/// when the pushed route is popped off the navigator.
Future<dynamic> push(Route<dynamic> route) {
Future<Object> push(Route<Object> route) {
assert(!_debugLocked);
assert(() { _debugLocked = true; return true; }());
assert(route != null);
......
......@@ -592,7 +592,20 @@ class _HasGoodToStringDeep extends Matcher {
/// sets of value for which a metric space is defined.
typedef num DistanceFunction<T>(T a, T b);
const Map<Type, DistanceFunction<dynamic>> _kStandardDistanceFunctions = const <Type, DistanceFunction<dynamic>>{
/// The type of a union of instances of [DistanceFunction<T>] for various types
/// T.
///
/// This type is used to describe a collection of [DistanceFunction<T>]
/// functions which have (potentially) unrelated argument types. Since the
/// argument types of the functions may be unrelated, the only thing that the
/// type system can statically assume about them is that they accept null (since
/// all types in Dart are nullable).
///
/// Calling an instance of this type must either be done dynamically, or by
/// first casting it to a [DistanceFunction<T>] for some concrete T.
typedef num AnyDistanceFunction(Null a, Null b);
const Map<Type, AnyDistanceFunction> _kStandardDistanceFunctions = const <Type, AnyDistanceFunction>{
Color: _maxComponentColorDistance,
Offset: _offsetDistance,
int: _intDistance,
......
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