setTrackEntryListener method
Implementation
void setTrackEntryListener(TrackEntry entry, AnimationStateListener? listener) {
// Get the animation state from the track entry itself!
final state = entry.animationState;
if (state == null) {
throw StateError('TrackEntry does not have an associated AnimationState');
}
final stateKey = state.nativePtr.address;
final entryKey = entry.nativePtr.address;
final listeners = _trackEntryListeners.putIfAbsent(stateKey, () => {});
if (listener == null) {
listeners.remove(entryKey);
} else {
listeners[entryKey] = listener;
// print('DEBUG: Registered listener for TrackEntry at address: $entryKey for AnimationState at address: $stateKey');
}
}