We know you have many choices when you fly, I mean animate, in Flutter, so thank you for choosing
AnimatedWidget. Wait, what? No! Flutter has many different animation widgets, but unlike commercial airlines, each type of widget is right for a different type of job. Sure, you can accomplish the same animation in a couple of different ways, but using the right animation widget for the job will make your life much easier.
This article covers why you might want to use
AnimatedWidget versus other animation widgets, and how to use them. Suppose you want to add an animation to your app. This article is part of a series, walking through why you might want to use each type of animation widget. The particular animation you want to do repeats a couple of times or needs to be able to pause and resume in response to something, like a finger tap. …
To make animations in Flutter, there are many different options available. How do you choose the right animation widget? This article, part of our animation series, delves into the best use cases for
TweenAnimationBuilder versus when a different widget is best for the job. The previous article in this series explains just how powerful all the built-in implicit animation widgets are and how much you can accomplish with them.
TweenAnimationBuilder? Suppose you want to create a basic animation: an animation that doesn’t repeat forever and is just one widget or widget tree. Flutter has a convention of naming its implicitly animated widgets
Foo is the name of the property that animates. Don’t believe me? Here’s a sample of built-in, implicitly animated widgets:
AnimatedSwitcher. This set of widgets is impressively powerful, and you can accomplish a lot of your needs just using those.
The key parameter can be found on basically every widget constructor, but their use is less common. Keys preserve state when widgets move around in your widget tree. In practice, this means they can be useful to preserve the user’s scroll location or keep state when modifying a collection.
The following article is adapted from the following video:
If you prefer to listen/watch rather than read, that video should cover all of the same content.
Most of the time… you don’t need keys! Generally, there’s no harm adding them, but it’s also unnecessary and just takes up unnecessary space, just like the new keyword, or declaring types on both the right side and left side of a new variable (I’m looking at you,
Map<Foo, Bar> aMap = Map<Foo, Bar>()). But, if you find yourself adding, removing, or reordering a collection of widgets of the same type that hold some state, using keys is likely in your future! …
Do you want to write an app that can display a web page without having to open your mobile device’s browser? Or maybe you already have a secure payment flow implemented on your website and don’t want to reimplement payment functionality in your mobile app — money can be tricky business and you don’t want to end up accidentally sending half of the payment to the Save the Kraken Fund. Oh, that’s just me? …
Or, how to do fancy scrolling techniques in your mobile app with Flutter
Hello, fearless Flutter fans! Today we’re going to delve into a highly specialized topic — something most app developers can blissfully ignore and create great looking apps without needing to know or understand. Usually if you need to scroll through something, ListView and GridView will do the job. Done and done. But, if you seek deeper knowledge and want to spice up your scrolling abilities: