From 568fa07e17bbe0ab8ef5a9c0b00ffcb0c258501a Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Thu, 14 Jan 2016 09:35:39 -0800 Subject: [PATCH] PageStorage storage identifier should include the context widgets key --- packages/flutter/lib/src/widgets/page_storage.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/flutter/lib/src/widgets/page_storage.dart b/packages/flutter/lib/src/widgets/page_storage.dart index 585519e738..520814f153 100644 --- a/packages/flutter/lib/src/widgets/page_storage.dart +++ b/packages/flutter/lib/src/widgets/page_storage.dart @@ -31,6 +31,10 @@ class _StorageEntryIdentifier { return true; } int get hashCode => hashValues(clientType, scopeKey, hashList(keys)); + + String toString() { + return 'StorageEntryIdentifier($clientType, $scopeKey, ${keys?.join(":")})'; + } } class PageStorageBucket { @@ -39,6 +43,8 @@ class PageStorageBucket { result.clientType = context.widget.runtimeType; Key lastKey = context.widget.key; if (lastKey is! GlobalKey) { + if (lastKey != null) + result.addKey(lastKey); context.visitAncestorElements((Element element) { if (element.widget.key is GlobalKey) { lastKey = element.widget.key;