defaultTextInputStyles function
Returns the default styles for the text input.
Creates sensible defaults for both dark and light terminal backgrounds.
isDark: Set totrue(default) for dark terminals,falsefor light.
Returns a TextInputStyles with appropriate colors for the background type.
Implementation
TextInputStyles defaultTextInputStyles({bool isDark = true}) {
final foreground = isDark ? AnsiColor(7) : AnsiColor(0);
return TextInputStyles(
focused: TextInputStyleState(
placeholder: Style().foreground(isDark ? AnsiColor(240) : AnsiColor(245)),
suggestion: Style().foreground(isDark ? AnsiColor(240) : AnsiColor(245)),
prompt: Style().foreground(foreground),
text: Style().foreground(foreground),
),
blurred: TextInputStyleState(
placeholder: Style().foreground(isDark ? AnsiColor(240) : AnsiColor(245)),
suggestion: Style().foreground(isDark ? AnsiColor(240) : AnsiColor(245)),
prompt: Style().foreground(foreground),
text: Style().foreground(foreground),
),
cursor: TextInputCursorStyle(
color: foreground,
shape: CursorShape.block,
blink: true,
),
);
}