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