feat(mobile): UI-01 upload center, capture and auxiliary pages

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-21 17:20:43 +08:00
parent f6929ae18f
commit 1f67b7c818
26 changed files with 2144 additions and 771 deletions
+35 -3
View File
@@ -191,7 +191,7 @@ void main() {
testWidgets('快门即拍即入队:任务落库 queued + 待传徽章 1', (tester) async {
await pumpCapture(tester);
expect(find.text('PREVIEW_MARK'), findsOneWidget, reason: '相机预览就绪');
expect(find.text('Pending 0'), findsOneWidget);
expect(find.text('Queued 0'), findsOneWidget);
await shoot(tester);
@@ -202,7 +202,39 @@ void main() {
expect(tasks.single.albumId, 'alb-1');
expect(tasks.single.categoryId, isNull, reason: '默认分类');
expect(tasks.single.filename, 'IMG_0001.jpg');
expect(find.text('Pending 1'), findsOneWidget, reason: '徽章实时刷新');
expect(find.text('Queued 1'), findsOneWidget, reason: '徽章实时刷新');
});
testWidgets('入队成功反馈:短暂浮层出现(不逐张弹确认,§4.5)',
(tester) async {
await pumpCapture(tester);
// 与 pressRealIo 同法但缩短真实等待(80ms < 200ms 反馈窗):入队链路
// 完成时浮层已翻转、计时器未到期,可在窗内断言不透明度 > 0。
final button = find
.ancestor(of: find.byIcon(Icons.camera), matching: find.byType(IconButton))
.evaluate()
.single
.widget as IconButton;
await tester.runAsync(() async {
button.onPressed!();
await Future<void>.delayed(const Duration(milliseconds: 80));
});
await tester.pump(const Duration(milliseconds: 180));
// 反馈浮层淡入完成(AnimatedOpacity → 1),文案为「已加入队列」。
expect(
tester.widget<AnimatedOpacity>(find.byType(AnimatedOpacity).first).opacity,
greaterThan(0),
reason: '200ms 反馈窗内浮层可见',
);
expect(find.text('Added to queue'), findsOneWidget);
// 等待 200ms 反馈计时器在真实事件循环中到期,避免悬挂计时器;随后
// fake pump 冲刷淡出动画帧。
await tester.runAsync(
() async => Future<void>.delayed(const Duration(milliseconds: 250)),
);
await tester.pump(const Duration(milliseconds: 400));
});
testWidgets('连拍两张串行入队(不逐张确认)', (tester) async {
@@ -215,7 +247,7 @@ void main() {
'IMG_0001.jpg',
'IMG_0002.jpg',
]));
expect(find.text('Pending 2'), findsOneWidget);
expect(find.text('Queued 2'), findsOneWidget);
});
testWidgets('分类切换:hint 提示 + 仅影响之后拍摄(A15 归属不变)',