DocumentModel

class DocumentModel(val scope: CoroutineScope = CoroutineScope(Dispatchers.IO), val documentStore: DocumentStore, val documentTypeRepository: DocumentTypeRepository?)

Model that loads documents from a DocumentStore and keeps them updated.

It exposes a kotlinx.coroutines.flow.StateFlow of all documents as DocumentInfo and listens to live updates from the store. If a Document has no cardArt the model creates a default stock cardArt.

Parameters

scope

launches coroutines

documentStore

the DocumentStore which manages Document and Credential instances.

documentTypeRepository

a DocumentTypeRepository with information about document types or null.

Constructors

Link copied to clipboard
constructor(scope: CoroutineScope = CoroutineScope(Dispatchers.IO), documentStore: DocumentStore, documentTypeRepository: DocumentTypeRepository?)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val scope: CoroutineScope