reloadCache method

Future<void> reloadCache()

Updates cache with latest values from platform.

This should be called before reading any values if the values may have been changed by anything other than this cache instance, such as from another isolate or native code that changes the underlying preference storage directly.

Implementation

Future<void> reloadCache() async {
  _cache.clear();
  _cache.addAll(
      await _platformMethods.getAll(allowList: _cacheOptions.allowList));
}