read<P> method Null safety

P? read <P>(
  1. String restorationId

Returns the value of type P that is currently stored in the bucket under the provided restorationId.

Returns null if nothing is stored under that id. Throws, if the value stored under the ID is not of type P.

See also:

  • write, which stores a value in the bucket.
  • remove, which removes a value from the bucket.
  • contains, which checks whether any value is stored under a given restoration ID.


P? read<P>(String restorationId) {
  assert(restorationId != null);
  return _rawValues[restorationId] as P?;