Well, I am making a chat application I am confused about which component should I opt for rendering chats, between SingleChildScrollView
and ListView
, I read a couple of articles, and they suggest
SingleChildScrollView
, Since it's a chat application so each chat bubble will not be the same thereforeListView
will not be performant.
But, In SingleChildScrollView
all items inside the column are rendered at once even if they are not inside the ViewPort
or in other words visible. Doing so should not be memory efficient.
So which one should I Opt?
You should go for the
ListView.builder()
since it creates items on demand.Example:
docs: https://api.flutter.dev/flutter/widgets/ListView/ListView.builder.html