SnackbarDefaults


Object to hold defaults used by Snackbar

Summary

Public properties

Color

Default background color of the Snackbar

Cmn
Color

Provides a best-effort 'primary' color to be used as the primary color inside a Snackbar.

Cmn

Public properties

backgroundColor

val backgroundColorColor

Default background color of the Snackbar

primaryActionColor

val primaryActionColorColor

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.