feat: inline season tabs and d-pad focus improvements

This commit is contained in:
edde746
2026-03-12 00:57:51 +01:00
parent 1a4516bdd1
commit c062dd944e
9 changed files with 629 additions and 568 deletions
+12
View File
@@ -1,5 +1,17 @@
import 'package:flutter/widgets.dart';
/// Scroll the nearest scrollable ancestor so [context] is centered.
///
/// Uses [Scrollable.ensureVisible] with alignment 0.5 (center).
/// Runs in a post-frame callback to ensure layout is complete.
void scrollContextToCenter(BuildContext? context) {
if (context == null) return;
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!context.mounted) return;
Scrollable.ensureVisible(context, alignment: 0.5, duration: const Duration(milliseconds: 200), curve: Curves.easeOut);
});
}
/// Scroll a horizontal list to center the item at the given index.
///
/// Assumes items are laid out with [leadingPadding] before the first item,