PromptInput constructor

const PromptInput({
  1. Key? key,
  2. Widget? header,
  3. Widget? contextStrip,
  4. Widget? footer,
  5. String agentName = 'Codex',
  6. bool enabled = true,
  7. required bool isSending,
  8. bool promptAppearsStalled = false,
  9. PromptSendCallback? onSend,
  10. Future<ChatSubmitResult> onSubmit(
    1. ChatSubmission
    )?,
  11. ChatComposerController? composerController,
  12. Object? sessionIdentity,
  13. required VoidCallback onStop,
  14. bool showAttachmentControl = true,
  15. bool showExecutionPolicy = true,
  16. bool canQueueWhileSending = true,
  17. List<Map<String, Object?>> availableCommands = const <Map<String, Object?>>[],
  18. int availableCommandsRevision = 0,
  19. ChatPromptCapabilities? promptCapabilities,
  20. ChatPermissionRequest? pendingPermissionRequest,
  21. VoidCallback? onAllowPermission,
  22. VoidCallback? onDenyPermission,
  23. VoidCallback? onCancelPermission,
  24. ValueChanged<String>? onSelectPermissionOption,
  25. ChatToolCallExecutionPolicy toolCallExecutionPolicy = ChatToolCallExecutionPolicy.defaultPermissions,
  26. bool hasPermissionReviewer = false,
  27. ValueChanged<ChatToolCallExecutionPolicy>? onToolCallExecutionPolicyChanged,
  28. ChatConfigOption? modelOption,
  29. ChatConfigOption? reasoningEffortOption,
  30. ValueChanged<String>? onModelSelected,
  31. ValueChanged<String>? onReasoningEffortSelected,
  32. List<ChatConfigOption> configOptions = const <ChatConfigOption>[],
  33. SessionConfigSelectionCallback? onConfigOptionSelected,
  34. PromptAttachmentPicker? pickAttachments,
  35. PromptAttachmentKindPicker? pickAttachmentsForKind,
  36. PromptAttachmentController? attachmentController,
  37. PromptImageClipboardReader readClipboardImage = emptyClipboardImage,
  38. PromptDroppedImageReader readDroppedImage = readDroppedImageAttachment,
  39. List<String> workspaceRoots = const <String>[],
  40. String? imageAttachmentLimitation,
  41. List<String> promptHistory = const <String>[],
  42. List<ChatQueuedPrompt> queuedPrompts = const <ChatQueuedPrompt>[],
  43. ValueChanged<int>? onGuideQueuedPrompt,
  44. ValueChanged<int>? onRemoveQueuedPrompt,
  45. VoidCallback? onClearQueuedPrompts,
  46. void onReorderQueuedPrompt(
    1. int oldIndex,
    2. int newIndex
    )?,
  47. ChatInputBudget inputBudget = const ChatInputBudget(),
})

Implementation

const PromptInput({
  super.key,
  this.header,
  this.contextStrip,
  this.footer,
  this.agentName = 'Codex',
  this.enabled = true,
  required this.isSending,
  this.promptAppearsStalled = false,
  this.onSend,
  this.onSubmit,
  this.composerController,
  this.sessionIdentity,
  required this.onStop,
  this.showAttachmentControl = true,
  this.showExecutionPolicy = true,
  this.canQueueWhileSending = true,
  this.availableCommands = const <Map<String, Object?>>[],
  this.availableCommandsRevision = 0,
  this.promptCapabilities,
  this.pendingPermissionRequest,
  this.onAllowPermission,
  this.onDenyPermission,
  this.onCancelPermission,
  this.onSelectPermissionOption,
  this.toolCallExecutionPolicy =
      ChatToolCallExecutionPolicy.defaultPermissions,
  this.hasPermissionReviewer = false,
  this.onToolCallExecutionPolicyChanged,
  this.modelOption,
  this.reasoningEffortOption,
  this.onModelSelected,
  this.onReasoningEffortSelected,
  this.configOptions = const <ChatConfigOption>[],
  this.onConfigOptionSelected,
  this.pickAttachments,
  this.pickAttachmentsForKind,
  this.attachmentController,
  this.readClipboardImage = emptyClipboardImage,
  this.readDroppedImage = readDroppedImageAttachment,
  this.workspaceRoots = const <String>[],
  this.imageAttachmentLimitation,
  this.promptHistory = const <String>[],
  this.queuedPrompts = const <ChatQueuedPrompt>[],
  this.onGuideQueuedPrompt,
  this.onRemoveQueuedPrompt,
  this.onClearQueuedPrompts,
  this.onReorderQueuedPrompt,
  this.inputBudget = const ChatInputBudget(),
}) : assert(onSend != null || onSubmit != null);