Skip to content
retention_identity โ€บ Functions โ€บ deriveRetentionKey function

deriveRetentionKey โ€‹

Object deriveRetentionKey({required dynamic module, required dynamic context, Object? explicitKey, Object? parentKey, dynamic args, Map<String, Object?>? extras})

Derive a stable cache key for a Module within the retention system.

The key uniquely identifies a ModuleController within the ModuleRetainer cache. Identical keys cause the retainer to return the same cached controller.

Resolution Order โ€‹

  1. If explicitKey is provided, it is returned as-is.
  2. If the module implements RetentionIdentityProvider, its RetentionIdentityProvider.buildRetentionIdentity is called. A non-null result is returned directly.
  3. Otherwise a composite hash is computed from the module type, the enclosing route, args, parentKey, and extras.