flutter / flutter/devtools

Flame chart - jumpTo called before scroll position offsets have new size

Aperta
#2,012 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub
cost: medium flame_chart P2 screen: cpu profiler
Lingua principale
Dart
Stelle
1.7k
Fork
404
Merge medio
6g 17h
PR unite (30g)
18

Descrizione

In flame_chart.dart, we call
```
linkedHorizontalScrollControllerGroup.jumpTo(newScrollOffset);
```
to update the scroll offset as we zoom. We call this inside of an animation controller listener `zoomController.addListener(() { ... })`. At times when we call this, `scrollController.position.maxScrollOffset` is not updated for the new zoom level and layout size, causing `jumpTo` to fire BallisticScrollActivities to bounce the scroll offset back to what it thinks is the `maxScrollOffset`.

We need to have a way to call `jumpTo` when we can guarantee that the min / max scroll offsets are updated for the new zoom value.

I attempted to set these offsets manually using `scrollController.position.applyContentDimensions(minScrollOffset, maxScrollOffset)` but this results in an error regarding gesture detectors: `The replaceGestureRecognizers() method can only be called during the layout phase.`

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start in flame_chart.dart at the zoomController listener and the linkedHorizontalScrollControllerGroup.jumpTo(newScrollOffset) call. Reproduce zooming near a scroll boundary, then verify that jumpTo runs only after the new min/max scroll offsets are available, without triggering ballistic bounce or the gesture-detector layout error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
dart, flutter
Ambito
data-visualization, frontend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.