Package Flutter Bluetooth to Zebra

佐手、 提交于 2020-07-23 06:19:33

问题


I need to add printing functionality on a zebra ZQ520 bluetooth thermal printer in an application developed in flutter (Android), does anyone have any suggestions or packages to perform this task? I tried with the packages: esc_pos_printer, esc_pos_bluetooth, flutter-zsdk, zsdk , but I was not successful.

Thank you!


回答1:


You can have mine plugin from https://github.com/gmeles/flutter_cblue

You place it in the project root folder and add your dependency on pub spec.yaml like

dependencies:

  flutter:
    sdk: flutter
................
  flutter_cblue:
    path: ../flutter_cblue

The printer must be already paired and it's name must starts with 'zebra'

After that you only send strings

import 'package:flutter_cblue/flutter_cblue.dart';

FlutterCblue.printToBT(printStr: '^XA^CFA,30 ^FO50,300^FDHello World^FS ^XZ')
                                  .then((result) {


.............
  1. It works only on android, have no need for iOS for this project

  2. Check the code ......

  3. Check that your ZPL commands are correct using http://labelary.com/viewer.html



来源:https://stackoverflow.com/questions/62994695/package-flutter-bluetooth-to-zebra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!