Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ScrollablePositionedList] with StickyHeader #516

Open
daddowzoubair opened this issue Feb 15, 2024 · 0 comments
Open

[ScrollablePositionedList] with StickyHeader #516

daddowzoubair opened this issue Feb 15, 2024 · 0 comments

Comments

@daddowzoubair
Copy link

I'm using sticky_headers: ^0.3.0+2 with scrollable_positioned_list: ^0.3.8

using this code

return ScrollablePositionedList.builder(
    initialScrollIndex: _initialScrollIndex,
    shrinkWrap: true,
    itemCount: products.length,
    itemBuilder: (context, mainIndex) => 
    StickyHeader(
      header: ProductsListItem(
          listItem: products[mainIndex].first,
        ), 
      content:  ListView.builder(
        shrinkWrap: true,
        physics: const ClampingScrollPhysics(),
        itemCount: products[mainIndex].length - 1,
        itemBuilder: (context, index) {
          return ProductsListItem(
            listItem: products[mainIndex][index + 1],
          );
        }
      )
    )
  );

And this is my flutter doctor information
[✓] Flutter (Channel stable, 3.16.9, on macOS 14.2.1 23C71 darwin-arm64, locale en-AE)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.86.1)
[✓] VS Code (version 1.76.2)
[✓] Connected device (3 available)
[✓] Network resources

When I scroll beside the initialScrollIndex I have this dancing for the header

scroll_position.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant