mapToDataRows method

List<DataRow> mapToDataRows(
  1. List<Map<String, dynamic>> nestedObject,
  2. FieldPressedCallback onFieldPressed,
  3. int cellsNumber,
  4. void onSelectRow({
    1. required int index,
    2. required bool selected,
    }),
  5. List<int> selectedRows,
  6. bool enableSelection,
  7. 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();
}