getAndroidDirectoryFromFolderType method

Future<Directory?> getAndroidDirectoryFromFolderType(
  1. String folderType
)

Implementation

Future<Directory?> getAndroidDirectoryFromFolderType(
    String folderType) async {
  final String? directoryPath = await methodChannel.invokeMethod<String>(
    'getExternalStoragePublicDirectory',
    {'type': folderType},
  );

  if (directoryPath == null) {
    return null;
  }

  return Directory(directoryPath);
}