CliTheme class final

The style of each channel of a Cli, merged under the styles of the message itself, and the ThemeData the widgets it shows are shown in (data).

A channel left out takes its style from data: Cli.detail its muted text, Cli.success, Cli.warn and Cli.err its success, warning and error colors; Cli.info is unstyled and Cli.alert bold white on red. Without data, the terminal's own colors (ThemeData.terminal), its muted text dim (lineData).

The prompts' lines take question, answer and hint: ? Name? (my_app) as asked, ✔ Name? my_app once answered, the ✔ in success and a refusal's ✗ in error; the marks are glyphs.

final cli = Cli(
  theme: CliTheme(
    warning: const Style(fg: Color.yellow, attrs: Attr.bold),
  ),
);
Annotations
  • @immutable

Constructors

CliTheme({ThemeData? data, Style? detail, Style? info, Style? success, Style? warning, Style? error, Style? alert, Style? question, Style? answer, Style? hint})
A theme of data with the channels given restyled.
const

Properties

alert → Style
The style of Cli.alert: bold white on red by default.
no setter
answer → Style
A prompt's answer once given, and the ? before a question: the theme's primary color by default.
no setter
data → ThemeData?
What widgets are shown in (Cli.show, prompts, progress); null for the terminal's own theme, which the inline session takes from its brightness.
final
detail → Style
The style of Cli.detail: muted by default.
no setter
error → Style
The style of Cli.err: the theme's error color by default.
no setter
glyphs → Glyphs
The marks of the prompts' and progress lines (✔, ✓, ✗): ThemeData.glyphs of data, Glyphs.unicode without it.
no setter
hashCode → int
The hash code for this object.
no setteroverride
hint → Style
What a prompt says around its question (the default, how to answer): the theme's muted text by default.
no setter
info → Style
The style of Cli.info: unstyled by default.
no setter
question → Style
The question a prompt asks: bold by default.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
success → Style
The style of Cli.success: the theme's success color by default.
no setter
warning → Style
The style of Cli.warn: the theme's warning color by default.
no setter

Methods

copyWith({ThemeData? data, Style? detail, Style? info, Style? success, Style? warning, Style? error, Style? alert, Style? question, Style? answer, Style? hint}) → CliTheme
This theme with the fields given replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override