mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-15 12:09:08 +08:00
28 lines
1008 B
Dart
28 lines
1008 B
Dart
import 'package:flutter/widgets.dart';
|
|
import 'package:flutter_hbb/consts.dart';
|
|
import 'package:flutter_improved_scrolling/flutter_improved_scrolling.dart';
|
|
|
|
class DesktopScrollWrapper extends StatelessWidget {
|
|
final ScrollController scrollController;
|
|
final Widget child;
|
|
const DesktopScrollWrapper(
|
|
{Key? key, required this.scrollController, required this.child})
|
|
: super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ImprovedScrolling(
|
|
scrollController: scrollController,
|
|
enableCustomMouseWheelScrolling: true,
|
|
// enableKeyboardScrolling: true, // strange behavior on mac
|
|
customMouseWheelScrollConfig: CustomMouseWheelScrollConfig(
|
|
scrollDuration: kDefaultScrollDuration,
|
|
scrollCurve: Curves.linearToEaseOut,
|
|
mouseWheelTurnsThrottleTimeMs:
|
|
kDefaultMouseWheelThrottleDuration.inMilliseconds,
|
|
scrollAmountMultiplier: kDefaultScrollAmountMultiplier),
|
|
child: child,
|
|
);
|
|
}
|
|
}
|