Can you show the code? because it's difficult to understand your case.
Anyway I show you my code from one of my projects, maybe it helps
Widget build(BuildContext context) {
widget.userBloc = BlocProvider.of<UserBloc>(context);
return Scaffold(
body: NestedScrollView(
headerSliverBuilder: (context, innerBoxIsScrolled) =>
[
SliverOverlapAbsorber(
// ignore: deprecated_member_use
child: SliverSafeArea(
top: false,
sliver: SliverAppBar(
title: Text(
'',
style: TextStyle(
fontFamily: "Lato",
fontSize: 15,
// fontWeight: FontWeight.bold
),
),
centerTitle: true,
expandedHeight: 100,
floating: true,
flexibleSpace: FlexibleSpaceBar(
titlePadding: EdgeInsets.only(bottom: 25),
title: Text(
'Hospedajes',
style: TextStyle(
fontFamily: "Lato",
fontSize: 24,
fontWeight: FontWeight.bold
),
),
centerTitle: true,
background: GradientBack(height: null,),
),
),
),
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
)
],
body: StreamBuilder(
stream: widget.userBloc.authStatus,
builder: (BuildContext context, AsyncSnapshot snapshot){
switch (snapshot.connectionState){
case ConnectionState.waiting:
return Center(child: CircularProgressIndicator(),);
case ConnectionState.none:
return Center(child: CircularProgressIndicator(),);
case ConnectionState.active:
return showUserLodgingsData(snapshot);
case ConnectionState.done:
return showUserLodgingsData(snapshot);
default:
return showUserLodgingsData(snapshot);
}
},
),
),
);
}