lazyReplace<P> static method

Future<void> lazyReplace<P>(
  1. InstanceBuilderCallback<P> builder, {
  2. String? tag,
  3. bool? fenix,
})

Lazily replaces the specified child widget with a new one.

Implementation

static Future<void> lazyReplace<P>(
  InstanceBuilderCallback<P> builder, {
  String? tag,
  bool? fenix,
}) async {
  final InstanceInfo info = Get.getInstanceInfo<P>(tag: tag);
  final bool permanent = info.isPermanent ?? false;
  await delete<P>(tag: tag, force: permanent);
  Get.lazyPut(builder, tag: tag, fenix: fenix ?? permanent);
}