Skip to content

Tab _warpToCurrentIndex causing pages to build and dispose immediately #32056

@shihaohong

Description

@shihaohong

When warping in TabBarView, pages that are not shown on the Viewport can improperly be built and immediately disposed. This behavior is undesired, as it may have performance implications from attempting to build and dispose of a widget unnecessarily. To reproduce:

  1. Tap on a tab that is adjacent to a tab containing a nested TabBarView
  2. The nested tab has to be in between the initial tab and the tab that was tapped on
    (ie. current index = 0, tap on tab at index 3 when tab at index 2 has nested TabBarView)

See #31581 for context

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: qualityA truly polished experiencec: performanceRelates to speed or footprint issues (see "perf:" labels)c: tech-debtTechnical debt, code quality, testing, etc.f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions