tvolkert / chicago

The Chicago widget set for Flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ListView doesn't unregister its listener on the controller when it is detached

Hixie opened this issue · comments

Render objects should not subscribe to anything until they are attached, and should unsubscribe from things when they are detached. RenderListView subscribes when the selectionController property is set, and never unsubscribes.

This means that if you have a ListView that uses a controller, and then you remove it from the rendering, and give the controller to something else, then when the controller changes value, that original ListView will try to dirty itself and throw an exception (because it's disposed and thus should not be mutating itself any more).