JsonFileRepository<T> class abstract

Repository per memorizzare su una cache basata su file di testo l'identity dell'utente.

Implemented types
Mixed-in types

Constructors

JsonFileRepository({required T fromJson(Map<String, dynamic>), required Map<String, dynamic> toJson(T), required String fileName, String? fileFolder})

Properties

content Future<T?>
Reads the content of the whole object stored inside the persistence system. Returns null if it cannot read the object.
no setteroverride
fromJson → T Function(Map<String, dynamic>)
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toJson Map<String, dynamic> Function(T)
final

Methods

createDirectory(String path, String newFolder) Future<void>
Creates a folder named newFolder inside the path specified by path.
inherited
createDirectorySync(String path, String newFolder) → void
SYNCHRONOUS VERSION
inherited
deleteContent() Future<void>
Removes the object from the persistence system. It can also unmount the persistence system if it is no longer useful.
override
deleteFile(String fileFolder, String fileName) Future<void>
Deletes a file.
inherited
deleteFileSync(String fileFolder, String fileName) → void
SYNCHRONOUS VERSION
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readFromFile(String fileFolder, String fileName, {bool byteMode = false}) Future
Reads from a file and returns the content on the form of a String or Uint8List.
inherited
readFromFileSync(String fileFolder, String fileName, {bool byteMode = false}) → dynamic
Reads from a file and returns the content on the form of a String or Uint8List.
inherited
saveContent(T content) Future<void>
Stores the object content of type T inside the predefined (by the implementer) persistent system.
override
saveToFile(String fileFolder, String fileName, dynamic fileContent, {bool append = false, bool byteMode = false}) Future<void>
Saves on a file (which path is fileFolder/fileName) the content in fileContent.
inherited
saveToFileSync(String fileFolder, String fileName, dynamic fileContent, {bool append = false, bool byteMode = false}) → void
SYNCHRONOUS VERSION
inherited
setFileFolder([String fileFolder = ""]) Future<void>
toString() String
A string representation of this object.
inherited

Operators

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