ViewEnvironmentKey

abstract class ViewEnvironmentKey<T : Any>(source)

Defines a value type T that can be provided by a ViewEnvironment map, and specifies its default value.

It is hard to imagine a useful implementation of this that is not a Kotlin object. Preferred use is to have the companion object of T extend this class. See BackStackConfig.Companion for an example.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
abstract val default: T

Defines the default value for this key. It is a grievous error for this value to be dynamic in any way.

Functions

Link copied to clipboard
open fun combine(left: T, right: T): T

Applied from ViewEnvironment.plus when the receiving environment already contains a value for this key. The default implementation replaces left with right.

Link copied to clipboard
operator override fun equals(other: Any?): Boolean
Link copied to clipboard
override fun hashCode(): Int