flutter_usb_thermal_plugin 0.0.1+1 copy "flutter_usb_thermal_plugin: ^0.0.1+1" to clipboard
flutter_usb_thermal_plugin: ^0.0.1+1 copied to clipboard

Flutter plugin for usb thermal printer

flutter_usb_thermal_plugin #

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

Getting Started #

    flutter pub add flutter_usb_thermal_plugin

Example of Usage #

FlutterUsbThermalPlugin flutterUsbPrinter = FlutterUsbThermalPlugin();

....


_getDevicelist() async {
    List<UsbDevice> results = [];
    results = await flutterUsbPrinter.getUSBDeviceList();

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

_connect(int vendorId, int productId) async {
    bool? returned = false;
    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);
    } on PlatformException {
      //response = 'Failed to get platform version.';
    }
  }

FAQ Support #

Thanks For #

5
likes
140
points
7
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin for usb thermal printer

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_usb_thermal_plugin