no message
This commit is contained in:
parent
d3509a2eee
commit
952e181e45
|
|
@ -34,18 +34,11 @@ class AnswerHandwriting extends Dialog {
|
||||||
final int? questionNo;
|
final int? questionNo;
|
||||||
final Function closeCall;
|
final Function closeCall;
|
||||||
AnswerHandwriting(
|
AnswerHandwriting(
|
||||||
{super.key, required this.homeworkId, required this.studentId, required this.closeCall, this.templateId, this.pageNum, this.questionNo}) {
|
{super.key, required this.homeworkId, required this.studentId, required this.closeCall, this.templateId, this.pageNum, this.questionNo});
|
||||||
Get.find<HandwritingLogic>().params.value = OriginalManuscriptHandwritingParams(
|
|
||||||
homeworkId: homeworkId,
|
|
||||||
studentId: studentId,
|
|
||||||
templateId: templateId,
|
|
||||||
pageNum: pageNum,
|
|
||||||
questionNo: questionNo,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
final _handwritingLogic = Get.find<HandwritingLogic>();
|
final _handwritingLogic = Get.find<HandwritingLogic>();
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return OrientationBuilder(builder: (BuildContext context, Orientation orientation) {
|
||||||
var boxHeight = ScreenUtil().screenHeight / 1.168; // 盒子高度
|
var boxHeight = ScreenUtil().screenHeight / 1.168; // 盒子高度
|
||||||
var boxWidth = ScreenUtil().screenWidth - (ScreenUtil().scaleWidth < 1.5 ? 40.r : 40.r); // 盒子宽度
|
var boxWidth = ScreenUtil().screenWidth - (ScreenUtil().scaleWidth < 1.5 ? 40.r : 40.r); // 盒子宽度
|
||||||
|
|
||||||
|
|
@ -67,6 +60,7 @@ class AnswerHandwriting extends Dialog {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -78,12 +72,18 @@ Future<void> showAnswerHandwriting(
|
||||||
int? pageNum,
|
int? pageNum,
|
||||||
int? questionNo,
|
int? questionNo,
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
|
||||||
backCall() {
|
backCall() {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
Get.put(HandwritingLogic(backCall));
|
Get.put(HandwritingLogic(backCall));
|
||||||
|
Get.find<HandwritingLogic>().params.value = OriginalManuscriptHandwritingParams(
|
||||||
|
homeworkId: homeworkId,
|
||||||
|
studentId: studentId,
|
||||||
|
templateId: templateId,
|
||||||
|
pageNum: pageNum,
|
||||||
|
questionNo: questionNo,
|
||||||
|
);
|
||||||
await showDialog(
|
await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) => AnswerHandwriting(
|
builder: (BuildContext context) => AnswerHandwriting(
|
||||||
|
|
@ -94,10 +94,7 @@ Future<void> showAnswerHandwriting(
|
||||||
questionNo: questionNo,
|
questionNo: questionNo,
|
||||||
closeCall: backCall,
|
closeCall: backCall,
|
||||||
),
|
),
|
||||||
);
|
).then((e) => Get.delete<HandwritingLogic>());
|
||||||
} finally {
|
|
||||||
Get.delete<HandwritingLogic>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 主图
|
// 主图
|
||||||
|
|
@ -364,7 +361,12 @@ class _HandwritingDrawBoxState extends State<HandwritingDrawBox> with EventBusMi
|
||||||
_packagedHandwritingDataAll = [];
|
_packagedHandwritingDataAll = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// _vnPrimaryHandWritings.is
|
||||||
|
try {
|
||||||
_vnPrimaryHandWritings.value = [..._packagedHandwritingDataAll]; // 总体数据
|
_vnPrimaryHandWritings.value = [..._packagedHandwritingDataAll]; // 总体数据
|
||||||
|
} catch (e) {
|
||||||
|
_vnPrimaryHandWritings = ValueNotifier<List<GestureHandwritingRecording>>(_packagedHandwritingDataAll);
|
||||||
|
}
|
||||||
// eventFire(model: JobHandwritingPlaybarBus);
|
// eventFire(model: JobHandwritingPlaybarBus);
|
||||||
});
|
});
|
||||||
showManuscriptStream = handwritingLogic.toolbar.showManuscript.listen((e) {
|
showManuscriptStream = handwritingLogic.toolbar.showManuscript.listen((e) {
|
||||||
|
|
@ -379,7 +381,13 @@ class _HandwritingDrawBoxState extends State<HandwritingDrawBox> with EventBusMi
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
executionDataStream = handwritingLogic.toolbar.executionData.listen((e) => _vnHandWritings.value = e);
|
executionDataStream = handwritingLogic.toolbar.executionData.listen((e) {
|
||||||
|
try {
|
||||||
|
_vnHandWritings.value = e;
|
||||||
|
} catch (e1) {
|
||||||
|
_vnHandWritings = ValueNotifier<List<GestureHandwritingRecording>>(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
eventOn(callback: (e) {
|
eventOn(callback: (e) {
|
||||||
switch (e.runtimeType) {
|
switch (e.runtimeType) {
|
||||||
|
|
@ -421,6 +429,8 @@ class _HandwritingDrawBoxState extends State<HandwritingDrawBox> with EventBusMi
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
imageStream?.removeListener(theImageStreamListener);
|
imageStream?.removeListener(theImageStreamListener);
|
||||||
|
_vnHandWritings.dispose();
|
||||||
|
_vnPrimaryHandWritings.dispose();
|
||||||
showManuscriptStream.cancel();
|
showManuscriptStream.cancel();
|
||||||
executionDataStream.cancel();
|
executionDataStream.cancel();
|
||||||
eventCancel();
|
eventCancel();
|
||||||
|
|
@ -537,7 +547,8 @@ class _HandwritingDrawBoxState extends State<HandwritingDrawBox> with EventBusMi
|
||||||
imageUrl: paperPicture,
|
imageUrl: paperPicture,
|
||||||
(context, imageProvider) {
|
(context, imageProvider) {
|
||||||
Image imageWidget = Image(image: imageProvider, fit: BoxFit.contain);
|
Image imageWidget = Image(image: imageProvider, fit: BoxFit.contain);
|
||||||
if (handwritingLogic.imagInfoModel.value == null) {
|
var imagInfoModel = handwritingLogic.imagInfoModel.value;
|
||||||
|
if (imagInfoModel == null || imagInfoModel.boxWidth != widget.boxWidth) {
|
||||||
imageStream?.removeListener(theImageStreamListener);
|
imageStream?.removeListener(theImageStreamListener);
|
||||||
imageStream = imageWidget.image.resolve(const ImageConfiguration());
|
imageStream = imageWidget.image.resolve(const ImageConfiguration());
|
||||||
imageStream?.addListener(theImageStreamListener);
|
imageStream?.addListener(theImageStreamListener);
|
||||||
|
|
@ -873,7 +884,6 @@ class StudentManuscriptBtn extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Obx(() {
|
return Obx(() {
|
||||||
print('显示原噶:${handwritingLogic.toolbar.showManuscript.value}');
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => easyThrottle('job_handwriting_udent_manuscript', () {
|
onTap: () => easyThrottle('job_handwriting_udent_manuscript', () {
|
||||||
var showManuscript = handwritingLogic.toolbar.showManuscript.value;
|
var showManuscript = handwritingLogic.toolbar.showManuscript.value;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// 逻辑文件
|
// 逻辑文件
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:making_school_asignment_app/common/config/request_config.dart';
|
import 'package:making_school_asignment_app/common/config/request_config.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/marking_models/do_test_questions_image_info.dart';
|
import 'package:making_school_asignment_app/common/job/marking_models/do_test_questions_image_info.dart';
|
||||||
|
|
@ -33,6 +34,7 @@ class HandwritingLogic extends GetxController with RequestToolMixin {
|
||||||
ever(params, (callback) => getData());
|
ever(params, (callback) => getData());
|
||||||
ever(imagInfoModel, (callback) {
|
ever(imagInfoModel, (callback) {
|
||||||
// 图像数据初始化后 计算笔迹数据
|
// 图像数据初始化后 计算笔迹数据
|
||||||
|
toolbar.initialization.value = false;
|
||||||
handwritingInfo.value = getHandwritingDetail(resultData.value);
|
handwritingInfo.value = getHandwritingDetail(resultData.value);
|
||||||
getCalculatedSize();
|
getCalculatedSize();
|
||||||
});
|
});
|
||||||
|
|
@ -67,24 +69,25 @@ class HandwritingLogic extends GetxController with RequestToolMixin {
|
||||||
double scaleRatio = imagInfoModel.value!.scaleRatio;
|
double scaleRatio = imagInfoModel.value!.scaleRatio;
|
||||||
if (mapData.isNotEmpty) {
|
if (mapData.isNotEmpty) {
|
||||||
List<int> keys = mapData.keys.toList();
|
List<int> keys = mapData.keys.toList();
|
||||||
|
print('重新计算:${scaleRatio}');
|
||||||
List<List<GestureHandwritingRecording>> _packagedHandwritingDatas = [];
|
List<List<GestureHandwritingRecording>> _packagedHandwritingDatas = [];
|
||||||
List<GestureHandwritingRecording> _packagedHandwritingDataAll = [];
|
List<GestureHandwritingRecording> _packagedHandwritingDataAll = [];
|
||||||
for (var i = 0; i < keys.length; i++) {
|
for (var i = 0; i < keys.length; i++) {
|
||||||
List<GestureHandwritingRecording> newTrajectoryData = mapData[keys[i]]!.map((e) {
|
List<GestureHandwritingRecording> newTrajectoryData = mapData[keys[i]]!.map((e) {
|
||||||
double theX = e.x;
|
// double theX = e.x;
|
||||||
double theY = e.y;
|
// double theY = e.y;
|
||||||
if (!e.initialization) {
|
// if (!e.initialization) {
|
||||||
// 未初始化基准
|
// // 未初始化基准
|
||||||
e.toInitialization(scaleRatio);
|
// e.toInitialization(scaleRatio);
|
||||||
theX = e.x;
|
// theX = e.x;
|
||||||
theY = e.y;
|
// theY = e.y;
|
||||||
}
|
// }
|
||||||
return GestureHandwritingRecording(
|
return GestureHandwritingRecording(
|
||||||
data: Offset(theX, theY),
|
stroke: e.stroke,
|
||||||
|
data: Offset(e.x * scaleRatio, e.y * scaleRatio),
|
||||||
|
// data: Offset(theX, theY),
|
||||||
usageTime: e.time.toInt(),
|
usageTime: e.time.toInt(),
|
||||||
intervalTime: e.intervalTime,
|
intervalTime: e.intervalTime,
|
||||||
stroke: e.stroke,
|
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|
@ -101,6 +104,7 @@ class HandwritingLogic extends GetxController with RequestToolMixin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 数据笔画处理计算
|
||||||
HandwritingInfo? getHandwritingDetail(JobHandwriting? theData) {
|
HandwritingInfo? getHandwritingDetail(JobHandwriting? theData) {
|
||||||
if (theData == null) return null;
|
if (theData == null) return null;
|
||||||
// 笔画分组
|
// 笔画分组
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue