applyElevationOverlayColor property

bool applyElevationOverlayColor
final

Apply a semi-transparent overlay color on Material surfaces to indicate elevation for dark themes.

If useMaterial3 is true, then this flag is ignored as there is a new Material.surfaceTintColor used to create an overlay for Material 3. This flag is meant only for the Material 2 elevation overlay for dark themes.

Material drop shadows can be difficult to see in a dark theme, so the elevation of a surface should be portrayed with an "overlay" in addition to the shadow. As the elevation of the component increases, the overlay increases in opacity. applyElevationOverlayColor turns the application of this overlay on or off for dark themes.

If true and brightness is Brightness.dark, a semi-transparent version of ColorScheme.onSurface will be applied on top of Material widgets that have a ColorScheme.surface color. The level of transparency is based on Material.elevation as per the Material Dark theme specification.

If false the surface color will be used unmodified.

Defaults to false in order to maintain backwards compatibility with apps that were built before the Material Dark theme specification was published. New apps should set this to true for any themes where brightness is Brightness.dark.

See also:

Implementation

final bool applyElevationOverlayColor;