deleteAll method

void deleteAll({
  1. bool force = false,
})

Deletes all registered class instances and closes any open controllers that implement DisposableInterface.

This method clears the memory by removing all registered instances. If force is set to true, instances marked as permanent will also be deleted.

Example:

// Deletes all instances.
Get.deleteAll();

// Deletes all instances, including permanent ones.
Get.deleteAll(force: true);

Implementation

void deleteAll({bool force = false}) {
  final keys = _singl.keys.toList();
  for (final key in keys) {
    delete(key: key, force: force);
  }
}