isExternalStorageWritable method

  1. @override
Future<bool> isExternalStorageWritable()
override

Implementation

@override
Future<bool> isExternalStorageWritable() async {
  try {
    if (!Platform.isAndroid) throw _unsupportedPlatformException();
    return await methodChannel.invokeMethod<bool>(
          'isExternalStorageWritable',
        ) ??
        false;
  } on PlatformException catch (e) {
    debugPrint(
      'Error checking if external storage is writable: ${e.message}',
    );
    return false;
  }
}