Is there any way to detect if a certain modifier h...
# compose
e
Is there any way to detect if a certain modifier has been used in a chain? For example, if
aspectRatio
was already used, I don't want to use it again
l
modifier.any { it::class.simpleName == "AspectRatioElement" }
Check out the source code for each modifier extension, sure there will be some kind of "XxxElement" or "XxxModifier".
Or a better means:
Copy code
isDebugInspectorInfoEnabled = true

modifier.any { element ->
    element is InspectableValue && element.nameFallback == "aspectRatio"
}