Flocon/docs/dashboard.md
Raphael Teyssandier 2c42d582e2 feat: Pages
2025-11-27 19:33:22 +01:00

1.9 KiB

📈 Configurable Dashboards (from the mobile app)

Screenshot 2025-09-12 at 15 45 05 Screenshot 2025-09-12 at 15 44 57

Your Android application can define and expose custom dashboards, which Flocon renders dynamically in the desktop interface.

Use cases include:

  • Displaying live business metrics
  • Monitoring app state variables
  • Debugging real-time values (e.g., geolocation, battery, app mode)
  • Real time in-app variables editions
  • Perform from the desktop app mobile callbacks

Dashboards are defined programmatically on the mobile side via the SDK, and they update live as data changes — making them ideal for live demos, QA testing, or in-field diagnostics.

userFlow.collect { user ->
     Flocon.dashboard(id = "main") {
        user?.let {
            section(name = "User") {
                text(label = "username", value = user.userName)
                text(label = "fullName", value = user.fullName, color = Color.Red.toArgb())
                text(label = "user id", value = user.id)
                button(
                    text = "Change User Id",
                    id = "changeUserId",
                    onClick = {
                        userFlow.update { it.copy(userName = "__flo__") }
                    }
                )
                textField(
                    label = "Update Name",
                    placeHolder = "name",
                    id = "changeUserName",
                    value = user.fullName,
                    onSubmitted = { value ->
                        userFlow.update { it.copy(fullName = value) }
                    })
            }
        }
    }
}