printBill method
Implementation
Future<PrintResult> printBill({
int width = 580,
int height = 0,
}) async {
String? filePath;
var count = 0;
do {
count++;
filePath = await _captureWidget();
} while (filePath == null && count < 5);
if (filePath == null) {
throw Exception('Error while capturing screenshot.');
}
return await posPrinter.print(
filePath,
width: width,
height: height,
);
}