Composing Animations and Chaining Animations in Dart's Flutter Framework

in #utopian-io6 years ago (edited)

What Will I Learn?

  • You will learn how to use custom tween animations with custom values
  • You will learn how to chain and compose animations in flutter
  • You will learn how to use an Animated Builder widget

Requirements

Difficulty

  • Intermediate

Description

In this flutter video tutorial, we take a look at how we can create longer more complex animations by chaining and composing different animations together. We can use these various animations and apply them to a single widget to give it multiple dynamic features. Specifically, we look at how we can build out a box animation that first fades in using the opacity widget and property. Next the box rotates around the z axis using the transform property. Then the box moves upwards and to the right which is accomplished by manipulating the margin and edge insets of the box. The box then scales upwards and becomes a larger box before changing from a square into a circle. During this animation, the box also changes colors from red to a deep purple color. At the end of the tutorial, we change the intervals of each of these animations so that they overlap with one another.

We make use of the animated builder widget; a widget that allows us to build out a widget or set of widgets that use animations as a smaller part of the tree. This widget allows us to create a subtree of widgets which is more efficient because we do not need to re-render the entire widget tree every frame. We also make use of some of the custom made tween widgets in the flutter framework; these include the color tween, the edge insets tween and the border radius tween. These tweens automatically take the output of our curve functions and convert it to the proper property that we need for our animation elements.

The source code for this project can be found here

Video Tutorial

Curriculum



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Thank you for moderating my content.

Hey @redart, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Hey @tensor I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Congratulations @tensor, this post is the eighth most rewarded post (based on pending payouts) in the last 12 hours written by a User account holder (accounts that hold between 0.1 and 1.0 Mega Vests). The total number of posts by User account holders during this period was 3988 and the total pending payments to posts in this category was $10056.43. To see the full list of highest paid posts across all accounts categories, click here.

If you do not wish to receive these messages in future, please reply stop to this comment.

Coin Marketplace

STEEM 0.32
TRX 0.11
JST 0.034
BTC 66384.36
ETH 3272.25
USDT 1.00
SBD 4.27