Closed busslina closed 5 months ago
Would you be able to provide a minimal reproducible example, where commenting out the keep alive causes it to work, but uncommenting causes it to fail?
Note to future self: I wonder if navigation to the new page causes the previous page to deactivate, causing some sort of issue with the keep alives there (rebuild triggered in deactivate maybe)?
I reproduced it in a simple repo test: https://github.com/busslina/rearch-keep-alive-issue
Fail mode:
flutter run -d windows
No fail mode: Just comment this and execute again.
Thanks, I’ll take a look in a few hours
Looks like the root cause is that the use.data
is being updated in the deactivate listener, which then throws the markNeedsBuild assert. Not sure why this isn't being triggered for the infinite_scroll test right now, but alas.
The solution here is the rawValueWrapper
that I removed before. Annoying, but I'll just hack one together for the keep alive.
You're good at finding the bugs 🐛😆
You're good at finding the bugs 🐛😆
Hehe thanks :)
I confirm https://github.com/GregoryConrad/rearch-dart/pull/200 solves the issue.
I have a
PostsScreen
where I show an undefined number of posts on aScrollable
widget.use.automaticKeepAlive
seems working on preventing not visible children to keep alive.The error came when I leave this screen for another, I got an exception that seems to indicate that a similar issue to https://github.com/GregoryConrad/rearch-dart/discussions/194 is happening. If I comment
use.automaticKeepAlive
, the error dissapears.Error stack trace: