1

I'm trying to have a floatting SliverAppBar on flutter web, but the SliverAppBar is only been displayed when I scroll to the top of the screen. It works well on Android. My code is:

return Scaffold(
        backgroundColor: Colors.grey[100],
        body: CustomScrollView(slivers: <Widget>[
          SliverAppBar(
            automaticallyImplyLeading: false,
            actions: <Widget>[Container()],
            floating: true,
            title: Text(('My Title')),
            elevation: 0,
          ),
          SliverList(
            delegate: SliverChildListDelegate(
              [
                Container(color: Colors.red, height: 150.0),
                Container(color: Colors.purple, height: 150.0),
                Container(color: Colors.green, height: 150.0),
                Container(color: Colors.red, height: 150.0),
                Container(color: Colors.purple, height: 150.0),
                Container(color: Colors.green, height: 150.0),
                Container(color: Colors.red, height: 150.0),
                Container(color: Colors.purple, height: 150.0),
                Container(color: Colors.green, height: 150.0),
                Container(color: Colors.red, height: 150.0),
                Container(color: Colors.purple, height: 150.0),
                Container(color: Colors.green, height: 150.0),
              ],
            ),
          )
        ]));
woshitom
  • 4,811
  • 8
  • 38
  • 62
  • Is it really behaving like that? I'm using your code on dartpad and it's working fine. https://dartpad.dev/e4aad8ebfc91c751e50fc52b16484aaa?null_safety=true App bar coming down when you scrolls down. – Chirag Bargoojar Jun 04 '21 at 14:38
  • https://github.com/flutter/flutter/issues/75059 – Spatz Jun 04 '21 at 15:01
  • @ChiragBargoojar in your link and with my browser the appbar is not floating. I'm expecting the appbar to show as soon as I'm scrolling up, from any position. In your link it only shows up when the top is reached – woshitom Jun 04 '21 at 17:08
  • Yes, I just saw that check @Spatz shared the link it's stating the same problem. – Chirag Bargoojar Jun 04 '21 at 17:29

0 Answers0