resetCacheManagers static method

Future<void> resetCacheManagers()

Implementation

static Future<void> resetCacheManagers() async {
  await _mapCacheManager?.emptyCache();
  await _mapCacheManager?.dispose();
  await _weatherCacheManager?.emptyCache();
  await _weatherCacheManager?.dispose();

  // Set underlying cache managers to null, because when they are created,
  // they use the surrounding http client. By always setting it to null,
  // they can use either the mock http client or the live one in tests.
  _mapCacheManager = null;
  _weatherCacheManager = null;
}