keyGenerator property

K? Function(T) keyGenerator
final

Generates the cache key of a value. The default one is a deep copy of the value (see deepCopy), so changing a value after the computation doesn't change its cached key. Limit: a map whose types deepCopy can't reproduce isn't copied, so it must not be changed after the computation (or use a custom key generator).

Implementation

final K? Function(T) keyGenerator;