getDocumentMetadata method
Get file or directory metadata without downloading content
containerId is the iCloud Container Id.
relativePath is the relative path of the item on iCloud
Trailing slashes are allowed for directory paths returned by metadata.
Returns metadata about the item, or null if it doesn't exist.
The map should include isDirectory to distinguish directories.
Implementation
@override
Future<Map<String, dynamic>?> getDocumentMetadata({
required String containerId,
required String relativePath,
}) async {
final result = await methodChannel
.invokeMethod<Map<dynamic, dynamic>?>('getDocumentMetadata', {
'containerId': containerId,
'relativePath': relativePath,
});
if (result == null) return null;
// Convert dynamic map to properly typed map
return result.map((key, value) => MapEntry(key.toString(), value));
}