Scrollbar alwaysOn for desktop/web
This commit is contained in:
parent
28ebe79ad2
commit
66840b9300
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:wonders/common_libs.dart';
|
import 'package:wonders/common_libs.dart';
|
||||||
|
import 'package:wonders/logic/common/platform_info.dart';
|
||||||
|
|
||||||
class AppScrollBehavior extends ScrollBehavior {
|
class AppScrollBehavior extends ScrollBehavior {
|
||||||
@override
|
@override
|
||||||
@ -14,4 +15,16 @@ class AppScrollBehavior extends ScrollBehavior {
|
|||||||
// Use bouncing physics on all platforms, better matches the design of the app
|
// Use bouncing physics on all platforms, better matches the design of the app
|
||||||
@override
|
@override
|
||||||
ScrollPhysics getScrollPhysics(BuildContext context) => const BouncingScrollPhysics();
|
ScrollPhysics getScrollPhysics(BuildContext context) => const BouncingScrollPhysics();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget buildScrollbar(BuildContext context, Widget child, ScrollableDetails details) {
|
||||||
|
if (PlatformInfo.isMobile) return child;
|
||||||
|
return RawScrollbar(
|
||||||
|
controller: details.controller,
|
||||||
|
thumbVisibility: PlatformInfo.isDesktopOrWeb,
|
||||||
|
thickness: 8,
|
||||||
|
interactive: true,
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user