refactor(empty-state): 空状态支持内容居中

This commit is contained in:
Zhou Weidong committed 2026-11-02 14:44:38 +08:00
1 parent 59fbd33059
commit 7463d3ee26
8 files changed
+131 -80

No files matched your search

+21
View File
@@ -209,6 +209,27 @@ void main() {
expect(find.text('The Signal'), findsOneWidget);
});
testWidgets('should_center_empty_state_in_remaining_page_space', (
tester,
) async {
final auth = await _auth(signedIn: true);
await _pumpPage(
tester,
auth: auth,
history: CountingWatchHistory(const []),
catalog: FakeCatalogRepository(),
);
final viewport = tester.getRect(
find.byKey(const Key('watch-records-empty-scroll')),
);
final content = tester.getRect(
find.byKey(const Key('empty-state-content')),
);
expect(content.center.dx, closeTo(viewport.center.dx, 0.1));
expect(content.center.dy, closeTo(viewport.center.dy, 0.1));
});
testWidgets('should_remove_and_clear_device_history_when_signed_out', (
tester,
) async {