extractTabularHeader function
Extracts tabular header from array of objects
Implementation
List<String>? extractTabularHeader(List<Map<String, Object?>> rows) {
if (rows.isEmpty) {
return null;
}
final firstRow = rows[0];
final firstKeys = firstRow.keys.toList();
if (firstKeys.isEmpty) {
return null;
}
if (isTabularArray(rows, firstKeys)) {
return firstKeys;
}
return null;
}