15
6
PREFER using the built-in typedef AsyncCallback instead of declaring a custom one.
AsyncCallback
final Future<void> Function() cb;
final AsyncCallback cb;
To enable the prefer_async_callback rule, add prefer_async_callback under custom_lint > rules in your analysis_options.yaml file:
prefer_async_callback
analysis_options.yaml
custom_lint: rules: - prefer_async_callback