PaginatedDataTable2 constructor

PaginatedDataTable2({
  1. Key? key,
  2. Widget? header,
  3. List<Widget>? actions,
  4. required List<DataColumn> columns,
  5. int? sortColumnIndex,
  6. bool sortAscending = true,
  7. Duration sortArrowAnimationDuration = const Duration(milliseconds: 150),
  8. IconData sortArrowIcon = Icons.arrow_upward,
  9. ValueSetter<bool?>? onSelectAll,
  10. double dataRowHeight = kMinInteractiveDimension,
  11. double headingRowHeight = 56.0,
  12. MaterialStateProperty<Color?>? headingRowColor,
  13. double horizontalMargin = 24.0,
  14. double columnSpacing = 56.0,
  15. double? dividerThickness,
  16. bool renderEmptyRowsInTheEnd = true,
  17. int fixedLeftColumns = 0,
  18. int fixedTopRows = 1,
  19. Color? fixedColumnsColor,
  20. Color? fixedCornerColor,
  21. bool showCheckboxColumn = true,
  22. bool showFirstLastButtons = false,
  23. int? initialFirstRowIndex = 0,
  24. ValueChanged<int>? onPageChanged,
  25. int rowsPerPage = defaultRowsPerPage,
  26. List<int> availableRowsPerPage = const <int>[defaultRowsPerPage, defaultRowsPerPage * 2, defaultRowsPerPage * 5, defaultRowsPerPage * 10],
  27. ValueChanged<int?>? onRowsPerPageChanged,
  28. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  29. required DataTableSource source,
  30. double? checkboxHorizontalMargin,
  31. bool wrapInCard = true,
  32. double? minWidth,
  33. FlexFit fit = FlexFit.tight,
  34. bool hidePaginator = false,
  35. PaginatorController? controller,
  36. ScrollController? scrollController,
  37. ScrollController? horizontalScrollController,
  38. Widget? empty,
  39. TableBorder? border,
  40. bool autoRowsToHeight = false,
  41. double smRatio = 0.67,
  42. double lmRatio = 1.2,
})

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.onSelectAll,
  this.dataRowHeight = kMinInteractiveDimension,
  this.headingRowHeight = 56.0,
  this.headingRowColor,
  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.wrapInCard = true,
  this.minWidth,
  this.fit = FlexFit.tight,
  this.hidePaginator = false,
  this.controller,
  this.scrollController,
  this.horizontalScrollController,
  this.empty,
  this.border,
  this.autoRowsToHeight = false,
  this.smRatio = 0.67,
  this.lmRatio = 1.2,
})  : 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;
      }());