addListener method Null safety

void addListener(
  1. VoidCallback listener
)

Calls the listener every time the value of the animation changes.

Listeners can be removed with removeListener.

Implementation

void addListener(VoidCallback listener) {
  didRegisterListener();
  _listeners.add(listener);
}