|
@@ -13,6 +13,7 @@ import 'package:fis_measure/view/measure/measure_config/measure_configuation_pag
|
|
|
import 'package:fis_measure/view/measure/measure_config/widgets/measure_configuration_style.dart';
|
|
|
import 'package:fis_measure/view/measure/measure_config/widgets/measure_configuration_unit.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
+import 'package:get/get.dart';
|
|
|
import 'package:vid/us/vid_us_mode.dart';
|
|
|
|
|
|
class MeasureInfoData {
|
|
@@ -122,6 +123,10 @@ abstract class IMeasureDataController {
|
|
|
String get currentMode;
|
|
|
set currentMode(String value);
|
|
|
|
|
|
+ /// 通用画笔
|
|
|
+ Paint get paintPen;
|
|
|
+ set paintPen(Paint value);
|
|
|
+
|
|
|
/// 卡尺线画笔
|
|
|
Paint get paintLinePan;
|
|
|
set paintLinePan(Paint value);
|
|
@@ -133,6 +138,11 @@ abstract class IMeasureDataController {
|
|
|
// int index = 0;
|
|
|
|
|
|
// int totalCount = 0;
|
|
|
+
|
|
|
+ /// 设置画笔颜色
|
|
|
+ ///
|
|
|
+ /// [color] 颜色
|
|
|
+ void setPenColor(Color color);
|
|
|
}
|
|
|
|
|
|
class MeasureDataController implements IMeasureDataController {
|
|
@@ -165,16 +175,25 @@ class MeasureDataController implements IMeasureDataController {
|
|
|
|
|
|
/// 新增的
|
|
|
List<ItemMetaDTO> itemMetaListConfig = [];
|
|
|
+
|
|
|
+ Paint _paintPen = Paint()
|
|
|
+ ..color = MeasureColors.Primary
|
|
|
+ ..isAntiAlias = true
|
|
|
+ ..strokeWidth = 2
|
|
|
+ ..style = PaintingStyle.stroke;
|
|
|
+
|
|
|
Paint _paintLinePan = Paint()
|
|
|
..color = MeasureColors.Primary
|
|
|
..isAntiAlias = true
|
|
|
..strokeWidth = 2
|
|
|
..style = PaintingStyle.stroke;
|
|
|
+
|
|
|
Paint _paintPointPan = Paint()
|
|
|
..color = MeasureColors.Primary
|
|
|
..isAntiAlias = true
|
|
|
..strokeWidth = 2
|
|
|
..style = PaintingStyle.stroke;
|
|
|
+
|
|
|
@override
|
|
|
var remedicalListResultChanged = FEventHandler<List<RemedicalInfoDTO>>();
|
|
|
|
|
@@ -340,6 +359,18 @@ class MeasureDataController implements IMeasureDataController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ void checkCursorColor(Color defaultColor) {
|
|
|
+ Color cursorColor = defaultColor;
|
|
|
+ final value = _measureSystemSetting.cursorColor;
|
|
|
+ if (value != null) {
|
|
|
+ if (value.startsWith("#")) {
|
|
|
+ Color colorFromHex = Color(int.parse(value.substring(1), radix: 16));
|
|
|
+ cursorColor = colorFromHex;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ setPenColor(cursorColor);
|
|
|
+ }
|
|
|
+
|
|
|
bool isContainsValue(List<MeasureSelectModel> list, String? value) {
|
|
|
if (value == null) return false;
|
|
|
for (var item in list) {
|
|
@@ -495,6 +526,15 @@ class MeasureDataController implements IMeasureDataController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @override
|
|
|
+ Paint get paintPen => _paintPen;
|
|
|
+ @override
|
|
|
+ set paintPen(Paint value) {
|
|
|
+ if (value != _paintPen) {
|
|
|
+ _paintPen = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@override
|
|
|
Paint get paintLinePan => _paintLinePan;
|
|
|
@override
|
|
@@ -575,6 +615,17 @@ class MeasureDataController implements IMeasureDataController {
|
|
|
return imageUrl;
|
|
|
}
|
|
|
|
|
|
+ @override
|
|
|
+ void setPenColor(Color color) {
|
|
|
+ paintPen.color = color;
|
|
|
+ paintLinePan.color = color;
|
|
|
+ paintPointPan.color = color;
|
|
|
+ MeasureColors.ActivePrimary = color;
|
|
|
+ if (Get.isRegistered<IApplication>()) {
|
|
|
+ Get.find<IApplication>().updateRenderReady.emit(this, null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
void _onRemedicalListChanged() {
|
|
|
remedicalListResultChanged.emit(this, remedicalList);
|
|
|
}
|