getExternalStorageDirectories method

  1. @override
Future<List<String>> getExternalStorageDirectories(
  1. String type
)
override

Implementation

@override
Future<List<String>> getExternalStorageDirectories(String type) async {
  try {
    if (!Platform.isAndroid) throw _unsupportedPlatformException();
    final result = await methodChannel.invokeListMethod<String>(
      'getExternalStorageDirectories',
      {'type': type},
    );
    return result ?? [];
  } on PlatformException catch (e) {
    debugPrint('Error getting external storage directories: ${e.message}');
    return [];
  }
}