runWithFrame method

PromptResult runWithFrame({
  1. required FrameView frame,
  2. required void content(
    1. FrameContext ctx
    ),
  3. required KeyBindings bindings,
})

Runs a prompt with FrameView-based rendering.

Convenience method that combines PromptRunner with FrameView for the most common use case.

Example:

final runner = PromptRunner();
final result = runner.runWithFrame(
  frame: FrameView(title: 'My Prompt', theme: theme, bindings: bindings),
  content: (ctx) {
    ctx.gutterLine('Content here');
  },
  bindings: bindings,
);

Implementation

PromptResult runWithFrame({
  required FrameView frame,
  required void Function(FrameContext ctx) content,
  required KeyBindings bindings,
}) {
  return runWithBindings(
    render: (out) => frame.render(out, content),
    bindings: bindings,
  );
}