prefer_void_callback

SeverityQuick FixOptions
Info

Details

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

Bad
final void Function() cb;
Good
final VoidCallback cb;

Usage

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

custom_lint:
  rules:
    - prefer_void_callback