getMediaDirPath static method

Future<String> getMediaDirPath()

Implementation

static Future<String> getMediaDirPath() async
{
  Directory? appDocDir = await getExternalStorageDirectory();
  // Construct the path to the Android/media directory
  String storagePath = '${appDocDir!.path}';
  storagePath = storagePath.replaceAll("/data/", "/media/");
  return storagePath;
}