clearCompleted method

void clearCompleted()

Clears all completed (LxSuccess or LxIdle) tasks from the state map.

Implementation

void clearCompleted() {
  final keys = tasks.keys
      .where((id) =>
          tasks[id] is LxSuccess ||
          tasks[id] is LxIdle ||
          tasks[id] is LxError)
      .toList();
  for (final id in keys) {
    clearTask(id);
  }
}