Flutter名称FutureOr不是类型,因此不能在as表达式中使用
将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