目錄
目錄

Avoid returning null for Future.

This rule is currently deprecated and available as of Dart 2.1.1.

This rule has a quick fix available.

Details

AVOID returning null for Future.

It is almost always wrong to return null for a Future. Most of the time the developer simply forgot to put an async keyword on the function.

Usage

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

linter:
  rules:
    - avoid_returning_null_for_future