MessageCollection constructor

MessageCollection(
  1. {required GroupChannel channel,
  2. required MessageListParams params,
  3. required MessageCollectionHandler handler,
  4. int? startingPoint,
  5. Chat? chat}
)

Constructor

startingPoint is the reference point for message retrieval in a chat view. This should be specified as a timestamp(ms) and the default value is max.

Implementation

MessageCollection({
  required GroupChannel channel,
  required MessageListParams params,
  required MessageCollectionHandler handler,
  int? startingPoint,
  Chat? chat,
})  : _channel = channel,
      _initializeParams = params,
      _loadPreviousParams = MessageListParams()..copyWith(params),
      _loadNextParams = MessageListParams()..copyWith(params),
      _handler = handler,
      _startingPoint = startingPoint ?? IntMax.max,
      _chat = chat ?? SendbirdChat().chat {
  sbLog.i(StackTrace.current, 'MessageCollection()');
  _chat.collectionManager.addMessageCollection(this);
}