isAbsolute static method

bool isAbsolute(
  1. String path
)

Checks if a path is absolute

Example:

  • isAbsolute('/path/to/file') returns true
  • isAbsolute('relative/path') returns false

Implementation

static bool isAbsolute(String path) {
  if (path.isEmpty) {
    return false;
  }

  return p.isAbsolute(path);
}