Bloc: Performance on listView

Created on 16 Apr 2019  路  2Comments  路  Source: felangel/bloc

Hi @felangel,

You just contributed a great project to our flutter community. I really loved it.
In your flutter_inifite_list, I saw that:

  • Each time we get the new data and addAll to the list, the flutter ListView try to rebuild the entire list (from the beginning item).

So I wonder:
1/ Does it affect the performance of the list view if our PostWidget had much more complicated UI(maybe, it included the pictures or video)?
2/ So if I wanted to update an item in the list, ListView was also rebuilt entire list?
3/ Do we have a solution for that in flutter(in android native we got method notifyItemRangeInserted to solved that)?

question

Most helpful comment

Thank you so much @felangel

All 2 comments

Hi @locpt 馃憢
Thanks for opening an issue and the positive feedback!

Great question! The ListView.builder constructor will only create items as they are scrolled onto the screen (source).

As a result, as long as our build is a pure function (meaning we don't have any side effects like making network requests or reading from a DB) it should be totally fine. I haven't seen any performance issues personally but if you are then let me know and I'm more than happy to help. 馃憤

Thank you so much @felangel

Was this page helpful?
0 / 5 - 0 ratings