saveDocument method
Implementation
Future<Map> saveDocument(Uint8List? responseBytes, String number, DocumentTypes type) async {
if(responseBytes != null){
if(type == DocumentTypes.pdf){
return await downloadFile(responseBytes, number, 'pdf');
//await Printing.layoutPdf(onLayout: (PdfPageFormat format) async => responseBytes);
} else if (type == DocumentTypes.xml){
return await downloadFile(responseBytes, number, 'xml');
}
}
return {'type': '', 'message': 'empty'};
}