From e271fa3e76d3a9f8a4aa8fbe3c8147a85c10da23 Mon Sep 17 00:00:00 2001 From: Viktor Lidholt Date: Mon, 27 Mar 2017 20:12:10 +0200 Subject: [PATCH] Fixes issue with removing and re-adding a toolbar which is connected to the same TabBarController (#9015) --- packages/flutter/lib/src/material/tabs.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index 6e42c2c629..225bbf57a4 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -478,8 +478,10 @@ class _TabBarState extends State { @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(); }