LocalStorePersistentStorage class

Default implementation of PersistentStorage using Localstore package

Implemented types

Properties

currentDatabaseVersion → (String, int)
Name and version number for this type of persistent storage
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
log → Logger
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storedDatabaseVersion Future<(String, int)>
Name and version number for database as stored
no setteroverride

Methods

initialize() Future<void>
Initialize the database - only called when the BaseDownloader is created with this object, which happens when the FileDownloader singleton is instantiated, OR as part of a migration away from this database type.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String collection, [String? identifier]) Future<void>
Removes document with identifier from collection
removePausedTask(String? taskId) Future<void>
Remove paused Task with taskId from storage. If null, remove all
override
removeResumeData(String? taskId) Future<void>
Remove ResumeData with taskId from storage. If null, remove all
override
removeTaskRecord(String? taskId) Future<void>
Remove TaskRecord with taskId from storage. If null, remove all
override
retrieve(String collection, String identifier) Future<Map<String, dynamic>?>
Returns document stored in collection under key identifier as a Map<String, dynamic>, or null if not found
retrieveAll(String collection) Future<Map<String, dynamic>>
Returns all documents in collection as a Map<String, dynamic> keyed by the document identifier, with the value a Map<String, dynamic> representing the document
retrieveAllPausedTasks() Future<List<Task>>
Retrieve all paused Task
override
retrieveAllResumeData() Future<List<ResumeData>>
Retrieve all ResumeData
override
retrieveAllTaskRecords() Future<List<TaskRecord>>
Retrieve all TaskRecord
override
retrievePausedTask(String taskId) Future<Task?>
Retrieve paused Task with taskId, or null if not found
override
retrieveResumeData(String taskId) Future<ResumeData?>
Retrieve ResumeData with taskId, or null if not found
override
retrieveTaskRecord(String taskId) Future<TaskRecord?>
Retrieve TaskRecord with taskId, or null if not found
override
store(Map<String, dynamic> document, String collection, String identifier) Future<void>
Stores Map<String, dynamic> formatted document in collection keyed under identifier
storePausedTask(Task task) Future<void>
Store a paused task, keyed by taskId
override
storeResumeData(ResumeData resumeData) Future<void>
Store ResumeData, keyed by its taskId
override
storeTaskRecord(TaskRecord record) Future<void>
Store a TaskRecord, keyed by taskId
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

metaDataCollection → const String
pausedTasksPath → const String
resumeDataPath → const String
taskRecordsPath → const String