Skip to content

Commit e271fa3

Browse files
vlidholtHans Muller
authored andcommitted
Fixes issue with removing and re-adding a toolbar which is connected to the same TabBarController (flutter#9015)
1 parent 657a4c3 commit e271fa3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/flutter/lib/src/material/tabs.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,10 @@ class _TabBarState extends State<TabBar> {
478478

479479
@override
480480
void dispose() {
481-
if (_controller != null)
481+
if (_controller != null) {
482482
_controller.animation.removeListener(_handleTabControllerAnimationTick);
483+
_controller.removeListener(_handleTabControllerTick);
484+
}
483485
// We don't own the _controller Animation, so it's not disposed here.
484486
super.dispose();
485487
}

0 commit comments

Comments
 (0)