notifyStatusListeners method

void notifyStatusListeners (AnimationStatus status)

Calls all the status listeners.

If listeners are added or removed during this function, the modifications will not change which listeners are called during this iteration.

Implementation

void notifyStatusListeners(AnimationStatus status) {
  final List<AnimationStatusListener> localListeners = List<AnimationStatusListener>.from(_statusListeners);
  for (AnimationStatusListener listener in localListeners) {
    try {
      if (_statusListeners.contains(listener))
        listener(status);
    } catch (exception, stack) {
      FlutterError.reportError(FlutterErrorDetails(
        exception: exception,
        stack: stack,
        library: 'animation library',
        context: 'while notifying status listeners for $runtimeType',
        informationCollector: (StringBuffer information) {
          information.writeln('The $runtimeType notifying status listeners was:');
          information.write('  $this');
        },
      ));
    }
  }
}