findOrPut<S> method

S findOrPut<S>({
  1. required S createFunction(),
  2. String? tag,
  3. bool permanent = false,
})

Once bakar yoksa koyar

Implementation

S findOrPut<S>({required S Function() createFunction, String? tag, bool permanent = false}) {
  if (Get.isRegistered<S>(tag: tag)) return Get.find<S>(tag: tag);
  return Get.put<S>(createFunction(), tag: tag, permanent: permanent);
}