Skip to content

TabController's index and animation is not working properly when a new tab is selected while there is a transition still occurring #113020

@dvigara-medallia

Description

@dvigara-medallia

Steps to Reproduce

  1. Use the sample app navigation_and_routing.
  2. In books.dart add a print statement in the method _handleTabIndexChanged to see what's the value of _tabController.indexIsChanging
  3. In the app, start in the 'Popuplar' tab, Tap on the 'New' Tab and before it finishes quickly tap on the 'All' tab. Make the tabController animationDuration longer to see it easily

Expected results:
The tab starts to navigate to the New tab, indexIsChanging is true. When it arrives to 'New' Tab indexIsChanging is false. Because the 'All' tab was pressed before arriving to 'New' tab, as soon as it arrives to 'New', it starts navigating to the 'All' tab and indexIsChanging is true.

Actual results:
When it arrives to the 'New' tab and starts navigating to the 'All' tab, indexIsChanging never changes to true, it stays as false while the tabbar is transitioning. The same happens if you put a listener to the animation status.

Video:
I put a setstate to show the value of indexIsChanging in the appbar.

22-10-06-11-22-01.mp4

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: animationAnimation APIsf: material designflutter/packages/flutter/material repository.found in release: 3.4Found to occur in 3.4found in release: 3.5Found to occur in 3.5frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions