Merge pull request #1584 from Kingtous/master
opt: use custom scroll feature
This commit is contained in:
commit
8a6ec7b18f
@ -16,7 +16,9 @@ const int kDesktopDefaultDisplayWidth = 1080;
|
|||||||
const int kDesktopDefaultDisplayHeight = 720;
|
const int kDesktopDefaultDisplayHeight = 720;
|
||||||
|
|
||||||
/// [kDefaultScrollAmountMultiplier] indicates how many rows can be scrolled after a minimum scroll action of mouse
|
/// [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 kFullScreenEdgeSize = 1.0;
|
||||||
const kWindowEdgeSize = 4.0;
|
const kWindowEdgeSize = 4.0;
|
||||||
|
|
||||||
|
@ -875,7 +875,9 @@ class _PeerTabbedPageState extends State<_PeerTabbedPage>
|
|||||||
Widget _createTabBarView() {
|
Widget _createTabBarView() {
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: PageView(
|
child: PageView(
|
||||||
controller: _pageController, children: super.widget.children)
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
controller: _pageController,
|
||||||
|
children: super.widget.children)
|
||||||
.marginSymmetric(vertical: 12));
|
.marginSymmetric(vertical: 12));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,6 +89,7 @@ class _PeerWidgetState extends State<_PeerWidget> with WindowListener {
|
|||||||
: DesktopScrollWrapper(
|
: DesktopScrollWrapper(
|
||||||
scrollController: _scrollController,
|
scrollController: _scrollController,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
controller: _scrollController,
|
controller: _scrollController,
|
||||||
child: ObxValue<RxString>((searchText) {
|
child: ObxValue<RxString>((searchText) {
|
||||||
return FutureBuilder<List<Peer>>(
|
return FutureBuilder<List<Peer>>(
|
||||||
|
@ -13,8 +13,12 @@ class DesktopScrollWrapper extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ImprovedScrolling(
|
return ImprovedScrolling(
|
||||||
scrollController: scrollController,
|
scrollController: scrollController,
|
||||||
enableCustomMouseWheelScrolling: false,
|
enableCustomMouseWheelScrolling: true,
|
||||||
customMouseWheelScrollConfig: const CustomMouseWheelScrollConfig(
|
customMouseWheelScrollConfig: CustomMouseWheelScrollConfig(
|
||||||
|
scrollDuration: kDefaultScrollDuration,
|
||||||
|
scrollCurve: Curves.linearToEaseOut,
|
||||||
|
mouseWheelTurnsThrottleTimeMs:
|
||||||
|
kDefaultMouseWhellThrottleDuration.inMilliseconds,
|
||||||
scrollAmountMultiplier: kDefaultScrollAmountMultiplier),
|
scrollAmountMultiplier: kDefaultScrollAmountMultiplier),
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
|
@ -80,7 +80,10 @@ dependencies:
|
|||||||
desktop_drop: ^0.3.3
|
desktop_drop: ^0.3.3
|
||||||
scroll_pos: ^0.3.0
|
scroll_pos: ^0.3.0
|
||||||
rxdart: ^0.27.5
|
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:
|
dev_dependencies:
|
||||||
icons_launcher: ^2.0.4
|
icons_launcher: ^2.0.4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user