reloadAll method

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

Reloads all registered class instances.

If force is set to true, instances marked as permanent will also be reloaded.

Example:

// Reloads all instances.
Get.reloadAll();

// Reloads all instances, including permanent ones.
Get.reloadAll(force: true);

Implementation

void reloadAll({bool force = false}) {
  _singl.forEach((key, value) {
    if (value.permanent && !force) {
      Get.log('Instance "$key" is permanent. Skipping reload');
    } else {
      value.dependency = null;
      value.isInit = false;
      Get.log('Instance "$key" was reloaded.');
    }
  });
}