DataTableY constructor
DataTableY({
- Key? key,
- required List<
DataColumnY> columns, - int? sortColumnIndex,
- bool sortAscending = true,
- ValueSetter<
bool?> ? onSelectAll, - Decoration? decoration,
- WidgetStateProperty<
Color?> ? 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,
- TextStyle? dataTextStyle,
- WidgetStateProperty<
Color?> ? headingRowColor, - double? headingRowHeight,
- TextStyle? headingTextStyle,
- double? horizontalMargin,
- double? columnSpacing,
- bool showCheckboxColumn = false,
- bool showBottomBorder = false,
- double? dividerThickness,
- required List<
DataRowY> rows, - double? checkboxHorizontalMargin,
- TableBorder? border,
- 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;