Search packages, repositories and app categories

fp_bt_printer cover
Package detailsv0.0.3

fp_bt_printer

printing receipts on bluetooth thermal printers (android only).

Android
30-day downloads
35
Likes
23
Pub points
125

Install package

flutter pub add fp_bt_printer

Package Overview

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

A Flutter package for printing receipts on Bluetooth thermal printers, designed specifically for Android devices. It enables seamless communication with compatible Bluetooth printers to send print commands directly from mobile apps. Ideal for point-of-sale systems, retail kiosks, and small business applications requiring on-the-go receipt printing. The package handles pairing, connection management, and data transmission efficiently. It relies on native Android Bluetooth APIs and does not support iOS or other platforms.

Use cases

  • Point-of-sale systems
  • Retail receipt printing
  • Mobile kiosk applications
  • Event ticket printing
  • On-site order processing

Key features

  • Bluetooth thermal printer integration
  • Android-only support
  • Receipt text and image printing
  • Automatic printer discovery
  • Simple API for print commands

Suitable for

  • Android developers
  • Retail app creators
  • POS system integrators
  • Small business software
  • Mobile printing solutions

Considerations

  • Requires Android device
  • Limited to Bluetooth thermal printers
  • No iOS support
  • Needs proper permissions in AndroidManifest.xml
  • Printer compatibility must be verified

Original README

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

fp_bt_printer

This library allows printing receipts on bluetooth thermal printers (android only). Support 58mm and 80mm printer.

It allows to print QR, BarCode, Images RasterImages with the esc_pos_utils package.

List bounded devices

Get list of bluetooth devices, it supports any version of bluetooth, not just BLE.

    List<PrinterDevice> devices = [];
    FpBtPrinter printer = FpBtPrinter();

    Future<void> getDevices() async {
        final response = await printer.scanBondedDevices();
        setState(() {
        devices = response;
        });
    }
Check device connected

You can check that the connection with the device is correct.

    Future<void> setConnet(PrinterDevice d) async {
        final response = await printer.checkConnection(d.address);
        print(response.message);
    }
Print data

This method recibe address of the printer and List of the data;

    FpBtPrinter printer = FpBtPrinter();
    final resp = await printer.printData(bytes, address: address);
    if (resp.success) {
     //print ok
    } else {
    print(resp.message); //print error
    }
Ticket with Styles usin :
List<int> getTicket() {
  final List<int> bytes = [];
  // Using default profile
  final profile = await CapabilityProfile.load();
    final generator = Generator(PaperSize.mm80, profile);
    List<int> bytes = [];

    // //  Print image:
    final ByteData data = await rootBundle.load('assets/wz.png');
    final Uint8List bytesImg = data.buffer.asUint8List();
    var image = decodePng(bytesImg);

    // resize
    var thumbnail =
        copyResize(image!, interpolation: Interpolation.nearest, height: 200);

    bytes += generator.text("fp_bt_printer",
        styles: PosStyles(align: PosAlign.center, bold: true));

    bytes += generator.imageRaster(thumbnail, align: PosAlign.center);

    bytes += generator.reset();
    bytes += generator.setGlobalCodeTable('CP1252');
    bytes += generator.feed(1);
    bytes += generator.text("HELLO PRINTER by FPV",
        styles: PosStyles(align: PosAlign.center, bold: true));
    bytes += generator.qrcode("https://github.com/FranciscoPV94",
        size: QRSize.Size6);
    bytes += generator.feed(1);
    bytes += generator.feed(1);

    final resp = await printer.printData(bytes, address: address);
  return bytes;
}

Tested and working with following Bluetooth Thermal Printers:

Xprinter Portable Thermal Printer

Model: Bixolon SPP-R310

Evidence

test receipt

Support me

If you think that this project has helped you with your developments, you can support this project, any support is much appreciated. Paypal

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.