read abstract method

FutureOr<PersistedData<EncodedT>?> read(
  1. KeyT key
)

Reads the data associated with key.

If no data is associated with key, this method should return null. Otherwise it should return the data associated with key.

It is fine to return expired data, as NotifierPersistX.persist will handle the expiration logic.

If possible, make this method synchronous. This can enable NotifierPersistX.persist to be synchronous too ; which will allow the persisted data to be available as soon as possible in the UI.

Implementation

FutureOr<PersistedData<EncodedT>?> read(KeyT key);