clear method

Future<void> clear()

Clears the _pagination and fragments.

Implementation

Future<void> clear() async {
  Log.debug('clear()', '$runtimeType($id)');

  for (var e in fragments) {
    e.dispose();
  }
  fragments.clear();

  await _pagination?.clear();

  // [Chat.members] don't change in dialogs or monologs, no need to clear it.
  if (chat.value.isGroup) {
    await members.clear();
  }
}