Skip to main content

MaestroPanelAvailability

Represents the availability state of panels for the current event.

Overview​

MaestroPanelAvailability is a sealed interface returned by MaestroSDK.Instance.availablePanels. It describes whether panel configuration has loaded and, if so, which panel types are available. Use it to conditionally render player-side controls that navigate to specific panels.

Syntax​

sealed interface MaestroPanelAvailability {
data object Loading : MaestroPanelAvailability
data object None : MaestroPanelAvailability
data class Available(val panels: List<MaestroPanelType>) : MaestroPanelAvailability
}

States​

StateDescription
LoadingConfig has not yet resolved. Hide or disable any panel-specific controls.
NoneThe current event has no panels for this platform. Hide panel-specific controls.
Available(panels)One or more panels are available. The panels list contains MaestroPanelType values in the order the SDK's tab bar displays them, already filtered by UserConfig.enabledPanels.

MaestroPanelType values​

MaestroPanelType is an enum that identifies a panel by type. The following values may appear in Available.panels:

ValuePanel
EspnScoreboardScoreboard
EspnStatsStats
EspnKeyPlaysKey Plays
FantasyFantasy
BetsBets
ShopShop
BuilderBuilder
WhatJustHappenedWhat Just Happened
HelloWorldHello World

Example​

import com.lessthan3.maestropanel.ui.topheader.MaestroPanelAvailability
import com.lessthan3.maestropanel.ui.topheader.MaestroPanelType

val availability by sdk.availablePanels.collectAsState(MaestroPanelAvailability.Loading)

when (availability) {
MaestroPanelAvailability.Loading -> { /* show loading indicator */ }
MaestroPanelAvailability.None -> { /* hide panel controls */ }
is MaestroPanelAvailability.Available -> {
val panels = availability.panels
if (MaestroPanelType.EspnStats in panels) {
StatsButton(onClick = { sdk.didShowPanel(MaestroPanelType.EspnStats) })
}
}
}

Notes​

  • Panels in Available.panels are ordered to match the SDK's own tab bar.
  • Unknown panel types returned by future SDK versions will not appear in Available.panels; exhaustive when expressions over MaestroPanelType must handle all enum values.

See Also​