notifyStatusListeners method Null safety

  1. @protected
void notifyStatusListeners(
  1. 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.


void notifyStatusListeners(AnimationStatus status) {
  final List<AnimationStatusListener> localListeners = List<AnimationStatusListener>.from(_statusListeners);
  for (final AnimationStatusListener listener in localListeners) {
    try {
      if (_statusListeners.contains(listener))
    } catch (exception, stack) {
      InformationCollector? collector;
      assert(() {
        collector = () sync* {
          yield DiagnosticsProperty<AnimationLocalStatusListenersMixin>(
            'The $runtimeType notifying status listeners was',
            style: DiagnosticsTreeStyle.errorProperty,
        return true;
        exception: exception,
        stack: stack,
        library: 'animation library',
        context: ErrorDescription('while notifying status listeners for $runtimeType'),
        informationCollector: collector,