Enable use_function_type_syntax_for_parameters lint (#77163)
This commit is contained in:
committed by
GitHub
parent
8f9c6af2dd
commit
7b251f5f37
@@ -40,8 +40,8 @@ void macroPerfTest(
|
||||
{ Duration pageDelay,
|
||||
Duration duration = const Duration(seconds: 3),
|
||||
Duration timeout = kTimeout,
|
||||
Future<void> driverOps(FlutterDriver driver),
|
||||
Future<void> setupOps(FlutterDriver driver),
|
||||
Future<void> Function(FlutterDriver driver) driverOps,
|
||||
Future<void> Function(FlutterDriver driver) setupOps,
|
||||
}) {
|
||||
test(testName, () async {
|
||||
Timeline timeline;
|
||||
|
||||
@@ -115,7 +115,7 @@ class FakeProcessManager extends Mock implements ProcessManager {
|
||||
|
||||
/// A fake process that can be used to interact with a process "started" by the FakeProcessManager.
|
||||
class FakeProcess extends Mock implements Process {
|
||||
FakeProcess(ProcessResult result, {void stdinResults(String input)})
|
||||
FakeProcess(ProcessResult result, {void Function(String input) stdinResults})
|
||||
: stdoutStream = Stream<List<int>>.value((result.stdout as String).codeUnits),
|
||||
stderrStream = Stream<List<int>>.value((result.stderr as String).codeUnits),
|
||||
desiredExitCode = result.exitCode,
|
||||
|
||||
@@ -30,7 +30,7 @@ final List<String> baseApkFiles = <String> [
|
||||
];
|
||||
|
||||
/// Runs the given [testFunction] on a freshly generated Flutter project.
|
||||
Future<void> runProjectTest(Future<void> testFunction(FlutterProject project)) async {
|
||||
Future<void> runProjectTest(Future<void> Function(FlutterProject project) testFunction) async {
|
||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_gradle_plugin_test.');
|
||||
final FlutterProject project = await FlutterProject.create(tempDir, 'hello');
|
||||
|
||||
@@ -42,7 +42,7 @@ Future<void> runProjectTest(Future<void> testFunction(FlutterProject project)) a
|
||||
}
|
||||
|
||||
/// Runs the given [testFunction] on a freshly generated Flutter plugin project.
|
||||
Future<void> runPluginProjectTest(Future<void> testFunction(FlutterPluginProject pluginProject)) async {
|
||||
Future<void> runPluginProjectTest(Future<void> Function(FlutterPluginProject pluginProject) testFunction) async {
|
||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_gradle_plugin_test.');
|
||||
final FlutterPluginProject pluginProject = await FlutterPluginProject.create(tempDir, 'aaa');
|
||||
|
||||
@@ -54,7 +54,7 @@ Future<void> runPluginProjectTest(Future<void> testFunction(FlutterPluginProject
|
||||
}
|
||||
|
||||
/// Runs the given [testFunction] on a freshly generated Flutter module project.
|
||||
Future<void> runModuleProjectTest(Future<void> testFunction(FlutterModuleProject moduleProject)) async {
|
||||
Future<void> runModuleProjectTest(Future<void> Function(FlutterModuleProject moduleProject) testFunction) async {
|
||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_gradle_module_test.');
|
||||
final FlutterModuleProject moduleProject = await FlutterModuleProject.create(tempDir, 'hello_module');
|
||||
|
||||
|
||||
@@ -514,7 +514,7 @@ Future<String> findJavaHome() async {
|
||||
return path.dirname(path.dirname(javaBinary));
|
||||
}
|
||||
|
||||
Future<T> inDirectory<T>(dynamic directory, Future<T> action()) async {
|
||||
Future<T> inDirectory<T>(dynamic directory, Future<T> Function() action) async {
|
||||
final String previousCwd = cwd;
|
||||
try {
|
||||
cd(directory);
|
||||
@@ -629,7 +629,7 @@ Iterable<String> grep(Pattern pattern, {@required String from}) {
|
||||
/// } catch (error, chain) {
|
||||
///
|
||||
/// }
|
||||
Future<void> runAndCaptureAsyncStacks(Future<void> callback()) {
|
||||
Future<void> runAndCaptureAsyncStacks(Future<void> Function() callback) {
|
||||
final Completer<void> completer = Completer<void>();
|
||||
Chain.capture(() async {
|
||||
await callback();
|
||||
|
||||
@@ -78,7 +78,7 @@ class DessertDataSource extends DataTableSource {
|
||||
Dessert('Coconut slice and KitKat', 677, 41.0, 72, 8.5, 63, 12, 12),
|
||||
];
|
||||
|
||||
void _sort<T>(Comparable<T> getField(Dessert d), bool ascending) {
|
||||
void _sort<T>(Comparable<T> Function(Dessert d) getField, bool ascending) {
|
||||
_desserts.sort((Dessert a, Dessert b) {
|
||||
if (!ascending) {
|
||||
final Dessert c = a;
|
||||
@@ -156,7 +156,7 @@ class _DataTableDemoState extends State<DataTableDemo> {
|
||||
bool _sortAscending = true;
|
||||
final DessertDataSource _dessertsDataSource = DessertDataSource();
|
||||
|
||||
void _sort<T>(Comparable<T> getField(Dessert d), int columnIndex, bool ascending) {
|
||||
void _sort<T>(Comparable<T> Function(Dessert d) getField, int columnIndex, bool ascending) {
|
||||
_dessertsDataSource._sort<T>(getField, ascending);
|
||||
setState(() {
|
||||
_sortColumnIndex = columnIndex;
|
||||
|
||||
@@ -53,7 +53,7 @@ class TestAssetBundle extends AssetBundle {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<T> loadStructuredData<T>(String key, Future<T> parser(String value)) async {
|
||||
Future<T> loadStructuredData<T>(String key, Future<T> Function(String value) parser) async {
|
||||
return parser(await loadString(key));
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ class _LiveWidgetController extends LiveWidgetController {
|
||||
bool frameSync = true;
|
||||
|
||||
/// Waits until at the end of a frame the provided [condition] is [true].
|
||||
Future<void> _waitUntilFrame(bool condition(), [Completer<void>? completer]) {
|
||||
Future<void> _waitUntilFrame(bool Function() condition, [Completer<void>? completer]) {
|
||||
completer ??= Completer<void>();
|
||||
if (!condition()) {
|
||||
SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
|
||||
|
||||
@@ -182,7 +182,7 @@ class CardCollectionState extends State<CardCollection> {
|
||||
});
|
||||
}
|
||||
|
||||
Widget buildDrawerCheckbox(String label, bool value, void callback(), { bool enabled = true }) {
|
||||
Widget buildDrawerCheckbox(String label, bool value, void Function() callback, { bool enabled = true }) {
|
||||
return ListTile(
|
||||
onTap: enabled ? callback : null,
|
||||
title: Text(label),
|
||||
|
||||
@@ -313,7 +313,7 @@ void createSearchMetadata(String templatePath, String metadataPath) {
|
||||
/// specified, for each source/destination file pair.
|
||||
///
|
||||
/// Creates `destDir` if needed.
|
||||
void copyDirectorySync(Directory srcDir, Directory destDir, [void onFileCopied(File srcFile, File destFile)]) {
|
||||
void copyDirectorySync(Directory srcDir, Directory destDir, [void Function(File srcFile, File destFile) onFileCopied]) {
|
||||
if (!srcDir.existsSync())
|
||||
throw Exception('Source directory "${srcDir.path}" does not exist, nothing to copy');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user