Closed myThorsten closed 3 years ago
I'm using the following code to change to displayed tab on swipe-right or swipe-left via code. Please note the _tabController.animateTo:
body: GestureDetector( onHorizontalDragEnd: (drawEndDetails) { print(drawEndDetails); if (drawEndDetails.primaryVelocity > 0.0 && _tabController.index > 0) { setState(() => _tabController.animateTo(_tabController.index - 1)); } else if (drawEndDetails.primaryVelocity < 0.0 && _tabController.index < _labels.length - 1) { setState(() => _tabController.animateTo(_tabController.index + 1)); } }, child: MotionTabBarView( controller: _tabController, children: [ ContactCreateHistory(encounter: widget._encounter), ContactCreateContacts(encounter: widget._encounter), ContactCreateMaps(encounter: widget._encounter), ContactCreateFormular(encounter: widget._encounter), ], ), ),
The displayed content is updated correctly, but not the tab-display. it is not animating nor updated.
Before swipe, on the first tab: After swipe, tab-content updated to second tab, should be focusing red circled tab:
Am I doing something wrong?
Not longer relevant
What is the solution
@myThorsten @therezacuet
I'm using the following code to change to displayed tab on swipe-right or swipe-left via code. Please note the _tabController.animateTo:
The displayed content is updated correctly, but not the tab-display. it is not animating nor updated.
Before swipe, on the first tab:
After swipe, tab-content updated to second tab, should be focusing red circled tab:
![image](https://user-images.githubusercontent.com/9773490/95626541-c27a1280-0a7a-11eb-998a-ad7f0b16f55a.png)
Am I doing something wrong?