StickyHeadersTable constructor
StickyHeadersTable({
- Key? key,
- required int columnsLength,
- required int rowsLength,
- Widget legendCell = const Text(''),
- required Widget columnsTitleBuilder(
- int columnIndex
- required Widget rowsTitleBuilder(
- int rowIndex
- required Widget contentCellBuilder(),
- CellDimensions cellDimensions = CellDimensions.base,
- CellAlignments cellAlignments = CellAlignments.base,
- dynamic onStickyLegendPressed()?,
- dynamic onColumnTitlePressed(
- int columnIndex
- dynamic onRowTitlePressed(
- int rowIndex
- dynamic onContentCellPressed()?,
- double initialScrollOffsetX = 0.0,
- double initialScrollOffsetY = 0.0,
- dynamic onEndScrolling()?,
- ScrollControllers? scrollControllers,
Implementation
StickyHeadersTable({
Key? key,
/// Number of Columns (for content only)
required this.columnsLength,
/// Number of Rows (for content only)
required this.rowsLength,
/// Title for Top Left cell (always visible)
this.legendCell = const Text(''),
/// Builder for column titles. Takes index of content column as parameter
/// and returns String for column title
required this.columnsTitleBuilder,
/// Builder for row titles. Takes index of content row as parameter
/// and returns String for row title
required this.rowsTitleBuilder,
/// Builder for content cell. Takes index for content column first,
/// index for content row second and returns String for cell
required this.contentCellBuilder,
/// Table cell dimensions
this.cellDimensions = CellDimensions.base,
/// Alignments for cell contents
this.cellAlignments = CellAlignments.base,
/// Callbacks for when pressing a cell
Function()? onStickyLegendPressed,
Function(int columnIndex)? onColumnTitlePressed,
Function(int rowIndex)? onRowTitlePressed,
Function(int columnIndex, int rowIndex)? onContentCellPressed,
/// Initial scroll offsets in X and Y directions
this.initialScrollOffsetX = 0.0,
this.initialScrollOffsetY = 0.0,
/// Called when scrolling has ended, passing the current offset position
this.onEndScrolling,
/// Scroll controllers for the table
ScrollControllers? scrollControllers,
}) : this.scrollControllers = scrollControllers ?? ScrollControllers(),
this.onStickyLegendPressed = onStickyLegendPressed ?? (() {}),
this.onColumnTitlePressed = onColumnTitlePressed ?? ((_) {}),
this.onRowTitlePressed = onRowTitlePressed ?? ((_) {}),
this.onContentCellPressed = onContentCellPressed ?? ((_, __) {}),
super(key: key) {
cellDimensions.runAssertions(rowsLength, columnsLength);
cellAlignments.runAssertions(rowsLength, columnsLength);
}