一个 Flutter 插件,通过蓝牙、BLE、TCP 和 USB 接口在 Android、iOS 和 Windows 上实现跨平台打印,支持各种打印机的 ESC/POS 命令。它提供统一的 API 来发送原始打印机命令,非常适合零售、餐饮和销售点系统中的收据打印机。该插件抽象了平台特定的实现,简化了在不同设备和操作系统之间的集成。
适合场景
POS系统中的收据打印
通过蓝牙或USB进行移动打印
跨平台打印应用程序
零售和餐厅订单处理
通过TCP/IP进行远程打印
主要特点
支持多个平台(Android、iOS、Windows)
处理 ESC/POS 命令传输
支持蓝牙、BLE、TCP 和 USB
跨平台统一 API
轻便高效
适合对象
开发POS应用的开发者
需要多设备打印的业务
需要可靠收据打印的应用程序
跨平台移动解决方案
与 ESC/POS 打印机配合使用的硬件集成商
使用建议
需要兼容的ESC/POS打印机
可能需要特定于平台的设置
仅限 ESC/POS 命令集
必须手动处理蓝牙配对
没有内置的打印预览或格式化工具
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
flutter_pos_printer_platform
Notice: This library was initially forked from arthas1888 in order to use it in a flutter project that use both image v4 and image v3 dart libraries. And since then, the library received many bug fixes after the original library was discontinued.
A library to discover printers, and send printer commands.
This library allows to print esc commands to printers in different platforms such as android, ios, windows and different interfaces as Bluetooth and BLE, USB and Wifi/Ethernet
error:'State restoration of CBCentralManager is only allowed for applications that have specified the "bluetooth-central" background mode'
info.plist add:
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Allow App use bluetooth?</string><key>NSBluetoothPeripheralUsageDescription</key><string>Allow App use bluetooth?</string><key>UIBackgroundModes</key><array><string>bluetooth-central</string><string>bluetooth-peripheral</string></array>