PrinterRegistry class

superprinter_flutter's PrinterRegistry: the configured printers, kept in SharedPreferences under the same key (saved printers carry over), handed to LocalPrinting on every change.

Inheritance

Constructors

PrinterRegistry({LocalPrinting? printing, String storageKey = defaultStorageKey})

Properties

defaultPrinter → TargetPrinter?
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isEmpty → bool
no setter
isLoaded → bool
no setter
onLocalProtocolChange ↔ void Function(Map<String, String> languages, Set<String> corrections)?
Called when a printer's protocol is chosen by the user or corrected.
getter/setter pair
printers → List<TargetPrinter>
no setter
printing → LocalPrinting
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
storageKey → String
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
afterPrinted(TargetPrinter printer) → Future<TargetPrinter?>
After a printed job: the first job in a language asks the printer (no paper) whether that is its language and corrects it when it is not. Returns the corrected printer, or null.
applyModelTable(String json) → Future<int>
Loads and keeps a model table revision; returns the active revision.
byName(String name) → TargetPrinter?
dispose() → void
Discards any resources used by the object.
inherited
load() → Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
probeReport(String printerName) → Future<String?>
remove(String name) → Future<void>
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
save(TargetPrinter printer) → Future<void>
setDefault(String name) → Future<void>
setLanguageSource(String printerName, String source) → Future<void>
Records where a printer's language came from (user, device_id, model_table, ipp, status).
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

defaultStorageKey → const String