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'. }
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did129459