SelectableRegionState for dynamic toolbar positioning by itsAdityaRathore · Pull Request #183160 · flutter/flutter
…r positioning This commit introduces a new method, refreshToolbar, in the SelectableRegionState class. This method recalculates the toolbar's position based on the current selection geometry, ensuring it updates correctly after layout changes such as scrolling. Additionally, a new test case is added to verify that the toolbar's position is updated appropriately after scrolling within a SelectableRegion. - Implemented refreshToolbar method to trigger layout updates for the selection overlay. - Added a test to confirm toolbar repositioning after scrolling. This enhancement improves the user experience by maintaining the toolbar's visibility and accuracy during text selection scenarios.
This commit adds a null check for the _selectionOverlay in the refreshToolbar method of the SelectableRegionState class. If the _selectionOverlay is null, the method will return early, preventing potential null pointer exceptions. This change enhances the robustness of the toolbar refresh logic during text selection scenarios.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters