通过路径生成URI

通过路径生成URI

Use the toUri() and fromUri() functions in the path Pub package when converting between a URI and a path.

import 'package:path/path.dart' as path;

main() {
  var uri = path.toUri('http://dartlang.org/samples');
  print(path.fromUri(uri)); // Prints 'http:/dartlang.org/samples'.
}

手机扫码阅读