isAbsolute property

bool isAbsolute

Returns a bool indicating whether this object's path is absolute.

On Windows, a path is absolute if it starts with \\ or a drive letter between a and z (upper or lower case) followed by :\ or :/. On non-Windows, a path is absolute if it starts with /.

Source

bool get isAbsolute {
  if (Platform.isWindows) {
    return path.startsWith(_absoluteWindowsPathPattern);
  } else {
    return path.startsWith('/');
  }
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-io/FileSystemEntity/isAbsolute.html