lines method
Implementation
List<String> lines({
bool addElse = false,
}) {
var _lines = <String>[];
var operatorStr = getOperatorStr(operator);
var conditionLine = '';
if (conditionLeft != null && conditionRight != null && operator != null) {
conditionLine = '$conditionLeft $operatorStr $conditionRight';
} else if (conditionLeft != null && operator != null) {
conditionLine = '$conditionLeft $operatorStr';
} else if (conditionLeft != null) {
conditionLine = '$conditionLeft';
}
var conditionBody = body?.toCode().join(' ');
var condition = '{ $conditionBody }';
if (conditionLine != '') {
condition = 'if($conditionLine) $condition';
} else {
addElse = true;
}
if (addElse) {
condition = ' else $condition';
}
_lines.add(condition);
return _lines;
}