styleForCell method

Style? styleForCell({
  1. required int row,
  2. required int column,
  3. required TableThemeSection section,
  4. required int rowCount,
  5. required int columnCount,
  6. required bool hasHeader,
  7. required bool hasDarkBackground,
})

Returns a merged style for the given cell.

Implementation

Style? styleForCell({
  required int row,
  required int column,
  required TableThemeSection section,
  required int rowCount,
  required int columnCount,
  required bool hasHeader,
  required bool hasDarkBackground,
}) {
  if (effects.isEmpty) return null;
  Style? styled;
  for (final effect in effects) {
    final candidate = effect.styleForCell(
      row: row,
      column: column,
      section: section,
      rowCount: rowCount,
      columnCount: columnCount,
      hasHeader: hasHeader,
      hasDarkBackground: hasDarkBackground,
    );
    if (candidate == null) continue;
    if (styled == null) {
      styled = candidate;
    } else {
      styled = styled.copy()..inherit(candidate);
    }
  }
  return styled;
}