wrap method
Wraps text into the defined styles with option to override a style.
Implementation
String wrap(
String text, {
AnsiColor? foreground,
AnsiColor? background,
AnsiColor? bright,
bool? reverse,
bool? underline,
}) {
final underlineStyle = (underline ?? false) ? underline : this.underline;
final rvStyle = (reverse ?? false) ? reverse : this.reverse;
final fgColor = (foreground != null)
? foreground
: (this.foreground != null)
? this.foreground
: null;
final bgColor = (background != null)
? background
: (this.background != null)
? this.background
: null;
final brColor = (bright != null)
? bright
: (this.bright != null)
? this.bright
: null;
return wrapWith(
text,
background: bgColor,
foreground: fgColor,
bright: brColor,
reverse: rvStyle,
underline: underlineStyle,
);
}