getLatestCalibrationValByMachineId method

void getLatestCalibrationValByMachineId(
  1. int weighingMachineId
)

Implementation

void getLatestCalibrationValByMachineId(int weighingMachineId) async {
  try {
    final response = await _apiService.getData(
        AppUrls.getLatestCalibrationValByMachineId,
        queryParams: {'weighingMachineId': weighingMachineId});

    if (response.statusCode == 200) {
      final modelResponse =
          CalibrationMachineResponse.fromJson(response.data);
      calibrationMachineId.value = modelResponse.data;
    }
  } catch (e) {
    print('Exception: $e');
  } finally {
    isLoading(false);
  }
}