DevToolsState
@Serializable
State representing the current DevTools connection status.
This state can be observed to show connection status in the UI:
@Composable
fun ConnectionIndicator() {
val devToolsState by selectState<DevToolsState>().collectAsState()
when (devToolsState.connectionState) {
ConnectionState.CONNECTED -> Icon(Icons.Check, "Connected")
ConnectionState.CONNECTING -> CircularProgressIndicator()
ConnectionState.DISCONNECTED -> Icon(Icons.Close, "Disconnected")
ConnectionState.ERROR -> Icon(Icons.Error, "Error")
}
}Content copied to clipboard
Constructors
Link copied to clipboard
constructor(connectionState: ConnectionState = ConnectionState.DISCONNECTED, currentServerUrl: String? = null, errorMessage: String? = null)