Skip to content

Instantly share code, notes, and snippets.

@enyciaa
Created December 5, 2021 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enyciaa/4ca00dd00c8f6b125524b04b1cfefb19 to your computer and use it in GitHub Desktop.
Save enyciaa/4ca00dd00c8f6b125524b04b1cfefb19 to your computer and use it in GitHub Desktop.
screen-template-3
@Composable
fun MyFabDestination(
myFabScreenViewModel: MyFabScreenViewModel,
) {
LifecycleHandler(myFabScreenViewModel)
val viewState = myFabScreenViewModel.viewStateStream()
.collectAsState(myFabScreenViewModel.defaultViewState())
val onNextClicked =
{ myFabScreenViewModel.onAction(MyFabScreenViewModel.UiAction.NextClicked) }
ScreenTemplate(
screenState = viewState.value.screenState,
screenToolbarViewState = viewState.value.screenToolbarViewState,
screenCallToActionViewState = viewState.value.screenCallToActionViewState,
onCallToActionClicked = onNextClicked,
loadedState = {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center,
) {
Text("Loaded!")
}
}
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment