row method
Implementation
row(List<DatecsColumn> cols){
final isSumValid = cols.fold(0, (int sum, col) => sum + col.width) == getDivider();
if (!isSumValid) {
throw Exception('Total columns width must be equal to ${getDivider()}');
}
String text= "";
int max_char = _getMaxCharsPerLine();
for (int i = 0; i < cols.length; ++i) {
int max_char_col = ((max_char / getDivider()) * cols[i].width).floor();
if(cols[i].text.length > max_char_col){
var tmp = cols[i].text.substring(0, max_char_col);
text += textPrint(tmp, style: cols[i].styles, useRow: true);
}else{
if(cols[i].styles.align == DatecsAlign.left || cols[i].styles.align == DatecsAlign.center){
int restStr = max_char_col - cols[i].text.length;
var tmp = cols[i].text;
for(int j = 0; j < restStr; j++){
tmp += " ";
}
text += textPrint(tmp, style: cols[i].styles, useRow: true);
}else if(cols[i].styles.align == DatecsAlign.right){
int restStr = max_char_col - cols[i].text.length;
var tmp = "";
for(int j = 0; j < restStr; j++){
tmp += " ";
}
tmp += cols[i].text;
text += textPrint(tmp, style: cols[i].styles, useRow: true);
}
}
}
text += "{br}";
args.add(text);
}