PaginatedDataTable2 constructor
PaginatedDataTable2({
- Key? key,
- Widget? header,
- List<
Widget> ? actions, - required List<
DataColumn> columns, - int? sortColumnIndex,
- bool sortAscending = true,
- Duration sortArrowAnimationDuration = const Duration(milliseconds: 150),
- IconData sortArrowIcon = Icons.arrow_upward,
- Widget sortArrowBuilder()?,
- bool sortArrowAlwaysVisible = false,
- ValueSetter<
bool?> ? onSelectAll, - TextStyle? dataTextStyle,
- double dataRowHeight = kMinInteractiveDimension,
- CheckboxThemeData? datarowCheckboxTheme,
- TextStyle? headingTextStyle,
- double headingRowHeight = 56.0,
- MaterialStateProperty<
Color?> ? headingRowColor, - CheckboxThemeData? headingCheckboxTheme,
- double horizontalMargin = 24.0,
- double columnSpacing = 56.0,
- double? dividerThickness,
- bool renderEmptyRowsInTheEnd = true,
- int fixedLeftColumns = 0,
- int fixedTopRows = 1,
- Color? fixedColumnsColor,
- Color? fixedCornerColor,
- bool showCheckboxColumn = true,
- bool showFirstLastButtons = false,
- int? initialFirstRowIndex = 0,
- ValueChanged<
int> ? onPageChanged, - int rowsPerPage = defaultRowsPerPage,
- List<
int> availableRowsPerPage = const <int>[defaultRowsPerPage, defaultRowsPerPage * 2, defaultRowsPerPage * 5, defaultRowsPerPage * 10], - ValueChanged<
int?> ? onRowsPerPageChanged, - DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- required DataTableSource source,
- double? checkboxHorizontalMargin,
- Alignment checkboxAlignment = Alignment.center,
- bool wrapInCard = true,
- double? minWidth,
- FlexFit fit = FlexFit.tight,
- bool hidePaginator = false,
- PaginatorController? controller,
- ScrollController? scrollController,
- ScrollController? horizontalScrollController,
- bool? isHorizontalScrollBarVisible = false,
- bool? isLoadingBarShown = false,
- Widget? empty,
- TableBorder? border,
- bool autoRowsToHeight = false,
- double smRatio = 0.67,
- double lmRatio = 1.2,
- BoxDecoration? headingRowDecoration,
Check out PaginatedDataTable for the API decription.
Key differences are minWidth
and fit
properties.
Implementation
PaginatedDataTable2({
super.key,
this.header,
this.actions,
required this.columns,
this.sortColumnIndex,
this.sortAscending = true,
this.sortArrowAnimationDuration = const Duration(milliseconds: 150),
this.sortArrowIcon = Icons.arrow_upward,
this.sortArrowBuilder,
this.sortArrowAlwaysVisible = false,
this.onSelectAll,
this.dataTextStyle,
this.dataRowHeight = kMinInteractiveDimension,
this.datarowCheckboxTheme,
this.headingTextStyle,
this.headingRowHeight = 56.0,
this.headingRowColor,
this.headingCheckboxTheme,
this.horizontalMargin = 24.0,
this.columnSpacing = 56.0,
this.dividerThickness,
this.renderEmptyRowsInTheEnd = true,
this.fixedLeftColumns = 0,
this.fixedTopRows = 1,
this.fixedColumnsColor,
this.fixedCornerColor,
this.showCheckboxColumn = true,
this.showFirstLastButtons = false,
this.initialFirstRowIndex = 0,
this.onPageChanged,
this.rowsPerPage = defaultRowsPerPage,
this.availableRowsPerPage = const <int>[
defaultRowsPerPage,
defaultRowsPerPage * 2,
defaultRowsPerPage * 5,
defaultRowsPerPage * 10
],
this.onRowsPerPageChanged,
this.dragStartBehavior = DragStartBehavior.start,
required this.source,
this.checkboxHorizontalMargin,
this.checkboxAlignment = Alignment.center,
this.wrapInCard = true,
this.minWidth,
this.fit = FlexFit.tight,
this.hidePaginator = false,
this.controller,
this.scrollController,
this.horizontalScrollController,
this.isHorizontalScrollBarVisible = false,
this.isLoadingBarShown = false,
this.empty,
this.border,
this.autoRowsToHeight = false,
this.smRatio = 0.67,
this.lmRatio = 1.2,
this.headingRowDecoration,
}) : assert(actions == null || (header != null)),
assert(columns.isNotEmpty),
assert(sortColumnIndex == null ||
(sortColumnIndex >= 0 && sortColumnIndex < columns.length)),
assert(rowsPerPage > 0),
assert(() {
if (onRowsPerPageChanged != null && autoRowsToHeight == false) {
assert(availableRowsPerPage.contains(rowsPerPage));
}
return true;
}());