computeIfPresentAsync method

Future<V> computeIfPresentAsync(
  1. K key,
  2. Future<V> ifPresent(
    1. K key,
    2. V value
    )
)

Implementation

Future<V> computeIfPresentAsync(
    K key, Future<V> Function(K key, V value) ifPresent) async {
  if (containsKey(key)) {
    this[key] = await ifPresent(key, this[key]!);
  }
  return this[key]!;
}