encloseInParentheses method
Returns this string enclosed in parentheses, or null if empty.
When wrapEmpty is true, returns '()' for empty strings.
Implementation
@useResult
String? encloseInParentheses({bool wrapEmpty = false}) {
if (isEmpty) {
return wrapEmpty ? '()' : null;
}
return '($this)';
}