pathToFile static method

File pathToFile(
  1. String path, [
  2. String? dir
])

Implementation

static File pathToFile(String path, [String? dir]) {
  final file = File(path);

  if (!file.isAbsolute) {
    final newFile = File(
      p.canonicalize(p.join(dir ?? projectDir(), file.path)),
    );
    return newFile;
  }

  return File(p.canonicalize(file.path));
}