EmpaticaStatusEvent.fromMap constructor

EmpaticaStatusEvent.fromMap(
  1. Map map
)

Implementation

factory EmpaticaStatusEvent.fromMap(Map<dynamic, dynamic> map) {
  final String type = map['type'];
  switch (type) {
    case 'Listen':
      return Listen.fromMap(map);
    case 'UpdateStatus':
      return UpdateStatus.fromMap(map);
    case 'EstablishConnection':
      return EstablishConnection.fromMap(map);
    case 'UpdateSensorStatus':
      return UpdateSensorStatus.fromMap(map);
    case 'DiscoverDevice':
      return DiscoverDevice.fromMap(map);
    case 'FailedScanning':
      return FailedScanning.fromMap(map);
    case 'RequestEnableBluetooth':
      return RequestEnableBluetooth.fromMap(map);
    case 'bluetoothStateChanged':
      return BluetoothStateChanged.fromMap(map);
    default:
      return EmpaticaStatusEvent();
  }
}