alihaider78222 / dynamic_tabbar

Flutter package for creating dynamic tabs (TabBar and TabBarView).
https://pub.dev/packages/dynamic_tabbar
MIT License
14 stars 11 forks source link

Why not support Widows & Linux & MacOS #11

Closed huayii closed 3 weeks ago

huayii commented 2 months ago

Why not support Widows & Linux & MacOS??

rodolfogoulart commented 2 months ago

As depends only on flutter, the package support Widows & Linux & MacOS, i do use on windows, linux and macos

JanHitako commented 2 weeks ago

@rodolfogoulart Actually, that's not quite right, trackpad scrolling seems to be broken on Windows. Any listview under this Tabbar doesn't scroll with finger gestures on trackpad on windows, and you have to drag the screen (click and move) as if you were on mobile to scroll or drag the side bar, so I would consider from that that windows is stil not officially supported.

rodolfogoulart commented 2 weeks ago

@JanHitako i have this problem too. But you can fix this using a ScrollBehavior

class CustomScrollBehavior extends MaterialScrollBehavior {
  // Override behavior methods and getters like dragDevices
  @override
  Set<PointerDeviceKind> get dragDevices => {
        PointerDeviceKind.touch,
        PointerDeviceKind.mouse,
        PointerDeviceKind.trackpad,
      };
}

Just wrap your listview on a ScrollController

ScrollConfiguration(
      behavior: CustomScrollBehavior(),
      child: ListView()    <- your listView
)
JanHitako commented 2 weeks ago

@rodolfogoulart Yes, I resolved the issue this way as well, it also work as expected by either wrapping it in a NestedViewController when applicable or using any other parent that passes their own ScrollController down the widget tree containing the TabBar. Essentially, if there’s a standard ScrollController available to pass down, it functions correctly. Otherwise, it defaults to this unusual behavior. I might look into this further and submit a PR, but I currently don’t have much time but still consider this to not be fully supporting windows at the moment.