How do I drive an animation loop at 60fps with Dart and the web?
问题 How do I drive an animation loop or game loop at 60fps in a Dart web application? 回答1: Use window.animationFrame , the Future-based cousin of the traditional window.requestAnimationFrame . Dart has been shifting to use Future and Stream as more object-oriented ways to handle asynchronous operations. The callback-based (old 'n busted) requestAnimationFrame is replaced by the Future-based (new hotness) animationFrame . Here is a sample: import 'dart:html'; gameLoop(num delta) { // do stuff