Group: style

Maturity: stable

Dart SDK: >= 2.0.0 • (Linter v0.1.47)

View the Project on GitHub dart-lang/linter

PREFER generic function type aliases.

With the introduction of generic functions, function type aliases (typedef void F()) couldn't express all of the possible kinds of parameterization that users might want to express. Generic function type aliases (typedef F = void Function()) fixed that issue.

For consistancy and readability reasons, it's better to only use one syntax and thus prefer generic function type aliases.


typedef void F();


typedef F = void Function();