我尝试了这个链接,但效果不理想。
在这段代码中,当我尝试改变AppBar
的高度时,但是并没有任何变化。
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
body: Container(
height: double.infinity,
child: Column(
children: <Widget>[
PreferredSize(
preferredSize: Size.fromHeight(150.0),
child: AppBar(
backgroundColor: Colors.white.withOpacity(0.9),
title: Container(height: 150.0,),
),
)
],
)),
);
}
注意: 我的AppBar(...)
没有在appBar:
中使用。
appBar
不在Scaffold
小部件中。 - DolDurmaappbar
不在Scaffold
widget 里面。 - DolDurma