cs10_z100_pos_printer 1.0.0 copy "cs10_z100_pos_printer: ^1.0.0" to clipboard
cs10_z100_pos_printer: ^1.0.0 copied to clipboard

A Flutter plugin for printing on CS10-Z100 POS terminals.

CS10-Z100 POS Printer Plugin #

pub package

A Flutter plugin for printing on the integrated terminal of CS10-Z100 POS devices. Built specifically for Android POS models CS10 and Z100

Features #

  • Initialize and close the printer connection.
  • Check the printer status.
  • Print text with customizable alignment and font settings.
  • Print QR code.

Important: Be sure to call printInit() at least once before using any other methods.

Device Compatibility #

Important: This plugin is exclusively compatible with the CS10-Z100 POS terminal. It will not function correctly and will print Plugin does not support this device, use a CS10 or Z100 printer model message on the console.

Installation #

Add the plugin to your Flutter project by running:

flutter pub add cs10_z100_pos_printer

Usage #

Import the plugin:

import 'package:cs10_z100_pos_printer/cs10_z100_pos_printer.dart';

Initialize the printer plugin instance:

import 'package:cs10_z100_pos_printer/cs10_z100_pos_printer.dart';

void main() async {
  final printer = Cs10Z100PosPrinter();
  final wasInit = await printer.printInit();
  if (wasInit) {
    print('Printer initialized successfully');
  } else {
    print('Printer initialization failed');
  }
}

Add text to the printer queue:

import 'package:cs10_z100_pos_printer/cs10_z100_pos_printer.dart';

void main() async {
  final printer = Cs10Z100PosPrinter();
  final wasInit = await printer.printInit();
  if (!wasInit) return;

  // option 1
  await printer.addString(PrinterText('Example Text',align: PrinterStringAlign.center,zoom: PrinterStringZoom.medium));

  // option 2
  await printer.addToQueue(PrinterText('Example Text',align: PrinterStringAlign.center,zoom: PrinterStringZoom.medium));
}

Add a Qr Code to the queue:

import 'package:cs10_z100_pos_printer/cs10_z100_pos_printer.dart';

void main() async {
  final printer = Cs10Z100PosPrinter();
  final wasInit = await printer.printInit();
  if (!wasInit) return;

  // option 1
  await printer.addQrCode(PrinterQrCode('https://pub.dev/packages/cs10_z100_pos_printer', align: PrinterStringAlign.center));

  // option 2
  await printer.addToQueue(PrinterQrCode('https://pub.dev/packages/cs10_z100_pos_printer', align: PrinterStringAlign.center));
}

Start printing the queue:

final printStarted = await printer.printStart();

Clears the queue:

await printer.printClose();

Example:

import 'package:cs10_z100_pos_printer/cs10_z100_pos_printer.dart';

void main() async {
  final space = List.generate(8, (index) => '\n').join();
  final printer = Cs10Z100PosPrinter();
  final wasInit = await printer.printInit();
  if (!wasInit) return;
  final List<Printable> list = [
    PrinterText(
      'Example Title',
      align: PrinterStringAlign.center,
      zoom: PrinterStringZoom.medium,
    ),
    PrinterText('\n\n'),
    PrinterText('Receipt Number:\t12034'),
    PrinterText('Date:\t25/04/2025'),
    PrinterText('\n'),
    PrinterText('Amount: \$. 10.00'),
    PrinterText('Tax:    \$.  1.00'),
    PrinterText('Total:  \$. 11.00'),
    PrinterText('\n'),
    PrinterQrCode('https://pub.dev/packages/cs10_z100_pos_printer', align: PrinterStringAlign.center),
    PrinterText('Url Link', align: PrinterStringAlign.center, size: PrinterStringSize.small),
    PrinterText(space, align: PrinterStringAlign.center),
  ];
  bool stringAdded = false;
  for (var element in list) {
    stringAdded = await printer.addToQueue(element);
    if (!stringAdded) return;
  }
  final printStarted = await printer.printStart();
  if (!printStarted) return;
  await printer.printClose();
}
4
likes
0
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for printing on CS10-Z100 POS terminals.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on cs10_z100_pos_printer

Packages that implement cs10_z100_pos_printer