flutter-animatedlist

How to animate the items rendered initially using Animated List in flutter

北城以北 提交于 2019-12-13 17:45:51
问题 I am using Animated List in flutter to load a list class, while adding or removing the items, the animation works but when the list is initially loaded, the animation does not work. Is there a way to animate items when initially loading the list. class AnimationTest extends StatefulWidget { @override _AnimationTestState createState() => _AnimationTestState(); } class _AnimationTestState extends State<AnimationTest> with SingleTickerProviderStateMixin { AnimationController _controller;

How to clear all items from an AnimatedList in Flutter

我的梦境 提交于 2019-12-10 17:34:41
问题 I was trying to preproduce all of the update operations on an AnimatedList like I have done for a RecyclerView adapter in Android. But when I got to clearing all of the data, I couldn't figure out how to do it. If I do this setState(() { _data.clear(); }); then the backing data is cleared but the GlobalKey's current state still doesn't know about the change, and there is no clear() method on it. Supplemental code import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class

How to smoothly update a Flutter AnimatedList without using a GlobalKey.currentState?

最后都变了- 提交于 2019-12-07 23:54:22
问题 All examples I have found of inserting items into a Flutter AnimatedList utilize a GlobalKey.currentState to tell the AnimatedList widget that an item has been inserted. Same thing with delete from the list. It is known that in Flutter a GlobalKey's currentState may be null. In my case, I am waiting on a Firebase message to come through. When it appears that message is inserted into the AnimatedList's List data and if one were to follow the prevalent examples shown for AnimatedList one would