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

Build StickyHeaders dynamicly #52

Closed
mehrdad-shokri opened this issue Aug 22, 2020 · 4 comments
Closed

Build StickyHeaders dynamicly #52

mehrdad-shokri opened this issue Aug 22, 2020 · 4 comments

Comments

@mehrdad-shokri
Copy link

Hi, thanks for your library this is not an issue/bug with this library. I'm stuck on generating StickyHeader as a builder pattern. I want to create a finite list just like ListView.Builder but with CustomScrollView. More detail can be found here sorry again for opening this issue

@letsar
Copy link
Owner

letsar commented Aug 26, 2020

Can you elaborate?

You can do something like this:

return CustomScrollView(
      slivers: [
        ...groups.map(
          (group) {
            return SliverStickyHeader(
              header:Text(group.title),
              sliver: SliverList(
                delegate: SliverChildBuilderDelegate(
                  (BuildContext context, int index) {
                    return Text(group.items[index].label);
                  },
                  childCount: group.items.length,
                ),
              ),
            );
          },
        ),
      ],
    );

@mehrdad-shokri
Copy link
Author

I'm creating upcoming page of a todo app. user can scroll indefinitely so groups isn't something I want. Besides, Items should be created dynamically inside slivers

@letsar
Copy link
Owner

letsar commented Jul 13, 2022

It doesn't seem to be related to this package.

@astubenbord
Copy link

Did you find a solution on how to lazy-load StickyHeaders?

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

3 participants