Convert chat to from builder to ListView (#154)
Since widgets are built bottom up in the chat, most of the benefits of the `ListView.builder` are likely null.
This commit is contained in:
parent
9911ed49e6
commit
717d989954
1 changed files with 7 additions and 6 deletions
|
|
@ -35,16 +35,17 @@ class Chat extends StatelessWidget {
|
|||
style: DefaultTextStyle.of(context).style.copyWith(fontSize: chatStore.settings.fontSize),
|
||||
child: Observer(
|
||||
builder: (context) {
|
||||
return ListView.builder(
|
||||
return ListView(
|
||||
reverse: true,
|
||||
padding: EdgeInsets.zero,
|
||||
addAutomaticKeepAlives: false,
|
||||
controller: chatStore.scrollController,
|
||||
itemCount: chatStore.renderMessages.length,
|
||||
itemBuilder: (context, index) => ChatMessage(
|
||||
ircMessage: chatStore.renderMessages.reversed.toList()[index],
|
||||
chatStore: chatStore,
|
||||
),
|
||||
children: chatStore.renderMessages.reversed
|
||||
.map((e) => ChatMessage(
|
||||
ircMessage: e,
|
||||
chatStore: chatStore,
|
||||
))
|
||||
.toList(),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue