prefer_async_callback

SeverityQuick FixOptions
Info

Details

PREFER using the built-in typedef AsyncCallback instead of declaring a custom one.

Bad
final Future<void> Function() cb;
Good
final AsyncCallback cb;

Usage

To enable the prefer_async_callback rule, add prefer_async_callback under custom_lint > rules in your analysis_options.yaml file:

custom_lint:
  rules:
    - prefer_async_callback