requestFuture method

Future<void> requestFuture({
  1. int historyCount = Room.defaultHistoryCount,
  2. StateFilter? filter,
})

Request more future events from the server. historyCount defines how many events should be received maximum. filter allows you to specify a StateFilter object to filter the events, which can include various criteria such as event types (e.g., EventTypes.Message) and other state-related filters. The StateFilter object will have lazyLoadMembers set to true by default, but this can be overridden. This method does not return a value.

Implementation

Future<void> requestFuture({
  int historyCount = Room.defaultHistoryCount,
  StateFilter? filter,
}) async {
  if (allowNewEvent) {
    return; // we shouldn't force to add new events if they will autatically be added
  }

  if (isRequestingFuture) return;
  isRequestingFuture = true;
  await _requestEvents(
    direction: Direction.f,
    historyCount: historyCount,
    filter: filter,
  );
  isRequestingFuture = false;
}