Pablo
12/15/2022, 2:45 PM@Composable
fun test() {
val scaffoldState = rememberScaffoldState()
val scope = rememberCoroutineScope()
Scaffold(
scaffoldState = scaffoldState,
floatingActionButton = {
var clickCount by remember { mutableStateOf(0) }
ExtendedFloatingActionButton(
text = { Text("Show snackbar") },
onClick = {
// show snackbar as a suspend function
scope.launch {
scaffoldState.snackbarHostState.showSnackbar("Snackbar # ${++clickCount}")
}
}
)
},
content = { innerPadding ->
Text(
text = "Body content",
modifier = Modifier.padding(innerPadding).fillMaxSize().wrapContentSize()
)
}
)
}
Maybe is not compatible with Compose-Desktop?Igor Demin
12/20/2022, 6:09 AMIgor Demin
12/20/2022, 6:12 AMfun main() = singleWindowApplication {
test()
}