mcy_new #1

Merged
wangyang merged 179 commits from mcy_new into master 2025-08-28 10:10:45 +08:00
2 changed files with 65 additions and 68 deletions
Showing only changes of commit 41b29f19f3 - Show all commits

View File

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

View File

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