沒有AppBar的Flutter,如果不在Scaffold中使用AppBar會發現默認是沉浸式。
預留出狀態欄的高度方法
Scaffold(
appBar: PreferredSize(
preferredSize:Size.fromHeight(MediaQuery.of(context).size.height * 0.07),
child:SafeArea(
top: true,
child: Offstage(),
),
),
body: indexStack,
bottomNavigationBar: initNavigationBar(),
);