fromUri method
- Object? uri
Returns the path represented by uri
, which may be a String or a Uri.
For POSIX and Windows styles, uri
must be a file:
URI. For the URL
style, this will just convert uri
to a string.
// POSIX
context.fromUri('file:///path/to/foo')
// -> '/path/to/foo'
// Windows
context.fromUri('file:///C:/path/to/foo')
// -> r'C:\path\to\foo'
// URL
context.fromUri('https://dart.dev/path/to/foo')
// -> 'https://dart.dev/path/to/foo'
If uri
is relative, a relative path will be returned.
path.fromUri('path/to/foo'); // -> 'path/to/foo'
Implementation
String fromUri(Object? uri) => style.pathFromUri(_parseUri(uri!));