replace<P> static method

void replace<P>(
  1. P child, {
  2. String? tag,
})

Replaces the registered instance of type P with a new child instance.

Delegates to Get.replace, so registrations that a plain delete keeps alive (a fenix factory, a GetxService, or an entry with a pending lateRemove disposal) are evicted and the new child always takes their place.

  • tag Optional tag to identify the instance.

Implementation

static void replace<P>(P child, {String? tag}) =>
    Get.replace<P>(child, tag: tag);