In Flutter this can be done using the FutureBuilder widget. It takes three parameters: future: The future that should be waited upon initialData: The data contained in the snapshot parameter of the builder until the future is completed. builder: A function with the signature (BuildContext ...
This is wrong because the AnimationController itself contains some state (the animation value) and by calling forward() we are modifying it. Instead, it only makes sense to call forward() in initState() or inside a callback in response to some user interaction. FutureBuilder & StreamBuilder ...