getQueuedCommandAttachments function

List<Attachment> getQueuedCommandAttachments(
  1. List<Map<String, dynamic>> queuedCommands
)

Get queued command attachments from a list of queued commands.

Implementation

List<Attachment> getQueuedCommandAttachments(
  List<Map<String, dynamic>> queuedCommands,
) {
  return queuedCommands
      .map(
        (cmd) => QueuedCommandAttachment(
          prompt: cmd['prompt'],
          sourceUuid: cmd['source_uuid'] as String?,
          imagePasteIds: (cmd['imagePasteIds'] as List?)?.cast<int>(),
          commandMode: cmd['commandMode'] as String?,
        ),
      )
      .toList();
}