5

The following code throws the 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 works as expected. Am I misunderstanding how Dart futures work?

Shailen Tuli
  • 13,815
  • 5
  • 40
  • 51
Sydius
  • 13,567
  • 17
  • 59
  • 76

1 Answers1

1

Usage looks right.

Either you are running an older version that doesn't yet implement the behavior that is specified in the documentation or it is simply a bug. I would go ahead and file an issue on http://dartbug.com/new

Florian Loitsch
  • 7,698
  • 25
  • 30