1

I'm using a CustomScrollView that has this hierarchy:

  • SliverPersistentHeader
  • SliverPersistentHeader
  • SliverFillRemaining

The 1st SliverPersistentHeader isn't pinned, the 2nd SliverPersistentHeader is pinned and I expect that SliverFillRemaining will always be below the second SliverPersistentHeader.

The SliverFillRemaining contains a scrollable list and therefor it has hasScrollBody property set to true.

Currently SliverFillRemaining when builded is located below the 2nd header, but when scrolling it goes behind the 2nd header until reaching the AppBar. How can I make SliverFillRemaining to always be placed below the 2nd header?

Some code:

CustomScrollView(
          physics: ClampingScrollPhysics(),
          slivers: <Widget>[
            SliverPersistentHeader(
              pinned: false,
              delegate: _SliverAppBarDelegate(
                  minHeight: 0.0,
                  maxHeight: 340.0,
                  child: ClipRect(
                    child: OverflowBox(
                      alignment: Alignment.topLeft,
                      maxHeight: 340.0,
                      child: Column(
                        children: <Widget>[
                          Widget1()
                          Widget2(),
                        ],
                      ),
                    ),
                  )
              ),
            ),
            SliverPersistentHeader(
              pinned: true,
              delegate: _SliverAppBarDelegate(
                  minHeight: 50.0,
                  maxHeight: 55.0,
                  child: Column(
                    children: <Widget>[
                      Widget3(),
                    ],
                  ),
              ),
            ),
            SliverFillRemaining(
              hasScrollBody: true,
              child: Column(
                children: <Widget>[
                  Widget4(),
                ],
              ),
            )
          ],         
        ),
Juvi
  • 1,078
  • 1
  • 19
  • 38

0 Answers0