📜  如何在颤动中减去 appbar 的高度 - Dart 代码示例

📅  最后修改于: 2022-03-11 14:48:07.887000             🧑  作者: Mango

代码示例1
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
    */,
  );
}
Now you can get the height of your appBar using its preferredSized:

double height = appBar.preferredSize.height