DataStorage constructor
DataStorage(
- String id, [
- 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;
}