feat: 完善听力口语辅助状态记录、练习分块与复习抽查间隔机制

This commit is contained in:
shen
2026-09-23 18:33:22 -07:00
parent 6b42b7abc3
commit d740a9e19c
106 changed files with 2933 additions and 845 deletions
+9 -6
View File
@@ -37,7 +37,8 @@ class UsageCard extends StatelessWidget {
if (usage == null) return const SizedBox.shrink();
final lines = <({String label, String text})>[
if (usage.when.isNotEmpty) (label: '什么时候用', text: usage.when),
if (!compact && usage.reply.isNotEmpty) (label: '对方会怎么答', text: usage.reply),
if (!compact && usage.reply.isNotEmpty)
(label: '对方会怎么答', text: usage.reply),
if (!compact && usage.swap.isNotEmpty) (label: '换个说法', text: usage.swap),
// Mid-exercise only the nearest confusion is worth a line; the full
// list belongs on the preview and lookup cards.
@@ -57,10 +58,9 @@ class UsageCard extends StatelessWidget {
for (final line in lines)
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style.copyWith(
color: AppColors.warmInk,
height: 1.45,
),
style: DefaultTextStyle.of(
context,
).style.copyWith(color: AppColors.warmInk, height: 1.45),
children: [
TextSpan(
text: '${line.label}:',
@@ -94,7 +94,10 @@ class SegmentUsage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ids = findLessonSegment(segmentId)?.targetItemIds ?? const <String>[];
final explained = [for (final id in ids) if (coreUsage(id) != null) id];
final explained = [
for (final id in ids)
if (coreUsage(id) != null) id,
];
if (explained.isEmpty) return const SizedBox.shrink();
return SpacedColumn(
spacing: 8,