要在桌面/网络上隐藏滚动条,请将您的小部件树包装在具有 ScrollConfiguration.of(context).copyWith(scrollbars: false) 行为的 ScrollConfiguration 小部件中,
ScrollConfiguration(
behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false),
child: ...,),
或者您可以将 scrollBehavior 添加到 MaterialApp 小部件
class NoThumbScrollBehavior extends ScrollBehavior {
@override
Set<PointerDeviceKind> get dragDevices => {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
PointerDeviceKind.stylus,
};
}
return MaterialApp(
debugShowCheckedModeBanner: false,
scrollBehavior: NoThumbScrollBehavior().copyWith(scrollbars: false),
home: MainWindow(),
);