ste
01/15/2022, 10:03 AMTextSnackBar
which shows a pop-up message over the screen and then disappears) over different screens. There's a TextSnackBarState
that exports the method display(message: String)
.
I don't know which approach I should embrace: (see thread)TextSnackBar
and expose its state via `CompositionLocalProvider`: I can show any message anytime I want to with ease, but achieving custom style/behavior is hard.
2. Declare a "local" `TextSnackBar`: each screen has its own TextSnackbarState
that can be used to display different messages: more code, more nesting, avoids global state but achieving custom style/behavior is hard too.
3. Declare as many TextSnackBar
I need in each screen: if I have two different messages, I need two TextSnackBar
with their own TextSnackBarState
. More code, same nesting as 2), custom style/behavior is easy to do.