Flutter 中如何将 appBar 设置成透明

Flutter 中如何将 appBar 设置成透明

在 flutter 中有时候因为业务需求需要将 appBar 设置成透明,设置方法如下:

Scaffold(
      	// Scaffold 组件设置背景色
        backgroundColor: Color.fromRGBO(14, 14, 31, 1),
        appBar: AppBar(
          title: Text('History'),
          // appBar 组件设置背景色为透明,elevation 属性要设置为 0
          backgroundColor: Colors.transparent,
          elevation: 0,
        ),
        body: _checkMenu()
);

结果如下:
Flutter 中如何将 appBar 设置成透明_第1张图片

你可能感兴趣的:(Flutter)