Search packages, repositories and app categories

Package detailsv0.0.41

zebrautility

A flutter plugin for working with zebra printers

AndroidiOS
30-day downloads
409
Likes
41
Pub points
110

Install package

flutter pub add zebrautility

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

ZebraUtility is a Flutter plugin designed to facilitate communication with Zebra printers, enabling developers to send print commands and manage printing tasks directly from Flutter applications. It supports both Android and iOS platforms, making it ideal for mobile solutions requiring label or receipt printing. The plugin provides a straightforward interface for integrating Zebra printer functionality into apps used in logistics, retail, and inventory management. Built on top of native Zebra SDKs, it ensures reliable performance and compatibility with a wide range of Zebra devices.

Use cases

  • Mobile inventory management
  • Retail receipt printing
  • Shipping label generation
  • Asset tracking applications
  • Field service documentation

Key features

  • Cross-platform support (Android & iOS)
  • Simple API for sending print jobs
  • Integration with Zebra printer SDKs
  • Real-time printing status monitoring
  • Support for ZPL and EPL languages

Suitable for

  • Developers building mobile printing apps
  • Logistics and supply chain software
  • Retail and point-of-sale systems
  • Field data collection tools
  • Industrial mobile applications

Considerations

  • Requires compatible Zebra printer hardware
  • May need additional configuration for network printing
  • Limited to Zebra printer models supported by underlying SDK
  • Platform-specific setup steps required
  • Dependent on stable network connection for wireless printers

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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();

Categories

Source repository

Projects using this package

No data available yet.