So, I have made a simple web app with a flutter that uses a SilverAppBar. The problem arises in the scrolling. When I scroll it, as the cursor goes off from SilverAppBar, it automatically goes on the top. I don't know what is causing the problem. I have run the app on chrome as well as edge browser but the same glitch happens again and again. I have tried flutter clean command also but got the same results.
I can't upload the video here, but I have the video on youtube Youtube video showing glitch
Also, the source code is given below:
Widget build(BuildContext context) {
return Scaffold(
extendBodyBehindAppBar: true,
backgroundColor: Colors.yellow,
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled){
return <Widget>[
SliverAppBar(
expandedHeight: MediaQuery.of(context).size.height,
collapsedHeight: 100,
pinned: true,
flexibleSpace: FlexibleSpaceBar(
titlePadding: EdgeInsets.all(0),
title: Container(
color: Colors.transparent,
child: Align(
alignment: Alignment.bottomCenter,
child: Align(
alignment: Alignment.center,
child: Text(
"Who Will Help Me?", style: TextStyle(fontSize: 50,),
),
),
),
),
background: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
color: Colors.green,
),
),
),
];
},
body: ListView(
padding: EdgeInsets.all(0),
children: [
Padding(padding: EdgeInsets.all(100), child: Text("demo text"),),
Padding(padding: EdgeInsets.all(100), child: Text("demo text"),),
Padding(padding: EdgeInsets.all(100), child: Text("demo text"),),
Padding(padding: EdgeInsets.all(100), child: Text("demo text"),),
Padding(padding: EdgeInsets.all(100), child: Text("demo text"),),
],
),
),
);
Uploading the flutter doctor here:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, 1.20.0-0.0.pre, on Microsoft Windows [Version 10.0.18363.719],
locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
X Android license status unknown.
Try reinstalling or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-
started/install/windows#android-setup for detailed
instructions.
[√] Chrome - develop for the web
[√] Android Studio (version 3.6)
[√] VS Code, 64-bit edition (version 1.46.0)
[√] Connected device (3 available)
! Doctor found issues in 1 category.