perf(tv): reduced visual-effects tier for low-end devices

This commit is contained in:
edde746
2026-06-12 06:30:38 +02:00
parent ad3cc6b986
commit 2b34f4a9d7
25 changed files with 1043 additions and 425 deletions
+17 -8
View File
@@ -253,19 +253,28 @@ class MediaCardState extends State<MediaCard> with ContextMenuTapMixin<MediaCard
/// Grid layout — inlined from former _MediaCardGrid, _PosterOverlay, and
/// flattened Column. Semantics removed (InkWell provides button semantics).
///
/// MergeSemantics collapses the card (texts, progress, button) into ONE
/// semantics node. Browse rails/grids show dozens of cards and the
/// platform-driven semantics pass runs every frame on TV boxes with an
/// accessibility service active — node count is the cost driver. The card
/// has a single action (tap; long-press menu), so merging is safe and gives
/// screen readers one coherent announcement per card.
Widget _buildGridCard(BuildContext context, Object item, String? localPosterPath) {
if (widget.fullBleedImage) {
return LayoutBuilder(
builder: (context, constraints) {
final cardWidth = widget.width ?? (constraints.hasBoundedWidth ? constraints.maxWidth : null);
final cardHeight = widget.height ?? (constraints.hasBoundedHeight ? constraints.maxHeight : null);
if (cardHeight == null) return _buildStandardGridCard(context, item, localPosterPath);
return _buildFullBleedGridCard(context, item, localPosterPath, width: cardWidth, height: cardHeight);
},
return MergeSemantics(
child: LayoutBuilder(
builder: (context, constraints) {
final cardWidth = widget.width ?? (constraints.hasBoundedWidth ? constraints.maxWidth : null);
final cardHeight = widget.height ?? (constraints.hasBoundedHeight ? constraints.maxHeight : null);
if (cardHeight == null) return _buildStandardGridCard(context, item, localPosterPath);
return _buildFullBleedGridCard(context, item, localPosterPath, width: cardWidth, height: cardHeight);
},
),
);
}
return _buildStandardGridCard(context, item, localPosterPath);
return MergeSemantics(child: _buildStandardGridCard(context, item, localPosterPath));
}
Widget _buildFullBleedGridCard(