LazyDataTable constructor
LazyDataTable({
- Key? key,
- required int columns,
- required int rows,
- LazyDataTableDimensions tableDimensions = const LazyDataTableDimensions(),
- LazyDataTableTheme tableTheme = const LazyDataTableTheme(),
- Widget topHeaderBuilder(
- int columnIndex
- Widget leftHeaderBuilder(
- int rowIndex
- Widget rightHeaderBuilder(
- int rowIndex
- Widget bottomHeaderBuilder(
- int columnIndex
- required Widget dataCellBuilder(),
- Widget? topLeftCornerWidget,
- Widget? topRightCornerWidget,
- Widget? bottomLeftCornerWidget,
- Widget? bottomRightCornerWidget,
Implementation
LazyDataTable({
Key? key,
// Number of data columns.
required this.columns,
// Number of data rows.
required this.rows,
// Dimensions of the table elements.
this.tableDimensions = const LazyDataTableDimensions(),
// Theme of the table elements.
this.tableTheme = const LazyDataTableTheme(),
// Builder function for the top header.
this.topHeaderBuilder,
// Builder function for the left header.
this.leftHeaderBuilder,
// Builder function for the right header.
this.rightHeaderBuilder,
// Builder function for the bottom header.
this.bottomHeaderBuilder,
// Builder function for the data cell.
required this.dataCellBuilder,
// Top left corner widget.
this.topLeftCornerWidget,
// Top right corner widget.
this.topRightCornerWidget,
// Bottom left corner widget.
this.bottomLeftCornerWidget,
// Bottom right corner widget.
this.bottomRightCornerWidget,
}) : super(key: key) {
// Check for top left corner
if (topHeaderBuilder == null || leftHeaderBuilder == null) {
assert(topLeftCornerWidget == null,
"The top left corner widget is only allowed when you have both the top header and the left header.");
}
// Check for top right corner
if (topHeaderBuilder == null || rightHeaderBuilder == null) {
assert(topRightCornerWidget == null,
"The top right corner widget is only allowed when you have both the top header and the right header.");
}
// Check for bottom left corner
if (bottomHeaderBuilder == null || leftHeaderBuilder == null) {
assert(bottomLeftCornerWidget == null,
"The bottom left corner widget is only allowed when you have both the bottom header and the left header.");
}
// Check for bottom right corner
if (bottomHeaderBuilder == null || rightHeaderBuilder == null) {
assert(bottomRightCornerWidget == null,
"The bottom right corner widget is only allowed when you have both the bottom header and the right header.");
}
}