fix(tv): stabilize long rail focus scrolling
This commit is contained in:
@@ -86,9 +86,12 @@ void scrollKeyedChildToHorizontalCenter(
|
||||
GlobalKey key, {
|
||||
bool animate = true,
|
||||
int maxAttempts = 2,
|
||||
bool Function()? isCurrent,
|
||||
}) {
|
||||
void schedule(int attempt) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (isCurrent?.call() == false) return;
|
||||
|
||||
final context = key.currentContext;
|
||||
if (context == null) {
|
||||
if (attempt < maxAttempts) schedule(attempt + 1);
|
||||
|
||||
Reference in New Issue
Block a user