如何在颤振窗口中隐藏任务栏?



是否有一种方法可以在Flutter窗口中隐藏windows桌面。[PS.我是初学者]

await WindowManager.instance.setFullScreen(true);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: [SystemUiOverlay.top]);

尝试了上面的代码,但是它只隐藏了标题栏

您可以使用window_manager对于代码,您可以在main.dart中运行应用程序之前使用此代码片段。

void main() {
if (Platform.isWindows) {
await windowManager.ensureInitialized();
WindowOptions windowOptions = const WindowOptions(
fullScreen: true,
skipTaskbar: true,
center: true,
size: Size(Constants.verticalW, Constants.verticalH),
alwaysOnTop: true, // This hide the taskbar and appear the app on top
titleBarStyle: TitleBarStyle.hidden,
);
windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.show();
await windowManager.focus();
});
}
runApp(const app());
}

最新更新