getChannelStateByCid method
Future<ChannelState>
getChannelStateByCid(
- String cid, {
- PaginationParams? messagePagination,
- PaginationParams? pinnedMessagePagination,
inherited
Get ChannelState
data by providing channel cid
Implementation
Future<ChannelState> getChannelStateByCid(
String cid, {
PaginationParams? messagePagination,
PaginationParams? pinnedMessagePagination,
}) async {
final data = await Future.wait([
getMembersByCid(cid),
getReadsByCid(cid),
getChannelByCid(cid),
getMessagesByCid(cid, messagePagination: messagePagination),
getPinnedMessagesByCid(cid, messagePagination: pinnedMessagePagination),
]);
return ChannelState(
members: data[0] as List<Member>?,
read: data[1] as List<Read>?,
channel: data[2] as ChannelModel?,
messages: data[3] as List<Message>?,
pinnedMessages: data[4] as List<Message>?,
);
}