Perf round 4: lazy chat sessions list

Chat sections are slivers: a lazy, keyed SliverList under the same heading,
with SliverAnimatedExtent reproducing the clipped AnimatedSize for open,
close and arriving rows. The first Chat tab visit no longer builds every row
(150 chats: worst build frame 116 ms to 19 ms).
This commit is contained in:
2026-11-02 14:28:33 +00:00
parent 2f6d967f3b
commit 8fd55cb7eb
9 changed files with 597 additions and 188 deletions
@@ -111,8 +111,11 @@ void main() {
'rowRebuilds=${rebuilds.of(ChatSessionRow)} '
'totalRebuilds=${rebuilds.total}',
);
// One row per change, not all 200 (10,000 row rebuilds before).
expect(rebuilds.of(ChatSessionRow), 50);
// Only the rows on screen are built (the list is lazy) ...
expect(built, lessThan(40));
// ... and at most the changed row rebuilds per change, not all 200
// (10,000 row rebuilds before); a change to an offscreen row builds none.
expect(rebuilds.of(ChatSessionRow), inInclusiveRange(1, 50));
});
testWidgets('gallery: open a visit with 500 artifacts', (tester) async {