0

I have the below code. I need to make the StorySwipeList, _SearchBar and SizedBoxes scrollable along with the rest of the page. The Listview Builder scrolls no problem. But the top StorySwipeList, Sizedboxes and _searchBar do not want to scroll with them.

I have added an removed Neverscroll physics to the scroll view and thje list view, I have replaces the first listview with a column and reversed, added always scrollable physics etc. Nothing seems to make that section of widgets move.

Does anyone know how to do this?

return SafeArea(
      child: Scaffold(
        extendBody: false,
        extendBodyBehindAppBar: false,
        backgroundColor: HexColor('#0A0928'),
        body: SingleChildScrollView(
          physics: AlwaysScrollableScrollPhysics(),
          child: ListView(
            shrinkWrap: true,
            children: [
              StorySwipeList(
                  latestProTracks: pageManager.latestProTracksNotifier.value),
              SizedBox(
                height: 10,
              ),
              _searchBar(),
              SizedBox(
                height: 10,
              ),
              ValueListenableBuilder<List<MediaItem>>(
                valueListenable: pageManager.filteredMainPlaylistNotifier,
                builder: (context, playlist, _) {
                  TestLog.log('HOME PAGE: playlist size ${playlist.length}');
                  return SizedBox(
                    height: MediaQuery.of(context).size.height * 0.7,
                    child: ListView.builder(
                      physics: AlwaysScrollableScrollPhysics(),
                      shrinkWrap: true,
                      itemCount: playlist.length,
                      itemBuilder: (context, index) {
                        return PlaylistTrack(
                          index: index,
                          playlist: playlist,
                          track: playlist[index],
                          currentUserId: currentUserId,
                          playlistName: 'Main',
                        );
nerdMonkey
  • 107
  • 1
  • 14

2 Answers2

0

Try setting primary: true, in the main ListView. You can set it to false inside other ones.

intraector
  • 994
  • 10
  • 20
0

Removing the height constraint of the Sized Box seemed to do the trick.

height: MediaQuery.of(context).size.height * 0.7,
nerdMonkey
  • 107
  • 1
  • 14