Flutter 名称 FutureOr 不是类型,因此不能在 as 表达式中使用

Flutter The name FutureOr isn't a type, so it can't be used in an as expression

将flutter项目升级到null-safety时出现如下错误

    The name 'FutureOr' isn't a type, so it can't be used in an 'as' expression.
Try changing the name to the name of an existing type, or creating a type with the name 'FutureOr'

似乎缺少导入 import 'dart:async';

FutureOr 是 dart:async

的一部分