saveBytes static method
Implementation
static Future<void> saveBytes({
required String printName,
required String fileType,
required Uint8List bytes,
String? path,
}) async {
if(Platform.isMacOS || Platform.isWindows || Platform.isLinux || Platform.isFuchsia){
path = await GetFilePicker.saveFile(printName, fileType);
}
else if(path == null && (Platform.isAndroid || Platform.isIOS)){
final appDocDir = await pp.getApplicationDocumentsDirectory();
path = '${appDocDir.path}/$printName.$fileType';
}
else{
path = '$path/$printName.$fileType';
}
await File(path!).writeAsBytes(bytes);
}