From 09df603a399fddedc142679edbc55d3036514d89 Mon Sep 17 00:00:00 2001 From: mem3Dealer <43483419+mem3Dealer@users.noreply.github.com> Date: Fri, 8 Jan 2021 22:09:37 +0300 Subject: [PATCH] damn animations --- lib/main.dart | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 71ad4e5..9b9923a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -23,7 +23,7 @@ class AppState extends State with SingleTickerProviderStateMixin { void initState() { super.initState(); _controller = AnimationController( - duration: Duration(seconds: 3), + duration: Duration(seconds: 9), vsync: this, ); } @@ -37,7 +37,7 @@ class AppState extends State with SingleTickerProviderStateMixin { Future _startAnim() async { try { await _controller.forward().orCancel; - await _controller.reverse().orCancel; + // await _controller.reverse().orCancel; } on TickerCanceled { print('welp we fucked'); } @@ -81,10 +81,43 @@ class AppState extends State with SingleTickerProviderStateMixin { class MovingHole extends StatelessWidget { MovingHole({Key key, this.controller}) - : width = Tween(begin: 50.0, end: 150.0).animate(CurvedAnimation( - parent: controller, - curve: Interval(0.0, 1, curve: Curves.fastOutSlowIn))), - height = Tween(begin: 50.0, end: 150.0).animate(CurvedAnimation( + : width = TweenSequence( + >[ + TweenSequenceItem( + tween: Tween(begin: 100, end: 150) + .chain(CurveTween(curve: Curves.ease)), + weight: 33.0, + ), + TweenSequenceItem( + tween: Tween(begin: 150, end: 200), + weight: 33.0, + ), + TweenSequenceItem( + tween: Tween(begin: 200, end: 300) + .chain(CurveTween(curve: Curves.ease)), + weight: 33.0, + ), + ], + ).animate(CurvedAnimation( + parent: controller, curve: Interval(0.0, 1, curve: Curves.linear))), + height = TweenSequence( + >[ + TweenSequenceItem( + tween: Tween(begin: 100, end: 150) + .chain(CurveTween(curve: Curves.ease)), + weight: 40.0, + ), + TweenSequenceItem( + tween: Tween(begin: 150, end: 200), + weight: 20.0, + ), + TweenSequenceItem( + tween: Tween(begin: 200, end: 300) + .chain(CurveTween(curve: Curves.ease)), + weight: 40.0, + ), + ], + ).animate(CurvedAnimation( parent: controller, curve: Interval(0.0, 1, curve: Curves.fastOutSlowIn))), radius = BorderRadiusTween(