DataStorage constructor

DataStorage(
  1. String id, [
  2. DataStorageType storageType = DataStorageType.session
])

Implementation

DataStorage(this.id, [this.storageType = DataStorageType.session]) {
  if (!isValidKeyName(id)) {
    throw ArgumentError('Invalid DataStorage id: $id');
  }

  _simpleStorage = storageType == DataStorageType.persistent
      ? _persistentStorage
      : _sessionStorage;
}