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

Ui Freezing when too many items are loaded in the list-LazyLoading feature request #179

Open
RileyManda opened this issue Apr 17, 2023 · 0 comments

Comments

@RileyManda
Copy link

I am facing an issue where my Ui freezes when i have more than 10 items in my list: I have a color generator that generates colors efficiently and never regenerates a color for the same list item saved in a map for my list. I tried removing this generator to test if the UI would stop freezing: but the UI still freezes when using grouped listview. I removed grouped listview and created a normal flutter listview. build and the Ui stopped freezing. I even tried creating separate widgets for my Ui and Data (Separation of Concerns)But all my lists that use grouped listview cause the Ui to freeze.:

This is my code snippet with GroupedListView:

return GroupedListView(
              controller: _scrollController,
              semanticChildCount: itemList.length,
              sort: true,
              order: GroupedListOrder.ASC,
              elements: itemList,
              useStickyGroupSeparators: true,
              groupBy: (Pantry pantry) => pantry.category,

              groupHeaderBuilder: (Pantry pantry) => Padding(
                padding: const EdgeInsets.all(10.0).copyWith(left: 20),
                child: Text(
                  getFormattedDate(pantry.date).toUpperCase(),
                  style: const TextStyle(
                    fontSize: 16,
                    fontWeight: FontWeight.bold,
                    color: Colors.grey,
                  ),
                ),
              ),
              itemBuilder: (context, Pantry pantry) {
                return Padding(
                  padding: const EdgeInsets.symmetric(horizontal: 8),
                  child: InkWell(
                    onTap: () {
                      textController.text = pantry.text;
                      categoryController.text = pantry.category;
                      time = pantry.time;
                      showItemInput(context, pantry: pantry);
                    },
                    child: Container(
                      decoration: BoxDecoration(
                        color: Colors.white,
                        border: Border(
                            right: BorderSide(
                          color: getCatColorForCategory(pantry.category),
                          width: 10,
                        )),

Suggestions
Please implement lazy loading to the grouped listview library

@RileyManda RileyManda changed the title Ui Freezing when too many items are loaded in the list Ui Freezing when too many items are loaded in the list-LazyLoading feature request Apr 17, 2023
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