Skip to content

Instantly share code, notes, and snippets.

@AlabasterAxe
Created November 9, 2020 23:57
Show Gist options
  • Select an option

  • Save AlabasterAxe/95fd8a7101ee8e927b37883c7fc84d2b to your computer and use it in GitHub Desktop.

Select an option

Save AlabasterAxe/95fd8a7101ee8e927b37883c7fc84d2b to your computer and use it in GitHub Desktop.
Animated rendering code for our dino.
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