pub仓库中bitsdojo_window插件提供了响应 *** 作
import 'package:flutter/material.dart';
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'pages/loginpage.dart';
import 'routers/rout.dart';
void main() {
runApp(MyApp());
doWhenWindowReady(() {
final win = appWindow;
//final initialSize = Size(300, 420); //loginszie
// final initialSize = Size(420, 300); //forgetsize
final initialSize = Size(1200, 700);
// win.minSize = initialSize;
win.size = initialSize;
//win.maxSize = initialSize;
win.alignment = Alignment.center; //将窗口显示到中间
win.show();
});
}
const borderColor = Color(0xFF805306);
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
initialRoute: '/login',
onGenerateRoute: onGenerateRoute);
}
}
如果想要实现界面跳转改变窗口大小,只需在每个界面的初始化函数中添加以上代码就可以了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)