Created
November 9, 2020 23:57
-
-
Save AlabasterAxe/95fd8a7101ee8e927b37883c7fc84d2b to your computer and use it in GitHub Desktop.
Animated rendering code for our dino.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return Scaffold( | |
| appBar: AppBar( | |
| title: Text(widget.title), | |
| ), | |
| body: Stack( | |
| alignment: Alignment.center, | |
| children: [ | |
| AnimatedBuilder( | |
| animation: worldController, | |
| builder: (context, child) { | |
| Rect dinoRect = dino.getRect(screenSize, 0); | |
| return Positioned( | |
| left: dinoRect.left, | |
| top: dinoRect.top, | |
| width: dinoRect.width, | |
| height: dinoRect.height, | |
| child: dino.render(), | |
| ); | |
| }) | |
| ], | |
| ), | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment