loadCache method

Future<void> loadCache()

Load SharedPreferences cache

Implementation

Future<void> loadCache() async {
  try {
    final prefs = await SharedPreferences.getInstance();
    final allPrefsKeys = prefs.getKeys();
    for (final pkey in allPrefsKeys) {
      if (pkey.startsWith(_rcCachePrefix)) {
        final key = pkey.substring(_rcCachePrefix.length);
        final v = prefs.getString(pkey);
        if (v != null) _cache[key] = v;
      }
    }
  } catch (e) {
    debugPrint("Cache load error: $e");
  }
}