通过路径生成URI

Android社区 收藏文章

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'.
}
相关标签

扫一扫

在手机上阅读