createFileAsBytes function
Create a direct child document of parentUri.
mimeTypeis the type of document following this specs.displayNameis the name of the document, must be a valid file name.bytesis the content of the document as a list of bytesUint8List.
Returns the created file as a DocumentFile.
Mirror of DocumentFile.createFile
Implementation
Future<DocumentFile?> createFileAsBytes(
Uri parentUri, {
required String mimeType,
required String displayName,
required Uint8List bytes,
}) async {
final String directoryUri = '$parentUri';
final Map<String, dynamic> args = <String, dynamic>{
'mimeType': mimeType,
'content': bytes,
'displayName': displayName,
'directoryUri': directoryUri,
};
return invokeMapMethod('createFile', args);
}