ScannerInfo.fromMap constructor

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

Implementation

factory ScannerInfo.fromMap(Map<String, dynamic> map) {
  return ScannerInfo(
    isDefaultScanner: map['isDefaultScanner'] as bool?,
    friendlyName: map['friendlyName'] as String?,
    modelNumber: map['modelNumber'] as String?,
    deviceType: map['deviceType'] != null
        ? ScannerDeviceType.fromValue(map['deviceType'] as String)
        : null,
    connectionType: map['connectionType'] != null
        ? ScannerConnectionType.fromValue(map['connectionType'] as String)
        : null,
    deviceIdentifier: map['deviceIdentifier'] != null
        ? BarcodeManagerDeviceIdentifier.fromValue(map['deviceIdentifier'] as String)
        : null,
    decoderType: map['decoderType'] != null
        ? ScannerDecoderType.fromValue(map['decoderType'] as String)
        : null,
    isConnected: map['isConnected'] as bool?,
  );
}