enable lint prefer_generic_function_type_aliases (#21680)

This commit is contained in:
Alexandre Ardhuin
2018-09-14 21:06:19 +02:00
committed by GitHub
parent 6c3adcf60f
commit a07d3719a1
133 changed files with 217 additions and 217 deletions

View File

@@ -9,10 +9,10 @@ import 'package:meta/meta.dart';
import 'all_elements.dart';
/// Signature for [CommonFinders.byWidgetPredicate].
typedef bool WidgetPredicate(Widget widget);
typedef WidgetPredicate = bool Function(Widget widget);
/// Signature for [CommonFinders.byElementPredicate].
typedef bool ElementPredicate(Element element);
typedef ElementPredicate = bool Function(Element element);
/// Some frequently used widget [Finder]s.
const CommonFinders find = CommonFinders._();

View File

@@ -865,7 +865,7 @@ class _HasGoodToStringDeep extends Matcher {
///
/// This makes it useful for comparing numbers, [Color]s, [Offset]s and other
/// sets of value for which a metric space is defined.
typedef num DistanceFunction<T>(T a, T b);
typedef DistanceFunction<T> = num Function(T a, T b);
/// The type of a union of instances of [DistanceFunction<T>] for various types
/// T.
@@ -878,7 +878,7 @@ typedef num DistanceFunction<T>(T a, T b);
///
/// 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);
typedef AnyDistanceFunction = num Function(Null a, Null b);
const Map<Type, AnyDistanceFunction> _kStandardDistanceFunctions = <Type, AnyDistanceFunction>{
Color: _maxComponentColorDistance,

View File

@@ -7,7 +7,7 @@ import 'package:stack_trace/stack_trace.dart' as stack_trace;
import 'package:test/test.dart' as test_package;
/// Signature for the [reportTestException] callback.
typedef void TestExceptionReporter(FlutterErrorDetails details, String testDescription);
typedef TestExceptionReporter = void Function(FlutterErrorDetails details, String testDescription);
/// A function that is called by the test framework when an unexpected error
/// occurred during a test.

View File

@@ -113,10 +113,10 @@ class TestPointer {
/// Signature for a callback that can dispatch events and returns a future that
/// completes when the event dispatch is complete.
typedef Future<Null> EventDispatcher(PointerEvent event, HitTestResult result);
typedef EventDispatcher = Future<Null> Function(PointerEvent event, HitTestResult result);
/// Signature for callbacks that perform hit-testing at a given location.
typedef HitTestResult HitTester(Offset location);
typedef HitTester = HitTestResult Function(Offset location);
/// A class for performing gestures in tests.
///

View File

@@ -30,7 +30,7 @@ export 'package:test/test.dart' hide
isInstanceOf; // we have our own wrapper in matchers.dart
/// Signature for callback to [testWidgets] and [benchmarkWidgets].
typedef Future<Null> WidgetTesterCallback(WidgetTester widgetTester);
typedef WidgetTesterCallback = Future<Null> Function(WidgetTester widgetTester);
/// Runs the [callback] inside the Flutter test environment.
///
@@ -656,7 +656,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker
}
}
typedef void _TickerDisposeCallback(_TestTicker ticker);
typedef _TickerDisposeCallback = void Function(_TestTicker ticker);
class _TestTicker extends Ticker {
_TestTicker(TickerCallback onTick, this._onDispose) : super(onTick);