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/...'.
}
Copyright© 2013-2019