|
@@ -116,8 +116,10 @@ class AiPatintController extends GetxController {
|
|
|
final widthScale = Get.find<IApplication>().displayScaleRatio;
|
|
|
|
|
|
for (int m = 0; m < detectedObjects!.length; m++) {
|
|
|
- final List<AIDiagnosisPoint2D>? contours = detectedObjects[m].contours;
|
|
|
- if (contours!.isNotEmpty && detectedObjects[m].descriptions!.isNotEmpty) {
|
|
|
+ final List<AIDiagnosisPoint2D>? contours =
|
|
|
+ detectedObjects[m].contours ?? [];
|
|
|
+ if ((contours?.isNotEmpty ?? false) &&
|
|
|
+ (detectedObjects[m].descriptions?.isNotEmpty ?? false)) {
|
|
|
var lesionSizeDescription = detectedObjects[m].descriptions?.firstWhere(
|
|
|
(element) => element.type == DiagnosisDescriptionEnum.LesionSize);
|
|
|
lesionSize = lesionSizeDescription?.value ?? '';
|
|
@@ -125,7 +127,7 @@ class AiPatintController extends GetxController {
|
|
|
final lesionSizeMap = jsonDecode(lesionSize);
|
|
|
if (_HAS_VIEW_STATUS_ARR.contains(state.vidStatus)) {
|
|
|
aiResultsList = [];
|
|
|
- for (int i = 0; i < contours.length; i++) {
|
|
|
+ for (int i = 0; i < contours!.length; i++) {
|
|
|
aiResultsList.add(Offset(
|
|
|
contours[i].x * widthScale,
|
|
|
contours[i].y * widthScale,
|