以下代码抛出异常 "type '([int]) => void' is not a subtype of type 'RequestAnimationFrameCallback' of 'callback'."
import 'dart:html';
void main() {
window.animationFrame.then((time) => print("test"));
}
如果我改变
window.animationFrame.then
至 window.requestAnimationFrame
,一切都按预期工作。我是否误解了 Dart future 的运作方式?
最佳答案
用法看起来不错。
您运行的旧版本尚未实现文档中指定的行为,或者它只是一个错误。我会继续在 http://dartbug.com/new 上提交问题
关于dart - 如何在 Dart 中使用 animationFrame?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15470299/