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

Feature request: allow sections in the list #4

Open
sebastianbuechleratcamaelion opened this issue Jun 15, 2020 · 5 comments
Open

Feature request: allow sections in the list #4

sebastianbuechleratcamaelion opened this issue Jun 15, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@sebastianbuechleratcamaelion

Allow the usage of sections similar to this listview: https://pub.dev/packages/flutter_section_list_view

@themisir themisir added the enhancement New feature or request label Jun 15, 2020
@themisir
Copy link
Owner

Do you want something like that?

sections: <Section>[
  Section(
    label: Text('Static section'),
    children: <Widget>[
      ListTile(),
      ...
    ],
  ),
  Section(
    label: Text('Dynamic section'),
    adapter: NetworkListAdapter(..),
  ),
  ...
],

@sebastianbuechleratcamaelion
Copy link
Author

No, more like a separate sectionBuilder (additional to itemBuilder).However, i am not sure how to distinguish between sections and items in the data once you have to separate builders.

@themisir
Copy link
Owner

No, more like a separate sectionBuilder (additional to itemBuilder).However, i am not sure how to distinguish between sections and items in the data once you have to separate builders.

Could you write example mockup code?

@sebastianbuechleratcamaelion
Copy link
Author

sebastianbuechleratcamaelion commented Jun 15, 2020

No, more like a separate sectionBuilder (additional to itemBuilder).However, i am not sure how to distinguish between sections and items in the data once you have to separate builders.

Could you write example mockup code?

Sure:

CustomListView(
    sectionBuilder: (context, index, section) {return SectionTile(title: section.title)},
    itemBuilder: (context, index, item) {return ListTile(title: item.title)},
    adapter:  ListAdapter(
    fetchItems: (int offset, int limit) {
      return List(ListItems([ ... ])); // <- Each section has its own list entry, or maybe other structure handling the sections
    },
  ),

Does this make sense to you?

@themisir
Copy link
Owner

I need to think about code design:

  • Where to define sections
  • Dynamic sections?
  • Defining which item is associated to which section.
  • Infinite loading and many more things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants