diff --git a/dev/bots/test.dart b/dev/bots/test.dart index d152f35a5a..4e8863eeaa 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -498,10 +498,10 @@ Future _verifyGeneratedPluginRegistrants(String flutterRoot) async { final Set outOfDate = new Set(); for (String package in packageToRegistrants.keys) { - final Map fileToContent = new Map.fromIterable(packageToRegistrants[package], - key: (File f) => f, - value: (File f) => f.readAsStringSync(), - ); + final Map fileToContent = {}; + for(File f in packageToRegistrants[package]) { + fileToContent[f] = f.readAsStringSync(); + } await _runCommand(flutter, ['inject-plugins'], workingDirectory: package, printOutput: false, diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart index 66a1e21bf1..37655c1bad 100644 --- a/packages/flutter/lib/src/widgets/navigator.dart +++ b/packages/flutter/lib/src/widgets/navigator.dart @@ -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 push(BuildContext context, Route route) { + @optionalTypeArgs + static Future push(BuildContext context, Route route) { return Navigator.of(context).push(route); } @@ -913,7 +914,7 @@ class NavigatorState extends State with TickerProviderStateMixin { /// /// Returns a [Future] that completes to the `result` value passed to [pop] /// when the pushed route is popped off the navigator. - Future push(Route route) { + Future push(Route route) { assert(!_debugLocked); assert(() { _debugLocked = true; return true; }()); assert(route != null); diff --git a/packages/flutter_test/lib/src/matchers.dart b/packages/flutter_test/lib/src/matchers.dart index 7279cbe786..33b359bdc5 100644 --- a/packages/flutter_test/lib/src/matchers.dart +++ b/packages/flutter_test/lib/src/matchers.dart @@ -592,7 +592,20 @@ class _HasGoodToStringDeep extends Matcher { /// sets of value for which a metric space is defined. typedef num DistanceFunction(T a, T b); -const Map> _kStandardDistanceFunctions = const >{ +/// The type of a union of instances of [DistanceFunction] for various types +/// T. +/// +/// This type is used to describe a collection of [DistanceFunction] +/// 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] for some concrete T. +typedef num AnyDistanceFunction(Null a, Null b); + +const Map _kStandardDistanceFunctions = const { Color: _maxComponentColorDistance, Offset: _offsetDistance, int: _intDistance,