fromUri function

String fromUri (dynamic 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
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('http://dartlang.org/path/to/foo')
  // -> 'http://dartlang.org/path/to/foo'

If uri is relative, a relative path will be returned.

p.fromUri('path/to/foo'); // -> 'path/to/foo'

Implementation

String fromUri(uri) => context.fromUri(uri);