Skip to content
On this page

DataTable

A configurable table for structured data and asynchronous loading.

DataTable in FluttyUIDataTable in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

DataTable

const DataTable({
  super.key,
  required this.columns,
  this.size,
  required this.rows,
  this.title,
  this.itemCount,
  this.toolbar,
  this.search,
  this.footer,
  this.selectedRows = const {},
  this.onSelectionChanged,
  this.hasMore = false,
  this.isLoadingMore = false,
  this.onLoadMore,
  this.onLoadMoreError,
  this.loadMoreErrorBuilder,
  this.loadMoreThreshold = 180,
  this.showSelection = true,
  this.headerHeight,
  this.rowHeight,
  this.bodyMaxHeight = 400,
  this.backgroundColor,
  this.headerColor,
  this.rowColor,
  this.dividerColor,
  this.borderRadius,
  this.bodyBorderRadius,
  this.bodyInset,
});
ParameterTypeRequiredDefault
keyKey?Nonull
columnsList<DataTableColumn<T>>Yes—
sizeComponentSize?Nonull
rowsList<T>Yes—
titleString?Nonull
itemCountint?Nonull
toolbarList<Widget>?Nonull
searchWidget?Nonull
footerWidget?Nonull
selectedRowsSet<T>Noconst {}
onSelectionChangedValueChanged<Set<T>>?Nonull
hasMoreboolNofalse
isLoadingMoreboolNofalse
onLoadMoreFutureOr<void> Function()?Nonull
onLoadMoreErrorvoid Function(Object error, StackTrace stackTrace)?Nonull
loadMoreErrorBuilderWidget Function(BuildContext context, Object error, VoidCallback retry)?Nonull
loadMoreThresholddoubleNo180
showSelectionboolNotrue
headerHeightdouble?Nonull
rowHeightdouble?Nonull
bodyMaxHeightdoubleNo400
backgroundColorColor?Nonull
headerColorColor?Nonull
rowColorColor?Nonull
dividerColorColor?Nonull
borderRadiusdouble?Nonull
bodyBorderRadiusdouble?Nonull
bodyInsetdouble?Nonull

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/data_display/table/table.dart

This reference is generated from the DataTable declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI