NestedTabBar-Flutter icon indicating copy to clipboard operation
NestedTabBar-Flutter copied to clipboard

Does not work as expected

Open marchellodev opened this issue 4 years ago • 2 comments

Nested TabBarView means that when user scrolls the last element of the TabBarView that is inside, the swipe seamlessly transitions to the main TabBarView. This project, however, just puts TabBarView inside another one and adds some paddings. Therefore, there is no seamless transition.

Video that clearly demonstrates that: https://drive.google.com/file/d/1JfkuPrH11dTBJQpQu5vYC90Cuf8RYNiU/view

If someone finds out how to code a real nested TabBarView - please let me know :)

marchellodev avatar Dec 03 '20 22:12 marchellodev

I found a solution !!!

We can use PageView instead of TabBarView. Now we just need to manually attach PageView to the TabBar. I've added a small snippet of how this could be done below.

  • We also need to listen to TabBars, so that pages will transition on click. It's not hard to code now though.

I think it would be pretty cool to make this into a package. @IAmSarthakVerma What do you think?

Demo: https://drive.google.com/file/d/1CrY_KKxFj8IG_QPL54PKPy5HSlemUtCc/view?usp=sharing

Screenshot 2020-12-04 004028

marchellodev avatar Dec 03 '20 22:12 marchellodev

Nevermind, there is already a package for just that https://github.com/wilin52/union_tabs

lol

marchellodev avatar Dec 03 '20 22:12 marchellodev