replace<P> static method
Replaces the specified child widget with a new one.
Implementation
static Future<void> replace<P>(P child, {String? tag}) async {
final InstanceInfo info = Get.getInstanceInfo<P>(tag: tag);
final bool permanent = info.isPermanent ?? false;
await delete<P>(tag: tag, force: permanent);
Get.put(child, tag: tag, permanent: permanent);
}