Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScrollController is disposed when parent widget state changes #289

Open
lhengl opened this issue Dec 11, 2024 · 0 comments
Open

ScrollController is disposed when parent widget state changes #289

lhengl opened this issue Dec 11, 2024 · 0 comments

Comments

@lhengl
Copy link

lhengl commented Dec 11, 2024

Describe the bug
Setting state of the parent widget dismounts [ChatListWidget] which disposes scroll controller prematurely, causing the following error:

A ScrollController was used after being disposed.

To Reproduce
Steps to reproduce the behavior:

  1. Create a ChatView inside a StatefulWidget
  2. Update the state of the parent widget - for example update the state of the ChatView from loading to hasMessages and back again.
  3. When the ChatListWidget gets dismounted and disposed, the scrollScroll gets disposed of, even though it still exist in the chatController, which lives rent free in the parent widget's state.

I've created a demo app to this error: https://github.com/lhengl/chatview_errors

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Screen Shot 2024-12-12 at 8 01 14 am

I've created a demo app to this error: https://github.com/lhengl/chatview_errors

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):

  • Device: Samsung Galaxy S20
  • OS: Android 13
  • Browser : N/A
  • Version: N/A

Additional context
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant