mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-18 10:23:51 +02:00
docs: add more descriptive documentation to repository methods
This commit is contained in:
parent
c155531b11
commit
f7f15ef750
2 changed files with 15 additions and 1 deletions
|
@ -73,17 +73,27 @@ abstract class ChatRepositoryInterface {
|
|||
required MessageModel firstMessage,
|
||||
});
|
||||
|
||||
/// Function that provides the next message id
|
||||
/// Retrieve the next unused message id given a current chat.
|
||||
///
|
||||
/// The resulting string should be at least unique per [chatId]. The userId
|
||||
/// is provided in case the specific user has influence on the id.
|
||||
///
|
||||
/// Imagine returning a UUID, the next integer in a counter or the document
|
||||
/// id in firebase.
|
||||
Future<String> getNextMessageId({
|
||||
required String userId,
|
||||
required String chatId,
|
||||
});
|
||||
|
||||
/// Send a message with the given parameters.
|
||||
///
|
||||
/// [chatId] is the chat id.
|
||||
/// [senderId] is the sender id.
|
||||
/// [messageId] is the identifier for this message
|
||||
/// [text] is the message text.
|
||||
/// [imageUrl] is the image url.
|
||||
/// [messageType] is a way to identify a difference in messages
|
||||
/// [timestamp] is the moment of sending.
|
||||
Future<void> sendMessage({
|
||||
required String chatId,
|
||||
required String senderId,
|
||||
|
|
|
@ -15,10 +15,14 @@ abstract class PendingMessageRepositoryInterface {
|
|||
});
|
||||
|
||||
/// Create a message in the pending messages and return the created message.
|
||||
///
|
||||
/// [chatId] is the chat id.
|
||||
/// [senderId] is the sender id.
|
||||
/// [messageId] is the identifier for this message
|
||||
/// [text] is the message text.
|
||||
/// [imageUrl] is the image url.
|
||||
/// [messageType] is a way to identify a difference in messages
|
||||
/// [timestamp] is the moment of sending.
|
||||
Future<MessageModel> createMessage({
|
||||
required String chatId,
|
||||
required String senderId,
|
||||
|
|
Loading…
Reference in a new issue