feat: 优化口语防重复问答、课程推进流转、键盘输入流畅度与竖屏锁定
- AI口语约束:在对话系统提示词与单轮指导中增加防重复问答约束,避免重复寒暄及索取已提供信息,根据历史自然向前推进 - 课程流转:修复多段课程学完后今日任务卡片流转下一课,及退出重进定位逻辑 - 竖屏锁定:在 Flutter、Android 及 iOS 平台配置仅支持竖屏显示 - 对话交互:优化对话界面文本输入重绘与词汇查询,解决键盘输入卡顿 - 测试用例:补充并更新单轮约束、状态流转与返回键退出测试,212项测试全绿
This commit is contained in:
@@ -64,6 +64,7 @@ class _LessonFlowState extends State<LessonFlow> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.state.addListener(_onStateChange);
|
||||
writingController.text = widget.state.lessonWritingDraft;
|
||||
independentController.text = widget.state.independentAttemptDraft;
|
||||
previewIndex = widget.state.previewIndex
|
||||
@@ -73,11 +74,16 @@ class _LessonFlowState extends State<LessonFlow> {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
widget.state.removeListener(_onStateChange);
|
||||
writingController.dispose();
|
||||
independentController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _onStateChange() {
|
||||
if (mounted) setState(() {});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final lesson = lessonById(widget.state.activeLessonId);
|
||||
@@ -230,19 +236,23 @@ class _LessonFlowState extends State<LessonFlow> {
|
||||
widget.state.activeSegmentIndexFor(lesson.id) ==
|
||||
lesson.segments.length - 1,
|
||||
nextSegmentNumber: widget.state.activeSegmentIndexFor(lesson.id) + 2,
|
||||
onFinish: () {
|
||||
widget.state.finishCurrentLessonSegment();
|
||||
widget.onFinish();
|
||||
},
|
||||
onFinish: _finishOrExit,
|
||||
);
|
||||
}
|
||||
return _LessonScope(
|
||||
title:
|
||||
'第 ${lesson.number} 课 · ${lesson.title} · 第 ${widget.state.activeSegmentIndexFor(lesson.id) + 1}/${lesson.segments.length} 段',
|
||||
onExit: widget.onFinish,
|
||||
onExit: _finishOrExit,
|
||||
child: content,
|
||||
);
|
||||
}
|
||||
|
||||
void _finishOrExit() {
|
||||
if (widget.state.lessonStep == LessonStep.complete) {
|
||||
widget.state.finishCurrentLessonSegment();
|
||||
}
|
||||
widget.onFinish();
|
||||
}
|
||||
}
|
||||
|
||||
class _LessonScaffold extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user