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
| State | Description |
|---|---|
Loading | Config has not yet resolved. Hide or disable any panel-specific controls. |
None | The 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:
| Value | Panel |
|---|---|
EspnScoreboard | Scoreboard |
EspnStats | Stats |
EspnKeyPlays | Key Plays |
Fantasy | Fantasy |
Bets | Bets |
Shop | Shop |
Builder | Builder |
WhatJustHappened | What Just Happened |
HelloWorld | Hello 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.panelsare ordered to match the SDK's own tab bar. - Unknown panel types returned by future SDK versions will not appear in
Available.panels; exhaustivewhenexpressions overMaestroPanelTypemust handle all enum values.
See Also
availablePanels— the property that emits this typeselectedPanel— tracks which panel is currently activedidShowPanel()— navigate to a specific panel