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

@@ -11,7 +11,7 @@ import 'package:meta/meta.dart';
import 'run_command.dart';
typedef Future<Null> ShardRunner();
typedef ShardRunner = Future<Null> Function();
final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script))));
final String flutter = path.join(flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');

View File

@@ -175,7 +175,7 @@ class ProcessRunner {
}
}
typedef Future<Uint8List> HttpReader(Uri url, {Map<String, String> headers});
typedef HttpReader = Future<Uint8List> Function(Uri url, {Map<String, String> headers});
/// Creates a pre-populated Flutter archive from a git repo.
class ArchiveCreator {

View File

@@ -9,7 +9,7 @@ import 'package:path/path.dart' as path;
import 'run_command.dart';
typedef Future<Null> ShardRunner();
typedef ShardRunner = Future<Null> Function();
final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script))));
final String flutter = path.join(flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');

View File

@@ -151,7 +151,7 @@ class FakeProcess extends Mock implements Process {
}
/// Callback used to receive stdin input when it occurs.
typedef void StringReceivedCallback(String received);
typedef StringReceivedCallback = void Function(String received);
/// A stream consumer class that consumes UTF8 strings as lists of ints.
class StringStreamConsumer implements StreamConsumer<List<int>> {

View File

@@ -20,7 +20,7 @@ const Duration _kDefaultTaskTimeout = Duration(minutes: 15);
/// Represents a unit of work performed in the CI environment that can
/// succeed, fail and be retried independently of others.
typedef Future<TaskResult> TaskFunction();
typedef TaskFunction = Future<TaskResult> Function();
bool _isTaskRegistered = false;

View File

@@ -122,7 +122,7 @@ CommandArgs cmd({
);
}
typedef dynamic ExitErrorFactory();
typedef ExitErrorFactory = dynamic Function();
class CommandArgs {
CommandArgs({ this.command, this.arguments, this.environment });

View File

@@ -11,7 +11,7 @@ import 'pair.dart';
enum TestStatus { ok, pending, failed, complete }
typedef Future<TestStepResult> TestStep();
typedef TestStep = Future<TestStepResult> Function();
const String nothing = '-';

View File

@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
enum TestStatus { ok, pending, failed, complete }
typedef Future<TestStepResult> TestStep();
typedef TestStep = Future<TestStepResult> Function();
const String nothing = '-';

View File

@@ -396,7 +396,7 @@ class _RectangleDemoState extends State<_RectangleDemo> {
}
}
typedef Widget _DemoBuilder(_ArcDemo demo);
typedef _DemoBuilder = Widget Function(_ArcDemo demo);
class _ArcDemo {
_ArcDemo(this.title, this.builder, TickerProvider vsync)

View File

@@ -92,7 +92,7 @@ class OverlayGeometryApp extends StatefulWidget {
OverlayGeometryAppState createState() => OverlayGeometryAppState();
}
typedef void CardTapCallback(GlobalKey targetKey, Offset globalPosition);
typedef CardTapCallback = void Function(GlobalKey targetKey, Offset globalPosition);
class CardBuilder extends SliverChildDelegate {
CardBuilder({ this.cardModels, this.onTapUp });