It's a good time to also investigate a bit the dart I/O interfaces, especially the one related to files. The dart:io package must be imported to deal with files and directories in Dart.

import 'dart:io';

Enter fullscreen mode

Exit fullscreen mode

A file in Dart is an object instantiated by the File class. This object can be created by simply invoking the default constructor, where its argument will be a String.