PrinterManager class
Universal printer manager for all platforms Handles BLE and USB printer discovery and operations using universal_ble for all platforms Removes dependency on win_ble and creates a single manager for all platforms
Properties
- bleConfig ↔ BleConfig
-
getter/setter pair
-
devicesStream
→ Stream<
List< Printer> > -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isBleTurnedOnStream
→ Stream<
bool> -
Whether Bluetooth is on: the current state first, then every change.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
connect(
Printer device, {Duration? connectionTimeout, Duration? connectionStabilizationDelay}) → Future< bool> - Connect to a printer device
-
disconnect(
Printer device) → Future< void> - Disconnect from a printer device
-
dispose(
) → Future< void> - Stops scanning. The manager is a singleton, so it stays usable and devicesStream stays open.
-
getPrinters(
{Duration refreshDuration = const Duration(seconds: 2), List< ConnectionType> connectionTypes = const [ConnectionType.BLE, ConnectionType.USB, ConnectionType.NETWORK], bool androidUsesFineLocation = false}) → Future<void> - Discover BLE and USB printers, plus installed network queues on macOS and Windows. Network discovery elsewhere still needs an explicit IP.
-
isBleTurnedOn(
) → Future< bool> - Check if Bluetooth is turned on
-
isConnected(
Printer device) → Future< bool> - Check if a device is connected
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
printData(
Printer printer, List< int> bytes, {bool longData = false, int? chunkSize}) → Future<bool> -
Sends
bytestoprinterand returns whether all of them were handed to the printer. Failures are logged, not thrown. -
sortDevices(
) → void - Sort and filter devices
-
stopScan(
{bool stopBle = true, bool stopUsb = true}) → Future< void> - Optimized stop scanning with better resource cleanup
-
toString(
) → String -
A string representation of this object.
inherited
-
turnOnBluetooth(
) → Future< void> - Turn on Bluetooth (universal approach)
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → PrinterManager
-
no setter