no message
This commit is contained in:
parent
261d1ad4a4
commit
41b29f19f3
|
|
@ -586,77 +586,75 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
|||
|
||||
if (imageUrl == null) return const SizedBox();
|
||||
|
||||
return GestureDetector(
|
||||
onPanDown: (_) => sateData.panQuestView = true,
|
||||
child: SingleChildScrollView(
|
||||
controller: scrollControllerQuestion,
|
||||
physics: !annotationState.pen.value ? const BouncingScrollPhysics() : const NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.zero,
|
||||
scrollDirection: Axis.vertical, // 设置垂直滚动
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.2), offset: Offset(-6.r, 1.r), blurRadius: 10.r, spreadRadius: 8.r)]),
|
||||
child: Listener(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onPointerDown: (PointerDownEvent event) {
|
||||
// 判断当前是否已经有触摸点,如果有则忽略该触摸事件
|
||||
return SingleChildScrollView(
|
||||
controller: scrollControllerQuestion,
|
||||
physics: !annotationState.pen.value ? const BouncingScrollPhysics() : const NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.zero,
|
||||
scrollDirection: Axis.vertical, // 设置垂直滚动
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.2), offset: Offset(-6.r, 1.r), blurRadius: 10.r, spreadRadius: 8.r)]),
|
||||
child: Listener(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onPointerDown: (PointerDownEvent event) {
|
||||
// 判断当前是否已经有触摸点,如果有则忽略该触摸事件
|
||||
|
||||
// 处理单个触摸点按下的逻辑
|
||||
activePointers++;
|
||||
},
|
||||
onPointerUp: (PointerUpEvent details) {
|
||||
// 处理单个触摸点抬起的逻辑
|
||||
// activePointers--;
|
||||
// globalPosition = null;
|
||||
activePointers--;
|
||||
// 处理单个触摸点按下的逻辑
|
||||
activePointers++;
|
||||
sateData.panQuestView = true;
|
||||
},
|
||||
onPointerUp: (PointerUpEvent details) {
|
||||
// 处理单个触摸点抬起的逻辑
|
||||
// activePointers--;
|
||||
// globalPosition = null;
|
||||
activePointers--;
|
||||
|
||||
var imageScale = sateData.imageScale.value;
|
||||
if (imageScale == null || !annotationState.pen.value) return;
|
||||
vnHandWritings.value.add(null); // 增加空点以分隔不同的线段
|
||||
sateData.handwritings = vnHandWritings.value; // 添加笔迹数据
|
||||
},
|
||||
onPointerMove: (PointerMoveEvent event) {
|
||||
if (activePointers != 1) return;
|
||||
var imageScale = sateData.imageScale.value;
|
||||
if (imageScale == null || !annotationState.pen.value) return;
|
||||
vnHandWritings.value.add(null); // 增加空点以分隔不同的线段
|
||||
sateData.handwritings = vnHandWritings.value; // 添加笔迹数据
|
||||
},
|
||||
onPointerMove: (PointerMoveEvent event) {
|
||||
if (activePointers != 1) return;
|
||||
|
||||
var imageScale = sateData.imageScale.value;
|
||||
if (imageScale == null || !annotationState.pen.value) return;
|
||||
Offset localPosition = event.localPosition;
|
||||
var dy = localPosition.dy;
|
||||
if (dy > imageScale.actualImgHeight || dy < 0) return; // 检查笔记是否超出图片范围
|
||||
var imageScale = sateData.imageScale.value;
|
||||
if (imageScale == null || !annotationState.pen.value) return;
|
||||
Offset localPosition = event.localPosition;
|
||||
var dy = localPosition.dy;
|
||||
if (dy > imageScale.actualImgHeight || dy < 0) return; // 检查笔记是否超出图片范围
|
||||
|
||||
vnHandWritings.value = List.from(vnHandWritings.value)..add(localPosition);
|
||||
sateData.handwritings = vnHandWritings.value;
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
$TheCachedNetworkImage(
|
||||
imageUrl: imageUrl,
|
||||
imgWidth: maxWidth,
|
||||
(context, imageProvider) {
|
||||
Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth);
|
||||
imageStream?.removeListener(imageStreamListener.value);
|
||||
imageStream = imageWidget.image.resolve(const ImageConfiguration())..addListener(imageStreamListener.value);
|
||||
// return imageWidget;
|
||||
return imageWidget;
|
||||
},
|
||||
vnHandWritings.value = List.from(vnHandWritings.value)..add(localPosition);
|
||||
sateData.handwritings = vnHandWritings.value;
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
$TheCachedNetworkImage(
|
||||
imageUrl: imageUrl,
|
||||
imgWidth: maxWidth,
|
||||
(context, imageProvider) {
|
||||
Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth);
|
||||
imageStream?.removeListener(imageStreamListener.value);
|
||||
imageStream = imageWidget.image.resolve(const ImageConfiguration())..addListener(imageStreamListener.value);
|
||||
// return imageWidget;
|
||||
return imageWidget;
|
||||
},
|
||||
),
|
||||
RepaintBoundary(
|
||||
key: logic.pictureOverviewKey,
|
||||
child: CustomPaint(
|
||||
isComplex: true,
|
||||
size: customPaintSize.value,
|
||||
foregroundPainter: DrawingPainter(ctrl: vnHandWritings),
|
||||
child: showZgtAnnotate != null
|
||||
? $TheCachedNetworkImage(
|
||||
imgWidth: maxWidth,
|
||||
imageUrl: showZgtAnnotate,
|
||||
(_, imageProvider) => Image(image: imageProvider, fit: BoxFit.fitWidth),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
RepaintBoundary(
|
||||
key: logic.pictureOverviewKey,
|
||||
child: CustomPaint(
|
||||
isComplex: true,
|
||||
size: customPaintSize.value,
|
||||
foregroundPainter: DrawingPainter(ctrl: vnHandWritings),
|
||||
child: showZgtAnnotate != null
|
||||
? $TheCachedNetworkImage(
|
||||
imgWidth: maxWidth,
|
||||
imageUrl: showZgtAnnotate,
|
||||
(_, imageProvider) => Image(image: imageProvider, fit: BoxFit.fitWidth),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -107,11 +107,10 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
|||
state.studentQuestions.value = data.studentQuestions;
|
||||
} catch (e) {
|
||||
print('获取数据报错了:$e');
|
||||
ToastUtils.showError('未获取到试题数据,请重试');
|
||||
// ToastUtils.showError('未获取到试题数据,请重试');
|
||||
state.getDataError.value = true;
|
||||
} finally {
|
||||
if (timerControl.isActive) timerControl.cancel();
|
||||
|
||||
ToastUtils.dismiss();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue