getOrDefaultAsync<V> method

Future<V?> getOrDefaultAsync<V>(
  1. String key,
  2. dynamic defaultValue
)

Gets key value. If absent returns defaultValue.

Implementation

Future<V?> getOrDefaultAsync<V>(String key, dynamic defaultValue) async {
  if (isLoaded) return getOrDefault<V>(key, defaultValue);
  return _callLoaded<V?>(() => getOrDefault<V>(key, defaultValue));
}