wayne900204 / vertical_scrollable_tabview

A Flutter plugin which synchronize a ScrollView and a custom tab view.
https://pub.dev/packages/vertical_scrollable_tabview
MIT License
43 stars 27 forks source link

Item changes to late / Solution to accept horizontal scroll #2

Closed enviro-apps closed 2 years ago

enviro-apps commented 2 years ago

Dear Sir or Madam, The package changes the tab one item to late. I have a list of months and each item covers 86 Prozent of the Screen so the items are pretty large if thats relevant. When I scroll through and I am in January for example and I go to February it changes from December to Januar so always one to late. What I could figure out is in your package visible items look like this: [3, 4] so middle index will be 3 but it should be 4.

enviro-apps commented 2 years ago

I solved it sir. The problem was I made changes to the package to accept horizontal scroll which works btw so you could support it too.

When we want to use this package to accept horizontal scroll and still changing tabs right change this lines: if (itemRect.top > rect.bottom) return; if (itemRect.bottom < rect.top) return; to this: if (itemRect.left > rect.right) return; if (itemRect.right < rect.left) return;

wayne900204 commented 2 years ago

OK, Thx @enviro-apps . I will try to add this feature to the package.