ModifierLocal

Known direct subclasses
ProvidableModifierLocal

ProvidableModifierLocals are ModifierLocals that can be used to provide values using a ModifierLocalProvider.


ModifierLocals provide a means of inter-modifier communication. When a modifier provides a ModifierLocal, it is available to modifiers on the right of the providing modifier for the current layout node. The provided ModifierLocals are also available to layout nodes that are children of the current layout node.

One must create a ModifierLocal instance, which can be referenced by consumers statically. ModifierLocal instances themselves hold no data, and can be thought of as a type-safe identifier for the data being passed to other modifiers to the right of the providing modifier or down the tree. ModifierLocal factory functions take a single parameter: a factory to create a default value in cases where a ModifierLocal is used without a Provider. If this is a situation you would rather not handle, you can throw an error in this factory.

To add a value that can be accessed by other modifiers, create an instance of a ProvidableModifierLocal and add it to the tree by using a modifierLocalProvider. Now other modifiers can access the provided value by using a modifierLocalConsumer.

Summary

Protected constructors

<T : Any?> ModifierLocal(defaultFactory: () -> T)
Cmn

Protected constructors

ModifierLocal

protected <T : Any?> ModifierLocal(defaultFactory: () -> T)