createCalibrationFinishedStatus function
Implementation
CalibrationFinishedStatus createCalibrationFinishedStatus(payload) {
final statusString = payload['status'];
if (statusString == null) {
throw Exception('Invalid payload at createCalibrationFinishedStatus.');
}
switch (statusString) {
case 'success':
return CalibrationFinishedStatus.success;
case 'undo':
return CalibrationFinishedStatus.undo;
case 'cancelled':
return CalibrationFinishedStatus.cancelled;
default:
throw Exception('Status $statusString not defined.');
}
}