Open AntonShynkaretskyi opened 1 year ago
I have the same issue with OctoImage https://github.com/Baseflow/octo_image/issues/28
I have the same issue with OctoImage Baseflow/octo_image#28
Meanwhile, if you want a nice alternative, I settled on https://pub.dev/packages/implicitly_animated_reorderable_list_2
@AntonShynkaretskyi Thanks, I will look into it.
You are free to switch to other libraries if you wish, however I point out that this library was created precisely because I felt the other libraries were inadequate and full of bugs, given the complexity behind animating a list. I feel that my library is well programmed and much more robust enough to handle even multiple change requests while animating on virtually infinite lists. Try doing the same with other libraries and you will see the limitations they have. However, this library is still in alpha version, and your input is invaluable in finalizing it.
Getting back to the error, the problem lies in the item measurement when a remove/insert animation occurs. In your builder try providing an equivalent widget that has the same height when AnimatedWidgetBuilderData.measuring = true (as described in the documentation); it will definitely solve the issue. However I will investigate it to find a solution to your problem.
@DavideBelsole Thanks for the provided solution. Indeed, it solved the issue.
I feel that my library is well programmed and much more robust enough to handle even multiple change requests while animating on virtually infinite lists.
That's my impression as well
Getting back to the error, the problem lies in the item measurement when a remove/insert animation occurs. In your builder try providing an equivalent widget that has the same height when AnimatedWidgetBuilderData.measuring = true (as described in the documentation); it will definitely solve the issue.
It does result in the stack trace being gone. But I don't have the real height of the items, and falling back to 60 (as in the example) or any other value makes the animation to jump weirdly
If you don't provide the right height, it's normal for it to jump weirdly, For now, roughly solve it this way so you don't get stuck with your development. In the meantime I have already fixed the issue and in these days I will release several fixes including this one.
Try this for fix the problem:
AutomaticAnimatedListView
( list: data, padding: widget.padding ?? const EdgeInsets.all(16.0), comparator: AnimatedListDiffListComparator (sameItem: widget.sameItem, sameContent: widget.sameContent), itemBuilder: (context, item, data) => data.measuring ? const SizedBox.shrink() : widget.itemBuilder(item), listController: controller, addLongPressReorderable: false, reorderModel: AutomaticAnimatedListReorderModel(data), detectMoves: true, );
I have already fixed the issue and in these days I will release several fixes including this one
@DavideBelsole, could you please release what's ready if it's not too much effort? Thanks :)
@AntonShynkaretskyi Just check for AnimatedWidgetBuilderData.measuring = true and pass dummy equivalent empty layout widget.
If an item in AutomaticAnimatedListView has an SVG image rendered by the
flutter_svg
library, I'm getting exceptions.After a bit of googling it seems to be a more common issue than just with the SVG library. E.g. https://stackoverflow.com/questions/60852896/widget-cannot-be-marked-as-needing-to-build-because-the-framework-is-already-in
The library I'm using is
flutter_svg: ^2.0.1
: https://pub.dev/packages/flutter_svgStack trace:
PS: Thanks for the library, might become an awesome alternative to Android's ListView with auto diff animations :)