どうも、ちょげ(@chogetarou)です。
SliverAppBarの最大の高さを設定するには、どうしたらいいのでしょうか?
方法

@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
slivers: [
SliverAppBar(
floating: true,
expandedHeight: 200,
title: Text("Title"),
),
SliverList(
delegate: SliverChildListDelegate([
for (var i = 0; i < 100; i++)
ListTile(
title: Text("item $i"),
)
]))
],
),
);
}
SliverAppBarの高さを設定するには、引数「expandedHeight」を使います。
この引数に指定した値は、SliverAppBarの最大の高さになります。
コメント