Skip to content

Commit a07d371

Browse files
authored
enable lint prefer_generic_function_type_aliases (flutter#21680)
1 parent 6c3adcf commit a07d371

File tree

133 files changed

+217
-217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+217
-217
lines changed

analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ linter:
128128
- prefer_final_locals
129129
- prefer_foreach
130130
# - prefer_function_declarations_over_variables # not yet tested
131-
# - prefer_generic_function_type_aliases # not yet tested
131+
- prefer_generic_function_type_aliases
132132
- prefer_initializing_formals
133133
# - prefer_interpolation_to_compose_strings # not yet tested
134134
- prefer_is_empty

dev/bots/analyze.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'package:meta/meta.dart';
1111

1212
import 'run_command.dart';
1313

14-
typedef Future<Null> ShardRunner();
14+
typedef ShardRunner = Future<Null> Function();
1515

1616
final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script))));
1717
final String flutter = path.join(flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');

dev/bots/prepare_package.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class ProcessRunner {
175175
}
176176
}
177177

178-
typedef Future<Uint8List> HttpReader(Uri url, {Map<String, String> headers});
178+
typedef HttpReader = Future<Uint8List> Function(Uri url, {Map<String, String> headers});
179179

180180
/// Creates a pre-populated Flutter archive from a git repo.
181181
class ArchiveCreator {

dev/bots/test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:path/path.dart' as path;
99

1010
import 'run_command.dart';
1111

12-
typedef Future<Null> ShardRunner();
12+
typedef ShardRunner = Future<Null> Function();
1313

1414
final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script))));
1515
final String flutter = path.join(flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');

dev/bots/test/fake_process_manager.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class FakeProcess extends Mock implements Process {
151151
}
152152

153153
/// Callback used to receive stdin input when it occurs.
154-
typedef void StringReceivedCallback(String received);
154+
typedef StringReceivedCallback = void Function(String received);
155155

156156
/// A stream consumer class that consumes UTF8 strings as lists of ints.
157157
class StringStreamConsumer implements StreamConsumer<List<int>> {

dev/devicelab/lib/framework/framework.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const Duration _kDefaultTaskTimeout = Duration(minutes: 15);
2020

2121
/// Represents a unit of work performed in the CI environment that can
2222
/// succeed, fail and be retried independently of others.
23-
typedef Future<TaskResult> TaskFunction();
23+
typedef TaskFunction = Future<TaskResult> Function();
2424

2525
bool _isTaskRegistered = false;
2626

dev/devicelab/test/adb_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ CommandArgs cmd({
122122
);
123123
}
124124

125-
typedef dynamic ExitErrorFactory();
125+
typedef ExitErrorFactory = dynamic Function();
126126

127127
class CommandArgs {
128128
CommandArgs({ this.command, this.arguments, this.environment });

dev/integration_tests/channels/lib/src/test_step.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'pair.dart';
1111

1212
enum TestStatus { ok, pending, failed, complete }
1313

14-
typedef Future<TestStepResult> TestStep();
14+
typedef TestStep = Future<TestStepResult> Function();
1515

1616
const String nothing = '-';
1717

dev/integration_tests/platform_interaction/lib/src/test_step.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
88

99
enum TestStatus { ok, pending, failed, complete }
1010

11-
typedef Future<TestStepResult> TestStep();
11+
typedef TestStep = Future<TestStepResult> Function();
1212

1313
const String nothing = '-';
1414

dev/manual_tests/lib/material_arc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ class _RectangleDemoState extends State<_RectangleDemo> {
396396
}
397397
}
398398

399-
typedef Widget _DemoBuilder(_ArcDemo demo);
399+
typedef _DemoBuilder = Widget Function(_ArcDemo demo);
400400

401401
class _ArcDemo {
402402
_ArcDemo(this.title, this.builder, TickerProvider vsync)

0 commit comments

Comments
 (0)