Create a dummy value by default for LocalSnackbarDispatcher. (#715)
This should solve the issue with needing to provide a `LocalSnackbarDispatcher` for previews and screenshot tests.
This commit is contained in:
parent
2ce614ae97
commit
679ee301dd
2 changed files with 1 additions and 7 deletions
|
|
@ -59,9 +59,7 @@ class SnackbarDispatcher {
|
|||
}
|
||||
|
||||
/** Used to provide a [SnackbarDispatcher] to composable functions, it's needed for [rememberSnackbarHostState]. */
|
||||
val LocalSnackbarDispatcher = compositionLocalOf<SnackbarDispatcher> {
|
||||
error("No SnackbarDispatcher provided")
|
||||
}
|
||||
val LocalSnackbarDispatcher = compositionLocalOf<SnackbarDispatcher> { SnackbarDispatcher() }
|
||||
|
||||
@Composable
|
||||
fun SnackbarDispatcher.collectSnackbarMessageAsState(): State<SnackbarMessage?> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue