ProjectsScreenViewModel

The ProjectsScreenViewModel is useful to manage the lists displayed in the com.tecknobit.pandoro.ui.screens.projects.presenter.ProjectsScreen

Author

N7ghtm4r3 - Tecknobit

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

inDevelopmentProjectsFilter the filters to apply to the inDevelopmentProjectsState list

Link copied to clipboard

inDevelopmentProjectsState the state used to manage the pagination for the retrieveInDevelopmentProjects method

Link copied to clipboard

projectsFilter the filters to apply to the projectsState list

Link copied to clipboard
val projectsState: PaginationState<Int, Project>

projectsState the state used to manage the pagination for the retrieveProjects method

Link copied to clipboard
open override val requestsScope: CoroutineScope

requestsScope coroutine used to send the requests to the backend

Link copied to clipboard
lateinit var sessionFlowState: SessionFlowState

sessionFlowState the state used to manage the session lifecycle in the screen

Link copied to clipboard

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
open override fun areFiltersSet(allItems: Boolean): Boolean

Method to check whether the filters have been set

Link copied to clipboard
open override fun canRetrieverStart(): Boolean
Link copied to clipboard
open override fun clearFilters(allItems: Boolean)

Method to clear filters have been set

Link copied to clipboard
open override fun continueToRetrieve(currentContext: KClass<*>): Boolean
Link copied to clipboard
open fun deleteProject(project: Project, onDelete: () -> Unit, onFailure: (JsonObject) -> Unit)

Method to delete a project

Link copied to clipboard
open override fun filterItems(allItems: Boolean, filters: MutableState<String>, onFiltersSet: () -> Unit)

Method to filter the items list

Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
open override fun restartRetriever()
Link copied to clipboard
open fun restartRetrieverIf(condition: Boolean)
Link copied to clipboard
open override fun retrieve(currentContext: KClass<*>, routine: suspend () -> Unit, repeatRoutine: Boolean, refreshDelay: Long)
Link copied to clipboard
open override fun retryRetrieveLists()

Method to retry the retrieving of the lists data

Link copied to clipboard
open fun setActiveContext(currentContext: KClass<*>)
Link copied to clipboard
fun showSnackbarMessage(message: String, actionLabel: String?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
fun showSnackbarMessage(response: JsonObject, actionLabel: String?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
fun showSnackbarMessage(message: StringResource, actionLabel: StringResource?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
Link copied to clipboard
open override fun suspendRetriever()
Link copied to clipboard
open fun suspendRetrieverIf(condition: Boolean)