void rejectAllFutures(int code, String reason) { _pendingFutures.forEach((String key, FutureCallback cb) { cb.completer?.completeError(reason); }); }