Questions tagged [flutter-animation]

Flutter animations that use tweens or physics-based animations. This also includes any use of AnimationController or implicit animations.

Flutter’s animation support makes it easy to implement a variety of animation types. Many widgets, especially Material widgets, come with the standard motion effects defined in their design spec, but it’s also possible to customize these effects.

Animation types

Animations fall into one of two categories: tween- or physics-based. The following sections explain what these terms mean, and points you to resources where you can learn more. In some cases, the best documentation we currently have is example code in the Flutter gallery.

Tween animation

Short for in-betweening. In a tween animation, the beginning and ending points are defined, as well as a timeline, and a curve that defines the timing and speed of the transition. The framework calculates how to transition from the beginning point to the end point.

Physics-based animation

In physics-based animation, motion is modeled to resemble real-world behavior. When you toss a ball, for example, where and when it lands depends on how fast it was tossed and how far it was from the ground. Similarly, dropping a ball attached to a spring falls (and bounces) differently than dropping a ball attached to a string.

Reference: https://flutter.dev/docs/development/ui/animations

2656 questions
231
votes
22 answers

Programmatically scrolling to the end of a ListView

I have a scrollable ListView where the number of items can change dynamically. Whenever a new item is added to the end of the list, I would like to programmatically scroll the ListView to the end. (e.g., something like a chat message list where new…
yyoon
  • 3,555
  • 3
  • 21
  • 17
90
votes
8 answers

Horizontally scrollable cards with Snap effect in flutter

I want to create a list of cards scrolling horizontally with snap to fit effect when swiped either from left or right. Each card has some spacing between them and fit to screen similar to below image Apart from that these horizontally scrollable…
WitVault
  • 23,445
  • 19
  • 103
  • 133
52
votes
7 answers

how to display animated gif in flutter?

I am trying to display gif in flutter. I am using the code Image(image : NetworkImage(message.image_url)) But it shows error: Another exception was thrown: Exception: HTTP request failed, statusCode: 403,…
Monu Kumar
  • 873
  • 2
  • 8
  • 10
51
votes
10 answers

How to rotate an image using Flutter AnimationController and Transform?

I have star png image and I need to rotate the star using Flutter AnimationController and Transformer. I couldn't find any documents or example for image rotation animation. Any idea How to rotate an image using Flutter AnimationController and…
Nick
  • 4,163
  • 13
  • 38
  • 63
46
votes
4 answers

flutter: animate transition to named route

When I use Navigator.pushNamed(context, "/someRoute");, there is a minimal animation which slides in the new route from the bottom of the screen (on Android, might look different on iOS). How can I add a custom animation to this transition? I found…
lhk
  • 27,458
  • 30
  • 122
  • 201
37
votes
4 answers

Flutter - Animate change on height when child of container renders

I'm trying to recreate something like ExpansionTile but in a Card. When I click the card, its child renders and the card changes its height, so I want to animate that change. I tried using AnimatedContainer and GlobalKey to know the final size of…
Diego Francisco
  • 1,650
  • 1
  • 17
  • 31
35
votes
4 answers

TextField with animated hint / label

I want to implement a form containing TextFields. Each field has a label / hint. I want the hint to animate and become a label when the user starts typing. This is a standard Material design pattern, so I expected it to be implemented by the…
Frank Harper
  • 3,027
  • 3
  • 30
  • 41
34
votes
2 answers

How to change speed of a hero animation in flutter

I have made simple hero animation following instructions from Flutter's website It works as described in the instructions but in my case, I would like it to animate much more slowly from the first to the second screen. do anyone know how to change…
Asger Lorenzen
  • 341
  • 1
  • 3
  • 5
31
votes
5 answers

How to add asset image in app bar as an action icon in Flutter application?

Problem I am trying to add a logout image icon in appbar of flutter screen. I have created a asset folder and created directories images/icons/ and placed icons in them. I have mentioned them in pubspec.yaml file. I tried to implement a asset…
user3831831
29
votes
1 answer

Flutter: Ticker must be disposed before calling super.dispose()

I don't know why this error is appearing in the console box Console message: SplashScreenState created a Ticker via its SingleTickerProviderStateMixin, but at the time dispose() was called on the mixin, that Ticker was still active. The Ticker…
raman raman
  • 1,655
  • 4
  • 22
  • 34
28
votes
6 answers

Error: RenderBox was not laid out, Failed assertion: line 1940 pos 12: 'hasSize'

I can't fix this error RenderBox was not laid out: RenderPointerListener#2b92a relayoutBoundary=up9 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1940 pos 12: 'hasSize'. The relevant…
28
votes
5 answers

Flutter Sortable Drag And Drop ListView

So I'm starting to learn Flutter and would like to use a material design drag and drop list just like the one seen on the material guidelines…
Jared
  • 2,029
  • 5
  • 20
  • 39
27
votes
1 answer

How to add animated transitions when changing Widget on BLoC pattern?

so I was following bloc login tutorial, and while I managed to complete it, I'm still fairly new to Flutter & Dart. There is a portion of the code where, depending on the state, the code returns a different widget, instead of a new Scaffold. Since…
herrmartell
  • 3,057
  • 4
  • 18
  • 27
26
votes
3 answers

What is the alternative to RecyclerView in Flutter?

What is the alternative to Recycle view in flutter I have tried using this code but how to do Animination with listview widget in flutter Is this valid? ListView( children: [ ListTile( leading: Icon(Icons.map), title:…
user3924438
25
votes
3 answers

How to change language of Show date picker in flutter

I would like to change the language from english to french in show date picker, Please find below the code i am using and one like which supposed to solve that but it makes the code not working for this part: new Step( …
1
2 3
99 100