LazyDataTable constructor

LazyDataTable({
  1. Key? key,
  2. required int columns,
  3. required int rows,
  4. LazyDataTableDimensions tableDimensions = const LazyDataTableDimensions(),
  5. LazyDataTableTheme tableTheme = const LazyDataTableTheme(),
  6. Widget topHeaderBuilder(
    1. int columnIndex
    )?,
  7. Widget leftHeaderBuilder(
    1. int rowIndex
    )?,
  8. Widget rightHeaderBuilder(
    1. int rowIndex
    )?,
  9. Widget bottomHeaderBuilder(
    1. int columnIndex
    )?,
  10. required Widget dataCellBuilder(
    1. int columnIndex,
    2. int rowIndex
    ),
  11. Widget? topLeftCornerWidget,
  12. Widget? topRightCornerWidget,
  13. Widget? bottomLeftCornerWidget,
  14. 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.");
  }
}