AnimatedContainer (Flutter Widget of the Week)

Google for Developers · 441K views · 2018 · 1:08

Open on YouTube

Software architecture & designUX & UI designtutorial

Why Stack Overflow recommends it

Stack Overflow users link it when answering Flutter animation questions, as a quick demonstration of how AnimatedContainer animates property changes without hand-written animation controllers.

Recommended by 3 people across 3 different months, 2019 to 2021.

What it is

A roughly one-minute entry in Google's Flutter Widget of the Week series covering the AnimatedContainer widget. It shows how rebuilding the widget with a new property value, such as color, makes Flutter animate the change automatically, with adjustable duration and curve.

What people said

Recommends SEG.Veenstra · 2019-01 · Stack Overflow · on “How to Continue Transform/Rotation? - Dart/Flutter”

You basically want to save the state of the widget so I think you will need to wrap it in a StatefulWidget to be able to do that. ( [LINK] ) To smooth out the animation you could maybe try and use the AnimatedContainer? I haven't used it myself but I think it should be what you need! ( [this video] ) EDIT Okay, I've got it working for you. Offset vector; double startingAngle; double deltaAngle = 0.0; double finalAngle = 0.0; // store the final angle of the object double finalObjectAngle = 0.0; void _onPanStart(DragStartDetails details) { _polarCoordFromGlobalOffset(details.globalPosition); startingAngle = vector.direction; print('START = $startingAngle ==================================='); } voi

Recommends Eishon · 2021-07 · Stack Overflow · on “animate conatiner while changing screen flutter”

Use the AnimatedContainer widget for this. This [this video] is the video explanation from Flutter Devs, about how to do it.

Recommends Muhammed Aydogan · 2021-08 · Stack Overflow · on “Flutter Splash Screen Animation”

Your question is not detailed so all I can do is giving a topic to you to train. Flutter has a nice capability of animating things, but if the animation is too complicated, I prefer pre-built animations like AfterEffect or sth like that. You can possibly do what you want using AnimatedContainer [this video] . But first, you need to gather more than basic animation knowledge in this area, so, here [LINK] is the topic you need to dig..

Cites Hasen · 2019-09 · Stack Overflow · on “How to use an AnimatedContainer for animated transforms (ex. Scale)”

I'm assuming you do support transform now with Animated container since it says so in your widget of the week video on it here: [this video] not sure how's done though.

Cites Midhilaj · 2019-12 · Stack Overflow · on “Flutter AnimatedContainer is not not animating it is showing as normal case”

I am trying to implement AnimatedContaner and i got this idea from this video [this video] But animation is not working as they said in the video. Any idea what is wrong with my code ? Code is added below, please support to solve this. import 'package:flutter/material.dart'; class BillCard extends StatefulWidget { @override _BillCardState createState() => _BillCardState(); } class _BillCardState extends State<BillCard> { //AnimationController _controller; String body = ""; bool expanded = false; @override void initState() { for (int i = 0; i < 100; i++) { body += " body body"; } // _controller = AnimationController(vsync: this); super.initState(); } @override void dispose() { // _controller.dispo

Cites encubos · 2020-04 · Stack Overflow · on “Animating item removal in a grid in Flutter”

You could give a try to use AnimatedContainer I basically change the width from 100 to 0, when the tap event occurs. I also change the list items a little. AnimatedContainer detects that the property width changed and fires the animation. Please try something like this (is not the same as your reference) I commented the items.remove(item) , you need to find a way to really remove the item once the animation is finished (maybe with a timer or future). List<Map<String,dynamic>> items = [ {'id':'11','name':'A','width':100}, {'id':'12','name':'B','width':100}, {'id':'13','name':'C','width':100}, {'id':'14','name':'D','width':100}, {'id':'15','name':'E','width':100}, {'id':'16','name':'F','width'

Cites Baker · 2021-01 · Stack Overflow · on “Animating between provider stream changes”

Animation An AnimatedSwitcher widget (included in SDK, not related to Provider) might suffice to animate between your two widgets showing connected / disconnected states. ( AnimatedContainer [this video] might work as well if you're just switching a color or something else in the constructor argument list of Container.) A key is needed for the child of AnimatedSwitcher [LINK] when the children are of the same class, but differ internally. If they're completely different Types, Flutter knows to animate between the two, but not if they're the same Type. (Has to do with how Flutter analyzes the widget tree looking for needed rebuilds.) Rebuild Only Affected Widgets In the example below, the YellowWi