getDirectoryPaths function

Future<List<String?>> getDirectoryPaths({
  1. String? initialDirectory,
  2. String? confirmButtonText,
})

Opens a directory selection dialog and returns a list of the paths chosen by the user.

This always returns an empty array on the web.

initialDirectory is the full path to the directory that will be displayed when the dialog is opened. When not provided, the platform will pick an initial location.

confirmButtonText is the text in the confirmation button of the dialog. When not provided, the default OS label is used (for example, "Open").

Returns an empty array if the user cancels the operation.

Implementation

Future<List<String?>> getDirectoryPaths({
  String? initialDirectory,
  String? confirmButtonText,
}) async {
  return FileSelectorPlatform.instance.getDirectoryPaths(
      initialDirectory: initialDirectory, confirmButtonText: confirmButtonText);
}