OpfsSidecarStore.forAccount constructor

OpfsSidecarStore.forAccount(
  1. String accountKey
)

A store rooted at accountKey.

accountKey is whatever the host uses to tell one signed-in person from another; it is only ever a directory name here. It may not be empty, and it may not contain a separator — a key that walked up out of its own root would put one person's records where another's are read.

Implementation

factory OpfsSidecarStore.forAccount(String accountKey) {
  if (accountKey.isEmpty ||
      accountKey.contains('/') ||
      accountKey.contains('\\') ||
      accountKey == '.' ||
      accountKey == '..') {
    throw ArgumentError.value(
      accountKey,
      'accountKey',
      'must be a single non-empty path segment',
    );
  }
  return OpfsSidecarStore._(<String>[_rootDirName, accountKey]);
}