ESC/POS (thermal, receipt) printing for Flutter & Dart (Android/iOS)

Last update: Aug 6, 2022

esc_pos_bluetooth

Pub Version

The library allows to print receipts using a Bluetooth printer. For WiFi/Ethernet printers, use esc_pos_printer library.

TODO (PRs are welcomed!)

  • Split byte data into chunks: issue
  • Print QR Codes using the GS ( k command (printing QR code from an image already supported)
  • PDF-417 Barcodes using the GS ( k command
  • Line spacing using the ESC 3 <n> command

How to Help

  • Test your printer and add it in the table: Wifi/Network printer or Bluetooth printer
  • Test and report bugs
  • Share your ideas about what could be improved (code optimization, new features...)
  • PRs are welcomed!

Tested Printers

Here are some printers tested with this library. Please add the models you have tested to maintain and improve this library and help others to choose the right printer.

Generate a Ticket

Simple Ticket with Styles:

Ticket testTicket() {
  final Ticket ticket = Ticket(PaperSize.mm80);

  ticket.text(
      'Regular: aA bB cC dD eE fF gG hH iI jJ kK lL mM nN oO pP qQ rR sS tT uU vV wW xX yY zZ');
  ticket.text('Special 1: àÀ èÈ éÉ ûÛ üÜ çÇ ôÔ',
      styles: PosStyles(codeTable: PosCodeTable.westEur));
  ticket.text('Special 2: blåbærgrød',
      styles: PosStyles(codeTable: PosCodeTable.westEur));

  ticket.text('Bold text', styles: PosStyles(bold: true));
  ticket.text('Reverse text', styles: PosStyles(reverse: true));
  ticket.text('Underlined text',
      styles: PosStyles(underline: true), linesAfter: 1);
  ticket.text('Align left', styles: PosStyles(align: PosAlign.left));
  ticket.text('Align center', styles: PosStyles(align: PosAlign.center));
  ticket.text('Align right',
      styles: PosStyles(align: PosAlign.right), linesAfter: 1);

  ticket.text('Text size 200%',
      styles: PosStyles(
        height: PosTextSize.size2,
        width: PosTextSize.size2,
      ));

  ticket.feed(2);
  ticket.cut();
  return ticket;
}

You can find more examples here: esc_pos_utils.

Print a Ticket

PrinterBluetoothManager printerManager = PrinterBluetoothManager();

printerManager.scanResults.listen((printers) async {
  // store found printers
});
printerManager.startScan(Duration(seconds: 4));

// ...

printerManager.selectPrinter(printer);
final PosPrintResult res = await printerManager.printTicket(testTicket());

print('Print result: ${res.msg}');

For a complete example, check the demo project example/blue.

Troubleshooting

  • If your printer prints only 5%-10% of an image and then stops, or it can't print more than 1 image on the same ticket, or it can't print long tickets, try to ajust queueSleepTimeMs of the PrinterBluetoothManager.printTicket (try 50 or 100ms): printerManager.printTicket(await demoReceipt(paper), queueSleepTimeMs: 50);

Test Print

test receipt

test receipt

GitHub

https://github.com/andrey-ushakov/esc_pos_bluetooth
Comments
  • 1. printerManager.startScan() Errors after 0.4.0 update

    @andrey-ushakov @RangerOfGondor After migrating to Version 0.4.0, when running scan() command, I am getting the following error (with the example code in the repo):

    E/flutter ( 9214): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type 'Null' is not a subtype of type 'bool' in type cast
    E/flutter ( 9214): #0      _$BluetoothDeviceFromJson
    package:flutter_bluetooth_basic/src/bluetooth_device.g.dart:14
    E/flutter ( 9214): #1      new BluetoothDevice.fromJson
    package:flutter_bluetooth_basic/src/bluetooth_device.dart:15
    E/flutter ( 9214): #2      BluetoothManager.scan.<anonymous closure>
    package:flutter_bluetooth_basic/src/bluetooth_manager.dart:94
    E/flutter ( 9214): #3      _MapStream._handleData (dart:async/stream_pipe.dart:213:31)
    E/flutter ( 9214): #4      _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)
    E/flutter ( 9214): #5      _rootRunUnary (dart:async/zone.dart:1436:47)
    E/flutter ( 9214): #6      _CustomZone.runUnary (dart:async/zone.dart:1335:19)
    E/flutter ( 9214): #7      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
    E/flutter ( 9214): #8      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
    E/flutter ( 9214): #9      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
    E/flutter ( 9214): #10     _SyncBroadcastStreamController._sendData (dart:async/broadcast_stream_controller.dart:378:25)
    E/flutter ( 9214): #11     _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:244:5)
    E/flutter ( 9214): #12     _DoStreamSink.add
    package:rxdart/…/transformers/do.dart:40
    E/flutter ( 9214): #13     forwardStream.<anonymous closure>.<anonymous closure>.<anonymous closure>
    package:rxdart/…/utils/forwarding_stream.dart:31
    E/flutter ( 9214): #14     forwardStream.runCatching
    package:rxdart/…/utils/forwarding_stream.dart:21
    E/flutter ( 9214): #15     forwardStream.<anonymous closure>.<anonymous closure>
    package:rxdart/…/utils/forwarding_stream.dart:31
    E/flutter ( 9214): #16     _rootRunUnary (dart:async/zone.dart:1436:47)
    E/flutter ( 9214): #17     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
    E/flutter ( 9214): #18     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
    E/flutter ( 9214): #19     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
    E/flutter ( 9214): #20     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
    E/flutter ( 9214): #21     _SyncBroadcastStreamController._sendData (dart:async/broadcast_stream_controller.dart:378:25)
    E/flutter ( 9214): #22     _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:244:5)
    E/flutter ( 9214): #23     _TakeUntilStreamSink.add
    package:rxdart/…/transformers/take_until.dart:13
    E/flutter ( 9214): #24     forwardStream.<anonymous closure>.<anonymous closure>.<anonymous closure>
    package:rxdart/…/utils/forwarding_stream.dart:31
    E/flutter ( 9214): #25     forwardStream.runCatching
    package:rxdart/…/utils/forwarding_stream.dart:21
    E/flutter ( 9214): #26     forwardStream.<anonymous closure>.<anonymous closure>
    package:rxdart/…/utils/forwarding_stream.dart:31
    E/flutter ( 9214): #27     _rootRunUnary (dart:async/zone.dart:1436:47)
    E/flutter ( 9214): #28     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
    E/flutter ( 9214): #29     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
    E/flutter ( 9214): #30     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
    E/flutter ( 9214): #31     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
    E/flutter ( 9214): #32     _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
    E/flutter ( 9214): #33     _MapStream._handleData (dart:async/stream_pipe.dart:218:10)
    E/flutter ( 9214): #34     _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)
    E/flutter ( 9214): #35     _rootRunUnary (dart:async/zone.dart:1436:47)
    E/flutter ( 9214): #36     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
    E/flutter ( 9214): #37     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
    E/flutter ( 9214): #38     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
    E/flutter ( 9214): #39     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
    E/flutter ( 9214): #40     _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
    E/flutter ( 9214): #41     _WhereStream._handleData (dart:async/stream_pipe.dart:195:12)
    E/flutter ( 9214): #42     _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)
    E/flutter ( 9214): #43     _rootRunUnary (dart:async/zone.dart:1436:47)
    E/flutter ( 9214): #44     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
    E/flutter ( 9214): #45     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
    E/flutter ( 9214): #46     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
    E/flutter ( 9214): #47     _DelayedData.perform (dart:async/stream_impl.dart:591:14)
    E/flutter ( 9214): #48     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11)
    #49     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:663:7)
    #50     _rootRun (dart:async/zone.dart:1420:47)
    #51     _CustomZone.run (dart:async/zone.dart:1328:19)
    #52     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
    #53     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
    #54     _rootRun (dart:async/zone.dart:1428:13)
    #55     _CustomZone.run (dart:async/zone.dart:1328:19)
    #56     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
    #57     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
    #58     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
    #59     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
    3
    find device -> Printer001
    find device -> N0A78
    5
    find device -> Printer001
    
    Reviewed by jobypthomas at 2021-09-26 21:46
  • 2. esc_pos_bluetooth ^0.2.6 error with rxdart ^0.26.0

    [proyect] flutter pub get Running "flutter pub get" in proyect...
    Because esc_pos_bluetooth 0.2.8 depends on rxdart ^0.23.1 and no versions of esc_pos_bluetooth match >0.2.8 <0.3.0, esc_pos_bluetooth ^0.2.8 requires rxdart ^0.23.1.

    So, because app_name depends on both rxdart ^0.26.0 and esc_pos_bluetooth ^0.2.8, version solving failed. pub get failed (1; So, because app_name depends on both rxdart ^0.26.0 and esc_pos_bluetooth ^0.2.8, version solving failed.) exit code 1

    Reviewed by danny2585 at 2021-04-14 23:17
  • 3. using esc_pos_bluetooth and esc_pos_printer in 1 project

    Getting error: Because no versions of esc_pos_printer match >4.0.3 <5.0.0 and esc_pos_printer 4.0.3 depends on esc_pos_utils ^1.0.0, esc_pos_printer ^4.0.3 requires esc_pos_utils ^1.0.0. And because esc_pos_bluetooth >=0.2.8 depends on esc_pos_utils ^0.3.6, esc_pos_printer ^4.0.3 is incompatible with esc_pos_bluetooth >=0.2.8. So, because ticket_scan depends on both esc_pos_bluetooth ^0.2.8 and esc_pos_printer ^4.0.3, version solving failed. pub get failed (1; So, because tibox depends on both esc_pos_bluetooth ^0.2.8 and esc_pos_printer ^4.0.3, version solving failed.)

    Reviewed by gabin8 at 2021-01-14 18:37
  • 4. unable to discover divices when using skd version 29

    Hello everyone, The package seems to not work when using targetSdkVersion 29 in android. I have not tried it in ios. My project is using sdk29.

    To reproduce, change

    defaultConfig { applicationId "com.example.blue" minSdkVersion 21 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" }

    to

    defaultConfig { applicationId "com.example.blue" minSdkVersion 21 targetSdkVersion 29 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" }

    I added the following permission and it is still not working: <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

    I need your help solving this problem.

    Reviewed by msandwidi at 2020-10-06 21:16
  • 5. Prints only once when the app starts

    I can only be able to print once, only when the app starts for the first time, subsequent attempts to print am getting Printer connection timeout Here are the logs.

    D/BluetoothBasicPlugin(31167): start scan 
    D/BluetoothAdapter(31167): STATE_ON
    I/chatty  (31167): uid=10277(ke.co.quebasetech.wanga_admin) identical 1 line
    D/BluetoothAdapter(31167): STATE_ON
    D/BluetoothLeScanner(31167): Start Scan with callback
    D/BluetoothLeScanner(31167): onScannerRegistered() - status=0 scannerId=9 mScannerId=0
    D/BluetoothAdapter(31167): STATE_ON
    D/BluetoothAdapter(31167): STATE_ON
    D/BluetoothLeScanner(31167): Stop Scan with callback
    D/BluetoothAdapter(31167): STATE_ON
    D/BluetoothAdapter(31167): STATE_ON
    D/BluetoothLeScanner(31167): could not find callback wrapper
    D/BluetoothSocket(31167): close() this: [email protected], channel: 1, mSocketIS: [email protected], mSocketOS: [email protected]: [email protected] impl:[email protected] fd:[email protected], mSocketState: CONNECTED
    W/System.err(31167): java.io.IOException: bt socket closed, read return: -1
    D/BluetoothSocket(31167): close() this: [email protected], channel: 1, mSocketIS: [email protected], mSocketOS: [email protected]: null, mSocketState: CLOSED
    D/BluetoothSocket(31167): close() this: [email protected], channel: 1, mSocketIS: [email protected], mSocketOS: [email protected]: null, mSocketState: CLOSED
    W/System.err(31167): 	at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:721)
    W/System.err(31167): 	at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:88)
    W/System.err(31167): 	at java.io.InputStream.read(InputStream.java:101)
    W/System.err(31167): 	at com.gprinter.io.BluetoothPort.readData(BluetoothPort.java:130)
    W/System.err(31167): 	at com.tablemi.flutter_bluetooth_basic.DeviceConnFactoryManager.readDataImmediately(DeviceConnFactoryManager.java:418)
    W/System.err(31167): 	at com.tablemi.flutter_bluetooth_basic.DeviceConnFactoryManager$PrinterReader.run(DeviceConnFactoryManager.java:498)
    E/BluetoothPort(31167): connection device is lost
    E/DeviceConnFactoryManager(31167):  read 0
    D/BluetoothAdapter(31167): cancelDiscovery
    D/BluetoothAdapter(31167): cancelDiscovery = true
    D/BluetoothUtils(31167): isSocketAllowedBySecurityPolicy start : device null
    W/BluetoothAdapter(31167): getBluetoothService() called with no BluetoothManagerCallback
    E/DeviceConnFactoryManager(31167): wait read 
    E/BluetoothPort(31167): read length1
    E/DeviceConnFactoryManager(31167):  read 1
    E/DeviceConnFactoryManager(31167): wait read 
    I/flutter (31167): Error. Printer connection timeout
    
    Reviewed by nyugoh at 2020-07-15 13:35
  • 6. Incompatibility with other dependencies

    My pubspec.yaml has the following dependencies:

    dependencies:
      flutter:
        sdk: flutter
      google_fonts: ^2.1.0
      shared_preferences: ^2.0.6
      image_picker: ^0.8.0+3
      photo_view: ^0.11.1
      native_pdf_view: ^4.1.0
      printing: ^5.4.3
    

    If I add esc_pos_bluetooth: ^0.2.8 the console throws the following errors:

    Running "flutter pub get"...
    Because esc_pos_bluetooth >=0.2.8 depends on esc_pos_utils ^0.3.6 which depends on image ^2.1.4, esc_pos_bluetooth >=0.2.8 requires image ^2.1.4.

    And because printing >=5.0.1 depends on image ^3.0.1, esc_pos_bluetooth >=0.2.8 is incompatible with printing >=5.0.1.

    So, because [appName] depends on both printing ^5.4.3 and esc_pos_bluetooth ^0.2.8, version solving failed. pub get failed (1; So, because [appName] depends on both printing ^5.4.3 and esc_pos_bluetooth ^0.2.8, version solving failed.) exit code 1

    Reviewed by PINHOf at 2021-07-26 11:28
  • 7. Can't find Ticket class

    Compiler message: lib/main.dart:26:17: Error: 'Ticket' isn't a type. Ticket ticket = Ticket(PaperSize.mm80); ^^^^^^ lib/main.dart:26:33: Error: The method 'Ticket' isn't defined for the class '_MyAppState'.

    • '_MyAppState' is from 'package:test_printer/main.dart' ('lib/main.dart'). Try correcting the name to the name of an existing method, or defining a method named 'Ticket'. Ticket ticket = Ticket(PaperSize.mm80); ^^^^^^ lib/main.dart:26:40: Error: The getter 'PaperSize' isn't defined for the class '_MyAppState'.
    • '_MyAppState' is from 'package:test_printer/main.dart' ('lib/main.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'PaperSize'. Ticket ticket = Ticket(PaperSize.mm80);
    Reviewed by KunakornT at 2020-07-07 08:21
  • 8. Dependency issue with flutter_bluetooth_basic

    @andrey-ushakov, I cloned the example and the dependency failed for bluetooth package. Following is the error:

    Because every version of flutter from sdk depends on meta 1.3.0 and json_annotation >=4.1.0 depends on meta ^1.4.0, flutter from sdk is incompatible with json_annotation >=4.1.0.
    
    And because esc_pos_bluetooth >=0.3.0 depends on flutter_bluetooth_basic ^0.1.6 which depends on json_annotation ^4.1.0, flutter from sdk is incompatible with esc_pos_bluetooth >=0.3.0.
    
    So, because blue depends on both flutter any from sdk and esc_pos_bluetooth ^0.4.0, version solving failed.
    pub get failed (1; So, because blue depends on both flutter any from sdk and esc_pos_bluetooth ^0.4.0, version solving failed.)
    exit code 1
    
    
    Reviewed by jobypthomas at 2021-09-23 17:18
  • 9. null-safe but depends on non-null-safe esc_pos_utils

    @andrey-ushakov First, thank you for releasing the null-safe package for esc_pos_bluetooth. However, is depends on the non-null-safe utils - esc_pos_utils: ^0.3.6. Can this dependency be chanted to null safe esc_pos_utils: ^1.1.0

    Reviewed by jobypthomas at 2021-09-21 18:24
  • 10. This expression has type 'void' and can't be used. print(ticket.text(text))

    i try to run sample application. but it gives this error. can i get solution for this?

    ../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/esc_pos_bluetooth-0.2.8/lib/src/printer_bluetooth_manager.dart:154:23: Error: The getter 'text' isn't defined for the class 'PrinterBluetoothManager'.

    • 'PrinterBluetoothManager' is from 'package:esc_pos_bluetooth/src/printer_bluetooth_manager.dart' ('../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/esc_pos_bluetooth-0.2.8/lib/src/printer_bluetooth_manager.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'text'. print(ticket.text(text)); ^^^^ ../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/esc_pos_bluetooth-0.2.8/lib/src/printer_bluetooth_manager.dart:154:18: Error: This expression has type 'void' and can't be used. print(ticket.text(text)); ^

    Command PhaseScriptExecution failed with a nonzero exit code

    Reviewed by vidurasilva at 2021-07-16 10:40
  • 11. Print on sunmi t2 (InnerPrinter) problem

    Hi,

    Thanks for your package. I use a Sunmi T2 Terminal with a virtual bluethooth (INNERPRINTER). When I print a ticket, a 'V0' caracter is write at each lines. Another problem when the ticket is finished, the printer cut 2 times at the end.

    Thanks for your help 20200930_092817

    Reviewed by llaad26 at 2020-09-30 07:59
  • 12. Error in scanning

    Hi, i faced this error when the app start scanning.

    [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(startScan, Need android.permission.BLUETOOTH_SCAN permission for AttributionSource { uid = 10479, packageName = com.example.test_app, attributionTag = null, token = [email protected], next = null }: GattService registerScanner, null, null)

    i dont know whats the solution, please help me. thanks

    Reviewed by Ibraheem-ElDali at 2022-08-13 20:35
  • 13. Android V2 embedding & Language Change

    Hello,

    I just installed the plugin and works perfectly on my with 2 exceptions

    1. First I get this below message when the application builds which currently is not an issue but looks like it could be in the future The plugin flutter_bluetooth_basic uses a deprecated version of the Android embedding. To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs. If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

    2. Secondly I wanted to use it for printing receipts in Thai (Different language) but it kicked back an error "Invalid argument (string): Contains invalid characters.: "กหฟห""

    I would appreciate if you could provide some help!

    Reviewed by simeonangelov94 at 2022-07-26 13:17
  • 14. deprecated version of the Android embedding

    The plugin flutter_bluetooth_basic uses a deprecated version of the Android embedding. To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs. If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

    Please Andrey Ushakov do some upgrade in this package

    Reviewed by tariq74 at 2022-06-28 10:20
  • 15. Not Printing, Errors, Deprecation messages,

    like other have mentioned , one of the packages is deprecated, but

    When try to print , i get "Success" from the toast but then I get this error msg. on the console and nothing prints Please help

    D/[email protected][MainActivity](24965): ViewPostIme pointer 0 D/[email protected][MainActivity](24965): ViewPostIme pointer 1 D/BluetoothBasicPlugin(24965): start scan D/BluetoothAdapter(24965): STATE_ON I/chatty (24965): uid=10189(u0_a189) com.example.btbt.exc_pos_bt_ex identical 4 lines D/BluetoothAdapter(24965): STATE_ON D/BluetoothLeScanner(24965): Start Scan with callback D/BluetoothLeScanner(24965): onScannerRegistered() - status=0 scannerId=6 mScannerId=0 D/BluetoothAdapter(24965): STATE_ON I/chatty (24965): uid=10189(u0_a189) com.example.btbt.exc_pos_bt_ex identical 2 lines D/BluetoothAdapter(24965): STATE_ON D/BluetoothLeScanner(24965): Stop Scan with callback D/BluetoothAdapter(24965): STATE_ON I/chatty (24965): uid=10189(u0_a189) com.example.btbt.exc_pos_bt_ex identical 2 lines D/BluetoothAdapter(24965): STATE_ON D/BluetoothLeScanner(24965): could not find callback wrapper D/BluetoothAdapter(24965): cancelDiscovery D/BluetoothAdapter(24965): cancelDiscovery = true D/BluetoothUtils(24965): isSocketAllowedBySecurityPolicy start : device null W/BluetoothAdapter(24965): getBluetoothService() called with no BluetoothManagerCallback D/BluetoothBasicPlugin(24965): stateStreamHandler, current action: android.bluetooth.device.action.ACL_CONNECTED E/DeviceConnFactoryManager(24965): wait read E/BluetoothPort(24965): read length1 E/DeviceConnFactoryManager(24965): read 1 E/DeviceConnFactoryManager(24965): wait read D/BluetoothSocket(24965): close() this: [email protected], channel: 1, mSocketIS: [email protected], mSocketOS: [email protected]: [email protected] impl:[email protected] fd:[email protected], mSocketState: CONNECTED D/BluetoothSocket(24965): close() this: [email protected], channel: 1, mSocketIS: [email protected], mSocketOS: [email protected]: null, mSocketState: CLOSED W/System.err(24965): java.io.IOException: bt socket closed, read return: -1 D/BluetoothSocket(24965): close() this: [email protected], channel: 1, mSocketIS: [email protected], mSocketOS: [email protected]: null, mSocketState: CLOSED W/System.err(24965): at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:643) W/System.err(24965): at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:96) W/System.err(24965): at java.io.InputStream.read(InputStream.java:101) W/System.err(24965): at com.gprinter.io.BluetoothPort.readData(BluetoothPort.java:130) W/System.err(24965): at com.tablemi.flutter_bluetooth_basic.DeviceConnFactoryManager.readDataImmediately(DeviceConnFactoryManager.java:418) W/System.err(24965): at com.tablemi.flutter_bluetooth_basic.DeviceConnFactoryManager$PrinterReader.run(DeviceConnFactoryManager.java:498) E/BluetoothPort(24965): connection device is lost E/DeviceConnFactoryManager(24965): read 0 D/BluetoothBasicPlugin(24965): stateStreamHandler, current action: android.bluetooth.device.action.ACL_DISCONNECTED

    Reviewed by YahalomsGuy at 2022-06-19 15:34
  • 16. PosColumn alignment inside row not working

    Hi, I have a row with three columns. I want to align one to the right and I use the example. but it doesn't work, it just puts all the columns together with no alignment. Anyone know why? Thanks.

    bytes += ticket.row([
            PosColumn(text: element.cantidad.toString() + ' x ' + element.nombre!,width: 4, styles: PosStyles(height: PosTextSize.size1, width: PosTextSize.size1, codeTable: 'CP1252')),
            PosColumn(text: " " * espacios, width: 6, styles: PosStyles(height: PosTextSize.size1, width: PosTextSize.size1)),
            PosColumn(width: 2, textEncoded: Uint8List.fromList(element.precioArticulo.toString().codeUnits + [128]), styles: PosStyles(codeTable: 'CP1252', align: PosAlign.right)),
          ]);
    
    Reviewed by noebt at 2022-05-12 11:58

Related

Flutter NFC reader plugin for iOS and Android
Flutter NFC reader plugin for iOS and Android

Flutter NFC Reader & Writer A new flutter plugin to help developers looking to use internal hardware inside iOS or Android devices for reading and wri

Aug 15, 2022
Flutter plugin for accessing the NFC features on Android and iOS.

nfc_manager Flutter plugin for accessing the NFC features on Android and iOS. Note: This plugin depends on NFCTagReaderSession (requires iOS 13.0 or l

Jul 29, 2022
Ready for Building Production-Ready Healthcare/ Doctor Consult Android and iOS app UI using Flutter.
Ready for Building Production-Ready Healthcare/ Doctor Consult Android and iOS app UI using Flutter.

Production-Ready Doctor Consultant App - Flutter UI Watch it on YouTube Packages we are using: flutter_svg: link Complete Source code (Patreon) In thi

Aug 2, 2022
This Android/IOS application intends to help users to get an early notification for slot availability for Covid19 vaccination.
This Android/IOS application intends to help users to get an early notification for slot availability for Covid19 vaccination.

Cowin Slot Reminder Objective: This Android/IOS application intends to help users to get an early notification for slot availability for Covid19 vacci

Jun 6, 2021
iOS App to Record Daily Sun Intake
iOS App to Record Daily Sun Intake

Why Suncheck 당신은 하루에 해를 얼마나 보나요? 코시국에 더욱 우울하거나 무기력한 건 햇살을 충분히 받지 못해서 일 수도 있어요. 매일 단 15분의 햇살만으로 우리 뇌에서는 우울증을 예방할 수 있을 만큼의 세로토닌이 분비됩니다. 만약 하루 동안 내가 얼마나

Jul 16, 2022
Bluetooth plugin for Flutter
Bluetooth plugin for Flutter

Introduction FlutterBlue is a bluetooth plugin for Flutter, a new app SDK to help developers build modern multi-platform apps. Alpha version This libr

Aug 13, 2022
A Flutter plugin for turning your device into a beacon.

Beacon Broadcast plugin for Flutter A Flutter plugin for turning your device into a beacon. Usage To use this plugin, add beacon_broadcast as a depend

Jun 28, 2022
Flutter library that handles BLE operations for multiple devices.

Flutter reactive BLE library Flutter library that handles BLE operations for multiple devices. Usage The reactive BLE lib supports the following: BLE

Aug 13, 2022
FlutterBleLib - A library for all your Bluetooth Low Energy needs in Flutter.
 FlutterBleLib - A library for all your Bluetooth Low Energy needs in Flutter.

FlutterBleLib A library for all your Bluetooth Low Energy needs in Flutter. Internally utilises Polidea's MultiPlatformBleAdapter, which runs on RxAnd

Jun 10, 2022
Bluetooth Low Energy library for Flutter with support for simulating peripherals
Bluetooth Low Energy library for Flutter with support for simulating peripherals

FlutterBleLib A library for all your Bluetooth Low Energy needs in Flutter. Internally utilises Polidea's MultiPlatformBleAdapter, which runs on RxAnd

Aug 7, 2022
Using Bluetooth plugin in Flutter (flutter_bluetooth_serial)
Using Bluetooth plugin in Flutter (flutter_bluetooth_serial)

Flutter Bluetooth NOTE: This is the updated version of the app (using flutter_bluetooth_serial 0.2.2). This version has much fewer bugs and provides a

Aug 6, 2022
A Flutter Template to communicate with an esp32 over bluetooth

Flutter Esp32 Bluetooth Template Changes in android/ [1 if you take the code to an other project, 2 still nessesarely]: Change minSdkVersion from 16 t

Aug 11, 2022
Aug 3, 2022
This flutter app will help you to connect to Bluetooth Devices (like, HC-05)
This flutter app will help you to connect to Bluetooth Devices (like, HC-05)

Flutter Bluetooth NOTE: This is the updated version of the app (using flutter_bluetooth_serial 0.2.2). This version has much fewer bugs and provides a

Jun 5, 2022
Flutter basic implementation for Classical Bluetooth (only RFCOMM for now)
Flutter basic implementation for Classical Bluetooth (only RFCOMM for now)

flutter_bluetooth_serial Flutter basic implementation for Classical Bluetooth (only RFCOMM for now). Features The first goal of this project, started

Apr 13, 2022
ESC/POS (thermal, receipt) printing for Flutter & Dart (Android/iOS)
ESC/POS (thermal, receipt) printing for Flutter & Dart (Android/iOS)

esc_pos_bluetooth The library allows to print receipts using a Bluetooth printer. For WiFi/Ethernet printers, use esc_pos_printer library. TODO (PRs a

Aug 6, 2022
Flutter pos - A mobile POS written in Flutter, suitable for small cafe/restaurant, fully offline
Flutter pos - A mobile POS written in Flutter, suitable for small cafe/restaurant, fully offline

Simple-POS A mobile POS written in Flutter, suitable for small cafe/restaurant,

Aug 10, 2022
POS plugging to connect with each type of pos device.

flutter_pos_printer A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized packag

Jan 24, 2022
Receipt parser application written in dart.
Receipt parser application written in dart.

Receipt manager You can find pre-compiled releases on the Github release page or in the FDROID repository. All the needed info about how to use the re

Aug 7, 2022
A lightweight Flutter plugin for making payments and printing on MyPos

my_poster ?? my_poster is in beta - please provide feedback (and/or contribute) if you find issues ??️ A lightweight Flutter plugin for making payment

May 30, 2021