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

插件详情v0.0.41

zebrautility

用于与斑马打印机配合使用的 Flutter 插件

AndroidiOS
近 30 天下载
409
喜欢数
41
Pub 分数
110

安装插件

flutter pub add zebrautility

插件介绍

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

ZebraUtility 是一个 Flutter 插件,旨在促进与 Zebra 打印机的通信,使开发者能够直接从 Flutter 应用程序发送打印命令并管理打印任务。它支持 Android 和 iOS 平台,非常适合需要标签或收据打印的移动解决方案。该插件为将 Zebra 打印机功能集成到物流、零售和库存管理应用中提供了简单直观的接口。基于原生 Zebra SDK 构建,确保了可靠的性能和对多种 Zebra 设备的兼容性。

适合场景

  • 移动库存管理
  • 零售收据打印
  • 发货标签生成
  • 资产追踪应用
  • 现场服务文档

主要特点

  • 跨平台支持(Android 和 iOS)
  • 用于发送打印作业的简单 API
  • 与斑马打印机SDK的集成
  • 实时打印状态监控
  • 支持 ZPL 和 EPL 语言

适合对象

  • 开发移动打印应用程序的开发者
  • 物流和供应链软件
  • 零售和销售点系统
  • 字段数据采集工具
  • 工业移动应用

使用建议

  • 需要兼容的斑马打印机硬件
  • 可能需要为网络打印进行额外配置
  • 仅限底层SDK支持的斑马打印机型号
  • 需要平台特定的设置步骤
  • 依赖稳定的网络连接以使用无线打印机

原始 README

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

Flutter ZebraUtility

Zebra utility is a plugin for working easily with zebra printers in your flutter project.

  • Discovery bluetooth and wifi printers in android and bluetooth printers in iOS.
  • Connect and disconnect to printers
  • Set mediatype, darkness, calibrate command without writing any ZPL code for ZPL printers.
  • Rotate ZPL without changing your zpl.

Installation

Android

Add this code to android block in build.gradle (Module level).

android {
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
    }
}

iOS

Add Supported external accessory protocols in your info.plist and then add com.zebra.rawportto its. Add Privacy - Local Network Usage Description in your info.plist.

Example

Getting Started

for initial new object of printer use this.

     ZebraPrinter zebraPrinter = await Zebrautility.getPrinterInstance(
  onPrinterFound, onPrinterDiscoveryDone, onChangePrinterStatus,
  onPermissionDenied: onPermissionDenied);

You must pass 3 functions onPrinterFound, onPrinterDiscoveryDone and onChangePrinterStatus. onPrinterFound is called, when a new printer found. you can implement like this:

  Function onPrinterFound = (name, ipAddress) {
      print("PrinterFound :" + name + ipAddress);
    };

onPrinterDiscoveryDone is called, when discovery printers is done and finished. You can implement like this:

 Function onPrinterDiscoveryDone = () {
      print("Discovery Done");
    };

onChangePrinterStatus when the Status of printer changes, You can implement like this:

   Function onChangePrinterStatus = (status, color) {
      print("change printer status: " + status + color);
    };

onPermissionDenied is called, when android user deny location permission. You can implement like this:

  Function onPermissionDenied = () {
      print("Permission Deny.");
    };

Methods

For start Discovery bluetooth and wifi printres, use this method:

  zebraPrinter.discoveryPrinters();

For connecting to printer, pass ipAddreess for wifi printer or macAddress for bluetooth printer to connectToPrinter method.

 zebraPrinter.connectToPrinter("192.168.47.50");

You can set media type between Lable, Journal and BlackMark. You can choose media type by EnumMediaType.

  zebraPrinter.setMediaType(EnumMediaType.BlackMark);

You may callibrate printer after set media type. You can use this method.

zebraPrinter.calibratePrinter();

You can set darkness. the valid darkness value are -99,-75,-50,-25,0,25,50,75,100,125,150,175,200.

  zebraPrinter.setDarkness(25);

For print ZPL, you pass ZPL to print method.

  zebraPrinter.print("Your ZPL");

For rotate your ZPL without changing your ZPL, you can use this method. You can call this again for normal printing.

  zebraPrinter.rotate();

For disconnect from printer, use disconnect method. For battery saver, disconnect from printer when you not need printer.

  zebraPrinter.disconnect();

所属分类

源码仓库

使用此插件的项目

暂无相关数据。