Flutter web, SliverAppBar floating not working

764 views Asked by At

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),
              ],
            ),
          )
        ]));
0

There are 0 answers