findOrPutAsync<S> method

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

Once bakar yoksa koyar

Implementation

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