addCallback method

  1. @override
void addCallback(
  1. ValueGetter<Future<bool>> callback
)

Register the callback to be called when the object changes.

If other callbacks have already been registered, they must be removed (with removeCallback) before the callback is next called.

Implementation

@override
void addCallback(ValueGetter<Future<bool>> callback) {
  if (!hasCallbacks) {
    WidgetsBinding.instance.addObserver(this);
  }
  super.addCallback(callback);
}