next method

Advances this sequence to the next page and then returns getCurrentPage().

You have to check the hasNext property first before you can call next().

Implementation

MessageSequence next() {
  assert(
    hasNext,
    'This paged sequence has no next page. Check hasNext property.',
  );
  _currentPage++;

  return getCurrentPage();
}