pickDirectory static method

Future<DirectoryLocation?> pickDirectory()

Displays a dialog for picking a directory. Availabe on Android 21/iOS 13 and above. Use isPickDirectorySupported to check whether the current platform supports pickDirectory or not if you are targeting an older version of Android/iOS.

Returns the path of the picked directory or null if operation was cancelled. Throws exception on error.

Implementation

static Future<DirectoryLocation?> pickDirectory() async {
  final String? uriString = await _channel.invokeMethod('pickDirectory');
  if (uriString == null) return null;
  return DirectoryLocation._(uriString);
}