Enable use_function_type_syntax_for_parameters lint (#77163)

This commit is contained in:
Michael Goderbauer
2021-03-04 08:59:17 -08:00
committed by GitHub
parent 8f9c6af2dd
commit 7b251f5f37
68 changed files with 119 additions and 119 deletions

View File

@@ -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;

View File

@@ -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));
}

View File

@@ -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) {