public void writeState(BuildContext context, object data, object identifier = null) { this._storage = this._storage ?? new Dictionary <object, object>(); if (identifier != null) { this._storage[identifier] = data; } else { _StorageEntryIdentifier contextIdentifier = this._computeIdentifier(context); if (contextIdentifier.isNotEmpty) { this._storage[contextIdentifier] = data; } } }
public object readState(BuildContext context, object identifier = null) { if (this._storage == null) { return(null); } if (identifier != null) { return(this._storage[identifier]); } _StorageEntryIdentifier contextIdentifier = this._computeIdentifier(context); return(contextIdentifier.isNotEmpty ? this._storage[contextIdentifier] : null); }
public object readState(BuildContext context, object identifier = null) { if (_storage == null) { return(null); } if (identifier != null) { return(_storage.getOrDefault(identifier)); } _StorageEntryIdentifier contextIdentifier = _computeIdentifier(context); return(contextIdentifier.isNotEmpty ? _storage.getOrDefault(contextIdentifier) : null); }