printers method
Die Netzwerk-Drucker des Kontos.
Implementation
Future<List<NetworkPrinter>> printers() async {
const name = Aufrufe.listMyPrinters;
final daten = await transport.call(name);
final liste = daten['printers'];
if (liste is! List) {
// Keine Liste ist etwas anderes als eine leere Liste: „noch kein
// Drucker" darf nicht aussehen wie „Antwort kaputt".
throw const KasseneckValidationError(name, 'Antwort enthaelt keine Liste (data.printers fehlt)', 'response');
}
return [
for (final e in liste) NetworkPrinter.fromJson(e is Map ? Map<String, dynamic>.from(e) : const {}),
];
}