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 78 additions and 63 deletions
Showing only changes of commit db43b4a88f - Show all commits

View File

@ -57,7 +57,6 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
child: Obx(() {
LastPage? lastPageVal = sateData.data.value?.lastPage;
if (lastPageVal == null) return const SizedBox();
return FloatingActionButton(
heroTag: '点击前往上一题',
tooltip: '点击前往上一题',
@ -81,7 +80,6 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
child: Obx(() {
NextPage? nextPageVal = sateData.data.value?.nextPage;
if (nextPageVal == null) return const SizedBox();
return FloatingActionButton(
heroTag: '点击前往下一题',
tooltip: '点击前往下一题',
@ -114,8 +112,11 @@ Widget $questionNumberView(BuildContext context, HomeworkReviewState sateData) {
final scrollControllerNum = useScrollController(); //
useEffect(() {
scrollControllerNum.addListener(() {
if (sateData.panQuestView == false) sateData.slide.value = scrollControllerNum.offset;
});
var listenVal = sateData.slide.listen((e) {
if (e != scrollControllerNum.offset) scrollControllerNum.jumpTo(e);
if (e != scrollControllerNum.offset && sateData.panQuestView == true) scrollControllerNum.jumpTo(e);
});
return () {
@ -136,6 +137,8 @@ Widget $questionNumberView(BuildContext context, HomeworkReviewState sateData) {
)
],
),
child: GestureDetector(
onPanDown: (_) => sateData.panQuestView = false,
child: SingleChildScrollView(
controller: scrollControllerNum,
physics: const BouncingScrollPhysics(),
@ -158,7 +161,7 @@ Widget $questionNumberView(BuildContext context, HomeworkReviewState sateData) {
),
);
}),
),
)),
);
}
@ -354,9 +357,17 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
vnHandWritings.value = annotationsData;
});
scrollControllerQuestion.addListener(() => sateData.slide.value = scrollControllerQuestion.offset); //
scrollControllerQuestion.addListener(() {
sateData.slide.value = scrollControllerQuestion.offset;
}); //
var listenVal = sateData.slide.listen((e) {
if (e != scrollControllerQuestion.offset && sateData.panQuestView == false) scrollControllerQuestion.jumpTo(e);
});
//
return () {
listenVal.cancel();
imageStream?.removeListener(imageStreamListener.value);
};
}, []);
@ -369,7 +380,9 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
var imageUrl = sateData.data.value?.zgtAnswer;
if (imageUrl == null) return const SizedBox();
return SingleChildScrollView(
return GestureDetector(
onPanDown: (_) => sateData.panQuestView = true,
child: SingleChildScrollView(
controller: scrollControllerQuestion,
physics: !annotationState.pen.value ? const BouncingScrollPhysics() : const NeverScrollableScrollPhysics(),
padding: EdgeInsets.zero,
@ -414,6 +427,7 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
),
),
),
),
);
}));
}

View File

@ -21,6 +21,7 @@ class HomeworkReviewState {
late Rx<DoPaperDetailsResult?> data;
late Rx<List<StudentQuestions>?> studentQuestions;
late Rx<double> slide; //
late bool? panQuestView;
late Rx<TestQuestionsImageInfo?> imageScale;
// late String dateEnd = '';