Skip to content

Instantly share code, notes, and snippets.

@sergei-mikhailovskii-idf
Last active October 9, 2022 17:41
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 sergei-mikhailovskii-idf/a856d8fede2ac04e1c99c686964452bd to your computer and use it in GitHub Desktop.
Save sergei-mikhailovskii-idf/a856d8fede2ac04e1c99c686964452bd to your computer and use it in GitHub Desktop.
internal class SnackbarDelegate(
var snackbarHostState: SnackbarHostState? = null,
var coroutineScope: CoroutineScope? = null
) {
fun showSnackbar(
message: String,
actionLabel: String? = null,
duration: SnackbarDuration = SnackbarDuration.Short
) {
coroutineScope?.launch {
snackbarHostState?.showSnackbar(message, actionLabel, duration)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment