ListView build tất cả con trước — cuộn qua danh sách 1000 item rất chậm và tốn bộ nhớ. ListView.builder lazily build item hiện trên màn hình: chỉ ~10 item tồn tại trong bộ nhớ mọi lúc.
- Luôn dùng
ListView.buildercho danh sách động.SliverListlà giải pháp nâng cao cho scrolling phức tạp (kết hợp list và grid). - Nhầm lẫn dùng
ListViewthayListView.builderlà bug hiệu năng phổ biến.
ListView builds all children upfront — slow and memory-intensive for large lists. ListView.builder lazily builds only visible items, keeping only ~10 items in memory at once.
- Always use
ListView.builderfor dynamic lists. - Using
ListViewinstead is a common performance bug.