You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin calls .dispose() on the ScrollController argument it receives.
This means the obvious usage pattern is now wrong:
class_MyWidgetStateextendsState<MyWidget> {
ScrollController _myController;
@overridevoidinitState() {
super.initState();
_myController =ScrollController();
}
@overridevoiddispose() {
// Wrong, because this plugin wants me *not* to dispose my own controller!
_myController.dispose();
super.dispose();
}
@overrideWidgetbuild() {
returnFadingEdgeScrollView.fromScrollView(child: ... _myController ...);
}
}
This is surprising: If I'm supposed to create the controller and pass it in, it should also be my job to dispose it. This is the way it works everywhere else in Flutter.
So, I think you should not dispose the controller and let the user control its lifetime instead. This user ran into the same problem and would probably agree.
Thank you!
The text was updated successfully, but these errors were encountered:
This plugin calls
.dispose()
on the ScrollController argument it receives.This means the obvious usage pattern is now wrong:
This is surprising: If I'm supposed to create the controller and pass it in, it should also be my job to dispose it. This is the way it works everywhere else in Flutter.
So, I think you should not dispose the controller and let the user control its lifetime instead. This user ran into the same problem and would probably agree.
Thank you!
The text was updated successfully, but these errors were encountered: