From b0e0e65c092708dccd7a2b021ba1e638594dd42b Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Tue, 21 Jul 2015 08:25:49 -0700 Subject: [PATCH] Fixed several typos --- .../flutter/lib/widgets/variable_height_scrollable.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/widgets/variable_height_scrollable.dart b/packages/flutter/lib/widgets/variable_height_scrollable.dart index fcca28242c..ebf47564f3 100644 --- a/packages/flutter/lib/widgets/variable_height_scrollable.dart +++ b/packages/flutter/lib/widgets/variable_height_scrollable.dart @@ -41,8 +41,8 @@ class VariableHeightScrollable extends Scrollable { if (layoutState != source.layoutState) { // Warning: this is unlikely to be what you intended. assert(source.layoutState != null); - layoutState == source.layoutState; layoutState.removeListener(_handleLayoutChanged); + layoutState = source.layoutState; layoutState.addListener(_handleLayoutChanged); } super.syncFields(source); @@ -55,6 +55,11 @@ class VariableHeightScrollable extends Scrollable { scrollBehavior.containerSize = newSize.height; } + void didUnmount() { + layoutState.removeListener(_handleLayoutChanged); + super.didUnmount(); + } + void _handleLayoutChanged() { if (layoutState.didReachLastChild) { scrollBehavior.contentsSize = layoutState.contentsSize;