Construct chat row contents only when slivers mount them
This commit is contained in:
@@ -1094,17 +1094,24 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
Padding(
|
||||
key: ValueKey<String>(keys[index]),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: _entering(
|
||||
rows[index],
|
||||
_transcriptRow(
|
||||
// Slivers mount only visible rows. Defer constructing
|
||||
// their chips and checking cached widgets until then,
|
||||
// rather than visiting the entire history per delta.
|
||||
child: Builder(
|
||||
builder: (_) => _entering(
|
||||
rows[index],
|
||||
keys[index],
|
||||
onDismissCompaction:
|
||||
compactionNotice != null &&
|
||||
chatNoticeActivityCondition(rows[index]) ==
|
||||
compactionNotice.condition
|
||||
? () => _dismiss(compactionNotice)
|
||||
: null,
|
||||
_transcriptRow(
|
||||
rows[index],
|
||||
keys[index],
|
||||
onDismissCompaction:
|
||||
compactionNotice != null &&
|
||||
chatNoticeActivityCondition(
|
||||
rows[index],
|
||||
) ==
|
||||
compactionNotice.condition
|
||||
? () => _dismiss(compactionNotice)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user