ProtectedFilesRegistry class abstract interface

Abstraction for managing protected files Protected files are NOT deleted during cleanup operations

Use cases:

  • External files (FileSource) should never be deleted
  • Currently downloading files should be protected
  • Active model files should be protected

Platform implementations:

  • SharedPreferencesProtectedRegistry: uses SharedPreferences
  • InMemoryProtectedRegistry: for testing
Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearAll() Future<void>
Clears all protections
getExternalPath(String filename) Future<String?>
Gets the external path for a filename
getProtectedFiles() Future<List<String>>
Gets all protected files
isProtected(String filename) Future<bool>
Checks if a file is protected
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
protect(String filename) Future<void>
Marks a file as protected from cleanup
registerExternalPath(String filename, String externalPath) Future<void>
Registers an external file path mapping
toString() String
A string representation of this object.
inherited
unprotect(String filename) Future<void>
Removes protection from a file

Operators

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