public sealed interface ShadowContext
Class responsible for managing shadow related dependencies. This includes creation and caching of various DropShadowPainter and InnerShadowPainter instances based on the provided Shadow.
Functions
createInnerShadowPainter
public fun createInnerShadowPainter(shape: Shape, shadow: Shadow): InnerShadowPainter
Return an InnerShadowPainter instance for the provided shape and shadow. This may return a previously allocated InnerShadowPainter instance for the same parameters, for efficiency. For example, a design system that leverages shadows may have the same properties across multiple UI elements. In this case, the same dependencies for an InnerShadowPainter can be reused.
createDropShadowPainter
public fun createDropShadowPainter(shape: Shape, shadow: Shadow): DropShadowPainter
Return a DropShadowPainter instance for the provided shape and shadow. This may return a previously allocated DropShadowPainter instance for the same parameters, for efficiency. For example, a design system that leverages shadows may have the same properties across multiple UI elements. In this case, the same dependencies for a DropShadowPainter can be reused.
clearCache
public fun clearCache()
Clear all previously cached InnerShadowPainter and DropShadowPainter instances alongside all other shadow dependencies.