如何在 Dart 中设置当前工作目录?

How to set the current working directory in Dart?

在 dart 控制台应用程序中,如何设置当前工作目录?

import 'dart:io';
... 
Directory.current = new Directory('your/path/here'); 

或者只是

Directory.current = 'your/path/here';

另见 https://api.dartlang.org/133671/dart-io/Directory/current.html