flutter 自定义 appbar 相对于状态栏的垂直位置

flutter custom appbar vertical position relative to status bar

我使用下面的例子link创建了一个自定义的appBar。

代码有效,但是应用栏位于 Android 状态栏后面的屏幕顶部

如何定位 appBar,使其在状态栏下方开始呈现?

使用的版本:

有一个名为 SafeArea 的小部件可以设置小部件的填充以避免状态栏的干扰。您可以将其用作:

// Use the SafeArea here to position the AppBar under the status bar
SafeArea( 
   child: Scaffold(
      appBar: PreferredSize(
        preferredSize: Size(double.infinity, 100),
        child: Container(
          decoration: BoxDecoration(

          // ... other lines