ShadowContext


Class responsible for managing shadow related dependencies. This includes creation and caching of various DropShadowPainter and InnerShadowPainter instances based on the provided DropShadow and InnerShadow parameters

Summary

Public functions

open Unit

Clear all previously cached InnerShadowPainter and DropShadowPainter instances alongside all other shadow dependencies.

Cmn
open DropShadowPainter
createDropShadowPainter(shape: Shape, dropShadow: DropShadow)

Return a DropShadowPainter instance for the provided shape and dropShadow.

Cmn
open InnerShadowPainter
createInnerShadowPainter(shape: Shape, innerShadow: InnerShadow)

Return an InnerShadowPainter instance for the provided shape and innerShadow.

Cmn

Public functions

clearCache

open fun clearCache(): Unit

Clear all previously cached InnerShadowPainter and DropShadowPainter instances alongside all other shadow dependencies.

createDropShadowPainter

open fun createDropShadowPainter(shape: Shape, dropShadow: DropShadow): DropShadowPainter

Return a DropShadowPainter instance for the provided shape and dropShadow. 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.

createInnerShadowPainter

open fun createInnerShadowPainter(shape: Shape, innerShadow: InnerShadow): InnerShadowPainter

Return an InnerShadowPainter instance for the provided shape and innerShadow. 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.