除了将 backgroundColor 设置为 transparent,还需要将 shadowColor 设置为 transparent,或者把 elevation 设置为 0:
backgroundColor
transparent
shadowColor
elevation
appBar: AppBar( title: Text('透明导航栏'), backgroundColor: Colors.transparent, // 背景颜色设置为透明 shadowColor: Colors.transparent, // 阴影也要设置为透明 //elevation: 0, ),
因篇幅问题不能全部显示,请点此查看更多更全内容