Instantly share code, notes, and snippets.

Embed
What would you like to do?
class _PriceTabState extends State<PriceTab> with TickerProviderStateMixin {
AnimationController _planeSizeAnimationController;
Animation _planeSizeAnimation;
double get _planeTopPadding => widget.height - _initialPlanePaddingBottom - _planeSize;
double get _planeSize => _planeSizeAnimation.value;
@override
void initState() {
super.initState();
_initSizeAnimations();
_planeSizeAnimationController.forward();
}
@override
void dispose() {
_planeSizeAnimationController.dispose();
super.dispose();
}
Widget _buildPlane() {
return Positioned(
top: _planeTopPadding,
child: Column(
children: <Widget>[
AnimatedPlaneIcon(animation: _planeSizeAnimation),
],
),
);
}
_initSizeAnimations() {
_planeSizeAnimationController = AnimationController(
duration: const Duration(milliseconds: 340),
vsync: this,
);
_planeSizeAnimation = Tween<double>(begin: 60.0, end: 36.0).animate(CurvedAnimation(
parent: _planeSizeAnimationController,
curve: Curves.easeOut,
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment