Romantic Project — How to create the NetFlix logo animation in Flutter
In this article, we would be exploring Flutter animation from scratch. We would learn some core concepts about animation by creating a cover version of the NetFlix logo animation in Flutter.
From Flutter Animations document, Choosing an approach. Yes! You have to imagine in your mind What & How to do … And list them from biggest to smallest.
- Use CustomPaint to draw “N”.
- Separate “N” into 3 lines: |(line1) \(line2) |(line3)
- Draw each line by many sub-lines.
- Each line is drawn by a gradient color that will change from red to transparency at different speeds.
- Starting animation by line3.
- When line3 is at 40%, start line2.
- When line2 is at 40%, start line1.
- Line1 starts to change gradient color from red to many colors.
- When Line1 changed into many colors, start to translate its sub-lines to the left & right sides at different speeds.
- Wrap “N” CustomPainter with a ScaleTransition, from 1 -> 7, and its duration is total duration of 3 lines. Use TweenSequence to split into 2 phases of scaling, first 80% is slow and then faster.
- An AnimationControler to control the whole animation.
- 3 AnimationControllers to control 3 lines.
- Use CurveTween for each of the sub-animations to make more exciting effects.
- Use Gradient Shader to draw a sub-line.
- Use ColorTween to change from red to transparency.
- Changing stops value of Gradient by AnimationController.value to make line changing effect.
- Animations (Explicit, Implicit, Low-level).
- Basic Algorithm for drawing by Canvas.
Yeah! That is my solution to create the NetFlix Logo by basic animations in Flutter. Isn’t it romantic? How about your solution? Feel free to comment below! :D