applyCache static method

void applyCache()

Implementation

static void applyCache() {
  disableCaching();
  for (String key in cache.keys as Iterable<String>) {
    var val = cache[key];
    if (val is bool)
      sharedPreferences!.setBool(key, val);
    else if (val is double)
      sharedPreferences!.setDouble(key, val);
    else if (val is int)
      sharedPreferences!.setInt(key, val);
    else if (val is String)
      sharedPreferences!.setString(key, val);
    else if (val is List<String>) sharedPreferences!.setStringList(key, val);
  }
  clearCache();
}