sunmi_printerx 1.1.0 copy "sunmi_printerx: ^1.1.0" to clipboard
sunmi_printerx: ^1.1.0 copied to clipboard

PlatformAndroid

A Flutter plugin for Sunmi PrinterX SDK.

Sunmi PrinterX Flutter Plugin #

A Flutter plugin for interacting with the Sunmi PrinterX SDK.

Features #

  • Discover available printers
  • Retrieve printer status
  • Send print commands
  • Open and check the status of the cash drawer

Installation #

Add the following to your pubspec.yaml file:

dependencies:
    sunmi_printerx: ^1.0.0

Then, run flutter pub get to install the new dependency.

Usage #

Import the Plugin #

import 'package:sunmi_printerx/sunmi_printerx.dart';

Initialize the Plugin #

final sunmiPrinterX = SunmiPrinterX();

API and Examples #

SunmiPrinterX #

Methods

  • Future<List<Printer>> getPrinters()

    • Retrieves a list of available printers.

    Example:

    final sunmiPrinterX = SunmiPrinterX();
    List<Printer> printers = await sunmiPrinterX.getPrinters();
    print(printers);
    

Printer #

Methods

  • Future<PrinterStatus> getStatus()

    • Retrieves the status of the printer.

    Example:

    PrinterStatus status = await printer.getStatus();
    print(status);
    
  • Future<void> openCashDrawer()

    • Opens the cash drawer.

    Example:

    await printer.openCashDrawer();
    
  • Future<bool> isCashDrawerOpen()

    • Checks if the cash drawer is open.

    Example:

    bool isOpen = await printer.isCashDrawerOpen();
    print(isOpen);
    
  • Future<void> printEscPosCommands(Uint8List commands)

    • Sends ESC/POS commands to the printer.

    Example:

    await printer.printEscPosCommands(commands);
    
  • Future<void> waitForCashDrawerClose()

    • Waits for the cash drawer to close.

    Example:

    await printer.waitForCashDrawerClose();
    

Contributing #

Contributions are welcome! Please open an issue or submit a pull request.

License #

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

1
likes
140
pub points
14%
popularity

Publisher

unverified uploader

A Flutter plugin for Sunmi PrinterX SDK.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on sunmi_printerx