Console class final
Writes dpk's own messages.
Child processes started by dpk write to the terminal directly. Everything dpk prints itself goes through a Console, so tests can capture it and so colors and verbosity follow one set of rules.
Constructors
- Console({required StringSink out, required StringSink err, bool useColor = false, bool isStdio = false, bool hasTerminal = false, int terminalColumns = 80})
- Console.buffered()
-
A console that collects output in memory.
factory
- Console.stdio({bool? color})
-
A console that writes to the process's stdout and stderr.
factory
Properties
- err → StringSink
-
final
- errText → String
-
Text written to a buffered console's stderr.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasTerminal → bool
-
Whether stdout and stderr are both attached to a terminal.
final
- isStdio → bool
-
Whether out and err are the real stdout and stderr, so child
processes can inherit them.
final
- out → StringSink
-
final
- outText → String
-
Text written to a buffered console's stdout.
no setter
- quiet ↔ bool
-
Hides step messages.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- terminalColumns → int
-
final
- useColor → bool
-
final
- verbose ↔ bool
-
Prints detail messages.
getter/setter pair
Methods
-
bold(
String text) → String -
cyan(
String text) → String -
detail(
String message) → void - Prints a message only in verbose mode.
-
dim(
String text) → String -
error(
String message) → void - Prints an error to stderr.
-
green(
String text) → String -
info(
String message) → void - Prints a result line to stdout.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
packageColor(
String text, int index) → String -
red(
String text) → String -
step(
String message) → void - Prints a progress line, such as the script dpk is about to run, to stderr so it never mixes into piped script output.
-
toString(
) → String -
A string representation of this object.
inherited
-
warning(
String message) → void - Prints a warning to stderr.
-
yellow(
String text) → String
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited