andrey-ushakov / esc_pos_printer

ESC/POS (thermal, receipt) printing for Flutter & Dart
BSD 3-Clause "New" or "Revised" License
346 stars 298 forks source link

No print if add image #156

Open 3rdfloordesign opened 2 years ago

3rdfloordesign commented 2 years ago

I have this issue when try to start printing image A value of type 'Image?' can't be assigned to a variable of type 'Image'. This is my piece of code, someone can help me! Please

Schermata 2022-07-28 alle 13 07 59

.

RyanFreitasG4 commented 1 year ago

Hello @3rdfloordesign, the reason for the error described in the image is that it may be null. add the null safety treatment

final Image? image = decodeImage(bytes); or final Image image = decodeImage(bytes)!;