Migrated llc Lists to be nullable instead of being an empty array

This commit is contained in:
Ayush Shekhar
2022-04-26 21:11:24 +05:30
parent 381e1c06f5
commit b6bb3608e5
23 changed files with 178 additions and 153 deletions
@@ -106,7 +106,9 @@ class StreamChannelState extends State<StreamChannel> {
limit: limit,
preferOffline: preferOffline,
);
if (state.messages.isEmpty || state.messages.length < limit) {
if (state.messages == null ||
state.messages!.isEmpty ||
state.messages!.length < limit) {
_topPaginationEnded = true;
}
_queryTopMessagesController.safeAdd(false);
@@ -137,7 +139,9 @@ class StreamChannelState extends State<StreamChannel> {
limit: limit,
preferOffline: preferOffline,
);
if (state.messages.isEmpty || state.messages.length < limit) {
if (state.messages == null ||
state.messages!.isEmpty ||
state.messages!.length < limit) {
_bottomPaginationEnded = true;
}
_queryBottomMessagesController.safeAdd(false);
@@ -299,7 +303,9 @@ class StreamChannelState extends State<StreamChannel> {
),
preferOffline: preferOffline,
);
if (state.messages.isEmpty || state.messages.length < limit) {
if (state.messages == null ||
state.messages!.isEmpty ||
state.messages!.length < limit) {
channel.state?.isUpToDate = true;
}
return state;