fromUri function
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
p.fromUri('file:///path/to/foo') // -> '/path/to/foo'
// Windows
p.fromUri('file:///C:/path/to/foo') // -> r'C:\path\to\foo'
// URL
p.fromUri('https://dart.dev/path/to/foo')
// -> 'https://dart.dev/path/to/foo'
If uri
is relative, a relative path will be returned.
p.fromUri('path/to/foo'); // -> 'path/to/foo'
Implementation
String fromUri(Object? uri) => context.fromUri(uri!);