英文:
How to disable window resizing in a flutter desktop app
问题
我想在Flutter桌面应用程序上禁用屏幕调整大小,但似乎不起作用。我还想更改窗口标题。
import 'package:desktop_window/desktop_window.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await DesktopWindow.setMinWindowSize(const Size(1280, 720));
await DesktopWindow.setMaxWindowSize(const Size(1280, 720));
runApp(MyApp());
}
英文:
I want to disable screen resizing on a flutter desktop application but it doesn't seem to work. I also want to change the window title.
import 'package:desktop_window/desktop_window.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await DesktopWindow.setMinWindowSize(const Size(1280, 720));
await DesktopWindow.setMaxWindowSize(const Size(1280, 720));
runApp(MyApp());
}
答案1
得分: 1
我建议您使用window_manager包,使用该包,您可以配置用户是否能够调整窗口大小。更多信息请参阅:https://pub.dev/packages/window_manager#setresizable
英文:
I would recommend you to use the window_manager package, with this package you can configure if the user should be able to resize the window or not. More info here:
https://pub.dev/packages/window_manager#setresizable
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论