perf: reduce state notification fan-out

This commit is contained in:
edde746
2026-07-12 18:59:58 +02:00
parent b4575c9780
commit a561777456
11 changed files with 241 additions and 98 deletions
@@ -390,12 +390,15 @@ class WaitingForParticipantsIndicator extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Selector<WatchTogetherProvider, (bool, List<String>)>(
selector: (_, provider) => (provider.isWaitingForPeers, provider.waitingOnNames),
return Selector<WatchTogetherProvider, (bool, String)>(
selector: (_, provider) {
final waiting = provider.isWaitingForPeers;
return (waiting, waiting ? _label(provider.waitingOnNames) : '');
},
builder: (context, value, child) {
final (isWaiting, names) = value;
final (isWaiting, label) = value;
if (!isWaiting) return const SizedBox.shrink();
return _StatusPill(tvIcon: Symbols.hourglass_empty_rounded, label: _label(names));
return _StatusPill(tvIcon: Symbols.hourglass_empty_rounded, label: label);
},
);
}