How to use animationFrame in Dart?

Issue 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

Continue reading

Cannot query dynamically added elements

Issue In Dart I’m trying to add HTML dynamically in a div element. Note: the mainContainer element is just a div in my HTML code import ‘dart:html’; main() { loadHTML(“web/html/test.html”); } void loadHTML(String fileName) { DivElement div = query(“#mainContainer”); div.children.clear();

Continue reading