read<T> method

T read<T>(
  1. String key, [
  2. T? defValue
])

Retrieves a value from the store

Implementation

T read<T>(String key, [T? defValue]) {
  if (this._data[key] == null || this._data[key] is T) {
    return this._data[key] ?? defValue;
  }

  throw FormatException(
      'Store expects a [$T] but got [${this._data[key].runtimeType}]. '
      'It is possible that the key [$key] used is wrong.');
}