opt: custom scroll for better scroll and add trackpad support

This commit is contained in:
Kingtous
2022-09-19 21:09:54 +08:00
parent e1ab01a97f
commit df5a2ab556
5 changed files with 16 additions and 5 deletions

View File

@@ -89,7 +89,7 @@ class _PeerWidgetState extends State<_PeerWidget> with WindowListener {
: DesktopScrollWrapper(
scrollController: _scrollController,
child: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(),
controller: _scrollController,
child: ObxValue<RxString>((searchText) {
return FutureBuilder<List<Peer>>(

View File

@@ -14,7 +14,11 @@ class DesktopScrollWrapper extends StatelessWidget {
return ImprovedScrolling(
scrollController: scrollController,
enableCustomMouseWheelScrolling: true,
customMouseWheelScrollConfig: const CustomMouseWheelScrollConfig(
customMouseWheelScrollConfig: CustomMouseWheelScrollConfig(
scrollDuration: kDefaultScrollDuration,
scrollCurve: Curves.linearToEaseOut,
mouseWheelTurnsThrottleTimeMs:
kDefaultMouseWhellThrottleDuration.inMilliseconds,
scrollAmountMultiplier: kDefaultScrollAmountMultiplier),
child: child,
);