doIfControllerRegister<T> method

void doIfControllerRegister<T>({
  1. String tag = '',
  2. dynamic doIfRegister(
    1. T controller
    )?,
  3. dynamic doIfUnRegister()?,
})

Implementation

void doIfControllerRegister<T>(
    {String tag = '',
    Function(T controller)? doIfRegister,
    Function()? doIfUnRegister}) {
  if (Get.isRegistered<T>(tag: tag)) {
    doIfRegister?.call(Get.find<T>(tag: tag));
  } else {
    doIfUnRegister?.call();
  }
}