void' is not a subtype of type 'RequestAnimationFrameCallbac...">

How to use animation in Dart?

The following code throws an exception "type '([int]) => void' is not a subtype of type 'RequestAnimationFrameCallback' of 'callback'."

 import 'dart:html'; void main() { window.animationFrame.then((time) => print("test")); } 

If I change window.animationFrame.then to window.requestAnimationFrame , everything will work as expected. I don’t understand how Dart futures work?

+4
source share
1 answer

Use looks right.

Either you are using an older version that does not yet implement the behavior specified in the documentation, or just an error. I would like to continue and post the question at http://dartbug.com/new

+1
source

All Articles