createUri static method
This method is supported only on the Android platform. It is used to create a URI for saving a file on the Android device.
The file is saved in the Downloads directory by default, but you can specify a subdirectory within Downloads using the
childDirectoryName parameter. If the childDirectoryName is not provided, the file will be saved directly in the Downloads directory.
The fileName parameter is required to specify the name of the file (e.g., test.pdf).
Example usage:
String? uri = await ComPDFKit.createUri('test.pdf');
fileName(required) specifies the name of the file, for exampletest.pdf.childDirectoryName(optional) specifies a subdirectory within theDownloadsfolder.mimeType(optional) is the MIME type of the file, defaulting toapplication/pdf.
Implementation
static Future<String?> createUri(String fileName,
{String? childDirectoryName, String mimeType = 'application/pdf'}) async {
final String? uri = await _methodChannel.invokeMethod('create_uri', {
'file_name': fileName,
'child_directory_name': childDirectoryName,
'mime_type': mimeType
});
return uri;
}