NetworkPrinterManager class

Network Printer

Inheritance

Constructors

NetworkPrinterManager(POSPrinter printer)

Properties

hashCode int
The hash code for this object.
no setterinherited
isConnected bool
Whether the socket is currently connected.
no setter
printer POSPrinter
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
socket Socket?
getter/setter pair

Methods

connect({Duration? timeout = const Duration(seconds: 5)}) Future
connect let you connect to a network printer.
override
disconnect({Duration? timeout}) Future
disconnect flushes pending data and closes the socket.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pair(POSPrinter device) Future<void>
override
scan() Stream<POSPrinter>
scan yields printers as they are discovered on the network.
override
toString() String
A string representation of this object.
inherited
writeBytes(List<int> data, {int chunkSize = defaultChunkSize, int chunkDelayMs = defaultChunkDelayMs}) Future
writeBytes writes raw data to the network socket in chunks.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

discover({int port = 9100}) Future<List<NetWorkPrinter>>
discover let you explore all netWork printer in your network.
discoverStream({int port = 9100, Duration timeout = const Duration(milliseconds: 5000)}) Stream<NetWorkPrinter>
discoverStream returns a Stream that yields printers as they are found on the network, instead of waiting for the full scan to finish.

Constants

defaultChunkDelayMs → const int
Delay between sending chunks (in milliseconds).
defaultChunkSize → const int
Maximum bytes to write per chunk over the network.