Add useIndexedTab property for smooth tab switching with lazy-loaded indexed building#2190
Open
Add useIndexedTab property for smooth tab switching with lazy-loaded indexed building#2190
useIndexedTab property for smooth tab switching with lazy-loaded indexed building#2190Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Introduces
useIndexedTab, a boolean property that enables IndexedStack-based tab building in TabBar widgets.Problem it solves:
By default, when switching tabs, the previous tab's widget is removed from the widget tree. Switching back to that tab requires rebuilding it, which causes lag or freezing if the tab contains heavy data.
Solution:
With
useIndexedTab: true, tabs are built on-demand and cached. When you switch to a tab for the first time, it's built and cached. Tab switching becomes instant—no rebuild, no delay, no freeze. Unvisited tabs remain lazy and are not built until accessed.How it works:
IndexedStack(expanded) orColumnwithOffstage(non-expanded) to maintain widgets in treeImpact:
Eliminates freezed transitions when switching between tabs with heavy content.
Screen.Recording.2026-04-28.at.01.10.53.mov