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

插件详情v0.0.14

blue_print_pos

用于连接蓝牙打印机设备的插件,支持 Android 和 iOS

近 30 天下载
100
喜欢数
56
Pub 分数
70

安装插件

flutter pub add blue_print_pos

插件介绍

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

BluePrintPOS 是一个 Flutter 插件,可在 Android 和 iOS 平台上实现与蓝牙打印机设备的无缝连接。它提供了一个简单的 API 来发送打印命令,非常适合零售、销售点(POS)和收据打印应用。该插件高效地处理设备发现、配对和数据传输,确保与兼容打印机的可靠通信。通过最少的设置,开发者可以将实时打印功能集成到其应用中。它支持常见的打印操作,如文本、条形码和图像输出。

适合场景

  • 零售POS系统
  • 收据打印
  • 库存管理
  • 事件票务打印
  • 移动订单处理

主要特点

  • 蓝牙打印机连接
  • 跨平台支持(Android 和 iOS)
  • 文本和条形码打印
  • 简单 API 集成
  • 实时打印命令执行

适合对象

  • 开发POS应用的开发者
  • 移动零售解决方案
  • 现场服务应用程序
  • 随时随地的打印需求
  • 需要便携式收据打印的业务

使用建议

  • 需要兼容的蓝牙打印机
  • 仅限 Android 和 iOS 平台
  • 打印机特定的格式可能有所不同
  • 需要适当的蓝牙访问权限
  • 可能需要针对特定硬件型号进行测试

原始 README

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

Introduction

This plugin to help use bluetooth printer in Android/iOS. Support for text, image, add new line or line dashed and QR.

Usage

Initialize
BluePrintPos bluePrintPos = BluePrintPos.instance; 
Scan bluetooth printer
bluePrintPos.scan();
Connect bluetooth printer
bluePrintPos.connect(device);
Print Text

In method .addText(text, {size, style, alignment}) you can modify size, style and alignment

ReceiptSectionText receiptText = ReceiptSectionText();
receiptText.addText('MY STORE', size: ReceiptTextSizeType.medium, style: ReceiptTextStyleType.bold);
Print text left right
receiptText.addLeftRightText('Time', '04/06/21, 10:00');
Print image
final ByteData logoBytes = await rootBundle.load('assets/logo.jpg');
receiptText.addImage(
  base64.encode(Uint8List.view(logoBytes.buffer)),
  width: 150,
);
Add new line
receiptText.addSpacer();
Add new line with dash
receiptText.addSpacer(useDashed: true);

Getting Started

Android

Change the minSdkVersion in android/app/build.gradle in 19

android {
  defaultConfig {
     minSdkVersion 19
  }
}

Add permission for Bluetooth and access location in android/app/src/main/AndroidManifest.xml

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
iOS

Add info key in ios/Runner/Info.plist

<key>NSBluetoothAlwaysUsageDescription</key>  
<string>Need BLE permission</string>  
<key>NSBluetoothPeripheralUsageDescription</key>  
<string>Need BLE permission</string>  
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>  
<string>Need Location permission</string>  
<key>NSLocationAlwaysUsageDescription</key>  
<string>Need Location permission</string>  
<key>NSLocationWhenInUseUsageDescription</key>  
<string>Need Location permission</string>

Thanks to

Reference and dependencies create this plugin

所属分类

依赖

依赖清单 5 项

源码仓库

使用此插件的项目

暂无相关数据。