initialise method

Future initialise()
override

Implementation

Future initialise() {
  _futuresCompleter = Completer();
  _initialiseData();
  // We set busy manually as well because when notify listeners is called to clear error messages the
  // ui is rebuilt and if you expect busy to be true it's not.
  setBusy(true);
  notifyListeners();

  for (var key in futuresMap.keys) {
    runBusyFuture(futuresMap[key]!(), busyObject: key, throwException: true)
        .then((futureData) {
      _dataMap![key] = futureData;
      setBusyForObject(key, false);
      notifyListeners();
      onData(key);
      _incrementAndCheckFuturesCompleted();
    }).catchError((error) {
      setErrorForObject(key, error);
      setBusyForObject(key, false);
      onError(key: key, error: error);
      notifyListeners();
      _incrementAndCheckFuturesCompleted();
    });
  }
  setBusy(false);
  changeSource = false;

  return _futuresCompleter.future;
}