
我认为这不是理想的方法,但它会起作用。
首先 声明
AppBar您将在中使用的小部件
Scaffold。
Widget demoPage() { AppBar appBar = AppBar( title: Text('Demo'), ); return Scaffold( appBar: appBar, body: , );}现在, 你可以得到 高度 您的
appBar使用它
preferredSized:
double height = appBar.preferredSize.height;
您可以使用此高度从 屏幕高度 减小。
final double height = MediaQuery.of(context).size.height;
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)