|
@@ -39,9 +39,6 @@ class _AIPaintInfoState extends State<AIPaintInfo> {
|
|
|
/// ai结果
|
|
|
late final List<AIDiagnosisPerImageDTO> aiResult = [];
|
|
|
|
|
|
- /// ai json 数据
|
|
|
- String? aiResults;
|
|
|
-
|
|
|
/// 测量AI数据
|
|
|
final measureData = Get.find<MeasureDataController>();
|
|
|
|
|
@@ -51,6 +48,9 @@ class _AIPaintInfoState extends State<AIPaintInfo> {
|
|
|
/// ai结果图展示
|
|
|
late List<Offset> aiResultsList = [];
|
|
|
|
|
|
+ /// ai json 数据
|
|
|
+ late String? aiResults = measureData.aiResults;
|
|
|
+
|
|
|
/// ai的横纵坐标 四个点
|
|
|
late Offset p1 = Offset.zero;
|
|
|
late Offset p2 = Offset.zero;
|
|
@@ -69,7 +69,17 @@ class _AIPaintInfoState extends State<AIPaintInfo> {
|
|
|
void onMeasuredAIResultsInfoChanged(Object sender, String e) {
|
|
|
if (e.isNotEmpty) {
|
|
|
aiResults = e;
|
|
|
-
|
|
|
+ final measureDataAIResults = jsonDecode(
|
|
|
+ aiResults ?? '',
|
|
|
+ );
|
|
|
+ for (int i = 0; i < (measureDataAIResults as List).length; i++) {
|
|
|
+ aiResult.add(
|
|
|
+ AIDiagnosisPerImageDTO.fromJson(
|
|
|
+ measureDataAIResults[i],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+ print('ffffffffffffffffffffff');
|
|
|
setState(() {});
|
|
|
}
|
|
|
}
|
|
@@ -179,14 +189,14 @@ class _AIPaintInfoState extends State<AIPaintInfo> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @override
|
|
|
- void didUpdateWidget(covariant AIPaintInfo oldWidget) {
|
|
|
- if (oldWidget.controller != widget.controller) {
|
|
|
- throw UnsupportedError("[VidTestPlayer] unsupport replace controller.");
|
|
|
- }
|
|
|
+ // @override
|
|
|
+ // void didUpdateWidget(covariant AIPaintInfo oldWidget) {
|
|
|
+ // if (oldWidget.controller != widget.controller) {
|
|
|
+ // throw UnsupportedError("[VidTestPlayer] unsupport replace controller.");
|
|
|
+ // }
|
|
|
|
|
|
- super.didUpdateWidget(oldWidget);
|
|
|
- }
|
|
|
+ // super.didUpdateWidget(oldWidget);
|
|
|
+ // }
|
|
|
|
|
|
@override
|
|
|
void initState() {
|
|
@@ -227,7 +237,6 @@ class _AIPaintInfoState extends State<AIPaintInfo> {
|
|
|
return const SizedBox();
|
|
|
} else {
|
|
|
return CustomMultiChildLayout(
|
|
|
- key: UniqueKey(),
|
|
|
delegate: _LayerLayoutDelegate(),
|
|
|
children: [
|
|
|
LayoutId(
|
|
@@ -269,6 +278,7 @@ class _AIPaintInfoState extends State<AIPaintInfo> {
|
|
|
Widget buildBox(BuildContext context, Widget child) {
|
|
|
return Container(
|
|
|
alignment: Alignment.center,
|
|
|
+ key: ValueKey(measureData.itemCurrentImage),
|
|
|
child: child,
|
|
|
);
|
|
|
}
|
|
@@ -297,19 +307,6 @@ class _AIPaintInfoState extends State<AIPaintInfo> {
|
|
|
application.updateRenderReady.addListener(_onMeasureRerenderReady);
|
|
|
measureData.aiResultsInfoChanged
|
|
|
.addListener(onMeasuredAIResultsInfoChanged);
|
|
|
- await Future.delayed(const Duration(milliseconds: 300), () {
|
|
|
- final measureDataAIResults = jsonDecode(
|
|
|
- (aiResults ?? '').isEmpty ? measureData.aiResults : aiResults ?? '',
|
|
|
- );
|
|
|
- for (int i = 0; i < (measureDataAIResults as List).length; i++) {
|
|
|
- aiResult.add(
|
|
|
- AIDiagnosisPerImageDTO.fromJson(
|
|
|
- measureDataAIResults[i],
|
|
|
- ),
|
|
|
- );
|
|
|
- }
|
|
|
- setState(() {});
|
|
|
- });
|
|
|
}
|
|
|
|
|
|
void _removeListenrs() {
|