0

What is the best way to animate a widget before it is removed from the widget tree? Is this even possible or are there any alternative solutions?

May
  • 93
  • 7
  • From the widget tree, not sure about it. But you can do animation on destroy Time. It would be better if you can provide minimal snippet what exactly you are trying to archive? – Md. Yeasin Sheikh Jul 27 '22 at 09:57
  • I'm wondering what is the solution in general. You can't animate in a dispose method, that's why I'm not sure how to do it. – May Jul 27 '22 at 10:19
  • You can animate before dispose , also dispose method will call based on scenario like some event user tap on something then it remove, It is not clear what exactly the case for you, – Md. Yeasin Sheikh Jul 27 '22 at 10:21
  • How can I animate before dispose? The parent is operating the widget. The child widget that I want to animate doesn't know anything. Also, I'm not modifying the child directly - when the data changes, the new list is created. A child is part of that list. – May Jul 27 '22 at 10:55
  • I've done by creating temporary data and a variable to notify the child to react on it dispose, You can decorate your logic – Md. Yeasin Sheikh Jul 27 '22 at 10:57
  • I don't understand. You can't animate in a dispose method. Also, when a child is disposed, it can't get any notification from the parent, it will only get removed. – May Jul 27 '22 at 12:47
  • 1
    You can check animatedList, and how to delete item from it – Md. Yeasin Sheikh Jul 27 '22 at 13:22

0 Answers0