Sensor.fromMap constructor

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

Implementation

factory Sensor.fromMap(Map<String, dynamic> map) {
  return Sensor(
    name: map['name'] as String,
    vendor: map['vendor'] as String,
    version: map['version'] as int,
    type: map['type'] as int,
    maxRange: map['maxRange'] as double,
    resolution: map['resolution'] as double,
    power: map['power'] as double,
    minDelay: map['minDelay'] as int,
    reportingMode:
        map['reportingMode'] != null ? map['reportingMode'] as int : null,
    isDynamicSensor: map['isDynamicSensor'] != null
        ? map['isDynamicSensor'] as bool
        : null,
    isWakeUpSensor:
        map['isWakeUpSensor'] != null ? map['isWakeUpSensor'] as bool : null,
    fifoReservedEventCount: map['fifoReservedEventCount'] != null
        ? map['fifoReservedEventCount'] as int
        : null,
    fifoMaxEventCount: map['fifoMaxEventCount'] != null
        ? map['fifoMaxEventCount'] as int
        : null,
    stringType:
        map['stringType'] != null ? map['stringType'] as String : null,
    maxDelay: map['maxDelay'] != null ? map['maxDelay'] as int : null,
    id: map['id'] != null ? map['id'] as int : null,
  );
}