notifyListeners method

void notifyListeners ()

Calls all the listeners.

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

Implementation

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