How to wait until image(s) loaded in Dart
问题 I have some basic code to load some sprite images, I am using Future.wait to wait until both images are loaded. However this still does not what I exactly want to do, Because I want to assign image width and height to members before It exits. SpaceShip(this.x, this.y) { rocket = new ImageElement(src: "nofire.png"); firingRockets = new ImageElement(src: "fire.png"); var futures = [rocket.onLoad.first, firingRockets.onLoad.first]; Future.wait(futures).then((_) { width = rocket.width; height =