How to make flutter app draw behind android navigation bar and make navigation bar fully transparent?

后端 未结 4 1488
心在旅途
心在旅途 2021-02-01 13:24

I would like to make my Flutter app take up the entire screen in Android while still showing both the status bar and the navigation bar, with both of them transparent, to achiev

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-01 13:53

    This might be late, but the latest version for flutter, 1.12 provides a feature to draw the app behind the NavigationBar, so the following code will have the transparent navigation bar with app fully extended behind the navigation bar,

    Scaffold(
      extendBodyBehindAppBar: true, //this ensures that the body is drawn behind the navigation bar as well
      appBar: AppBar(
        backgroundColor: Colors.transparent,
        title: Text('Transparent Bar'),
      ),
      body: Container(
        color: Colors.blue,
      ),
    );
    

提交回复
热议问题