目录

avoid_returning_null_for_future

Avoid returning null for Future.

此规则已从最新的 Dart 版本中移除。

详情

#

NOTE: This rule is removed in Dart 3.3.0; it is no longer functional.

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.

使用方法

#

要启用 avoid_returning_null_for_future 规则,请在你的 analysis_options.yaml 文件中,在 linter > rules 下添加 avoid_returning_null_for_future

analysis_options.yaml
yaml
linter:
  rules:
    - avoid_returning_null_for_future