Im so confuse why my sliverappbar doesnt stretch and zoom when I reach the top list. I following the flutter video
I tried the following code
class AppBar5 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
slivers: [
SliverAppBar(
title: Text("title"),
expandedHeight: 200,
stretch: true,
flexibleSpace: FlexibleSpaceBar(
background: Container(
width: MediaQuery.of(context).size.width,
height: 200,
child: Image.asset("assets/images/hot.jpg", fit: BoxFit.cover)
),
)
),
SliverList(
delegate: SliverChildBuilderDelegate(
(_, index) => ListTile(
title: Text("Index: $index"),
),
),
)
],
),
);
}
}
Add Bouncing ScrollPhysics to CustomScrollView