I'm trying to print a Raw Data from esc_pos_utils package put I'm getting this exception
BTException{error: BTError.errorWithMessage, message: can't not found writable characteristic}
This is the function that prepare my data:
static Future<List<int>> getTicket() async {
List<int> list = [];
final profile = await CapabilityProfile.load();
final generator = Generator(PaperSize.mm58, profile);
//create image
ByteData data = await rootBundle.load('assets/images/print_image.png');
final Uint8List bytes = data.buffer.asUint8List();
final image = decodeImage(bytes);
//add image
if (image != null) {
list += generator.image(image);
}
//Thank
list += generator.text(
'Thank You For Visiting Our Shop',
styles: PosStyles(
align: PosAlign.center,
bold: true
),
);
list+=generator.feed(1);
return list;
}
And I print the data like this:
var data = await getTicket();
printInvoice(bytes: Uint8List.fromList(data));
Future<bool> printInvoice({required Uint8List bytes})async{
var printed = await bluetoothManager.writeRawData(bytes);
return printed;
}
I'm trying to print a Raw Data from
esc_pos_utils
package put I'm getting this exceptionBTException{error: BTError.errorWithMessage, message: can't not found writable characteristic}
This is the function that prepare my data:
And I print the data like this: