mapToDataRows method
List<DataRow>
mapToDataRows(
- List<Map<String, dynamic>> nestedObject,
- FieldPressedCallback onFieldPressed,
- int cellsNumber,
- void onSelectRow({
- required int index,
- required bool selected,
}),
- List<int> selectedRows,
- bool enableSelection,
- List<String> keys,
)
Implementation
List<DataRow> mapToDataRows(
List<Map<String, dynamic>> nestedObject,
FieldPressedCallback onFieldPressed,
int cellsNumber,
void Function({required bool selected, required int index}) onSelectRow,
List<int> selectedRows,
bool enableSelection,
List<String> keys,
) {
return nestedObject.map((obj) {
final index = nestedObject.indexOf(obj);
final isSelected = selectedRows.contains(index);
return buildRow(
objectAsJson: obj,
onFieldPressed: onFieldPressed,
cellsNumber: cellsNumber,
objectIndex: index,
isSelected: isSelected,
onSelectRow: onSelectRow,
enableSelection: enableSelection,
keys: keys,
);
}).toList();
}