no message

This commit is contained in:
1147192855@qq.com 2024-11-07 10:58:04 +08:00
parent 261d1ad4a4
commit 41b29f19f3
2 changed files with 65 additions and 68 deletions

View File

@ -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,
),
),
],
),
),
],
),
),
),

View File

@ -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();
}
}