version method

int version(
  1. String fid
)

Implementation

int version(String fid) {
  final dir = p.join(_root, historyDir, fid);
  if (!FileSystemEntity.isDirectorySync(dir)) {
    return 0;
  }
  final items = Directory(dir).listSync();
  final ver = items.map((e) => FileSystemEntity.isDirectorySync(e.path) ? 1 : 0)
      .reduce((v, e) => v + e);
  return ver + 1;
}