Skip to main content

sprint_flutter 0.1.1 copy "sprint_flutter: ^0.1.1" to clipboard
sprint_flutter: ^0.1.1 copied to clipboard

sPrint for Flutter: Superroute's printing SDK. Find network, USB and Bluetooth printers, detect their language, print labels, PDF, HTML, images and raw bytes, and run a Superroute print node, on Andro [...]

sprint_flutter #

sPrint for Flutter: Superroute's printing SDK on Android, iOS, macOS, Windows and Linux. Find network, USB and Bluetooth printers, detect their command language (ZPL, TSPL, ESC/POS, CPCL and the vendor dialects), print labels, PDF, HTML, images and raw bytes, and turn the device into a Superroute print node — with the same engine as every other sPrint platform.

import 'package:sprint_flutter/sprint_flutter.dart';

final printers = await PrinterRegistry.open('${dir.path}/printers.json');
await printers.save(const TargetPrinter(name: 'Labels', host: '192.168.1.40', language: Languages.zpl));
final result = await printers.print(PrintJob(type: JobTypes.label, label: LabelJob.parse(labelJson)));

final found = await Discovery.scanNetwork();

final node = await PrintNode.create(printers, state: savedState);
node.events.listen((e) { if (e is NodeStateEvent) save(e.state.json); });
await node.pair('K2M9XY'); // the code from the Print Nodes page
await node.start();

Platform notes:

  • Android: the plugin uses the sPrint Android library from https://goodneo-solutions.github.io/sprint-releases/maven (added to your app's repositories by the plugin). Ask for Bluetooth / USB permissions in your app.
  • iOS / macOS: Swift Package Manager is required (flutter config --enable-swift-package-manager); iOS 15+, macOS 13+. Add NSBluetoothAlwaysUsageDescription (Bluetooth LE printers) and NSLocalNetworkUsageDescription (network printers) to Info.plist.
  • Windows / Linux: the build downloads the sPrint C library of this version from the sprint-releases Release (checked against its SHA256SUMS.txt).

Licensed under the Superroute SDK License.

Coming from superprinter_flutter #

import 'package:sprint_flutter/superprinter_compat.dart'; gives the same LocalPrinting, PrinterRegistry, TargetPrinter, … calls (and the printers already saved). See docs/MIGRATING-FROM-SUPERPRINTER-FLUTTER.md in the sPrint repository for the call-by-call mapping and the behaviour differences.

0
likes
0
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

sPrint for Flutter: Superroute's printing SDK. Find network, USB and Bluetooth printers, detect their language, print labels, PDF, HTML, images and raw bytes, and run a Superroute print node, on Android, iOS, macOS, Windows and Linux.

Repository (GitHub)
View/report issues

Topics

#printing #label #thermal #zpl #escpos

License

unknown (license)

Dependencies

ffi, flutter, shared_preferences

More

Packages that depend on sprint_flutter

Packages that implement sprint_flutter