flutter / flutter/devtools

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

未關閉
#2,012 7 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
cost: medium flame_chart P2 screen: cpu profiler
主要語言
Dart
星號
1.7k
分支
404
平均合併
6 天 17 小時
30 天內合併 PR
18

描述

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.`

貢獻指南

開啟貢獻指南

研究方向

從 flame_chart.dart 中 zoomController 的監聽器以及 linkedHorizontalScrollControllerGroup.jumpTo(newScrollOffset) 呼叫開始。重現接近捲動邊界時的縮放,然後確認只有在新的最小/最大捲動偏移量可用後才會執行 jumpTo,同時不會觸發彈道回彈或手勢偵測器版面配置錯誤。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
dart, flutter
領域
data-visualization, frontend
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。