Closed cavedweller closed 2 years ago
Hi @cavedweller, thank you for opening this issue. That seems to be a special case. I will look into your problem in the next days.
Edit: I found some time now :D
Ok I found a workaround for your problem. Maybe not the best solution because the children are rebuilt every time you close and reopen the widget but it enables the behavior for reordering.
The explanation why it is currently not working: It looks like the problem is that the children are built at a time when they are not displayed. This has issues when I calculate their offset. All the children are getting Offset = zero. So if I can make sure that the children are shown, when you tap on the button and the animation is finished, then the calculated offset would be correct.
If you add the following lines to your method media
:
List<Widget> media() {
if (_expandAnimation.value != 1.0) {
return [];
}
...
}
Is that helping you? @cavedweller
Hi @karvulf, thank you so much for the quick response, I really do appreciate itππ
So I added the bit you suggested but it is still blocked from re-ordering. Not sure where I am going wrong here.
The new piece of code is below.
Edit: I am sorry, it does appear to work. I will do a full test tonight when I get home and let you know ππ
Sounds great @cavedweller
@karvulf after much testing it appears that its working perfectly, should I have any issues ill let you know π Thanks again for your time and assistance π
Glad to hear that π @cavedweller
Issue
When adding an animation I can no longer re-order the grid.
Possible cause
I found that it might be the
setState((){})
in the animation listener. If you remove the_expandAnimation.value
in theTransform.scale
and set thescale
to 1, I can re-order due to the animation not being built.Code
```dart import 'package:flutter/material.dart'; import 'package:flutter_reorderable_grid_view/widgets/reorderable_builder.dart'; class Grids extends StatefulWidget { const Grids({Key key}) : super(key: key); @override StateI do apologize that the code is not null-safe
Any assistance will greatly be appreciated π