Note View Model
ViewModel for managing UI-related data for notes in a lifecycle-conscious way. This class is responsible for preparing and managing the data for an Activity or a Fragment. It also handles communication with the data layer (NoteDao) for CRUD operations.
Functions
Permanently deletes a note from the database. This operation is performed asynchronously in a coroutine.
Inserts a new note into the database. This operation is performed asynchronously in a coroutine.
Restores a soft-deleted note by setting its 'isDeleted' flag to false. The note is updated in the database. This operation is performed asynchronously in a coroutine.
Marks a note as "soft-deleted" by setting its 'isDeleted' flag to true. The note is updated in the database, not physically removed. This operation is performed asynchronously in a coroutine.