移除高频 print 日志
This commit is contained in:
parent
c7afafc3aa
commit
2ac88000cc
|
|
@ -133,7 +133,7 @@ Widget $questionNumberScrollView({
|
||||||
|
|
||||||
// var actualImgHeight = useImageInfo.value?.actualImgHeight ?? 0; // 实际图片高度
|
// var actualImgHeight = useImageInfo.value?.actualImgHeight ?? 0; // 实际图片高度
|
||||||
|
|
||||||
print("图片高度:${usePiddingTop.value}");
|
// 移除高频日志,避免在滚动/缩放时造成不必要的 I/O 开销
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
controller: scrollControllerNum,
|
controller: scrollControllerNum,
|
||||||
|
|
@ -183,7 +183,6 @@ Widget $scoringQuestionsView(
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
/// 学生打分数据
|
/// 学生打分数据
|
||||||
studentScoreListener() {
|
studentScoreListener() {
|
||||||
print(item.toJson());
|
|
||||||
item.studentScore = studentScore.value;
|
item.studentScore = studentScore.value;
|
||||||
try {
|
try {
|
||||||
var theVal = sateData.studentQuestions.value?.firstWhere((e) => e.questionNo == item.questionNo);
|
var theVal = sateData.studentQuestions.value?.firstWhere((e) => e.questionNo == item.questionNo);
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin, EventBus
|
||||||
state.studentQuestions.value = data.studentQuestions; // 赋值试题集合
|
state.studentQuestions.value = data.studentQuestions; // 赋值试题集合
|
||||||
state.data.value = data;
|
state.data.value = data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('获取数据报错了:$e');
|
// 移除冗余打印,使用提示替代
|
||||||
state.getDataError.value = true;
|
state.getDataError.value = true;
|
||||||
ToastUtils.showError('获取试题数据失败,请检查网络连接后重试');
|
ToastUtils.showError('获取试题数据失败,请检查网络连接后重试');
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -247,8 +247,7 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin, EventBus
|
||||||
|
|
||||||
return imgKey;
|
return imgKey;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('图片上传失败');
|
// 图片上传失败日志移除,统一提示
|
||||||
print(e.toString());
|
|
||||||
ToastUtils.getFluttertoast(msg: '图片上传失败', context: context);
|
ToastUtils.getFluttertoast(msg: '图片上传失败', context: context);
|
||||||
} finally {
|
} finally {
|
||||||
// ToastUtils.dismiss();
|
// ToastUtils.dismiss();
|
||||||
|
|
@ -331,7 +330,7 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin, EventBus
|
||||||
ToastUtils.showSuccess("批阅已提交");
|
ToastUtils.showSuccess("批阅已提交");
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("批阅提交报错 $e");
|
// 提交异常日志移除,统一提示
|
||||||
ToastUtils.showError('提交失败,请检查网络连接后重试');
|
ToastUtils.showError('提交失败,请检查网络连接后重试');
|
||||||
} finally {
|
} finally {
|
||||||
state.submitLoading.value = false;
|
state.submitLoading.value = false;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ class ZoomLogic extends GetxController {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((e) {
|
WidgetsBinding.instance.addPostFrameCallback((e) {
|
||||||
/// 试题加载后更新尺寸对象(只要题号没有变就不更新尺寸对象)
|
/// 试题加载后更新尺寸对象(只要题号没有变就不更新尺寸对象)
|
||||||
_streamHomework = homeworkReviewLogic.state.data.listen((e) {
|
_streamHomework = homeworkReviewLogic.state.data.listen((e) {
|
||||||
print("HOMEWORKSTATE 变化了");
|
|
||||||
var zoomFile = zoomState.zoomFile.value;
|
var zoomFile = zoomState.zoomFile.value;
|
||||||
if (e == null || zoomFile == null) return;
|
if (e == null || zoomFile == null) return;
|
||||||
|
|
||||||
|
|
@ -83,7 +82,7 @@ class ZoomLogic extends GetxController {
|
||||||
|
|
||||||
oldTemplateId = templateId;
|
oldTemplateId = templateId;
|
||||||
final fileSize = imageSizeMap[templateId];
|
final fileSize = imageSizeMap[templateId];
|
||||||
print("fileSize: ${fileSize?.toJson()}");
|
// 移除冗余日志,避免频繁 I/O
|
||||||
if (fileSize != null) {
|
if (fileSize != null) {
|
||||||
zoomState.zoomFile.value = fileSize;
|
zoomState.zoomFile.value = fileSize;
|
||||||
return;
|
return;
|
||||||
|
|
@ -113,8 +112,6 @@ class ZoomLogic extends GetxController {
|
||||||
|
|
||||||
// 缩放组件 ==> 缩放监听
|
// 缩放组件 ==> 缩放监听
|
||||||
void onScaleUpdate(double zoom) async {
|
void onScaleUpdate(double zoom) async {
|
||||||
print("缩放比例:$zoom");
|
|
||||||
|
|
||||||
/// 防抖
|
/// 防抖
|
||||||
zoomState.initScale.value = zoom;
|
zoomState.initScale.value = zoom;
|
||||||
// anti_shake_throttling.debounce(() => zoomState.initScale.value = zoom, const Duration(milliseconds: 100))();
|
// anti_shake_throttling.debounce(() => zoomState.initScale.value = zoom, const Duration(milliseconds: 100))();
|
||||||
|
|
@ -124,8 +121,6 @@ class ZoomLogic extends GetxController {
|
||||||
void onPanUpPosition(Offset val) async {
|
void onPanUpPosition(Offset val) async {
|
||||||
// 手指在移动 非物体移动的位置
|
// 手指在移动 非物体移动的位置
|
||||||
var state = homeworkReviewLogic.state;
|
var state = homeworkReviewLogic.state;
|
||||||
print('**************** 正在移动位置 YYY:${val.dy}');
|
|
||||||
print('**************** 正在移动位置 XXX:${val.dx}');
|
|
||||||
state.zoomOffset = val;
|
state.zoomOffset = val;
|
||||||
state.slide.value = val.dy.abs().toInt().toDouble();
|
state.slide.value = val.dy.abs().toInt().toDouble();
|
||||||
}
|
}
|
||||||
|
|
@ -138,18 +133,6 @@ class ZoomLogic extends GetxController {
|
||||||
// 重置位置偏移
|
// 重置位置偏移
|
||||||
homeworkReviewLogic.state.zoomOffset = Offset.zero;
|
homeworkReviewLogic.state.zoomOffset = Offset.zero;
|
||||||
homeworkReviewLogic.state.slide.value = 0.0;
|
homeworkReviewLogic.state.slide.value = 0.0;
|
||||||
|
|
||||||
// final zoomFile = zoomState.zoomFile.value;
|
|
||||||
// final double imageOffsetY = (zoomFile?.imageHeightOffsetStart ?? 0).toDouble();
|
|
||||||
// final controller = homeworkReviewLogic.zoomController;
|
|
||||||
// if (controller != null) {
|
|
||||||
// // 以单位矩阵为基,设置垂直平移到居中位置
|
|
||||||
// final Matrix4 centered = Matrix4.identity()..setTranslationRaw(0, imageOffsetY > 0 ? imageOffsetY : 0, 0);
|
|
||||||
|
|
||||||
// controller.value = centered;
|
|
||||||
// }
|
|
||||||
|
|
||||||
print('缩放已重置');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue