Analyses Screen View Model

class AnalysesScreenViewModel : EquinoxViewModel, ToastsLauncher

The AnalysesScreenViewModel class is the support class used to manage the analyses requests

Author

N7ghtm4r3 - Tecknobit

See also

Retriever.RetrieverWrapper
EquinoxViewModel

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val creatingReport: StateFlow<Boolean>
Link copied to clipboard

customPeriodPickerState the state of the picker used to select a custom dates range

Link copied to clipboard
Link copied to clipboard
val glycemicTrendGroupingDay: StateFlow<GlycemicTrendGroupingDay?>
Link copied to clipboard
val glycemicTrendPeriod: StateFlow<GlycemicTrendPeriod>
Link copied to clipboard
open override var scope: CoroutineScope

toasterState the state used to launch the toasts messages

Link copied to clipboard
lateinit var sessionFlowState: SessionFlowState

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

Link copied to clipboard
Link copied to clipboard
open lateinit override var toasterState: ToasterState

toasterState the state used to launch the toasts messages

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun applyCustomTrendPeriod(allowedPeriod: String, onApply: () -> Unit)

Method used to select the selected custom range dates

Link copied to clipboard
open override fun canRetrieverStart(): Boolean
Link copied to clipboard
open override fun continueToRetrieve(currentContext: KClass<*>): Boolean
Link copied to clipboard
fun createReport(onCreated: () -> Unit)

Method used to request to create a report

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
fun retrieveGlycemicTrend(from: Long? = null, to: Long? = null)

Method used to request the glycemic trend

Link copied to clipboard
fun selectGlycemicGroupingDay(groupingDay: GlycemicTrendGroupingDay)

Method used to apply the new value of the grouping day

Link copied to clipboard
fun selectGlycemicTrendPeriod(period: GlycemicTrendPeriod)

Method used to apply the new value of the trend period

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)
Link copied to clipboard
open fun toastError(error: StringResource, vararg formatArgs: Any)

Method used to toast an error message