搜索插件、代码仓与 APP 分类

插件详情v0.0.6

bluetooth_thermal_printer

该库允许使用蓝牙打印机(仅限 Android)打印收据。

AndroidiOS
近 30 天下载
225
喜欢数
78
Pub 分数
150

安装插件

flutter pub add bluetooth_thermal_printer

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个用于通过蓝牙打印机打印收据的Flutter包,目前仅支持Android。它可与热敏打印机无缝集成,直接从Android设备生成并发送打印任务。适用于需要随时随地打印收据的销售点系统、零售应用和自助服务终端。该库高效处理蓝牙配对和数据传输,简化了向兼容打印机发送格式化文本和图像的过程。

适合场景

  • 销售点系统
  • 零售收据打印
  • 自助服务应用程序
  • 移动订单处理
  • 库存管理

主要特点

  • 仅支持 Android
  • 蓝牙打印机集成
  • 文本和图像打印
  • 轻松设置和配对
  • 轻便且快速

适合对象

  • Android 开发者
  • 零售应用创建者
  • POS系统集成商
  • 移动商务解决方案

使用建议

  • 仅限Android平台
  • 需要兼容的蓝牙热敏打印机
  • 手动处理打印机专用命令
  • 不支持 iOS
  • 依赖外部原生库

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

bluetooth_thermal_printer

Pub Version

The library allows printing receipts using a Bluetooth printer(Android Only). It supports both 58mm and 80mm Bluetooth printers.

This package does not use Location Permission. By that, it follows google's policy of Android 10.

Add-ons

  1. esc_pos_utils package to print receipts
  2. Image to print images
Simple Ticket with Styles:
List<int> testTicket() {
  final List<int> bytes = [];
  // Using default profile
  final profile = await CapabilityProfile.load();
  final generator = Generator(PaperSize.mm80, profile);
  List<int> bytes = [];

  bytes += generator.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');
  bytes += generator.text('Special 1: àÀ èÈ éÉ ûÛ üÜ çÇ ôÔ',
      styles: PosStyles(codeTable: PosCodeTable.westEur));
  bytes += generator.text('Special 2: blåbærgrød',
      styles: PosStyles(codeTable: PosCodeTable.westEur));

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

  bytes += generator.text('Text size 200%',
      styles: PosStyles(
        height: PosTextSize.size2,
        width: PosTextSize.size2,
      ));

  bytes += generator.feed(2);
  bytes += generator.cut();
  return bytes;
}

You can find more examples here: esc_pos_utils.

How to Help

  • Test your printer and add it in the table: Tested Printers
  • 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.

For a complete example, check the example project.

Test Print

test receipt test receipt

所属分类

源码仓库

使用此插件的项目

暂无相关数据。