Search packages, repositories and app categories

Package detailsv0.3.2

flutter_usb_printer

This plugin will allow develop send data and work with usb printer on android

Android
30-day downloads
2.6K
Likes
28
Pub points
150

Install package

flutter pub add flutter_usb_printer

Package Overview

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

The flutter_usb_printer package enables Android developers to send data to and manage USB printers directly from their Flutter applications. It provides a straightforward interface for communicating with connected USB printers, allowing printing of text, images, and formatted content. Designed specifically for Android, the plugin leverages native USB communication protocols to ensure reliable printing performance. Ideal for point-of-sale systems, receipt printing, and kiosk applications, it simplifies integration with hardware printers via USB.

Use cases

  • Receipt printing in retail apps
  • Point-of-sale (POS) systems
  • Kiosk applications
  • Label printing
  • On-device document output

Key features

  • Direct USB printer communication
  • Support for text and image printing
  • Android-only platform compatibility
  • Simple API for sending print jobs
  • Built-in USB device detection

Suitable for

  • Android-based POS developers
  • Retail and hospitality app creators
  • Hardware-integrated mobile solutions
  • Developers needing direct printer control

Considerations

  • Limited to Android devices
  • Requires USB OTG support
  • Needs proper USB permission handling
  • May require device-specific configuration
  • No iOS or desktop support

Original README

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

flutter_usb_printer

This plugin will allow develop send data and work with usb printer on android

Getting Started

    flutter pub add flutter_usb_printer

Example of Usage

_getDevicelist() async {
    List<Map<String, dynamic>> results = [];
    results = await FlutterUsbPrinter.getUSBDeviceList();

    print(" length: ${results.length}");
    setState(() {
      devices = results;
    });
}

_connect(int vendorId, int productId) async {
    bool returned;
    try {
      returned = await flutterUsbPrinter.connect(vendorId, productId);
    } on PlatformException {
      //response = 'Failed to get platform version.';
    }
    if (returned) {
      setState(() {
        connected = true;
      });
    }
}

_print() async {
    try {
      var data = Uint8List.fromList(
          utf8.encode(" Hello world Testing ESC POS printer..."));
      await flutterUsbPrinter.write(data);
      // await FlutterUsbPrinter.printRawData("text");
      // await FlutterUsbPrinter.printText("Testing ESC POS printer...");
    } on PlatformException {
      //response = 'Failed to get platform version.';
    }
}

Categories

Source repository

Projects using this package