Create Team View Model

class CreateTeamViewModel(snackbarHostState: SnackbarHostState) : CreateItemViewModel<Team> , RecompositionsLocker

The CreateTeamViewModel class is the support class used by CreateTeamScreen to communicate with the backend for the creation or the editing of a Team

Author

N7ghtm4r3 - Tecknobit

Parameters

snackbarHostState

: the host to launch the snackbar messages

See also

ViewModel
FetcherManager.FetcherManagerWrapper
EquinoxViewModel

Constructors

Link copied to clipboard
constructor(snackbarHostState: SnackbarHostState)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val itemDedicatedList: SnapshotStateList<String>

itemDedicatedList -> a dedicated list of the item, useful to manage for example links, collections or members list attached to the item

Link copied to clipboard
lateinit var itemDescription: MutableState<String>

itemDescription -> the description of the item

Link copied to clipboard
lateinit var itemDescriptionError: MutableState<Boolean>

itemDescriptionError -> whether the itemDescription field is not valid

Link copied to clipboard
lateinit var itemName: MutableState<String>

itemName -> the name of the item

Link copied to clipboard
lateinit var logoPic: MutableState<String>

logoPic -> the logo picture of the team

Link copied to clipboard
val potentialMembers: StateFlow<SnapshotStateList<Team.RefyTeamMember>>

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
open override fun canRefresherStart(): Boolean
Link copied to clipboard
open override fun continueToFetch(currentContext: Class<*>): Boolean
Link copied to clipboard
open override fun execRefreshingRoutine(currentContext: Class<*>, routine: () -> Unit, repeatRoutine: Boolean, refreshDelay: Long)
Link copied to clipboard

Function to execute the request to fetch the potentials member for the team

Link copied to clipboard
Link copied to clipboard
open override fun initExistingItem(item: Team?)

Function to initializing the existingItem if exists, null otherwise

Link copied to clipboard
open fun lastCanGoes(counter: Int): Boolean

Function to decree if the counter value reached the threshold of the LAST_CAN_GOES_VALUE

Link copied to clipboard
fun manageItem(onSuccess: () -> Unit)

Wrapper function to execute the request to create or edit an item

Link copied to clipboard
open override fun reset()

Function to reset the counter to zero

Link copied to clipboard
open override fun restartRefresher()
Link copied to clipboard
open fun setActiveContext(currentContext: Class<*>)
Link copied to clipboard
open override fun suspendRefresher()

Function to suspend the current refreshRoutine to execute other requests to the backend, the isRefreshing instance will be set as false to allow the restart of the routine after executing the other requests

Link copied to clipboard
fun SuspendUntilElementOnScreen(elementVisible: MutableState<Boolean>)