DataTableY constructor

DataTableY({
  1. Key? key,
  2. required List<DataColumnY> columns,
  3. List<DataRowY>? footerRows,
  4. int? sortColumnIndex,
  5. bool sortAscending = true,
  6. ValueSetter<bool?>? onSelectAll,
  7. Decoration? decoration,
  8. WidgetStateProperty<Color?>? dataRowColor,
  9. @Deprecated('Migrate to use dataRowMinHeight and dataRowMaxHeight instead. ' 'This feature was deprecated after v3.7.0-5.0.pre.') double? dataRowHeight,
  10. double? dataRowMinHeight,
  11. double? dataRowMaxHeight,
  12. TextStyle? dataTextStyle,
  13. WidgetStateProperty<Color?>? headingRowColor,
  14. double? headingRowHeight,
  15. TextStyle? headingTextStyle,
  16. double? horizontalMargin,
  17. double? columnSpacing,
  18. bool showCheckboxColumn = false,
  19. bool showBottomBorder = false,
  20. double? dividerThickness,
  21. required List<DataRowY> rows,
  22. double? checkboxHorizontalMargin,
  23. TableBorder? border,
  24. Clip clipBehavior = Clip.none,
})

Implementation

DataTableY({
  super.key,
  required this.columns,
  this.footerRows,
  this.sortColumnIndex,
  this.sortAscending = true,
  this.onSelectAll,
  this.decoration,
  this.dataRowColor,
  @Deprecated(
    'Migrate to use dataRowMinHeight and dataRowMaxHeight instead. '
    'This feature was deprecated after v3.7.0-5.0.pre.',
  )
  double? dataRowHeight,
  double? dataRowMinHeight,
  double? dataRowMaxHeight,
  this.dataTextStyle,
  this.headingRowColor,
  this.headingRowHeight,
  this.headingTextStyle,
  this.horizontalMargin,
  this.columnSpacing,
  this.showCheckboxColumn = false,
  this.showBottomBorder = false,
  this.dividerThickness,
  required this.rows,
  this.checkboxHorizontalMargin,
  this.border,
  this.clipBehavior = Clip.none,
})  : assert(columns.isNotEmpty),
      assert(sortColumnIndex == null || (sortColumnIndex >= 0 && sortColumnIndex < columns.length)),
      assert(
          !rows.any((DataRowY row) => row.cells.length != columns.length), 'All rows must have the same number of cells as there are header cells (${columns.length})'),
      assert(dividerThickness == null || dividerThickness >= 0),
      assert(dataRowMinHeight == null || dataRowMaxHeight == null || dataRowMaxHeight >= dataRowMinHeight),
      assert(dataRowHeight == null || (dataRowMinHeight == null && dataRowMaxHeight == null),
          'dataRowHeight ($dataRowHeight) must not be set if dataRowMinHeight ($dataRowMinHeight) or dataRowMaxHeight ($dataRowMaxHeight) are set.'),
      dataRowMinHeight = dataRowHeight ?? dataRowMinHeight,
      dataRowMaxHeight = dataRowHeight ?? dataRowMaxHeight;