data_grid library

Classes

CellLayoutId
Identifies a single cell in the grid by its row and column indices.
CellScope<T extends DataGridRow>
Scoped inherited widget that provides per-cell data to descendant widgets.
ClearFilterEvent
Clears the filter on a specific column, or all filters if columnId is null.
ClearSelectionEvent
Clears all row and cell selections.
ColumnFilter
A single column filter with an operator and comparison value.
ColumnReorderEvent
Moves a column from oldIndex to newIndex.
ColumnResizeEvent
Resizes a column to the specified width.
CustomHorizontalScrollbar
A custom horizontal scrollbar widget with drag support.
CustomLayoutGridBody<T extends DataGridRow>
CustomVerticalScrollbar
A custom vertical scrollbar widget with drag support.
DataGrid<T extends DataGridRow>
A high-performance, virtualized data grid widget for displaying tabular data.
DataGridBody<T extends DataGridRow>
DataGridBorders
Border settings for DataGrid elements.
DataGridCell<T extends DataGridRow>
Cell widget whose content is always a stable widget instance wrapped in CellScope. The child widget (either DataGridColumn.cellWidget or the built-in _DefaultTextCell) is created once and never changes identity, so Flutter preserves the entire element subtree across rebuilds.
DataGridCellDecorations
Pre-computed BoxDecoration instances for all common cell variants. Avoids allocating new decorations on every cell build.
DataGridChildDelegate<T extends DataGridRow>
Delegate that provides children (cells) for the 2D grid viewport. Builds DataGridCell / DataGridCheckboxCell widgets directly from the grid's data, avoiding closure allocation on every body rebuild.
DataGridColors
Color settings for DataGrid elements.
DataGridColumn<T extends DataGridRow>
Configuration for a column in the DataGrid.
DataGridController<T extends DataGridRow>
Controller for managing DataGrid state, data, and events.
DataGridControllerScope<T extends DataGridRow>
Provides the controller and scroll controller. These rarely change, so widgets depending only on this won't rebuild on state updates.
DataGridDimensions
Dimension settings for DataGrid layout.
DataGridEvent
Base class for all data grid events.
DataGridHeader<T extends DataGridRow>
DataGridHeaderCell
A single header cell widget that displays column title and handles sorting/resizing. Supports:
DataGridInherited<T extends DataGridRow>
Convenience wrapper that nests both scopes.
DataGridInterceptor<T extends DataGridRow>
Base class for DataGrid interceptors.
DataGridLoadingOverlay
Default loading overlay widget displayed during heavy operations.
DataGridLoadingScope<T extends DataGridRow>
Scoped loading overlay that only rebuilds when loading state changes.
DataGridOverlayTheme
Theme settings for loading overlays in DataGrid.
DataGridPadding
Padding settings for DataGrid elements.
DataGridPagination<T extends DataGridRow>
DataGridRow
Base class for rows displayed in a DataGrid.
DataGridScrollView<T extends DataGridRow>
DataGridState<T extends DataGridRow>
Immutable snapshot of the entire data grid state.
DataGridStateScope<T extends DataGridRow>
Provides grid state via InheritedModel so dependents can subscribe to specific DataGridAspects and skip rebuilds for unrelated changes.
DataGridTheme
An inherited widget that provides DataGridThemeData to descendant widgets.
DataGridThemeData
Theme configuration for customizing the appearance of a DataGrid.
DataGridVicinity
Represents a cell's location in the 2D grid.
DataGridViewport<T extends DataGridRow>
The viewport widget that displays a scrollable window into the 2D grid. This widget creates and manages the render object that performs layout.
DefaultFilterWidget
Default filter widget using a simple debounced text input.
DeleteRowEvent
Deletes a single row by its ID.
DeleteRowsEvent
Deletes multiple rows by their IDs.
EditState
Inline cell editing state.
EnablePaginationEvent
Enables or disables pagination.
FilterDelegate<T extends DataGridRow>
FilterEvent
Applies a filter on a column with the given operator and value.
FilterResult
FilterScope
Scoped inherited widget that provides per-column filter data to descendant widgets.
FilterState
Active column filters, keyed by column ID.
FirstPageEvent
Navigates to the first page.
GridLayoutDelegate
A MultiChildLayoutDelegate that positions grid cells at pre-computed offsets. Each child is identified by a CellLayoutId and sized/placed according to the corresponding entry in cellRects.
GridScrollController
Manages horizontal and vertical scroll controllers for the data grid, exposing reactive streams for scroll metric changes.
GroupByColumnEvent
Groups rows by the specified column.
GroupState
Row grouping state.
InsertRowEvent
Inserts a single row, optionally at a specific position.
InsertRowsEvent
Inserts multiple rows at the end of the grid.
LastPageEvent
Navigates to the last page.
LoadDataEvent<T>
Loads a new set of rows into the grid, optionally appending to existing data.
Moves the focused row down by one position.
Moves the focused column left by one position.
Moves the focused column right by one position.
Moves the focused row up by one position.
NextPageEvent
Navigates to the next page.
PaginationState
Pagination configuration and position.
PreviousPageEvent
Navigates to the previous page.
RefreshDataEvent
Triggers a data refresh by setting the loading flag.
RenderDataGridViewport<T extends DataGridRow>
The render object that performs the actual layout of the 2D grid. This implements the lazy rendering logic that only builds visible cells.
ScrollbarTracker
Widget that tracks scroll controller changes and rebuilds its child.
SelectAllRowsEvent
Selects all rows, or a specific set of row IDs if provided.
SelectAllVisibleEvent
Selects all currently visible rows.
SelectionState
Row and cell selection state.
SelectRowEvent
Selects or toggles a single row.
SelectRowsRangeEvent
Selects a contiguous range of rows between two row IDs.
SetLoadingEvent
Explicitly sets the loading state and optional message.
SetPageEvent
Navigates to a specific page number.
SetPageSizeEvent
Changes the number of rows displayed per page.
SetSelectionModeEvent
Changes the selection mode (none, single, or multiple).
SetServerSidePaginationEvent
Enables or disables server-side pagination mode.
SetTotalItemsEvent
Sets the total item count (used for server-side pagination).
SortColumn
Identifies a sorted column and its direction.
SortCompleteEvent<T extends DataGridRow>
Internal event dispatched when an async sort operation completes.
SortDelegate<T extends DataGridRow>
Abstract delegate for handling sort operations.
SortEvent
Applies or changes the sort on a column.
SortResult
Result of a sort operation.
SortState
Current sort configuration.
ToggleGroupExpansionEvent
Toggles the expanded/collapsed state of a row group.
UngroupColumnEvent
Removes grouping for the specified column.
UpdateCellEvent
Updates a single cell value on an existing row.
UpdateRowEvent
Replaces an entire row with a new instance.

