From e1ab01a97f6d769c96c41a16ec43665b990edfd5 Mon Sep 17 00:00:00 2001 From: Kingtous Date: Mon, 19 Sep 2022 19:18:05 +0800 Subject: [PATCH] opt: use custom scroll feature --- flutter/lib/consts.dart | 2 +- flutter/lib/desktop/widgets/peer_widget.dart | 1 + flutter/lib/desktop/widgets/scroll_wrapper.dart | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index 0d93df778..3ed080206 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -16,7 +16,7 @@ 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 = 10.0; const kFullScreenEdgeSize = 1.0; const kWindowEdgeSize = 4.0; diff --git a/flutter/lib/desktop/widgets/peer_widget.dart b/flutter/lib/desktop/widgets/peer_widget.dart index 07a621add..1b0626198 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: const 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..6ad63b99c 100644 --- a/flutter/lib/desktop/widgets/scroll_wrapper.dart +++ b/flutter/lib/desktop/widgets/scroll_wrapper.dart @@ -13,7 +13,7 @@ class DesktopScrollWrapper extends StatelessWidget { Widget build(BuildContext context) { return ImprovedScrolling( scrollController: scrollController, - enableCustomMouseWheelScrolling: false, + enableCustomMouseWheelScrolling: true, customMouseWheelScrollConfig: const CustomMouseWheelScrollConfig( scrollAmountMultiplier: kDefaultScrollAmountMultiplier), child: child,