createMessage method

Future<String?> createMessage(
  1. String threadId,
  2. Message message
)

Implementation

Future<String?> createMessage(String threadId, Message message) async {
  final result = await _repository.createMessage(threadId, message);

  return result.fold(
    (l) => null,
    (r) => r.id,
  );
}