- protected
Call all the registered listeners.
Call this method whenever the object changes, to notify any clients the object may have. Listeners that are added during this iteration will not be visited. Listeners that are removed during this iteration will not be visited after they are removed.
Exceptions thrown by listeners will be caught and reported using FlutterError.reportError.
Source
@protected void notifyListeners() { if (_listeners != null) { List<VoidCallback> localListeners = new List<VoidCallback>.from(_listeners); for (VoidCallback listener in localListeners) { try { if (_listeners.contains(listener)) listener(); } catch (exception, stack) { FlutterError.reportError(new FlutterErrorDetails( exception: exception, stack: stack, library: 'foundation library', context: 'while dispatching notifications for $runtimeType', informationCollector: (StringBuffer information) { information.writeln('The $runtimeType sending notification was:'); information.write(' $this'); } )); } } } }