Team Screen View Model

The TeamScreenViewModel class is the support class used by the com.tecknobit.refy.ui.screens.team.presenter.TeamScreen

Author

N7ghtm4r3 - Tecknobit

Parameters

teamId

The identifier of the team

teamName

The name of the team

See also

Constructors

Link copied to clipboard
constructor(teamId: String, teamName: String)

Properties

Link copied to clipboard
val item: StateFlow<Team?>
Link copied to clipboard
val itemName: StateFlow<String>
Link copied to clipboard
lateinit var keywords: MutableState<String>

keywords the keywords used as filter

Link copied to clipboard
open override val linksState: PaginationState<Int, RefyLink.RefyLinkImpl>

linksState the state used to handle the pagination of the links list

Link copied to clipboard
open override val requestsScope: CoroutineScope

requestsScope the CoroutineScope used to make the requests to the backend

Link copied to clipboard
open lateinit override var sessionFlowState: SessionFlowState

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

Link copied to clipboard
Link copied to clipboard
val teamCollections: PaginationState<Int, LinksCollection>

teamCollections the state used to handle the pagination of the collections shared with the team list

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
open fun attachCollections(team: Team, collections: List<LinksCollection>, afterAttached: () -> Unit)

Method to request to attach collections to the team

Link copied to clipboard
open fun attachLinks(team: Team, links: List<RefyLink.RefyLinkImpl>, afterAttached: () -> Unit)

Method to request to attach links to the team

Link copied to clipboard
open override fun canRetrieverStart(): Boolean
Link copied to clipboard
fun changeMemberRole(member: TeamMember, role: TeamRole, onChange: () -> Unit)

Method to change the role of the member

Link copied to clipboard
open override fun continueToRetrieve(currentContext: KClass<*>): Boolean
Link copied to clipboard
open fun deleteTeam(team: Team, onDelete: () -> Unit)

Method to delete the team

Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun leaveTeam(onLeave: () -> Unit)

Method to leave from the team

Link copied to clipboard
open override fun loadLinks(page: Int)

Method used to load and retrieve the links to append to the linksState

Link copied to clipboard
Link copied to clipboard
open override fun performOnServerOffline()

Routine to perform when the server is currently offline

Link copied to clipboard
open override fun refresh()

Method used to refresh the data displayed by the screen

Link copied to clipboard
open override fun refreshAfterCollectionsAttached()

Method to refresh the data after the collections have been attached

Link copied to clipboard
open override fun refreshAfterLinksAttached()

Method to refresh the data after the links have been attached

Link copied to clipboard
open override fun reload()

Method used to reload the content related to the _item when an error occurred during its retrieving

Link copied to clipboard

Method to remove a collection shared with the team

Link copied to clipboard
open override fun removeLink(link: RefyLink.RefyLinkImpl)

Method to remove a link contained by the _item

Link copied to clipboard
fun removeMember(member: TeamMember, onRemove: () -> Unit)

Method to remove a member

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 retrieveItem()

Method to retrieve the information of the item to display

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)