copyWith method

SimplePrompt<T> copyWith({
  1. String? title,
  2. PromptTheme? theme,
  3. T? initialValue,
  4. KeyBindings buildBindings(
    1. PromptState<T> state
    )?,
  5. void render(
    1. FrameContext ctx,
    2. PromptState<T> state
    )?,
  6. bool? hideCursor,
})

Creates a copy with modified properties.

Implementation

SimplePrompt<T> copyWith({
  String? title,
  PromptTheme? theme,
  T? initialValue,
  KeyBindings Function(PromptState<T> state)? buildBindings,
  void Function(FrameContext ctx, PromptState<T> state)? render,
  bool? hideCursor,
}) {
  return SimplePrompt<T>(
    title: title ?? this.title,
    theme: theme ?? this.theme,
    initialValue: initialValue ?? this.initialValue,
    buildBindings: buildBindings ?? this.buildBindings,
    render: render ?? this.render,
    hideCursor: hideCursor ?? this.hideCursor,
  );
}