Object

SnackbarDefaults

Object to hold defaults used by Snackbar

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Common
object SnackbarDefaults

Object to hold defaults used by Snackbar

Properties

Common
val backgroundColor: Color

Default background color of the Snackbar

Common
val primaryActionColor: Color

Provides a best-effort 'primary' color to be used as the primary color inside a Snackbar. Given that Snackbars have an 'inverted' theme, i.e. in a light theme they appear dark, and in a dark theme they appear light, just using Colors.primary will not work, and has incorrect contrast.

If your light theme has a corresponding dark theme, you should instead directly use Colors.primary from the dark theme when in a light theme, and use Colors.primaryVariant from the dark theme when in a dark theme.

When in a light theme, this function applies a color overlay to Colors.primary from MaterialTheme.colors to attempt to reduce the contrast, and when in a dark theme this function uses Colors.primaryVariant.