scanIccidWithCamera method

Future<void> scanIccidWithCamera(
  1. String? id
)

Implementation

Future<void> scanIccidWithCamera(String? id) async {
  ConditionalLogs().customLog("scanIccidWithCamera : $id");
  if (id == null) {
    return;
  }
  isScanning.value = true;
  if (selectedScanType.value == "Single") {
    singleScanController.value.text = id;
    await scanIccid();
    // isScanning.value = false;
  } else if (selectedScanType.value == "Range") {
    if (rangeStartScanController.value.text.isEmpty &&
        id != rangeEndScanController.value.text) {
      rangeStartScanController.value.text = id;
      ConditionalLogs().customLog("start : $id");
    } else if (rangeEndScanController.value.text.isEmpty &&
        id != rangeStartScanController.value.text) {
      rangeEndScanController.value.text = id;
      ConditionalLogs().customLog("end : $id");
    }
    if (rangeStartScanController.value.text.isNotEmpty &&
        rangeEndScanController.value.text.isNotEmpty) {
      await scanIccid();
      // isScanning.value = false;
    } else {
      // isScanning.value = false;
    }
  }
}