Use Platform.script to get the absolute URI of the script being run in the current isolate.
import 'dart:io' show Platform; main() { // Get the URI of the script being run. var uri = Platform.script; print(uri); // Prints something like '/Users/shailentuli/workspace/...'. // Convert the URI to a path. var path = uri.toFilePath(); print( path); // Prints something like 'file:///Users/shailentuli/workspace/...'. }
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did129455