Skip to main content Open Assistant Open Assistant User Profiles | Virtual Stadium | API Hub
Virtual Stadium Virtual Stadium, Moderation, Engagement Tools, BET
Last updated 2 months ago
Is this site helpful? Load and manage Central Hub user profiles, shared bets, and profile privacy settings.
# Profile Management
CentralHubProfileProvider gives you access to profile details, avatar URLs, shared bets, and privacy updates.
The provider can supply:
User data — username, avatar, bio, and verification state.
Statistics — followers, following, inspirations, and reach.
Shared bets — a user's published bet history.
Privacy settings — whether the user's profile is public or private.
kotlin
class ProfileViewModel : ViewModel (), KoinComponent {
private val profileProvider: CentralHubProfileProvider = get ()
val profileState = profileProvider.profileState
fun loadProfile (userId: String ) {
profileProvider. getUserData (userId)
}
kotlin
@Composable
fun ProfileScreen (
userId: String ,
viewModel: ProfileViewModel = viewModel (),
) {
val state by viewModel.profileState. collectAsStateWithLifecycle ()
LaunchedEffect (userId) {
viewModel. loadProfile (userId)
}
Column {
AsyncImage
# Data Models
# CentralHubProfileState
kotlin
data class CentralHubProfileState (
val user: User ,
val isMyProfile: Boolean ,
val isPrivate: Boolean ,
val isFollowed: Boolean ,
val followersCount: Int ,
val followingCount: Int ,
val inspirations: Int ,
val reach: Int ,
val sharedBets:
fun getAvatarUrl (userId: String ): String {
return profileProvider. getUserAvatarUrl (userId)
}
fun setPrivate () {
profileProvider. setProfileToPrivate (
onSuccess = { /* Profile now private */ },
onFailure = { error -> /* Handle error */ },
)
}
fun setPublic () {
profileProvider. setProfileToPublic (
onSuccess = { /* Profile now public */ },
onFailure = { error -> /* Handle error */ },
)
}
override fun onCleared () {
super . onCleared ()
profileProvider. destroy ()
}
}
(
model = viewModel. getAvatarUrl (state.user.id),
contentDescription = "User avatar" ,
)
Text (state.user.username)
Row {
Text ( "Followers: ${ state.followersCount } " )
Text ( "Following: ${ state.followingCount } " )
Text ( "Inspirations: ${ state.inspirations } " )
Text ( "Reach: ${ state.reach } " )
}
}
}
List
<
BetShare
>,
val loadingStatus: LoadingStatus ,
val followActionLoadingStatus: LoadingStatus ,
)