通过路径生成URI

1634次阅读  |  发布于4年以前

通过路径生成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'.
}

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8