How to set the current working directory in Dart?

Issue

In a dart console application, how do I set the current working directory?

Solution

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

or just

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

See also https://api.dartlang.org/133671/dart-io/Directory/current.html

Answered By – Günter Zöchbauer

Answer Checked By – Mary Flores (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *