setPrefix static method

bool setPrefix(
  1. String prefix, {
  2. Set<String>? allowList,
})

Sets the prefix that is attached to all keys for all shared preferences. Return false if called after SharedPreferences was instantiated.

Implementation

static bool setPrefix(String prefix, {Set<String>? allowList}) {
  // setPrefix cannot be called after getInstance
  final set = !ready();
  if (set) {
    SharedPreferences.setPrefix(prefix, allowList: allowList);
  }
  return set;
}