So, I'm showing a snackbar inside of my Scaffold, using the scaffoldState.snackbarHostState.showSnackbar() method, though the colour of the "Undo" action is dark purple, and I would like to change it to something else.
I know that I can show it as a custom component, though I would like to launch it in a coroutineScope(), which I think is not possible.
My code is like this for the snackbar.
scope.launch {
val result = scaffoldState.snackbarHostState.showSnackbar(
message = "Note Deleted",
actionLabel = "Undo",
)
if (result == SnackbarResult.ActionPerformed) {
viewModel.onEvent(NotesEvent.RestoreNote)
}
}
I would like to know if it's possible to change the text colour of the action here and if yes, it would be cool if you could give an example or a resource.
Thanks!
