If you ever use Jetpack Compose, you will probably know how hard it is to use snackbar. Because in Compose, Snackbar require a Host, and a State. Unlike in Android XML, we can just refer any UI part as a snackbar Host, but in Compose, we require specific Component for it so called SnackbarHost which usually placed in a Scaffold Snackbar Slot.
In order to solve this problem, we need a way where we can provide Snackbar Host into the Child composable without the need to pass it as a parameter in composable function. Therefore, we're gonna utilize Compose feature, which is Composition Local Provider that was able to provide specific stuff into it's composable Tree, and we're gonna make a custom class to manage this Queue System utilizing Java LinkedList and a Mutex in order to prevent value loss due to concurrency.
A custom class is required for this in order to make a queue system. Use the code below to achieve the behavior.