InlineStyle class
InlineStyle – theme-aware inline text styling utilities.
Use for inline components that return styled strings rather than rendering to output (badges, labels, status indicators).
Example:
final inline = InlineStyle(theme);
stdout.writeln('Status: ${inline.badge("SUCCESS", tone: BadgeTone.success)}');
stdout.writeln('Build ${inline.spinner(phase)} Processing...');
Constructors
- InlineStyle(PromptTheme theme)
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- theme → PromptTheme
-
final
Methods
-
accent(
String text) → String - Applies accent color to text.
-
badge(
String text, {BadgeTone tone = BadgeTone.info, bool inverted = true, bool bracketed = true, bool bold = true}) → String -
Creates an inline badge string:
SUCCESS -
bold(
String text) → String - Applies bold styling to text.
-
dangerBadge(
String text) → String - Shorthand for danger badge.
-
dim(
String text) → String - Applies dim styling to text.
-
error(
String text) → String - Applies error color to text.
-
errorIcon(
) → String - Error icon (✖).
-
gray(
String text) → String - Applies gray color to text.
-
highlight(
String text) → String - Applies highlight color to text.
-
icon(
String char, {StatTone tone = StatTone.accent}) → String - Returns a styled icon with the given tone color.
-
info(
String text) → String - Applies info color to text.
-
infoBadge(
String text) → String - Shorthand for info badge.
-
infoIcon(
) → String - Info icon (ℹ).
-
inverse(
String text) → String - Applies inverse styling to text.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
progressBar(
double ratio, {int width = 10, bool showPercent = true, String filledChar = '█', String emptyChar = '░'}) → String - Creates an inline progress bar: ████░░░░ 75%
-
selection(
String text) → String - Applies selection color to text.
-
spinner(
int phase, {SpinnerFrames frames = SpinnerFrames.dots}) → String - Returns a spinner frame for the given phase.
-
successBadge(
String text) → String - Shorthand for success badge.
-
successIcon(
) → String - Success icon (✔).
-
toString(
) → String -
A string representation of this object.
inherited
-
warn(
String text) → String - Applies warn color to text.
-
warnBadge(
String text) → String - Shorthand for warning badge.
-
warnIcon(
) → String - Warning icon (⚠).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited