Fixes issue with removing and re-adding a toolbar which is connected to the same TabBarController (#9015)

This commit is contained in:
Viktor Lidholt 2017-03-27 20:12:10 +02:00 committed by Hans Muller
parent 657a4c3fc6
commit e271fa3e76

View File

@ -478,8 +478,10 @@ class _TabBarState extends State<TabBar> {
@override
void dispose() {
if (_controller != null)
if (_controller != null) {
_controller.animation.removeListener(_handleTabControllerAnimationTick);
_controller.removeListener(_handleTabControllerTick);
}
// We don't own the _controller Animation, so it's not disposed here.
super.dispose();
}