createFileAsBytes function
Create a direct child document of parentUri
.
mimeType
is the type of document following this specs.displayName
is the name of the document, must be a valid file name.bytes
is 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 directoryUri = '$parentUri';
final args = <String, dynamic>{
'mimeType': mimeType,
'content': bytes,
'displayName': displayName,
'directoryUri': directoryUri,
};
return invokeMapMethod('createFile', args);
}