Merge pull request #1240 from HansMuller/page_storage
PageStorage storage identifier should include the context widget's key
This commit is contained in:
@@ -31,6 +31,10 @@ class _StorageEntryIdentifier {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int get hashCode => hashValues(clientType, scopeKey, hashList(keys));
|
int get hashCode => hashValues(clientType, scopeKey, hashList(keys));
|
||||||
|
|
||||||
|
String toString() {
|
||||||
|
return 'StorageEntryIdentifier($clientType, $scopeKey, ${keys?.join(":")})';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PageStorageBucket {
|
class PageStorageBucket {
|
||||||
@@ -39,6 +43,8 @@ class PageStorageBucket {
|
|||||||
result.clientType = context.widget.runtimeType;
|
result.clientType = context.widget.runtimeType;
|
||||||
Key lastKey = context.widget.key;
|
Key lastKey = context.widget.key;
|
||||||
if (lastKey is! GlobalKey) {
|
if (lastKey is! GlobalKey) {
|
||||||
|
if (lastKey != null)
|
||||||
|
result.addKey(lastKey);
|
||||||
context.visitAncestorElements((Element element) {
|
context.visitAncestorElements((Element element) {
|
||||||
if (element.widget.key is GlobalKey) {
|
if (element.widget.key is GlobalKey) {
|
||||||
lastKey = element.widget.key;
|
lastKey = element.widget.key;
|
||||||
|
|||||||
Reference in New Issue
Block a user