getStorageRootDirectory method

  1. @override
Future<String?> getStorageRootDirectory()
override

Get the root of the primary external/shared storage.

On Android this returns /storage/emulated/0 (the external storage root). Works across all manufacturers including Xiaomi (MIUI), Samsung (One UI), Huawei (EMUI), and others. Returns null on platforms without this concept.

Implementation

@override
Future<String?> getStorageRootDirectory() async {
  // Web doesn't have a storage root concept
  return null;
}