no message
This commit is contained in:
parent
4b92774cc8
commit
db43b4a88f
|
|
@ -57,7 +57,6 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
LastPage? lastPageVal = sateData.data.value?.lastPage;
|
LastPage? lastPageVal = sateData.data.value?.lastPage;
|
||||||
if (lastPageVal == null) return const SizedBox();
|
if (lastPageVal == null) return const SizedBox();
|
||||||
|
|
||||||
return FloatingActionButton(
|
return FloatingActionButton(
|
||||||
heroTag: '点击前往上一题',
|
heroTag: '点击前往上一题',
|
||||||
tooltip: '点击前往上一题',
|
tooltip: '点击前往上一题',
|
||||||
|
|
@ -81,7 +80,6 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
NextPage? nextPageVal = sateData.data.value?.nextPage;
|
NextPage? nextPageVal = sateData.data.value?.nextPage;
|
||||||
if (nextPageVal == null) return const SizedBox();
|
if (nextPageVal == null) return const SizedBox();
|
||||||
|
|
||||||
return FloatingActionButton(
|
return FloatingActionButton(
|
||||||
heroTag: '点击前往下一题',
|
heroTag: '点击前往下一题',
|
||||||
tooltip: '点击前往下一题',
|
tooltip: '点击前往下一题',
|
||||||
|
|
@ -114,8 +112,11 @@ Widget $questionNumberView(BuildContext context, HomeworkReviewState sateData) {
|
||||||
final scrollControllerNum = useScrollController(); // 试题题号区域
|
final scrollControllerNum = useScrollController(); // 试题题号区域
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
|
scrollControllerNum.addListener(() {
|
||||||
|
if (sateData.panQuestView == false) sateData.slide.value = scrollControllerNum.offset;
|
||||||
|
});
|
||||||
var listenVal = sateData.slide.listen((e) {
|
var listenVal = sateData.slide.listen((e) {
|
||||||
if (e != scrollControllerNum.offset) scrollControllerNum.jumpTo(e);
|
if (e != scrollControllerNum.offset && sateData.panQuestView == true) scrollControllerNum.jumpTo(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
return () {
|
return () {
|
||||||
|
|
@ -136,6 +137,8 @@ Widget $questionNumberView(BuildContext context, HomeworkReviewState sateData) {
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
child: GestureDetector(
|
||||||
|
onPanDown: (_) => sateData.panQuestView = false,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
controller: scrollControllerNum,
|
controller: scrollControllerNum,
|
||||||
physics: const BouncingScrollPhysics(),
|
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;
|
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 () {
|
return () {
|
||||||
|
listenVal.cancel();
|
||||||
imageStream?.removeListener(imageStreamListener.value);
|
imageStream?.removeListener(imageStreamListener.value);
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
@ -369,7 +380,9 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
||||||
var imageUrl = sateData.data.value?.zgtAnswer;
|
var imageUrl = sateData.data.value?.zgtAnswer;
|
||||||
if (imageUrl == null) return const SizedBox();
|
if (imageUrl == null) return const SizedBox();
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return GestureDetector(
|
||||||
|
onPanDown: (_) => sateData.panQuestView = true,
|
||||||
|
child: SingleChildScrollView(
|
||||||
controller: scrollControllerQuestion,
|
controller: scrollControllerQuestion,
|
||||||
physics: !annotationState.pen.value ? const BouncingScrollPhysics() : const NeverScrollableScrollPhysics(),
|
physics: !annotationState.pen.value ? const BouncingScrollPhysics() : const NeverScrollableScrollPhysics(),
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
|
|
@ -414,6 +427,7 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ class HomeworkReviewState {
|
||||||
late Rx<DoPaperDetailsResult?> data;
|
late Rx<DoPaperDetailsResult?> data;
|
||||||
late Rx<List<StudentQuestions>?> studentQuestions;
|
late Rx<List<StudentQuestions>?> studentQuestions;
|
||||||
late Rx<double> slide; // 滑动位置
|
late Rx<double> slide; // 滑动位置
|
||||||
|
late bool? panQuestView;
|
||||||
late Rx<TestQuestionsImageInfo?> imageScale;
|
late Rx<TestQuestionsImageInfo?> imageScale;
|
||||||
|
|
||||||
// late String dateEnd = '';
|
// late String dateEnd = '';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue