getDirectoryPath method

Future<String?> getDirectoryPath({
  1. String? dialogTitle,
  2. bool lockParentWindow = false,
  3. String? initialDirectory,
})

Selects a directory and returns its absolute path.

On Android, this requires to be running on SDK 21 or above, else won't work. Note: Some Android paths are protected, hence can't be accessed and will return / instead.

dialogTitle can be set to display a custom title on desktop platforms. It will be ignored on Web & IO.

If lockParentWindow is set, the child window (file picker window) will stay in front of the Flutter window until it is closed (like a modal window). This parameter works only on Windows desktop.

initialDirectory can be optionally set to an absolute path to specify where the dialog should open. Only supported on Linux, macOS, and Windows.

Returns null if aborted or if the folder path couldn't be resolved.

Note: Some Android paths are protected, hence can't be accessed and will return / instead.

Implementation

Future<String?> getDirectoryPath({
  String? dialogTitle,
  bool lockParentWindow = false,
  String? initialDirectory,
}) async =>
    throw UnimplementedError('getDirectoryPath() has not been implemented.');