You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(widgets): avoid re-splitting lines on every build in VirtualSelectableTextView #1532
In VirtualSelectableTextView.build (lib/core/widgets/virtual_selectable_text_view.dart), final lines = text.split('\n'); is executed unconditionally on every widget build.
During window resize, theme change, focus shift, or parent animations, a multi-thousand-line string is re-split into a List<String> on every single frame, causing UI stutter.
Solution
Convert to a StatefulWidget or compute/cache line offsets/slices (LineIndex) only when widget.text changes (didUpdateWidget).
Avoid running text.split('\n') inside build().
Benefits
Zero string splitting during re-renders, layout recalculations, and theme changes.
Stable 60/120 FPS during window resizing with large text views.
Fixed on dev by 6c0cca6: perf(widgets): split VirtualSelectableTextView lines only when the text changes. It reaches main with the next dev to main merge (closed after checking the code and its tests).
Activity
Merge pull request #1601 from QueryaHub/issue/1532-selectable-text-split
ZhuchkaTriplesix commentedon Oct 25, 2026
Fixed on dev by 6c0cca6: perf(widgets): split VirtualSelectableTextView lines only when the text changes. It reaches main with the next dev to main merge (closed after checking the code and its tests).