Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 3.36 KB

File metadata and controls

46 lines (37 loc) · 3.36 KB

TableViewEx Configuration

This document details all the configurable properties available in TableViewEx.

Table of Contents


Scrollbar Customization

  • scrollThumbColor: The color of the scrollbar thumb. Defaults to Colors.grey.
  • scrollThumbThickness: The thickness of the scrollbar thumb. Defaults to 6.0.
  • verticalThumbVisibility: Allows visibility control of the vertical scrollbar.
  • horizontalThumbVisibility: Allows visibility control of the horizontal scrollbar.
    • Note: If both visibility properties are set to false, the scrollbars will be completely hidden.

Column Behavior

  • columnDefinitions: A required list of TableViewExColumnConfig objects that define the structure, style, and behavior of each column.
  • enableColumnWidthResize: A boolean to enable or disable column resizing by dragging. Defaults to true.
  • allowColumnReordering: A boolean to enable or disable column reordering via drag-and-drop. Defaults to false.
  • resizingSeparatorWidth: The width of the draggable separator used for resizing columns. Defaults to 3.0.
  • contentMaxWidthProvider: An optional function double Function(int colIndex) that provides the maximum width for a column's content. This is used for the auto-resize on double-tap feature.

Row & Cell Configuration

  • rowCount: The required total number of rows in the table.
  • rowSpanBuilder: A required function SpanExtent Function(int) to build the height (SpanExtent) for each row.
  • cellWidgetBuilder: A required function Widget Function(BuildContext, TableVicinity) to build the widget for each individual cell in the table.
  • rowBackgroundColorProvider: An optional function Color Function(int rowIndex) to provide alternating or conditional background colors for rows.
  • showHeader: A boolean that, when true, treats the first row as a pinned header. Defaults to false.

Styling and Borders

  • horizontalBorderSide: Defines the BorderSide for the horizontal lines between rows. If omitted, no horizontal lines are drawn.
  • verticalBorderSide: Defines the BorderSide for the vertical lines between columns. If omitted, no vertical lines are drawn.

Selection Properties

  • selectionMode: An optional SelectionMode enum value (none, cell, or row) that defines the selection behavior. Defaults to SelectionMode.none.
  • selectedRowBackgroundColor: An optional Color that defines the background color of selected row. Only applicable when selectionMode is set to row. It has no impact if the selectionMode is cell, as the content widget customization is out of scope of this widget. Check example on how to handle cell selection.

Core Functionality

  • onSortRequested: An optional callback void Function(int colIndex) that is triggered when a header is tapped, signaling a sort request.
  • columnWidthCalculator: A required instance of a TableViewExWidthCalculator implementation, which is responsible for determining the initial widths of the columns. This package comes with a default implementation named as DefaultTableViewExWidthCalculator for use.