更新时间:2022-12-28 15:52:25
我认为,这不是理想的方法,但是它可以工作.
This is not an ideal way, I think, but it will work.
首先声明要在Scaffold
中使用的AppBar
小部件.
Firstly declare the AppBar
widget that you will use in your Scaffold
.
Widget demoPage() {
AppBar appBar = AppBar(
title: Text('Demo'),
);
return Scaffold(
appBar: appBar,
body: /*
page body
*/,
);
}
现在,您可以使用appBar
的
double height = appBar.preferredSize.height;
您可以使用此高度来降低屏幕高度.
You can use this height to reduce from the screen height.
final double height = MediaQuery.of(context).size.height;