PrinterDeviceInfo.fromMap constructor

PrinterDeviceInfo.fromMap(
  1. Map<String, dynamic> map
)

Parseo defensivo del map nativo: nunca lanza por claves faltantes o tipos inesperados. Valores irrecuperables caen a '' / 0; el caller filtra con hasInstanceId.

Implementation

factory PrinterDeviceInfo.fromMap(Map<String, dynamic> map) {
  return PrinterDeviceInfo(
    instanceId: _asString(map['instanceId']),
    displayName: _asString(map['displayName']),
    vid: _asInt(map['vid']),
    pid: _asInt(map['pid']),
  );
}