Our BotStacks SDKs include convenient screen content views, which are essentially multiple components working together under the hood, generally using a State.

The views rely on a State object for driving UI and handling asynchronous updates for saving, creating, and updating. The state will be a required parameter on each View.

They generally can be used for the entire contents on a screen and are drop in capable.

Outlined below are the content views currently available and examples of how to use them.

ChannelSettingsView

This is a screen content view for displaying settings and details for a given Chat channel. This relies on the ChannelSettingsState.

To persist changes to the channel settings, call state.update().

val state = remember(chat) { ChannelSettingsState(chat) }
ChannelSettingsView(state)

For a more detailed API definition, check out the API docs here.

CreateChannelView

This is a screen content view for creating a new Channel. It has a callback to trigger navigation selecting users for the channel. The UI for this screen can be found in SelectChannelUsersView.

To create the channel, call state.create().

val state = remember { CreateChannelState() }
CreateChannelView(state) {
    // go to pick users
}

For a more detailed API definition, check out the API docs here.

EditProfileView

A screen content view for editing the current user.

To trigger an update once modifications are done within the view, simply call state.update().

val state = remember { EditProfileState() }
EditProfileView(state)

For a more detailed API definition, check out the API docs here.

SelectChannelUsersView

This is used in coordination with either a CreateChannelView or a ChannelSettingsView to set or update the users in a given channel.

val state = remember(chat) { ChannelUserSelectionState(chat) }
SelectChannelUsersView(state = state)

For a more detailed API definition, check out the API docs here.

UserDetailsView

val state = remember(user) { UserDetailsState(user) }
UserDetailsView(state = state)

For a more detailed API definition, check out the API docs here.