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}) {
var underlineStyle = (underline ?? false) ? underline : this.underline;
var rvStyle = (reverse ?? false) ? reverse : this.reverse;
var fgColor = (foreground != null)
? foreground
: (this.foreground != null)
? this.foreground
: null;
var bgColor = (background != null)
? background
: (this.background != null)
? this.background
: null;
var brColor = (bright != null)
? bright
: (this.bright != null)
? this.bright
: null;
return wrapWith(text,
background: bgColor,
foreground: fgColor,
bright: brColor,
reverse: rvStyle,
underline: underlineStyle);
}