diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index 0d93df778..e7c506ecc 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -16,7 +16,9 @@ const int kDesktopDefaultDisplayWidth = 1080; const int kDesktopDefaultDisplayHeight = 720; /// [kDefaultScrollAmountMultiplier] indicates how many rows can be scrolled after a minimum scroll action of mouse -const kDefaultScrollAmountMultiplier = 3.0; +const kDefaultScrollAmountMultiplier = 5.0; +const kDefaultScrollDuration = Duration(milliseconds: 50); +const kDefaultMouseWhellThrottleDuration = Duration(milliseconds: 50); const kFullScreenEdgeSize = 1.0; const kWindowEdgeSize = 4.0; diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index 198f64bcc..05cb3858a 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -875,7 +875,9 @@ class _PeerTabbedPageState extends State<_PeerTabbedPage> Widget _createTabBarView() { return Expanded( child: PageView( - controller: _pageController, children: super.widget.children) + physics: NeverScrollableScrollPhysics(), + controller: _pageController, + children: super.widget.children) .marginSymmetric(vertical: 12)); } diff --git a/flutter/lib/desktop/widgets/peer_widget.dart b/flutter/lib/desktop/widgets/peer_widget.dart index 07a621add..a7edc0b93 100644 --- a/flutter/lib/desktop/widgets/peer_widget.dart +++ b/flutter/lib/desktop/widgets/peer_widget.dart @@ -89,6 +89,7 @@ class _PeerWidgetState extends State<_PeerWidget> with WindowListener { : DesktopScrollWrapper( scrollController: _scrollController, child: SingleChildScrollView( + physics: NeverScrollableScrollPhysics(), controller: _scrollController, child: ObxValue((searchText) { return FutureBuilder>( diff --git a/flutter/lib/desktop/widgets/scroll_wrapper.dart b/flutter/lib/desktop/widgets/scroll_wrapper.dart index 96eb9f735..aaa3aa403 100644 --- a/flutter/lib/desktop/widgets/scroll_wrapper.dart +++ b/flutter/lib/desktop/widgets/scroll_wrapper.dart @@ -13,8 +13,12 @@ class DesktopScrollWrapper extends StatelessWidget { Widget build(BuildContext context) { return ImprovedScrolling( scrollController: scrollController, - enableCustomMouseWheelScrolling: false, - customMouseWheelScrollConfig: const CustomMouseWheelScrollConfig( + enableCustomMouseWheelScrolling: true, + customMouseWheelScrollConfig: CustomMouseWheelScrollConfig( + scrollDuration: kDefaultScrollDuration, + scrollCurve: Curves.linearToEaseOut, + mouseWheelTurnsThrottleTimeMs: + kDefaultMouseWhellThrottleDuration.inMilliseconds, scrollAmountMultiplier: kDefaultScrollAmountMultiplier), child: child, ); diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index 9bc8816ef..696f2a5d2 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -80,7 +80,10 @@ dependencies: desktop_drop: ^0.3.3 scroll_pos: ^0.3.0 rxdart: ^0.27.5 - flutter_improved_scrolling: ^0.0.3 + flutter_improved_scrolling: + git: + url: https://github.com/Kingtous/flutter_improved_scrolling + ref: 62f09545149f320616467c306c8c5f71714a18e6 dev_dependencies: icons_launcher: ^2.0.4