getCurrentExtentNid method
Current animated extent for the live nid. Hot-path equivalent of
getCurrentExtent; resolves the chain bulk → operation-group →
standalone → fullExtent. Caller must guarantee nid is live and
within range.
Implementation
double getCurrentExtentNid(int nid) {
final fullRaw = _fullExtentByNid[nid];
final full = fullRaw < 0 ? defaultExtent : fullRaw;
// 1. Bulk — nid-keyed mirror skips the keyOfUnchecked + Set.contains
// probe. Under the existing pendingRemoval ⊆ members invariant the
// mirror returns the same answer as `bulk.members.contains(key)`.
final bulk = _bulkAnimationGroup;
if (bulk != null && _isBulkMemberByNid[nid] != 0) {
return full * bulk.value;
}
// 2. Operation group
final opKey = _opGroupKeyByNid[nid];
if (opKey != null) {
final group = _operationGroups[opKey];
if (group != null) {
final key = _nids.keyOfUnchecked(nid);
final member = group.members[key];
if (member != null) {
return member.computeExtent(group.curvedValue, full);
}
}
}
// 3. Standalone
final animation = _standaloneByNid[nid];
if (animation == null) return full;
final t = animationCurve.transform(animation.progress.clamp(0.0, 1.0));
if (animation.targetExtent == _unknownExtent) {
return animation.type == AnimationType.entering
? full * t
: full * (1.0 - t);
}
return lerpDouble(animation.startExtent, animation.targetExtent, t)!;
}