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

Able to use regular ListView #84

Open
letto4135 opened this issue Dec 9, 2023 · 1 comment
Open

Able to use regular ListView #84

letto4135 opened this issue Dec 9, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@letto4135
Copy link

letto4135 commented Dec 9, 2023

Hello there.

Not really an issue, looking for a way to have a searchable list with a regular ListView instead of ListView.builder.
I have a table with a lot of sparse fields, the searchable list makes it easier, but because there are so many fields the ListView.builder loads them as you scroll and if you save before scrolling to the end then it doesn't pass all the values.

I pulled out the searchable_listview and search_text_field code into my repo, the change to do this as a ListView is inside the renderListView method

      return ListView(
        children: list.map((item) {
          return Container(
            child: widget.builder!(list.indexOf(item), item),
          );
        }).toList(),
      );

The widget.builder! was an issue for the list view. Seems like any builder methods will lazy load.
I'm not sure how the change would fit in with your repo, but this would be a nice option to have in your package if possible. 👍

@koukibadr
Copy link
Owner

@letto4135 thanks for your feedback and sending me your suggestion for this
It can be achieved if we add a parameter lazyLoading that will indicate if the searchable listview will use Listview.builder or just Listview simple constructor.
if I had other solution I will let you know, otherwise I'll let you know once published on pub.dev

@koukibadr koukibadr self-assigned this Dec 10, 2023
@koukibadr koukibadr added the enhancement New feature or request label Dec 10, 2023
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