scanIccidWithCamera method
Implementation
Future<void> scanIccidWithCamera(String? id) async {
debugPrint("scanIccidWithCamera : $id");
if (id == null) {
return;
}
isScanning.value = true;
if (selectedScanType.value == "Single") {
singleScanController.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;
debugPrint("start : $id");
} else if (rangeEndScanController.value.text.isEmpty &&
id != rangeStartScanController.value.text) {
rangeEndScanController.value.text = id;
debugPrint("end : $id");
}
if (rangeStartScanController.value.text.isNotEmpty &&
rangeEndScanController.value.text.isNotEmpty) {
await scanIccid();
isScanning.value = false;
} else {
isScanning.value = false;
}
}
}