Enums

DataGridAspect
Aspects of grid state that widgets can selectively depend on.
DataGridRendererType
Rendering strategy used for the grid body.

Extensions

ColumnFilterPatterns on ColumnFilter
Adds pattern-matching-related methods to ColumnFilter.
DataGridContext on BuildContext
DataGridStatePatterns on DataGridState<T>
Adds pattern-matching-related methods to DataGridState.
EditStatePatterns on EditState
Adds pattern-matching-related methods to EditState.
FilterStatePatterns on FilterState
Adds pattern-matching-related methods to FilterState.
GroupStatePatterns on GroupState
Adds pattern-matching-related methods to GroupState.
PaginationStatePatterns on PaginationState
Adds pattern-matching-related methods to PaginationState.
SelectionStatePatterns on SelectionState
Adds pattern-matching-related methods to SelectionState.
SortColumnPatterns on SortColumn
Adds pattern-matching-related methods to SortColumn.
SortStatePatterns on SortState
Adds pattern-matching-related methods to SortState.

Constants

kSelectionColumnId → const int
Column ID used for the selection checkbox column. Uses a very negative value to avoid conflicts with user-defined column IDs.
kSelectionColumnWidth → const double
Default width for the selection checkbox column.

Typedefs

CellEditorBuilder = Widget Function(BuildContext context, dynamic value, ValueChanged onChanged)
Builder function for custom cell editor widgets.
CellFormatter<T extends DataGridRow> = String Function(T row, DataGridColumn<DataGridRow> column)
Formatter function to convert cell values to display strings.