rowAsMap method
Returns row row as a name → value map aligned with columns.
Implementation
Map<String, Object?> rowAsMap(int row) {
if (row < 0 || row >= rows.length) {
return const <String, Object?>{};
}
final values = rows[row];
final out = <String, Object?>{};
for (var i = 0; i < columns.length; i++) {
out[columns[i]] = i < values.length ? values[i] : null;
}
return out;
}