findUnallocatedName method

Future<String> findUnallocatedName(
  1. String path
)

Implementation

Future<String> findUnallocatedName(String path) async {
  if (await exists(path)) {
    int i = 1;
    while (await exists(VPaths.appendName(path, " (copy $i)"))) {
      i++;
    }
    return VPaths.appendName(path, " (copy $i)");
  }

  return path;
}